forked from github/server
Merge pull request #589 from ennorehling/develop
Bug 2239: create snowman with full hitpoints
This commit is contained in:
commit
165bd6acaf
|
@ -25,11 +25,10 @@ function ponnuki.init()
|
|||
local home = get_region(-67, -5)
|
||||
local f = get_faction(666)
|
||||
if home and f then
|
||||
u = add_unit(f, home)
|
||||
u = unit.create(f, home, 1, "illusion")
|
||||
u.id = atoi36("ponn")
|
||||
u.name = "Ponnuki"
|
||||
u.info = "Go, Ponnuki, Go!"
|
||||
u.race = "illusion"
|
||||
u:set_racename("Ritter von Go")
|
||||
else
|
||||
eressea.log.error("Ponnuki cannot find Magrathea")
|
||||
|
|
|
@ -62,9 +62,7 @@ end
|
|||
|
||||
function use_snowman(u, amount)
|
||||
if amount>0 and u.region.terrain == "glacier" then
|
||||
local man = unit.create(u.faction, u.region)
|
||||
man.race = "snowman"
|
||||
man.number = amount
|
||||
local man = unit.create(u.faction, u.region, amount, "snowman")
|
||||
return amount
|
||||
end
|
||||
return -4
|
||||
|
|
|
@ -215,7 +215,8 @@ function test_snowman()
|
|||
process_orders()
|
||||
for u2 in r.units do
|
||||
if u2.id~=u.id then
|
||||
assert_equal(u2.race, "snowman")
|
||||
assert_equal("snowman", u2.race)
|
||||
assert_equal(1000, u2.hp)
|
||||
u = nil
|
||||
break
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue