//Better Abilities By Minero with kirb help
//Please Credit :D


//Super Thok
addHook ("AbilitySpecial",function(player)

  if player.mo.skin == "sonic" -- OMG SNUC
  and not (player.pflags & PF_THOKKED) --im the poor copy for kirb
  
   P_InstaThrust(player.mo,player.mo.angle,40*FRACUNIT)--XD

  P_SetObjectMomZ(player.mo, 20*FRACUNIT,true)--UP,UUUUUUUUUUUUUP!
   
   
 P_SpawnThokMobj(player)

  S_StartSound (player.mo , sfx_spin)--SPINDA

 end
 
 end)
 
 //Putting the learned and Spin Down B)
 
addHook("JumpSpinSpecial",function(player)

    if player.mo and player.mo.skin == "sonic" -- sunky
	and not P_IsObjectOnGround(player.mo) -- if not in ground
	and not player.powers[pw_super] -- if u not are super
	
      P_NukeEnemies (player.mo,player.mo,900*FRACUNIT) 
	   P_SpawnSkidDust (player,-10*FRACUNIT,sfx_none)	 --the effect
        S_StartSound(player.mo, sfx_spin) -- the sound
		player.mo.state = S_PLAY_BOUNCE -- the bounce
        player.mo.momz= -60*FRACUNIT -- the bounce x2
		player.pflags = $|PF_THOKKED --u use the ability
		if P_IsObjectOnGround(player.mo) -- if in ground
		P_SetObjectMomZ (player.mo,10*FRACUNIT,true)
		P_DoBubbleBounce(player.mo)
		end				
    end
end)
//DashMode Attacks Enemies
addHook("PlayerCanDamage",function(player, sourmo) --THE FUNCTION
  if player.mo.skin == "sonic" --sanic
  and  P_IsObjectOnGround(player.mo) --you khow
  and player.dashmode > 3*TICRATE --idk
  and MF_ENEMY --enemi
  and MF_SOLID --if a spikes
  
   player.charflags = SF_MACHINE
   P_SpawnThokMobj(player) -- the thok effect
   return true  
   end
 end)
//Explotion B)
addHook("PlayerThink",function(player)-- THE PLAYER (AGAIN)
if player.mo.skin == "sonic" -- HEY DONT ROB MY CODE!
if player.cmd.buttons & BT_CUSTOM1 and -- IF U PRESS C1
not P_IsObjectOnGround(player.mo) and -- IF U ARE IN GROUND
not (player.pflags & PF_THOKKED) and --IF U NOT USE YOUR ABILITI
player.rings >= 10 -- IF U HAVE RINGS!


P_NukeEnemies (player.mo,player.mo,3000*FRACUNIT) -- THE ESPLOTION
P_FlashPal(player, PAL_WHITE, 10) -- THE EFFECT
player.pflags = $|PF_THOKKED -- IF U USE THE ABILITY, NO SPAM
player.mo.momz = 2 -- U UP
P_GivePlayerRings(player,-10) -- RAINS RINGS
S_StartSound(player.mo,	sfx_zoom) -- THE SOUND
player.mo.state = S_PLAY_SUPER_TRANS1 -- THE ANIMATION
end
end
end)

