Skip to content

Commit 9c3b8a2

Browse files
committed
adding intermediate level 8
1 parent 04df8b9 commit 9c3b8a2

File tree

6 files changed

+29
-4
lines changed

6 files changed

+29
-4
lines changed

CHANGELOG.rdoc

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Adding intermediate level 8 with look and detonate abilities
2+
13
* Raising an exception when performing an ability with a bad direction.
24

35
* Hard wrapping clue text to 80 characters

lib/ruby_warrior/abilities/base.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def pass_turn
3636

3737
def verify_direction(direction)
3838
unless Position::RELATIVE_DIRECTIONS.include? direction
39-
raise "Unknown direction \"#{direction}\". Should be :forward, :backward, :left or :right."
39+
raise "Unknown direction #{direction.inspect}. Should be :forward, :backward, :left or :right."
4040
end
4141
end
4242
end

lib/ruby_warrior/abilities/detonate.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def description
88
def perform(direction = :forward)
99
verify_direction(direction)
1010
if @unit.position
11-
@unit.say "detonates a bomb #{direction}"
11+
@unit.say "detonates a bomb #{direction} launching a deadly explosion."
1212
bomb(direction, 1, 0, 8)
1313
[[1, 1], [1, -1], [2, 0], [0, 0]].each do |x, y|
1414
bomb(direction, x, y, 4)

spec/ruby_warrior/abilities/base_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@
3333
it "should raise an exception if direction isn't recognized" do
3434
lambda {
3535
@ability.verify_direction(:foo)
36-
}.should raise_error("Unknown direction \"foo\". Should be :forward, :backward, :left or :right.")
36+
}.should raise_error("Unknown direction :foo. Should be :forward, :backward, :left or :right.")
3737
end
3838
end

towers/intermediate/level_007.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
description "Another ticking sound, but some sludge is blocking the way."
88
tip "Quickly kill the sludge and rescue the captive before the bomb goes off. You can't simply go around them."
9-
clue "You'll need to bind the two other sludge first before killing the one blocking the way to the ticking captive."
9+
clue "Determine the direction of the ticking captive and kill any enemies blocking that path. You may need to bind surrounding enemies first."
1010

1111
time_bonus 70
1212
ace_score 134

towers/intermediate/level_008.rb

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# -------
2+
# |@ Ss C>|
3+
# -------
4+
5+
description "You discover a satchel of bombs which will help when facing a mob of enemies."
6+
tip "Detonate a bomb when you see a couple enemies ahead of you (warrior.look). Watch out for your health too."
7+
clue "Calling warrior.look will return an array of Spaces. If the first two contain enemies, detonate a bomb with warrior.detonate!."
8+
9+
time_bonus 30
10+
size 7, 1
11+
stairs 6, 0
12+
13+
warrior 0, 0, :east do |u|
14+
u.add_abilities :look
15+
u.add_abilities :detonate!
16+
end
17+
18+
unit :captive, 5, 0, :west do |u|
19+
u.add_abilities :explode!
20+
u.abilities[:explode!].time = 9
21+
end
22+
unit :thick_sludge, 2, 0, :west
23+
unit :sludge, 3, 0, :west

0 commit comments

Comments
 (0)