//Better Tails Abilitys By The Minero
//And Discord srb2 guys
//PLEASE CREDIT!
//Mini tutorial,rename all the "tails" spaces.


freeslot ("S_PLAY_ROLLFALL","S_PLAY_ROLLFALL2")
states [S_PLAY_ROLLFALL] = {SPR_PLAY,SPR2_ROLL|FF_ANIMATE,10,nil,5,1,S_PLAY_ROLLFALL2}
states [S_PLAY_ROLLFALL2] = {SPR_PLAY,SPR2_FALL|FF_ANIMATE,20,nil,2,0,S_PLAY_ROLLFALL2}

//Double Jump Thok

addHook("JumpSpinSpecial",function(player)
if player.mo.skin == "tails"
and not P_IsObjectOnGround(player.mo)
and not (player.pflags & PF_THOKKED)

P_SetObjectMomZ(player.mo,20*FRACUNIT,true)

P_InstaThrust(player.mo,player.mo.angle,40*FRACUNIT)

S_StartSound (player.mo,sfx_thok)

P_SpawnThokMobj(player)

player.pflags = $|PF_THOKKED

end
end)
//Turb0
addHook ("PlayerThink",function(player)
if player.mo.skin == "tails"
and player.cmd.buttons & BT_CUSTOM1
and not (player.pflags & PF_FINISHED)
P_InstaThrust(player.mo,player.mo.angle,50*FRACUNIT)
P_SpawnThokMobj(player)
S_StartSound(player.mo,sfx_zoom) 
player.pflags = $|PF_THOKKED
if player.mo.state == S_PLAY_STND
player.mo.state = S_PLAY_RUN
end
end
end)
//BackSpin
addHook ("PlayerThink",function(player)
if player.mo.skin == "tails"
and not P_IsObjectOnGround(player.mo)
and not (player.pflags & PF_THOKKED)
and player.cmd.buttons & BT_CUSTOM2

player.mo.state = S_PLAY_ROLL
P_SetObjectMomZ(player.mo,10*FRACUNIT,true)
P_InstaThrust(player.mo,player.mo.angle,-40*FRACUNIT)
player.pflags = $|PF_THOKKED
S_StartSound(player.mo,sfx_spin)
P_SpawnThokMobj(player)
end
end)
//Run EFFECT XDDDDDDD
addHook ("PlayerThink",function(player)
if player.mo.skin == "tails"
	if (P_IsObjectOnGround(player.mo)) 
	and (player.mo.state == S_PLAY_RUN) 
	or (player.mo.state == S_PLAY_DASH)
	and not player.powers[pw_super]
		P_SpawnSkidDust(player, 15*FRACUNIT, sfx_none)
	end
end
end)
