jimbojimbob
why
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)