forked from github/server
Create the snowman with full hitpoints.
https://bugs.eressea.de/view.php?id=2239
This commit is contained in:
parent
59d145c4b5
commit
5a129f8bd4
|
@ -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")
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue