#東方弾幕風
#Title[フローリア　スペル2]
#Text[]
#ScriptVersion[2]
#Player[script\script_Player\PlayerScript.txt]
script_enemy_main{
#include_function "script\Script-System\ThymeGauge2.txt"
#include_function "script\Script-System\Timer.txt"
#include_function "script\Script-System\LifeStar.txt"
#include_function "script\Script-System\LifeCircle.dms"
#include_function "script\Script-System\MagicCircle.txt"
#include_function "script\Script-System\ChargeEffect.txt"
#include_function "script\Script-System\BossVanish.txt"
SetCommonData("Player","Reimu");//保存時に消してください	
SetCommonData("OKShot",true);
let Frame1=0;
let Frame2=0;
let Cx=GetCenterX;
let Cy=GetCenterY;
let CutInSwitch=true;
let cutend=false;
let BossImage="script\Script-1Boss\Frolir-Dot.png";
let Anime1=0;let Anime2=0;let Anime3=0;let Anime4=0;let Height=0;
let MoveMord1=true; let BossShot=false;let MoveMord2=false;
let Frame1=0;let Frame2=0;let Frame3=0;let Frame4=0;let Frame5=0;
let Cx=GetCenterX; let Cy=GetCenterY; let Htime=0; let Move=true;
let Set1=0; let Set2=0; let Set3=0; let Set4=0; let Set5=0;
let Angle1=0; let Angle2=0;
let NowBom=false;
let Bariaon=false;
@Initialize{
SetLife(1);
SetTimer(60);
SetDamageRate(100,100);
ThymeGauge1;
TimerBack;
SetEnemyMarker(true);
SetCommonData("SetStar",0);
SetCommonData("SetStarX",GetCenterX-185);
LifeStar1;
SetCommonData("BossNumber",1);
BossName;
LoadUserShotData("script\Script-System\AllShotData.txt");
SetGraphicRect(0,96,63,191);
LoadGraphic(BossImage);
SetMovePosition03(GetCenterX,150,10,4);
MoveMord1=true;
SetBossLifeCircle(3200,false,20,true);
BossMagicCircle;
}
			
@MainLoop{
yield;
Frame1++;Frame2++;Frame3++;Frame4++;Frame5++;
if(Frame1==60){
PlaySE("script\SE\SpellCard.wav");
Back1;
Back3;
Back4;
Back2;
SpellEffect;
SpellLight;
BossCutIn;
SpellName;
}
SetCollisionA(GetX,GetY,25);SetCollisionB(GetX,GetY+Height,20);
if(Frame3==250){
Move=true;
if(Cx>GetX){
MoveMord1=true;
SetMovePosition03(rand(Cx,Cx+50),rand(100,200),10,3);
}
if(Cx<GetX){
MoveMord2=true;
SetMovePosition03(rand(Cx,Cx-50),rand(100,200),10,3);
}
Move=false;
}
if(Frame1==60){
Move=false;
Charge;
}

if(Frame1==200){
Move=false;
Charge;
Set4=GetPlayerX;
Set5=GetPlayerY;
}

if(Frame1==260){
PlaySE("script\SE\Kira1.wav");
loop(18){
Angle2=(Angle1-40*60);
Set2=Set4+70*cos(Angle2);
Set3=Set5+70*sin(Angle2);
Shot1;
Angle1+=20;
}
if(Set1==1){
}else{
Frame1=255;
}
}
if(Frame2==270){
Set1=1;
}
if(Frame2==600){
Set1=0;
Frame1=100;
Frame2=100;
}
DeleteEnemyShotImmediatelyInCircle(ALL,0,0,1);


}
	

task Shot1{
let shot1=Obj_Create(OBJ_SHOT);
let count=0;
let frame1=0;
let X1=0;
let X2=0;
let Y1=0;
let Y2=0;
Obj_SetX(shot1,Set2);//x座標設定
Obj_SetY(shot1,Set3);//y座標設定;
ObjShot_SetDelay(shot1,20);
Obj_SetSpeed(shot1,rand(1,3));//速度設定
ObjShot_SetGraphic(shot1,37);//画像設定
Obj_SetAngle(shot1,Angle2);
loop{
frame1++;
SetCommonData("ShotX",Obj_GetX(shot1));
SetCommonData("ShotY",Obj_GetY(shot1));
if(frame1==60){
Obj_SetSpeed(shot1,0);
}
if(frame1==120){
Cold;
Angle1=70;
loop(3){
Shot2;
Angle1+=20;
}
Obj_Delete(shot1);
}
task Shot2{
let shot1=Obj_Create(OBJ_SHOT);
let count=0;
let frame1=0;
let X1=0;
let X2=0;
let Y1=0;
let Y2=0;
Obj_SetX(shot1,GetCommonData("ShotX"));//x座標設定
Obj_SetY(shot1,GetCommonData("ShotY"));//y座標設定;
ObjShot_SetDelay(shot1,10);
Obj_SetSpeed(shot1,0.3);//速度設定
ObjShot_SetGraphic(shot1,44);//画像設定
Obj_SetAngle(shot1,rand(0,360));
loop{
yield;
}
}

task Cold{
let X=GetCommonData("ShotX");
let Y=GetCommonData("ShotY");
let Img1="script\img-System\EffectSet-1.png";
let rect01=128;
let rect02=0;
let rect03=191;
let rect04=63;
let Layer=5;
let W=(rect03-rect01)/2;
let H=(rect04-rect02)/2;
let Angle1=0;
let Angle2=40;
let Angle3=40;
let Scale=1;
let Frame1=0;
let Set1=0;
let Set2=0;
let Set3=0;
let Set4=0;
let Set5=0;
let Angle2=rand(0,180)+40;
let Angle3=rand(0,180)+40;
let Alpha=255;
let Obj=Obj_Create(OBJ_EFFECT);
LoadGraphic(Img1);
ObjEffect_SetTexture(Obj,Img1);
ObjEffect_SetRenderState(Obj,ADD);
ObjEffect_SetPrimitiveType(Obj, PRIMITIVE_TRIANGLEFAN);
ObjEffect_CreateVertex(Obj,4);
ObjEffect_SetLayer(Obj,Layer);
Obj_SetPosition(Obj,X,Y);
ObjEffect_SetAngle(Obj,0,0,0);
ObjEffect_SetScale(Obj,1.0,1.0);
ObjEffect_SetVertexXY(Obj,0,-W,-H);
ObjEffect_SetVertexXY(Obj,1,W,-H);
ObjEffect_SetVertexXY(Obj,2,W,H);
ObjEffect_SetVertexXY(Obj,3,-W,H);
ObjEffect_SetVertexUV(Obj,0,rect01,rect02);
ObjEffect_SetVertexUV(Obj,1,rect03,rect02);
ObjEffect_SetVertexUV(Obj,2,rect03,rect04);
ObjEffect_SetVertexUV(Obj,3,rect01,rect04);
ObjEffect_SetVertexColor(Obj,0,255,255,255,255);
ObjEffect_SetVertexColor(Obj,1,255,255,255,255);
ObjEffect_SetVertexColor(Obj,2,255,255,255,255);
ObjEffect_SetVertexColor(Obj,3,255,255,255,255);
loop{
Frame1++;
Angle1++;
Angle2++;
Angle3++;
ObjEffect_SetScale(Obj,Scale,Scale);
ObjEffect_SetVertexColor(Obj,0,Alpha,255,255,255);
ObjEffect_SetVertexColor(Obj,1,Alpha,255,255,255);
ObjEffect_SetVertexColor(Obj,2,Alpha,255,255,255);
ObjEffect_SetVertexColor(Obj,3,Alpha,255,255,255);
if(Scale>5){	
}else{
Scale+=0.1;
}
if(Alpha<0){
Obj_Delete(Obj);
break;
}else{
Alpha-=8;
}
if(Obj_GetX(Obj)==0){
Obj_Delete(Obj);
break;
}
yield;	
}
}
yield;
}
}	
	
	
	
	
	
	
	
	
	
@DrawLoop{
SetTexture(BossImage);
DrawGraphic(GetX,GetY+Height);
Anime1++;
Anime2++;
Anime3++;
Anime4++;
if(GetSpeed<0.1){
if(MoveMord2==true){
if(Anime1==1){
SetGraphicRect(192,96,255,191);
} 
if(Anime1==5){
SetGraphicRect(128,96,191,191);
}
if(Anime1==10){
SetGraphicRect(64,96,127,191);
}
if(Anime1==15){
SetGraphicRect(0,96,63,191);
}
if(Anime1==20){
MoveMord2=false;
Anime1=0;
Anime2=0;
Anime4=0;
}
}else if(MoveMord1==true){
if(Anime1==1){
SetGraphicRect(192,192,255,287);
} 
if(Anime1==5){
SetGraphicRect(128,192,191,287);
}
if(Anime1==10){
SetGraphicRect(64,192,127,287);
}
if(Anime1==15){
SetGraphicRect(0,192,63,287);
}
if(Anime1==20){
MoveMord1=false;
Anime1=0;
Anime2=0;
}
}else{
 
if(BossShot==true){
if(Anime4==1){
SetGraphicRect(0,288,63,383);
}
if(Anime4==5){
SetGraphicRect(64,288,127,383);
} 
if(Anime4==10){
SetGraphicRect(128,288,191,383);
}
if(Anime4==15){
SetGraphicRect(192,288,255,383);
}
}else{
Anime2=0;
Anime3=0;
Anime4=0;
if(Anime1==1){
SetGraphicRect(0,0,63,95);
}
if(Anime1==10){
SetGraphicRect(64,0,127,95);
}
if(Anime1==20){
SetGraphicRect(128,0,191,95);
}
if(Anime1==30){
SetGraphicRect(192,0,255,95);
}
if(Anime1==40){
SetGraphicRect(128,0,191,95);
}
if(Anime1==50){
SetGraphicRect(64,0,127,95);
Anime1=0;
}
}
}
}else if(GetSpeedX<0){
Anime1=0;
Anime3=0;
Anime4=0;
if(Anime2==1){
SetGraphicRect(0,96,63,191);
}
if(Anime2==5){
SetGraphicRect(64,96,127,191);
}
if(Anime2==10){
SetGraphicRect(128,96,191,191);
}
if(Anime2==15){
SetGraphicRect(192,96,255,191);
}
}else{
Anime1=0;
Anime2=0;
Anime4=0;
if(Anime3==1){
SetGraphicRect(0,192,63,287);
} 
if(Anime3==5){
SetGraphicRect(64,192,127,287);
}
if(Anime3==10){
SetGraphicRect(128,192,191,287);
}
if(Anime3==15){
SetGraphicRect(192,192,255,287);
}

}
if(Move==false){
Htime++;
}
if(Htime==1){
Height+=1;
}
if(Htime==10){
Height+=1;
}
if(Htime==20){
Height+=1;
}
if(Htime==30){
Height-=1;
}
if(Htime==40){
Height-=1;
}
if(Htime==50){
Height-=1;
Htime=0;
}
}
			
@Finalize{
PlaySE("script\SE\Vanish2.wav");
Vanish;
}
task SpellLight{
let X=GetCenterX;
let Y=GetCenterY;
let img1="script\img-System\SpellEffectLight.png";
let rect01=0;
let rect02=0;
let rect03=384;
let rect04=448;
let Layer=6;
let W=(rect03-rect01)/2;
let H=(rect04-rect02)/2;
let alpha=0;
let alpha2=0;
let angle=180;
let frame1=0;
let set=0;
let obj = Obj_Create(OBJ_EFFECT);
if(Obj_BeDeleted(obj)==false){
LoadGraphic(img1);
ObjEffect_SetTexture(obj,img1);
ObjEffect_SetRenderState(obj,ADD);
ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
ObjEffect_CreateVertex(obj, 4);
ObjEffect_SetLayer(obj,Layer);
Obj_SetPosition(obj, X, Y);
ObjEffect_SetAngle(obj,0,0,0);
ObjEffect_SetScale(obj,1.0,1.0);
ObjEffect_SetVertexXY(obj, 0,-W,-H);ObjEffect_SetVertexXY(obj, 1, W,-H);
ObjEffect_SetVertexXY(obj, 2, W, H);ObjEffect_SetVertexXY(obj, 3,-W, H);
ObjEffect_SetVertexUV(obj, 0, rect01, rect02);ObjEffect_SetVertexUV(obj, 1, rect03, rect02);
ObjEffect_SetVertexUV(obj, 2, rect03, rect04);ObjEffect_SetVertexUV(obj, 3, rect01, rect04);
ObjEffect_SetVertexColor(obj, 0, 255, 255, 255, 255);ObjEffect_SetVertexColor(obj, 1, 255, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 2, 255, 255, 255, 255);ObjEffect_SetVertexColor(obj, 3, 255, 255, 255, 255);
loop{
if(alpha>255){set=1;}
if(alpha<0){set=0;}
if(set==1){alpha-=10;}else{alpha+=10;}
if(angle<0){	}else{angle-=3;}
if(cutend==true){frame1++;}else{}
ObjEffect_SetVertexColor(obj, 0, alpha, 255, 255, 255);ObjEffect_SetVertexColor(obj, 1, alpha, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 2, alpha, 255, 255, 255);ObjEffect_SetVertexColor(obj, 3, alpha, 255, 255, 255);
if(frame1==1){set=1;}
if(frame1==5){}
if(frame1==20){Obj_Delete(obj);break;}
yield;
}
}
}
task SpellEffect{
let X=GetCenterX;
let Y=GetCenterY;
let img1="script\img-System\SpellEffect.png";
let rect01=0;
let rect02=0;
let rect03=384;
let rect04=448;
let Layer=6;
let W=(rect03-rect01)/2;
let H=(rect04-rect02)/2;
let alpha=0;
let alpha2=0;
let angle=180;
let frame1=0;
let set=0;
let obj = Obj_Create(OBJ_EFFECT);
if(Obj_BeDeleted(obj)==false){
LoadGraphic(img1);
ObjEffect_SetTexture(obj,img1);
ObjEffect_SetRenderState(obj,ALPHA);
ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
ObjEffect_CreateVertex(obj, 4);
ObjEffect_SetLayer(obj,Layer);
Obj_SetPosition(obj, X, Y);
ObjEffect_SetAngle(obj,0,0,0);
ObjEffect_SetScale(obj,1.0,1.0);
ObjEffect_SetVertexXY(obj, 0,-W,-H);ObjEffect_SetVertexXY(obj, 1, W,-H);
ObjEffect_SetVertexXY(obj, 2, W, H);ObjEffect_SetVertexXY(obj, 3,-W, H);
ObjEffect_SetVertexUV(obj, 0, rect01, rect02);ObjEffect_SetVertexUV(obj, 1, rect03, rect02);
ObjEffect_SetVertexUV(obj, 2, rect03, rect04);ObjEffect_SetVertexUV(obj, 3, rect01, rect04);
ObjEffect_SetVertexColor(obj, 0, 255, 255, 255, 255);ObjEffect_SetVertexColor(obj, 1, 255, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 2, 255, 255, 255, 255);ObjEffect_SetVertexColor(obj, 3, 255, 255, 255, 255);
loop{
if(alpha>255){set=1;}
if(alpha<0){set=0;}
if(set==1){}else{alpha+=6;}
if(angle<0){	}else{angle-=3;}
if(cutend==true){frame1++;alpha2-=10;
ObjEffect_SetVertexColor(obj, 0, alpha2, 255, 255, 255);ObjEffect_SetVertexColor(obj, 1, alpha2, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 2, alpha2, 255, 255, 255);ObjEffect_SetVertexColor(obj, 3, alpha2, 255, 255, 255);}else{
ObjEffect_SetVertexColor(obj, 0, alpha, 255, 255, 255);ObjEffect_SetVertexColor(obj, 1, alpha, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 2, alpha, 255, 255, 255);ObjEffect_SetVertexColor(obj, 3, alpha, 255, 255, 255);
}if(frame1==1){alpha2=alpha;}if(frame1==5){}
if(frame1==20){Obj_Delete(obj);break;}yield;
}
}
}
task BossCutIn{
let X=Cx+180;
let Y=Cy-50;
let rect01=1;
let rect02=1;
let rect03=450;
let rect04=612;
let img1="script\img-Character\Frolir-1.png";
let Layer=6;
let W=(rect03-rect01)/2;
let H=(rect04-rect02)/2;
let frame1=0;
let set1=0;
let obj = Obj_Create(OBJ_EFFECT);
LoadGraphic(img1);
ObjEffect_SetTexture(obj,img1);
ObjEffect_SetRenderState(obj,ALPHA);
ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
ObjEffect_CreateVertex(obj, 4);
ObjEffect_SetLayer(obj,Layer);
Obj_SetPosition(obj, X, Y);
ObjEffect_SetAngle(obj,0,0,0);
ObjEffect_SetScale(obj,1.0,1.0);
ObjEffect_SetVertexXY(obj, 0,-W,-H);ObjEffect_SetVertexXY(obj, 1, W,-H);
ObjEffect_SetVertexXY(obj, 2, W, H);ObjEffect_SetVertexXY(obj, 3,-W, H);
ObjEffect_SetVertexUV(obj, 0, rect01, rect02);ObjEffect_SetVertexUV(obj, 1, rect03, rect02);
ObjEffect_SetVertexUV(obj, 2, rect03, rect04);ObjEffect_SetVertexUV(obj, 3, rect01, rect04);
ObjEffect_SetVertexColor(obj, 0, 255, 255, 255, 255);ObjEffect_SetVertexColor(obj, 1, 255, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 2, 255, 255, 255, 255);ObjEffect_SetVertexColor(obj, 3, 255, 255, 255, 255);
loop{
frame1++;
if(frame1==5){PlaySE("script\SE\SpellCut.wav");Obj_SetAngle(obj,150);Obj_SetSpeed(obj,10);}
if(frame1==10){Obj_SetSpeed(obj,8);}if(frame1==14){Obj_SetSpeed(obj,7);}
if(frame1==17){Obj_SetSpeed(obj,6);}if(frame1==19){Obj_SetSpeed(obj,5);}
if(frame1==21){Obj_SetSpeed(obj,4);}if(frame1==24){Obj_SetSpeed(obj,3);}
if(frame1==26){Obj_SetSpeed(obj,2);}if(frame1==27){Obj_SetSpeed(obj,1);}
if(frame1==28){Obj_SetSpeed(obj,0.5);}if(frame1==90){Obj_SetSpeed(obj,2);}
if(frame1==95){Obj_SetSpeed(obj,3);}if(frame1==100){Obj_SetSpeed(obj,4);}
if(frame1==105){Obj_SetSpeed(obj,5);}if(frame1==110){Obj_SetSpeed(obj,6);}
if(frame1==115){Obj_SetSpeed(obj,7);}if(frame1==120){Obj_SetSpeed(obj,8);}
if(frame1==125){Obj_SetSpeed(obj,9);}if(frame1==130){Obj_SetSpeed(obj,16);}
if(frame1==145){cutend=true;}if(frame1==190){CutInSwitch=false;Obj_Delete(obj);break;}
yield;
}
}
task SpellName{
let X=Cx+64;
let Y=Cy+150;
let img1="script\Script-1Boss\Frolir-Spell04.png";
img1="script\Script-1Boss\Frolir-Spell04.png";
let rect01=0;
let rect02=0;
let rect03=256;
let rect04=40;
let Layer=6;
let W=(rect03-rect01)/2;
let H=(rect04-rect02)/2;
let frame1=0;
let scale=2;
let set1=0;
let obj = Obj_Create(OBJ_EFFECT);
LoadGraphic(img1);
ObjEffect_SetTexture(obj,img1);
ObjEffect_SetRenderState(obj,ALPHA);
ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
ObjEffect_CreateVertex(obj, 4);
ObjEffect_SetLayer(obj,Layer);
Obj_SetPosition(obj, X, Y);
ObjEffect_SetAngle(obj,0,0,0);
ObjEffect_SetScale(obj,1.0,1.0);
ObjEffect_SetVertexXY(obj, 0,-W,-H);
ObjEffect_SetVertexXY(obj, 1, W,-H);
ObjEffect_SetVertexXY(obj, 2, W, H);
ObjEffect_SetVertexXY(obj, 3,-W, H);
ObjEffect_SetVertexUV(obj, 0, rect01, rect02);
ObjEffect_SetVertexUV(obj, 1, rect03, rect02);
ObjEffect_SetVertexUV(obj, 2, rect03, rect04);
ObjEffect_SetVertexUV(obj, 3, rect01, rect04);
ObjEffect_SetVertexColor(obj, 0, 255, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 1, 255, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 2, 255, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 3, 255, 255, 255, 255);
loop{
frame1++;
if(scale<1){}else{scale-=0.1;ObjEffect_SetScale(obj,scale,scale);}
if(frame1==5){Obj_SetAngle(obj,-90);Obj_SetSpeed(obj,0);}
if(frame1==60){Obj_SetSpeed(obj,1);}if(frame1==62){Obj_SetSpeed(obj,2);}if(frame1==64){Obj_SetSpeed(obj,3);}
if(frame1==66){Obj_SetSpeed(obj,4);}if(frame1==68){Obj_SetSpeed(obj,5);}
if(frame1==70){Obj_SetSpeed(obj,6);}if(frame1==72){Obj_SetSpeed(obj,7);}
if(frame1==74){Obj_SetSpeed(obj,8);}if(frame1==76){Obj_SetSpeed(obj,9);}
if(frame1==78){Obj_SetSpeed(obj,10);}if(frame1==100){Obj_SetSpeed(obj,5);}
if(frame1==102){Obj_SetSpeed(obj,4);}if(frame1==104){Obj_SetSpeed(obj,3);}
if(frame1==106){Obj_SetSpeed(obj,2);}if(frame1==108){Obj_SetSpeed(obj,1);}if(frame1==110){Obj_SetSpeed(obj,0);}
yield;
}
}
task Back1{
let X=Cx;
let Y=Cy;
let img1="script\Script-1Boss\Frolir-Back1.png";
let rect01=0;
let rect02=0;
let rect03=384;
let rect04=448;
let Layer=0;
let Alpha=0;
let Set=0;
let Collar=0;
let W=(rect03-rect01)/2;
let H=(rect04-rect02)/2;
let obj = Obj_Create(OBJ_EFFECT);
LoadGraphic(img1);
ObjEffect_SetTexture(obj,img1);
ObjEffect_SetRenderState(obj,ALPHA);
ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
ObjEffect_CreateVertex(obj, 4);
ObjEffect_SetLayer(obj,Layer);
Obj_SetPosition(obj, X, Y);
ObjEffect_SetAngle(obj,0,0,0);
ObjEffect_SetVertexXY(obj, 0,-W,-H);
ObjEffect_SetVertexXY(obj, 1, W,-H);
ObjEffect_SetVertexXY(obj, 2, W, H);
ObjEffect_SetVertexXY(obj, 3,-W, H);
ObjEffect_SetVertexUV(obj, 0, rect01, rect02);
ObjEffect_SetVertexUV(obj, 1, rect03, rect02);
ObjEffect_SetVertexUV(obj, 2, rect03, rect04);
ObjEffect_SetVertexUV(obj, 3, rect01, rect04);
ObjEffect_SetVertexColor(obj, 0, 255, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 1, 255, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 2, 255, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 3, 255, 255, 255, 255);
loop{

yield;
}
}
task Back2{
let X=Cx;
let Y=Cy;
let img1="script\Script-1Boss\Frolir-Back2.png";
let rect01=0;
let rect02=0;
let rect03=750;
let rect04=750;
let Layer=0;
let Alpha=255;
let Set=0;
let Collar=0;
let Scale=1;
let Set2=0;
let SetA=0;
let SetB=1;
let SetC=2;
let SetD=3;
let Frame1=0;
let W=(rect03-rect01)/2;
let H=(rect04-rect02)/2;
let obj = Obj_Create(OBJ_EFFECT);
LoadGraphic(img1);
ObjEffect_SetRenderState(obj,MULTIPLY);
ObjEffect_SetTexture(obj,img1);
ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
ObjEffect_CreateVertex(obj, 4);
ObjEffect_SetLayer(obj,Layer);
Obj_SetPosition(obj, X, Y);
ObjEffect_SetAngle(obj,0,0,0);
ObjEffect_SetVertexXY(obj, 0,-W,-H);
ObjEffect_SetVertexXY(obj, 1, W,-H);
ObjEffect_SetVertexXY(obj, 2, W, H);
ObjEffect_SetVertexXY(obj, 3,-W, H);
ObjEffect_SetVertexUV(obj, 0, rect01, rect02);
ObjEffect_SetVertexUV(obj, 1, rect03, rect02);
ObjEffect_SetVertexUV(obj, 2, rect03, rect04);
ObjEffect_SetVertexUV(obj, 3, rect01, rect04);
ObjEffect_SetVertexColor(obj, 0, 200, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 1, 200, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 2, 200, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 3, 200, 255, 255, 255);
loop{
ObjEffect_SetAngle(obj,0,0,Set2);
ObjEffect_SetScale(obj,Scale,Scale);
Set2+=1;
yield;
}
}
task Back3{
let X=Cx+150;
let Y=Cy+150;
let img1="script\Script-1Boss\Frolir-Back3.png";
let rect01=0;
let rect02=0;
let rect03=291;
let rect04=291;
let Layer=0;
let Alpha=255;
let Set=0;
let Collar=0;
let Scale=2;
let Set2=0;
let SetA=0;
let SetB=1;
let SetC=2;
let SetD=3;
let Frame1=0;
let W=(rect03-rect01)/2;
let H=(rect04-rect02)/2;
let obj = Obj_Create(OBJ_EFFECT);
LoadGraphic(img1);
ObjEffect_SetRenderState(obj,ADD);
ObjEffect_SetTexture(obj,img1);
ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
ObjEffect_CreateVertex(obj, 4);
ObjEffect_SetLayer(obj,Layer);
Obj_SetPosition(obj, X, Y);
ObjEffect_SetAngle(obj,0,0,0);
ObjEffect_SetVertexXY(obj, 0,-W,-H);
ObjEffect_SetVertexXY(obj, 1, W,-H);
ObjEffect_SetVertexXY(obj, 2, W, H);
ObjEffect_SetVertexXY(obj, 3,-W, H);
ObjEffect_SetVertexUV(obj, 0, rect01, rect02);
ObjEffect_SetVertexUV(obj, 1, rect03, rect02);
ObjEffect_SetVertexUV(obj, 2, rect03, rect04);
ObjEffect_SetVertexUV(obj, 3, rect01, rect04);
ObjEffect_SetVertexColor(obj, 0, 200, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 1, 200, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 2, 200, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 3, 200, 255, 255, 255);
loop{
ObjEffect_SetAngle(obj,0,0,Set2);
ObjEffect_SetScale(obj,Scale,Scale);
Set2+=0.3;
yield;
}
}
task Back4{
let X=Cx-150;
let Y=Cy-150;
let img1="script\Script-1Boss\Frolir-Back3.png";
let rect01=0;
let rect02=0;
let rect03=291;
let rect04=291;
let Layer=0;
let Alpha=255;
let Set=0;
let Collar=0;
let Scale=2;
let Set2=0;
let SetA=0;
let SetB=1;
let SetC=2;
let SetD=3;
let Frame1=0;
let W=(rect03-rect01)/2;
let H=(rect04-rect02)/2;
let obj = Obj_Create(OBJ_EFFECT);
LoadGraphic(img1);
ObjEffect_SetRenderState(obj,ADD);
ObjEffect_SetTexture(obj,img1);
ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
ObjEffect_CreateVertex(obj, 4);
ObjEffect_SetLayer(obj,Layer);
Obj_SetPosition(obj, X, Y);
ObjEffect_SetAngle(obj,0,0,0);
ObjEffect_SetVertexXY(obj, 0,-W,-H);
ObjEffect_SetVertexXY(obj, 1, W,-H);
ObjEffect_SetVertexXY(obj, 2, W, H);
ObjEffect_SetVertexXY(obj, 3,-W, H);
ObjEffect_SetVertexUV(obj, 0, rect01, rect02);
ObjEffect_SetVertexUV(obj, 1, rect03, rect02);
ObjEffect_SetVertexUV(obj, 2, rect03, rect04);
ObjEffect_SetVertexUV(obj, 3, rect01, rect04);
ObjEffect_SetVertexColor(obj, 0, 200, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 1, 200, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 2, 200, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 3, 200, 255, 255, 255);
loop{
ObjEffect_SetAngle(obj,0,0,Set2);
ObjEffect_SetScale(obj,Scale,Scale);
Set2+=0.3;
yield;
}
}

}


