From a3c8ff78da1fa15d9631dec3e50a7f494498f571 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 6 Dec 2020 19:08:23 +0100 Subject: [PATCH] https://bugs.eressea.de/view.php?id=2651 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Störe Astrale Integrität und Mauern der Ewigkeit können mit STUFE gezuabert werden. Als Fixkosten-Sprüche kann die Stufe des Zaubers nicht überschritten werden. Test für die Reichweite des Astralzaubers. --- res/eressea/spells.xml | 4 +-- scripts/tests/e2/spells.lua | 55 +++++++++++++++++++++++++++++++++++-- 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/res/eressea/spells.xml b/res/eressea/spells.xml index 0570fa80d..a56b147ef 100644 --- a/res/eressea/spells.xml +++ b/res/eressea/spells.xml @@ -214,7 +214,7 @@ - + @@ -422,7 +422,7 @@ - + diff --git a/scripts/tests/e2/spells.lua b/scripts/tests/e2/spells.lua index 2a5c50b2c..43c586c11 100644 --- a/scripts/tests/e2/spells.lua +++ b/scripts/tests/e2/spells.lua @@ -273,15 +273,64 @@ end function test_astral_disruption() local r = region.create(0, 0, "plain") local r2 = r:get_astral('fog') + local r3 = region.create(r2.x+1, r2.y, 'fog') local f = faction.create("human") local u = unit.create(f, r) local uh = unit.create(get_monsters(), r2, 1, "braineater") - u.magic = "draig" + u.magic = "tybied" u:set_skill("magic", 100) -- level 100 should beat magic resistance u.aura = 200 - u:add_spell("astral_disruption") + u:add_spell("astral_disruption", 14) u:add_order('ZAUBERE STUFE 1 "Stoere Astrale Integritaet"') process_orders() - assert_not_nil(r2:get_curse("astralblock")) + assert_equal(60, u.aura) + assert_equal(100, r2:get_curse("astralblock")) + assert_nil(r3:get_curse("astralblock")) + assert_equal(r, uh.region) +end + +function test_astral_disruption_levels() + local r = region.create(0, 0, "plain") + local r2 = r:get_astral('fog') + local r3 = region.create(r2.x+1, r2.y, 'fog') + local r4 = region.create(r2.x+2, r2.y, 'fog') + local f = faction.create("human") + local u = unit.create(f, r) + local uh = unit.create(get_monsters(), r2, 1, "braineater") + u.magic = "tybied" + u:set_skill("magic", 100) -- level 100 should beat magic resistance + u.aura = 200 + u:add_spell("astral_disruption", 14) + -- at level 5, range +1: + u:add_order('ZAUBERE STUFE 5 "Stoere Astrale Integritaet"') + process_orders() + assert_equal(60, u.aura) + assert_equal(100, r2:get_curse("astralblock")) + assert_equal(100, r3:get_curse("astralblock")) + assert_nil(r4:get_curse("astralblock")) + assert_equal(r, uh.region) +end + +function test_astral_disruption_default_level() + local r = region.create(0, 0, "plain") + local r2 = r:get_astral('fog') + local r3 = region.create(r2.x+1, r2.y, 'fog') + local r4 = region.create(r3.x+1, r2.y, 'fog') + local r5 = region.create(r4.x+1, r2.y, 'fog') + local f = faction.create("human") + local u = unit.create(f, r) + local uh = unit.create(get_monsters(), r2, 1, "braineater") + u.magic = "tybied" + u:set_skill("magic", 100) -- level 100 should beat magic resistance + u.aura = 200 + u:add_spell("astral_disruption", 14) + -- no level means cast at the spell's level (14) + u:add_order('ZAUBERE "Stoere Astrale Integritaet"') + process_orders() + assert_equal(60, u.aura) + assert_equal(100, r2:get_curse("astralblock")) + assert_equal(100, r3:get_curse("astralblock")) + assert_equal(100, r4:get_curse("astralblock")) + assert_nil(r5:get_curse("astralblock")) assert_equal(r, uh.region) end