#TouhouDanmakufu
#Title[:V]
#Text[]
#Image[]
#Player[REIMU,MARISA]
#ScriptVersion[2]


script_enemy_main{
	


let lol = 0;
let imgBoss = GetCurrentScriptDirectory~"system\momizi.png";
LoadGraphic(imgBoss);
	@Initialize{
		
		SetLife(1);
		SetTimer(999);
		//SetScore(9999999);
		
		
		
		
		//SetDurableSpellCard;
		//CutIn(KOUMA,"",cut,0,0,0,0);
		//mainTask;
		if(GetPlayerType==REIMU_A || GetPlayerType==REIMU_B){
		CreateEventFromScript("reimu");
		} else {
		CreateEventFromScript("talk");
		}
		//SetEnemyMarker(true);
		
		
	}
	@MainLoop{
		
if(OnEvent){
if(GetEventStep==3 && lol ==0){
SetMovePosition01(GetCenterX,GetCenterY-120,7);
lol=1;
}
if(GetEventStep==4 && lol==1){
if(GetCommonDataDefault("midi",false)){
PlayMusic(GetCurrentScriptDirectory~"system\bgm.mid");
} else {
LoadMusic(GetCurrentScriptDirectory~"system\bgm.wav");
PlayMusic(GetCurrentScriptDirectory~"system\bgm.wav");
}
lol=2;
}
} else {
VanishEnemy;
}

		yield;
		
	}
	@DrawLoop{
		SetTexture(imgBoss);
		SetRenderState(ALPHA);
		SetGraphicRect(0,0,64,64);
		SetGraphicScale(1,1);
		SetGraphicAngle(0,0,0);
		DrawGraphic(GetX,GetY);
	}

	@Finalize{
	CreateEnemyFromFile(GetCurrentScriptDirectory~"momizi1.txt",GetX,GetY,0,0,0);

	}




}

script_event reimu{
let csd = GetCurrentScriptDirectory~"system\";
let reimu1 = csd~"Reimu.png";
let reimu2 = csd~"Reimu2.png";
let reimu3 = csd~"Reimu3.png";
let marisa1 = csd~"Marisa.png";
let marisa2 = csd~"Marisa2.png";
let marisa3 = csd~"Marisa3.png";
let marisa4 = csd~"Marisa4.png";
let marisa5 = csd~"Marisa5.png";
let momizi = csd~"momizi2.png";
let graphic = [reimu1,reimu2,reimu3,marisa1,marisa2,marisa3,marisa4,marisa5,momizi];
@Initialize{
	LoadGraphic(reimu1);
	LoadGraphic(reimu2);
	LoadGraphic(reimu3);
	LoadGraphic(marisa1);
	LoadGraphic(marisa2);
	LoadGraphic(marisa3);
	LoadGraphic(marisa4);
	LoadGraphic(marisa5);
	LoadGraphic(momizi);

}
@MainLoop{

Wait(120);
SetChar(LEFT,reimu2);
SetGraphicRect(LEFT,0,0,191,319);
MoveChar(LEFT,FRONT);
TextOutA("\c[RED]It's a good day today.");
SetChar(LEFT,reimu1);
TextOutA("\c[RED]I wonder what that pesky mountain \ngods are up to.");
TextOutA("\c[RED]...");
TextOutA("\c[RED]....");
TextOutA("\c[RED].....");
SetChar(LEFT,reimu3);
TextOutA("\c[RED]Wow the mountains are really \nempty today.");
TextOutA("\c[RED]Usually this is when someone \njumps in and answers.");
SetStep(3);
SetChar(RIGHT,momizi);
SetGraphicRect(RIGHT,0,0,276,329);
MoveChar(LEFT,BACK);
MoveChar(RIGHT,FRONT);
SetNameFromText(RIGHT,TEXT_WHITE,"Momiji Inubashiri","The Guardian Of Youkai Mountain");
TextOutC(35,"\c[BLUE]Well then. \nShall I fill the gap?");
MoveChar(LEFT,FRONT);
MoveChar(RIGHT,BACK);
TextOutA("\c[RED]I wasn`t talking to you");
MoveChar(LEFT,BACK);
MoveChar(RIGHT,FRONT);
TextOutA("\c[BLUE]Well, you wanted someone to answer something.");
MoveChar(LEFT,FRONT);
MoveChar(RIGHT,BACK);
TextOutA("\c[RED]Well, so you`re the only one here?");
MoveChar(LEFT,BACK);
MoveChar(RIGHT,FRONT);
TextOutA("\c[BLUE]Not really.");
MoveChar(LEFT,FRONT);
MoveChar(RIGHT,BACK);
SetChar(LEFT,reimu1);
TextOutA("\c[RED]Looks like i`m just wasting time here.");
MoveChar(LEFT,BACK);
MoveChar(RIGHT,FRONT);
TextOutA("\c[BLUE]Well what would not be a waste of time?");
MoveChar(LEFT,FRONT);
MoveChar(RIGHT,BACK);
SetChar(LEFT,reimu2);
TextOutA("\c[RED]Solving incidents!");
MoveChar(LEFT,BACK);
MoveChar(RIGHT,FRONT);
SetStep(4);
TextOutA("\c[BLUE]Well, how about we have a quick brawl.");
TextOutA("\c[BLUE]Then we talk incidents");
MoveChar(LEFT,FRONT);
MoveChar(RIGHT,BACK);
TextOutA("\c[RED]I was going to even if you didn`t ask!");

End();
}
@Finalize{

}
}
script_event talk{

let csd = GetCurrentScriptDirectory~"system\";
let reimu1 = csd~"Reimu.png";
let reimu2 = csd~"Reimu2.png";
let reimu3 = csd~"Reimu3.png";
let marisa1 = csd~"Marisa.png";
let marisa2 = csd~"Marisa2.png";
let marisa3 = csd~"Marisa3.png";
let marisa4 = csd~"Marisa4.png";
let marisa5 = csd~"Marisa5.png";
let momizi = csd~"momizi2.png";
let graphic = [reimu1,reimu2,reimu3,marisa1,marisa2,marisa3,marisa4,marisa5,momizi];
@Initialize{
	LoadGraphic(reimu1);
	LoadGraphic(reimu2);
	LoadGraphic(reimu3);
	LoadGraphic(marisa1);
	LoadGraphic(marisa2);
	LoadGraphic(marisa3);
	LoadGraphic(marisa4);
	LoadGraphic(marisa5);
	LoadGraphic(momizi);

}
@MainLoop{

Wait(120);
SetChar(LEFT,marisa4);
SetGraphicRect(LEFT,0,0,191,319);
MoveChar(LEFT,FRONT);
TextOutA("\c[YELLOW]What a boring day.");
TextOutA("\c[YELLOW]No stuff to steal \nNo youkai to hunt \nAnd no incidents to solve");
TextOutA("\c[YELLOW]No one to even play a game with");
SetStep(3);
SetChar(RIGHT,momizi);
SetGraphicRect(RIGHT,0,0,276,329);
MoveChar(LEFT,BACK);
MoveChar(RIGHT,FRONT);
TextOutC(35,"\c[BLUE]I`d like to agree with you.");
MoveChar(LEFT,FRONT);
MoveChar(RIGHT,BACK);
SetChar(LEFT,marisa1);
TextOutA("\c[YELLOW]Momizi!?");
SetNameFromText(RIGHT,TEXT_WHITE,"Momiji Inubashiri","The Guardian Of Youkai Mountain");
TextOutA("\c[BLUE]Yes. No one`s intruding so I have \nnothing to do as well.");
MoveChar(LEFT,FRONT);
MoveChar(RIGHT,BACK);
TextOutA("\c[YELLOW]So you looking for a game?");
MoveChar(LEFT,BACK);
MoveChar(RIGHT,FRONT);
TextOutA("\c[BLUE]Well, if you have one.");
MoveChar(LEFT,FRONT);
MoveChar(RIGHT,BACK);
TextOutA("\c[YELLOW]How about danmaku?");
SetStep(4);
MoveChar(LEFT,BACK);
MoveChar(RIGHT,FRONT);
TextOutA("\c[BLUE]Oh, Making patterns?");
TextOutA("\c[BLUE]I`m quite good with that.");
MoveChar(LEFT,FRONT);
MoveChar(RIGHT,BACK);
TextOutA("\c[YELLOW]You know, \nThat was Reimu`s line right?");

DeleteName(RIGHT);
SetStep(0);
End;
}
@Finalize{
ascent(i in 0..length(graphic)){
DeleteGraphic(graphic[i]);
}
}

}