//---------------------------------------------------------------------------------------------
//
//	Chromatic Wing Mod
//	
//	Penalty Function
//	Cut score and power - etc. when dead or bomb
//	
//	Dead Cost 1 power, 250000 score, 25000 fever
//	Bomb cost 1 power, 50000 score, 5000 fever
//	Death bomb cost "BOTH"
//	However, if you have power only for bomb and cast death bomb,
//	you get power penalty for bomb only~ I don't mass function with this :p
//
//---------------------------------------------------------------------------------------------

	#include_function".\function\glo_playerdrop.txt";

	// trigger dead flag
	let ng_deadtrigger = 0;
	let ng_bombtrigger = 0;

	let ng_pdeadX = 0;
	let ng_pdeadY = 0;


//---------------------------------------------------------------------------------------------
// Sub function itself
//---------------------------------------------------------------------------------------------

//-----------------------------------------------------------------------------------------
// On dead


	sub SFU_DEAD
	{
	if ((OnPlayerMissed  == true))
		{
		if (ng_deadtrigger == 0)
			{
			SetCommonData("CD_Power", GetCommonDataDefault("CD_Power",0) - 100);
			AddScore(-250000 * GetCommonDataDefault("CD_FeverMultiplyUse",1));
			SetCommonData("CD_Feverscore", GetCommonDataDefault("CD_Feverscore",0) - 25000);
			ng_pdeadX = GetPlayerX;
			ng_pdeadY = GetPlayerY;
			ng_deadtrigger = 1;
			}
		}


	if ((OnPlayerMissed == false) && (ng_deadtrigger == 1))
		{
		ng_deadtrigger = 0;
		if (OnBomb == false)
			{
			PlayerDropItem(ng_pdeadX, ng_pdeadY, 4, 3);
			}
		}
	}



//-----------------------------------------------------------------------------------------
// On bomb


	sub SFU_BOMB
	{
	if ((OnBomb == true))
		{
		if (ng_bombtrigger == 0)
			{
			SetCommonData("CD_Power", GetCommonDataDefault("CD_Power",0) - 100);
			AddScore(-50000 * GetCommonDataDefault("CD_FeverMultiplyUse",1));
			SetCommonData("CD_Feverscore", GetCommonDataDefault("CD_Feverscore",0) - 5000);
			ng_bombtrigger = 1;
			}
		}


	if ((OnBomb == false) && (ng_bombtrigger == 1))
		{
		ng_bombtrigger = 0;
		}
	}

