#TouhouDanmakufu
#Title[THE THIRD CONVERSATIONE~]
#Text[Nyan~]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
    let ImgBoss = "script\img\ExRumia.png";
	let reimu = "reimu.png";
let marisa = "marisa.png";
let rumia = "rumia.png";
    let frame = -120;
	
    @Initialize {
        SetLife(10);
        SetTimer(60);
	
        SetInvincibility(180);
	SetDamageRate(100,0);
	CreateItem(ITEM_1UP, rand(50, -50)+GetX, rand(10, -10)+GetY);
        SetMovePosition02(GetCenterX, GetClipMinY + 120, 120);
       

        LoadGraphic(ImgBoss);
        SetTexture(ImgBoss);
        SetGraphicRect(0, 0, 64, 64);
    }

    @MainLoop {
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
	if (frame == 0){
	FadeOutMusic(GetCurrentScriptDirectory~"bgm.wav", 10);
	CreateEventFromScript("conversation");

	}
	

	if(frame>0){

	
	if(GetEventStep == 1) { 
AddLife(-GetLife);
	 }
	}

        frame++;
	

    }

    @DrawLoop {
        SetTexture(ImgBoss);
                SetRenderState(ALPHA);
                SetAlpha(255);  
                SetGraphicScale(1,1);
                SetGraphicAngle(0,0,0);

                if(GetSpeedX==0){
                         SetGraphicRect(0,0,64,64); }
                        
 
                if(GetSpeedX>0){
                        SetGraphicRect(190, 126, 256, 64);
			}
 
                if(GetSpeedX<0){
                        
                        SetGraphicRect(128,128,186,64); }
                      
 
                DrawGraphic(GetX,GetY);
    }

    @Finalize {
        DeleteGraphic(ImgBoss);
    }




}

script_event conversation{
let reimu =GetCurrentScriptDirectory ~ ("\reimu.png");
let rumia =GetCurrentScriptDirectory~ ("\rumia.png");

@Initialize{
  LoadGraphic(reimu);
  LoadGraphic(rumia);
 }

@MainLoop{
SetChar(LEFT, reimu);                 
SetGraphicRect(LEFT, 128, 0, 256, 256);           
MoveChar(LEFT, FRONT);                                      
MoveChar(RIGHT, BACK);
TextOutA("\c[RED] Give up yet?");
SetChar(RIGHT, rumia); 
SetGraphicRect(RIGHT, 1, 1, 128, 257);
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);                          
TextOutA("\c[BLUE] asdfghjkl");           
MoveChar(RIGHT, BACK);                           
MoveChar(LEFT, FRONT);
SetGraphicRect(LEFT, 1, 1, 128, 257);                           
TextOutA("\c[RED] So it seems I've won.");   
DeleteName(LEFT);                 
MoveChar(RIGHT, FRONT);                           
MoveChar(LEFT, BACK);                           
TextOutA("\c[BLUE]And I thought that spell rush would've worked...");
MoveChar(RIGHT, BACK);                           
MoveChar(LEFT, FRONT);
DeleteName(RIGHT);
TextOutA("\c[RED] Is that so~?"); 
MoveChar(RIGHT, FRONT);                           
MoveChar(LEFT, BACK);
TextOutA("\c[BLUE] OH SCREW YOU");
TextOutA("\c[BLUE] EAT THIS");
MoveChar(RIGHT, BACK);                           
MoveChar(LEFT, FRONT);
TextOutA("\c[RED] asdf"); 
End;           //This ends the event.
SetStep(1);
}

 @Finalize{
  
 }
}
