# # 全体攻撃装備・バトルの格闘場化スクリプト対応版(RGSS2) #  (C)2007,2009 TYPE74RX-T # #-------------------------------------------------------------------------- # ★ システムワードの登録:全体攻撃、全体攻撃% #-------------------------------------------------------------------------- module RPG class BaseItem alias rx_rgss2bo20_rx_extract_sys_str_from_note rx_extract_sys_str_from_note def rx_extract_sys_str_from_note rx_get_sys = RX_T.get_system_word_in_note(@note, "RX-SYS") unless rx_get_sys == "" @@rx_copy_str += rx_get_sys @note = @note.sub(rx_get_sys, "") @note = @note.sub("\r\n", "") end rx_get_sys = RX_T.get_system_word_in_note(@note, "全体攻撃%", true) unless rx_get_sys == "" @@rx_copy_str += rx_get_sys @note = @note.sub(rx_get_sys, "") @note = @note.sub("\r\n", "") end rx_get_sys = RX_T.get_system_word_in_note(@note, "全体攻撃") unless rx_get_sys == "" @@rx_copy_str += rx_get_sys @note = @note.sub(rx_get_sys, "") @note = @note.sub("\r\n", "") end @rx_sys_str = @@rx_copy_str # メソッドを呼び戻す rx_rgss2bo20_rx_extract_sys_str_from_note end end end #============================================================================== # ■ Game_Battler #------------------------------------------------------------------------------ #  バトラーを扱うクラスです。このクラスは Game_Actor クラスと Game_Enemy クラ # スのスーパークラスとして使用されます。 #============================================================================== class Game_Battler #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :rx_attenuation_times # ダメージ減衰回数カウント(全体攻撃用) #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- alias rx_rgss2bo20_initialize initialize def initialize @rx_attenuation_times = 0 # メソッドを呼び戻す rx_rgss2bo20_initialize end #-------------------------------------------------------------------------- # ★ ダメージ減衰効果 #-------------------------------------------------------------------------- def rx_attenuation_effect(attacker, damage, attenuation) percent = 100 percent_rates = [100] # 減衰レート配列を作成 for i in 1..7 percent = percent * attenuation / 100 percent_rates [i] = percent end # ダメージ減衰処理 damage = damage * percent_rates [attacker.rx_attenuation_times] / 100 # ダメージ減衰回数をカウント attacker.rx_attenuation_times += 1 return damage end end #============================================================================== # ■ Game_BattleAction #------------------------------------------------------------------------------ #  戦闘行動を扱うクラスです。このクラスは Game_Battler クラスの内部で使用され # ます。 #============================================================================== class Game_BattleAction #-------------------------------------------------------------------------- # ● 通常攻撃のターゲット作成 #-------------------------------------------------------------------------- alias rx_rgss2bo20_make_attack_targets make_attack_targets def make_attack_targets targets = [] # ★ 行動者がアクターで、且つ装備用のシステムワードに「全体攻撃」が含まれていれば if battler.actor? and RX_T.check_system_word_in_equip(battler.rx_sys_str, "全体攻撃") # 全体攻撃化 if battler.confusion? targets = friends_unit.existing_members elsif battler.berserker? targets = opponents_unit.existing_members else targets = opponents_unit.existing_members end if battler.dual_attack # 連続攻撃 targets += targets end return targets.compact end # メソッドを呼び戻す rx_rgss2bo20_make_attack_targets end end #============================================================================== # ■ Scene_Battle #------------------------------------------------------------------------------ #  バトル画面の処理を行うクラスです。 #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● 対象敵キャラ選択の開始 #-------------------------------------------------------------------------- alias rx_rgss2bo20_start_target_enemy_selection start_target_enemy_selection def start_target_enemy_selection # ★ ギャンブルモードでなければ unless $game_temp.rx_gamble_mode # ★ 行動が通常攻撃で、武器を持っており # 装備用システムワードに「全体攻撃」が含まれていれば if @active_battler.rx_weapon_attack? and RX_T.check_system_word_in_equip(@active_battler.rx_sys_str, "全体攻撃") # 次のアクターへ next_actor return end end # メソッドを呼び戻す rx_rgss2bo20_start_target_enemy_selection end #-------------------------------------------------------------------------- # ● 戦闘行動の実行 #-------------------------------------------------------------------------- alias rx_rgss2bo20_execute_action execute_action def execute_action # ★ ダメージ減衰回数を初期化 @active_battler.rx_attenuation_times = 0 # メソッドを呼び戻す rx_rgss2bo20_execute_action end end