freeslot(
	"sfx_RBSFXA"
)


addHook("PlayerThink", function(player)
	if not (player.valid or player.mo.valid) return end
	
	if player.mo.charsfxtime == nil
		player.mo.charsfxtime = 0
	end
	
	if player.mo.charsfxtime > 0
		player.mo.charsfxtime = $ - 1
	end
	
	if (S_SoundPlaying(player.mo, sfx_BPMRA1)
	or S_SoundPlaying(player.mo, sfx_CSWLA1)
	or S_SoundPlaying(player.mo, sfx_HIPPA1)
	or S_SoundPlaying(player.mo, sfx_MCAHA1)
	or S_SoundPlaying(player.mo, sfx_SHMNA1))
	and not S_SoundPlaying(nil, sfx_ssa018)
	and player.mo.charsfxtime == 0
		S_StartSound(nil,sfx_ssa018,player)
		player.mo.charsfxtime = 105
	end
	if (S_SoundPlaying(player.mo, sfx_BPMRA2)
	or S_SoundPlaying(player.mo, sfx_CSWLA2)
	or S_SoundPlaying(player.mo, sfx_HIPPA2)
	or S_SoundPlaying(player.mo, sfx_MCAHA2)
	or S_SoundPlaying(player.mo, sfx_SHMNA2))
	and not S_SoundPlaying(nil, sfx_ssa018)
	and player.mo.charsfxtime == 0
		S_StartSound(nil,sfx_ssa018,player)
		player.mo.charsfxtime = 105
	end
	if (S_SoundPlaying(player.mo, sfx_BPMRB1)
	or S_SoundPlaying(player.mo, sfx_CSWLB1)
	or S_SoundPlaying(player.mo, sfx_HIPPB1)
	or S_SoundPlaying(player.mo, sfx_MCAHB1)
	or S_SoundPlaying(player.mo, sfx_SHMNB1))
	and not S_SoundPlaying(nil, sfx_mswarp)
	and player.mo.charsfxtime == 0
		S_StartSound(nil,sfx_mswarp,player)
		player.mo.charsfxtime = 105
	end
	if (S_SoundPlaying(player.mo, sfx_BPMRB2)
	or S_SoundPlaying(player.mo, sfx_CSWLB2)
	or S_SoundPlaying(player.mo, sfx_HIPPB2)
	or S_SoundPlaying(player.mo, sfx_MCAHB2)
	or S_SoundPlaying(player.mo, sfx_SHMNB2))
	and not S_SoundPlaying(nil, sfx_mswarp)
	and player.mo.charsfxtime == 0
		S_StartSound(nil,sfx_mswarp,player)
		player.mo.charsfxtime = 105
	end	
	if (S_SoundPlaying(player.mo, sfx_BPMRGL)
	or S_SoundPlaying(player.mo, sfx_CSWLGL)
	or S_SoundPlaying(player.mo, sfx_HIPPGL)
	or S_SoundPlaying(player.mo, sfx_MCAHGL)
	or S_SoundPlaying(player.mo, sfx_SHMNGL))
	and not S_SoundPlaying(nil, sfx_nxbump)
	and player.mo.charsfxtime == 0
		S_StartSound(nil,sfx_nxbump,player)
		player.mo.charsfxtime = 105
	end	
	if (S_SoundPlaying(player.mo, sfx_BPMRH1)
	or S_SoundPlaying(player.mo, sfx_CSWLH1)
	or S_SoundPlaying(player.mo, sfx_HIPPH1)
	or S_SoundPlaying(player.mo, sfx_MCAHH1)
	or S_SoundPlaying(player.mo, sfx_SHMNH1))
	and not S_SoundPlaying(nil, sfx_bnce1)
	and player.mo.charsfxtime == 0
		S_StartSound(nil,sfx_bnce1,player)
		player.mo.charsfxtime = 105
	end	
	if (S_SoundPlaying(player.mo, sfx_BPMRH2)
	or S_SoundPlaying(player.mo, sfx_CSWLH2)
	or S_SoundPlaying(player.mo, sfx_HIPPH2)
	or S_SoundPlaying(player.mo, sfx_MCAHH2)
	or S_SoundPlaying(player.mo, sfx_SHMNH2))
	and not S_SoundPlaying(nil, sfx_bnce1)
	and player.mo.charsfxtime == 0
		S_StartSound(nil,sfx_bnce1,player)
		player.mo.charsfxtime = 105
	end	
	if (S_SoundPlaying(player.mo, sfx_BPMRHT)
	or S_SoundPlaying(player.mo, sfx_CSWLHT)
	or S_SoundPlaying(player.mo, sfx_HIPPHT)
	or S_SoundPlaying(player.mo, sfx_MCAHHT)
	or S_SoundPlaying(player.mo, sfx_SHMNHT))
	and not S_SoundPlaying(nil, sfx_antiri)
	and player.mo.charsfxtime == 0
		S_StartSound(nil,sfx_antiri,player)
		player.mo.charsfxtime = 105
	end	
	if (S_SoundPlaying(player.mo, sfx_BPMRLS)
	or S_SoundPlaying(player.mo, sfx_CSWLLS)
	or S_SoundPlaying(player.mo, sfx_HIPPLS)
	or S_SoundPlaying(player.mo, sfx_MCAHLS)
	or S_SoundPlaying(player.mo, sfx_SHMNLS))
	and not S_SoundPlaying(nil, sfx_adderr)
	and player.mo.charsfxtime == 0
		S_StartSound(nil,sfx_adderr,player)
		player.mo.charsfxtime = 105
	end	
	if (S_SoundPlaying(player.mo, sfx_BPMRSL)
	or S_SoundPlaying(player.mo, sfx_CSWLSL)
	or S_SoundPlaying(player.mo, sfx_HIPPSL)
	or S_SoundPlaying(player.mo, sfx_MCAHSL)
	or S_SoundPlaying(player.mo, sfx_SHMNSL))
	and not S_SoundPlaying(nil, sfx_emfind)
	and player.mo.charsfxtime == 0
		S_StartSound(nil,sfx_emfind,player)
		player.mo.charsfxtime = 105
	end	
	if S_SoundPlaying(player.mo, sfx_BPMRWI)
	or S_SoundPlaying(player.mo, sfx_CSWLWI)
	or S_SoundPlaying(player.mo, sfx_HIPPWI)
	or S_SoundPlaying(player.mo, sfx_MCAHWI)
	or S_SoundPlaying(player.mo, sfx_SHMNWI)
	and not S_SoundPlaying(nil, sfx_flgcap)
	and player.mo.charsfxtime == 0
		S_StartSound(nil,sfx_flgcap,player)
		player.mo.charsfxtime = 105
	end	
end)

/*

addHook("MobjDamage", function(target, inflictor, source, damage, damagetype)
	local type = damagetype & DMG_TYPEMASK
	
	if type == DMG_NORMAL
		S_StartSound(target.mo,sfx_RUB0,target)
	end
	if type == DMG_WIPEOUT
		print("WIPEOUT")
	end
	if type == DMG_EXPLODE
		print("EXPLODE")
	end
	if type == DMG_TUMBLE
		print("TUMBLE")
	end
	if type == DMG_STING 
		print("STING")
	end
	if type == DMG_KARMA
		print("KARMA")
	end
	if type == DMG_VOLTAGE
		print("VOLTAGE")
	end	
	if type == DMG_STUMBLE
		print("STUMBLE")
	end	
	if type == DMG_WHUMBLE
		print("WHUMBLE")
	end	
	if type == DMG_INSTAKILL
		print("INSTAKILL")
	end	
	if type == DMG_CRUSHED
		print("CRUSHED")
	end	
	if type == DMG_SPECTATOR
		print("SPECTATOR")
	end	
	if type == DMG_DEATHPIT
		print("SPECTATOR")
	end	
	if type == DMG_TIMEOVER
		print("TIMEOVER")
	end	
end, MT_PLAYER)

*/