allow GIVE PERSON for undead race, too

This commit is contained in:
Enno Rehling 2017-07-22 12:36:01 +02:00
parent 572073f084
commit 3445e376e0
4 changed files with 13 additions and 9 deletions

View File

@ -700,7 +700,11 @@
<attack type="4" damage="2d12"/> <attack type="4" damage="2d12"/>
</race> </race>
<race name="undead" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="20" damage="1d7" unarmedattack="0" unarmeddefense="0" attackmodifier="1" defensemodifier="1" scarepeasants="yes" walk="yes" canlearn="no" teach="no" noheal="yes" undead="yes" equipment="yes"> <race name="undead" maxaura="1.0" regaura="1.0" weight="1000"
capacity="540" speed="1.0" hp="20" damage="1d7" unarmedattack="0"
unarmeddefense="0" attackmodifier="1" defensemodifier="1"
scarepeasants="yes" walk="yes" canlearn="no" teach="no" noheal="yes"
undead="yes" equipment="yes" giveperson="yes">
<ai splitsize="20000" moverandom="yes"/> <ai splitsize="20000" moverandom="yes"/>
<attack type="4" damage="1d7"/> <attack type="4" damage="1d7"/>
<attack type="5"/> <attack type="5"/>

View File

@ -732,7 +732,7 @@
<attack type="4" damage="1d30"/> <attack type="4" damage="1d30"/>
<attack type="6" spell="fiery_dragonbreath" level="3" /> <attack type="6" spell="fiery_dragonbreath" level="3" />
</race> </race>
<race name="undead" maxaura="1.000000" regaura="1.000000" weight="1000" capacity="540" speed="1.000000" hp="20" damage="1d7" unarmedattack="0" unarmeddefense="0" attackmodifier="1" defensemodifier="1" scarepeasants="yes" walk="yes" canlearn="no" teach="no" noheal="yes" undead="yes" equipment="yes"> <race name="undead" maxaura="1.000000" regaura="1.000000" weight="1000" capacity="540" speed="1.000000" hp="20" damage="1d7" unarmedattack="0" unarmeddefense="0" attackmodifier="1" defensemodifier="1" scarepeasants="yes" walk="yes" canlearn="no" teach="no" noheal="yes" undead="yes" equipment="yes" giveperson="yes">
<ai splitsize="20000" moverandom="yes"/> <ai splitsize="20000" moverandom="yes"/>
<attack type="4" damage="1d7"/> <attack type="4" damage="1d7"/>
<attack type="5"/> <attack type="5"/>

View File

@ -18,11 +18,11 @@ function test_undead_give_item()
assert_equal(0, u1:get_item("log")) assert_equal(0, u1:get_item("log"))
end end
function test_undead_dont_give_person() function test_clones_dont_give_person()
local r1 = region.create(0, 0, "plain") local r1 = region.create(0, 0, "plain")
local f1 = faction.create("human", "hodor@eressea.de", "de") local f1 = faction.create("human", "hodor@eressea.de", "de")
local u1 = unit.create(f1, r1, 2) local u1 = unit.create(f1, r1, 2)
u1.race = "undead" u1.race = "clone"
u1:clear_orders() u1:clear_orders()
u1:add_item("log", 1) u1:add_item("log", 1)
u1:add_order("GIB 0 1 Person") u1:add_order("GIB 0 1 Person")

View File

@ -21,16 +21,16 @@ function test_give_undead_to_self()
local u2 = unit.create(f, r, 1, "undead") local u2 = unit.create(f, r, 1, "undead")
u1:add_order("GIB " .. itoa36(u2.id) .. " 1 PERSON") u1:add_order("GIB " .. itoa36(u2.id) .. " 1 PERSON")
process_orders() process_orders()
assert_equal(2, u1.number) assert_equal(1, u1.number)
assert_equal(1, u2.number) assert_equal(2, u2.number)
end end
function test_give_self_undead_fail() function test_give_self_clone_fail()
-- disallow giving basic undead units -- disallow giving basic undead units
local r = region.create(0, 0, "plain") local r = region.create(0, 0, "plain")
local f = faction.create("human") local f = faction.create("human")
local u1 = unit.create(f, r, 2, "undead") local u1 = unit.create(f, r, 2, "clone")
local u2 = unit.create(f, r, 1, "undead") local u2 = unit.create(f, r, 1, "clone")
u1:add_order("GIB " .. itoa36(u2.id) .. " 1 PERSON") u1:add_order("GIB " .. itoa36(u2.id) .. " 1 PERSON")
process_orders() process_orders()
assert_equal(2, u1.number) assert_equal(2, u1.number)