Class: Hamlet1

Inherits:
Object
  • Object
show all
Defined in:
lib/hamlet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = 'Deserted Hamlet', locations = {'house' => Abnd_house , 'tavern' => Abnd_tavern }, visit = 1, fightchance = 6, monsters = 0) ⇒ Hamlet1

Returns a new instance of Hamlet1.



7
8
9
10
11
12
13
# File 'lib/hamlet.rb', line 7

def initialize(name = 'Deserted Hamlet', locations = {'house' => Abnd_house , 'tavern' => Abnd_tavern }, visit = 1, fightchance = 6, monsters = 0)
	@name = name
	@locations = locations
	@visit = visit
	@fightchance = fightchance
	@monsters = monsters
end

Instance Attribute Details

#fightchanceObject

Returns the value of attribute fightchance.



5
6
7
# File 'lib/hamlet.rb', line 5

def fightchance
  @fightchance
end

#locationsObject

Returns the value of attribute locations.



5
6
7
# File 'lib/hamlet.rb', line 5

def locations
  @locations
end

#monstersObject

Returns the value of attribute monsters.



5
6
7
# File 'lib/hamlet.rb', line 5

def monsters
  @monsters
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/hamlet.rb', line 5

def name
  @name
end

#visitObject

Returns the value of attribute visit.



5
6
7
# File 'lib/hamlet.rb', line 5

def visit
  @visit
end

Instance Method Details

#lookObject



15
16
17
18
19
20
21
22
# File 'lib/hamlet.rb', line 15

def look
	puts 'You see the remains of several buildings, many of which have collapsed due'
	puts 'from the weight of time and neglect. Only two buildings are left standing'
	puts 'and intact. The closest one looks to have been a tavern of sorts, judging'
	puts 'by the sign that has, surpisingly, survived. The other, you assume, was a'
	puts 'house. (Move: tavern, house)'
	puts ''
end