#============================================================================== # □ TPダメージ武器 (for VX Ace) #------------------------------------------------------------------------------ # Version : 1_20120421 # by サリサ・タイクーン # http://www.tycoon812.com/rgss/ #============================================================================== #============================================================================== # □ 素材スイッチ #============================================================================== $rgsslab = {} if $rgsslab == nil $rgsslab["TPダメージ武器"] = true if $rgsslab["TPダメージ武器"] #============================================================================== # □ カスタマイズポイント #============================================================================== module RGSSLAB end module RGSSLAB::Tp_Damage_Weapon #-------------------------------------------------------------------------- # ○ TPダメージの文字列設定 # 武器のメモ欄にて記述する文字列を設定します。 # # メモ欄に [ + NOTE + 数値 + ] と記述する事で # TPダメージを設定する事ができます。 # # 記述例: # NOTEが"TPダメージ"で、10の設定の場合は # [TPダメージ:10] と記述します。 #-------------------------------------------------------------------------- NOTE = "TPダメージ:" end # カスタマイズポイントは、ここまで #============================================================================== # □ RGSSLAB::Tp_Damage_Weapon [module] #============================================================================== module RGSSLAB::Tp_Damage_Weapon #-------------------------------------------------------------------------- # ○ 素材設定用の定数定義 #-------------------------------------------------------------------------- MATERIAL_NAME = "TPダメージ" VERSION = 1 RELEASE = 20120421 end #============================================================================== # ■ Game_Battler [class] #============================================================================== class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # ○ モジュールの設定 #-------------------------------------------------------------------------- RGSSLAB_131 = RGSSLAB::Tp_Damage_Weapon #-------------------------------------------------------------------------- # ● ダメージの処理 [再定義] # user : 使用者 #-------------------------------------------------------------------------- def execute_damage(user) on_damage(@result.hp_damage) if @result.hp_damage > 0 self.hp -= @result.hp_damage self.mp -= @result.mp_damage judge_mp_damage(user) if $rgsslab["MPダメージ武器"] judge_tp_damage(user) if $rgsslab["TPダメージ武器"] user.hp += @result.hp_drain user.mp += @result.mp_drain end #-------------------------------------------------------------------------- # ○ 武器によるTPダメージ判定 # user : 使用者 #-------------------------------------------------------------------------- def judge_tp_damage(user) if user.is_a?(Game_Actor) return user.actions.empty? if user.actions[0].item.id == user.attack_skill_id for weapon in user.weapons if weapon.note[/\[#{RGSSLAB_131::NOTE}(\d+)\]/] @result.tp_damage = weapon.note[/\[#{RGSSLAB_131::NOTE}(\d+)\]/].scan(/(\d+)/)[0][0].to_i self.tp -= @result.tp_damage end end end end end end end