#============================================================================== # □ MPダメージ武器 (for VX Ace) #------------------------------------------------------------------------------ # Version : 1_20120421 # by サリサ・タイクーン # http://www.tycoon812.com/rgss/ #============================================================================== #============================================================================== # □ 素材スイッチ #============================================================================== $rgsslab = {} if $rgsslab == nil $rgsslab["MPダメージ武器"] = true if $rgsslab["MPダメージ武器"] #============================================================================== # □ カスタマイズポイント #============================================================================== module RGSSLAB end module RGSSLAB::Mp_Damage_Weapon #-------------------------------------------------------------------------- # ○ MPダメージの文字列設定 # 武器のメモ欄にて記述する文字列を設定します。 # # メモ欄に [ + NOTE + 数値(‰) + ] と記述する事で # MPダメージ率を設定する事ができます。 # (100‰でダメージが100ならば、MPダメージは10になります) # # 記述例: # NOTEが"MPダメージ"で、100‰の設定の場合は # [MPダメージ:100] と記述します。 #-------------------------------------------------------------------------- NOTE = "MPダメージ:" end # カスタマイズポイントは、ここまで #============================================================================== # □ RGSSLAB::Mp_Damage_Weapon [module] #============================================================================== module RGSSLAB::Mp_Damage_Weapon #-------------------------------------------------------------------------- # ○ 素材設定用の定数定義 #-------------------------------------------------------------------------- MATERIAL_NAME = "MPダメージ武器" VERSION = 1 RELEASE = 20120421 end #============================================================================== # ■ Game_Battler [class] #============================================================================== class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # ○ モジュールの設定 #-------------------------------------------------------------------------- RGSSLAB_073 = RGSSLAB::Mp_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 #-------------------------------------------------------------------------- # ○ 武器によるMPダメージ判定 # user : 使用者 #-------------------------------------------------------------------------- def judge_mp_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_073::NOTE}(\d+)\]/] value = weapon.note[/\[#{RGSSLAB_073::NOTE}(\d+)\]/].scan(/(\d+)/)[0][0].to_i damage = @result.hp_damage * value / 1000.0 @result.mp_damage += Integer(damage) self.mp -= @result.mp_damage end end end end end end end