Class: Lich::Gemstone::Treasure
- Inherits:
-
Object
- Object
- Lich::Gemstone::Treasure
- Defined in:
- documented/gemstone/creature.rb
Overview
Creature treasure/loot information
Tracks what types of treasure a creature drops (coins, gems, boxes, skins).
Instance Method Summary collapse
- #blunt_required? ⇒ Boolean
- #has_boxes? ⇒ Boolean
- #has_coins? ⇒ Boolean
- #has_gems? ⇒ Boolean
- #has_skin? ⇒ Boolean
-
#initialize(data = {}) ⇒ Treasure
constructor
Initialize treasure data.
- #to_h ⇒ Object
Constructor Details
#initialize(data = {}) ⇒ Treasure
Initialize treasure data
726 727 728 729 730 731 732 733 734 735 736 |
# File 'documented/gemstone/creature.rb', line 726 def initialize(data = {}) @data = { coins: false, gems: false, boxes: false, skin: nil, magic_items: nil, other: nil, blunt_required: false }.merge(data) end |
Instance Method Details
#blunt_required? ⇒ Boolean
742 |
# File 'documented/gemstone/creature.rb', line 742 def blunt_required? = !!@data[:blunt_required] |
#has_boxes? ⇒ Boolean
740 |
# File 'documented/gemstone/creature.rb', line 740 def has_boxes? = !!@data[:boxes] |
#has_coins? ⇒ Boolean
738 |
# File 'documented/gemstone/creature.rb', line 738 def has_coins? = !!@data[:coins] |
#has_gems? ⇒ Boolean
739 |
# File 'documented/gemstone/creature.rb', line 739 def has_gems? = !!@data[:gems] |
#has_skin? ⇒ Boolean
741 |
# File 'documented/gemstone/creature.rb', line 741 def has_skin? = !!@data[:skin] |
#to_h ⇒ Object
744 |
# File 'documented/gemstone/creature.rb', line 744 def to_h = @data |