# # 無敵ステート(RGSS2) #  (C)2008 TYPE74RX-T # #-------------------------------------------------------------------------- # ★ システムワードの登録:無敵 #-------------------------------------------------------------------------- module RPG class State alias rx_rgss2b6_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, "無敵") 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_rgss2b6_rx_extract_sys_str_from_note end end end #============================================================================== # ■ Game_Battler #------------------------------------------------------------------------------ #  バトラーを扱うクラスです。このクラスは Game_Actor クラスと Game_Enemy クラ # スのスーパークラスとして使用されます。 #============================================================================== class Game_Battler #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- alias rx_rgss2b6_initialize initialize def initialize # メソッドを呼び戻す rx_rgss2b6_initialize @rx_invincible = false # ★ 無敵フラグ end #-------------------------------------------------------------------------- # ★ 無敵フラグ #-------------------------------------------------------------------------- def rx_invincible return @rx_invincible end #-------------------------------------------------------------------------- # ★ 無敵判定 #-------------------------------------------------------------------------- def rx_get_invincible @rx_invincible = false for state in states @rx_invincible = true if state.rx_sys_str.include?("無敵") end return @rx_invincible end #-------------------------------------------------------------------------- # ● 制約の取得 # 現在付加されているステートから最大の restriction を取得する。 #-------------------------------------------------------------------------- alias rx_rgss2b6_restriction restriction def restriction # ★ 無敵判定 rx_get_invincible # メソッドを呼び戻す rx_rgss2b6_restriction end #-------------------------------------------------------------------------- # ● ダメージの反映 # user : スキルかアイテムの使用者 # 呼び出し前に @hp_damage、@mp_damage、@absorbed が設定されていること。 #-------------------------------------------------------------------------- alias rx_rgss2b6_execute_damage execute_damage def execute_damage(user) # ★ 無敵状態(ダメージを受ける場合に限る)なら処理をスルー return if self.rx_invincible and (@hp_damage > 0 or @mp_damage > 0) # メソッドを呼び戻す rx_rgss2b6_execute_damage(user) end #-------------------------------------------------------------------------- # ● ステート変化の適用 # obj : スキル、アイテム、または攻撃者 #-------------------------------------------------------------------------- alias rx_rgss2b6_apply_state_changes apply_state_changes def apply_state_changes(obj) # ★ 無敵状態(ステートを付加する場合に限る)なら処理をスルー return if @rx_invincible and obj.plus_state_set != [] # メソッドを呼び戻す rx_rgss2b6_apply_state_changes(obj) end end