Advertisement
DizzyFoxkit

Custom equipment

Jan 27th, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.01 KB | None | 0 0
  1. module RPG
  2.   class Weapon
  3.     alias new_initialize initialize
  4.     def initialize
  5.       new_initialize
  6.       @initial_level = 1
  7.       @final_level = 99
  8.       @exp_basis = 30
  9.       @exp_inflation = 30
  10.     end
  11.    
  12.     attr_accessor :initial_level
  13.     attr_accessor :final_level
  14.     attr_accessor :exp_basis
  15.     attr_accessor :exp_inflation
  16.     attr_accessor :bonded_actor_id
  17.   end
  18. end
  19.  
  20. class Scene_Equip
  21.   def bond_weapon(item) # fyi b_item stands for bonded item #
  22.     # First Duplicate the object #
  23.     b_item = item.dup
  24.     # Set the id to the new array id :IE: data_b_weapons #
  25.     b_item.id = $data_b_weapons.size
  26.     # Bond said item #
  27.     b_item.b_actor_id = @actor.id
  28.     # Change the name :3 #
  29.     if item.name
  30.       if b_item.bonded_actor_id != @actor.id
  31.         b_item.name = @actor.name + "'s " + item.name
  32.       end
  33.     end
  34.     # put the Weapon at the end of data_b_weapons #
  35.     $data_b_weapons[b_item.id] = b_item
  36.     # return the bonded item for use #
  37.     return b_item
  38.   end
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement