Advertisement
Guest User

Shopaholic Page 3

a guest
Jul 29th, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. #-------------------------------------------------------------------------------
  2. # page 3 of 12
  3. # Shopoholic v 2.0
  4. # code by cmpsr2000
  5. # available exclusively @ rpgrevolution.com/forums
  6. # Released June 25, 2008
  7. #
  8. #-------------------------------------------------------------------------------
  9. class Storage_Slot < RPG::BaseItem
  10.  
  11. attr_reader :locked
  12. attr_reader :amount
  13. attr_reader :item
  14. #-----------------------------------------------------------------------------
  15. # Creates the Storage_Slot object
  16. #-----------------------------------------------------------------------------
  17. def initialize
  18. @icon_index = 1947
  19. @item = nil
  20. @amount = 0
  21. @locked = true
  22. end
  23. #-----------------------------------------------------------------------------
  24. # Stores the specified item in the slot
  25. # item: The item being stored
  26. # amount: The amount of the item being stored
  27. #-----------------------------------------------------------------------------
  28. def storeItem(item, amount)
  29. $game_party.lose_item(item, amount)
  30. @item = item
  31. @amount = amount
  32. end
  33. #-----------------------------------------------------------------------------
  34. # removes the stored item from the slot and gives it to the party
  35. #-----------------------------------------------------------------------------
  36. def takeItem
  37. $game_party.gain_item(@item, @amount)
  38. @item = nil
  39. @amount = 0
  40. end
  41. #-----------------------------------------------------------------------------
  42. # locks the slot
  43. #-----------------------------------------------------------------------------
  44. def lock
  45. @locked = true
  46. end
  47. #-----------------------------------------------------------------------------
  48. # unlocks the slot
  49. #-----------------------------------------------------------------------------
  50. def unlock
  51. @locked = false
  52. end
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement