plot 0
	name <PLOT: Face Your Enemy>

	% E1 is the scene for the current episode.
	% E2 is the character who will give the PC a mission.
	% E3 is the scene to be used in the next episode.
	Element1 <Grab 3>
	Element2 <Grab 1>
	Element3 <Scene Town Target !Far 1>
	Element4 <Character Citizen !Near 1>
	Element5 <Faction GoodEnemy>

	% V1 = Initialization Counter
	% V2 = Combat Counter
	% V3 = Conversation Counter

	% On a cleanup request just delete this plot.
	cleanup <AdvancePlot 0>

	% If Persona E2 dies, load a new plot.
	start <ifPersona E2 else GoDelete ifG P2 1 else GoCheckStartCombat ForceChat E2>
	GoCheckStartCombat <if= P2 1 else GoCheckInit ifNPCInPlay E2 else GoCheckInit if= V3 0 V= 3 1 ForceChat E2>
	GoCheckInit <if= V1 0 else GoCheckTown V= 1 1  MoveChar E2 E1 Compose UTD E2 .e2dies>
	GoCheckTown <if= V1 1 else GoCheckExit if= SceneID E1 V= 1 2>
	GoCheckExit <if= V1 2 if= SceneID 1 Goto GoStartCombat>
	GoDelete <S= 101 1 XREnemy NAV_XREFaction AdvancePlot 0>

	GoStartCombat <Print 101 Block FreezeChar E2 SavePos P= 2 1 Dynamic 2 Threat S103 80 .nu1 .nu2 DynaNPC E2 2>
	.e2dies <ForceChat E2 ifG V2 0 Retreat 2>
	.nu1 <if= T1 0 Return>
	.nu2 <if= T2 0 Salvage>

	% Combat check. If combat has been entered, V2=1.
	% Combat ends in victory if the number of active masters on
	% team two drops to zero, or ends in defeat is the number of
	% active masters on team one drops to zero. After combat, V2=3
	% if the player was victorious or V2=2 is the player lost.
	nu1 <if= T1 0 if= V2 1  V= 2 2  Reputation 6 -7>
	nu2 <if= T2 0 if= V2 1  V= 2 3  Reputation 6  1  XPV 100 ifPersona E2 ForceChat E2>

	Msg101 <While leaving town, you are attacked by mecha!>

sub
	Persona 2
	greeting <EndChat ifPersona E2 else GoE2Dead if= P2 3 else GoCheckLoss Say 1 S= 101 1 S+ 102 1 N= 3 E3 History 2 AdvancePlot 0>
	GoE2Dead <ifG P2 0 else GoE2DeadNoCombat ifFaction N2 else GoNewFaction Goto GoFinishFaction>
	GoNewFaction <N= 2 E5 Goto GoFinishFaction>
	GoFinishFaction <Say 3 S= 101 1 S+ 102 1 N= 3 E3 XREnemy NAV_XREFaction History 4 AdvancePlot 0>
	GoE2DeadNoCombat <Say 13 History 14 XREnemy NAV_XREUnknown S= 101 1 N= 3 E3 AdvancePlot 0>
	GoCheckLoss <if= P2 2 else GoCheckFirst Say 5 History 6 S= 101 1 N= 3 E3 AdvancePlot 0>
	GoCheckFirst <ifG P2 0 else GoInTown Say 7 AddChat 1 AddChat 2>
	GoInTown <NewChat ifG NPCRep E2 2 0 else GoNoLaw Say 10 AddChat 3 AddChat 4 AddChat 5>
	GoNoLaw <ifG 0 NPCRep E2 4 else GoNoPassion EndChat Say 11 FreezeChar E2>
	GoNoPassion <Say 12 AddChat 3 AddChat 4 AddChat 5>

	result1 <EndChat Say 8>
	result2 <EndChat Say 9 AddReact -d10 Reputation 4 d10>
	result3 <NewChat if= XRB NAV_XRBUnknown else GoR3NoMystery Say 18 XRBadThing NAV_XRBLostLove AddChat 6 AddChat 7>
	GoR3NoMystery <Say 15 FreezeChar E2>
	result4 <NewChat Say 16 FreezeChar E2>
	result5 <NewChat if= XRB NAV_XRBUnknown else GoR5NoMystery Say 24 XRBadThing NAV_XRBLostLove AddChat 6 AddChat 7>
	GoR5NoMystery <Say 17 FreezeChar E2>
	result6 <NewChat Say 19 History 21 FreezeChar E2 Reputation 3 d6  AddChat 8 AddChat 9>
	result7 <NewChat Say 20 History 21 FreezeChar E2 Reputation 3 -d6 AddChat 8 AddChat 9>
	result8 <EndChat Say 22>
	result9 <EndChat Say 23>

	Msg1 <Don't think that you've won today. You've merely prolonged the inevitable.>
	Msg2 <You defeated \ELEMENT 2 outside of \ELEMENT 1 .>
	Msg3 <You have defeated me... You are the better pilot. But... know that... \NARRATIVE 2 has other agents, more skilled than I... no-one escapes forever...>
	Msg4 <You defeated \ELEMENT 2 , who was working for \NARRATIVE 2 .>
	Msg5 <You are lucky to have escaped us today. That luck will soon run out, I assure you. Until the next time we meet...>
	Msg6 <You were defeated by \ELEMENT 2 outside of \ELEMENT 1 .>
	Msg7 <I've been waiting for you to show yourself. Now, we will battle!>
	Msg8 <May the better pilot win...>
	Msg9 <I am a force you should not take so lightly!!!>
	Msg10 <Imagine seeing you here. So long as we are both in town there is no reason why we should not be civil. Once we leave here, though, we will be enemies again.>
	Msg11 <What? You!? I did not expect to meet you here... I can't stand to be in the same city as you. I'll be leaving this place now.>
	Msg12 <Well, if it isn't \PC . Count yourself lucky that we're in town, otherwise I'd snuff out your worthless life in an instant.>
	Msg13 <I die...>
	Msg14 <You killed \ELEMENT 2 in \ELEMENT 1 .>
	Msg15 <You haven't figured that out on your own yet? You must be stupider than you look. Perhaps they are wrong... perhaps you're not as much of a danger as they say.>
	Msg16 <In the middle of \ELEMENT 1 ? You must be daft. Aside from the obvious problems of bystanders and the Guardians, there's also my reputation to think about.>
	Msg17 <Then why did you speak with me? If you have nothing to say, then don't disturb me.>
	Msg18 <What? You mean, you don't recognize me? How could you forget so easily... Think harder, back to middle school...>
	Msg19 <Then you'll also remember how I swore my eternal revenge on you, for winning the heart of the one who should have been mine! I have nothing more to say to you, except that you still aren't forgiven...>
	Msg20 <I wonder if you remember anything else, then... remember how you stole the love of the one who should have been mine, and how on that day I swore my eternal revenge!>
	Msg21 <\ELEMENT 2 hates you because of a love triangle from middle school.>
	Msg22 <Don't try to make lightly of other people's emotions! I have been waiting for my revenge; since you stole my love away it's all I've had to live for.>
	Msg23 <You're saying that my one true love who chose you over me means nothing to you!? How callous! You will pay dearly for your insensitivity!!!>
	Msg24 <I knew it! So that means you still remember, and you hate me as much as I hate you... You do still remember, don't you? Think hard... all the way back to middle school... You couldn't have forgotten that so easily...>

	Prompt1 <I'm ready to take you.>
	Prompt2 <Sure, I have nothing better to do.>
	Prompt3 <Why do you want to kill me?>
	Prompt4 <Let's settle this here.>
	Prompt5 <I have nothing to say to you.>
	Prompt6 <Ah, \ELEMENT 2 , now I remember you...>
	Prompt7 <Nope. I'm getting nothing.>
	Prompt8 <Come on, that was years ago.>
	Prompt9 <I can't even remember the person...>

	Persona 4
	rumor <!4 saw !2 in town.>
	greeting <NewChat ifNPCInPlay E2 else GoNotInPlay Say 1>
	GoNotInPlay <SayAnything>
	Msg1 <\ELEMENT 2 is in town doing some shopping.>

end
