//sound captions
sfxinfo[sfx_mach1].caption = "Mach 1"
sfxinfo[sfx_mach2].caption = "Mach 2"
sfxinfo[sfx_mach3].caption = "Mach 3"
sfxinfo[sfx_mach4].caption = "Mach 4"
sfxinfo[sfx_macg1].caption = "Running On Floor Level 1"
sfxinfo[sfx_macg2].caption = "Running On Floor Level 2"
sfxinfo[sfx_macg3].caption = "Running On Floor Level 3"
sfxinfo[sfx_macg4].caption = "Running On Floor Level 4"
sfxinfo[sfx_kill].caption = "Enemy Death"
sfxinfo[sfx_bump].caption = "Bump"
sfxinfo[sfx_enscr1].caption = "AAAAAAAAAAAAAAAA"
sfxinfo[sfx_enscr2].caption = "OOAAAAAAAA"
sfxinfo[sfx_enscr3].caption = "AAAAAAaAaaAaaaaa"
sfxinfo[sfx_enscr4].caption = "AaAAaAaaAaaaAaaa"
sfxinfo[sfx_enscr5].caption = "YAAAAAAAAAaaAaaaaa"
sfxinfo[sfx_enscr6].caption = "YEAAOHOHOOOOOOH"

//slam sounds effects(andsuperjump)
addHook("ThinkFrame", function()
     for player in players.iterate do
	 if player.pizzanoreal
	    and (player.mo.state == S_PLAY_BODYSLAM_INITIAL)
		and not S_SoundPlaying(player.mo, sfx_slstar) then
		S_StartSound(player.mo, sfx_slstar)
	end
	    if player.pizzanoreal
	    and not (player.mo.state == S_PLAY_BODYSLAM_INITIAL)
		and S_SoundPlaying(player.mo, sfx_slstar) then
		S_StopSoundByID(player.mo, sfx_slstar)
	end
		 if player.pizzanoreal
	    and (player.mo.state == S_PLAY_SUPERJUMP_PREPARE)	
		and not S_SoundPlaying(player.mo, sfx_sjhol) then
		S_StartSound(player.mo, sfx_sjhol)
    end
	     if player.pizzanoreal
	    and not (player.mo.state == S_PLAY_SUPERJUMP_PREPARE)
		and S_SoundPlaying(player.mo, sfx_sjhol) then
		S_StopSoundByID(player.mo, sfx_sjhol)
	end
	    if player.pizzanoreal
	    and (player.mo.state == S_PLAY_SUPERJUMP_PREPARESIDE)	
		and not S_SoundPlaying(player.mo, sfx_sjcan) then
		S_StartSound(player.mo, sfx_sjcan)
	end
	    if player.pizzanoreal
	    and (player.mo.state == S_PLAY_SUPERJUMP_RELEASE)	
		and not S_SoundPlaying(player.mo, sfx_sjrel) then
		S_StartSound(player.mo, sfx_sjrel)
	end
	    if player.pizzanoreal
	    and (player.mo.state == S_PLAY_BODYSLAM_FINAL)	
		and not S_SoundPlaying(player.mo, sfx_slloop) then
		S_StartSound(player.mo, sfx_slloop)
    end
	     if player.pizzanoreal
	    and not (player.mo.state == S_PLAY_BODYSLAM_FINAL)
		and S_SoundPlaying(player.mo, sfx_slloop) then
		S_StopSoundByID(player.mo, sfx_slloop)
	end
	     if player.pizzanoreal
	    and (player.mo.state == S_PLAY_CHAINSAW)	
		and not S_SoundPlaying(player.mo, sfx_chain) then
		S_StartSound(player.mo, sfx_chain)
    end
	end
end)

//the mach sounds
addHook("ThinkFrame", function()
     for player in players.iterate do
	 if player.pizzanoreal
	    and ((player.mo.state == S_PLAY_DASH) or (player.mo.state == S_PLAY_MACH3_PAD) or (player.mo.state == S_PLAY_PZNOMACH3JUMPDIVE) or (player.mo.state == S_PLAY_PZNOMACH3JUMP))
		and player.machxdtimerr <= 350
		and not S_SoundPlaying(player.mo, sfx_mach3)
		
		or ((player.mo.state == S_PLAY_MACH5PZNO) or (player.mo.state == S_PLAY_MACH3_PAD) or (player.mo.state == S_PLAY_FIRE) or (player.mo.state == S_PLAY_SUPERJUMP_SIDE) or (player.mo.state == S_PLAY_FIRE_FINISH))
		and not S_SoundPlaying(player.mo, sfx_mach3) then
		S_StartSoundAtVolume(player.mo, sfx_mach3, 130)
	end
	    if player.pizzanoreal
	    and not ((player.mo.state == S_PLAY_DASH) or (player.mo.state == S_PLAY_MACH3_PAD) or (player.mo.state == S_PLAY_PZNOMACH3JUMPDIVE) or (player.mo.state == S_PLAY_PZNOMACH3JUMP) or (player.mo.state == S_PLAY_MACH5PZNO) or (player.mo.state == S_PLAY_SUPERJUMP_SIDE) or (player.mo.state == S_PLAY_FIRE_FINISH))
		and S_SoundPlaying(player.mo, sfx_mach3)
		
		or player.pizzanoreal 
		and ((player.mo.state == S_PLAY_PZNOMACH3JUMPDIVE) or (player.mo.state == S_PLAY_MACH3_PAD) or (player.mo.state == S_PLAY_PZNOMACH3JUMP))
		and S_SoundPlaying(player.mo, sfx_mach3)
		and player.machxdtimerr >= 350 then
		S_StopSoundByID(player.mo, sfx_mach3)
	end
	if player.pizzanoreal
	    and ((player.mo.state == S_PLAY_DASH)
		or (player.mo.state == S_PLAY_MACH3_PAD))
		and player.machxdtimerr <= 350
		and not S_SoundPlaying(player.mo, sfx_macg3) then
		S_StartSound(player.mo, sfx_macg3)
	end
	    if player.pizzanoreal
	    and not ((player.mo.state == S_PLAY_DASH)
		or (player.mo.state == S_PLAY_MACH3_PAD))
		and S_SoundPlaying(player.mo, sfx_macg3) then
		S_StopSoundByID(player.mo, sfx_macg3)
	end
	    if player.pizzanoreal
	    and ((player.mo.state == S_PLAY_RUN)  or (player.mo.state == S_PLAY_WALLCLIMBB) or (player.mo.state == S_PLAY_PZNOMACH2JUMP) or (player.mo.state == S_PLAY_PZNOMACH2JUMPDIVE))
		and not S_SoundPlaying(player.mo, sfx_mach2) then
		S_StartSoundAtVolume(player.mo, sfx_mach2, 130)
    end
	    if player.pizzanoreal
	    and not ((player.mo.state == S_PLAY_RUN) or (player.mo.state == S_PLAY_WALLCLIMBB) or (player.mo.state == S_PLAY_PZNOMACH2JUMP) or (player.mo.state == S_PLAY_PZNOMACH2JUMPDIVE))
		and S_SoundPlaying(player.mo, sfx_mach2)then
		S_StopSoundByID(player.mo, sfx_mach2)
	end
	if player.pizzanoreal
	    and (player.mo.state == S_PLAY_RUN)
		and not S_SoundPlaying(player.mo, sfx_macg2) then
		S_StartSound(player.mo, sfx_macg2)
    end
	    if player.pizzanoreal
	    and not (player.mo.state == S_PLAY_RUN)
		and S_SoundPlaying(player.mo, sfx_macg2)then
		S_StopSoundByID(player.mo, sfx_macg2)
	end
	    if player.pizzanoreal
	    and (player.mo.state == S_PLAY_MACHC1)	
		and not S_SoundPlaying(player.mo, sfx_mach1) then
		S_StartSoundAtVolume(player.mo, sfx_mach1, 130)
    end
	    if player.pizzanoreal
	    and not (player.mo.state == S_PLAY_MACHC1)
		and S_SoundPlaying(player.mo, sfx_mach1) then
		S_StopSoundByID(player.mo, sfx_mach1)
	end
	if player.pizzanoreal
	    and (player.mo.state == S_PLAY_MACHC1)	
		and not S_SoundPlaying(player.mo, sfx_macg1) then
		S_StartSound(player.mo, sfx_macg1)
    end
	    if player.pizzanoreal
	    and not (player.mo.state == S_PLAY_MACHC1)
		and S_SoundPlaying(player.mo, sfx_macg1) then
		S_StopSoundByID(player.mo, sfx_macg1)
	end
	    if player.pizzanoreal
	    and (player.mo.state == S_PLAY_WALK)	
		and not S_SoundPlaying(player.mo, sfx_zstep) then
		S_StartSoundAtVolume(player.mo, sfx_zstep, 255)
	end
	    if player.pizzanoreal
	    and not (player.mo.state == S_PLAY_WALK)
		and S_SoundPlaying(player.mo, sfx_zstep) then
		S_StopSoundByID(player.mo, sfx_zstep)
	end
	    if player.pizzanoreal
	    and  ((player.mo.state == S_PLAY_MACH4PZNO)  or (player.mo.state == S_PLAY_PZNOMACH3JUMPDIVE) or (player.mo.state == S_PLAY_PZNOMACH3JUMP))
		and player.machxdtimerr >= 351
		and not S_SoundPlaying(player.mo, sfx_mach4) then
		S_StartSoundAtVolume(player.mo, sfx_mach4, 130 )
	end
	    if player.pizzanoreal
	    and not ((player.mo.state == S_PLAY_MACH4PZNO)  or (player.mo.state == S_PLAY_PZNOMACH3JUMPDIVE) or (player.mo.state == S_PLAY_PZNOMACH3JUMP))
		and S_SoundPlaying(player.mo, sfx_mach4) then
		S_StopSoundByID(player.mo, sfx_mach4)
	end
	 if player.pizzanoreal
	    and (player.mo.state == S_PLAY_MACH4PZNO)
		and player.machxdtimerr >= 351
		and not S_SoundPlaying(player.mo, sfx_macg4) then
		S_StartSound(player.mo, sfx_macg4)
	end
	    if player.pizzanoreal
	    and not (player.mo.state == S_PLAY_MACH4PZNO)
		and S_SoundPlaying(player.mo, sfx_macg4) then
		S_StopSoundByID(player.mo, sfx_macg4)
	end
	    if player.pizzanoreal
	    and (player.mo.state == S_PLAY_SKID_STOP)	
		and not S_SoundPlaying(player.mo, sfx_pskid) then
		S_StartSound(player.mo, sfx_pskid)
	end
	if player.pizzanoreal
	    and (player.mo.state == S_PLAY_PZNO_REDIRECT)	
		and not S_SoundPlaying(player.mo, sfx_skdi)
		and P_IsObjectOnGround(player.mo)then
		S_StartSound(player.mo, sfx_skdi)
	end
	if player.pizzanoreal
	and (player.mo.state == S_PLAY_PZNO_REDIRECT)
	and S_SoundPlaying(player.mo, sfx_pskid)
	S_StopSound(player.mo, sfx_pskid)
	end
	if player.pizzanoreal
	and (player.mo.state == S_PLAY_PZNO_REDIRECT)
	and S_SoundPlaying(player.mo, sfx_skid)
	S_StopSound(player.mo, sfx_skid)
	end
	    if player.pizzanoreal
	    and not (player.mo.state == S_PLAY_PZNO_REDIRECT)
		and S_SoundPlaying(player.mo, sfx_skdi) then
		S_StopSoundByID(player.mo, sfx_skdi)
	end
	end
end)