Advertisement
roninator2

Convert MP Damage to HP Damage

Nov 3rd, 2020 (edited)
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.35 KB | Source Code | 0 0
  1. # ╔═════════════════════════════════════╦════════════════════╗
  2. # ║ Title: Convert MP Damage            ║  Version: 1.00     ║
  3. # ║ Author: Roninator2                  ║                    ║
  4. # ╠═════════════════════════════════════╬════════════════════╣
  5. # ║ Function:                           ║   Date Created     ║
  6. # ║                                     ╠════════════════════╣
  7. # ║ Convert MP damage to HP damage      ║    01 Nov 2020     ║
  8. # ╚═════════════════════════════════════╩════════════════════╝
  9. # ╔══════════════════════════════════════════════════════════╗
  10. # ║ When you have a weapon or skills that does MP damage     ║
  11. # ║ and during the course of a battle, the enemy has no      ║
  12. # ║ MP left, then the damage will convert to HP.             ║
  13. # ╚══════════════════════════════════════════════════════════╝
  14. # ╔═════════════════════════════════════╗
  15. # ║ Terms of use:                       ║
  16. # ║ Free for all uses in RPG Maker      ║
  17. # ╚═════════════════════════════════════╝
  18. class Game_ActionResult
  19.   def make_damage(value, item)
  20.     @critical = false if value == 0
  21.     @hp_damage = value if item.damage.to_hp?
  22.     @mp_damage = value if item.damage.to_mp?
  23.     @mp_damage = [@battler.mp, @mp_damage].min
  24.     if @mp_damage <= 0 && item.damage.to_mp?
  25.       @hp_damage = value
  26.       @success = true
  27.     end
  28.     @hp_drain = @hp_damage if item.damage.drain?
  29.     @mp_drain = @mp_damage if item.damage.drain?
  30.     @hp_drain = [@battler.hp, @hp_drain].min
  31.     @success = true if item.damage.to_hp? || @mp_damage != 0
  32.   end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement