幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1413|回复: 3

嘎嘎!叮当要的就是这个!

[复制链接]

845

主题

1万

帖子

214748万

积分

版主

脑残中……

Rank: 7Rank: 7Rank: 7

积分
2147483647

声命组金赏

发表于 2006-9-12 17:08:31 | 显示全部楼层 |阅读模式
  1. # 連撃 Ver 1.03
  2. # 配布元・サポートURL
  3. # [url]http://members.jcom.home.ne.jp/cogwheel/[/url]
  4. #==============================================================================
  5. # ■ Scene_Battle (分割定義 4)
  6. #------------------------------------------------------------------------------
  7. #  バトル画面の処理を行うクラスです。
  8. #==============================================================================
  9. # アニメに強さ0のフラッシュが存在した場合、
  10. # 赤:倍率 緑:+スキル・アイテムID でダメージ計算を行う。
  11. class Scene_Battle
  12.   #--------------------------------------------------------------------------
  13.   # ● ATB基礎セットアップ
  14.   #--------------------------------------------------------------------------
  15.   alias :atb_setup_straight :atb_setup
  16.   def atb_setup
  17.     atb_setup_straight
  18.     for battler in $game_party.actors + $game_troop.enemies
  19.       battler.total_damage = {}
  20.     end
  21.   end
  22.   #--------------------------------------------------------------------------
  23.   # ● アクション更新 (メインフェーズ)
  24.   #--------------------------------------------------------------------------
  25.   def action_phase(battler)
  26.     while true
  27.       # action が 1 の場合、バトラーが行動中かどうか確認
  28.       if @action == 1 and battler.phase < 3
  29.         for target in battler.target
  30.           speller = synthe?(target)
  31.           if speller == nil
  32.             # ターゲットが通常行動中の場合
  33.             if @action_battlers.include?(target)
  34.               if target.phase > 2
  35.                 return
  36.               end
  37.             end
  38.           else
  39.             # ターゲットが連携スキル発動中の場合
  40.             for spell in speller
  41.               if @action_battlers.include?(spell)
  42.                 if spell.phase > 2
  43.                   return
  44.                 end
  45.               end
  46.             end
  47.           end
  48.         end
  49.       end
  50.       case battler.phase
  51.       when 1
  52.         update_phase4_step1(battler)
  53.       when 2
  54.         update_phase4_step2(battler)
  55.       when 3
  56.         update_phase4_step3(battler)
  57.       when 4
  58.         update_phase4_step4(battler)
  59.       when 5
  60.         update_phase4_step5(battler)
  61.       when 6
  62.         update_phase4_step6(battler)
  63.       end
  64.       # ウェイトが入った場合
  65.       if battler.wait > 0
  66.         # ウェイトカウントを減らして終了
  67.         battler.wait -= 1
  68.         break
  69.       end
  70.       # 行動終了した場合ループを抜ける
  71.       unless @action_battlers.include?(battler)
  72.         break
  73.       end
  74.     end
  75.   end
  76.   #--------------------------------------------------------------------------
  77.   # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
  78.   #--------------------------------------------------------------------------
  79.   def update_phase4_step1(battler)
  80.     # すでに戦闘から外されている場合
  81.     if battler.index == nil
  82.       @action_battlers.delete(battler)
  83.       anime_wait_return
  84.       battler.wait = 1
  85.       return
  86.     end
  87.     speller = synthe?(battler)
  88.     if speller == nil
  89.       # ダメージ食らい中の場合
  90.       unless battler.damage.empty? or @action > 2
  91.         battler.wait = 1
  92.         return
  93.       end
  94.       # 行動可能かどうか判定
  95.       unless battler.movable?
  96.         battler.phase = 6
  97.         return
  98.       end
  99.     else
  100.       # ダメージ食らい中の場合
  101.       for spell in speller
  102.         unless spell.damage.empty? or @action > 2
  103.           battler.wait = 1
  104.           return
  105.         end
  106.         # 行動可能かどうか判定
  107.         unless spell.movable?
  108.           battler.phase = 6
  109.           return
  110.         end
  111.       end
  112.     end
  113.     # スキル使用時、詠唱時間設定
  114.     # 強制アクションかつ @force が 2 の時はスキルを即時発動
  115.     if battler.current_action.kind == 1 and
  116.       (not battler.current_action.forcing or @force != 2)
  117.       if battler.rtp == 0
  118.         # スキル詠唱中ならば、解除
  119.         skill_reset(battler)
  120.         # スキル詠唱時間設定
  121.         recite_time(battler)
  122.         # 連携技設定
  123.         synthe_spell(battler)
  124.         # スキルを詠唱する場合
  125.         if battler.rtp > 0
  126.           # 強制アクションかつ @force が 1 の時は連携スキルのみ即時発動
  127.           speller = synthe?(battler)
  128.           if battler.current_action.forcing and @force > 0 and speller != nil
  129.             for spell in speller
  130.               spell.rt = spell.rtp
  131.             end
  132.           else
  133.             battler.blink = true
  134.             if battler.current_action.forcing
  135.               $game_temp.forcing_battler = nil
  136.               battler.current_action.forcing = false
  137.             end
  138.             @action_battlers.delete(battler)
  139.             return
  140.           end
  141.         end
  142.       end
  143.     end
  144.     # アクターの明滅エフェクト OFF
  145.     if battler != nil
  146.       battler.blink = false
  147.     end
  148.     speller = synthe?(battler)
  149.     if speller == nil
  150.       @spell_p.delete(battler)
  151.       @spell_e.delete(battler)
  152.     else
  153.       for spell in speller
  154.         spell.blink = false
  155.         @spell_p.delete(spell)
  156.         @spell_e.delete(spell)
  157.       end
  158.     end
  159.     # ステップ 2 に移行
  160.     battler.phase = 2
  161.   end
  162.   #--------------------------------------------------------------------------
  163.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  164.   #--------------------------------------------------------------------------
  165.   def update_phase4_step2(battler)
  166.     # 強制アクションでなければ
  167.     unless battler.current_action.forcing
  168.       # 制約が [敵を通常攻撃する] か [味方を通常攻撃する] の場合
  169.       if battler.restriction == 2 or battler.restriction == 3
  170.         # アクションに攻撃を設定
  171.         battler.current_action.kind = 0
  172.         battler.current_action.basic = 0
  173.       end
  174.     end
  175.     # アクションの種別より攻撃アニメーションを取得する
  176.     case battler.current_action.kind
  177.     when 0 # 基本
  178.       if battler.is_a?(Game_Actor)
  179.         base_id = battler.weapon_id
  180.       end
  181.       anime_id = battler.animation2_id
  182.       # 防御など特殊行動の場合は次のステップへ
  183.       unless make_basic_action_preparation(battler)
  184.         return
  185.       end
  186.       # 戦闘が終了した場合は行動をキャンセル
  187.       if fin?
  188.         battler.phase = 6
  189.         return
  190.       end
  191.     when 1 # スキル
  192.       base_id = battler.current_action.skill_id
  193.       anime_id = $data_skills[battler.current_action.skill_id].animation2_id
  194.       # スキルが使用できない場合は行動をキャンセル
  195.       unless make_skill_action_preparation(battler)
  196.         return
  197.       end
  198.       # 戦闘が終了した場合は行動をキャンセル
  199.       if fin? and $data_skills[anime_id].scope == 1..2
  200.         battler.phase = 6
  201.         return
  202.       end
  203.     when 2 # アイテム
  204.       base_id = battler.current_action.item_id
  205.       anime_id = $data_items[battler.current_action.item_id].animation2_id
  206.       # アイテムが使用できない場合は行動をキャンセル
  207.       unless make_item_action_preparation(battler)
  208.         return
  209.       end
  210.       # 戦闘が終了した場合は行動をキャンセル
  211.       if fin? and $data_items[anime_id].scope == 1..2
  212.         battler.phase = 6
  213.         return
  214.       end
  215.     end
  216.     # アニメーションを検索し、連撃性を変数serialに代入する
  217.     serial = []
  218.     frame = 0
  219.     if $data_animations[anime_id] != nil
  220.       for animation in $data_animations[anime_id].timings
  221.         color = animation.flash_color
  222.         # アニメーション・フラッシュの強さが0の場合
  223.         if color.alpha == 0
  224.           serial.push([color.red.to_i, color.green, animation.frame - frame])
  225.           frame = animation.frame
  226.         end
  227.       end
  228.       # 連撃性がない場合単発攻撃
  229.       if serial.empty?
  230.         serial = [[20, 100, $data_animations[anime_id].frame_max - 5]]
  231.       end
  232.     else
  233.       # アニメーションが存在しない場合
  234.       serial = [[20, 100, 0]]
  235.     end
  236.     # ハッシュ total_damage の作成
  237.     total_damage = {}
  238.     for target in battler.target
  239.       total_damage[target] = []
  240.     end
  241.     # 連撃回数分ダメージ計算を行う
  242.     for attack in serial
  243.       # アクションの種別で分岐
  244.       case battler.current_action.kind
  245.       when 0  # 基本
  246.         if battler.is_a?(Game_Actor)
  247.           # バトラーがアクターの場合、攻撃時に武器を変更する
  248.           battler.change_weapon(base_id + attack[1] - 100)
  249.         end
  250.         make_basic_action_result(battler)
  251.       when 1  # スキル
  252.         # 連携スキルのことを考え、スキルIDの変更は内部処理で行う
  253.         make_skill_action_result(battler, attack[1] - 100)
  254.       when 2  # アイテム
  255.         # アイテムIDを設定分変化させる
  256.         battler.current_action.item_id = base_id + attack[1] - 100
  257.         make_item_action_result(battler)
  258.       end
  259.       # total_damage へダメージを代入
  260.       for target in battler.target
  261.         # ダメージがある場合、ダメージをX/20倍する。
  262.         if target.damage[battler].is_a?(Numeric)
  263.           damage = target.damage[battler] * attack[0] / 20
  264.         else
  265.           damage = target.damage[battler]
  266.         end
  267.         # 回復HP量がある場合、回復HP量をX/20倍する。
  268.         if target.recover_hp[battler].is_a?(Numeric)
  269.           recover_hp = target.recover_hp[battler] * attack[0] / 20
  270.         end
  271.         # 回復SP量がある場合、回復SP量をX/20倍する。
  272.         if target.recover_sp[battler].is_a?(Numeric)
  273.           recover_sp = target.recover_sp[battler] * attack[0] / 20
  274.         end
  275.         critical = target.critical[battler]
  276.         # total_damage = [ダメージ, クリティカルフラグ, 回復HP量, 回復SP量,
  277.         #                 ステート変化, ステート回復, 待ちフレーム時間]
  278.         total_damage[target].push([damage, critical, recover_hp, recover_sp,
  279.           target.state_p[battler], target.state_m[battler], attack[2]])
  280.       end
  281.     end
  282.     # トータルダメージを、バトラーのインスタンスに代入
  283.     for target in battler.target
  284.       target.total_damage[battler] = total_damage[target]
  285.     end
  286.     # 武器・スキル・アイテムIDを通常に戻す
  287.     case battler.current_action.kind
  288.     when 0  # 基本
  289.       if battler.is_a?(Game_Actor)
  290.         battler.change_weapon(base_id)
  291.       end
  292.     when 1  # スキル
  293.       battler.current_action.skill_id = base_id
  294.     when 2  # アイテム
  295.       battler.current_action.item_id = base_id
  296.     end
  297.     if battler.phase == 2
  298.       # ステップ 3 に移行
  299.       battler.phase = 3
  300.     end
  301.   end
  302.   #--------------------------------------------------------------------------
  303.   # ● 基本アクション 準備
  304.   #--------------------------------------------------------------------------
  305.   def make_basic_action_preparation(battler)
  306.     # 攻撃の場合
  307.     if battler.current_action.basic == 0
  308.       # アニメーション ID を設定
  309.       battler.anime1 = battler.animation1_id
  310.       battler.anime2 = battler.animation2_id
  311.       # 行動側バトラーがエネミーの場合
  312.       if battler.is_a?(Game_Enemy)
  313.         if battler.restriction == 3
  314.           target = $game_troop.random_target_enemy
  315.         elsif battler.restriction == 2
  316.           target = $game_party.random_target_actor
  317.         else
  318.           index = battler.current_action.target_index
  319.           target = $game_party.smooth_target_actor(index)
  320.         end
  321.       end
  322.       # 行動側バトラーがアクターの場合
  323.       if battler.is_a?(Game_Actor)
  324.         if battler.restriction == 3
  325.           target = $game_party.random_target_actor
  326.         elsif battler.restriction == 2
  327.           target = $game_troop.random_target_enemy
  328.         else
  329.           index = battler.current_action.target_index
  330.           target = $game_troop.smooth_target_enemy(index)
  331.         end
  332.       end
  333.       # 対象側バトラーの配列を設定
  334.       battler.target = [target]
  335.       return true
  336.     end
  337.     # 防御の場合
  338.     if battler.current_action.basic == 1
  339.       # ステップ 3 に移行
  340.       battler.phase = 3
  341.       return false
  342.     end
  343.     # 逃げるの場合
  344.     if battler.is_a?(Game_Enemy) and battler.current_action.basic == 2
  345.       # ステップ 3 に移行
  346.       battler.phase = 3
  347.       return false
  348.     end
  349.     # 何もしないの場合
  350.     if battler.current_action.basic == 3
  351.       # ステップ 6 に移行
  352.       battler.phase = 6
  353.       return false
  354.     end
  355.   end
  356.   #--------------------------------------------------------------------------
  357.   # ● スキルアクション 準備
  358.   #--------------------------------------------------------------------------
  359.   def make_skill_action_preparation(battler)
  360.     # スキルを取得
  361.     @skill = $data_skills[battler.current_action.skill_id]
  362.     # 連携スキルであるかどうか確認
  363.     speller = synthe?(battler)
  364.     # 強制アクションでなければ
  365.     unless battler.current_action.forcing
  366.       # SP 切れなどで使用できなくなった場合
  367.       if speller == nil
  368.         unless battler.skill_can_use?(@skill.id)
  369.           # ステップ 6 に移行
  370.           battler.phase = 6
  371.          return false
  372.         end
  373.       end
  374.     end
  375.     # SP 消費
  376.     temp = false
  377.     if speller != nil
  378.       for spell in speller
  379.         if spell.current_action.spell_id == 0
  380.           spell.sp -= @skill.sp_cost
  381.         else
  382.           spell.sp -= $data_skills[spell.current_action.spell_id].sp_cost
  383.         end
  384.         # ステータスウィンドウをリフレッシュ
  385.         status_refresh(spell)
  386.       end
  387.     else
  388.       battler.sp -= @skill.sp_cost
  389.       # ステータスウィンドウをリフレッシュ
  390.       status_refresh(battler)
  391.     end
  392.     # アニメーション ID を設定
  393.     battler.anime1 = @skill.animation1_id
  394.     battler.anime2 = @skill.animation2_id
  395.     # コモンイベント ID を設定
  396.     battler.event = @skill.common_event_id
  397.     # 対象側バトラーを設定
  398.     set_target_battlers(@skill.scope, battler)
  399.     return true
  400.   end
  401.   #--------------------------------------------------------------------------
  402.   # ● アイテムアクション 準備
  403.   #--------------------------------------------------------------------------
  404.   def make_item_action_preparation(battler)
  405.     # アイテムを取得
  406.     @item = $data_items[battler.current_action.item_id]
  407.     # アイテム切れなどで使用できなくなった場合
  408.     unless $game_party.item_can_use?(@item.id)
  409.       # ステップ 6 に移行
  410.       battler.phase = 6
  411.       return false
  412.     end
  413.     # 消耗品の場合
  414.     if @item.consumable
  415.       # 使用したアイテムを 1 減らす
  416.       $game_party.lose_item(@item.id, 1)
  417.     end
  418.     # アニメーション ID を設定
  419.     battler.anime1 = @item.animation1_id
  420.     battler.anime2 = @item.animation2_id
  421.     # コモンイベント ID を設定
  422.     battler.event = @item.common_event_id
  423.     # 対象を決定
  424.     index = battler.current_action.target_index
  425.     target = $game_party.smooth_target_actor(index)
  426.     # 対象側バトラーを設定
  427.     set_target_battlers(@item.scope, battler)
  428.     return true
  429.   end
  430.   #--------------------------------------------------------------------------
  431.   # ● 基本アクション 結果作成
  432.   #--------------------------------------------------------------------------
  433.   def make_basic_action_result(battler)
  434.     # 通常攻撃の効果を適用
  435.     for target in battler.target
  436.       target.attack_effect(battler)
  437.     end
  438.   end
  439.   #--------------------------------------------------------------------------
  440.   # ● スキルアクション 結果作成
  441.   #--------------------------------------------------------------------------
  442.   def make_skill_action_result(battler, plus_id)
  443.     # スキルを取得
  444.     @skill = $data_skills[battler.current_action.skill_id + plus_id]
  445.     # 連携スキルであるかどうか確認
  446.     speller = synthe?(battler)
  447.     # スキルの効果を適用
  448.     for target in battler.target
  449.       if speller != nil
  450.         damage = 0
  451.         effective = false
  452.         state_p = []
  453.         state_m = []
  454.         d_result = false
  455.         for spell in speller
  456.           if spell.current_action.spell_id != 0
  457.             @skill = $data_skills[spell.current_action.spell_id + plus_id]
  458.           end
  459.           effective |= target.skill_effect(spell, @skill)
  460.           if target.damage[spell].class != String
  461.             d_result = true
  462.             damage += target.damage[spell]
  463.           elsif effective
  464.             effect = target.damage[spell]
  465.           end
  466.           state_p += target.state_p[spell]
  467.           state_m += target.state_m[spell]
  468.           target.damage.delete(spell)
  469.           target.state_p.delete(spell)
  470.           target.state_m.delete(spell)
  471.         end
  472.         if d_result
  473.           target.damage[battler] = damage
  474.         elsif effective
  475.           target.damage[battler] = effect
  476.         end
  477.         target.state_p[battler] = state_p
  478.         target.state_m[battler] = state_m
  479.       else
  480.         target.skill_effect(battler, @skill)
  481.       end
  482.     end
  483.   end
  484.   #--------------------------------------------------------------------------
  485.   # ● アイテムアクション 結果作成
  486.   #--------------------------------------------------------------------------
  487.   def make_item_action_result(battler)
  488.     # アイテムを取得
  489.     @item = $data_items[battler.current_action.item_id]
  490.     # アイテムの効果を適用
  491.     for target in battler.target
  492.       target.item_effect(@item, battler)
  493.     end
  494.   end
  495.   #--------------------------------------------------------------------------
  496.   # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
  497.   #--------------------------------------------------------------------------
  498.   def update_phase4_step4(battler)
  499.     # カメラ設定
  500.     if battler.target[0].is_a?(Game_Enemy) and battler.anime1 != 0
  501.       camera_set(battler)
  502.     end
  503.     # 対象側アニメーション
  504.     for target in battler.target
  505.       target.animation.push([battler.anime2,
  506.                                           (target.damage[battler] != "Miss")])
  507.       unless battler.anime2 == 0
  508.         battler.wait = 2 * target.total_damage[battler][0][6] - 1 +
  509.           Graphics.frame_count % 2
  510.       end
  511.     end
  512.     # ステップ 5 に移行
  513.     battler.phase = 5
  514.   end
  515.   #--------------------------------------------------------------------------
  516.   # ● フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)
  517.   #--------------------------------------------------------------------------
  518.   def update_phase4_step5(battler)
  519.     next_step = true
  520.     # ダメージ表示
  521.     for target in battler.target
  522.       # total_damage より全ダメージを算出
  523.       total_damage = target.total_damage[battler].shift
  524.       target.damage[battler] = total_damage[0]
  525.       target.critical[battler] = total_damage[1]
  526.       target.recover_hp[battler] = total_damage[2]
  527.       target.recover_sp[battler] = total_damage[3]
  528.       target.state_p[battler] = total_damage[4]
  529.       target.state_m[battler] = total_damage[5]
  530.       # ダメージ表示フラグをON
  531.       target.damage_pop[battler] = true
  532.       # 実際にダメージを与える
  533.       target.damage_effect(battler, battler.current_action.kind)
  534.       # 余計なハッシュを削除
  535.       target.recover_hp.delete(battler)
  536.       target.recover_sp.delete(battler)
  537.       target.state_p.delete(battler)
  538.       target.state_m.delete(battler)
  539.       # ダメージを全て与えきった場合
  540.       if target.total_damage[battler].empty?
  541.         # ターゲットへの全ダメージを削除
  542.         target.total_damage.delete(battler)
  543.         # 指定時間ウェイトする
  544.         battler.wait = @damage_wait
  545.       else
  546.         # 指定時間ウェイトする
  547.         next_step = false
  548.         battler.wait = 2 * target.total_damage[battler][0][6]
  549.       end
  550.       # ステータスウィンドウをリフレッシュ
  551.       status_refresh(target)
  552.     end
  553.     if next_step
  554.       # ステップ 6 に移行
  555.       battler.phase = 6
  556.     end
  557.   end
  558.   #--------------------------------------------------------------------------
  559.   # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  560.   #--------------------------------------------------------------------------
  561.   def update_phase4_step6(battler)
  562.     # カメラを戻す
  563.     if battler.target[0].is_a?(Game_Enemy) and @camera == battler
  564.       @spriteset.screen_target(0, 0, 1)
  565.     end
  566.     # スキルラーニング
  567.     if battler.target[0].is_a?(Game_Actor) and battler.current_action.kind == 1
  568.       for target in battler.target
  569.         skill_learning(target, target.class_id,
  570.                         battler.current_action.skill_id)
  571.       end
  572.     end
  573.     # アクション強制対象のバトラーをクリア
  574.     if battler.current_action.forcing == true and
  575.         battler.current_action.force_kind == 0 and
  576.         battler.current_action.force_basic == 0 and
  577.         battler.current_action.force_skill_id == 0
  578.       $game_temp.forcing_battler = nil
  579.       battler.current_action.forcing = false
  580.     end
  581.     refresh_phase(battler)
  582.     speller = synthe?(battler)
  583.     if speller != nil
  584.       for spell in speller
  585.         if spell != battler
  586.           refresh_phase(spell)
  587.         end
  588.       end
  589.       synthe_delete(speller)
  590.     end
  591.     # コモンイベント ID が有効の場合
  592.     if battler.event > 0
  593.       # イベントをセットアップ
  594.       common_event = $data_common_events[battler.event]
  595.       $game_system.battle_interpreter.setup(common_event.list, 0)
  596.     end
  597.     act = 0
  598.     for actor in $game_party.actors + $game_troop.enemies
  599.       if actor.movable?
  600.         act += 1
  601.       end
  602.     end
  603.     if @turn_cnt >= act and act > 0
  604.       @turn_cnt %= act
  605.       $game_temp.battle_turn += 1
  606.       # バトルイベントの全ページを検索
  607.       for index in 0...$data_troops[@troop_id].pages.size
  608.         # イベントページを取得
  609.         page = $data_troops[@troop_id].pages[index]
  610.         # このページのスパンが [ターン] の場合
  611.         if page.span == 1
  612.           # 実行済みフラグをクリア
  613.           $game_temp.battle_event_flags[index] = false
  614.         end
  615.       end
  616.     end
  617.     battler.phase = 1
  618.     @action_battlers.delete(battler)
  619.   end
  620. end
  621. #==============================================================================
  622. # ■ Game_Battler (分割定義 1)
  623. #------------------------------------------------------------------------------
  624. #  バトラーを扱うクラスです。このクラスは Game_Actor クラスと Game_Enemy クラ
  625. # スのスーパークラスとして使用されます。
  626. #==============================================================================
  627. class Game_Battler
  628.   #--------------------------------------------------------------------------
  629.   # ● 公開インスタンス変数追加
  630.   #--------------------------------------------------------------------------
  631.   attr_accessor :total_damage              # 総ダメージ
  632.   #--------------------------------------------------------------------------
  633.   # ● オブジェクト初期化
  634.   #--------------------------------------------------------------------------
  635.   alias :initialize_straight :initialize
  636.   def initialize
  637.     initialize_straight
  638.     @total_damage = {}
  639.   end
  640.   #--------------------------------------------------------------------------
  641.   # ● 存在判定
  642.   #--------------------------------------------------------------------------
  643.   def exist?
  644.     return (not @hidden and (@hp > 0 or @immortal or not @total_damage.empty?))
  645.   end
  646.   #--------------------------------------------------------------------------
  647.   # ● 残HP予測
  648.   #--------------------------------------------------------------------------
  649.   def rest_hp
  650.     # rest_hp に現HPを代入
  651.     rest_hp = @hp
  652.     # バトラーが受ける全ダメージをrest_hpに反映させる
  653.     for total in @total_damage
  654.       for pre_damage in total[1]
  655.         if pre_damage[0].is_a?(Numeric)
  656.           rest_hp -= pre_damage[0]
  657.         end
  658.         if pre_damage[2].is_a?(Numeric)
  659.           rest_hp += pre_damage[2]
  660.         end
  661.       end
  662.     end
  663.     return rest_hp
  664.   end
  665. end
  666. #==============================================================================
  667. # ■ Game_Actor
  668. #------------------------------------------------------------------------------
  669. #  アクターを扱うクラスです。このクラスは Game_Actors クラス ($game_actors)
  670. # の内部で使用され、Game_Party クラス ($game_party) からも参照されます。
  671. #==============================================================================
  672. class Game_Actor < Game_Battler
  673.   #--------------------------------------------------------------------------
  674.   # ● 公開インスタンス変数
  675.   #--------------------------------------------------------------------------
  676.   def change_weapon(id)
  677.     @weapon_id = id
  678.   end
  679. end
  680. #==============================================================================
  681. # ■ Sprite_Battler
  682. #------------------------------------------------------------------------------
  683. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  684. # スプライトの状態を自動的に変化させます。
  685. #==============================================================================
  686. class Sprite_Battler < RPG::Sprite
  687.   #--------------------------------------------------------------------------
  688.   # ● フレーム更新
  689.   #--------------------------------------------------------------------------
  690.   def update
  691.     super
  692.     # バトラーが nil の場合
  693.     if @battler == nil
  694.       self.bitmap = nil
  695.       loop_animation(nil)
  696.       return
  697.     end
  698.     # ファイル名か色相が現在のものと異なる場合
  699.     if @battler.battler_name != @battler_name or
  700.        @battler.battler_hue != @battler_hue
  701.       # ビットマップを取得、設定
  702.       @battler_name = @battler.battler_name
  703.       @battler_hue = @battler.battler_hue
  704.       self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  705.       @width = bitmap.width
  706.       @height = bitmap.height
  707.       self.ox = @width / 2
  708.       self.oy = @height
  709.       if @battler.is_a?(Game_Enemy)
  710.         @battler.height = @height
  711.       end
  712.       # 戦闘不能または隠れ状態なら不透明度を 0 にする
  713.       if @battler.dead? or @battler.hidden
  714.         self.opacity = 0
  715.       end
  716.     end
  717.     # アニメーション ID が現在のものと異なる場合
  718.     if @battler.state_animation_id != @state_animation_id
  719.       @state_animation_id = @battler.state_animation_id
  720.       loop_animation($data_animations[@state_animation_id])
  721.     end
  722.     # 表示されるべきアクターの場合
  723.     if @battler.is_a?(Game_Actor) and @battler_visible
  724.       # メインフェーズでないときは不透明度をやや下げる
  725.       if $game_temp.battle_main_phase
  726.         self.opacity += 3 if self.opacity < 255
  727.       else
  728.         self.opacity -= 3 if self.opacity > 207
  729.       end
  730.     end
  731.     # 明滅
  732.     if @battler.blink
  733.       blink_on
  734.     else
  735.       blink_off
  736.     end
  737.     # 不可視の場合
  738.     unless @battler_visible
  739.       # 出現
  740.       if not @battler.hidden and not @battler.dead? and
  741.          (@battler.damage.size < 2 or @battler.damage_pop.size < 2)
  742.         appear
  743.         @battler_visible = true
  744.       end
  745.     end
  746.     # ダメージ
  747.     for battler in @battler.damage_pop
  748.       if battler[0].class == Array
  749.         if battler[0][1] >= 0
  750.           $scene.skill_se
  751.         else
  752.           $scene.levelup_se
  753.         end
  754.         damage(@battler.damage[battler[0]], false, 2)
  755.       else
  756.         damage(@battler.damage[battler[0]], @battler.critical[battler[0]])
  757.       end
  758.       if @battler.damage_sp.include?(battler[0])
  759.         damage(@battler.damage_sp[battler[0]],
  760.                 @battler.critical[battler[0]], 1)
  761.         @battler.damage_sp.delete(battler[0])
  762.       end
  763.       @battler.damage_pop.delete(battler[0])
  764.       @battler.damage.delete(battler[0])
  765.       @battler.critical.delete(battler[0])
  766.     end
  767.     # 可視の場合
  768.     if @battler_visible
  769.       # 逃走
  770.       if @battler.hidden
  771.         $game_system.se_play($data_system.escape_se)
  772.         escape
  773.         @battler_visible = false
  774.       end
  775.       # 白フラッシュ
  776.       if @battler.white_flash
  777.         whiten
  778.         @battler.white_flash = false
  779.       end
  780.       # アニメーション
  781.       unless @battler.animation.empty?
  782.         for animation in @battler.animation.reverse
  783.           animation($data_animations[animation[0]], animation[1])
  784.           @battler.animation.delete(animation)
  785.         end
  786.       end
  787.       # コラプス
  788.       if @battler.total_damage.empty? and @battler.dead?
  789.         if $scene.dead_ok?(@battler)
  790.           if @battler.is_a?(Game_Enemy)
  791.             $game_system.se_play($data_system.enemy_collapse_se)
  792.           else
  793.             $game_system.se_play($data_system.actor_collapse_se)
  794.           end
  795.           collapse
  796.           @battler_visible = false
  797.         end
  798.       end
  799.     end
  800.     # スプライトの座標を設定
  801.     self.x = @battler.screen_x
  802.     self.y = @battler.screen_y
  803.     self.z = @battler.screen_z
  804.     if @battler.is_a?(Game_Enemy)
  805.       self.zoom_x = @battler.real_zoom * @battler.zoom
  806.       self.zoom_y = @battler.real_zoom * @battler.zoom
  807.     end
  808.   end
  809. end
复制代码

这个站点应该允许转载,所以就直接贴上来了.

http://icv.cc声动音缘配音社
回复

使用道具 举报

845

主题

1万

帖子

214748万

积分

版主

脑残中……

Rank: 7Rank: 7Rank: 7

积分
2147483647

声命组金赏

 楼主| 发表于 2006-9-12 18:08:46 | 显示全部楼层
发现不会用... [s:5] 必须跟那个BT战斗效果一起用...而且字体美化也不能用...呼叫冬瓜啊~~~ [s:6]
http://icv.cc声动音缘配音社
回复 支持 反对

使用道具 举报

3

主题

232

帖子

583

积分

⑤进阶

哇咔咔~传说中的称号.

积分
583
发表于 2006-9-12 21:59:19 | 显示全部楼层
[s:5] 想要把这个连击效果跟RTAB分解出来很难的说.........
RTAB几千行啊..次次打开都要等几秒.................. [s:6]
回复 支持 反对

使用道具 举报

845

主题

1万

帖子

214748万

积分

版主

脑残中……

Rank: 7Rank: 7Rank: 7

积分
2147483647

声命组金赏

 楼主| 发表于 2006-9-12 22:27:20 | 显示全部楼层
哦? 原来还有机器比叮当还差的....心理平衡了.....

在这个上面直接动手脚不行吗? [s:4]
http://icv.cc声动音缘配音社
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2025-6-29 11:12 , Processed in 0.011856 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表