Advertisement
WCouillard

RGSS3: Spellspring Add-On for YF Skill Cost Manager

Nov 22nd, 2014
489
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 8.31 KB | None | 0 0
  1. # ╔══════════════════════════════════════════════════════╤═══════╤════════════╗
  2. # ║ Spellspring Add-On for YF Skill Cost Manager         │ v1.00 │ (11/22/14) ║
  3. # ╠══════════════════════════════════════════════════════╧═══════╧════════════╣
  4. # ║ Author  : William Couillard                                               ║
  5. # ║ Thanks  : TheoAllen                                                       ║
  6. # ║ E-Mail  : cooliebk18@yahoo.com                                            ║
  7. # ║ Website : http://ffdiscovery.wikia.com                                    ║
  8. # ╠═══════════════════════════════════════════════════════════════════════════╣
  9. # ║ ABOUT                                                                     ║
  10. # ╠═══════════════════════════════════════════════════════════════════════════╣
  11. # ║ This script allows the user to set a state to enable Spellspring on that  ║
  12. # ║ Actor. Spellspring reduces any skill cost for skills that cost MP         ║
  13. # ║ to a value you set (commonly, 1), regardless of MCR. Players of Final     ║
  14. # ║ Fantasy VI will recognize this as the effect of the Economizer/Celestriad ║
  15. # ║ Relic. Skills costing 0 MP are unaffected.                                ║
  16. # ╠═══════════════════════════════════════════════════════════════════════════╣
  17. # ║ TERMS OF USE                                                              ║
  18. # ╠═══════════════════════════════════════════════════════════════════════════╣
  19. # ║ ► Do not edit the script's header or comments.                            ║
  20. # ║ ► Free to use in commercial projects as long as proper credit is given to ║
  21. # ║   ALL the names in the above header.                                      ║
  22. # ╠═══════════════════════════════════════════════════════════════════════════╣
  23. # ║ CHANGE LOG                                                                ║
  24. # ╠═════════════════════════════════════════════════════════════════╤═════════╣
  25. # ║ ■ November 22, 2014 : Initial release.                          │ (v1.00) ║
  26. # ╠═════════════════════════════════════════════════════════════════╧═════════╣
  27. # ║ ALIASED METHODS                                                           ║
  28. # ╠═══════════════════════════════════════════════════════════════════════════╣
  29. # ║   This script aliases one method in Yanfly's Skill Cost Manager script.   ║
  30. # ╟───────────────────────────────────────────────────────────────────────────╢
  31. # ║ ■ class Game_BattlerBase                                                  ║
  32. # ║    ► def skill_mp_cost                                                    ║
  33. # ╠═══════════════════════════════════════════════════════════════════════════╣
  34. # ║ INSTRUCTIONS                                                              ║
  35. # ╠═══════════════════════════════════════════════════════════════════════════╣
  36. # ║ Paste this script directly UNDERNEATH Yanfly's Skill Cost Manager 1.03.   ║
  37. # ╠═══════════════════════════════════════════════════════════════════════════╣
  38. # ║ IMPORT SETTING                                                            ║
  39. # ╚═══════════════════════════════════════════════════════════════════════════╝
  40. $imported = {} if $imported.nil?              # Do not edit
  41. $imported["WC_Spellspring_YEA"] = true # Do not edit
  42. # ╔═══════════════════════════════════════════════════════════════════════════╗
  43. # ║ CUSTOMIZATION MODULE                                                      ║
  44. # ╚═══════════════════════════════════════════════════════════════════════════╝
  45.  
  46. module COOLIE
  47.   module SPELLSPRING
  48.   # ╔═════════════════════════════════════════════════════════════════════════╗
  49.   # ║ SPELLSPRING SETTINGS                                                    ║
  50.   # ╚═════════════════════════════════════════════════════════════════════════╝
  51.     SPELLSPRING_STATE = 86 # ID of the state that enables Spellspring
  52.     SPELLSPRING_COST  =  1 # The MP cost of all skills when Spellspring is
  53.                            # enabled (only applies to skills costing MP)
  54.   end # SPELLSPRING
  55. end # COOLIE
  56.  
  57. class Game_BattlerBase  
  58.   #--------------------------------------------------------------------------
  59.   # alias method: skill_mp_cost
  60.   #--------------------------------------------------------------------------
  61.   alias coolie_spellspring_skill_mp_cost skill_mp_cost
  62.   def skill_mp_cost(skill)
  63.     coolie_spellspring_skill_mp_cost(skill)
  64.     actor = $game_actors[id] if !enemy?
  65.     n = 0
  66.     n = coolie_spellspring_skill_mp_cost(skill)
  67.     if n >= 1 && !enemy? && actor.state?(COOLIE::SPELLSPRING::SPELLSPRING_STATE)
  68.       n = COOLIE::SPELLSPRING::SPELLSPRING_COST
  69.     else
  70.       n += skill.mp_cost_percent * mmp * mcr
  71.       n = [n.to_i, skill.mp_cost_max].min unless skill.mp_cost_max.nil?
  72.       n = [n.to_i, skill.mp_cost_min].max unless skill.mp_cost_min.nil?
  73.     end # if...
  74.     return n.to_i
  75.   end # skill_mp_cost
  76. end # Game_BattlerBase
  77. # ╔═══════════════════════════════════════════════════════════════════════════╗
  78. # ║ END OF SCRIPT                                                             ║
  79. # ╚═══════════════════════════════════════════════════════════════════════════╝
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement