Create the snowman with full hitpoints.

https://bugs.eressea.de/view.php?id=2239
This commit is contained in:
Enno Rehling 2016-10-02 11:42:31 +02:00
parent 59d145c4b5
commit 5a129f8bd4
3 changed files with 4 additions and 6 deletions

View File

@ -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")

View File

@ -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

View File

@ -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