also allow GIVE for ghouls and skeletons.

This commit is contained in:
Enno Rehling 2017-07-09 15:25:33 +02:00
parent 60efb12d70
commit 2107a84b0d
3 changed files with 29 additions and 5 deletions

View File

@ -750,7 +750,7 @@
<attack type="2" damage="1d30"/> <attack type="2" damage="1d30"/>
</race> </race>
<race name="ghoul" magres="30" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="30" ac="1" damage="1d7" unarmedattack="3" unarmeddefense="3" attackmodifier="3" defensemodifier="3" scarepeasants="yes" walk="yes" canlearn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes"> <race name="ghoul" magres="30" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="30" ac="1" damage="1d7" unarmedattack="3" unarmeddefense="3" attackmodifier="3" defensemodifier="3" scarepeasants="yes" walk="yes" canlearn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" giveperson="yes">
<ai splitsize="10000" killpeasants="yes" moverandom="yes"/> <ai splitsize="10000" killpeasants="yes" moverandom="yes"/>
<skill name="crossbow" modifier="1"/> <skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/> <skill name="bow" modifier="1"/>
@ -812,7 +812,7 @@
<attack type="1" damage="1d7"/> <attack type="1" damage="1d7"/>
</race> </race>
<race name="skeleton" magres="10" maxaura="1.0" regaura="1.0" weight="500" capacity="540" speed="1.0" hp="20" ac="1" damage="1d7" unarmedattack="1" unarmeddefense="1" attackmodifier="6" defensemodifier="6" scarepeasants="yes" walk="yes" canlearn="no" teach="no" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes"> <race name="skeleton" magres="10" maxaura="1.0" regaura="1.0" weight="500" capacity="540" speed="1.0" hp="20" ac="1" damage="1d7" unarmedattack="1" unarmeddefense="1" attackmodifier="6" defensemodifier="6" scarepeasants="yes" walk="yes" canlearn="no" teach="no" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<ai splitsize="10000" killpeasants="yes" moverandom="yes"/> <ai splitsize="10000" killpeasants="yes" moverandom="yes"/>
<skill name="crossbow" modifier="1"/> <skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/> <skill name="bow" modifier="1"/>

View File

@ -1000,7 +1000,7 @@
<attack type="2" damage="1d30"/> <attack type="2" damage="1d30"/>
<attack type="2" damage="1d30"/> <attack type="2" damage="1d30"/>
</race> </race>
<race name="ghoul" magres="30" maxaura="1.000000" regaura="1.000000" weight="1000" capacity="540" speed="1.000000" hp="30" ac="1" damage="1d7" unarmedattack="3" unarmeddefense="3" attackmodifier="3" defensemodifier="3" scarepeasants="yes" walk="yes" canlearn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes"> <race name="ghoul" magres="30" maxaura="1.000000" regaura="1.000000" weight="1000" capacity="540" speed="1.000000" hp="30" ac="1" damage="1d7" unarmedattack="3" unarmeddefense="3" attackmodifier="3" defensemodifier="3" scarepeasants="yes" walk="yes" canlearn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" giveperson="yes">
<ai splitsize="10000" killpeasants="yes" moverandom="yes"/> <ai splitsize="10000" killpeasants="yes" moverandom="yes"/>
<skill name="crossbow" modifier="1"/> <skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/> <skill name="bow" modifier="1"/>
@ -1058,7 +1058,7 @@
<attack type="1" damage="1d7"/> <attack type="1" damage="1d7"/>
<attack type="1" damage="1d7"/> <attack type="1" damage="1d7"/>
</race> </race>
<race name="skeleton" magres="10" maxaura="1.000000" regaura="1.000000" weight="500" capacity="540" speed="1.000000" hp="20" ac="1" damage="1d7" unarmedattack="1" unarmeddefense="1" attackmodifier="6" defensemodifier="6" scarepeasants="yes" walk="yes" canlearn="no" teach="no" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes"> <race name="skeleton" magres="10" maxaura="1.000000" regaura="1.000000" weight="500" capacity="540" speed="1.000000" hp="20" ac="1" damage="1d7" unarmedattack="1" unarmeddefense="1" attackmodifier="6" defensemodifier="6" scarepeasants="yes" walk="yes" canlearn="no" teach="no" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<ai splitsize="10000" killpeasants="yes" moverandom="yes"/> <ai splitsize="10000" killpeasants="yes" moverandom="yes"/>
<skill name="crossbow" modifier="1"/> <skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/> <skill name="bow" modifier="1"/>

View File

@ -54,7 +54,7 @@ function test_give_other_zombie_fail()
end end
function test_give_self_zombie_okay() function test_give_self_zombie_okay()
-- allow giving undead units to own units of same race -- allow giving zombie units to own units of same race
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, "zombie") local u1 = unit.create(f, r, 2, "zombie")
@ -64,3 +64,27 @@ function test_give_self_zombie_okay()
assert_equal(1, u1.number) assert_equal(1, u1.number)
assert_equal(2, u2.number) assert_equal(2, u2.number)
end end
function test_give_self_skeleton_okay()
-- allow giving skeleton units to own units of same race
local r = region.create(0, 0, "plain")
local f = faction.create("human")
local u1 = unit.create(f, r, 2, "skeleton")
local u2 = unit.create(f, r, 1, "skeleton")
u1:add_order("GIB " .. itoa36(u2.id) .. " 1 PERSON")
process_orders()
assert_equal(1, u1.number)
assert_equal(2, u2.number)
end
function test_give_self_ghoul_okay()
-- allow giving ghoul units to own units of same race
local r = region.create(0, 0, "plain")
local f = faction.create("human")
local u1 = unit.create(f, r, 2, "ghoul")
local u2 = unit.create(f, r, 1, "ghoul")
u1:add_order("GIB " .. itoa36(u2.id) .. " 1 PERSON")
process_orders()
assert_equal(1, u1.number)
assert_equal(2, u2.number)
end