From db0cbf34c713a25ff2c8743ad808a5a94577c2a6 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 27 Feb 2017 14:17:38 +0100 Subject: [PATCH] test for aurapotion --- scripts/tests/e2/e2features.lua | 17 +++++++++++++++++ src/items.c | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/scripts/tests/e2/e2features.lua b/scripts/tests/e2/e2features.lua index 5af956980..59e93f86b 100644 --- a/scripts/tests/e2/e2features.lua +++ b/scripts/tests/e2/e2features.lua @@ -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") diff --git a/src/items.c b/src/items.c index cae5ea642..75cb79b68 100644 --- a/src/items.c +++ b/src/items.c @@ -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");