[lua]
code=<<
local args = ...
local u = wesnoth.units.get(args.unit_id)
local t = wml.variables["tmp_spartan_movecost_loc[0].terrain"]
if t then
local move_cost = wesnoth.units.movement_on(u, t)
wml.variables["tmp_return_movecost"] = move_cost
if(move_cost>19) then
wml.variables["tmp_return_passable"] = "no"
else
wml.variables["tmp_return_passable"] = "yes"
end
end
>>
[args]
unit_id={UNIT_ID}
[/args]
[/lua]
Knockback example