How do I map Tails' tailwhip?

I'm trying to map Tails' tailwhip attack to Custom 1. The problem is that the move removes his spindash so, can anyone help me map this abilities to Custom 1 while Tails can still keep his spindash.

Tail Whip Code:
addHook("PlayerThink", function(player)
    if not (player.spinner)
        player.spinner = 0
    end
    if not (player.tailswipe)
        player.tailswipe = 0
    end
    if (player.mo.skin == "tails")
        if (player.speed > 23*FRACUNIT)
        or (player.bot == 1)//Swiper no Swiping
            player.charability2 = CA2_SPINDASH
        else
            player.charability2 = CA2_NONE
        end
        
        //Tail Swipe Start
        if (player.pflags & PF_USEDOWN)
        and P_IsObjectOnGround(player.mo)
        and (player.speed < 24*FRACUNIT)
        and not (player.bot == 1)//SWIPER NO SWIPING
        and not (player.skidtime > 0)//Friggin Spindash
        or (player.tailswipe == 1)
        and (player.pflags & PF_USEDOWN)
            player.tailswipe = 1
        end
        
        //Ending Tail Swipe
        if not (player.pflags & PF_USEDOWN)
        or not P_IsObjectOnGround(player.mo)
            player.tailswipe = 0
        end
        
        //What to do
        if (player.tailswipe == 1)
            player.mo.state = S_PLAY_RUN
            player.jumpfactor = 0
            player.normalspeed = 20*FRACUNIT
            //player.pflags = $|PF_SPINNING
            player.spinner = ($ % 7) + 1
            if (player.spinner > 7)
                player.spinner = 0
            end
            player.drawangle = player.spinner * ANGLE_45
        end
        
        //Return to normal
        if (player.tailswipe == 0)
            player.jumpfactor = skins[player.mo.skin].jumpfactor
            player.normalspeed = skins[player.mo.skin].normalspeed
        end
    end
end)

local function advTailSwipe(enemy, mobj)
    local player = mobj.player
    if not (player.mo.skin == "tails")
    and not (player.tailswipe == 1)
        return false
    end
    if (enemy.flags & (MF_ENEMY|MF_BOSS))
    and (player.tailswipe == 1)
    and not (player.powers[pw_super])
    and not (player.powers[pw_invulnerability])
        P_DamageMobj(enemy, mobj, mobj)
        return true
    end
end

addHook("TouchSpecial", advTailSwipe)
 
Correct me if I'm wrong, but player.pflags & PF_USEDOWN should be player.cmd.buttons & BT_CUSTOM1 if you want it to be usable on custom 1.
Post automatically merged:

Also, line 13 will need to be edited or removed entirely to keep the spindash.
 
Last edited:
Correct me if I'm wrong, but player.pflags & PF_USEDOWN should be player.cmd.buttons & BT_CUSTOM1 if you want it to be usable on custom 1.
Post automatically merged:

Also, line 13 will need to be edited or removed entirely to keep the spindash.
Unfortunately, while editing line 13 did give Tails his spindash back, replacing player.pflags & PF_USEDOWN with player.cmd.buttons & BT_CUSTOM1 didn't work.
 
Unfortunately, while editing line 13 did give Tails his spindash back, replacing player.pflags & PF_USEDOWN with player.cmd.buttons & BT_CUSTOM1 didn't work.
Weird. When I edited player.pflags & PF_USEDOWN to player.cmd.buttons & BT_CUSTOM1, it worked just fine.
 
Oof, I suggest getting each other's discords and just have Jer send his lua code to Jimbo and see if it works.
 
Oof, I suggest getting each other's discords and just have Jer send his lua code to Jimbo and see if it works.
Don't worry about it, MK, I DM'd him the working code about 3 hours ago!
 
  • Cool!
Reactions: M.K
Don't worry about it, MK, I DM'd him the working code about 3 hours ago!
PERFECT! (You can contact me at my discord M.K's emergency alt#4028 and all of my other social media that's linkable is linked on my discord profile btw)
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top