Skip to content

Commit 216c657

Browse files
committed
making bomb do 4 damage in center and 2 around it
1 parent c44b6ba commit 216c657

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

lib/ruby_warrior/abilities/look.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module RubyWarrior
22
module Abilities
33
class Look < Base
44
def description
5-
"Returns an array of Spaces in the given direction (forward by default)."
5+
"Returns an array of up to three Spaces in the given direction (forward by default)."
66
end
77

88
def perform(direction = :forward)

lib/ruby_warrior/abilities/throw.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ def description
88
def perform(direction = :forward)
99
if @unit.position
1010
@unit.say "throws a bomb #{direction}"
11-
bomb(direction, 2, 0, 10)
11+
bomb(direction, 2, 0, 4)
1212
[[2, 1], [2, -1], [3, 0], [1, 0]].each do |x, y|
13-
bomb(direction, x, y, 1)
13+
bomb(direction, x, y, 2)
1414
end
1515
end
1616
end

spec/ruby_warrior/abilities/throw_spec.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,28 @@
1010
@throw = RubyWarrior::Abilities::Throw.new(@warrior)
1111
end
1212

13-
it "should subtract 10 from unit two spaces forward and 1 from units surrounding that space" do
13+
it "should subtract 4 from unit two spaces forward and 2 from units surrounding that space" do
1414
target_unit = RubyWarrior::Units::Base.new
1515
target_unit.health = 15
1616
second_unit = RubyWarrior::Units::Base.new
1717
second_unit.health = 15
1818
@floor.add(target_unit, 0, 2)
1919
@floor.add(second_unit, 1, 2)
2020
@throw.perform
21-
target_unit.health.should == 5
22-
second_unit.health.should == 14
21+
target_unit.health.should == 11
22+
second_unit.health.should == 13
2323
end
2424

25-
it "should subtract 10 from unit two spaces left and 1 from units surrounding that space" do
25+
it "should subtract 4 from unit two spaces left and 2 from units surrounding that space" do
2626
target_unit = RubyWarrior::Units::Base.new
2727
target_unit.health = 15
2828
second_unit = RubyWarrior::Units::Base.new
2929
second_unit.health = 15
3030
@floor.add(target_unit, 2, 0)
3131
@floor.add(second_unit, 2, 1)
3232
@throw.perform(:left)
33-
target_unit.health.should == 5
34-
second_unit.health.should == 14
33+
target_unit.health.should == 11
34+
second_unit.health.should == 13
3535
end
3636

3737
it "should detonate an explosive if any unit has one" do

0 commit comments

Comments
 (0)