blucalm

Ra Upg Equips Falcao Mana Stones Compatibility Patch

Dec 11th, 2012
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
  2. # * Eshra Upgradable Equipment + Falcao Mana Stone Compatiblity Patch\
  3. # Author: Eshra
  4. # Date: 11 Dec 2012
  5. # Dependencies: 1.) Tsuki_CustomDataManager
  6. # 2.) Ra Custom DM add-on
  7. #
  8. #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
  9. # This is a compatibility patch for the upgradable equipment script and Falcao's
  10. # Mana stone script. Just place this script under the materials section and above
  11. # main and be sure to mark all items that can have mana stones placed on them
  12. # with this notetag:
  13. #
  14. # <Unique>
  15. #
  16. # That notetag, in combination with this patch will fix the bug in the mana stone
  17. # script which causes all items of the same type to be treated as if they have
  18. # the same mana stones.
  19. #-------------------------------------------------------------------------------
  20.  
  21. ($imported||={})["Ra Upg Mana Stone Comptability"] = 0.1
  22.  
  23. raise "Ra Upg Mana Stone Compatibility requires Ra Custom DM add-on
  24. " if !$imported["Ra Custom DM add-on"]
  25.  
  26. class RPG::EquipItem < RPG::BaseItem
  27. # Overwrite
  28. def manaslots; @mana_stone_data ||= []; end
  29. end # RPG::EquipItem
  30.  
  31. class Game_System
  32. # Overwrite dataslots_ini, param: operand is no longer used
  33. def dataslots_ini(operand, item)
  34. for kind in item
  35. next if kind.nil?
  36. kind.init_mana_stones(kind.given_sl) if kind.given_sl != nil
  37. end
  38. end
  39. end # Game_System
  40.  
  41. class RPG::EquipItem < RPG::BaseItem
  42. attr_accessor :mana_stone_data
  43. def init_mana_stones(size)
  44. return if !size
  45. @mana_stone_data = Array.new(size)
  46. end
  47. def reset_stone_data
  48. (@mana_stone_data||=[]).each{ |i| @mana_stone_data[i] = nil }
  49. end
  50. def mana_stone_data=(arr); @mana_stone_data = arr; end
  51. end # RPG::EquipItem
  52. # End of File
Advertisement
Add Comment
Please, Sign In to add comment