#東方弾幕風
#Title[メリージール　スペル5]
#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 Cx=GetCenterX;
let Cy=GetCenterY;
let CutInSwitch=true;
let cutend=false;
let BossImage="script\Script-3Boss\Merysil-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 Frame6=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=180; let Angle3=90; let Angle4=90; let Angle5=0;
let Angle6=0; let Angle7=0; let Set6=0; let Set7=0; let Angle8=0; let Angle9=0;
let Set8=0; let Set9=0; let Set10=0; let Set11=0; let Angle10=0; let Angle11=0;
let Frame7=0; let Set12=0; let Set13=0; let Frame8=0;
let NowBom=false;
let Bariaon=false;
let BackFrame=0;
@Initialize{
SetLife(1);
SetTimer(60);
SetDamageRate(100,100);
ThymeGauge1;
TimerBack;
SetEnemyMarker(true);
SetCommonData("SetStar",0);
SetCommonData("SetStarX",GetCenterX-180);
LifeStar1;
SetCommonData("BossNumber",3);
BossName;
LoadUserShotData("script\Script-System\AllShotData.txt");
SetGraphicRect(0,96,63,191);
LoadGraphic(BossImage);
SetMovePosition03(GetCenterX,150,10,4);
MoveMord1=true;
SetBossLifeCircle(4500,false,20,true);
BossMagicCircle;
}
			
@MainLoop{
yield;
Frame1++;Frame2++;Frame3++;Frame4++;Frame5++;Frame6++;Frame7++;Frame8++;BackFrame++;
if(Frame1==60){
PlaySE("script\SE\SpellCard.wav");
Back1;
Back2;
Back3;
SpellEffect;
SpellLight;
BossCutIn;
SpellName;
}
if(BackFrame==60){
Back4;
BackFrame-=150;
}
SetCollisionA(GetX,GetY,25);SetCollisionB(GetX,GetY+Height,20);
if(Frame4==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;
Frame4=0;
}
if(Frame1==60){
Move=false;
Charge;
}

if(Frame5==150){
Wing1;
Wing2;
Frame5=0;
}

if(Frame1==200){
Move=false;
Charge;
}

if(Frame1==220){
PlaySE("script\SE\Laser1;.wav");
Laser1;
}
if(Frame1==230){
PlaySE("script\SE\Kira1.wav");
Angle2=(Angle1-40*60);
Set2=GetX+100*cos(Angle2);
Set3=GetY+100*sin(Angle2);
Shot1;
Angle1+=4;
Frame1=228;
}
if(Frame2==220){
PlaySE("script\SE\Laser1;.wav");
Laser2;
}
if(Frame2==230){
PlaySE("script\SE\Kira1.wav");
Angle4=(Angle3-40*60);
Set4=GetX+150*cos(Angle4);
Set5=GetY+150*sin(Angle4);
Shot2;
Angle3-=4;
Frame2=229;
}

if(Frame3==300){
PlaySE("script\SE\Laser1.wav");
loop(18){
Laser3;
Angle5+=20;	
}	
}
if(Frame3==320){
PlaySE("script\SE\Laser1.wav");
loop(18){
Angle7=(Angle6-40*60);
Set6=GetX+130*cos(Angle7);
Set7=GetY+130*sin(Angle7);
Laser4;
Laser5;
Angle6+=20;	
}	
loop(38){
Angle7=(Angle6-40*60);
Set6=GetX+200*cos(Angle7);
Set7=GetY+200*sin(Angle7);
CreateShotA(1,Set6,Set7,40);
SetShotDataA(1,0,0,Angle7,0,0,0,66);
SetShotDataA(1,5,0.5,NULL,0,0,0,66);
SetShotDataA(1,10,1,NULL,0,0,0,66);
FireShot(1);
Angle6+=10;	
}	

}
if(Frame3==340){
PlaySE("script\SE\Shot1.wav");
Angle6+=4;
loop(38){
Angle7=(Angle6-40*60);
Set6=GetX+200*cos(Angle7);
Set7=GetY+200*sin(Angle7);
CreateShotA(1,Set6,Set7,40);
SetShotDataA(1,0,0,Angle7,0,0,0,66);
SetShotDataA(1,5,0.5,NULL,0,0,0,66);
SetShotDataA(1,10,1,NULL,0,0,0,66);
FireShot(1);
Angle6+=10;	
}	
}
if(Frame3==360){
PlaySE("script\SE\Shot1.wav");
Angle6+=4;
loop(38){
Angle7=(Angle6-40*60);
Set6=GetX+200*cos(Angle7);
Set7=GetY+200*sin(Angle7);
CreateShotA(1,Set6,Set7,40);
SetShotDataA(1,0,0,Angle7,0,0,0,66);
SetShotDataA(1,5,0.5,NULL,0,0,0,66);
SetShotDataA(1,10,1,NULL,0,0,0,66);
FireShot(1);
Angle6+=10;	
}	
Frame3=140;
}

if(Frame6==250){
PlaySE("script\SE\Kira1.wav");
Angle8=rand(0,360);
loop(38){
Angle9=(Angle8-40*60);
Set8=GetX+170*cos(Angle9);
Set9=GetY+170*sin(Angle9);
CreateShotA(1,Set8,Set9,20);
SetShotDataA(1,0,0,Angle9,0,0,0,26);
SetShotDataA(1,5,0.5,NULL,0,0,0,26);
SetShotDataA(1,10,1,NULL,0.3,0,0,26);
FireShot(1);
CreateShotA(1,Set8,Set9,20);
SetShotDataA(1,0,0,Angle9,0,0,0,26);
SetShotDataA(1,5,0.5,NULL,0,0,0,26);
SetShotDataA(1,10,1,NULL,-0.3,0,0,26);
FireShot(1);
Angle8+=10;	
}	
}
if(Frame6==270){
PlaySE("script\SE\Kira1.wav");
Angle8=rand(0,360);
loop(38){
Angle9=(Angle8-40*60);
Set8=GetX+170*cos(Angle9);
Set9=GetY+170*sin(Angle9);
CreateShotA(1,Set8,Set9,20);
SetShotDataA(1,0,0,Angle9,0,0,0,26);
SetShotDataA(1,5,0.5,NULL,0,0,0,26);
SetShotDataA(1,10,1,NULL,0.3,0,0,26);
FireShot(1);
CreateShotA(1,Set8,Set9,20);
SetShotDataA(1,0,0,Angle9,0,0,0,26);
SetShotDataA(1,5,0.5,NULL,0,0,0,26);
SetShotDataA(1,10,1,NULL,-0.3,0,0,26);
FireShot(1);
Angle8+=10;	
}	
}
if(Frame6==280){
PlaySE("script\SE\Kira1.wav");
Angle8=rand(0,360);
loop(38){
Angle9=(Angle8-40*60);
Set8=GetX+170*cos(Angle9);
Set9=GetY+170*sin(Angle9);
CreateShotA(1,Set8,Set9,20);
SetShotDataA(1,0,0,Angle9,0,0,0,26);
SetShotDataA(1,5,0.5,NULL,0,0,0,26);
SetShotDataA(1,10,1,NULL,0.3,0,0,26);
FireShot(1);
CreateShotA(1,Set8,Set9,20);
SetShotDataA(1,0,0,Angle9,0,0,0,26);
SetShotDataA(1,5,0.5,NULL,0,0,0,26);
SetShotDataA(1,10,1,NULL,-0.3,0,0,26);
FireShot(1);
Angle8+=10;	
}
Frame6=100;
}

if(Frame7==250){
PlaySE("script\SE\Kira1.wav");
Angle11=(Angle10-40*60);
Set10=Set12+150*cos(Angle11);
Set11=Set13+150*sin(Angle11);
CreateShotA(1,Set10,Set11,20);
SetShotDirectionType(ABSOLUTE);
SetShotDataA(1,0,0,Angle9,0,0,0,26);
SetShotDataA(1,5,0.5,NULL,0,0,0,26);
SetShotDataA(1,10,1,NULL,0.3,0,0,26);
SetShotDirectionType(ABSOLUTE);
FireShot(1);
Angle10+=12;	
Frame7=247;
}
if(Frame8==300){
Set12=rand(32,416);
Set13=rand(0,GetY);
Frame8=100;
}

DeleteEnemyShotImmediatelyInCircle(ALL,0,0,1);
}
task Laser5{
let shot1=Obj_Create(OBJ_LASER);
let frame1=0;
let frame2=0;
let Set1=0;
let Set2=0;
let Set3=0;
let Set4=0;
let Set5=0;
let Nagasa=0;
let Hososa=0;
Obj_SetX(shot1,Set6);//x座標設定
Obj_SetY(shot1,Set7);//y座標設定;
ObjShot_SetDelay(shot1,70);
ObjShot_SetGraphic(shot1,55);//画像設定
ObjLaser_SetSource(shot1,false);
Obj_SetAngle(shot1,Angle7-40);
loop{
frame1++;
frame2++;
ObjLaser_SetLength(shot1,Nagasa);
ObjLaser_SetWidth(shot1,Hososa);

if(frame2==200){
ObjShot_FadeDelete(shot1);
Obj_Delete(shot1);
break;
return;
}


if(Nagasa>1000){	
}else{
Nagasa+=15;
}
if(Hososa>16){	
}else{
Hososa+=1;
}
yield;
}
}	
task Laser4{
let shot1=Obj_Create(OBJ_LASER);
let frame1=0;
let frame2=0;
let Set1=0;
let Set2=0;
let Set3=0;
let Set4=0;
let Set5=0;
let Nagasa=0;
let Hososa=0;
Obj_SetX(shot1,Set6);//x座標設定
Obj_SetY(shot1,Set7);//y座標設定;
ObjShot_SetDelay(shot1,70);
ObjShot_SetGraphic(shot1,55);//画像設定
ObjLaser_SetSource(shot1,false);
Obj_SetAngle(shot1,Angle7+40);
loop{
frame1++;
frame2++;
ObjLaser_SetLength(shot1,Nagasa);
ObjLaser_SetWidth(shot1,Hososa);

if(frame2==200){
ObjShot_FadeDelete(shot1);
Obj_Delete(shot1);
break;
return;
}


if(Nagasa>1000){	
}else{
Nagasa+=15;
}
if(Hososa>16){	
}else{
Hososa+=1;
}
yield;
}
}	
task Laser3{
let shot1=Obj_Create(OBJ_LASER);
let frame1=0;
let frame2=0;
let Set1=0;
let Set2=0;
let Set3=0;
let Set4=0;
let Set5=0;
let Nagasa=0;
let Hososa=0;
Obj_SetX(shot1,GetX);//x座標設定
Obj_SetY(shot1,GetY);//y座標設定;
ObjShot_SetDelay(shot1,70);
ObjShot_SetGraphic(shot1,52);//画像設定
ObjLaser_SetSource(shot1,false);
Obj_SetAngle(shot1,Angle5);
loop{
frame1++;
frame2++;
ObjLaser_SetLength(shot1,Nagasa);
ObjLaser_SetWidth(shot1,Hososa);

if(frame2==200){
ObjShot_FadeDelete(shot1);
Obj_Delete(shot1);
break;
return;
}


if(Nagasa>1000){	
}else{
Nagasa+=15;
}
if(Hososa>16){	
}else{
Hososa+=1;
}
yield;
}
}	
task Laser2{
let shot1=Obj_Create(OBJ_LASER);
let frame1=0;
let frame2=0;
let Set1=0;
let Set2=0;
let Set3=0;
let Set4=0;
let Set5=0;
let Nagasa=0;
let Hososa=0;
let Angle=-90;
Obj_SetX(shot1,GetX);//x座標設定
Obj_SetY(shot1,GetY);//y座標設定;
ObjShot_SetDelay(shot1,99999999999999999999999999999);
ObjShot_SetGraphic(shot1,52);//画像設定
loop{
frame1++;
frame2++;
Obj_SetAngle(shot1,Angle);
Angle-=4;
ObjLaser_SetLength(shot1,Nagasa);
ObjLaser_SetWidth(shot1,Hososa);
Obj_SetX(shot1,GetX);//x座標設定
Obj_SetY(shot1,GetY);//y座標設定;


if(Nagasa>150){	
}else{
Nagasa+=15;
}
if(Hososa>10){	
}else{
Hososa+=1;
}
yield;
}
}
task Laser1{
let shot1=Obj_Create(OBJ_LASER);
let frame1=0;
let frame2=0;
let Set1=0;
let Set2=0;
let Set3=0;
let Set4=0;
let Set5=0;
let Nagasa=0;
let Hososa=0;
let Angle=90;
Obj_SetX(shot1,GetX);//x座標設定
Obj_SetY(shot1,GetY);//y座標設定;
ObjShot_SetDelay(shot1,99999999999999999999999999999);
ObjShot_SetGraphic(shot1,52);//画像設定
loop{
frame1++;
frame2++;
Obj_SetAngle(shot1,Angle);
Angle+=2;
ObjLaser_SetLength(shot1,Nagasa);
ObjLaser_SetWidth(shot1,Hososa);
Obj_SetX(shot1,GetX);//x座標設定
Obj_SetY(shot1,GetY);//y座標設定;


if(Nagasa>100){	
}else{
Nagasa+=15;
}
if(Hososa>10){	
}else{
Hososa+=1;
}
yield;
}
}

task Shot1{
let shot1=Obj_Create(OBJ_SHOT);
let count=0;
let frame1=0;
let frame2=0;
let frame3=0;
let set1=0;
let set2=0;
let Angle=0;
Obj_SetX(shot1,Set2);//x座標設定
Obj_SetY(shot1,Set3);//y座標設定;
ObjShot_SetDelay(shot1,5);
Obj_SetSpeed(shot1,0);//速度設定
ObjShot_SetGraphic(shot1,16);//画像設定
Angle=Angle2;
Obj_SetAngle(shot1,Angle2);
loop{
frame1++;
frame2++;
if(frame1==60){
Obj_SetSpeed(shot1,1);
}
if(frame1==65){
Obj_SetSpeed(shot1,2);
}
if(frame1==70){
Obj_SetSpeed(shot1,3);
break;
}
yield;
}
}
task Shot2{
let shot1=Obj_Create(OBJ_SHOT);
let count=0;
let frame1=0;
let frame2=0;
let frame3=0;
let set1=0;
let set2=0;
let Angle=0;
Obj_SetX(shot1,Set4);//x座標設定
Obj_SetY(shot1,Set5);//y座標設定;
ObjShot_SetDelay(shot1,0);
Obj_SetSpeed(shot1,rand(1,3));//速度設定
ObjShot_SetGraphic(shot1,37);//画像設定
Angle=rand(0,360);
Obj_SetAngle(shot1,Angle);
loop{
frame1++;
frame2++;
Obj_SetAngle(shot1,Angle);
Angle-=0.2;
if(frame1==300){
break;
}
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+250;
let Y=Cy-100;
let rect01=1;
let rect02=1;
let rect03=683;
let rect04=604;
let img1="script\img-Character\Merysil-Cut.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-3Boss\Merysil-Spell11.png";
img1="script\Script-3Boss\Merysil-Spell11.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-3Boss\Merysil-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-3Boss\Merysil-Back2.png";
let rect01=0;
let rect02=0;
let rect03=384;
let rect04=448;
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,ALPHA);
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, 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{
ObjEffect_SetVertexColor(obj, 0, 200, 255, 255, Alpha);
ObjEffect_SetVertexColor(obj, 1, 200, 255, Alpha, 255);
ObjEffect_SetVertexColor(obj, 2, 200, 255, 255, 255);
ObjEffect_SetVertexColor(obj, 3, 200, 255, Alpha, 255);
if(Set==1){
Alpha-=3;
}
if(Set==0){
Alpha+=3;
}
if(Alpha>255){
Set=1;
}
if(Alpha<0){
Set=0;
}
yield;
}
}
task Back3{
let X=Cx;
let Y=Cy;
let img1="script\Script-3Boss\Merysil-Back3.png";
let rect01=0;
let rect02=0;
let rect03=360;
let rect04=360;
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_SetScale(obj,1.2,1.2);
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{
ObjEffect_SetAngle(obj,0,0,Set2);
Set2+=0.5;
yield;
}
}
task Back4{
let X=Cx;
let Y=Cy;
let img1="script\Script-3Boss\Merysil-Back4.png";
let rect01=0;
let rect02=0;
let rect03=360;
let rect04=360;
let Layer=0;
let Alpha=0;
let Set=0;
let Collar=0;
let Scale=5;
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,ALPHA);
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, 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{
ObjEffect_SetAngle(obj,0,0,Set2);
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);
Scale-=0.03;
if(Scale<0){
Obj_Delete(obj);
return;
break;
}
if(Alpha>255){
}else{
Alpha+=2;
}
Set2+=0.5;
yield;
}
}
task Wing1{
let X=GetX-50;
let Y=GetY-20;
let img1="script\Script-3Boss\Wing1.png";
let rect01=0;
let rect02=0;
let rect03=152;
let rect04=124;
let Layer=3;
let alpha=0;
let Set1=0;
let Collar=0;
let scale=4;
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, 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{
Obj_SetPosition(obj,GetX-50,GetY-20);
ObjEffect_SetScale(obj,scale,scale);
if(Set1==0){
scale-=0.07;
}
if(Set2==0){
if(scale<1){
frame1++;
Set1=1;
}
}
if(frame1==15){
Set1=0;
Set2=1;
}
if(scale<0){
Set1=0;
Obj_Delete(obj);
break;
}
if(alpha>255){
}else{
alpha+=5;
}
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);
yield;
}
}
task Wing2{
let X=GetX+50;
let Y=GetY-20;
let img1="script\Script-3Boss\Wing2.png";
let rect01=0;
let rect02=0;
let rect03=152;
let rect04=124;
let Layer=3;
let alpha=0;
let Set1=0;
let Collar=0;
let scale=4;
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, 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{
Obj_SetPosition(obj,GetX+50,GetY-20);
ObjEffect_SetScale(obj,scale,scale);
if(Set1==0){
scale-=0.07;
}
if(Set2==0){
if(scale<1){
frame1++;
Set1=1;
}
}
if(frame1==15){
Set1=0;
Set2=1;
}
if(scale<0){
Set1=0;
Obj_Delete(obj);
break;
}
if(alpha>255){
}else{
alpha+=5;
}
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);
yield;
}
}
}


