#Title[Felicia Event]
#Text[Introducing Felicia Opsors and Casus.]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
	let ImgBoss = "script\img\stg8enm.png";
	let convotheme = "bgm\Siege ~ Selfish Battlefront.mp3";
	let bosstheme = "bgm\Lucky Star ~ The Odds.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_felicia_e.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[YELLOW]E-eh? Nihil?!");
		ToFront(LEFT);
		TextOutA("\c[GREEN]Hey, it's Casus! Wazzap?");
		MoveChar(RIGHT, FRONT);
		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]You know each other?\n\c[BLUE]You know each other?");
		ToFront(RIGHT);
		TextOutA("\c[YELLOW]Nihil, the spirit of negation and void...\nThere's nary a spirit that doesn't know her.");
		ToFront(LEFT);
		TextOutA("\c[GREEN]She was a pal o' mine from the war, though.");
		TextOutA("\c[BLUE]Is that so...?");
		TextOutA("\c[GREEN]Yep, she's great. To think we'd meet like this...");
		ToFront(RIGHT);
		TextOutA("\c[YELLOW]...what do you mean?");
		TextOutA("\c[RED]This chick took out Jeanne.");
		TextOutA("\c[YELLOW]...really...");
		ToFront(LEFT);
		TextOutA("\c[BLUE]We have our reasons.");
		TextOutA("\c[GREEN]So you're Eien's last stand...");
		SetNameFromText(RIGHT, TEXT_RED, "Felicia Opsors", "Casus");
		ToFront(RIGHT);
		TextOutA("\c[RED]Felicia Opsors, that's me.");
		ToFront(LEFT);
		TextOutA("\c[BLUE]Somehow, I feel she's more formidable than miss d'Ark...");
		TextOutA("\c[GREEN]Looks right to me. And Casus en't bad, either.");
		ToFront(RIGHT);
		TextOutA("\c[YELLOW]...I'll put it to you straight, Felicia. We don't stand a chance.");
		TextOutA("\c[YELLOW]If Nihil and this girl...");
		ToFront(LEFT);
		TextOutA("\c[BLUE]Emily Urmetus.");
		ToFront(RIGHT);
		TextOutA("\c[YELLOW]...want to fight Eien, they'll win. And I know they have thier reasons.");
		ToFront(LEFT);
		TextOutA("\c[BLUE]Thank you for understanding.");
		ToFront(RIGHT);
		TextOutA("\c[RED]I don't usually back down from impossible odds, though.");
		ToFront(LEFT);
		TextOutA("\c[BLUE]Of course, that has its own meaning...");
		SetStep(1);
		TextOutA("\c[BLUE]Tell you what: let's play a game.");
		ToFront(RIGHT);
		TextOutA("\c[RED]Now I'm listening.");
		ToFront(LEFT);
		TextOutA("\c[BLUE]A quick duel of Artes.");
		TextOutA("\c[BLUE]If you win, we'll tell you what we know and let you decide what to do from there.");
		TextOutA("\c[BLUE]Otherwise, you'll guide us to mistress Valtiel.");
		ToFront(RIGHT);
		TextOutA("\c[RED]Sounds good to me. Alright, let's go!");
		End;
	}
	@MainLoop {
		yield;
	}
	@DrawLoop {
	}
	@Finalize {
		DeleteGraphic(ImgBoss);
		DeleteGraphic(ImgPlayer);
	}
}