Class: Northshre

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = 'Northshire', locations = {'inn' => NorthshireInn, 'shop' => NorthshireShop, 'tavern' => NorthshireTavern, 'house' => NorthshireHouse}, visit = 0, fight_chance = 12, monsters = 1) ⇒ Northshre

Returns a new instance of Northshre.



8
9
10
11
12
13
14
# File 'lib/northshire.rb', line 8

def initialize(name = 'Northshire', locations = {'inn' => NorthshireInn, 'shop' => NorthshireShop, 'tavern' => NorthshireTavern, 'house' => NorthshireHouse}, visit = 0, fight_chance = 12, monsters = 1)
	@name = name
	@locations = locations
	@visit = visit
	@fightchance = fight_chance
	@monsters = monsters
end

Instance Attribute Details

#fightchanceObject

Returns the value of attribute fightchance.



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

def fightchance
  @fightchance
end

#locationsObject

Returns the value of attribute locations.



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

def locations
  @locations
end

#monstersObject

Returns the value of attribute monsters.



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

def monsters
  @monsters
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#visitObject

Returns the value of attribute visit.



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

def visit
  @visit
end

Instance Method Details

#introductionObject



16
17
18
19
20
21
22
23
24
# File 'lib/northshire.rb', line 16

def introduction
	puts "You come upon a small town. The buildings here, though seemingly in full"
	puts "operation, have not been maintained well. You suspect this town doesnt get much"
	puts "trade or travellers. The people of this town seem to move slugishly, as if it"
	puts "were with great reluctance that they arive to wherever they are heading. The"
	puts "town itself had a depressed air about it and you find yourself experiencing an"
	puts "intense meloncholy merely by being there. You hope your time in this town will"
	puts "be short as you set off to discover what the town holds"
end

#lookObject



26
27
28
29
30
31
32
# File 'lib/northshire.rb', line 26

def look
	puts "The lack of care and maintanance of the buildings immediatly stand out to you,"
	puts "but, inspite of this, their functions are easily recognizable. Along the"
	puts "gravelled road is a row of buildings. Of those buildings you notice a shop and"
	puts "a tavern right next to it. Further down the road is you notice an inn."
	puts "(shop, tavern, inn)"
end

#monsterObject



34
35
36
# File 'lib/northshire.rb', line 34

def monster
	return Human.new("Mugger")
end