Class: Middle_ton

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = 'Middleton', locations = {'inn' => Mddltn_inn, 'shop' => Mddltn_shop, 'church' => Mddltn_church}, visit = 0, fight_chance = 11, monsters = 0) ⇒ Middle_ton

Returns a new instance of Middle_ton.



11
12
13
14
15
16
17
# File 'lib/middleton.rb', line 11

def initialize(name = 'Middleton', locations = {'inn' => Mddltn_inn, 'shop' => Mddltn_shop, 'church' => Mddltn_church}, visit = 0, fight_chance = 11, monsters = 0)
	@name = name
	@locations = locations
	@visit = visit
	@fightchance = fight_chance
	@monsters = monsters
end

Instance Attribute Details

#fightchanceObject

Returns the value of attribute fightchance.



9
10
11
# File 'lib/middleton.rb', line 9

def fightchance
  @fightchance
end

#locationsObject

Returns the value of attribute locations.



9
10
11
# File 'lib/middleton.rb', line 9

def locations
  @locations
end

#monstersObject

Returns the value of attribute monsters.



9
10
11
# File 'lib/middleton.rb', line 9

def monsters
  @monsters
end

#nameObject

Returns the value of attribute name.



9
10
11
# File 'lib/middleton.rb', line 9

def name
  @name
end

#visitObject

Returns the value of attribute visit.



9
10
11
# File 'lib/middleton.rb', line 9

def visit
  @visit
end

Instance Method Details

#introductionObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/middleton.rb', line 19

def introduction
	if self.visit == 0
		puts 'You come up to the edge of a small farm. You see a farmer on the other side'
		puts 'behind an Ox pulling a plow. You walk past it, smelling the freshly tilled'
		puts 'earth. A short distance passed the farm, you see a few small cottages and'
		puts 'catch a brief smell of someone cooking. Strangely, the smell is familiar'
		puts 'and you feel the sadness of having lost something dear to you. You wonder'
		puts 'if you had once led a life of simple luxury like you imagine the people'
		puts 'in the cottages do, but no memory of any such life comes to mind. The'
		puts 'scar on you hand begins to burn again and you decide to just continue'
		puts 'on to Middleton.'
		puts ''
		puts 'Just passed the cottages you arrive at a town. You see several buildings'
		puts 'and make note of the fact that all of them look nice and well cared for -'
		puts 'a nice contrast from the place you have just come. Knowing that there are'
		puts 'living souls here is reassuring. You see a sign as you pass the first building.'
		puts "It reads 'Middleton'"
		puts''
		$player.visited << Middletonloc
	end

	if ($player.inventory.include? 'book of mysteries') && (visit == 1)
		$player.maps << Northshiremap
		self.visit += 1
		puts "As you walk into town, a stranger approaches you. The mans eyes are dark and"
		puts "sunken and his face is thin. When he speaks, he does so in a raspy whisper. He"
		puts "calls himself your friend and he warns you of the treachery the church is"
		puts "capable of. He hands you a map and tells you to be wary when dealing with the"
		puts "church. Just as quickly as he had approached, he disappears into the crowd at"
		puts "the center of town. You glance down at the map, noting that the towns name  is"
		puts "Northshire, and wonder what could await you there."
		puts ''
		puts "northshire map added"
	end

end

#lookObject



56
57
58
59
60
61
62
63
64
# File 'lib/middleton.rb', line 56

def look
	puts 'You see people walking to and from the various buildings in the town though'
	puts 'none of them seem to be in a particular hurry. You conclude that this must'
	puts 'be a rather comfortable town. You see what looks to be a shop, and across from'
	puts 'that an inn. Down the street from them you see a building with a cross on the'
	puts 'roof - a church. None of the other building seem to be of interest.'
	puts '(move: inn, shop, church)'
	puts ''
end