-- A simple utility script to remove the magician box around IRONMAN characters when transforming

freeslot(
"S_TRANSFORM",
"spr_TRANS"
)

addHook("MobjThinker", function(m) 
    if not m.valid then
        return true
    end
    -- Note, internally these states are named S_MAGICIANBOX_TOP and S_MAGICIANBOX_BOTTOM
    if m.state == S_MAGICIANBOX or m.state == S_MAGICIANBOXTOP or m.state == S_MAGICIANBOXBOTTOM then 
        if m.target != nil and m.target.player != nil then
            -- Use the name of your own skin here
            if skins[m.target.player.skin].name == "sfiiitwelve" then -- alternatively to apply to all ironman chars: skins[m.target.player.skin].flags & SF_IRONMAN != 0
                m.state = S_NULL -- removes the object, to change the textures or behaviour change it to your own State here
                m.color = m.target.player.skincolor
            end
        end
    end
end, MT_MAGICIANBOX)

states[S_TRANSFORM] = {TRANS, A|FF_TRANS10|FF_FULLBRIGHT, 30, A_SmokeTrailer, MT_PPZPOPCORN, 5, S_NULL}
