Browse files

adding intermediate level 8

  • Loading branch information...
1 parent 04df8b9 commit 9c3b8a236ea4ca1590b0dc0004fede77859595ee @ryanb committed Jun 4, 2010
View
2 CHANGELOG.rdoc
@@ -1,3 +1,5 @@
+* Adding intermediate level 8 with look and detonate abilities
+
* Raising an exception when performing an ability with a bad direction.
* Hard wrapping clue text to 80 characters
View
2 lib/ruby_warrior/abilities/base.rb
@@ -36,7 +36,7 @@ def pass_turn
def verify_direction(direction)
unless Position::RELATIVE_DIRECTIONS.include? direction
- raise "Unknown direction \"#{direction}\". Should be :forward, :backward, :left or :right."
+ raise "Unknown direction #{direction.inspect}. Should be :forward, :backward, :left or :right."
end
end
end
View
2 lib/ruby_warrior/abilities/detonate.rb
@@ -8,7 +8,7 @@ def description
def perform(direction = :forward)
verify_direction(direction)
if @unit.position
- @unit.say "detonates a bomb #{direction}"
+ @unit.say "detonates a bomb #{direction} launching a deadly explosion."
bomb(direction, 1, 0, 8)
[[1, 1], [1, -1], [2, 0], [0, 0]].each do |x, y|
bomb(direction, x, y, 4)
View
2 spec/ruby_warrior/abilities/base_spec.rb
@@ -33,6 +33,6 @@
it "should raise an exception if direction isn't recognized" do
lambda {
@ability.verify_direction(:foo)
- }.should raise_error("Unknown direction \"foo\". Should be :forward, :backward, :left or :right.")
+ }.should raise_error("Unknown direction :foo. Should be :forward, :backward, :left or :right.")
end
end
View
2 towers/intermediate/level_007.rb
@@ -6,7 +6,7 @@
description "Another ticking sound, but some sludge is blocking the way."
tip "Quickly kill the sludge and rescue the captive before the bomb goes off. You can't simply go around them."
-clue "You'll need to bind the two other sludge first before killing the one blocking the way to the ticking captive."
+clue "Determine the direction of the ticking captive and kill any enemies blocking that path. You may need to bind surrounding enemies first."
time_bonus 70
ace_score 134
View
23 towers/intermediate/level_008.rb
@@ -0,0 +1,23 @@
+# -------
+# |@ Ss C>|
+# -------
+
+description "You discover a satchel of bombs which will help when facing a mob of enemies."
+tip "Detonate a bomb when you see a couple enemies ahead of you (warrior.look). Watch out for your health too."
+clue "Calling warrior.look will return an array of Spaces. If the first two contain enemies, detonate a bomb with warrior.detonate!."
+
+time_bonus 30
+size 7, 1
+stairs 6, 0
+
+warrior 0, 0, :east do |u|
+ u.add_abilities :look
+ u.add_abilities :detonate!
+end
+
+unit :captive, 5, 0, :west do |u|
+ u.add_abilities :explode!
+ u.abilities[:explode!].time = 9
+end
+unit :thick_sludge, 2, 0, :west
+unit :sludge, 3, 0, :west

0 comments on commit 9c3b8a2

Please sign in to comment.