#Title[Jeanne Event]
#Text[Introducing Jeanne d'Ark and Arkadia.]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
	let ImgBoss = "script\img\stg8enm.png";
	let convotheme = "bgm\Tension ~ Enemy Engaged.mp3";
	let bosstheme = "bgm\Radiance ~ Brilliant Light.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_jeanne.png";
	let ImgPlayer = "script\img\cin_emily.png";
	@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(RIGHT);
		TextOutA("\c[RED]...who are you?");
		ToFront(LEFT);
		TextOutA("\c[BLUE]A wandering doctor.");
		TextOutA("\c[GREEN]And a meddler in politics.");
		TextOutA("\c[BLUE]More of a stabilizer, I'd like to think.");
		ToFront(RIGHT);
		TextOutA("\c[RED]A wandering... doctor.");
		ToFront(LEFT);
		TextOutA("\c[BLUE]A wandering doctor.");
		ToFront(RIGHT);
		TextOutA("\c[RED]So what in the world are you doing with Sitiens?");
		ToFront(LEFT);
		TextOutA("\c[BLUE]Oh, I'm not with Sitiens. I just don't trust Valtiel.");
		TextOutA("\c[GREEN]Don't bother with the reasoning, this is her third-in-command.");
		ToFront(RIGHT);
		SetNameFromText(RIGHT, TEXT_RED, "Jeanne d'Ark", "Arkadia");
		TextOutA("\c[RED]No, reasoning would be nice.");
		TextOutA("\c[YELLOW]We don't have time for that.");
		ToFront(LEFT);
		TextOutA("\c[BLUE]There's always time to listen to reason.");
		ToFront(RIGHT);
		TextOutA("\c[YELLOW]Not in the middle of a war, there's not.");
		ToFront(LEFT);
		TextOutA("\c[BLUE]Especially in the middle of a war.");
		ToFront(RIGHT);
		TextOutA("\c[YELLOW]I still don't see how you think you can challenge us...");
		ToFront(LEFT);
		TextOutA("\c[GREEN]Yeah, hi. I'm Nihil. Spirit o' negation.");
		ToFront(RIGHT);
		TextOutA("\c[YELLOW]...oh. Well, then.");
		TextOutA("\c[YELLOW]Even so, the girl...");
		ToFront(LEFT);
		TextOutA("\c[BLUE]Don't underestimate me...");
		TextOutA("\c[GREEN]Please don't. I do on rare occasion, and pay for it.");
		TextOutA("\c[BLUE]So! If you don't mind, we have to defeat madame Valtiel.");
		ToFront(RIGHT);
		SetStep(1);
		TextOutA("\c[RED]I didn't earn my position for nothing, you know. Prepare yourself!");
		TextOutA("\c[YELLOW]Wither away before the light!");
		End;
	}
	@MainLoop {
		yield;
	}
	@DrawLoop {
	}
	@Finalize {
		DeleteGraphic(ImgBoss);
		DeleteGraphic(ImgPlayer);
	}
}