//--=================================================================//
//-- GAMEPLAY
//-- ---------
//-- contains all gameplay related scripting
//-- (This file is a mess. Organize it later)
//-- (You know this shouldn't even be called a gameplay header,
//-- it doesnt even ACT like one. fire the dumbass who made this choice)
//--=================================================================//
	
	local mus_silenc = mus_map99m
	local mus_padbos = mus_map98m
	local mus_pjboss = mus_map97m
	local mus_mldt1 = mus_map96m
	/*
freeslot(
	//--PLAYER STATES-------------------
	"S_PLAY_RUNANIM1",
	"S_PLAY_RUNANIM2",
	"S_PLAY_RUNANIM3",
	"S_PLAY_RUNANIM4",
	//-special states to be removed later
	"S_SSONIC_FLY1",
	"S_SSONIC_FLY2"
)

//////////////////////////////////////////////////////////////////////////

states[S_PLAY_RUNANIM1] = {SPR_PLAY,16,2,A_None,0,0,S_PLAY_RUNANIM2}
states[S_PLAY_RUNANIM2] = {SPR_PLAY,17,2,A_None,0,0,S_PLAY_RUNANIM3}
states[S_PLAY_RUNANIM3] = {SPR_PLAY,18,2,A_None,0,0,S_PLAY_RUNANIM4}
states[S_PLAY_RUNANIM4] = {SPR_PLAY,19,2,A_None,0,0,S_PLAY_RUNANIM1}
states[S_SSONIC_FLY1] = {SPR_PLAY,22,2,A_None,0,0,S_SSONIC_FLY2}
states[S_SSONIC_FLY2] = {SPR_PLAY,23,2,A_None,0,0,S_SSONIC_FLY1}*/
								
					
//------------------------
//--Gameplay editing!
//--puzzle elements and stuff
//--probably something to make it more unique too
//------------------------
addHook("ThinkFrame", do

	//--Player Action Codes, Used for modifying actions
	//--Adding powers would make this more unique
	for player in players.iterate	
		//Fire a regular item
		/*if (player.cmd.buttons & BT_ATTACK) and (player.attackdown == false)
			 //--player.mo.state = S_PLAY_FALL1
			 P_SpawnPlayerMissile(player.mo, MT_ROCKET, MF2_RAILRING)
			 S_StartSound(player.mo, sfx_fire)
			 player.attackdown = true
		end
		if not (player.cmd.buttons &  BT_ATTACK)
			player.attackdown = false
		end*/

		//--reset the boss script music
			for	mo in mobjs.iterate(mo)
				if (mo.type == MT_PUMPKINHEAD)
					if (mo.health > 1)
						S_ChangeMusic("PJBOSS", true)
					end
				end
				if (mo.type == MT_PGHOST)
					/*if (mo.target) and (mo.health > 1)
						S_ChangeMusic("PJBOSS", true, mo.target.player)
					end*/
					if (mo.health == 0)
						S_ChangeMusic("SILENC", true)
					end
				end
			end	
	end	
end)

