Module: RoomContent

Includes:
RoomTraps
Included in:
Room
Defined in:
lib/rooms/room_content.rb

Constant Summary collapse

CONTENT_DESC_EMPTY =
'Nothing in this room.'
CONTENT_DESC_MONSTERS_CLEARED =
'Slain monsters lying on the floor.'
CONTENT_DESC_TRAP_CLEARED =
'A deactivated trap. Be carefull.'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#encounters_difficultyObject

Returns the value of attribute encounters_difficulty.



6
7
8
# File 'lib/rooms/room_content.rb', line 6

def encounters_difficulty
  @encounters_difficulty
end

#party_levelsObject

Returns the value of attribute party_levels.



6
7
8
# File 'lib/rooms/room_content.rb', line 6

def party_levels
  @party_levels
end

Instance Method Details

#clearObject



25
26
27
28
29
30
31
32
33
34
# File 'lib/rooms/room_content.rb', line 25

def clear
  case @content
    when 'T'
      @content = nil
      @content_description = CONTENT_DESC_TRAP_CLEARED
    when 'M'
      @content = nil
      @content_description = CONTENT_DESC_MONSTERS_CLEARED
  end
end

#set_entry_roomObject



14
15
16
17
18
# File 'lib/rooms/room_content.rb', line 14

def set_entry_room
  @entry_room = true
  @content = 'E'
  @content_description = 'This room is the entry room.'
end

#set_treasure_roomObject



20
21
22
23
# File 'lib/rooms/room_content.rb', line 20

def set_treasure_room
  @content = 'H'
  @content_description = 'The treasure, you find it.'
end