Skip to content

Commit

Permalink
intermittent hunting: does u1 take damage?
Browse files Browse the repository at this point in the history
  • Loading branch information
ennorehling committed Dec 30, 2023
1 parent 239a06f commit 1e9f0fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/tests/e2/battle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ function test_ship_damage_catapult()
local sh = ship.create(r, "caravel")
local f1 = faction.create('human')
local u1 = unit.create(f1, r, 20)
u1.hp = u1.hp * 100
local hp = u1.hp * 100
u1.hp = hp
u1.ship = sh
local f2 = faction.create('human')
local u2 = unit.create(f2, r)
Expand All @@ -69,6 +70,7 @@ function test_ship_damage_catapult()
u2:add_item('catapultammo', 10)
assert_equal(0, sh.damage)
process_orders()
assert_not_equal(hp, u1.hp) -- u1 should have taken damage
assert_not_equal(0, sh.damage) -- intermittent!
end

Expand Down

0 comments on commit 1e9f0fb

Please sign in to comment.