forked from github/server
fix potion-use? need more testing
This commit is contained in:
parent
715c8569ba
commit
604b574d0f
|
@ -4,8 +4,7 @@
|
||||||
|
|
||||||
<!-- potions -->
|
<!-- potions -->
|
||||||
<resource name="p0" appearance="vial">
|
<resource name="p0" appearance="vial">
|
||||||
<item weight="0" score="30">
|
<item weight="0" score="30" use="yes">
|
||||||
<function name="use" value="usepotion"/>
|
|
||||||
<potion level="1"/>
|
<potion level="1"/>
|
||||||
<construction skill="alchemy" minskill="2">
|
<construction skill="alchemy" minskill="2">
|
||||||
<requirement type="h4"/>
|
<requirement type="h4"/>
|
||||||
|
@ -15,8 +14,7 @@
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="goliathwater" appearance="vial">
|
<resource name="goliathwater" appearance="vial">
|
||||||
<item weight="0" score="30">
|
<item weight="0" score="30" use="yes">
|
||||||
<function name="use" value="usepotion"/>
|
|
||||||
<potion level="1"/>
|
<potion level="1"/>
|
||||||
<construction skill="alchemy" minskill="2">
|
<construction skill="alchemy" minskill="2">
|
||||||
<requirement type="h6"/>
|
<requirement type="h6"/>
|
||||||
|
@ -26,8 +24,7 @@
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="truthpotion" appearance="vial">
|
<resource name="truthpotion" appearance="vial">
|
||||||
<item weight="0" score="30">
|
<item weight="0" score="30" use="yes">
|
||||||
<function name="use" value="usepotion"/>
|
|
||||||
<potion level="1"/>
|
<potion level="1"/>
|
||||||
<construction skill="alchemy" minskill="2">
|
<construction skill="alchemy" minskill="2">
|
||||||
<requirement type="h0"/>
|
<requirement type="h0"/>
|
||||||
|
@ -37,8 +34,7 @@
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="p2" appearance="vial">
|
<resource name="p2" appearance="vial">
|
||||||
<item weight="0" score="30">
|
<item weight="0" score="30" use="yes">
|
||||||
<function name="use" value="usepotion"/>
|
|
||||||
<potion level="1"/>
|
<potion level="1"/>
|
||||||
<construction skill="alchemy" minskill="2">
|
<construction skill="alchemy" minskill="2">
|
||||||
<requirement type="h5"/>
|
<requirement type="h5"/>
|
||||||
|
@ -48,8 +44,7 @@
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="p3" appearance="vial">
|
<resource name="p3" appearance="vial">
|
||||||
<item weight="0" score="60">
|
<item weight="0" score="60" use="yes">
|
||||||
<function name="use" value="usepotion"/>
|
|
||||||
<potion level="2"/>
|
<potion level="2"/>
|
||||||
<construction skill="alchemy" minskill="4">
|
<construction skill="alchemy" minskill="4">
|
||||||
<requirement type="h14"/>
|
<requirement type="h14"/>
|
||||||
|
@ -61,8 +56,7 @@
|
||||||
|
|
||||||
<resource name="ointment" appearance="vial">
|
<resource name="ointment" appearance="vial">
|
||||||
<!-- Wundsalbe -->
|
<!-- Wundsalbe -->
|
||||||
<item weight="0" score="60">
|
<item weight="0" score="60" use="yes">
|
||||||
<function name="use" value="usehealingpotion"/>
|
|
||||||
<potion level="2"/>
|
<potion level="2"/>
|
||||||
<construction skill="alchemy" minskill="4">
|
<construction skill="alchemy" minskill="4">
|
||||||
<requirement type="h19"/>
|
<requirement type="h19"/>
|
||||||
|
@ -74,8 +68,7 @@
|
||||||
|
|
||||||
<resource name="peasantblood" appearance="vial">
|
<resource name="peasantblood" appearance="vial">
|
||||||
<!-- Bauernblut -->
|
<!-- Bauernblut -->
|
||||||
<item weight="0" score="60">
|
<item weight="0" score="60" use="yes">
|
||||||
<function name="use" value="usebloodpotion"/>
|
|
||||||
<potion level="2"/>
|
<potion level="2"/>
|
||||||
<construction skill="alchemy" minskill="4">
|
<construction skill="alchemy" minskill="4">
|
||||||
<requirement type="h17"/>
|
<requirement type="h17"/>
|
||||||
|
@ -87,8 +80,7 @@
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="p6" appearance="vial">
|
<resource name="p6" appearance="vial">
|
||||||
<item weight="0" score="90">
|
<item weight="0" score="90" use="yes">
|
||||||
<function name="use" value="usepotion"/>
|
|
||||||
<potion level="3"/>
|
<potion level="3"/>
|
||||||
<construction skill="alchemy" minskill="6">
|
<construction skill="alchemy" minskill="6">
|
||||||
<requirement type="h9"/>
|
<requirement type="h9"/>
|
||||||
|
@ -100,8 +92,7 @@
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="p7" appearance="vial">
|
<resource name="p7" appearance="vial">
|
||||||
<item weight="0" score="90">
|
<item weight="0" score="90" use="yes">
|
||||||
<function name="use" value="usefoolpotion"/>
|
|
||||||
<potion level="3"/>
|
<potion level="3"/>
|
||||||
<construction skill="alchemy" minskill="6">
|
<construction skill="alchemy" minskill="6">
|
||||||
<requirement type="h2"/>
|
<requirement type="h2"/>
|
||||||
|
@ -113,8 +104,7 @@
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="nestwarmth" appearance="vial">
|
<resource name="nestwarmth" appearance="vial">
|
||||||
<item weight="0" score="90">
|
<item weight="0" score="90" use="yes">
|
||||||
<function name="use" value="usewarmthpotion"/>
|
|
||||||
<potion level="3"/>
|
<potion level="3"/>
|
||||||
<construction skill="alchemy" minskill="6">
|
<construction skill="alchemy" minskill="6">
|
||||||
<requirement type="h18"/>
|
<requirement type="h18"/>
|
||||||
|
@ -126,8 +116,7 @@
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="p9" appearance="vial">
|
<resource name="p9" appearance="vial">
|
||||||
<item weight="0" score="90">
|
<item weight="0" score="90" use="yes">
|
||||||
<function name="use" value="usepotion"/>
|
|
||||||
<potion level="3"/>
|
<potion level="3"/>
|
||||||
<construction skill="alchemy" minskill="6">
|
<construction skill="alchemy" minskill="6">
|
||||||
<requirement type="h4"/>
|
<requirement type="h4"/>
|
||||||
|
@ -139,8 +128,7 @@
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="p10" appearance="vial">
|
<resource name="p10" appearance="vial">
|
||||||
<item weight="0" score="90">
|
<item weight="0" score="90" use="yes">
|
||||||
<function name="use" value="usepotion"/>
|
|
||||||
<potion level="3"/>
|
<potion level="3"/>
|
||||||
<construction skill="alchemy" minskill="6">
|
<construction skill="alchemy" minskill="6">
|
||||||
<requirement type="h19"/>
|
<requirement type="h19"/>
|
||||||
|
@ -152,8 +140,7 @@
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="p11" appearance="vial">
|
<resource name="p11" appearance="vial">
|
||||||
<item weight="0" score="120">
|
<item weight="0" score="120" use="yes">
|
||||||
<function name="use" value="usepotion"/>
|
|
||||||
<potion level="4"/>
|
<potion level="4"/>
|
||||||
<construction skill="alchemy" minskill="8">
|
<construction skill="alchemy" minskill="8">
|
||||||
<requirement type="h14"/>
|
<requirement type="h14"/>
|
||||||
|
@ -166,8 +153,7 @@
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="p13" appearance="vial">
|
<resource name="p13" appearance="vial">
|
||||||
<item weight="0" score="120">
|
<item weight="0" score="120" use="yes">
|
||||||
<function name="use" value="usepotion"/>
|
|
||||||
<potion level="4"/>
|
<potion level="4"/>
|
||||||
<construction skill="alchemy" minskill="8">
|
<construction skill="alchemy" minskill="8">
|
||||||
<requirement type="h5"/>
|
<requirement type="h5"/>
|
||||||
|
@ -181,8 +167,7 @@
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="p14" appearance="vial">
|
<resource name="p14" appearance="vial">
|
||||||
<item weight="0" score="120">
|
<item weight="0" score="120" use="yes">
|
||||||
<function name="use" value="usepotion"/>
|
|
||||||
<potion level="4"/>
|
<potion level="4"/>
|
||||||
<construction skill="alchemy" minskill="8">
|
<construction skill="alchemy" minskill="8">
|
||||||
<requirement type="h6"/>
|
<requirement type="h6"/>
|
||||||
|
|
|
@ -7,64 +7,56 @@
|
||||||
|
|
||||||
<resource name="ointment" appearance="vial">
|
<resource name="ointment" appearance="vial">
|
||||||
<!-- Wundsalbe -->
|
<!-- Wundsalbe -->
|
||||||
<item weight="0" score="60">
|
<item weight="0" score="60" use="yes">
|
||||||
<function name="use" value="usehealingpotion"/>
|
|
||||||
<potion level="2"/>
|
<potion level="2"/>
|
||||||
</item>
|
</item>
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="p13" appearance="vial">
|
<resource name="p13" appearance="vial">
|
||||||
<!-- Elixier der Macht -->
|
<!-- Elixier der Macht -->
|
||||||
<item weight="0" score="120">
|
<item weight="0" score="120" use="yes">
|
||||||
<function name="use" value="usepotion"/>
|
|
||||||
<potion level="4"/>
|
<potion level="4"/>
|
||||||
</item>
|
</item>
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="p3" appearance="vial">
|
<resource name="p3" appearance="vial">
|
||||||
<!-- Schaffenstrunk -->
|
<!-- Schaffenstrunk -->
|
||||||
<item weight="0" score="60">
|
<item weight="0" score="60" use ="yes">
|
||||||
<function name="use" value="usepotion"/>
|
|
||||||
<potion level="2"/>
|
<potion level="2"/>
|
||||||
</item>
|
</item>
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="p14" appearance="vial">
|
<resource name="p14" appearance="vial">
|
||||||
<!-- Heiltrank -->
|
<!-- Heiltrank -->
|
||||||
<item weight="0" score="120">
|
<item weight="0" score="120" use="yes">
|
||||||
<function name="use" value="usepotion"/>
|
|
||||||
<potion level="4"/>
|
<potion level="4"/>
|
||||||
</item>
|
</item>
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="p0" appearance="vial">
|
<resource name="p0" appearance="vial">
|
||||||
<!-- Siebenmeilentee -->
|
<!-- Siebenmeilentee -->
|
||||||
<item weight="0" score="30">
|
<item weight="0" score="30" use="yes">
|
||||||
<function name="use" value="usepotion"/>
|
|
||||||
<potion level="1"/>
|
<potion level="1"/>
|
||||||
</item>
|
</item>
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="p2" appearance="vial">
|
<resource name="p2" appearance="vial">
|
||||||
<!-- Wasser des Lebens -->
|
<!-- Wasser des Lebens -->
|
||||||
<item weight="0" score="30">
|
<item weight="0" score="30" use="yes">
|
||||||
<function name="use" value="usepotion_delayed"/>
|
|
||||||
<potion level="1"/>
|
<potion level="1"/>
|
||||||
</item>
|
</item>
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="peasantblood" appearance="vial">
|
<resource name="peasantblood" appearance="vial">
|
||||||
<!-- Bauernblut -->
|
<!-- Bauernblut -->
|
||||||
<item weight="0" score="60">
|
<item weight="0" score="60" use="yes">
|
||||||
<function name="use" value="usebloodpotion"/>
|
|
||||||
<potion level="2"/>
|
<potion level="2"/>
|
||||||
</item>
|
</item>
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource name="p9" appearance="vial">
|
<resource name="p9" appearance="vial">
|
||||||
<!-- Pferdeglück -->
|
<!-- Pferdeglück -->
|
||||||
<item weight="0" score="90">
|
<item weight="0" score="90" use="yes">
|
||||||
<function name="use" value="usepotion"/>
|
|
||||||
<potion level="3"/>
|
<potion level="3"/>
|
||||||
</item>
|
</item>
|
||||||
</resource>
|
</resource>
|
||||||
|
|
|
@ -230,6 +230,21 @@ function test_no_uruk()
|
||||||
assert_equal(f1.race, "orc")
|
assert_equal(f1.race, "orc")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function test_ointment()
|
||||||
|
local r = region.create(0, 0, "plain")
|
||||||
|
local f = faction.create("noreply@eressea.de", "human", "de")
|
||||||
|
local u = unit.create(f, r, 1)
|
||||||
|
local hp = u.hp
|
||||||
|
u.hp = 0
|
||||||
|
u:add_item("ointment", 1)
|
||||||
|
u:clear_orders()
|
||||||
|
u:add_order("BENUTZEN 1 Wundsalbe")
|
||||||
|
process_orders()
|
||||||
|
assert_equal(0, u:get_item("ointment"))
|
||||||
|
assert_equal(1, f:count_msg_type('usepotion'))
|
||||||
|
assert_equal(hp, u.hp)
|
||||||
|
end
|
||||||
|
|
||||||
function test_bloodpotion_demon()
|
function test_bloodpotion_demon()
|
||||||
local r = region.create(0, 0, "plain")
|
local r = region.create(0, 0, "plain")
|
||||||
local f = faction.create("noreply@eressea.de", "demon", "de")
|
local f = faction.create("noreply@eressea.de", "demon", "de")
|
||||||
|
|
|
@ -1287,13 +1287,12 @@ void register_resources(void)
|
||||||
register_function((pf_generic)res_changehp, "changehp");
|
register_function((pf_generic)res_changehp, "changehp");
|
||||||
register_function((pf_generic)res_changeaura, "changeaura");
|
register_function((pf_generic)res_changeaura, "changeaura");
|
||||||
|
|
||||||
register_item_use(use_potion, "usepotion");
|
register_item_use(use_potion_delayed, "use_p2");
|
||||||
register_item_use(use_potion_delayed, "usepotion_delayed");
|
|
||||||
register_item_use(use_tacticcrystal, "use_tacticcrystal");
|
register_item_use(use_tacticcrystal, "use_tacticcrystal");
|
||||||
register_item_use(use_birthdayamulet, "use_birthdayamulet");
|
register_item_use(use_birthdayamulet, "use_birthdayamulet");
|
||||||
register_item_use(use_warmthpotion, "usewarmthpotion");
|
register_item_use(use_warmthpotion, "use_nestwarmth");
|
||||||
register_item_use(use_bloodpotion, "use_peasantblood");
|
register_item_use(use_bloodpotion, "use_peasantblood");
|
||||||
register_item_use(use_healingpotion, "usehealingpotion");
|
register_item_use(use_healingpotion, "use_ointment");
|
||||||
register_item_use(use_foolpotion, "use_p7");
|
register_item_use(use_foolpotion, "use_p7");
|
||||||
register_item_use(use_mistletoe, "usemistletoe");
|
register_item_use(use_mistletoe, "usemistletoe");
|
||||||
register_item_use(use_magicboost, "usemagicboost");
|
register_item_use(use_magicboost, "usemagicboost");
|
||||||
|
|
Loading…
Reference in New Issue