Advertisement
Fomar0153

Fomar0153 - Elementalist Class 1.0

Mar 11th, 2012
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.09 KB | None | 0 0
  1. =begin
  2. Elementalist Class
  3. by Fomar0153
  4. Version 1.0
  5. ----------------------
  6. Notes
  7. ----------------------
  8. Requires my unique classes script
  9. Allows you to learn new skills by using skills of the same element.
  10. ----------------------
  11. Instructions
  12. ----------------------
  13. To make an elementalist in the unique classes script set it up like this:
  14.     when 4 # Elementalist
  15.       @data[actor_id] ||= Game_Elementalist.new(actor_id)
  16.  
  17. You will need to edit module Fomar, further instructions
  18. are located there.
  19. ----------------------
  20. Known bugs
  21. ----------------------
  22. None
  23. =end
  24.  
  25. module Fomar
  26.  
  27.   ELEMENTS = []
  28.   # Add/Edit lines like the ones below
  29.   ELEMENTS[3] = {}
  30.   # ELEMENTS[id][uses] = [NEW_SKILL_ID, NEW_SKILL_ID...]
  31.   ELEMENTS[3][50]  = [52,53]
  32.   ELEMENTS[3][100] = [54]
  33.  
  34. end
  35.  
  36. class Game_Elementalist < Game_Actor
  37.   #--------------------------------------------------------------------------
  38.   # ● New Method setup
  39.   #--------------------------------------------------------------------------
  40.   def setup(actor_id)
  41.     super(actor_id)
  42.     @element_uses = []
  43.   end
  44.   #--------------------------------------------------------------------------
  45.   # ● New Method add_element_use
  46.   #--------------------------------------------------------------------------
  47.   def add_element_use(id)
  48.     if @element_uses[id] == nil
  49.       @element_uses[id] = 0
  50.     end
  51.     @element_uses[id] += 1
  52.     unless Fomar::ELEMENTS[id][@element_uses[id]] == nil
  53.       for skill in Fomar::ELEMENTS[id][@element_uses[id]]
  54.         learn_skill(skill)
  55.         $game_message.add(@name + ' learns ' + $data_skills[skill].name)
  56.       end
  57.     end
  58.   end
  59. end
  60.  
  61. class Game_Battler < Game_BattlerBase
  62.   #--------------------------------------------------------------------------
  63.   # ● Aliases item_apply
  64.   #--------------------------------------------------------------------------
  65.   alias uce_item_apply item_apply
  66.   def item_apply(user, item)
  67.     uce_item_apply(user, item)
  68.     if user.is_a?(Game_Elementalist) and item.is_a?(RPG::Skill)
  69.       user.add_element_use(item.damage.element_id)
  70.     end
  71.   end
  72. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement