#============================================================================== # ■ RGSS3 特殊死亡・全滅特徴 Ver2.00 by 星潟 #------------------------------------------------------------------------------ # 非戦闘不能者が全員、特定の特徴を持っていると # 全滅扱いとなるステートを作成します。 # 2種類の設定がありますが、「行動できない」を設定しないと # 行動選択はするので注意を。 # # 設定例(特徴を有するメモ欄に記入) # <死亡ステート> # ターゲット選択時は戦闘不能キャラとして扱われます。 # <全滅ステート> # ターゲット選択時は非戦闘不能キャラとして扱われます。 #============================================================================== module DeathState #死亡扱いとなるステート用のキーワードを設定します。 Word1 = "死亡ステート" #全滅扱いとなるステート用のキーワードを設定します。 Word2 = "全滅ステート" end class Game_BattlerBase #-------------------------------------------------------------------------- # 戦闘不能ステートの検査 #-------------------------------------------------------------------------- alias death_state_ex_death? death_state? def death_state? death_state_ex_death? or special_dead1? end #-------------------------------------------------------------------------- # 特殊戦闘不能ステートの検査 #-------------------------------------------------------------------------- def special_dead1? states.any? {|s| s.special_dead1} end #-------------------------------------------------------------------------- # 特殊全滅ステートの検査 #-------------------------------------------------------------------------- def special_dead2? states.any? {|s| s.special_dead2} end end class Game_Unit #-------------------------------------------------------------------------- # 全滅判定 #-------------------------------------------------------------------------- alias all_dead_ex? all_dead? def all_dead? all_dead_ex? or special_dead2? end #-------------------------------------------------------------------------- # 特殊全滅判定 #-------------------------------------------------------------------------- def special_dead2? alive_members.all? {|i| i.special_dead2?} end end class RPG::State < RPG::BaseItem #-------------------------------------------------------------------------- # 特殊戦闘不能ステート #-------------------------------------------------------------------------- def special_dead1 (@special_dead1 ||= /<#{DeathState::Word1}>/ =~ note ? 1 : 0) == 1 end #-------------------------------------------------------------------------- # 特殊全滅ステート #-------------------------------------------------------------------------- def special_dead2 (@special_dead2 ||= /<#{DeathState::Word2}>/ =~ note ? 1 : 0) == 1 end end