let gcsd = GetCurrentScriptDirectory;
let playerpower = GetPlayerPower;
#include"./../Stage/Script/LoadSounds.txt"

@Initialize{
	SetDefaultBonusItemEnable(false);
	LoadItemData(gcsd ~ "./item_library.txt");
	SetItemRenderPriorityI(60);}

@MainLoop{
	//SetPlayerPower(playerpower);
	yield;} 

@Event{
	alternative(GetEventType)
	case(EV_GET_ITEM){
		let itemID = GetEventArgument(0);
		alternative(itemID)
		case(1){SE(se_item);
		//	playerpower += 1;
		//	if(playerpower >= 400){
		//		playerpower = 400;}
		//	SetPlayerPower(playerpower);
			}
		case(2){SE(se_item);
		//	playerpower += 20;
		//	if(playerpower >= 400){
		//		playerpower = 400;}
		//	SetPlayerPower(playerpower);
		}
		case(3){SE(se_item);
		//	playerpower += 100;
		//	if(playerpower >= 400){
		//		playerpower = 400;}
		//	SetPlayerPower(playerpower);
		}
		case(4){SE(se_item);}
		case(5){SE(se_extend);
			let playerlife = GetPlayerLife;
			if(playerlife < 10){ 
				SetPlayerLife(playerlife+1);}}
		case(6){SE(se_lgods1);
			let playerspell = GetPlayerSpell;
			if(playerspell < 10){
				SetPlayerSpell(playerspell+1);}}
		case(7){SE(se_item);
			playerpower += 400;
			if(playerpower >= 400){
				playerpower = 400;}
			SetPlayerPower(playerpower);}
		case(8){SE(se_item);}
		case(9){SE(se_item);
			let lifep = GetAreaCommonData("LIFE","Number",0);
			lifep+=1; SetAreaCommonData("LIFE","Number",lifep);
			if(lifep >= 5){SE(se_extend);
			let playerlife = GetPlayerLife;
			if(playerlife < 10){ 
				SetPlayerLife(playerlife+1);}}}
		case(10){SE(se_item);
			let spellp = GetAreaCommonData("SPELL","Number",0);
			spellp+=1; SetAreaCommonData("SPELL","Number",spellp);
			if(spellp >= 5){SE(se_bonus2);
			let playerspell = GetPlayerSpell;
			if(playerspell < 10){ 
				SetPlayerSpell(playerspell+1);}}}
		case(11){SE(se_crystal);
			let fruit = GetAreaCommonData("COINS","Number",0);
			fruit++; SetAreaCommonData("COINS","Number",fruit);
			if(fruit >= 10){SE(se_crystal);
			SetAreaCommonData("ULTRA","PATH",1);
			SetAreaCommonData("COINS","Number",10);}}
	}}