#include "zcommon.acs"

//set line specials and such yada yada
SCRIPT 01 OPEN
{
	Sector_SetColor(const:2, 192, 240, 255); // Water
	SetLineSpecial(1,ACS_EXECUTE,2);
	if (GameType () != GAME_NET_DEATHMATCH)  //Does not happen in deathmatch
	{
	setMusic("AOTBEACH");
	}
}

//open secret area
SCRIPT 02 (VOID)
{
	Floor_LowertoLowest(0,16);
	SetLineBlocking(1, BLOCK_NOTHING);
	print(s:"DOPEFISH LIVES!");
	setMusic("VEGGIES");
}

//change the music
SCRIPT 03 (int track)
{
	switch(track)
	{
		case 0:
			setMusic("AOTBEACH");
			break;
		case 1:
			setMusic("COCONUT");
			break;
		case 2:
			setMusic("UNDERSEA");
			break;
		case 3:
			setMusic("VEGGIES");
			break;
		case 4:
			setMusic("POYW");
			break;
		default:
			setMusic("AOTBEACH");
			break;
	}
}

//Reggae Cocunut talk
SCRIPT 04 (VOID)
{
 SetPlayerProperty(0,1,PROP_TOTALLYFROZEN);
 
 //MESSAGE
 LocalAmbientSound("misc/chat", 127);
 messageBox_Plain("Put da lime in da coconut mon!","BILFONT",0,CR_TAN);
 
 int buttons;
 bool ok = false;
 delay(8);
 while (ok == false)
 {
    buttons = GetPlayerInput(-1, INPUT_BUTTONS);
    if (buttons & BT_USE)
       ok = true;
    delay(1);
 }
 messageBox_Clear();
 
 //END
 SetPlayerProperty(0,0,PROP_TOTALLYFROZEN);
}

//Stretch Coconuthead's speech
SCRIPT 05 (VOID)
{
 SetPlayerProperty(0,1,PROP_TOTALLYFROZEN);
 //SetPlayerProperty(0,1,PROP_INVULNERABILITY);
 LocalAmbientSound("misc/chat", 127);
 messageBox_Plain("I'm Stretch Coconuthead!\nGive me a lime and I'll dance for you!","BILFONT",0,CR_TAN);
 
 int buttons;
 bool ok = false;
 delay(8);
 while (ok == false)
 {
    buttons = GetPlayerInput(-1, INPUT_BUTTONS);
    if (buttons & BT_USE)
       ok = true;
    delay(1);
 }
 
 if (CheckInventory("Lime") > 0)
 {
	 LocalAmbientSound("FANFARE", 127);
	 messageBox_Plain("Oh, Yummy!\n\n\n*GULP!*","BILFONT",0,CR_TAN);
	 
	 takeInventory("Lime",1);
	 delay(64);
	 
	 LocalAmbientSound("menu/change", 127);
	 messageBox_Plain("Get ready to start movin and groovin!","BILFONT",0,CR_TAN);
	 
	 ok = false;
	 delay(8);
	 while (ok == false)
	 {
		buttons = GetPlayerInput(-1, INPUT_BUTTONS);
		if (buttons & BT_USE)
		   ok = true;
		delay(1);
	 }
	 messageBox_Clear();
	 
	 thing_SetSpecial(5,ACS_EXECUTE,8,0,0);
	 thing_SetSpecial(3,ACS_EXECUTE,3,0,1);
	 setActorState(3,"Dance");
	 setMusic("COCONUT");
 }

 //end dialogue
 messageBox_Clear();
 SetPlayerProperty(0,0,PROP_TOTALLYFROZEN);
 //SetPlayerProperty(0,0,PROP_INVULNERABILITY);
}

//Bananasauros talk
SCRIPT 06 (VOID)
{
 SetPlayerProperty(0,1,PROP_TOTALLYFROZEN);
 
 //MESSAGE
 LocalAmbientSound("BANANOSAURSIGHT", 127);
 messageBox_Plain("Warble Warble!","BILFONT",0,CR_TAN);
 
 int buttons;
 bool ok = false;
 delay(8);
 while (ok == false)
 {
    buttons = GetPlayerInput(-1, INPUT_BUTTONS);
    if (buttons & BT_USE)
       ok = true;
    delay(1);
 }
 messageBox_Clear();
 
 //END
 SetPlayerProperty(0,0,PROP_TOTALLYFROZEN);
}

//Pineapple of Politeness regular talk
SCRIPT 07 (VOID)
{
 SetPlayerProperty(0,1,PROP_TOTALLYFROZEN);
 
 //MESSAGE
 LocalAmbientSound("misc/chat", 127);
 messageBox_Plain("Hey loser, you stink!\nDid anybody get the number of that freight train\nthat just blind-sided me?\nOh, wait.  It's just your fat BUTT!\n\nLOL!","BILFONT",0,CR_TAN);
 
 int buttons;
 bool ok = false;
 delay(8);
 while (ok == false)
 {
    buttons = GetPlayerInput(-1, INPUT_BUTTONS);
    if (buttons & BT_USE)
       ok = true;
    delay(1);
 }
 messageBox_Clear();
 
 //END
 SetPlayerProperty(0,0,PROP_TOTALLYFROZEN);
}

//Pineapple of Politeness joins you
SCRIPT 08 (VOID)
{
 SetPlayerProperty(0,1,PROP_TOTALLYFROZEN);
 
 //MESSAGE
 LocalAmbientSound("misc/chat", 127);
 messageBox_Plain("I can't take another minute of this guy's singing!\nHey buddy, can I tag along with you for a while?","BILFONT",0,CR_TAN);
 
 int buttons;
 bool ok = false;
 delay(8);
 while (ok == false)
 {
    buttons = GetPlayerInput(-1, INPUT_BUTTONS);
    if (buttons & BT_USE)
       ok = true;
    delay(1);
 }
 messageBox_Clear();
 
 setmusic("MSTCFNFR");
 delay(8*35);
 delay(16);
 setmusic("");

 messageBox_Plain("Pineapple of Politeness joined your party.","BILFONT",0,CR_TAN);
	 
 ok = false;
 delay(8);
 while (ok == false)
 {
		buttons = GetPlayerInput(-1, INPUT_BUTTONS);
		if (buttons & BT_USE)
		   ok = true;
		delay(1);
 }
 messageBox_Clear();
 
 thing_Remove(5);
 giveInventory("PineappleOfPoliteness",1);
 setmusic("COCONUT");
 
 //END
 SetPlayerProperty(0,0,PROP_TOTALLYFROZEN);
}