let ITEM_POINT=0;
let ITEM_BOMB=1;
let ITEM_1UP=2;
let ITEM_MULTI=3;

function SetItem(let x,let y,let type)
{
	let data=[x,y,type];
	let itemstate=GetCommonDataDefault("ItemState",[]);
	itemstate=itemstate~[data];
	SetCommonData("ItemState",itemstate);
}


task SetEnemyShot01(let sx,let sy,let spd,let angle,let gra,let delay)
{
	let red=GetCommonDataDefault("RED",1);
	
	let speed=[spd,spd*1.05,spd*1.1,spd*1.6];
	let max=1;
	if(red>5000){max=2;}
	if(red>8000){max=3;}
	if(red>9999){max=4;}
	
	ascent(a in 0..max)
	{
		CreateShot01(sx,sy,speed[a],angle,gra,delay);
	}
}

task SetEnemyShot02(let sx,let sy,let spd,let angle,let acl,let mspd,let gra,let delay)
{
	let red=GetCommonDataDefault("RED",1);
	
	let speed=[spd,spd*1.1,spd*1.2,spd*1.3];
	let accel=[acl,acl*1.1,acl*1.2,acl*1.3];
	let maxspeed=[mspd,mspd*1.1,mspd*1.2,mspd*1.3];
	let max=1;
	if(red>5000){max=2;}
	if(red>8000){max=3;}
	if(red>9999){max=4;}
	ascent(a in 0..max)
	{
		CreateShot02(sx,sy,speed[a],angle,accel[a],maxspeed[a],gra,delay);
	}
}


task SetDelayEffect(
let x,
let y,
let gra,
let delay)
{
	let flame=0;
	let o=Obj_Create(OBJ_SHOT);
	Obj_SetX(o,x);
	Obj_SetY(o,y);
	Obj_SetSpeed(o,0);
	Obj_SetAngle(o,0);
	ObjShot_SetGraphic(o,gra);
	ObjShot_SetDelay(o,delay);
	ObjShot_SetBombResist(o,true);
	
	while(!Obj_BeDeleted(o))
	{
		if(delay-1<=flame){Obj_Delete(o);}
		flame++;
		yield;
	}
}
