#============================================================================== # ■ VX-RGSS2-21 精霊システム-opt [SpiritActor] by Claimh #------------------------------------------------------------------------------ # 精霊のデータをアクターデータから参照できるようにするパッチです。 # # 設定中の以下の設定は無効となります。 # SPIRIT, INIT_LV, MAX_LV, LVUP_PTN, # INIT_LV, UP_I, UP_S, A_EXP, # MHP, MMP, ATK, DEX, SPI, AGI, LEARN # # (※OPT, CMPT, E_RATE, START_V, START_Pのみ有効) # # 参照先のアクターが[クリティカル頻発]などのオプションを持ってる場合、 # そのオプションも精霊データに引き継がれます。 #------------------------------------------------------------------------------ # 【注】精霊システム本体よりこのパッチを下に配置してください。 #============================================================================== module SpiritSystem # 精霊 ※精霊ID:0 は使用禁止 SPIRIT = { # 精霊ID => データベースを参照するアクターID 1 => 9, 2 => 10, 3 => 11, 4 => 12 } #============================================================================== # ■ SpiritSystem::SpiritData [再定義] #------------------------------------------------------------------------------ # このクラスは $game_party.spirit[精霊ID] で参照できます。 #============================================================================== class SpiritData #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(id) @id = id @partner_id = 0 @actor_id = SPIRIT[id] @visible = START_V.include?(id) end def actor; return $game_actors[@actor_id]; end def d_actor;return $data_actors[@actor_id]; end #-------------------------------------------------------------------------- # ● アクターデータ参照 [reader,accessorの再定義] #-------------------------------------------------------------------------- def name; return actor.name; end def face_name; return actor.face_name; end def face_index; return actor.face_index; end def face_name=(file) a = actor a.set_graphic(a.character_name, a.character_index, file, a.face_index) end def face_index=(index) a = actor a.set_graphic(a.character_name, a.character_index, a.face_name, index) end def level; return actor.level; end def exp; return actor.exp; end def skills; return actor.skills; end #-------------------------------------------------------------------------- # ● レベル上限? #-------------------------------------------------------------------------- def level_max? return (self.level >= 99) # 99とする end #-------------------------------------------------------------------------- # ● EXP の文字列取得 #-------------------------------------------------------------------------- def exp_s return actor.exp_s end #-------------------------------------------------------------------------- # ● 次のレベルの EXP の文字列取得 #-------------------------------------------------------------------------- def next_exp_s return actor.next_exp_s end #-------------------------------------------------------------------------- # ● 次のレベルまでの EXP の文字列取得 #-------------------------------------------------------------------------- def next_rest_exp_s return actor.next_rest_exp_s end #-------------------------------------------------------------------------- # ● 経験値の変更 # exp : 新しい経験値 # show : レベルアップ表示フラグ #-------------------------------------------------------------------------- def change_exp(exp, show) return unless actor.exist? # 存在しない状態になっていたらEXP獲得スキップ actor.change_exp(exp, show) end #-------------------------------------------------------------------------- # ● レベルアップ #-------------------------------------------------------------------------- def level_up actor.level_up end #-------------------------------------------------------------------------- # ● レベルダウン #-------------------------------------------------------------------------- def level_down actor.level_down end #-------------------------------------------------------------------------- # ● レベルアップメッセージの表示 # new_skills : 新しく習得したスキルの配列 #-------------------------------------------------------------------------- def display_level_up(new_skills) # 何もしない end #-------------------------------------------------------------------------- # ● EXP の変更 # exp : 新しい EXP #-------------------------------------------------------------------------- def exp=(exp) change_exp(exp, false) end #-------------------------------------------------------------------------- # ● 経験値の獲得 (経験値 2 倍のオプションを考慮しない) # exp : 経験値の増加量 # show : レベルアップ表示フラグ #-------------------------------------------------------------------------- def gain_exp(exp, show) change_exp(self.exp + exp, show) end #-------------------------------------------------------------------------- # ● レベルの変更 # level : 新しいレベル #-------------------------------------------------------------------------- def level=(level) change_level(level, false) end #-------------------------------------------------------------------------- # ● レベルの変更 # level : 新しいレベル # show : レベルアップ表示フラグ #-------------------------------------------------------------------------- def change_level(level, show) actor.change_level(level, show) end #-------------------------------------------------------------------------- # ● スキル習得 #-------------------------------------------------------------------------- def lvup_skill_learn(old_lv=1) # 何もしない end #-------------------------------------------------------------------------- # ● スキルを覚える # skill_id : スキル ID #-------------------------------------------------------------------------- def learn_skill(skill_id) actor.learn_skill(skill_id) end #-------------------------------------------------------------------------- # ● スキルを忘れる # skill_id : スキル ID #-------------------------------------------------------------------------- def forget_skill(skill_id) actor.forget_skill(skill_id) end #-------------------------------------------------------------------------- # ● スキルの習得済み判定 # skill : スキル #-------------------------------------------------------------------------- def skill_learn?(skill) return actor.skill_learn?(skill) end #-------------------------------------------------------------------------- # ● 最大HP #-------------------------------------------------------------------------- def maxhp; return actor.maxhp; end #-------------------------------------------------------------------------- # ● 最大MP #-------------------------------------------------------------------------- def maxmp; return actor.maxmp; end #-------------------------------------------------------------------------- # ● 攻撃力 #-------------------------------------------------------------------------- def atk; return actor.atk; end #-------------------------------------------------------------------------- # ● 防御力の取得 #-------------------------------------------------------------------------- def def; return actor.def; end #-------------------------------------------------------------------------- # ● 精神力 #-------------------------------------------------------------------------- def spi; return actor.spi; end #-------------------------------------------------------------------------- # ● 素早さ #-------------------------------------------------------------------------- def agi; return actor.agi; end #-------------------------------------------------------------------------- # ● オプション : クリティカル頻発 #-------------------------------------------------------------------------- def critical_bonus return true if d_actor.critical_bonus return ::SpiritSystem.get(OPT, @id).include?(3) end #-------------------------------------------------------------------------- # ● オプション : 強力防御 #-------------------------------------------------------------------------- def super_guard return true if d_actor.super_guard return ::SpiritSystem.get(OPT, @id).include?(1) end #-------------------------------------------------------------------------- # ● オプション : 薬の知識 #-------------------------------------------------------------------------- def pharmacology return true if d_actor.pharmacology return ::SpiritSystem.get(OPT, @id).include?(2) end #-------------------------------------------------------------------------- # ● オプション : ターン内先制 #-------------------------------------------------------------------------- def fast_attack return true if actor.fast_attack return ::SpiritSystem.get(OPT, @id).include?(4) end #-------------------------------------------------------------------------- # ● オプション : 連続攻撃 #-------------------------------------------------------------------------- def dual_attack return true if actor.dual_attack return ::SpiritSystem.get(OPT, @id).include?(5) end #-------------------------------------------------------------------------- # ● オプション : クリティカル防止 #-------------------------------------------------------------------------- def prevent_critical return true if actor.prevent_critical return ::SpiritSystem.get(OPT, @id).include?(6) end #-------------------------------------------------------------------------- # ● オプション : 消費 MP 半分 #-------------------------------------------------------------------------- def half_mp_cost return true if actor.half_mp_cost return ::SpiritSystem.get(OPT, @id).include?(7) end #-------------------------------------------------------------------------- # ● オプション : 取得経験値 2 倍 #-------------------------------------------------------------------------- def double_exp_gain return true if actor.double_exp_gain return ::SpiritSystem.get(OPT, @id).include?(8) end #-------------------------------------------------------------------------- # ● オプション : HP 自動回復 #-------------------------------------------------------------------------- def auto_hp_recover return true if actor.auto_hp_recover return ::SpiritSystem.get(OPT, @id).include?(9) end end end # module SpiritSystem