# # 一時的に能力値が上下するスキル(RGSS2) #  (C)2008,2011 TYPE74RX-T # # ★ カスタマイズポイント:15~17行目 #============================================================================== # ★ RX_T #------------------------------------------------------------------------------ #  素材用汎用モジュールです。 #============================================================================== module RX_T GainP = "%sの%sが %s 上がった!" ActorLossP = "%sの%sが %s 下がった!" EnemyLossP = "%sの%sを %s 下げた!" end #============================================================================== # ★ 再定義ポイント #------------------------------------------------------------------------------ # class Game_Battler # def atk # def def # def spi # def agi #============================================================================== #-------------------------------------------------------------------------- # ★ システムワードの登録:攻撃力変化・防御力変化・敏捷性変化・精神力変化 #-------------------------------------------------------------------------- module RPG class BaseItem alias rx_rgss2b9_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, "攻撃力変化", 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, "防御力変化", 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, "敏捷性変化", 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, "精神力変化", true) 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_rgss2b9_rx_extract_sys_str_from_note end end end #============================================================================== # ■ Game_Battler #------------------------------------------------------------------------------ #  バトラーを扱うクラスです。このクラスは Game_Actor クラスと Game_Enemy クラ # スのスーパークラスとして使用されます。 #============================================================================== class Game_Battler #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- alias rx_rgss2b9_initialize initialize def initialize # メソッドを呼び戻す rx_rgss2b9_initialize @rx_chg_atk = 0 @rx_chg_def = 0 @rx_chg_spi = 0 @rx_chg_agi = 0 @rx_chg_params = [0, 0, 0, 0] end #-------------------------------------------------------------------------- # ★ 変化する攻撃力 #-------------------------------------------------------------------------- def rx_chg_atk return @rx_chg_atk end #-------------------------------------------------------------------------- # ★ 変化する攻撃力の取得 #-------------------------------------------------------------------------- def rx_chg_atk=(n) n = [[Integer(n), -999].max, 999].min @rx_chg_atk = n end #-------------------------------------------------------------------------- # ★ 変化する防御力 #-------------------------------------------------------------------------- def rx_chg_def return @rx_chg_def end #-------------------------------------------------------------------------- # ★ 変化する防御力の取得 #-------------------------------------------------------------------------- def rx_chg_def=(n) n = [[Integer(n), -999].max, 999].min @rx_chg_def = n end #-------------------------------------------------------------------------- # ★ 変化する精神力 #-------------------------------------------------------------------------- def rx_chg_spi return @rx_chg_spi end #-------------------------------------------------------------------------- # ★ 変化する精神力の取得 #-------------------------------------------------------------------------- def rx_chg_spi=(n) n = [[Integer(n), -999].max, 999].min @rx_chg_spi = n end #-------------------------------------------------------------------------- # ★ 変化する敏捷性 #-------------------------------------------------------------------------- def rx_chg_agi return @rx_chg_agi end #-------------------------------------------------------------------------- # ★ 変化する敏捷性の取得 #-------------------------------------------------------------------------- def rx_chg_agi=(n) n = [[Integer(n), -999].max, 999].min @rx_chg_agi = n end #-------------------------------------------------------------------------- # ★ 変化する各パラメータ #-------------------------------------------------------------------------- def rx_chg_params return @rx_chg_params end #-------------------------------------------------------------------------- # ★ 変化する各パラメータの取得 #-------------------------------------------------------------------------- def rx_chg_params=(n) @rx_chg_params = n end #-------------------------------------------------------------------------- # ● 攻撃力の取得(再定義) #-------------------------------------------------------------------------- def atk n = [[base_atk + @atk_plus, 1].max, 999].min for state in states do n *= state.atk_rate / 100.0 end n += @rx_chg_atk # ★ 追加 n = [[Integer(n), 1].max, 999].min return n end #-------------------------------------------------------------------------- # ● 防御力の取得(再定義) #-------------------------------------------------------------------------- def def n = [[base_def + @def_plus, 1].max, 999].min for state in states do n *= state.def_rate / 100.0 end n += @rx_chg_def # ★ 追加 n = [[Integer(n), 1].max, 999].min return n end #-------------------------------------------------------------------------- # ● 精神力の取得(再定義) #-------------------------------------------------------------------------- def spi n = [[base_spi + @spi_plus, 1].max, 999].min for state in states do n *= state.spi_rate / 100.0 end n += @rx_chg_spi # ★ 追加 n = [[Integer(n), 1].max, 999].min return n end #-------------------------------------------------------------------------- # ● 敏捷性の取得(再定義) #-------------------------------------------------------------------------- def agi n = [[base_agi + @agi_plus, 1].max, 999].min for state in states do n *= state.agi_rate / 100.0 end n += @rx_chg_agi # ★ 追加 n = [[Integer(n), 1].max, 999].min return n end end #============================================================================== # ■ Scene_Battle #------------------------------------------------------------------------------ #  バトル画面の処理を行うクラスです。 #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● 戦闘終了 # result : 結果 (0:勝利 1:逃走 2:敗北) #-------------------------------------------------------------------------- alias rx_rgss2b9_battle_end battle_end def battle_end(result) # メソッドを呼び戻す rx_rgss2b9_battle_end(result) # ★ 増減したパラメータを元に戻す for actor in $game_party.members actor.rx_chg_atk = 0 actor.rx_chg_def = 0 actor.rx_chg_agi = 0 actor.rx_chg_spi = 0 actor.rx_chg_params = [0, 0, 0, 0] end end #-------------------------------------------------------------------------- # ★ 能力値増減表示 # target : 対象者 # obj : スキルまたはアイテム #-------------------------------------------------------------------------- def rx_display_param_change(target, param, pts, chgparam) # マイナス表示抹消用変数の初期化 rx_pts = 0 # パラメータの増減によって表示を変える if pts > 0 fmt = RX_T::GainP else fmt = target.actor? ? RX_T::ActorLossP : RX_T::EnemyLossP end # 能力値上昇制限表示 ups = 0 case chgparam when 0 ups = target.rx_chg_atk + pts when 1 ups = target.rx_chg_def + pts when 2 ups = target.rx_chg_agi + pts when 3 ups = target.rx_chg_spi + pts end pts = pts - (ups - 999) if pts > 0 and ups >= 999 pts = pts - (ups + 999) if pts < 0 and ups <= -999 # マイナス表示を消してメッセージ表示 rx_pts = pts * -1 if pts < 0 rx_pts = pts if rx_pts == 0 text = sprintf(fmt, target.name, param, rx_pts) # メッセージ表示補正 if @message_window.line_number > 1 @message_window.replace_instant_text(text) else @message_window.add_instant_text(text) end if @message_window.last_instant_text.empty? @message_window.back_one else wait(30) end # 能力値を変化 case chgparam when 0 target.rx_chg_atk += pts when 1 target.rx_chg_def += pts when 2 target.rx_chg_agi += pts when 3 target.rx_chg_spi += pts end end #-------------------------------------------------------------------------- # ● ダメージの表示 # target : 対象者 # obj : スキルまたはアイテム #-------------------------------------------------------------------------- alias rx_rgss2b9_display_damage display_damage def display_damage(target, obj = nil) # メソッドを呼び戻す rx_rgss2b9_display_damage(target, obj) # ★ パラメータ変化値を取得 target.rx_chg_params[0] = RX_T.get_numeric_of_system_word_in_sys_str(obj, "攻撃力変化") target.rx_chg_params[1] = RX_T.get_numeric_of_system_word_in_sys_str(obj, "防御力変化") target.rx_chg_params[2] = RX_T.get_numeric_of_system_word_in_sys_str(obj, "敏捷性変化") target.rx_chg_params[3] = RX_T.get_numeric_of_system_word_in_sys_str(obj, "精神力変化") rx_check = 0 # ★ エフェクトチェック用 rx_check += 1 if target.states_active? rx_check += 1 if target.mp_damage != 0 rx_check += 1 if target.hp_damage != 0 rx_check += 1 unless target.missed and target.evaded # ★ ダメージまたはステートの変化があれば(rx_checkが 1 以上) rx_vocabs = [Vocab.atk, Vocab.def, Vocab.agi, Vocab.spi] if rx_check > 0 # ★ 変化値が取得できたもののみ結果(能力値増減)を表示 for i in 0..3 if target.rx_chg_params[i] != 0 rx_display_param_change(target, rx_vocabs[i], target.rx_chg_params[i], i) end end end end end