texugo-engine 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/README.md +70 -0
- data/lib/armour.rb +34 -0
- data/lib/books.rb +13 -0
- data/lib/characters.rb +51 -0
- data/lib/commands.rb +327 -0
- data/lib/denofshadows.rb +200 -0
- data/lib/games/.gitkeep +0 -0
- data/lib/hamlet.rb +115 -0
- data/lib/items.rb +59 -0
- data/lib/maps.rb +26 -0
- data/lib/middleton.rb +239 -0
- data/lib/modules.rb +169 -0
- data/lib/monsters.rb +106 -0
- data/lib/northshire.rb +160 -0
- data/lib/play.rb +218 -0
- data/lib/player.rb +65 -0
- data/lib/rand_fight.rb +120 -0
- data/lib/ridgedale.rb +43 -0
- data/lib/shop.rb +144 -0
- data/lib/spells.rb +53 -0
- data/lib/timer.rb +12 -0
- data/lib/weapons.rb +17 -0
- data/texugo-engine.gemspec +16 -0
- metadata +72 -0
data/lib/denofshadows.rb
ADDED
@@ -0,0 +1,200 @@
|
|
1
|
+
require_relative 'items'
|
2
|
+
require_relative 'timer'
|
3
|
+
class DenoShadow
|
4
|
+
attr_accessor :name, :locations, :visit, :fightchance, :monsters
|
5
|
+
|
6
|
+
def initialize (name = 'Den of Shadows', locations={'east' => DenEast, 'west' => DenWest, 'northeast' => DenNortheast, 'north' => DenNorth}, visit = 0, fightchance = 3, monsters = 0)
|
7
|
+
@name = name
|
8
|
+
@locations = locations
|
9
|
+
@visit = visit
|
10
|
+
@fightchance = fightchance
|
11
|
+
@monsters = monsters
|
12
|
+
end
|
13
|
+
|
14
|
+
def introduction
|
15
|
+
if self.visit == 0
|
16
|
+
puts 'You find yourself at the mouth of a large cave. The wind is'
|
17
|
+
puts 'blowing in such a manner that a low, howling noise can be heard.'
|
18
|
+
puts 'You notice fresh foot prints on the ground and expect this might'
|
19
|
+
puts 'be more difficult than you had anticipated. However, having come'
|
20
|
+
puts 'this far, you see no point in turning back and decided to head'
|
21
|
+
puts 'into the cave.'
|
22
|
+
$player.visited << Den_of_Shadowsloc
|
23
|
+
end
|
24
|
+
|
25
|
+
unless self.visit == 0
|
26
|
+
puts 'You find yourself at the mouth of a large cave. The wind is'
|
27
|
+
puts 'blowing in such a manner that a low, howling noise can be heard.'
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def look
|
32
|
+
puts 'You find yourself in a large cavern, dome-shaped cavern. the ceiling'
|
33
|
+
puts 'is high and you notice that it is not a natural formation. Small,'
|
34
|
+
puts 'discreet designs can be seen repeating across it. There are four'
|
35
|
+
puts 'corridors branching from this cavern. You see a light flickering from'
|
36
|
+
puts 'the northern most pathway. (north, east, west, northeast)'
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
class Den_north
|
43
|
+
attr_accessor :name, :commands, :inventory, :visit
|
44
|
+
|
45
|
+
def initialize (name = 'northern cavern', commands = ['leave', 'take', 'look'], inventory = ['book of mysteries', 'book of heal', Purse.new(150)])
|
46
|
+
@name = name
|
47
|
+
@commands = commands
|
48
|
+
@inventory = inventory
|
49
|
+
@visit = visit
|
50
|
+
end
|
51
|
+
|
52
|
+
def introduction
|
53
|
+
if self.inventory.include?('book of mysteries')
|
54
|
+
timer
|
55
|
+
puts 'As you walk into the cavern, you see a what looks to be a thin man'
|
56
|
+
puts 'huddled in the corner. He is skinny to the point of starvation.'
|
57
|
+
puts 'As you look, you begin to notice that certain characteristics are'
|
58
|
+
puts 'distinctly non-human - his spine protudes much more than a mans'
|
59
|
+
puts 'should, even at the point of starvation, and comes to a sharp point'
|
60
|
+
puts 'near the neck. His feet are long and boney and his toe-nails are'
|
61
|
+
puts 'rounded like those of a hawk. You begin to reconsider finish this'
|
62
|
+
puts 'as you are no longer sure what you have gotten into, but before you'
|
63
|
+
puts 'are able to turn and leave, the stands, turns to you, lunges at you.'
|
64
|
+
puts 'He stops short and looks as though he recognizes you. In a shrill,'
|
65
|
+
puts "raspy voice, he claims to know you. He demands that you tell him"
|
66
|
+
puts 'what you are doing there, but without pausing for you to reply says'
|
67
|
+
puts 'that you should not be there. Inspite of the differences in'
|
68
|
+
puts 'appearance, his facial characteristics are close enough to human for'
|
69
|
+
puts 'you to recognize fear and worry in his expression. You ask him how'
|
70
|
+
puts 'he knows you, but his expression lightens and he then begins to'
|
71
|
+
puts "laugh. He stands up straight and begins to speak. 'You have yet to"
|
72
|
+
puts "remember, but I shall see to it that you do not have get the chance"
|
73
|
+
puts "to.' His smile turns to a scowl and he attacks."
|
74
|
+
timer
|
75
|
+
fight(Demon.new('Belial', 150, 5, 40))
|
76
|
+
puts ''
|
77
|
+
puts 'The creatures body drops to the floor. He now lay in a pool of his own'
|
78
|
+
puts 'blood. You stare at his face, attempting to recall any memory of having'
|
79
|
+
puts 'met him before. However, you cannot. In the corner you see you see a'
|
80
|
+
puts 'book. You pick it up, noticing the obvious age by the worn out binding.'
|
81
|
+
puts 'You turn it over and feel your heart rate jump as you look at the symbol'
|
82
|
+
puts 'inscribed on the cover. It is the same symbol as the one on the back of'
|
83
|
+
puts 'your hand. You almost drop the book as your hand starts to burn with an'
|
84
|
+
puts 'intensity that you have not before felt. You flip through the book but'
|
85
|
+
puts 'soon realize that it is written in a language you have never before seen,'
|
86
|
+
puts 'but notice that the characters are very similar to what has been carved into'
|
87
|
+
puts 'circle on the back of your hand. You decide that the man in the church'
|
88
|
+
puts 'may know more about your situation than you thought. You put the book into'
|
89
|
+
puts 'your pack and prepare to journey back.'
|
90
|
+
$player.inventory << 'book of mysteries'
|
91
|
+
self.inventory.delete_at(self.inventory.index('book of mysteries').to_i)
|
92
|
+
end
|
93
|
+
|
94
|
+
unless self.inventory.include? Book_of_mysteries
|
95
|
+
puts 'You step over the body of the creature you have slain. Its unusual featurs'
|
96
|
+
puts 'still unsettle you.'
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
def look
|
101
|
+
coin = 0
|
102
|
+
self.inventory.each do |item|
|
103
|
+
coin += 1 if item.class == Purse
|
104
|
+
end
|
105
|
+
puts "There is a purse full of coins lying on the floor. (purse)" unless coin == 0
|
106
|
+
puts "You see a book laying near the wall with the word 'heal' printed on it.(book of heal)" if self.inventory.include? 'book of heal'
|
107
|
+
puts 'The den is cold and dark. There is nothing of interest here.' if self.inventory.length == 0
|
108
|
+
end
|
109
|
+
|
110
|
+
def leave
|
111
|
+
$player.position.delete_at (0)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
class Den_northeast
|
116
|
+
attr_accessor :name, :commands
|
117
|
+
|
118
|
+
def initialize (name = 'northeastern cavern', commands = ['sleep', 'look', 'leave'])
|
119
|
+
@name = name
|
120
|
+
@commands = commands
|
121
|
+
end
|
122
|
+
|
123
|
+
def introduction
|
124
|
+
puts 'You walk into the cavern. It is cold and smells of mildew'
|
125
|
+
end
|
126
|
+
|
127
|
+
def look
|
128
|
+
puts 'You see a crudely made burlap sleeping area. (sleep)'
|
129
|
+
end
|
130
|
+
|
131
|
+
def leave
|
132
|
+
$player.position.delete_at (0)
|
133
|
+
end
|
134
|
+
|
135
|
+
end
|
136
|
+
|
137
|
+
class Den_east
|
138
|
+
attr_accessor :name, :commands, :inventory
|
139
|
+
|
140
|
+
def initialize(name = 'eastern cavern', commands = ['look', 'take', 'leave'], inventory = ['club', 'wicker shield'])
|
141
|
+
@name = name
|
142
|
+
@commands = commands
|
143
|
+
@inventory = inventory
|
144
|
+
end
|
145
|
+
|
146
|
+
def introduction
|
147
|
+
puts 'You walk into the small cavern.'
|
148
|
+
end
|
149
|
+
|
150
|
+
|
151
|
+
def look
|
152
|
+
puts 'On the floor before you lies a poorly made wicker shield.' if self.inventory.include? 'wicker shield'
|
153
|
+
puts 'Leaning against the far wall is a crude looking club.' if self.inventory.include? 'club'
|
154
|
+
puts 'The room is small and damp. There is nothing here of any interest.' if self.inventory.length == 0
|
155
|
+
end
|
156
|
+
|
157
|
+
def leave
|
158
|
+
$player.position.delete_at (0)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
class Den_west
|
163
|
+
attr_accessor :name, :commands, :inventory
|
164
|
+
|
165
|
+
def initialize (name = 'western cavern', commands = ['look', 'take', 'leave'], inventory = ['potion', 'potion'])
|
166
|
+
@name = name
|
167
|
+
@commands = commands
|
168
|
+
@inventory = inventory
|
169
|
+
end
|
170
|
+
|
171
|
+
def introduction
|
172
|
+
puts 'Light from your torch glistens on the wet walls of the cavern.'
|
173
|
+
end
|
174
|
+
|
175
|
+
def look
|
176
|
+
repeats = Hash.new(0)
|
177
|
+
self.inventory.each do |item|
|
178
|
+
repeats[item] += 1
|
179
|
+
end
|
180
|
+
|
181
|
+
puts 'You see some potions lying on the floor against the wall.' if self.inventory.include? 'potion'
|
182
|
+
repeats.each {|item, number| puts "(#{item} x #{number})"} if self.inventory.include? 'potion'
|
183
|
+
puts 'There is nothing else that you find interesting here.' if self.inventory.length == 0
|
184
|
+
end
|
185
|
+
|
186
|
+
def leave
|
187
|
+
$player.position.delete_at (0)
|
188
|
+
end
|
189
|
+
|
190
|
+
end
|
191
|
+
|
192
|
+
DenNorth = Den_north.new
|
193
|
+
DenNortheast = Den_northeast.new
|
194
|
+
DenWest = Den_west.new
|
195
|
+
DenEast = Den_east.new
|
196
|
+
Den_of_Shadowsloc = [DenNorth, DenNortheast, DenWest, DenEast]
|
197
|
+
Den_of_Shadows = DenoShadow.new
|
198
|
+
|
199
|
+
|
200
|
+
|
data/lib/games/.gitkeep
ADDED
File without changes
|
data/lib/hamlet.rb
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
require_relative 'timer'
|
2
|
+
|
3
|
+
|
4
|
+
class Hamlet1
|
5
|
+
attr_accessor :name, :locations, :visit, :fightchance, :monsters
|
6
|
+
|
7
|
+
def initialize(name = 'Deserted Hamlet', locations = {'house' => Abnd_house , 'tavern' => Abnd_tavern }, visit = 1, fightchance = 6, monsters = 0)
|
8
|
+
@name = name
|
9
|
+
@locations = locations
|
10
|
+
@visit = visit
|
11
|
+
@fightchance = fightchance
|
12
|
+
@monsters = monsters
|
13
|
+
end
|
14
|
+
|
15
|
+
def look
|
16
|
+
puts 'You see the remains of several buildings, many of which have collapsed due'
|
17
|
+
puts 'from the weight of time and neglect. Only two buildings are left standing'
|
18
|
+
puts 'and intact. The closest one looks to have been a tavern of sorts, judging'
|
19
|
+
puts 'by the sign that has, surpisingly, survived. The other, you assume, was a'
|
20
|
+
puts 'house. (Move: tavern, house)'
|
21
|
+
puts ''
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
class AbandHouse
|
28
|
+
attr_accessor :name, :commands, :inventory
|
29
|
+
|
30
|
+
def initialize (name = 'Abandoned House', commands = ['take', 'look', 'leave'], inventory = ['potion'])
|
31
|
+
@name = name
|
32
|
+
@commands = commands
|
33
|
+
@inventory = inventory
|
34
|
+
end
|
35
|
+
|
36
|
+
def leave
|
37
|
+
$player.position.delete_at (0)
|
38
|
+
end
|
39
|
+
|
40
|
+
def introduction
|
41
|
+
puts 'The house looks as if it hasnt been lived in for years. Dust covers'
|
42
|
+
puts 'the floor and furniture and cobwebs cover the walls. There is the thick'
|
43
|
+
puts 'smell of mildew and rotting wood.'
|
44
|
+
end
|
45
|
+
|
46
|
+
def look
|
47
|
+
puts "There is a table in the center of the room. On it, you see a potion." if self.inventory.include? 'potion'
|
48
|
+
puts 'Dust covers everything. There looks to be nothing of value here' if self.inventory.length == 0
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
class AbandTavern
|
54
|
+
attr_accessor :name, :commands, :inventory, :visit
|
55
|
+
|
56
|
+
def initialize (name = 'Abandoned Tavern', commands = ['take', 'look', 'leave'], inventory=[Middletonmap], visit = 0)
|
57
|
+
@name = name
|
58
|
+
@commands = commands
|
59
|
+
@inventory = inventory
|
60
|
+
@visit = visit
|
61
|
+
end
|
62
|
+
|
63
|
+
def leave
|
64
|
+
timer
|
65
|
+
if self.inventory.length == 0 && self.visit == 0
|
66
|
+
puts 'As you turn to leave, you see the shadow of a figure on the door.'
|
67
|
+
puts 'You briefly look around thinking that perhaps someone was hiding'
|
68
|
+
puts 'as you were searching the room but see no one else. The shadow begins'
|
69
|
+
puts 'to pull away from the door, leaving the two dimensional plane that'
|
70
|
+
puts 'all shadows should be bound. Before you now is a feature-less form'
|
71
|
+
puts 'that resembles a man. It begins to speak, though the voice is hollow'
|
72
|
+
puts 'and quiet. It warns you of a power that seeks retribution for your'
|
73
|
+
puts 'past actions. Before you are able to ask it what it means, it attacks.'
|
74
|
+
timer
|
75
|
+
fight(Ghoul.new('Restless Spirit'))
|
76
|
+
end
|
77
|
+
|
78
|
+
if self.inventory.length == 0 && $player.life > 0 && self.visit == 0
|
79
|
+
timer
|
80
|
+
puts 'The ethereal substance of the spirit dissolves in a burst of light. You'
|
81
|
+
puts 'shield your eyes. When you look back, you see only dust in the air and'
|
82
|
+
puts 'your shadow against the wall. You wonder what the spirit had meant and'
|
83
|
+
puts 'try to force some form of recollection as to how you came to be in this'
|
84
|
+
puts 'deserted hamlet. You take a look at the map fragment and notice the'
|
85
|
+
puts 'name of the nearest town is Middleton. Whether there awaits answers for'
|
86
|
+
puts 'you there or not, you are certain that Middleton will have more to offer'
|
87
|
+
puts 'you than this place. You open the door and leave.'
|
88
|
+
puts ''
|
89
|
+
timer
|
90
|
+
self.visit += 1
|
91
|
+
end
|
92
|
+
$player.position.delete_at (0)
|
93
|
+
end
|
94
|
+
|
95
|
+
def introduction
|
96
|
+
puts 'The taverns floor creeks as you walk across it. You know this place has'
|
97
|
+
puts 'seen better days, but looking around you arent sure if you would have'
|
98
|
+
puts 'been a patron here even on its best.'
|
99
|
+
end
|
100
|
+
|
101
|
+
def look
|
102
|
+
if self.inventory.include? (Middletonmap)
|
103
|
+
puts 'You see a fragment of a map hanging on the wall. You recognize the'
|
104
|
+
puts 'area that you are currently in, and a short distance away you see'
|
105
|
+
puts 'what appears to be another town. You hope that towns population is'
|
106
|
+
puts 'a little larger than this ones. (take: map)'
|
107
|
+
end
|
108
|
+
puts 'there seems to be nothing of interest here' if self.inventory.length == 0
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
Abnd_tavern = AbandTavern.new
|
113
|
+
Abnd_house = AbandHouse.new
|
114
|
+
Hamletloc = [Abnd_tavern, Abnd_house]
|
115
|
+
Hamlet = Hamlet1.new
|
data/lib/items.rb
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
require_relative 'player'
|
2
|
+
|
3
|
+
|
4
|
+
def potion(user = $player)
|
5
|
+
user.life += 25
|
6
|
+
if user.life > user.endurance * 10
|
7
|
+
user.life = user.endurance * 10
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def xpotion(user = $player)
|
12
|
+
user.life += 75
|
13
|
+
if user.life > user.endurance * 10
|
14
|
+
user.life = user.endurance * 10
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def rejuvinate(user = $player)
|
19
|
+
user.life = user.endurance * 10
|
20
|
+
user.magic = user.intelligence * 3
|
21
|
+
if user.life > user.endurance * 10
|
22
|
+
user.life = user.endurance * 10
|
23
|
+
end
|
24
|
+
if user.magic > user.intelligence * 3
|
25
|
+
user.magic = user.intelligence * 3
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def mana(user = $player)
|
30
|
+
user.magic += 15
|
31
|
+
if user.magic > user.intelligence * 3
|
32
|
+
user.magic = user.intelligence * 3
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class Purse
|
37
|
+
attr_accessor :amount
|
38
|
+
|
39
|
+
def initialize(amount)
|
40
|
+
@amount = amount
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
#key items
|
46
|
+
|
47
|
+
class Keyitem
|
48
|
+
attr_accessor :name
|
49
|
+
|
50
|
+
def initialize(name)
|
51
|
+
@name = name
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
Book_of_mysteries = Keyitem.new('book of mysteries')
|
56
|
+
Key_Items = {'book of mysteries' => Book_of_mysteries}
|
57
|
+
|
58
|
+
Items_price = {'potion' => 50, 'mana' => 70, 'rejuvinate' => 350, 'xpotion' => 150}
|
59
|
+
Items = ['potion', 'mana', 'rejuvinate', 'xpotion']
|
data/lib/maps.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require_relative 'ridgedale'
|
2
|
+
require_relative 'denofshadows'
|
3
|
+
require_relative 'northshire'
|
4
|
+
|
5
|
+
|
6
|
+
class Maps
|
7
|
+
attr_accessor :name, :location
|
8
|
+
|
9
|
+
def initialize(name, location)
|
10
|
+
@name = name
|
11
|
+
@location = location
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
Ridgedalemap = Maps.new('ridgedale', Ridgedale)
|
16
|
+
Northshiremap = Maps.new('northshire', Northshire)
|
17
|
+
DenofShadowsmap = Maps.new('den of shadows', Den_of_Shadows)
|
18
|
+
require_relative 'middleton'
|
19
|
+
Middletonmap = Maps.new('middleton', Middleton)
|
20
|
+
require_relative 'hamlet'
|
21
|
+
Hamletmap = Maps.new('deserted hamlet', Hamlet)
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
Map_id = { 'hamlet' => Hamletmap, 'middleton' => Middletonmap, 'den of shadows' => DenofShadowsmap}
|
data/lib/middleton.rb
ADDED
@@ -0,0 +1,239 @@
|
|
1
|
+
require_relative 'spells'
|
2
|
+
require_relative 'items'
|
3
|
+
require_relative 'armour'
|
4
|
+
require_relative 'weapons'
|
5
|
+
require_relative 'modules'
|
6
|
+
require_relative 'maps'
|
7
|
+
|
8
|
+
class Middle_ton
|
9
|
+
attr_accessor :name, :locations, :visit, :fightchance, :monsters
|
10
|
+
|
11
|
+
def initialize(name = 'Middleton', locations = {'inn' => Mddltn_inn, 'shop' => Mddltn_shop, 'church' => Mddltn_church}, visit = 0, fight_chance = 11, monsters = 0)
|
12
|
+
@name = name
|
13
|
+
@locations = locations
|
14
|
+
@visit = visit
|
15
|
+
@fightchance = fight_chance
|
16
|
+
@monsters = monsters
|
17
|
+
end
|
18
|
+
|
19
|
+
def introduction
|
20
|
+
if self.visit == 0
|
21
|
+
puts 'You come up to the edge of a small farm. You see a farmer on the other side'
|
22
|
+
puts 'behind an Ox pulling a plow. You walk past it, smelling the freshly tilled'
|
23
|
+
puts 'earth. A short distance passed the farm, you see a few small cottages and'
|
24
|
+
puts 'catch a brief smell of someone cooking. Strangely, the smell is familiar'
|
25
|
+
puts 'and you feel the sadness of having lost something dear to you. You wonder'
|
26
|
+
puts 'if you had once led a life of simple luxury like you imagine the people'
|
27
|
+
puts 'in the cottages do, but no memory of any such life comes to mind. The'
|
28
|
+
puts 'scar on you hand begins to burn again and you decide to just continue'
|
29
|
+
puts 'on to Middleton.'
|
30
|
+
puts ''
|
31
|
+
puts 'Just passed the cottages you arrive at a town. You see several buildings'
|
32
|
+
puts 'and make note of the fact that all of them look nice and well cared for -'
|
33
|
+
puts 'a nice contrast from the place you have just come. Knowing that there are'
|
34
|
+
puts 'living souls here is reassuring. You see a sign as you pass the first building.'
|
35
|
+
puts "It reads 'Middleton'"
|
36
|
+
puts''
|
37
|
+
$player.visited << Middletonloc
|
38
|
+
end
|
39
|
+
|
40
|
+
if ($player.inventory.include? 'book of mysteries') && (visit == 1)
|
41
|
+
$player.maps << Northshiremap
|
42
|
+
self.visit += 1
|
43
|
+
puts "As you walk into town, a stranger approaches you. The mans eyes are dark and"
|
44
|
+
puts "sunken and his face is thin. When he speaks, he does so in a raspy whisper. He"
|
45
|
+
puts "calls himself your friend and he warns you of the treachery the church is"
|
46
|
+
puts "capable of. He hands you a map and tells you to be wary when dealing with the"
|
47
|
+
puts "church. Just as quickly as he had approached, he disappears into the crowd at"
|
48
|
+
puts "the center of town. You glance down at the map, noting that the towns name is"
|
49
|
+
puts "Northshire, and wonder what could await you there."
|
50
|
+
puts ''
|
51
|
+
puts "northshire map added"
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
def look
|
57
|
+
puts 'You see people walking to and from the various buildings in the town though'
|
58
|
+
puts 'none of them seem to be in a particular hurry. You conclude that this must'
|
59
|
+
puts 'be a rather comfortable town. You see what looks to be a shop, and across from'
|
60
|
+
puts 'that an inn. Down the street from them you see a building with a cross on the'
|
61
|
+
puts 'roof - a church. None of the other building seem to be of interest.'
|
62
|
+
puts '(move: inn, shop, church)'
|
63
|
+
puts ''
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
class MddltnInn
|
71
|
+
attr_accessor :name, :commands
|
72
|
+
|
73
|
+
include Inn
|
74
|
+
|
75
|
+
def initialize(name = 'Middleton Inn', commands = ['leave', 'look', 'rest'])
|
76
|
+
@name = name
|
77
|
+
@commands = commands
|
78
|
+
end
|
79
|
+
|
80
|
+
def leave
|
81
|
+
$player.position.delete_at (0)
|
82
|
+
end
|
83
|
+
|
84
|
+
def introduction
|
85
|
+
puts 'You walk into the inn. The Innkeeper looks at you and offers her welcome and'
|
86
|
+
'asks if she can offer you a room. (rest)'
|
87
|
+
end
|
88
|
+
|
89
|
+
def look
|
90
|
+
puts 'You see the innkeeper behind a wooden counter. Various paintings of landscapes'
|
91
|
+
puts 'Hang from the wall and there is a large vase filled with some colorful flowers'
|
92
|
+
puts 'off in the corner. There is nothing of any interest here.'
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
class Middleton_shop
|
97
|
+
attr_accessor :name, :commands ,:items, :weapons, :spells, :armour
|
98
|
+
|
99
|
+
include Shop
|
100
|
+
|
101
|
+
def initialize(name = 'Middleton Shop', commands = ['buy', 'sell','leave'], items = ['potion'], weapons = ['club', 'sword'], spells = ['holy'], armour = ['hat', 'leather vest', 'leather shoes'])
|
102
|
+
@name = name
|
103
|
+
@items = items
|
104
|
+
@weapons = weapons
|
105
|
+
@spells = spells
|
106
|
+
@armour = armour
|
107
|
+
@commands = commands
|
108
|
+
end
|
109
|
+
|
110
|
+
def introduction
|
111
|
+
puts 'You walk into the shop to see an older man sitting behind a wooden counter.'
|
112
|
+
puts 'He stands up and welcomes you. After a moment, he asks you if he can help you'
|
113
|
+
puts 'with anything. (buy or sell)'
|
114
|
+
end
|
115
|
+
|
116
|
+
def look
|
117
|
+
puts 'You see several types of objects hanging on the wall - tools, you assume, for'
|
118
|
+
puts 'the farmers. In a corner behind the desk, you see a few options for things you'
|
119
|
+
puts 'might find useful - a club, a few pieces of armour and some potions. A peaceful'
|
120
|
+
puts 'town like this obviously doesnt have much need for a large defensive stock.'
|
121
|
+
puts 'These items are apparently being gaurded closely so there is nothing you can'
|
122
|
+
puts 'take.'
|
123
|
+
end
|
124
|
+
|
125
|
+
def leave
|
126
|
+
$player.position.delete_at (0)
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
class Middleton_church
|
131
|
+
attr_accessor :name, :commands, :inventory, :people, :seen, :spoken
|
132
|
+
|
133
|
+
def initialize(name = 'Middleton Church', commands = ['look', 'leave', 'talk'], inventory = [DenofShadowsmap], people = ['priest'], seen = 0, spoken = 0)
|
134
|
+
@name = name
|
135
|
+
@commands = commands
|
136
|
+
@inventory = inventory
|
137
|
+
@people = people
|
138
|
+
@seen = seen
|
139
|
+
@spoken = spoken
|
140
|
+
end
|
141
|
+
|
142
|
+
def introduction
|
143
|
+
puts 'The large doors slam behind you as you walk into the church. The interior is'
|
144
|
+
puts 'much larger than you would have expected judging from the outside. As you walk'
|
145
|
+
puts 'down the isle, your footsteps echo throughout the room. The silence of this'
|
146
|
+
puts 'place is beginning to unsettle you.'
|
147
|
+
end
|
148
|
+
|
149
|
+
def look
|
150
|
+
unless self.seen > 0
|
151
|
+
puts 'You look around the church and are immediately taken aback by the luxury of the'
|
152
|
+
puts "interior. It's suprising to see such a modest looking town having such a lavish"
|
153
|
+
puts 'building. The pillars, wich are lined to make two rows that line the walkway'
|
154
|
+
puts 'between the pews, have gold engravings of, whom you assume to be, the idols of'
|
155
|
+
puts 'the region. The walkway itself is made of marble and the pews of polished oak.'
|
156
|
+
puts 'At the head of the walkway is a podium, behind which is a large golden statue'
|
157
|
+
puts 'of a man with his limbs tied and stretched as if he were on a rack. The chest'
|
158
|
+
puts 'is opened and his ribs are exposed. The mans face is contorted in agony.'
|
159
|
+
puts 'Suddenly being in a town with other people is not so reassuring.'
|
160
|
+
puts ''
|
161
|
+
self.seen += 1
|
162
|
+
end
|
163
|
+
unless $player.maps.include? DenofShadowsmap
|
164
|
+
puts 'You see a man in front knealing infront of the large statue. He turns to you'
|
165
|
+
puts 'and stands. (talk)'
|
166
|
+
end
|
167
|
+
if $player.maps.include? DenofShadowsmap && ((self.inventory.include? Book_of_mysteries) == false)
|
168
|
+
puts 'You see the man waiting, somewhat impatiently, near the entrance of the church.(talk)'
|
169
|
+
end
|
170
|
+
|
171
|
+
if self.inventory.include? Book_of_mysteries
|
172
|
+
puts 'You see the man standing quietly near the large statue.(talk)'
|
173
|
+
end
|
174
|
+
|
175
|
+
end
|
176
|
+
|
177
|
+
def talk
|
178
|
+
if self.inventory.include? DenofShadowsmap
|
179
|
+
puts 'You walk up to the man. He is small and frail and his face is lined as though'
|
180
|
+
puts 'he spends his days in worry. He welcomes you to the church but his expression'
|
181
|
+
puts 'is one of great sorrow and trouble. You ask him if he is ok but he only looks'
|
182
|
+
puts 'away. He then tells you that a great relic of their champion has been stolen -'
|
183
|
+
puts 'a book of great importance to his peoples history. He motions to the statue at'
|
184
|
+
puts 'his mention of the champion. He then turns to you and asks you, in a hurried'
|
185
|
+
puts 'and panicked voice, if you would be willing to retrieve the book. He has ahold'
|
186
|
+
puts 'of your shoulder and begins pleading insisting that it will be made worth your'
|
187
|
+
puts 'while. Unsure of how else to leave this situation, you agree to help. His'
|
188
|
+
puts 'expression lightens immediatly as he hands you a map of the location of the book'
|
189
|
+
$player.maps << DenofShadowsmap
|
190
|
+
self.inventory.delete_at(self.inventory.index(DenofShadowsmap))
|
191
|
+
puts ''
|
192
|
+
puts 'map to den of shadows added'
|
193
|
+
puts ''
|
194
|
+
end
|
195
|
+
|
196
|
+
unless ($player.inventory.include?('book of mysteries')) || (self.inventory.include? ('book of mysteries'))
|
197
|
+
puts "The man: 'Please return immediatly once you have obtained the book.'"
|
198
|
+
end
|
199
|
+
|
200
|
+
|
201
|
+
if $player.inventory.include? 'book of mysteries'
|
202
|
+
puts "The man's disposition changes greatly when you present to him the book. He"
|
203
|
+
puts "quickly grabs it, taking it from your hands almost violently and hugs it"
|
204
|
+
puts "closely to his chest. You ask him about the symbol on the cover of it and it"
|
205
|
+
puts "takes a minute before he replies. The man takes a deep breath before asking"
|
206
|
+
puts "you of your origins and how you came to be in this town. After telling him of"
|
207
|
+
puts "how you awoke in the deserted hamlet, he tells you that the symbol on the book"
|
208
|
+
puts "- and the one on your hand - is the sign of their champion and that the script"
|
209
|
+
puts "within the circle is the name of their champion. He goes on to say that only a"
|
210
|
+
puts "few are allowed to know that name and he is not one of them. He hands you a map"
|
211
|
+
puts "of a distant city and a letter. The city, he tells you, is the lands capitol"
|
212
|
+
puts "and is home of the central church. There, you must speak with the arch"
|
213
|
+
puts "counsiler, who is the head of the church, and give him the letter."
|
214
|
+
puts ''
|
215
|
+
puts 'Ridgedale map added'
|
216
|
+
$player.maps << Ridgedalemap
|
217
|
+
self.inventory << 'book of mysteries'
|
218
|
+
$player.inventory.delete_at($player.inventory.index('book of mysteries'))
|
219
|
+
end
|
220
|
+
|
221
|
+
if self.inventory.include? 'book of mysteries'
|
222
|
+
puts "The Man: The arch counsiler can offer you more than what I can. I wish you well"
|
223
|
+
puts "on your journey."
|
224
|
+
end
|
225
|
+
|
226
|
+
end
|
227
|
+
|
228
|
+
def leave
|
229
|
+
$player.position.delete_at (0)
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
Mddltn_church = Middleton_church.new
|
236
|
+
Mddltn_inn = MddltnInn.new
|
237
|
+
Mddltn_shop = Middleton_shop.new
|
238
|
+
Middletonloc = [Middleton_church]
|
239
|
+
Middleton = Middle_ton.new
|