let gcsd = GetCurrentScriptDirectory;
let item = gcsd ~ "./../Sounds/se_item00.wav";
let life = gcsd ~ "./../Sounds/se_extend.wav";
let spell = gcsd ~ "./../Sounds/se_getspell.wav";
let playerpower = GetPlayerPower;

@Initialize{
	LoadSound(item);
	LoadSound(life);
	LoadSound(spell);
	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){PlaySE(item);
			playerpower += 1;
			if(playerpower >= 400){
				playerpower = 400;}
			SetPlayerPower(playerpower);
			}
		case(2){PlaySE(item);
			playerpower += 20;
			if(playerpower >= 400){
				playerpower = 400;}
			SetPlayerPower(playerpower);}
		case(3){PlaySE(item);
			playerpower += 100;
			if(playerpower >= 400){
				playerpower = 400;}
			SetPlayerPower(playerpower);}
		case(4){PlaySE(item);}
		case(5){PlaySE(life);
			let playerlife = GetPlayerLife;
			if(playerlife < 20){ 
				SetPlayerLife(playerlife+1);}}
		case(6){PlaySE(spell);
			let playerspell = GetPlayerSpell;
			if(playerspell < 8){
				SetPlayerSpell(playerspell+1);}}
		case(7){PlaySE(item);
			playerpower += 400;
			if(playerpower >= 400){
				playerpower = 400;}
			SetPlayerPower(playerpower);}
		case(8){PlaySE(item);
			let fruit = GetAreaCommonData("Fruit","Number",0);
			fruit++; SetAreaCommonData("Fruit","Number",fruit);
			if(fruit >= 125){PlaySE(life);
			let playerlife = GetPlayerLife;
			if(playerlife < 20){ 
				SetPlayerLife(playerlife+1);}}}
	}}