freeslot(
"sfx_auhh",
"sfx_funky"
)
--this is reusable, you can also not include credits, do whatevor you wan!!!
sfxinfo[sfx_auhh].caption = "pain"
sfxinfo[sfx_funky].caption = "òfunky!"
/*                                                                              
                                                       ####                     
                     /(((                           *#######                    
                    (####(((/                    (##%%%%%%%%#/                  
                   ##########(((              (##%%%%%%%%#####                  
                  (#####%%%%%%%##(         .###%%%%%%%########,                 
                  (((((((###%%%%&###/    (##%%%%&%%###########(                 
                 ,######((((((#%%%%%%#((##%%&&#(((((####%%%%%%#                 
                 .##%%%%%%%%%%%%%%###%##%########%%%%&&&%%%%%%%                 
                  #####%%%%%#(#####(#%(####(####%&&&&%%%%%%####                 
                   ######(##(###/..............,%#############.                 
                    (#((####/....................,*#&%#######*                  
                     (###/,.........................,%%%%#                      
                      (#,,......,............(.......,                          
                       .,,,,../,.,..........,..*,......                         
                       ,,,..,/.............,...,**....,.                        
                      ,,,.../,....,,......,*,,,,°/,...,,                        
                       ,,,,,/#,##%&%°////&&%%%#%*°/.....                        
                      .,.,,***#####...,,,,%#%#%/°°/....,,                       
                       *,..***,,*,.....,,,,,******(...                          
                        //,#**,,,,,,,,,,,,,******#,  /                          
                           ,/°°/°********°/////°****                            
                           ,,,**%###(%%%((#((,....,,                            
                     .....,,.,*,%#%##&%%%####,...,,,,...,,                      
                    ..,,,°/(,//(((#%#####%######(/(//°*,,,,                     
                      (##(((######################((((.                         
                    ....(((((##########(#######(((((.,,***.                     
                      *((((((((((((#(##(#(((######((......                      
                       ..........(((((((*....((##(#(...                         
                         ...,  . ../(*   ......  .  ,,,,,                       
                        ,,.,,,,°/              .,/°,,,,,,,                      
                        ,,,,,,*                    .,*,,.                 
						
*/
addHook("MobjMoveBlocked", function(mo)
    local player = mo.player
    if player.mo.skin == "fumo"
	and not G_IsSpecialStage(gamemap)
	and not (player.pflags & PF_SPINNING)
	and not (player.pflags & PF_GLIDING)
	and not (player.pflags & PF_SLIDING)
	and player.speed > 20*FRACUNIT
	P_SetObjectMomZ(player.mo, player.speed/4)
	S_StartSound(player.mo, sfx_bnce1)
	player.mo.state = S_PLAY_STND
	player.pflags = $|PF_THOKKED
	player.mo.spritexscale = $ + 1*FRACUNIT
	P_InstaThrust(player.mo, player.mo.angle, -player.speed/4) 
	end
end, MT_PLAYER)
		addHook("PlayerThink", function(player)
   if player.mo.eflags & MFE_JUSTHITFLOOR
   and not player.weapondelay
   and player.mo.skin == "fumo"
   and not G_IsSpecialStage(gamemap)
   player.mo.digtimer = 25
	player.weapondelay = 1*TICRATE/2
   end
   if player.mo.eflags & MFE_JUSTHITFLOOR
   and player.mo.skin == "fumo"
   and not G_IsSpecialStage(gamemap)
   player.mo.spriteyscale = 1*FRACUNIT/2
   player.mo.spritexscale = 2*FRACUNIT
   S_StartSound(player.mo, sfx_bnce1)
   end
   if player.mo.spriteyscale < 1*FRACUNIT
   and player.mo.skin == "fumo"
   and not G_IsSpecialStage(gamemap)
   player.mo.spriteyscale = $ + 1*FRACUNIT/4
   end
   if player.mo.spritexscale > 1*FRACUNIT
   and player.mo.skin == "fumo"
   and not G_IsSpecialStage(gamemap)
   player.mo.spritexscale = $ - 1*FRACUNIT/4
   end
	if (leveltime % TICRATE == 0 or leveltime % TICRATE == TICRATE/2)
	and not G_IsSpecialStage(gamemap)
	and player.mo.skin == "fumo"
	and player.mo.state == S_PLAY_WAIT
	  player.mo.spriteyscale = 1*FRACUNIT/2
    player.mo.spritexscale = 3*FRACUNIT
	S_StartSound(player.mo, sfx_funky)
		end
	if player.mo.skin == "fumo"
	and player.mo.state == S_PLAY_WAIT
	player.drawangle = player.drawangle + ANG20
	end
		if player.mo.valid
		and player.mo.skin == "fumo"
		player.camerascale = player.speed/120 + 1*FRACUNIT
		end
		if player.mo.state == S_PLAY_PAIN
		and not (player.pflags & PF_SLIDING)
		and player.mo.skin == "fumo"
		S_StartSound(player.mo, sfx_auhh)
		player.mo.state = S_PLAY_STND
		end
		if not P_IsObjectOnGround(player.mo)
		and player.mo.skin == "fumo"
		player.mo.state = S_PLAY_JUMP
		player.mo.rollangle = $ + FixedAngle(50*FRACUNIT)
	end
		if P_IsObjectOnGround(player.mo)
		and player.mo.skin == "fumo"
		player.mo.rollangle = FixedAngle(0)
		end
	if player.mo.skin == "fumo"
	and player.cmd.buttons & BT_CUSTOM1
   	local missilee = P_SpawnPlayerMissile(player.mo, MT_JETTBULLET, MF2_RAILRING)
	missilee.state = S_NODESP
	missilee.momx = $+P_RandomRange(-10,10)*FRACUNIT
	missilee.momy = $+P_RandomRange(-10,10)*FRACUNIT
	missilee.momz = $+P_RandomRange(-10,10)*FRACUNIT
	 S_StartSound(player.mo, sfx_iceb)
	 end
	if player.mo.skin == "fumo"
	and player.cmd.buttons & BT_CUSTOM2
	player.drawangle = player.drawangle + ANG30
	 end
	if player.playerstate == PST_DEAD
	and not player.mo.state == S_INVISIBLE
	player.mo.state = S_INVISIBLE
	local p = P_SpawnMobjFromMobj(player.realmo, P_RandomRange(-20, 20) * FRACUNIT, P_RandomRange(-20, 20) * FRACUNIT, P_RandomRange(0, 50) * FRACUNIT, MT_PP)
	p.momx = P_RandomRange(-20,20)*FRACUNIT
	p.momy = P_RandomRange(-20,20)*FRACUNIT
	p.momz = P_RandomRange(-20,20)*FRACUNIT
	player.mo.momz = 0
	end
			if player.mo.skin == "fumo"
		and player.powers[pw_super]
		and (player.cmd.buttons & BT_JUMP)
		P_SetObjectMomZ(player.mo, 4*FRACUNIT, true)
		end
end)

addHook("MobjThinker", function(mobj)
	if mobj.valid
	and mobj.state == S_FUMOROCK or mobj.state == S_NODESP
	mobj.color = SKINCOLOR_SAPPHIRE
	mobj.colorized = true
	local iceghost = P_SpawnGhostMobj(mobj)
	iceghost.color = SKINCOLOR_SAPPHIRE
	iceghost.colorized = true
	iceghost.destscale = 0
	mobj.rollangle = $ + FixedAngle(50*FRACUNIT)
	end
	if mobj.valid
	and mobj.state == S_NODESP
	mobj.info.speed = 90*FRACUNIT	
	end
end)

addHook("SpinSpecial", function(player)
   if (player.cmd.buttons & BT_USE)
   and player.mo.skin == "fumo"
   and not (player.pflags & PF_USEDOWN)
   P_StartQuake(5*FRACUNIT, 2)
   local ice = P_SpawnMobjFromMobj(player.realmo,0, 0, 0, MT_DUST)
   ice.state = S_FUMOROCK
   ice.momz = 5*FRACUNIT
   local ice2 = P_SpawnMobjFromMobj(player.realmo,0, 0, 0, MT_DUST)
   ice2.state = S_FUMOROCK
   ice2.momz = -5*FRACUNIT
   local ice3 = P_SpawnMobjFromMobj(player.realmo,0, 0, 0, MT_DUST)
   ice3.state = S_FUMOROCK
   ice3.momx = -5*FRACUNIT
   local ice4 = P_SpawnMobjFromMobj(player.realmo,0, 0, 0, MT_DUST)
   ice4.state = S_FUMOROCK
   ice4.momx = 5*FRACUNIT
   local ice5 = P_SpawnMobjFromMobj(player.realmo,0, 0, 0, MT_DUST)
   ice5.state = S_FUMOROCK
   ice5.momy = -5*FRACUNIT
   local ice6 = P_SpawnMobjFromMobj(player.realmo,0, 0, 0, MT_DUST)
   ice6.state = S_FUMOROCK
   ice6.momy = 5*FRACUNIT
	player.mo.spritexscale = 2*FRACUNIT
   S_StartSound(player.mo, sfx_iceb)
   S_StartSound(player.mo, sfx_cdfm62) 
   P_Thrust(player.mo, player.mo.angle, 60*FRACUNIT) 
   player.pflags = $|PF_JUMPED
	end
	if player.powers[pw_super]
P_SwitchWeather(PRECIP_SNOWF)
	end
end)
addHook("AbilitySpecial", function(player)
if player.mo.skin == "fumo"
P_SetObjectMomZ(player.mo, -50*FRACUNIT)
	end
end)