gemwarrior 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gemwarrior/battle.rb +6 -13
- data/lib/gemwarrior/entities/items/floor_tile.rb +1 -5
- data/lib/gemwarrior/entities/items/tower_switch.rb +1 -5
- data/lib/gemwarrior/entities/player.rb +2 -7
- data/lib/gemwarrior/evaluator.rb +5 -5
- data/lib/gemwarrior/game.rb +1 -0
- data/lib/gemwarrior/misc/animation.rb +29 -0
- data/lib/gemwarrior/misc/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3e02eb07b6d2f5d85c69bff99e23d580e61326b
|
4
|
+
data.tar.gz: 8cc5438f267d75b010f7645d8da54d3dafa4a9c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5736f18ee87c888f5a0f41ede0fbb6f5246735d6da39c6282e5649568de3d33cb0aa8d3470b0505c214af997ff0f542382dc016be5f169e6547cbf63536ad15b
|
7
|
+
data.tar.gz: d3d2fa237f23270f92bfaa0f73529708d9d755646dee38a1199952b7be1296a888c377a412f96073cb7fb04cfc23f2e427bb80ea73db0bb421f05e52c905d645
|
data/lib/gemwarrior/battle.rb
CHANGED
@@ -143,17 +143,16 @@ module Gemwarrior
|
|
143
143
|
def take_damage(entity, dmg)
|
144
144
|
entity.hp_cur = entity.hp_cur.to_i - dmg.to_i
|
145
145
|
who_gets_wounded = ''
|
146
|
+
|
146
147
|
if entity.eql?(monster)
|
147
148
|
who_gets_wounded = "> You wound #{monster.name} for "
|
148
149
|
else
|
149
150
|
who_gets_wounded = "> You are wounded for "
|
150
151
|
end
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
end
|
156
|
-
return hit.join
|
152
|
+
|
153
|
+
print who_gets_wounded
|
154
|
+
Animation::run({ :phrase => dmg.to_s, :speed => :slow, :oneline => true, :alpha => false, :random => false })
|
155
|
+
print " point(s)!\n"
|
157
156
|
end
|
158
157
|
|
159
158
|
# MONSTER
|
@@ -227,7 +226,6 @@ module Gemwarrior
|
|
227
226
|
player.rox = player.rox + monster.rox
|
228
227
|
|
229
228
|
monster_items = monster.inventory.items
|
230
|
-
binding.pry
|
231
229
|
unless monster_items.nil?
|
232
230
|
player.inventory.items.concat monster_items unless monster_items.empty?
|
233
231
|
end
|
@@ -288,12 +286,7 @@ module Gemwarrior
|
|
288
286
|
# STATUS TEXT
|
289
287
|
|
290
288
|
def print_escape_text
|
291
|
-
|
292
|
-
print "* "
|
293
|
-
print "#{Matrext::process({ :phrase => TEXT_ESCAPE, :oneline => true })}"
|
294
|
-
print " *\n"
|
295
|
-
end
|
296
|
-
return escape.join
|
289
|
+
Animation::run({ :phrase => "* #{TEXT_ESCAPE} *", :oneline => true })
|
297
290
|
end
|
298
291
|
|
299
292
|
def print_battle_line
|
@@ -20,11 +20,7 @@ module Gemwarrior
|
|
20
20
|
puts 'You slowly lower your foot onto the tile, and then gently depress it, through the floor. Your whole body begins to feel light, lifeless. You black out.'
|
21
21
|
puts
|
22
22
|
|
23
|
-
|
24
|
-
print "#{Matrext::process({ :phrase => '*** SHOOOOOM ***', :oneline => true })}"
|
25
|
-
puts
|
26
|
-
end
|
27
|
-
t.join
|
23
|
+
Animation::run({ :phrase => '*** SHOOOOOM ***' })
|
28
24
|
|
29
25
|
{:type => 'move', :data => 'Sky Tower (Entrance)'}
|
30
26
|
end
|
@@ -20,11 +20,7 @@ module Gemwarrior
|
|
20
20
|
puts 'You move the switch from "No" to "Yes". Suddenly, a great wind picks up and you are gently lifted up by it. The ground moves away and your whole body begins to gently drift towards Emerald\'s compound high in the stratosphere.'
|
21
21
|
puts
|
22
22
|
|
23
|
-
|
24
|
-
print "#{Matrext::process({ :phrase => '*** WHOOOOOSH ***', :oneline => true })}"
|
25
|
-
puts
|
26
|
-
end
|
27
|
-
t.join
|
23
|
+
Animation::run({ :phrase => '*** WHOOOOOSH ***' })
|
28
24
|
|
29
25
|
{:type => 'move', :data => 'Sky Tower (Foyer)'}
|
30
26
|
end
|
@@ -174,19 +174,14 @@ module Gemwarrior
|
|
174
174
|
private
|
175
175
|
|
176
176
|
def player_death
|
177
|
-
puts '
|
177
|
+
puts 'Your actions have reduced you to death.'.colorize(:red)
|
178
178
|
puts 'Your adventure ends here. Try again next time!'.colorize(:red)
|
179
179
|
exit(0)
|
180
180
|
end
|
181
181
|
|
182
182
|
# TRAVEL
|
183
183
|
def print_traveling_text(direction_text)
|
184
|
-
|
185
|
-
print "* "
|
186
|
-
print "#{Matrext::process({ :phrase => direction_text, :oneline => true })}"
|
187
|
-
print " *\n"
|
188
|
-
end
|
189
|
-
return loc.join
|
184
|
+
Animation::run({:oneline => false, :phrase => "* #{direction_text} *"})
|
190
185
|
end
|
191
186
|
|
192
187
|
# CHARACTER
|
data/lib/gemwarrior/evaluator.rb
CHANGED
@@ -113,7 +113,7 @@ module Gemwarrior
|
|
113
113
|
end
|
114
114
|
when 'map', 'm'
|
115
115
|
world.print_map
|
116
|
-
when 'stat', 's'
|
116
|
+
when 'stat', 'st', 's'
|
117
117
|
if param1.nil?
|
118
118
|
puts ERROR_DEBUG_STAT_PARAM_MISSING
|
119
119
|
return DEBUG_STAT_PARAMS
|
@@ -121,7 +121,7 @@ module Gemwarrior
|
|
121
121
|
case param1
|
122
122
|
when 'atk_lo'
|
123
123
|
unless param2.nil?
|
124
|
-
param2.to_i
|
124
|
+
param2 = param2.to_i
|
125
125
|
if param2.is_a? Numeric
|
126
126
|
if param2 >= 0
|
127
127
|
world.player.atk_lo = param2
|
@@ -130,7 +130,7 @@ module Gemwarrior
|
|
130
130
|
end
|
131
131
|
when 'atk_hi'
|
132
132
|
unless param2.nil?
|
133
|
-
param2.to_i
|
133
|
+
param2 = param2.to_i
|
134
134
|
if param2.is_a? Numeric
|
135
135
|
if param2 >= 0
|
136
136
|
world.player.atk_hi = param2
|
@@ -139,7 +139,7 @@ module Gemwarrior
|
|
139
139
|
end
|
140
140
|
when 'strength', 'str', 'st'
|
141
141
|
unless param2.nil?
|
142
|
-
param2.to_i
|
142
|
+
param2 = param2.to_i
|
143
143
|
if param2.is_a? Numeric
|
144
144
|
if param2 >= 0
|
145
145
|
world.player.atk_lo = param2
|
@@ -149,7 +149,7 @@ module Gemwarrior
|
|
149
149
|
end
|
150
150
|
when 'dexterity', 'dex', 'd'
|
151
151
|
unless param2.nil?
|
152
|
-
param2.to_i
|
152
|
+
param2 = param2.to_i
|
153
153
|
if param2.is_a? Numeric
|
154
154
|
if param2 >= 0
|
155
155
|
world.player.dexterity = param2
|
data/lib/gemwarrior/game.rb
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
# lib/gemwarrior/animation.rb
|
2
|
+
# Animation routine
|
3
|
+
|
4
|
+
module Gemwarrior
|
5
|
+
module Animation
|
6
|
+
def self.run(opts)
|
7
|
+
options = {
|
8
|
+
:oneline => false,
|
9
|
+
:speed => nil,
|
10
|
+
:alpha => true,
|
11
|
+
:numeric => true,
|
12
|
+
:random => true
|
13
|
+
}.merge(opts)
|
14
|
+
|
15
|
+
th = Thread.new do
|
16
|
+
print Matrext::process({
|
17
|
+
:phrase => options.fetch(:phrase),
|
18
|
+
:oneline => options.fetch(:oneline),
|
19
|
+
:speed => options.fetch(:speed),
|
20
|
+
:alpha => options.fetch(:alpha),
|
21
|
+
:numeric => options.fetch(:numeric),
|
22
|
+
:random => options.fetch(:random)
|
23
|
+
})
|
24
|
+
end
|
25
|
+
|
26
|
+
return th.join
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemwarrior
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Chadwick
|
@@ -214,6 +214,7 @@ files:
|
|
214
214
|
- lib/gemwarrior/evaluator.rb
|
215
215
|
- lib/gemwarrior/game.rb
|
216
216
|
- lib/gemwarrior/inventory.rb
|
217
|
+
- lib/gemwarrior/misc/animation.rb
|
217
218
|
- lib/gemwarrior/misc/player_levels.rb
|
218
219
|
- lib/gemwarrior/misc/version.rb
|
219
220
|
- lib/gemwarrior/misc/wordlist.rb
|