--Pac dot (MAKE EM HIDE (but only for consoleplayer))
--By callmore

freeslot("MT_PACDOT", "sfx_pce2wa", "sfx_pce2ka")

local waka = true

local function pacSpecial(mt, mt2)
	if not (mt2.valid and mt2.player == consoleplayer) then return true end
	if mt.fuse then return true end
	mt.fuse = TICRATE*10
	mt.flags2 = $|MF2_DONTDRAW
	--print("Trying to waka")
	if waka then
		--print("wa")
		S_StartSoundAtVolume(nil, sfx_pce2wa, 127)
		--print("Played sound")
	else
		--print("ka")
		S_StartSoundAtVolume(nil, sfx_pce2ka, 127)
		--print("Played sound")
	end
	waka = not $
	return true
end

addHook("TouchSpecial", pacSpecial, MT_PACDOT)

local function pacFuse(mt)
	mt.flags2 = $&~MF2_DONTDRAW
	return true
end

addHook("MobjFuse", pacFuse, MT_PACDOT)