
if not aom_playerapi.has_pmb_statusfx then return end

pmb_statusfx.register_status("stair_slowness", {
    ----
    fx_allow_player = true,
    -- fx_allow_object = true,
    fx_only_tick_once = false,
    fx_only_apply_once = true,
    fx_timeout_individual = false,
    -- fx_use_player_functions_for_objects = true,
    ----
    on_apply_player = function(object, count, meta, params)
        meta.speed = math.min(meta.speed or 1, (params.speed or 0.6))
        playerphysics.add_physics_factor(object, "speed", "pmb_statusfx:stair_slow", meta.speed)
        return false -- true to prevent apply
    end,
    on_remove_player = function(object, count, meta, not_timeout)
        playerphysics.remove_physics_factor(object, "speed", "pmb_statusfx:stair_slow")
        return false -- true to prevent remove
    end,
    on_step_player = function(object, count, meta, dtime)
        return false -- true to remove
    end,
    ----
    -- hud = pmb_statusfx.hud.make_effect("pmb_status_slow.png^[opacity:50")
    ----
})
