let imgb=GetCurrentScriptDirectory~"shinki.png";
LoadGraphic(imgb);
let imgc=GetCurrentScriptDirectory~"img\spellbg.png";
LoadGraphic(imgc);
let imgd=GetCurrentScriptDirectory~"img\black.png";
LoadGraphic(imgd);
let count=0;
let anim=0;
let spellbgdist=0;


sub survivalanimm{
	count=0;
	anim=0;
	DrawText("Shinki", 40, 36, 12, 255);
	if(GetSpeedX<1 && GetSpeedX>=-0.1)
	{
	SetTexture(imgb);
	SetGraphicRect(0, 0, 128, 128);
	SetGraphicScale(1, 1);
	SetAlpha(155);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetX, GetY);
	}
	if(GetSpeedX<-0.1 && GetSpeedX>=-1)
	{
	SetTexture(imgb);
	SetGraphicRect(256, 0, 384, 128);
	SetGraphicScale(1, 1);
	SetAlpha(122.5);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetX, GetY);
	}
	if(GetSpeedX<-1)
	{
	SetTexture(imgb);
	SetGraphicRect(256, 128, 384, 256);
	SetGraphicScale(1, 1);
	SetAlpha(122.5);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetX, GetY);
	}
	if(GetSpeedX>0.1 && GetSpeedX<=1)
	{
	SetTexture(imgb);
	SetGraphicRect(256, 256, 384, 384);
	SetGraphicScale(1, 1);
	SetAlpha(122.5);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetX, GetY);
	}
	if(GetSpeedX>1)
	{
	SetTexture(imgb);
	SetGraphicRect(256, 384, 384, 512);
	SetGraphicScale(1, 1);
	SetAlpha(122.5);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetX, GetY);



	}
}


sub animm{
	count=0;
	anim=0;
	DrawText("Shinki", 40, 36, 12, 255);
	if(GetSpeedX<0.1 && GetSpeedX>-0.1)
	{
	SetTexture(imgb);
	SetGraphicRect(0, 0, 128, 128);
	SetGraphicScale(1, 1);
	SetAlpha(255);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetX, GetY);
	}
	if(GetSpeedX<-0.1 && GetSpeedX>=-1)
	{
	SetTexture(imgb);
	SetGraphicRect(256, 0, 384, 128);
	SetGraphicScale(1, 1);
	SetAlpha(255);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetX, GetY);
	}
	if(GetSpeedX<-1)
	{
	SetTexture(imgb);
	SetGraphicRect(256, 128, 384, 256);
	SetGraphicScale(1, 1);
	SetAlpha(255);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetX, GetY);
	}
	if(GetSpeedX>0.1 && GetSpeedX<=1.5)
	{
	SetTexture(imgb);
	SetGraphicRect(256, 256, 384, 384);
	SetGraphicScale(1, 1);
	SetAlpha(255);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetX, GetY);
	}
	
}

sub animation{
	count++;
	if(count<=15)
	{
	SetTexture(imgb);
	SetGraphicRect(512, floor(count/5)*128, 640, floor(count/5)*128+128);
	SetGraphicScale(1, 1);
	SetAlpha(255);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetX, GetY);
	}else{
	SetTexture(imgb);
	SetGraphicRect(640, floor((count-15)/5)*128, 768, floor((count-15)/5)*128+128);
	SetGraphicScale(1, 1);
	SetAlpha(255);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetX, GetY);

	DrawText("Alice Margatroid", 40, 36, 12, 255);
	}
}

sub spellbg
{
	if(spellbgdist>256){spellbgdist-=256;}
	SetTexture(imgd);
	SetGraphicRect(0, 0, 1000, 1000);
	SetGraphicScale(1, 1);
	SetAlpha(255);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(GetCenterX, GetCenterY);
	SetTexture(imgc);
	SetGraphicRect(0, 0, 256, 256);
	SetGraphicScale(1.5, 1.5);
	SetAlpha(255);
	SetGraphicAngle(0, 0, 0);
	ascent(i in -1..2)
	{
	DrawGraphic(GetCenterX, GetCenterY-spellbgdist+i*256);
	}

	spellbgdist++;
DrawText("Shinki", 40, 36, 12, 255);
}