script_enemy_main {

let frame1 = 0;
let frame2 = 0;
let frame3 = 0;
let frame4 = 0;
let frame5 = 0;
let frame6 = 0;
let frame7 = 0;
let frame8 = 0;
let frame9 = 0;
let frame10 = 0;
let frame11 = 0;
let anim1 = 0;
let anim2 = 0;
let anim3 = 0;
let a1 = 0;
let a2 = 0;
let a3 = 0;
let a4 = 0;
let a5 = 0;
let a6 = 0;
let a7 = 0;
let a8 = 0;
let acc1 = 0;
let acc2 = 0;
let acc3 = 0;
let acc4 = 0;
let acc5 = 0;
let acc6 = 0;
let acc7 = 0;
let acc8 = 0;
let acc9 = 0;
let acc10 = 0;
let acc11 = 0;
let acc12 = 0;
let kospin = 0;

let SP = GetCurrentScriptDirectory~"sp\sp.png";
let Custom = GetCurrentScriptDirectory~"sup\supershot.txt";
let MC = GetCurrentScriptDirectory~"ef\MC.png";
let CBG1 = GetCurrentScriptDirectory~"ef\cbg1.png";
let CBG2 = GetCurrentScriptDirectory~"ef\cbg2.png";
let NBG1 = GetCurrentScriptDirectory~"ef\nbg1.png";
let charge = GetCurrentScriptDirectory~"se\Charge2.wav";
let sh1 = GetCurrentScriptDirectory~"se\Shot1.wav";
let sh2 = GetCurrentScriptDirectory~"se\BulletWave.wav";
let Cut = GetCurrentScriptDirectory~"ef\sad.png";
let Cut2 = GetCurrentScriptDirectory~"ef\no.png";
	#include_function ".\function_cutin.txt";
	#include_function ".\maple.txt";

    @Initialize {

SetMovePosition03(GetCenterX, GetCenterY - 150, 10, 10);
LoadUserShotData(Custom);
LoadGraphic(SP);
LoadGraphic(MC);
LoadGraphic(Cut);
LoadGraphic(Cut2);
LoadGraphic(CBG1);
LoadGraphic(CBG2);
LoadGraphic(NBG1);
LoadSE(charge);
LoadSE(sh1);
LoadSE(sh2);
CreateEventFromScript("EVENT1");
SetLife(1);
    }

    @MainLoop {
		if(GetEventStep() == 1){
			SetLife(0);
		}
yield;
    }

    @DrawLoop {
SetTexture(MC);
SetRenderState(ADD);
SetGraphicAngle(0,0,acc1);
SetGraphicScale(1+acc3,1+acc3);
SetGraphicRect(0, 0, 128, 128);
SetAlpha(255);
DrawGraphic(GetX, GetY);

if (anim1 < 10 && GetSpeedX == 0){
SetTexture(SP);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,0);
SetGraphicScale(1,1);
SetGraphicRect(0, 0, 50, 81);
SetAlpha(255);
DrawGraphic(GetX + 2, GetY);
}
if (anim1 >= 10 && anim1 < 20 && GetSpeedX == 0){
SetTexture(SP);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,0);
SetGraphicScale(1,1);
SetGraphicRect(0, 0, 50, 81);
SetAlpha(255);
DrawGraphic(GetX + 3, GetY);
}
if (anim1 >= 20 && anim1 < 30 && GetSpeedX == 0){
SetTexture(SP);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,0);
SetGraphicScale(1,1);
SetGraphicRect(50, 0, 100, 81);
SetAlpha(255);
DrawGraphic(GetX + 4, GetY);
}
if (anim1 >= 30 && anim1 < 40 && GetSpeedX == 0){
SetTexture(SP);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,0);
SetGraphicScale(1,1);
SetGraphicRect(100, 0, 150, 81);
SetAlpha(255);
DrawGraphic(GetX + 5, GetY);
}
if (anim1 >= 40 && anim1 < 50 && GetSpeedX == 0){
SetTexture(SP);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,0);
SetGraphicScale(1,1);
SetGraphicRect(150, 0, 200, 81);
SetAlpha(255);
DrawGraphic(GetX + 6, GetY);
}
if (anim1 >= 50 && anim1 <= 60 && GetSpeedX == 0){
SetTexture(SP);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,0);
SetGraphicScale(1,1);
SetGraphicRect(200, 0, 250, 81);
SetAlpha(255);
DrawGraphic(GetX + 7, GetY);
}
if (anim1 == 60){
anim1 = 0;
}
if (GetSpeedX > 0){
SetTexture(SP);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,0);
SetGraphicScale(1,1);
SetGraphicRect(200, 81, 250, 160);
SetAlpha(255);
DrawGraphic(GetX + 10, GetY);
}
if (GetSpeedX < 0){
SetTexture(SP);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,0);
SetGraphicScale(-1,1);
SetGraphicRect(200, 81, 250, 160);
SetAlpha(255);
DrawGraphic(GetX - 10, GetY);
}
acc1 += 8;
acc2++;
anim1++;
if (acc2 <= 40){acc3 += 0.01;}
if (acc2 >= 40){acc3 -= 0.01;}
if (acc2 == 80){acc2 = 0;}
 }
    @Finalize {
    }
}

script_event EVENT1{

let Cut = GetCurrentScriptDirectory~"ef\sad.png";
let Cut2 = GetCurrentScriptDirectory~"ef\no.png";

@Initialize{
LoadGraphic(Cut);
LoadGraphic(Cut2);
 }

@MainLoop{                           //Move the player's character into the background, to show she is not speaking.
SetChar(RIGHT, Cut);                //Set the boss' picture on the right side of the screen.
SetGraphicRect(RIGHT, 0, 0, 200, 330);           //Set the boundry of the picture you want displayed.
MoveChar(RIGHT, FRONT);                          //Move the boss' image to the front to show that she is speaking.
TextOutB(160, "Ohh, You again? What now?");           //Self explanatory. Danmakufu will not pass this function until a certain amount of time has passed, or the player clicks the shot button.                           //Move the boss to the background, then...                           //Move the player forward, to show that she will now speak.
TextOutB(160, "I'm still trying to protect this\nplace you know!",);   
SetChar(RIGHT, Cut2);
TextOutB(160, "Just because you beat me once \ndoesn't mean I'll always let you pass!",);                    //What the player will be speaking.
SetStep(1);
End;           //This ends the event.
}

 @Finalize{
 }
}
}