Class: Middleton_church

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = 'Middleton Church', commands = ['look', 'leave', 'talk'], inventory = [DenofShadowsmap], people = ['priest'], seen = 0, spoken = 0) ⇒ Middleton_church

Returns a new instance of Middleton_church.



133
134
135
136
137
138
139
140
# File 'lib/middleton.rb', line 133

def initialize(name = 'Middleton Church', commands = ['look', 'leave', 'talk'], inventory = [DenofShadowsmap], people = ['priest'], seen = 0, spoken = 0)
	@name = name
	@commands = commands
	@inventory = inventory
	@people = people
	@seen = seen
	@spoken = spoken
end

Instance Attribute Details

#commandsObject

Returns the value of attribute commands.



131
132
133
# File 'lib/middleton.rb', line 131

def commands
  @commands
end

#inventoryObject

Returns the value of attribute inventory.



131
132
133
# File 'lib/middleton.rb', line 131

def inventory
  @inventory
end

#nameObject

Returns the value of attribute name.



131
132
133
# File 'lib/middleton.rb', line 131

def name
  @name
end

#peopleObject

Returns the value of attribute people.



131
132
133
# File 'lib/middleton.rb', line 131

def people
  @people
end

#seenObject

Returns the value of attribute seen.



131
132
133
# File 'lib/middleton.rb', line 131

def seen
  @seen
end

#spokenObject

Returns the value of attribute spoken.



131
132
133
# File 'lib/middleton.rb', line 131

def spoken
  @spoken
end

Instance Method Details

#introductionObject



142
143
144
145
146
147
# File 'lib/middleton.rb', line 142

def introduction
	puts 'The large doors slam behind you as you walk into the church. The interior is'
	puts 'much larger than you would have expected judging from the outside. As you walk'
	puts 'down the isle, your footsteps echo throughout the room. The silence of this'
	puts 'place is beginning to unsettle you.'
end

#leaveObject



228
229
230
# File 'lib/middleton.rb', line 228

def leave
	$player.position.delete_at (0)
end

#lookObject



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/middleton.rb', line 149

def look
	unless self.seen > 0
		puts 'You look around the church and are immediately taken aback by the luxury of the'
		puts "interior. It's suprising to see such a modest looking town having such a lavish"
		puts 'building. The pillars, wich are lined to make two rows that line the walkway'
		puts 'between the pews, have gold engravings of, whom you assume to be, the idols of'
		puts 'the region. The walkway itself is made of marble and the pews of polished oak.'
		puts 'At the head of the walkway is a podium, behind which is a large golden statue'
		puts 'of a man with his limbs tied and stretched as if he were on a rack. The chest'
		puts 'is opened and his ribs are exposed. The mans face is contorted in agony.'
		puts 'Suddenly being in a town with other people is not so reassuring.'
		puts ''
		self.seen += 1
	end
	unless $player.maps.include? DenofShadowsmap
		puts 'You see a man in front knealing infront of the large statue. He turns to you'
		puts 'and stands. (talk)'
	end
	if $player.maps.include? DenofShadowsmap && ((self.inventory.include? Book_of_mysteries) == false)
		puts 'You see the man waiting, somewhat impatiently, near the entrance of the church.(talk)'
	end

	if self.inventory.include? Book_of_mysteries
		puts 'You see the man standing quietly near the large statue.(talk)'
	end

end

#talkObject



177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'lib/middleton.rb', line 177

def talk
	if self.inventory.include? DenofShadowsmap
		puts 'You walk up to the man. He is small and frail and his face is lined as though'
		puts 'he spends his days in worry. He welcomes you to the church but his expression'
		puts 'is one of great sorrow and trouble. You ask him if he is ok but he only looks'
		puts 'away. He then tells you that a great relic of their champion has been stolen -'
		puts 'a book of great importance to his peoples history. He motions to the statue at'
		puts 'his mention of the champion. He then turns to you and asks you, in a hurried'
		puts 'and panicked voice, if you would be willing to retrieve the book. He has ahold'
		puts 'of your shoulder and begins pleading insisting that it will be made worth your'
		puts 'while. Unsure of how else to leave this situation, you agree to help. His'
		puts 'expression lightens immediatly as he hands you a map of the location of the book'
		$player.maps << DenofShadowsmap
		self.inventory.delete_at(self.inventory.index(DenofShadowsmap))
		puts ''
		puts 'map to den of shadows added'
		puts ''
	end

	unless ($player.inventory.include?('book of mysteries')) || (self.inventory.include? ('book of mysteries'))
		puts "The man: 'Please return immediatly once you have obtained the book.'"
	end


	if $player.inventory.include? 'book of mysteries'
		puts "The man's disposition changes greatly when you present to him the book. He"
		puts "quickly grabs it, taking it from your hands almost violently and hugs it"
		puts "closely to his chest. You ask him about the symbol on the cover of it and it"
		puts "takes a minute before he replies. The man takes a deep breath before asking"
		puts "you of your origins and how you came to be in this town. After telling him of"
		puts "how you awoke in the deserted hamlet, he tells you that the symbol on the book"
		puts "- and the one on your hand - is the sign of their champion and that the script"
		puts "within the circle is the name of their champion. He goes on to say that only a"
		puts "few are allowed to know that name and he is not one of them. He hands you a map"
		puts "of a distant city and a letter. The city, he tells you, is the lands capitol"
		puts "and is home of the central church. There, you must speak with the arch"
		puts "counsiler, who is the head of the church, and give him the letter."
		puts ''
		puts 'Ridgedale map added'
		$player.maps << Ridgedalemap
		self.inventory << 'book of mysteries'
		$player.inventory.delete_at($player.inventory.index('book of mysteries'))
	end

	if self.inventory.include? 'book of mysteries'
		puts "The Man: The arch counsiler can offer you more than what I can. I wish you well"
		puts "on your journey."
	end

end