ProditorMagnus / Ageless-for-1-14

Continues https://github.com/ProditorMagnus/Ageless-for-1-11
8 stars 2 forks source link

Update deprecated code #32

Open ProditorMagnus opened 1 year ago

ProditorMagnus commented 1 year ago

Knockback example

[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]
ProditorMagnus commented 1 year ago

Should be done before 1.17 release.