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 home = get_region(-67, -5)
local f = get_faction(666) local f = get_faction(666)
if home and f then if home and f then
u = add_unit(f, home) u = unit.create(f, home, 1, "illusion")
u.id = atoi36("ponn") u.id = atoi36("ponn")
u.name = "Ponnuki" u.name = "Ponnuki"
u.info = "Go, Ponnuki, Go!" u.info = "Go, Ponnuki, Go!"
u.race = "illusion"
u:set_racename("Ritter von Go") u:set_racename("Ritter von Go")
else else
eressea.log.error("Ponnuki cannot find Magrathea") eressea.log.error("Ponnuki cannot find Magrathea")

View File

@ -62,9 +62,7 @@ end
function use_snowman(u, amount) function use_snowman(u, amount)
if amount>0 and u.region.terrain == "glacier" then if amount>0 and u.region.terrain == "glacier" then
local man = unit.create(u.faction, u.region) local man = unit.create(u.faction, u.region, amount, "snowman")
man.race = "snowman"
man.number = amount
return amount return amount
end end
return -4 return -4

View File

@ -215,7 +215,8 @@ function test_snowman()
process_orders() process_orders()
for u2 in r.units do for u2 in r.units do
if u2.id~=u.id then if u2.id~=u.id then
assert_equal(u2.race, "snowman") assert_equal("snowman", u2.race)
assert_equal(1000, u2.hp)
u = nil u = nil
break break
end end