#Title[Cruz Event]
#Text[Introducing Cruz Obscura and Umbra.]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
	let ImgBoss = "script\img\stg8enm.png";
	let convotheme = "bgm\Tension ~ Enemy Engaged.mp3";
	let bosstheme = "bgm\Dark Clouds ~ World of Darkness.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);

		if(bgm_on) {
			LoadMusic(convotheme);
			PlayMusic(convotheme);
		}
		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);
		DeleteMusic(convotheme);
	}

}
script_event BossEvent {
	let ImgBoss = "script\img\cin_cruz.png";
	let ImgPlayer = "script\img\cin_felicia.png";
	let isEmily = false;
	@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);
		ToFront(LEFT);
		TextOutA("\c[BLUE]Hmhmhm, we meet at last... Cruz Obscura.");
		ToFront(RIGHT);
		SetNameFromText(RIGHT, TEXT_RED, "Cruz Obscura", "Umbra");
		TextOutA("\c[RED]Who are you?");
		ToFront(LEFT);
		TextOutA("\c[BLUE]Felicia Opsors. One o' those mercenary commanders we love so much.");
		ToFront(RIGHT);
		TextOutA("\c[RED]I'll warn you once -- quarrel with your own kind.\nMy fight isn't with you.");
		TextOutA("\c[YELLOW]Don't worry, Jeanne's not the jealous type...");
		TextOutA("\c[RED]Not the time, Umbra...");
		ToFront(LEFT);
		TextOutA("\c[BLUE]She's really not, though.");
		TextOutA("\c[GREEN]Anyway, we've already dealt with your commanders.");
		TextOutA("\c[BLUE]That gravity mage, anyway.");
		ToFront(RIGHT);
		TextOutA("\c[RED]Wh-- grr...");
		TextOutA("\c[YELLOW]Oh, go on and put them out of their misery.");
		ToFront(LEFT);
		TextOutA("\c[GREEN]I'm very happy with my life, thanks much.");
		ToFront(RIGHT);
		TextOutA("\c[RED]...Diligimur, ne?");
		ToFront(LEFT);
		TextOutA("\c[BLUE]Yeah, why?");
		ToFront(RIGHT);
		TextOutA("\c[RED]They've been a nuisance, but...");
		TextOutA("\c[YELLOW]Velon can deal with them.");
		ToFront(LEFT);
		TextOutA("\c[BLUE]We're their ace in the hole.");
		TextOutA("\c[GREEN]More to the point, Serius gravely underestimated us...");
		TextOutA("\c[GREEN]He hasn't gotten over his instincts as a commander.");
		ToFront(RIGHT);
		TextOutA("\c[YELLOW]Yeah... Cruz, take them seriously. Please.");
		TextOutA("\c[YELLOW]'Sides, even if they're bluffing, you can terminate 'em, right?");
		TextOutA("\c[YELLOW]Didn't have much trouble terminating your own soldiers...");
		TextOutA("\c[RED]Oh, alright.");
		SetStep(1);
		TextOutA("\c[RED]You asked for it.");
		ToFront(LEFT);
		TextOutA("\c[BLUE]By the way, I think Jeanne likes you.");
		TextOutA("\c[BLUE]She wants you alive...");
		End;
	}
	@MainLoop {
		yield;
	}
	@DrawLoop {
	}
	@Finalize {
		DeleteGraphic(ImgBoss);
		DeleteGraphic(ImgPlayer);
	}
}