#Title[Genner Sitiens Event 1]
#Text[Introducing Genner Sitiens and Onis.]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
	let ImgBoss = "script\img\stg8enm.png";
	let bosstheme = "bgm\Soul Battle ~ Dark Master.mp3";
	let frame = -120;
	#include_function "lib\SHOT_REPLACE\shot_replace.dnh"
	#include_function "p_config.txt"

	@Initialize {
		SetLife(1);
		SetDamageRate(0, 0);

		LoadGraphic(ImgBoss);
		SetTexture(ImgBoss);
		SetGraphicRect(6,195,70,285);
		SetMovePosition03(GetCenterX, GetClipMinY + 120, 10, 3);
		MainTask;
	}
	task MainTask {
		loop(121) { yield; }
		CreateEventFromScript("BossEvent");
		while(GetEventStep == 0) { yield; }
		if(bgm_on) {
			LoadMusic(bosstheme);
			PlayMusic(bosstheme);
		}
		while(OnEvent) { yield; }
		SetLife(0);
	}
	@MainLoop {
		yield;
	}
	@DrawLoop {
		DrawGraphic(GetX, GetY);
	}
	@Finalize {
		DeleteGraphic(ImgBoss);
	}

}
script_event BossEvent {
	let ImgBoss = "script\img\cin_genner.png";
	let ImgPlayer = "script\img\cin_felicia.png";
	let isEmily = false;
	if(GetPlayerScriptName == "EmilyA.dnh" || GetPlayerScriptName == "EmilyB.dnh") {
		ImgPlayer = "script\img\cin_emily.png";
		isEmily = true;
	}
	@Initialize {
		LoadGraphic(ImgBoss);
		LoadGraphic(ImgPlayer);
		Event;
	}
	task Event {
		function ToFront(dir) {
			if(dir == LEFT) {
				MoveChar(LEFT, FRONT);
				MoveChar(RIGHT, BACK);
			}
			else {
				MoveChar(RIGHT, FRONT);
				MoveChar(LEFT, BACK);
			}
		}
		SetStep(0);
		yield;
		SetChar(RIGHT, ImgBoss);
		SetGraphicRect(RIGHT, 0, 0, 192, 256);
		SetChar(LEFT, ImgPlayer);
		SetGraphicRect(LEFT, 0, 0, 192, 256);
		if(isEmily) {
			ToFront(LEFT);
			TextOutA("\c[BLUE]Greetings.");
			ToFront(RIGHT);
			TextOutA("\c[RED]What the...");
			ToFront(LEFT);
			TextOutA("\c[BLUE]To come out and fight yourself... Your valor is impressive.");
			TextOutA("\c[GREEN]Or Onis's puppetry. One of those.");
			ToFront(RIGHT);
			SetNameFromText(RIGHT, TEXT_RED, "Genner Sitiens", "Onis");
			TextOutA("\c[YELLOW]And just how do you mean that... Nihil?");
			ToFront(LEFT);
			TextOutA("\c[GREEN]Genner was the ultimate nice-guy.\nShy, timid, had trouble making friends.");
			TextOutA("\c[BLUE]We heard this, of course, from one of those friends.");
			TextOutA("\c[GREEN]You're the sort to wake up one day and say,\n'Hey, I feel like ruling the world.'");
			ToFront(RIGHT);
			TextOutA("\c[RED]You don't know what's going on in my head.");
			ToFront(LEFT);
			TextOutA("\c[GREEN]Technically true, for now.");
			TextOutA("\c[BLUE]But Onis is acting equally out of character.");
			ToFront(RIGHT);
			TextOutA("\c[YELLOW]Whaddaya mean?");
			ToFront(LEFT);
			TextOutA("\c[BLUE]You ruled the spirits purely by force.\nEven Nihil was left at a standstill until the Memor fought back.");
			TextOutA("\c[BLUE]You're not the sort to sit back in your pyus\nand let your vassal take the world for you.");
			ToFront(RIGHT);
			TextOutA("\c[YELLOW]Now just what do you...");
			ToFront(LEFT);
			TextOutA("\c[BLUE]Your real plan is to set the world against Genner.");
			TextOutA("\c[GREEN]...uh, exactly! And this is because...?");
			ToFront(RIGHT);
			TextOutA("\c[RED]...pardon?");
			ToFront(LEFT);
			TextOutA("\c[BLUE]You'd like this plan to fail. You want Genner to be punished. Badly.");
			TextOutA("\c[BLUE]Then, while he's traumatized, it'll be easy to trick him...");
			TextOutA("\c[BLUE]...into releasing you from your pyus and letting you rule the world alone.");
			TextOutA("\c[GREEN]Some teenager you are, analyzing it like that...");
			TextOutA("\c[BLUE]Was I wrong?");
			TextOutA("\c[GREEN]It's right, but... not what I was thinking.");
			TextOutA("\c[GREEN]I figured after Genner won, Onis would play bad-advisor...\nand then the world would already be his.");
			ToFront(RIGHT);
			TextOutA("\c[YELLOW]Hmph. You people are so morbid.");
			TextOutA("\c[YELLOW]I'm just making the best of my situation.");
			TextOutA("\c[RED]I'm afraid that mine experiences run contrary to your analysis.");
			TextOutA("\c[RED]He's surrounded me with friends as well as enemies.");
			TextOutA("\c[RED]If he wanted to drive me mad,\nthere are more efficient ways to do it.");
			ToFront(LEFT);
			TextOutA("\c[BLUE]Love is denial.");
			TextOutA("\c[GREEN]More than that, his mind is clouded...");
			TextOutA("\c[BLUE]He can do that?");
			TextOutA("\c[GREEN]I spent much of the war under the weather.");
			ToFront(RIGHT);
			SetStep(1);
			TextOutA("\c[YELLOW]Hate to rain on your parade, but...");
			TextOutA("\c[YELLOW]Your conjectures and my so-called illusions\nwon't last in a real fight.");
			TextOutA("\c[YELLOW]You against us... let's go.");
			ToFront(LEFT);
			TextOutA("\c[BLUE]Don't underestimate me...");
			TextOutA("\c[GREEN]Your lies shall be revealed!\n\c[YELLOW]Your lies shall be revealed!");
		}
		else {
			ToFront(LEFT);
			TextOutA("\c[BLUE]Hey.");
			ToFront(RIGHT);
			TextOutA("\c[RED]What the...");
			ToFront(LEFT);
			TextOutA("\c[BLUE]We're here. To assassinate you or something.");
			ToFront(RIGHT);
			TextOutA("\c[RED]Eh, really.");
			ToFront(LEFT);
			TextOutA("\c[BLUE]Well, we're really gonna expose Onis's evil plot, but...");
			TextOutA("\c[BLUE]Nominally, it's an assassination mission.");
			ToFront(RIGHT);
			TextOutA("\c[YELLOW]Evil plot, eh?");
			ToFront(LEFT);
			TextOutA("\c[GREEN]To escape your seal and rule the spirits once again.");
			ToFront(RIGHT);
			TextOutA("\c[YELLOW]And just what kind of evil plot is this?");
			ToFront(LEFT);
			TextOutA("\c[GREEN]You slipped word of Genner's plans to Desdemona...");
			TextOutA("\c[GREEN]...because she and Genner are childhood friends.");
			TextOutA("\c[BLUE]Genner valued his friends above his own life...");
			ToFront(RIGHT);
			TextOutA("\c[YELLOW]What am I supposed to be accomlplishing, again?");
			ToFront(LEFT);
			TextOutA("\c[BLUE]It's a pretty cool plan, 'cuz you win either way.");
			TextOutA("\c[BLUE]Genner fights Eien.");
			TextOutA("\c[BLUE]If he wins, he becomes a hated tyrant who's slain all his friends.");
			TextOutA("\c[BLUE]Not a nice mental state there.");
			TextOutA("\c[GREEN]And if he loses, he'll have to bear the punishments...");
			TextOutA("\c[GREEN]...dealt by a world that hates him.");
			TextOutA("\c[BLUE]I know I'd do anything to get out of that situation.");
			TextOutA("\c[BLUE]Even, say, release Casus from her pyus...");
			ToFront(RIGHT);
			TextOutA("\c[RED]...it's not quite that simple.");
			TextOutA("\c[RED]Onis has given me friends as well as enemies.");
			TextOutA("\c[RED]Valtiel's rebellion is... unfortunate, but I can make do.");
			ToFront(LEFT);
			TextOutA("\c[BLUE]It wouldn't do if this plan were exposed, now, would it?");
			TextOutA("\c[GREEN]Do they owe allegiance to you, or Onis?");
			ToFront(RIGHT);
			TextOutA("\c[RED]What does it matter? Onis is mine.");
			ToFront(LEFT);
			TextOutA("\c[BLUE]No one can possibly own Onis.");
			TextOutA("\c[GREEN]...say, a few lines of his...");
			TextOutA("\c[BLUE]Hm?");
			TextOutA("\c[GREEN]...do you think his mind is clouded?");
			TextOutA("\c[BLUE]Oh, that's a lame pun.");
			TextOutA("\c[GREEN]But Onis can do that.");
			TextOutA("\c[BLUE]...crap.");
			TextOutA("\c[BLUE]But with any luck, if Onis is a little beat up...");
			TextOutA("\c[BLUE]...the sun might come out again!");
			ToFront(RIGHT);
			SetStep(1);
			TextOutA("\c[YELLOW]It's a fight you want, huh?");
			TextOutA("\c[YELLOW]Then it's a fight you'll get.");
			MoveChar(LEFT, FRONT);
			TextOutA("\c[BLUE]Clear your mind, sorceror of storms!\n\c[RED]Get out of my way, wheel of fortune!");
		}
		End;
	}
	@MainLoop {
		yield;
	}
	@DrawLoop {
	}
	@Finalize {
		DeleteGraphic(ImgBoss);
		DeleteGraphic(ImgPlayer);
	}
}