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\Cut.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 (GetSpeedX == 0){
SetTexture(SP);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,0);
SetGraphicScale(1,1+acc10);
SetGraphicRect(0, 0, 52, 86);
SetAlpha(255);
DrawGraphic(GetX + 2, GetY);
}
if (GetSpeedX > 0){
SetTexture(SP);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,0);
SetGraphicScale(1,1+acc10);
SetGraphicRect(52, 0, 103, 86);
SetAlpha(255);
DrawGraphic(GetX + 10, GetY);
}
if (GetSpeedX < 0){
SetTexture(SP);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,0);
SetGraphicScale(-1,1+acc10);
SetGraphicRect(52, 0, 103, 86);
SetAlpha(255);
DrawGraphic(GetX - 10, GetY);
}
acc1 += 8;
acc2++;
anim1++;
anim2++;
anim3++;
if (acc2 <= 40){acc3 += 0.01;}
if (acc2 >= 40){acc3 -= 0.01;}
if (acc2 == 80){acc2 = 0;}

if (acc9 <= 20){acc10 += 0.002;}
if (acc9 >= 20){acc10 -= 0.002;}
if (acc9 == 40){acc9 = 0;}
acc5 += 0.5;
acc6++;
acc7 += 0.2;
acc8 += 1.2;
acc9++;
 }
    @Finalize {
    }
}

script_event EVENT1{

let Cut = GetCurrentScriptDirectory~"ef\Cut.png";

@Initialize{
LoadGraphic(Cut);
 }

@MainLoop{                       
SetChar(RIGHT, Cut);  
SetGraphicRect(RIGHT, 0, 0, 283, 283);                     
MoveChar(RIGHT, FRONT);                          
TextOutA("Wow, you are a lot stronger than \nI thought...");        
MoveChar(RIGHT, BACK);                   
TextOutA("Well I do this all the time \nso that makes sense."); 
TextOutA("So now that I beat you, can I pass?");  
MoveChar(RIGHT, FRONT);                          
TextOutA("Well, if you're stronger than the \n guards, It would be best to give"); 
TextOutA("you access whenever you want."); 
TextOutA("I don't want fights in the \n graveyard all the time...");   
MoveChar(RIGHT, BACK);                   
TextOutA("Finally! Now get back to guarding \n this place."); 
SetStep(1);
End;           //This ends the event.
}

 @Finalize{
 }
}
}