server/scripts/tests/e2/spells.lua
Enno Rehling b00d7b6d5a increase magic power for low levels in E3 (instead of divide by 2 sometimes giving powers of < 1.0, cap it below at 1)
several spells have now had problems with powers lower than they were ever designed for, including shapeshift
also added a test and some framework for shapeshift spell (in E2).
https://bugs.eressea.de/view.php?id=1588
2015-04-30 15:59:52 +02:00

28 lines
878 B
Lua

require "lunit"
module("tests.e2.spells", package.seeall, lunit.testcase)
function setup()
eressea.free_game()
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0")
eressea.settings.set("rules.economy.food", "4")
end
function test_shapeshift()
local r = region.create(42, 0, "plain")
local f = faction.create("noreply@eressea.de", "demon", "de")
local u1 = unit.create(f, r, 1)
local u2 = unit.create(f, r, 1)
u1:clear_orders()
u1.magic = "gray"
u1:set_skill("magic", 2)
u1.aura = 1
u1:add_spell("shapeshift")
u1:add_order("ZAUBERE STUFE 1 Gestaltwandlung " .. itoa36(u2.id) .. " Goblin")
process_orders()
assert_equal(f.race, u2.race)
s = u2:show()
assert_equal("1 Goblin", string.sub(s, string.find(s, "1 Goblin")))
end