
#Title[talk]
#Text[Text that appears on right part of screen]
#Image[.\image.png]
#Background[User(.\bg.png, 1, 1)]
#BGM[.\Sounds\bo4ss4.mp3]
#PlayLevel[Overdrive]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main{



 let wing1 = GetCurrentScriptDirectory ~ "wing1.png";
 let wing2 = GetCurrentScriptDirectory ~ "wing2.png";
let clear=0;
let MY = GetCurrentScriptDirectory~"supershot.txt";
let frame=0;
let frame2=0;
let frame3=0;
let frame4=0;
let frame5=0;
let t=60;
let cir=0;
let X=GetCenterX;
let Y=50;
let y=0;
let angle=0;
let angle2=0;
let cat = GetCurrentScriptDirectory~"cat.png";
let sonic = GetCurrentScriptDirectory~"gl.png";
let cut = GetCurrentScriptDirectory~"cut.png";
let yy =GetCenterY;
let xx=GetClipMaxX;
#include_function ".\function_cutin.txt"
let j=GetCurrentScriptDirectory~"g2l.png";
let j2=GetCurrentScriptDirectory~"bigmove.png";
let j3=GetCurrentScriptDirectory~"j3.png";
let j4=GetCurrentScriptDirectory~"j4.png";
let m=0;
    @Initialize{
	
	SetTexture(sonic);
	SetGraphicRect(0,0,69,74);
	SetGraphicScale(1,1);
	DrawGraphic(GetX,GetY);
	
	 LoadGraphic(wing1);
    LoadGraphic(wing2);
	
CreateEventFromScript("test");
	SetLife(111111);
	LoadUserShotData(MY);
	//SetTimer(t);
	//LoadGraphic(cat);
	LoadGraphic(sonic);
	LoadGraphic(j);
	LoadGraphic(j2);
	LoadGraphic(j3);
	LoadGraphic(j4);
	//LoadGraphic(cut);
	//SetScore(4000);
	//SetDurableSpellCard;
	//maintask;
	//cutin("NAZRIN","Speed Sign | Sound Barrier |","cut",0,0,200,340);
	//SetPlayerInvincibility(99559);
	//move;
    }
    @MainLoop{//PlayMusic(GetCurrentScriptDirectory ~ ".\boss4.mp3"); 
	SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
	
	yield;
	
	
	if(GetEventStep==3){

	
	  Explosion01(GetX,GetY,11,1,60);
 Explosion01(GetX,GetY,11,1,60);
 Explosion01(GetX,GetY,6,1,60);///
 
	SetLife(0);
	
	
	
	
	}
	
	
	
		if(GetEventStep==2){
	SetMovePosition03(GetCenterX,GetCenterY-50,15,4.5); }
	
	
	
	
	
	
	
	
	
    }let wave=0;let dor=0;let xw=0;
    @DrawLoop{
	
	dor+=4;
	if(xw==0.6){
	 wave+=3;}
    SetTexture(wing2);SetAlpha(255);
 
	SetGraphicRect(0,0,454,340);
SetGraphicScale(xw+sin(wave/2)*0.1,0.6+sin(wave/2)*0.1);
SetRenderState(ALPHA);

	SetGraphicAngle(0, 0,0);
	DrawGraphic(GetX,GetY+5*sin(dor)-40);
	
	
	
  SetTexture(wing1);SetAlpha(255);
 
	SetGraphicRect(0,0,454,340);
SetGraphicScale(xw+sin(wave/2)*0.1,0.6+sin(wave/2)*0.1);
SetRenderState(ALPHA);

	SetGraphicAngle(0, 0,0);
	DrawGraphic(GetX,GetY+5*sin(dor)-40);
	
	
	
	
	
	
	SetTexture(cut);
	SetGraphicRect(0,0,800,600);
	SetGraphicScale(0.5,0.5);
	DrawGraphic(xx,yy);
	
	if(xx>GetCenterX){xx-=50;}
	if(xx<GetCenterX){xx-=0.3;}
	if(xx<190){xx-=50;}
	
	if(GetSpeed() == 0){
	SetTexture(sonic);SetGraphicAngle(0, 0,0);
	SetGraphicRect(0,0,142,84);
	SetGraphicScale(0.6,0.6);
	DrawGraphic(GetX,GetY);
	}
	
	if(GetSpeed() > 0){
	
	SetTexture(j);SetGraphicAngle(0, 0,0);
	SetGraphicRect(0,0,142,84);
	SetGraphicScale(0.6,0.6);
	DrawGraphic(GetX,GetY);}

	
	
	
    }
    @Finalize{//m=1;  
	if(GetSpeed() == 0){
	SetTexture(sonic);
	SetGraphicRect(0,0,80,80);
	SetGraphicScale(1.5,1.5);
	DrawGraphic(GetX,GetY);
	}
    }
    @Background{
    }
	
	task move{//PlayMusic(GetCurrentScriptDirectory ~ ".\boss4.mp3");
	
}
	function wait(n) {loop(n){yield;} }
	}
	
////
script_event test {
 function wait(n) {loop(n){yield;} }
    let CSD = GetCurrentScriptDirectory;
    let imgKeanu = CSD ~ ".\rtalk1.png";
    let imgKeanu2 = CSD ~ ".\rtalk2.png";
    let imgKeanu3 = CSD ~ ".\rtalk3.png";
    let imgKeanu4 = CSD ~ ".\rtalk3.png";
    let imgReimu = CSD ~ ".\reimu.png";
    let imgReimu2 = CSD ~ ".\reimu2.png";
    let imgReimu3 = CSD ~ ".\reimu3.png";
    let imgReimu4 = CSD ~ ".\reimu4.png";
 
@Initialize {
        LoadGraphic(imgKeanu);
        LoadGraphic(imgKeanu2);
        LoadGraphic(imgKeanu3);
        LoadGraphic(imgKeanu4);
		
        LoadGraphic(imgReimu);
        LoadGraphic(imgReimu2);
        LoadGraphic(imgReimu3);
        LoadGraphic(imgReimu4);
 //SetTexture(imgReimu);
		
 }
 
@MainLoop{ MoveChar(LEFT, FRONT);    
 SetChar(LEFT, imgReimu4);                 //Set the player's character on the left side, with the graphic you've told it to display.
 SetGraphicRect(LEFT, 0, 0, 245, 280);           //The region you're displaying of the graphic for the player character, just like SetGraphicRect.
      
SetChar(LEFT, imgReimu4);                 //Set the player's character on the left side, with the graphic you've told it to display.
 SetGraphicRect(LEFT, 0, 0, 245, 280); 


MoveChar(LEFT, FRONT); 
 DeleteName(RIGHT); 
TextOutA("Such a dark place."); 
 
SetChar(LEFT, imgReimu3);  
TextOutA("Hey!Is someone here?"); 
MoveChar(LEFT, BACK);


 
MoveChar(RIGHT, BACK);  
 MoveChar(LEFT, BACK); 
 
TextOutA("Of course!"); SetStep(2);
 //Self explanatory. Danmakufu will not pass this function until a certain amount of time has passed, or the player clicks the shot button.
   //Self explanatory. Danmakufu will not pass this function until a certain amount of time has passed, or the player clicks the shot button.
  MoveChar(LEFT, BACK);  //Self explanatory. Danmakufu will not pass this function until a certain amount of time has passed, or the player clicks the shot button.
 MoveChar(RIGHT, FRONT);   
 //Move the boss' image to the front to show that she is speaking.
 
 SetChar(RIGHT, imgKeanu2);                //Set the boss' picture on the right side of the screen.
 SetGraphicRect(RIGHT, 0, 0, 245, 280);           //Set the boundry of the picture you want displayed.
   MoveChar(RIGHT, FRONT); 
TextOutA("Stop shouting like that!");           //Self explanatory. Danmakufu will not pass this function until a certain amount of time has passed, or the player clicks the shot button.
 MoveChar(RIGHT, BACK); 
//MoveChar(LEFT, FRONT); 
//TextOutA("Reimu Hakurei.");   //Self explanatory. Danmakufu will not pass this function until a certain amount of time has passed, or the player clicks the shot button.
  //MoveChar(LEFT, BACK);
//MoveChar(RIGHT, FRONT);   
    
 
 

MoveChar(LEFT, FRONT); 
 DeleteName(RIGHT); 
TextOutA("What are you?Some sort of talking eye?"); 
MoveChar(LEFT, BACK);

MoveChar(RIGHT, FRONT);   
    
 SetChar(RIGHT, imgKeanu3);                 //Move the boss' image to the front to show that she is speaking.
 TextOutA("How rude~");           //Self explanatory. Danmakufu will not pass this function until a certain amount of time has passed, or the player clicks the shot button.
 TextOutA("Actually,it's not my true form.");           //Self explanatory. Danmakufu will not pass this function until a certain amount of time has passed, or the player clicks the shot button.
 MoveChar(RIGHT, BACK);


 SetChar(LEFT, imgReimu); 
MoveChar(LEFT, FRONT); 
 DeleteName(RIGHT); 
TextOutA("And what do you want?"); 
MoveChar(LEFT, BACK);

MoveChar(RIGHT, FRONT);   
    
 SetChar(RIGHT, imgKeanu);                 //Move the boss' image to the front to show that she is speaking.
 TextOutA("And what do you want?");           //Self explanatory. Danmakufu will not pass this function until a certain amount of time has passed, or the player clicks the shot button.
 MoveChar(RIGHT, BACK);
 SetChar(LEFT, imgReimu4); 
MoveChar(LEFT, FRONT); 
TextOutA("..."); 
//TextOutA("I think that I should prevent you from opening this carnival!"); 
MoveChar(LEFT, BACK);

MoveChar(RIGHT, FRONT);
SetChar(RIGHT, imgKeanu);                 //Move the boss' image to the front to show that she is speaking.
 TextOutA("I'm not going to let you pass.");           //Self explanatory. Danmakufu will not pass this function until a certain amount of time has passed, or the player clicks the shot button.
 TextOutA("This place needs energy to exist.");           //Self explanatory. Danmakufu will not pass this function until a certain amount of time has passed, or the player clicks the shot button.
 MoveChar(RIGHT, BACK);

  
  
  SetChar(LEFT, imgReimu2); 
  
  MoveChar(LEFT, FRONT); 
TextOutA("And why can't I  go there?"); 
MoveChar(LEFT, BACK);

  MoveChar(RIGHT, FRONT);
  SetChar(RIGHT, imgKeanu);                 //Move the boss' image to the front to show that she is speaking.
 TextOutA("Because it's pure energy.");           //Self explanatory. Danmakufu will not pass this function until a certain amount of time has passed, or the player clicks the shot button.
 MoveChar(RIGHT, BACK);
  
  
  SetChar(LEFT, imgReimu); 
  MoveChar(LEFT, FRONT); 
TextOutA("I got your point."); 
 SetChar(LEFT, imgReimu3); 
TextOutA("But I need to go there anyway."); 
MoveChar(LEFT, BACK); 
  
  
  
  MoveChar(RIGHT, FRONT);
  SetChar(RIGHT, imgKeanu);                 //Move the boss' image to the front to show that she is speaking.
 TextOutA("So,you made your choice."); 


 SetChar(RIGHT, imgKeanu);                 //Move the boss' image to the front to show that she is speaking.
 TextOutA("Let the void guide you!");          //Self explanatory. Danmakufu will not pass this function until a certain amount of time has passed, or the player clicks the shot button.
 MoveChar(RIGHT, BACK);
  
  
  
  MoveChar(LEFT, FRONT);
  SetChar(LEFT, imgReimu);                 //Move the boss' image to the front to show that she is speaking.
 TextOutA("Wait,what happened?");
 TextOutA("I can't attack you!");
   MoveChar(LEFT, BACK);
  
  
  
  MoveChar(RIGHT, FRONT);
 SetChar(RIGHT, imgKeanu);                 //Move the boss' image to the front to show that she is speaking.
 TextOutA("That's too bad!");
 SetChar(RIGHT, imgKeanu3);  //Self explanatory. Danmakufu will not pass this function until a certain amount of time has passed, or the player clicks the shot button.
 TextOutA("Because I can.");          //Self explanatory. Danmakufu will not pass this function until a certain amount of time has passed, or the player clicks the shot button.
 MoveChar(RIGHT, BACK);
  
  
  
  SetStep(3);
  wait(120);
 End;           //This ends the event.

  
 
 
 }}
	