test for aurapotion

This commit is contained in:
Enno Rehling 2017-02-27 14:17:38 +01:00
parent 5ffe60193b
commit db0cbf34c7
2 changed files with 18 additions and 1 deletions

View File

@ -242,6 +242,23 @@ function test_meow()
assert_equal(1, r:count_msg_type('meow'))
end
function test_aurapotion50()
eressea.settings.set("magic.regeneration.enable", "0")
local r = region.create(0, 0, "plain")
local f = faction.create("noreply@eressea.de", "human", "de")
local u = unit.create(f, r, 1)
u:add_item("aurapotion50", 1)
u:set_skill('magic', 10);
u.magic = 'gwyrrd'
u.aura = 0
u:clear_orders()
u:add_order("BENUTZEN 1 Auratrank")
process_orders()
assert_equal(0, u:get_item("aurapotion50"))
assert_equal(1, f:count_msg_type('aurapotion50'))
assert_equal(50, u.aura)
end
function test_ointment()
local r = region.create(0, 0, "plain")
local f = faction.create("noreply@eressea.de", "human", "de")

View File

@ -393,9 +393,9 @@ void register_itemfunctions(void)
register_item_use(use_speedsail, "use_speedsail");
register_item_use(use_instantartacademy, "use_instantartacademy");
register_item_use(use_bagpipeoffear, "use_bagpipeoffear");
register_item_use(use_aurapotion50, "use_aurapotion50");
/* have tests: */
register_item_use(use_aurapotion50, "use_aurapotion50");
register_item_use(use_birthdayamulet, "use_aoc");
register_item_use(use_foolpotion, "use_p7");
register_item_use(use_bloodpotion, "use_peasantblood");