%% *:CS_MechaEncounter Content
%%
%%	&Raiders	The enemies are raiders aligned with the enemy NPC/Faction
%%	&Secondary	This is a secondary encounter
%%
%% This is the basic building block of any adventure- a mecha fight scene.
%% This component will likely alter the context of the core story.
%%
%% The parent plot sets the plot status to this layer's ID when ready.
%%
%% When this subplot concludes, it sets one of the following triggers:
%%  .%id%_%plotid%_GoWin
%%  .%id%_%plotid%_GoLoss
%% It will also hide the encounter with SetEncounterInactive.
%%
%% This is a MAIN COURSE subplot.
%%
%%  Param1: The outdoors scene where the encounter will be placed
%%  Param2: The encounter to be used as the entrance
%%

%%  ********************************
%%  ***   +P--  Peaceful  Life   ***
%%  ********************************

Content
	name <Plague of Bandits>
	size 8
	desc <Defend an allied cruiser from bandits; find out this has been happening quite often.>
	requires <*:CS_MechaEncounter +P-- (P:CORPO|F:CRIME)>
	changes <+P>

	% E1 is the outdoors scene where this encounter will be placed
	% E2 is the metascene to be used for this encounter
	% E3 is a local public scene
	% E4 is a trucker to be used in the exposition
	Element3 <Scene Public !Near -7>
	Element4 <Character Trucker !Okay -3 !XClude -2 !Near 3 NeverFail>
	NeverFail4 <Trucker>
	Place4 </>

	% P%id%01 = Initialization Counter
	% P%id%02 = Have gained reinforcements
	% P%id%03 = Have gained decimation
	update <if= V%id%01 0 V= %id%01 1   SetPlotStatus %plotid1% %id1%>

	.%id1%_%plotid1%_GoReinforcements <P= %id%02 1>
	.%id1%_%plotid1%_GoDecimation     <P= %id%03 1>

	% SubPlot1 = Gain Advantage vs Raiders
	SubPlot1 <*:CS_GainAdvantageVsMecha&Decimation&Reinforcements>

	sub
		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1   Alert 1  History 2  Monologue %4% 7  AlterContext .changes  CancelSubPlot %plotid1% if# P%id%02 0 Alert 6>
		.changes <+Pun>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1 Alert 3 History 4 Trigger0 .%id%_%plotid%_GoLoss LoseSubPlot %plotid%>
		nu2 <if= T2 0   if= V1 0 V= 1 1 ifG T3 0 else GoLoseMission  Alert 5  XPV 100  Salvage  Return  Trigger0 .%id%_%plotid%_GoWin WinSubPlot %plotid%>
		GoLoseMission <Alert 4 History 4 Trigger0 .%id%_%plotid%_GoLoss LoseSubPlot %plotid%>
		end <SetEncounterInactive %2%   MoveNPC %4% %3%>
		Msg1 <You find a cargo ship under attack by bandits. Its captain, %name4%, contacts you.>
		Msg2 <You found a cargo ship under attack by bandits.>
		Msg3 <Without your protection, the cargo ship quickly falls to the bandits.>
		Msg4 <You failed to protect the cargo ship.>
		Msg5 <With the bandits gone, %name4% continues safely to \PPR %4% destination.>
		Msg6 <Your reinforcements are here, as promised.>
		Msg7 <I could use some help dealing with these raiders- it seems that lately we've been getting far more attacks than usual.>

		sub
			team 1
			SetEnemy 2
			SetAlly 3 4
			ParaX 15
			ParaY 25

			team 2
			SetEnemy 1 3 4
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   if= p%id%03 0 else GoSmallDeploy WMecha 2 StoryDL 180>
			GoSmallDeploy <WMecha 2 StoryDL 100>
			ParaX 45
			ParaY 25

			team 3
			name <Cruiser Team>
			setenemy 2
			setally 1 4

			team 4
			name <Allies>
			setenemy 2
			setally 1 3
			home <Cruiser Zone>
			Deploy <if= PlotStatus %plotid% %id% if# p%id%02 0  WMecha 4 StoryDL 80>

			rect
			name <Cruiser Zone>
			special <SubZone>
			width 12
			height 12
			MFX 1
			MFY 19
			sub
				SuperProp
				requires <*Cruiser>
				SetTeam 3
			end
		end
	end

Content
	name <Capture Weapons Shipment>
	size 7
	desc <Capture an enemy cruiser, learn they're working on a weapons program.>
	requires <*:CS_MechaEncounter &Raiders (+P--|+Pun) -!Ne -!Lo>
	changes <+P>

	% E1 is the outdoors scene where this encounter will be placed
	% E2 is the metascene to be used for this encounter

	% P%id%01 = Initialization Counter
	% P%id%03 = Have gained decimation
	update <if= V%id%01 0 V= %id%01 1   SetPlotStatus %plotid1% %id1%>

	.%id1%_%plotid1%_GoDecimation     <P= %id%03 1>

	% SubPlot1 = Gain Advantage vs Raiders
	SubPlot1 <*:CS_GainAdvantageVsMecha&Decimation>

	sub
		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1   Alert 1  CancelSubPlot %plotid1%>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1 Alert 2 History 3 Trigger0 .%id%_%plotid%_GoLoss LoseSubPlot %plotid%>
		nu2 <if= T2 0   ifG T3 0 else GoCheckWin  Alert 4 WMecha 2 StoryDL 70>
		GoCheckWin <if= V1 0 V= 1 1   ifG T4 0 else GoLoseEncounter XPV 100  AddRenown 1   Alert 5 History 6 CustomMecha .mek StoryDL AlterContext .changes   Trigger0 .%id%_%plotid%_GoWin WinSubPlot %plotid%>
		.mek <GENERAL \FACTION_DESIG &EnemyFac>
		.changes <+Pew>
		GoLoseEncounter <Alert 2 History 3 Trigger0 .%id%_%plotid%_GoLoss LoseSubPlot %plotid%>
		end <SetEncounterInactive %2%>

		Msg1 <You discover your enemies escorting a cruiser. If you capture the vessel by disabling its weapons and engines, you can find out what they're transporting.>
		Msg2 <You failed to capture the enemy vessel.>
		Msg3 <You encountered an enemy cruiser, but failed to capture it.>
		Msg4 <Reinforcements arrive!>
		Msg5 <You capture the enemy vessel. You find that they were transporting a prototype mecha.>
		Msg6 <You captured an enemy vessel and their prototype mecha.>

		sub
			team 1
			SetEnemy 2 3
			ParaX 45
			ParaY 25

			team 2
			SetEnemy 1
			SetAlly 3
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   if= p%id%03 0 else GoSmallDeploy WMecha 2 StoryDL 150>
			GoSmallDeploy <WMecha 2 StoryDL 70>
			home <Enemy Zone>

			team 3
			setenemy 1
			setally 2

			team 4
			name <Neutral Bitz>

			rect
			name <Enemy Zone>
			special <SubZone>
			width 12
			height 12
			MFX 1
			MFY 19
			sub
				SuperProp
				requires <*Cruiser>
				Team1 4
				Team2 3
				Team3 3
			end
		end
	end


%%  ****************************
%%  ***   +Pme  Meet Enemy   ***
%%  ****************************

%%  *****************************************
%%  ***   +Pun  Unknown  Enemy  Attacks   ***
%%  *****************************************

Content
	name <Enemy Faction Revealed>
	size 6
	desc <Fight some mecha and find out who they work for.>
	requires <*:CS_MechaEncounter &Raiders F:-- +Pun (!Ne|!Lo|&Secondary)>
	changes <F:++>

	% E1 is the outdoors scene where this encounter will be placed
	% E2 is the metascene to be used for this encounter
	% E3 is the new enemy faction
	Element3 <Faction ArchEnemy !Okay -1 !XClude -3>

	% P%id%01 = Initialization Counter
	% P%id%02 = Have gained reinforcements
	% P%id%03 = Have gained decimation
	update <if= V%id%01 0 V= %id%01 1   SetPlotStatus %plotid1% %id1%>

	.%id1%_%plotid1%_GoReinforcements <P= %id%02 1>
	.%id1%_%plotid1%_GoDecimation     <P= %id%03 1>

	% SubPlot1 = Gain Advantage vs Raiders
	SubPlot1 <*:CS_GainAdvantageVsMecha&Reinforcements&Decimation>

	sub
		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1   Alert 1  History 2 &SetEnemyFac %3% CancelSubPlot %plotid1% if# P%id%02 0 Alert 3>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1 Alert 4 Trigger0 .%id%_%plotid%_GoLoss LoseSubPlot %plotid%>
		nu2 <if= T2 0   if= V1 0 V= 1 1   XPV 100  AddRenown 1   SALVAGE   Alert 5   Trigger0 .%id%_%plotid%_GoWin WinSubPlot %plotid%>
		end <SetEncounterInactive %2%>

		Msg1 <You locate the raiders.>
		Msg2 <You discovered that your enemy was working for %name3%.>
		Msg3 <Your reinforcements are here, as promised.>
		Msg4 <You were defeated by the raiders. There can be no doubt that they are working for %name3%.>
		Msg5 <You have defeated the raiders. There can be no doubt that they are working for %name3%.>

		sub
			team 1
			setally 3
			SetEnemy 2
			ParaX 5
			ParaY 10

			team 2
			SetEnemy 1 3
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction %3%   if= p%id%03 0 else GoSmallDeploy WMecha 2 StoryDL 150>
			GoSmallDeploy <WMecha 2 StoryDL 90>
			ParaX 45
			ParaY 45

			team 3
			setally 1
			setenemy 2
			Deploy <if= PlotStatus %plotid% %id%  if# P%id%02 0   WMecha 3 StoryDL 60>
			ParaX 10
			ParaY 5
		end
	end

Content
	name <Defend The Prototype>
	size 10
	desc <You find your enemies transporting a prototype weapon.>
	requires <*:CS_MechaEncounter +Pun -!Ne>
	changes <+P>

	% E1 is the outdoors scene where this encounter will be placed
	% E2 is the metascene to be used for this encounter

	% P%id%01 = Initialization Counter
	% P%id%02 = Have gained decimation
	update <if= V%id%01 0 V= %id%01 1   SetPlotStatus %plotid1% %id1%>

	.%id1%_%plotid1%_GoDecimation     <P= %id%02 1>

	% SubPlot1 = Gain Advantage vs Raiders
	SubPlot1 <*:CS_GainAdvantageVsMecha&Decimation>

	sub
		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1   Alert 1  TeamMonologue 2 2   AlterContext .changes   CancelSubPlot %plotid1%>
		.changes <+Pew>
		nu1 <if= T1 0   Return   if= L1 0  L= 1 1  ifG T3 0 else GoWinMission Goto GoLoseMission>
		nu2 <if= T2 0   if= T3 0   if= L1 0   L= 1 1  Goto GoWinMission>
		nu3 <if= T2 0   if= T3 0   if= L1 0   L= 1 1  Goto GoWinMission>
		GoWinMission  <Alert 4 History 5   XPV 100  SALVAGE  AddRenown 1   Trigger0 .%id%_%plotid%_GoWin   WinSubPlot %plotid%>
		GoLoseMission <Alert 6 History 7                                   Trigger0 .%id%_%plotid%_GoLoss  LoseSubPlot %plotid%>
		end <SetEncounterInactive %2%>

		Msg1 <You locate your enemies. They appear to be escorting a large vehicle of some type.>
		Msg2_1 <Defend the prototype! It must be protected, at all costs!>
		Msg2_2 <>
		Msg2_3 <>
		Msg3 <You discovered that your enemy was working for %name3%.>
		Msg4 <The prototype weapon has been destroyed. You wonder how many more of these things they might be working on.>
		Msg5 <You fought and destroyed an experimental weapon.>
		Msg6 <You shudder to think what will happen if this prototype should enter general production.>
		Msg7 <You failed to destroy an experimental weapon.>

		sub
			team 1
			SetEnemy 2 3
			ParaX 5
			ParaY 10

			team 2
			name <Mecha Forces>
			SetEnemy 1
			SetAlly 3
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   if= p%id%02 0 else GoSmallDeploy WMecha 2 StoryDL 120>
			GoSmallDeploy <WMecha 2 StoryDL 70>
			ParaX 40
			ParaY 40

			Team 3
			name <Prototype>
			SetAlly 2
			SetEnemy 1
			ParaX 45
			ParaY 45

			rect
			name <Enemy Zone>
			special <SubZone>
			width 5
			height 5
			MFX 40
			MFY 40
			sub
				SuperProp
				requires <*Superweapon>
				SetTeam 3
			end

		end
	end


%%  *************************************
%%  ***   +Pla  Learn  of  Artifact   ***
%%  *************************************


%%  ****************************************
%%  ***   +Pew  Enemy  Weapon  Program   ***
%%  ****************************************

Content
	name <Prototype Field Test>
	size 10
	desc <You find your enemies transporting a prototype weapon. Again.>
	requires <*:CS_MechaEncounter +Pew &Secondary>
	changes <+P>

	% E1 is the outdoors scene where this encounter will be placed
	% E2 is the metascene to be used for this encounter

	% P%id%01 = Initialization Counter
	% P%id%02 = Have gained decimation
	% P%id%03 = Have gained reinforcements
	update <if= V%id%01 0 V= %id%01 1   SetPlotStatus %plotid1% %id1%>

	.%id1%_%plotid1%_GoDecimation     <P= %id%02 1>
	.%id1%_%plotid1%_GoReinforcements <P= %id%03 1>

	% SubPlot1 = Gain Advantage vs Raiders
	SubPlot1 <*:CS_GainAdvantageVsMecha&Decimation&Reinforcements>

	sub
		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1   Alert 1  TeamMonologue 2 2  History 3   CancelSubPlot %plotid1%>
		nu1 <if= T1 0   Return   if= L1 0  L= 1 1  ifG T3 0 else GoWinMission Goto GoLoseMission>
		nu2 <if= T2 0   if= T3 0   if= L1 0   L= 1 1  Goto GoWinMission>
		nu3 <if= T2 0   if= T3 0   if= L1 0   L= 1 1  Goto GoWinMission>
		GoWinMission  <Alert 4 History 5   XPV 100  SALVAGE  AddRenown 1   Trigger0 .%id%_%plotid%_GoWin   WinSubPlot %plotid%>
		GoLoseMission <Alert 6 History 7                                   Trigger0 .%id%_%plotid%_GoLoss  LoseSubPlot %plotid%>
		end <SetEncounterInactive %2%>

		Msg1 <You locate the raiders. They appear to be escorting a large vehicle of some type.>
		Msg2_1 <We're being attacked... This will make the perfect field test for our new weapon!>
		Msg2_2 <>
		Msg2_3 <>
		Msg3 <You found your enemies field testing a prototype weapon.>
		Msg4 <You destroyed the weapon.>
		Msg5 <You destroyed the prototype.>
		Msg6 <You shudder to think what will happen if this prototype should enter general production.>
		Msg7 <You failed to destroy the prototype.>

		sub
			team 1
			SetEnemy 2 3
			SetAlly 4
			ParaX 5
			ParaY 10

			team 2
			name <Mecha Forces>
			SetEnemy 1 4
			SetAlly 3
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   if= p%id%02 0 else GoSmallDeploy WMecha 2 StoryDL 100>
			GoSmallDeploy <WMecha 2 StoryDL 60>
			ParaX 40
			ParaY 40

			Team 3
			name <Prototype>
			SetAlly 2
			SetEnemy 1 4
			ParaX 45
			ParaY 45

			Team 4
			name <Allies>
			SetAlly 1
			SetEnemy 2 3
			Deploy <if= PlotStatus %plotid% %id%  if# P%id%03 0   WMecha 4 StoryDL 60>
			ParaX 10
			ParaY 5

			rect
			name <Enemy Zone>
			special <SubZone>
			width 5
			height 5
			MFX 40
			MFY 40
			sub
				SuperProp
				requires <*Superweapon>
				SetTeam 3
			end

		end
	end


%%  *************************************
%%  ***   +Clo  Woo  Love  Interest   ***
%%  *************************************


%%  *******************
%%  ***   GENERAL   ***
%%  *******************

Content
	name <I'm Not Distressed>
	size 5
	desc <Your love interest is under attack, but will prove self to you.>
	requires <*:CS_MechaEncounter +H-- A:++ (A:LABOR|A:CRAFT|A:FAITH|A:CORPO|A:TRADE|A:ADVEN) (A:A.tha|A:A.jr_|A:A.---) -A:ENEMY ~+Glo>
	changes <A:A +H>

	% E1 is the outdoors scene where this encounter will take place
	% E2 is the encounter
	% E3 is the love interest
	element3 <Grab 9>
	Place3 <2 (Lover) sd ally>

	% P%id%01 = Initialization Counter
	% P%id%03 = Have gained decimation
	update <if= P%id%01 0 P= %id%01 1 NPCLevel %3% StoryDL SetPlotStatus %plotid1% %id1%>

	% Set decimation here
	.%id1%_%plotid1%_GoDecimation     <P= %id%03 1>

	% SubPlot1 = Gain Advantage vs Raiders
	SubPlot1 <*:CS_GainAdvantageVsMecha&Decimation>

	sub
		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1  Alert 1 History 2 ForceChat %3%  CancelSubPlot %plotid1%>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1   LoseSubPlot %plotid%   Trigger0 .%id1%_%plotid1%_GoLoss  Goto GoSetEnvy>
		nu2 <if= T2 0   if= V1 0 V= 1 1   XPV 100  AddRenown 1   SALVAGE   Trigger0 .%id%_%plotid%_GoWin WinSubPlot %plotid% ifNPCInPlay %3% else GoSetEnvy  Monologue %3% 3 FreezeNPC %3% Print 6 SetXXRAttitude %3% XXR_A_IsEqual  History 4 AlterContext .next>
		.next <+Hra>
		GoSetEnvy <ifNPCOK %3% SetXXRAttitude %3% XXR_A_EnviesPC History 5>
		end <SetEncounterInactive %2%>

		Msg1 <You find %name3% fighting off a lance of mecha from \FACTION &EnemyFac .>
		Msg2 <You helped %name3% fight \FACTION &EnemyFac .>
		Msg3 <Hey, I'd say that we make a pretty good team. I'll see you around \PC .>
		Msg4 <Together you defeated all of the enemies.>
		Msg5 <You failed to protect %name3% from the mecha.>
		Msg6 <%name3% returns to \PPR %3% convoy.>

		sub
			team 1
			SetEnemy 2
			SetAlly 3
			ParaX 5
			ParaY 5

			team 2
			SetEnemy 1 3
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   if= p%id%03 0 else GoSmallDeploy WMecha 2 StoryDL 220>
			GoSmallDeploy <WMecha 2 StoryDL 120>
			ParaX 30
			ParaY 30

			team 3
			name <Lover>
			SetEnemy 2
			SetAlly 1
			ParaX 45
			ParaY 45
		end

		Persona 3
		special <UNLISTED>
		% V%id%01 = Can only get this conversation once
		greeting <if= PlotStatus %plotid% %id% else %pop% if= v%id%01 0 else %pop% v= %id%01 1 EndChat Say %id%01 AddChat %id%01 AddChat %id%02>
		*result%id%01 <*LetsDefeatThem>
		result%id%02 <EndChat Say %id%02 AddReact -10>
		Msg%id%01 <Am I ever glad to see you! A convoy I was escorting just got attacked. I could use some backup.>
		Msg%id%01_1 <\PC ! You certainly know the right time to show up... A convoy that I was escorting got attacked by these mecha. I could use some help to finish them off.>
		CMsg%id%01_1 <ifNPCSociable Accept>
		Msg%id%01_2 <Imagine seeing you here. My convoy is under attack.>
		CMsg%id%01_2 <ifNPCShy Accept>
		Msg%id%01_3 <Oh, hi there! This isn't really a great time to see you, or maybe it's the perfect time, but my convoy is under attack...>
		CMsg%id%01_3 <ifNPCEasygoing Accept>
		Msg%id%01_4 <You sure know how to make a dramatic entrance! Look at this- these mecha had the nerve to attack the convoy I was guarding.>
		CMsg%id%01_4 <ifNPCPassionate Accept>
		Msg%id%01_5 <Well this is a lucky break... \PC , the convoy I'm guarding is under attack. I could use some backup.>
		CMsg%id%01_5 <ifNPCCheerful Accept>
		Msg%id%01_6 <Just when it seemed like this was going to be a bad day, here you are. The convoy I was guarding just got attacked.>
		CMsg%id%01_6 <ifNPCMelancholy Accept>
		Msg%id%02 <You think I'm completely helpless out here? Come on, let's see who the better pilot is!>
		Prompt%id%01 <I'll help you take them.>
		Prompt%id%01_1 <They won't stand a chance against both of us together.>
		Prompt%id%02 <Get out of here- I can take them myself.>
		Prompt%id%02_1 <This is too dangerous for you- leave it to me.>
	end


Content
	name <Edie Brickell Never Hurt Anyone>
	size 5
	desc <The Bohemian Collective distances itself from your enemy.>
	requires <*:CS_MechaEncounter F:BOHEM E:++ -&Secondary -!Ne ~!Md ~!Hi>
	% The Bohemian Collective, being largely an anarchic group of live-and-let-live leave-me-aloneist
	% libertarians/libertines, doesn't make a very good enemy. Honestly, I can see pissing one or two
	% of them off, or maybe even three or four, but the entire faction? You made them agree on something?
	% Impossible. If a splinter group wants to kill you, they're probably just posers. Or pirates.
	changes <F:++>

	% E1 is the outdoors scene where this encounter will take place
	% E2 is the encounter
	% E3 is an envoy from the Dusty Ring
	% E4 is a pirate faction to be the new enemy
	% E5 is a pirate/mook of the Enemy NPC
	Element3 <Prefab>
	Place3 <2 (Envoy) sd ally>
	Element4 <Faction (REDMA|CRIHN) -ArchAlly !XClude -3>
	Element5 <Prefab>

	% P%id%01 = Initialization Counter

	update <if= P%id%01 0 P= %id%01 1 NPCLevel %3% StoryDL SetNPCFaction %5% %4%>

	% This subplot must propgate the effects of its own subplot backwards to
	% the parent plot.
	.%id1%_%plotid1%_GoWin  <WinSubPlot %plotid%  Trigger0 .%id%_%plotid%_GoWin>
	.%id1%_%plotid1%_GoLoss <LoseSubPlot %plotid% Trigger0 .%id%_%plotid%_GoLoss>

	% SubPlot1 is the Stop E5 mission
	SubPlot1 <*:CS_StopNPCMission&Secondary 5>

	sub
		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1   Alert 1   History 2   &SetEnemyFac %4%   ForceChat %3%>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1         Trigger0 .%id%_%plotid%_GoLoss LoseSubPlot %plotid%>
		nu2 <if= T2 0   if= V1 0 V= 1 1   XPV 100  AddRenown 1   SALVAGE   Monologue %3% 3 Retreat 3 History 4 SMemo 5  SetPlotStatus %plotid1% %id1%>
		end <SetEncounterInactive %2% FreezeNPC %3%>

		Msg1 <You find a lance of Bohemian mecha fighting some pirates.>
		Msg2 <%name3% revealed that \PERSONA &EnemyNPC was a pirate, not a bohemian.>
		Msg3_1 <\PERSONA &EnemyNPC 's number one fighter %name5% is here on a mission. Stop \OPR %5% , and many lives will be spared. We will meet again.>
		CMsg3_1 <ifNPCOK %3% Accept>
		Msg3_2 <\PERSONA &EnemyNPC ... \PPR &EnemyNPC henchman... you must stop %name5%... we... we will meet again...>
		CMsg3_2 <ifNPCDead %3% Accept>
		Msg4 <You learned that \PERSONA &EnemyNPC 's henchman %name5% was in town on a mission.>
		Msg5 <%name3% told you that \PERSONA &EnemyNPC works for %name4%, and \PPR &EnemyNPC henchman %name5% is in town on a mission.>

		sub
			team 1
			setally 3
			SetEnemy 2
			ParaX 5
			ParaY 5

			team 2
			name <Pirates>
			SetEnemy 1 3
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction %4%   WMecha 2 StoryDL 150>
			GoSmallDeploy <WMecha 2 StoryDL 90>
			ParaX 25
			ParaY 45

			team 3
			name <Envoy>
			setally 1
			setenemy 2
			Deploy <if= PlotStatus %plotid% %id%  SetSelfFaction 12  WMecha 3 StoryDL 60>
			ParaX 45
			ParaY 5
		end

		Persona 3
		special <UNLISTED NOESCAPE>
		greeting <EndChat Say 1 AddChat 1 AddChat 2>
		result1 <EndChat Say 2 AddChat 3>
		result2 <EndChat Say 3 AddChat 3>
		result3 <EndChat Say 4>
		Msg1 <Hold your fire, I come to you bearing a message from the dusty ring! The Bohemian Collective is not your enemy. We seek only peace with the people of \SCENE &EpisodeScene .>
		Msg2 <\PERSONA &EnemyNPC does not represent us; in fact, \SPR &EnemyNPC has long been a member of %name4%, and it is they who have directed \PPR &EnemyNPC actions against you.>
		Msg3 <I see that \PERSONA &EnemyNPC has been busy spreading lies. You should know that \SPR &EnemyNPC is not a member of the collective, but instead a pirate with %name4%. It is them that you should be fighting.>
		Msg4 <I have additional information which may help you decide, but first we should deal with \PERSONA &EnemyNPC 's henchmen.>
		Prompt1 <Tell that to \PERSONA &EnemyNPC !>
		Prompt2 <You really think I'm going to believe that?>
		Prompt3 <How do I know I can trust you?>
	end
	inv
		NPC Explorer
		chardesc Old
		SetFaction 12

		NPC Pirate
		chardesc Young
		job_desig <MOOK_>
	end

Content
	name <MUGL, You Useless Morons>
	size 10
	desc <Your enemy, frustrated with MUGL Enterprises's incompotence, leaves them for a different corp.>
	requires <*:CS_MechaEncounter F:MUGLE (P:--|P:CORPO) (E:M.---|E:M.mer) -E:A.nme (!Ne|!Lo)>
	%% MUGL Enterprises isn't a particularly good villain... or, should I say, not a particularly intimidating
	%% villain. I mean, how would you feel if Sanrio were trying to kill you? Actually, that does sound pretty
	%% terrifying... In any case this component will help to cement their reputation as the newest and to-date
	%% least respected of the L5 mecha corporations.
	changes <F:++ E:M>

	% E1 is the outdoors scene where this encounter will be placed
	% E2 is the encounter
	% E3 is the enemy NPC
	% E4 is the faction which gave the NPC the better offer
	% E5 is a local public scene
	% E6 is another MUGL pilot who E3 is assisting, supposedly
	Element3 <Grab 1>
	Place3 <2 (Enemies) sd enemy>
	% The new enemy faction should be an enemy to both the PC and to MUGL.
	Element4 <Faction ArchEnemy !XClude -2 !XClude -3 Corporate>
	Element5 <Scene Public !Near -7 !Okay -2>
	Element6 <Character HasMecha Cheerful !Comrade -2 !Near 5 NeverFail>
	NeverFail6 <Mecha Pilot>
	Place6 <2 (Enemies) sd enemy>

	% P%id%01 = Initialization Counter
	% P%id%02 = Have gained decimation
	update <if= V%id%01 0 V= %id%01 1   SetPlotStatus %plotid1% %id1% NPCLevel %3% StoryDL NPCLevel %6% StoryDL>

	% Gaining the decimation advantage means that E6 won't show up to the battle.
	.%id1%_%plotid1%_GoDecimation     <P= %id%02 1  MoveAndPacifyNPC %6% 5>

	% SubPlot1 = Gain Advantage vs Raiders
	SubPlot1 <*:CS_GainAdvantageVsMecha&Decimation>

	sub
		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		% L3 = Enemy Died/Plot Immunity Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1   CancelSubPlot %plotid1%  Alert 1 Monologue %3% 2 if= P%id%02 0 else GoDecimated Monologue %6% 3 Monologue %3% 4 History 5>
		GoDecimated <Monologue %3% 6 History 7>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1         Trigger0 .%id%_%plotid%_GoLoss LoseSubPlot %plotid% if# L3 0 Monologue %3% 8 Monologue %3% 9 Goto GoSetAttitude>
		nu2 <if= T2 0   if= V1 0 V= 1 1   XPV 100  AddRenown 1   SALVAGE   Trigger0 .%id%_%plotid%_GoWin WinSubPlot %plotid%  Alert 11  if= L3 0 else GoE3DiedEnd  if# P%id%02 0 else GoE3AliveEnd  ifNPCOK %6% else GoE3AliveEnd Monologue %6% 12 History 15  Goto GoE3AliveEnd>
		GoE3AliveEnd <Monologue %3% 13 Monologue %3% 9 Goto GoSetAttitude>
		GoE3DiedEnd <Alert 14 Goto GoSetAttitude>
		Faint%3% <L= 3 1 FreezeNPC %3%>
		end <SetEncounterInactive %2%>
		GoSetAttitude <History 10   SetXXRMotivation %3% XXR_M_Mercenary>

		Msg1 <You face a lance of mecha from MUGL Enterprises led by %name3%.>
		Msg2_1 <Hello again, \PC . I thought you'd try to interfere with %name6%'s mission, so I came here to help out.>
		Msg3 <Yeah! No-one messes with the Bunny and gets away with it!>
		Msg4 <Just shut up and fight, %name6%.>
		Msg5 <You fought a group of mecha led by %name3% and %name6%.>
		Msg6 <Now, where the blazes is %name6%...?>
		Msg7 <You fought %name3%, who was supposed to be helping %name6%.>
		Msg8 <That crappy MUGL mecha nearly killed me! How is anyone supposed to work with substandard equipment like this!?>
		Msg9_1 <I quit! MUGL Enterprises can kiss my arse, I'm gonna go accept that offer at %name4%!>
		Msg10 <%name3% quit MUGL to go work for %name4%.>
		Msg11 <You have defeated all of the MUGL mecha.>
		Msg12 <Hey %name3%, I'm here to start our mission now! Sorry I'm a bit late... ashes, what happened!?>
		Msg13_1 <That's it! I've had it with this two-bit cartoon rabbit company! How do they expect us to win in garbage mecha like this!?>
		Msg14 <You are surprised to find the cockpit of %name3%'s mecha empty, except for a completed job application for %name4%.>
		Msg15 <%name6% arrived too late to help %name3%.>

		sub
			team 1
			SetEnemy 2
			ParaX 5
			ParaY 5

			team 2
			name <Enemies>
			SetEnemy 1
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   WMecha 2 StoryDL 40>
			ParaX 45
			ParaY 45
		end
	end


Content
	name <I Have Become Death>
	size 9
	desc <Your enemy no longer cares, and so won't hold back any longer.>
	requires <*:CS_MechaEncounter E:++ F:++ (E:M.---|E:M.rev) (E:A.hat|E:A.mut|E:A.obs|E:A.env|E:A.---|E:A.jr_|E:A.sr_) !Hi -&Secondary>
	changes <E:M R:++>

	% E1 is the outdoors scene where this encounter will be placed
	% E2 is the "kicker" encounter- the one which starts the main plot
	% E3 is the enemy
	% E4 is the urban scene for the encounters to follow
	% E5 is the final battle scene
	% E6 is the Enemy's lieutenant
	% E7 is the third in command
	% E8 is the fourth
	% E9 is the *FactionRampage mood which accompanies this episode
	% E10 is an enemy of the enemy faction needed for narrative purposes
	Element3 <Grab 1>
	Place3 </>
	Element4 <Scene Urban !Near -7>
	Element5 <Prefab>
	Place5 <4>
	Element6 <Character Villainous HasMecha !Comrade -2 !Global NeverFail>
	NeverFail6 <Mecha Pilot>
	Place6 <5 (Enemies) SD enemy>
	Element7 <NewNPC -2 -7 Passionate>
	Place7 </>
	Element8 <Character Heroic HasMecha !Comrade -2 !Global NeverFail>
	Place8 </>
	Element9 <Prefab>
	Element10 <Faction !Enemy -2>

	% P%id%01 = Initialization Counter
	% P%id%02 = Have gained reinforcements
	% P%id%03 = Have gained decimation
	% P%id%04 = Completed first combat
	% P%id%05 = E8 backed out of fight
	% P%id%06 = E7 backed out of (final) fight

	update <if= P%id%01 0 P= %id%01 1 SetNPCFaction %6% &EnemyFac SetNPCFaction %7% &EnemyFac SetNPCFaction %8% &EnemyFac>

	% Set either reinforcements or decimation here
	.%id3%_%plotid3%_GoReinforcements <P= %id%02 1>
	.%id3%_%plotid3%_GoDecimation     <P= %id%03 1>

	.%id1%_%plotid1%_GoWin <SetPlotStatus %plotid2% %id2%  SMemo %id%01     if= P%id%05 0 History %id%03     ifNPCOK %8% MoveNPC %8% %5% SetNPCTeam %8% 2>
	.%id2%_%plotid2%_GoWin <SetPlotStatus %plotid3% %id3%  Alert %id%02 SMemo %id%02 History %id%04 SetEncounterActive %5%  ifNPCOK %7% if= P%id%06 0 MoveNPC %7% %5% SetNPCTeam %7% 2>

	Msg%id%01 <You have defeated %name8%, but %name7% is still out there looking for you.>
	Msg%id%02 <You have defeated both %name8% and %name7%. Now it's time to bring the fight to %name6%.>
	Msg%id%03 <You defeated %name8% in mecha combat.>
	Msg%id%04 <You defeated %name7% in mecha combat.>

	% SubPlot1 is the first substage boss battle
	% SubPlot2 is the second substage boss battle
	% SubPlot3 is the ability to gain an advantage in the final battle
	SubPlot1 <*:CS_SubBossRoadblock 4 8>
	SubPlot2 <*:CS_SubBossRoadblock 4 7>
	SubPlot3 <*:CS_GainAdvantageVsNPC&Decimation&Reinforcements 6>

	sub
		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 30
		MapHeight 30

		Start <if= L2 0 L= 2 1 Alert 1 Monologue %3% 2 Monologue %6% 3  History 4  SetXXRMotivation %3% XXR_M_Nihilism   SetNPCRep %3% 1 -100   SetMood %9% &EpisodeScene>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1                           Monologue %6% 7  Goto GoBeginRoadblock>
		nu2 <if= T2 0   if= V1 0 V= 1 1   AddRenown 1   SALVAGE   Monologue %6% 8 Monologue %7% 9 Monologue %8% 10  XPV 100 P= %id%04 1 Return  Goto GoBeginRoadblock>
		end <SetEncounterInactive %2%>
		GoBeginRoadblock <SMemo 5 History 6 SetPlotStatus %plotid1% %id1%>

		Msg1 <You arrive at the end of a battle between %name3% and %name10%.>
		Msg2 <You missed the action, \PC . My work here is finished. %name6%, I will leave you to mop up the rest. I don't care how many civilians you have to kill.>
		Msg3 <It'll be my pleasure, captain. \SCENE &EpisodeScene will know that it belongs to \FACTION &EnemyFac !>
		Msg4 <%name3% ordered \PPR %3% lieutenant %name6% to raze \SCENE &EpisodeScene .>
		Msg5 <%name3% left \PPR %3% lieutenant to raze \SCENE &EpisodeScene . %name6% ordered %name7% and %name8% to hunt you down.>
		Msg6 <%name6% assigned %name7% and %name8% to hunt you down.>
		Msg7 <Don't think you can get away. I'll assign %name7% and %name8% to make sure you don't survive.>
		Msg8 <You're stronger than you look, but don't think you're safe just yet. I'll send %name7% and %name8% to hunt you down.>
		Msg9 <Finally, an opponent who might be worth my talents.>
		Msg10 <I don't know... are we really doing the right thing here?>

		sub
			team 1
			SetEnemy 2
			ParaX 5
			ParaY 5

			team 2
			SetEnemy 1
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   WMecha 2 StoryDL 100>
			ParaX 25
			ParaY 25
		end

		MetaScene 5 2
		%  This is the final battle against E6 and the surviving henchmen. It's likely to be
		%  very tough, so hopefully the PC has gained the advantage or removed some of the
		%  henchmen.
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1  ForceChat %6%>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1 LoseRenown History 1 SetMoodTimeLimit %9% 86400 LoseSubPlot %plotid%   Trigger0 .%id%_%plotid%_GoLoss>
		nu2 <if= T2 0   if= V1 0 V= 1 1   Alert 2 History 3   XPV 100  SALVAGE  KillMood %9%   AddRenown 1   Trigger0 .%id%_%plotid%_GoWin   WinSubPlot %plotid%>
		end <SetEncounterInactive %5%>

		Msg1 <You were defeated in combat by %name6%'s lance.>
		Msg2 <With %name6% defeated, %name3%'s followers will be forced to leave \SCENE &EpisodeScene and peace will return.>
		Msg3 <You defeated %name6%'s lance, driving them from \SCENE &EpisodeScene .>

		sub
			team 1
			SetEnemy 2
			SetAlly 3
			ParaX 5
			ParaY 5

			team 2
			name <Enemies>
			SetEnemy 1 3
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   if= P%id%03 0 else GoSmallDeploy WMecha 2 StoryDL 100>
			GoSmallDeploy <WMecha 2 StoryDL 25>
			ParaX 45
			ParaY 45

			team 3
			name <Reinforcements>
			SetEnemy 2
			SetAlly 1
			Deploy <if# P%id%02 0   WMecha 2 StoryDL 100>
			ParaX 10
			ParaY 10
		end

		Persona 6
		special <UNLISTED>
		greeting <if= PlotStatus %plotid% %id% else %pop% EndChat Say %id%01 AddChat %id%01>
		*result%id%01 <*THEME_EXPO&Enemy na>
		Msg%id%01 <You managed to escape both %name7% and %name8%... that's quite impressive. Unfortunately it will be of no use to you now.>
		Prompt%id%01 <I'll do the same to you.>

		Persona 7
		special <UNLISTED>
		% V%id%01 = Have fought before
		%  If the PC completed the first combat and heard E7 speak, it might be
		%  possible to convince them to not fight now.
		greeting <if= PlotStatus %plotid% %id% else %pop% if= v%id%01 0 else .%id%_GoSecondTime EndChat Say %id%01 AddChat %id%01 AddChat %id%02 V= %id%01 1>
		*.%id%_GoSecondTime <*Back_For_More>
		*result%id%01 <*THEME_EXPO&Enemy na>
		result%id%02 <EndChat Say %id%02 P= %id%06 1 AddChat %id%03>
		result%id%03 <Goto result%id%01>
		Msg%id%01 <So there you are... I heard what you did to %name8%, but I assure you that I won't be nearly so easy to beat.>
		Msg%id%02 <%name6% isn't the boss of me! I don't have to listen to \OPR %6%... it's just that right now I want to kick your ass of my own free will!>
		Prompt%id%01 <We'll find out soon enough.>
		Prompt%id%02 <If you're so tough, then why aren't you %name3%'s second?>
		CPrompt%id%02 <if# P%id%04 0 ifInsight SkillTar StoryDL Accept>
		Prompt%id%03 <[Continue]>

		Persona 8
		special <UNLISTED>
		% V%id%01 = Have fought before
		%  If the PC completed the first combat and heard E8 speak, it might be
		%  possible to convince them to not fight now.
		greeting <if= PlotStatus %plotid% %id% else %pop% if= P%id%05 0 else %pop% if= v%id%01 0 else .%id%_GoSecondTime EndChat Say %id%01 AddChat %id%01 AddChat %id%02 V= %id%01 1>
		*.%id%_GoSecondTime <*Back_For_More>
		*.%id%_GoArgumentFail <*IDisagreeYouDie>
		.%id%_GoArgumentWin <Retreat 2 P= %id%05 1>
		.%id%_GoArgumentMeh <EndChat Say %id%04 History %id%07 PCFriend %8% Goto .%id%_GoArgumentWin>
		.%id%_GoJoinLance <EndChat Say %id%05 History %id%06 &SetPartnerNPC %8% &AddPartnerToLance SetXXRMotivation %8% XXR_M_GreaterGood Goto .%id%_GoArgumentWin>
		*result%id%01 <*THEME_EXPO&Enemy na>
		result%id%02 <EndChat Say %id%02 AddChat %id%03 AddChat %id%04 AddChat %id%05>
		result%id%03 <ifPCHeroic else .%id%_GoArgumentFail ifConversation SkillTar StoryDL else .%id%_GoArgumentFail EndChat Say %id%03 AddChat %id%06 AddChat %id%07>
		result%id%04 <Goto result%id%01>
		result%id%05 <ifConversation SkillTar StoryDL else .%id%_GoArgumentFail EndChat Say %id%04 PCFriend %8% History %id%07 Goto .%id%_GoArgumentWin>
		result%id%06 <ifG PCHeroism d50 else .%id%_GoArgumentMeh Goto .%id%_GoJoinLance>
		result%id%07 <ifG ChatNPCHeroism d50 else .%id%_GoArgumentMeh Goto .%id%_GoJoinLance>
		Msg%id%01 <I've caught you! %name6% ordered me to defeat you, so I can't allow you to escape!>
		Msg%id%02 <What else can I do? I may not like what %name3%'s doing to \SCENE &EpisodeScene , but I must remain loyal to \FACTION &EnemyFac .>
		Msg%id%03 <But... but what about my friends? Is this really the right thing to do?>
		Msg%id%04 <You're right... I won't fight you, but I can't betray my friends either. Goodbye \PC .>
		Msg%id%05 <I think... I think you're right. I'll help you to defeat %name3%.>
		Msg%id%06 <You convinced %name8% to join your side.>
		Msg%id%07 <You convinced %name8% to abandon the fight.>
		Prompt%id%01 <Let's get this over with.>
		Prompt%id%02 <You don't have to do this, you know.>
		CPrompt%id%02 <if# P%id%04 0 Accept>
		Prompt%id%03 <Forget about them, and join my team instead!>
		CPrompt%id%03 <ifNPCDead &PartnerNPC Accept>
		Prompt%id%04 <Die by my hand, then.>
		Prompt%id%05 <You know what you're doing is wrong.>
		Prompt%id%06 <%name3% must be stopped, for everyone's sake.>
		Prompt%id%07 <Do whatever you think is right.>
	end
	inv
		stc CORE-ACTIVATABLE
		name <%name6%'s Lance>

		Mood 3
		name <"I Have Become Death" Mood>
		plot_type <*FactionRampage>
		Element1 <Grab -2>
		Update <if= v1 0 V= 1 1   News 1>
		Msg1_1 <%city% under siege as %name3%'s personal forces take control.>
		Msg1_2 <Mecha from \FACTION &EnemyFac take control of %city% under the orders of %name3%.>
		Msg1_3 <%name3% has begun a purge of \PPR %3% enemies from %city%; authorities powerless to stop the destruction.>
		% Meme Messages
		Msg_1 <When will the trouble with %me_name1% end?>
		CMsg_1 <if# ChatNPCFac %me_1% Accept>
		Msg_2 <Someone really ought to do something about %me_name1%... They must be stopped!>
		CMsg_2 <if# ChatNPCFac %me_1% Accept>
		Msg_3 <What did %city% do to deserve this? Those jerks from %me_name1% are acting like they own the place.>
		CMsg_3 <if# ChatNPCFac %me_1% Accept>
	end

Content
	name <Turning Point>
	size 5
	desc <Meet your former enemy fighting your current enemy and maybe become allies.>
	requires <*:CS_MechaEncounter F:++ +Hed H:++ ~H:FRIEND ~H:LOVER ~H:FAMILY -H:ALLY>
	changes <+H>

	% E1 is the outdoors scene where this encounter will be placed
	% E2 is the metascene to be used for this encounter
	% E3 is the former enemy
	% E4 is a local public scene
	Element3 <Grab 10>
	Place3 <2 (Former Enemy) sd ally>
	Element4 <Scene Public (Meeting|Bar|Garage) !Near -7>

	% P%id%01 = Initialization Counter
	% P%id%02 = Have gained reinforcements
	% P%id%03 = Have gained decimation
	% At initialization, set the NPC's level and clear its faction.
	update <if= p%id%01 0 p= %id%01 1 NPCLevel %3% StoryDL SetNPCFaction %3% 0   SetPlotStatus %plotid1% %id1%>

	% Set either reinforcements or decimation here
	.%id1%_%plotid1%_GoReinforcements <P= %id%02 1>
	.%id1%_%plotid1%_GoDecimation     <P= %id%03 1>

	% SubPlot1 = Gain Advantage vs Raiders
	SubPlot1 <*:CS_GainAdvantageVsMecha&Reinforcements&Decimation>

	sub
		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1  AlterContext .context  &SetHangingNPC 0   Alert 1 History 2 ForceChat %3%  CancelSubPlot %plotid1%>
		.context <+H-->
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1   LoseSubPlot %plotid%   Trigger0 .%id1%_%plotid1%_GoLoss  DeleteNPC %3%>
		nu2 <if= T2 0   if= V1 0 V= 1 1   XPV 100  AddRenown 1   SALVAGE   Trigger0 .%id%_%plotid%_GoWin WinSubPlot %plotid% ifNPCInPlay %3% else GoDeleteE3 PCAlly %3% Monologue %3% 3 MoveAndPacifyNPC %3% %4% History 4>
		GoDeleteE3 <DeleteNPC %3%>
		end <SetEncounterInactive %2%>

		Msg1 <You find %name3% fighting off a lance of mecha from \FACTION &EnemyFac .>
		Msg2 <You helped %name3% fight \FACTION &EnemyFac .>
		Msg3 <Thanks for the assist. I'll be at %name4% if you ever happen to need my help.>
		Msg4 <%name3% pledged to help you defeat \PPR %3% former allies.>

		sub
			team 1
			SetEnemy 2
			SetAlly 3
			ParaX 5
			ParaY 5

			team 2
			SetEnemy 1 3
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   if= p%id%03 0 else GoSmallDeploy WMecha 2 StoryDL 220>
			GoSmallDeploy <WMecha 2 StoryDL 120>
			ParaX 30
			ParaY 30

			team 3
			name <Former Enemy>
			Deploy <if= PlotStatus %plotid% %id% if= P%id%02 1   WMecha 3 StoryDL 100>
			SetEnemy 2
			SetAlly 1
			ParaX 45
			ParaY 45
		end

		Persona 3
		special <UNLISTED>
		% V%id%01 = Can only get this conversation once
		greeting <if= PlotStatus %plotid% %id% else %pop% if= v%id%01 0 else %pop% v= %id%01 1 EndChat Say %id%01 AddChat %id%01 AddChat %id%02>
		*result%id%01 <*LetsDefeatThem>
		*result%id%02 <*THEME_EXPO&Ally .%id%_GoEndR2>
		.%id%_GoEndR2 <AddCheerful -d10>
		Msg%id%01 <As you can see, my former allies are not too happy about my resignation. I guess that means we're on the same side now, \PC ... If you'll have me, I'll join with you to fight them.>
		Msg%id%01_1 <>
		CMsg%id%01_1 <ifNPCSociable Accept>
		Msg%id%01_2 <>
		CMsg%id%01_2 <ifNPCShy Accept>
		Msg%id%01_3 <>
		CMsg%id%01_3 <ifNPCEasygoing Accept>
		Msg%id%01_4 <>
		CMsg%id%01_4 <ifNPCPassionate Accept>
		Msg%id%01_5 <>
		CMsg%id%01_5 <ifNPCCheerful Accept>
		Msg%id%01_6 <>
		CMsg%id%01_6 <ifNPCMelancholy Accept>
		Prompt%id%01 <About time you came around to this side.>
		Prompt%id%01_1 <I always knew you were too smart for \FACTION &EnemyFac .>
		Prompt%id%01_2 <Sounds good to me. Shall we kick some ass?>
		Prompt%id%02 <I can't forgive you, but I hate \FACTION &EnemyFac more.>
		Prompt%id%02_1 <I'll help you this time, but don't expect forgiveness.>
		Prompt%id%02_2 <>
	end


Content
	name <Revenge Road>
	size 12
	desc <The Enemy has mobilized all forces to destroy the PC.>
	requires <*:CS_MechaEncounter E:++ E:A.hat (E:M.---|E:M.com|E:M.see) -&Secondary>
	changes <E:M>

	% E1 is the outdoors scene where this encounter will be placed
	% E2 is the metascene to be used for this encounter
	% E3 is the enemy
	% E4 is an environs scene
	% E5 is an urban scene
	% E6 is Seeker #1
	% E7 is Seeker #2
	Element3 <Grab 1>
	Place3 </>
	Element4 <Scene Environs !Near -7>
	Element5 <Scene Urban !Near -7>
	Element6 <Prefab>
	Place6 <4>
	Element7 <Prefab>
	Place7 <5>

	% P%id%01 = Have activated henchmen

	% This subplot must propgate the effects of its own subplot backwards to
	% the parent plot. Yahoo.
	.%id1%_%plotid1%_GoWin  <WinSubPlot %plotid%  Trigger0 .%id%_%plotid%_GoWin>
	.%id1%_%plotid1%_GoLoss <LoseSubPlot %plotid% Trigger0 .%id%_%plotid%_GoLoss>

	% SubPlot1 = The enemy mission you have to stop
	SubPlot1 <*:CS_StopNPCMission&IsEnemyNPC&Secondary 3>

	sub
		Persona 3
		special <Unlisted>
		greeting <if= PlotStatus %plotid% %id% else GoChat EndChat Say %id%01 AddCHat %id%01>
		GoChat <NewChat SayAnything>
		result%id%01 <EndCHat Say %id%02>
		Msg%id%01 <Well done, \PC . I suppose you'll be disappointed to learn that your actions here won't prevent me from completing my mission.>
		Msg%id%02 <Hardly. This is just the beginning! I've mobilized all of my lancemates and ordered them to destroy you. You will probably find yourself far too busy to stop me... that, or dead. Preferably dead.>
		Prompt%id%01 <Maybe not, but I've decimated your forces!>
		Prompt%id%01_1 <Maybe not, but I've made it harder on you!>

		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1 History 1>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1   LoseSubPlot %plotid%   Trigger0 .%id1%_%plotid1%_GoLoss>
		nu2 <if= T2 0   if= V1 0 V= 1 1   XPV 100  AddRenown 1   SALVAGE   Alert 2  SMemo 3  History 4   ForceChat %3%  SetPlotStatus %plotid1% %id1%  SetXXRMotivation %3% XXR_M_Revenge  P= %id%01 1>
		end <SetEncounterInactive %2%>

		Msg1 <You fought a group of %name3%'s henchmen.>
		Msg2 <You have defeated all of %name3%'s henchmen.>
		Msg3 <You haven't yet stopped %name3%'s mission, and \SPR %3% has mobilized all of \PPR %3% forces to prevent you from doing so.>
		Msg4 <%name3% mobilized all of \PPR %3% forces to destroy you.>

		sub
			team 1
			SetEnemy 2
			ParaX 5
			ParaY 5

			team 2
			SetEnemy 1
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   WMecha 2 StoryDL 150>
			ParaX 45
			ParaY 45
		end

		MetaScene 6 2
		special <UNCHARTABLE>
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1>
		nu1 <if= T1 0   Return if= L2 1 L= 2 2 AddRenown -1>
		nu2 <if= T2 0 if= T3 0   if= L2 1 L= 2 2 Alert 2 Return>
		nu3 <if= T2 0 if= T3 0   if= L2 1 L= 2 2 Alert 2 Return>
		end <L= 2 0>

		Msg2 <You have defeated this group of %name3%'s henchmen, but there will be more coming soon.>

		sub
			team 1
			SetEnemy 2 3
			ParaX 25
			ParaY 25

			team 2
			name <From the Top>
			SetEnemy 1
			SetAlly 3
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   WMecha 2 StoryDL 50>
			ParaX 20
			ParaY 5

			team 3
			name <From the Bottom>
			SetEnemy 1
			SetAlly 2
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   WMecha 3 StoryDL 50>
			ParaX 30
			ParaY 45
		end

		MetaScene 7 2
		special <UNCHARTABLE>
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1>
		nu1 <if= T1 0   Return if= L2 1 L= 2 2 AddRenown -1>
		nu2 <if= T2 0 if= T3 0   if= L2 1 L= 2 2 Alert 2 Return>
		nu3 <if= T2 0 if= T3 0   if= L2 1 L= 2 2 Alert 2 Return>
		end <L= 2 0>

		Msg2 <You have defeated this group of %name3%'s henchmen, but there will be more coming soon.>

		sub
			team 1
			SetEnemy 2 3
			ParaX 25
			ParaY 25

			team 2
			name <Left Flank>
			SetEnemy 1
			SetAlly 3
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   WMecha 2 StoryDL 50>
			ParaX 5
			ParaY 20

			team 3
			name <Right Flank>
			SetEnemy 1
			SetAlly 2
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   WMecha 3 StoryDL 50>
			ParaX 45
			ParaY 30
		end

	end
	inv
		Encounter
		name <Henchmen>
		% V1 = Recharge counter
		update <if= PlotStatus %plotid% %id% else GoHide if# p%id%01 0 else GoHide ifG ComTime V1 else GoHide SetStat STAT_MetaVisibility 0   Goto GoSetOrders>
		EncounterMove 20
		use <ifG StatVal STAT_MetaVisibility -1  Print -1   V= 1 ComTime   V+ 1 10800   Exit Destination>
		ATTACK <ifG StatVal STAT_MetaVisibility -1   ifG PCScale 0    V= 1 ComTime   V+ 1 10800   ifUStealth SkillTar StoryDL else GoAutoAttack   ifYesNo -3 -4 -5 else GoAvoidAttack Goto GoAutoAttack>
		Msg-2 <You are suddenly attacked by %name3%'s henchmen!>

		Encounter
		name <Henchmen>
		% V1 = Recharge counter
		update <if= PlotStatus %plotid% %id% else GoHide if# p%id%01 0 else GoHide ifG ComTime V1 else GoHide SetStat STAT_MetaVisibility 0   Goto GoSetOrders>
		EncounterMove 20
		use <ifG StatVal STAT_MetaVisibility -1  Print -1   V= 1 ComTime   V+ 1 10800   Exit Destination>
		ATTACK <ifG StatVal STAT_MetaVisibility -1   ifG PCScale 0    V= 1 ComTime   V+ 1 10800   ifUStealth SkillTar StoryDL else GoAutoAttack   ifYesNo -3 -4 -5 else GoAvoidAttack Goto GoAutoAttack>
		Msg-2 <You are suddenly attacked by %name3%'s henchmen!>
	end

Content
	name <Waited For Revenge>
	size 8
	desc <Fight someone who wanted revenge against you.>
	requires <*:CS_MechaEncounter +Hre H:++>
	changes <+H>

	% E1 is the outdoors scene where this encounter will be placed
	% E2 is the metascene to be used for this encounter
	% E3 is the enemy fighter
	Element3 <Grab 10>
	Place3 <2 (Enemies) sd enemy>

	% P%id%01 = Initialization Counter
	% P%id%02 = Have gained reinforcements
	% P%id%03 = Have gained decimation
	update <if= V%id%01 0 V= %id%01 1   SetPlotStatus %plotid1% %id1% NPCLevel %3% StoryDL>

	.%id1%_%plotid1%_GoReinforcements <P= %id%02 1>
	.%id1%_%plotid1%_GoDecimation     <P= %id%03 1>

	% SubPlot1 = Gain Advantage vs Raiders
	SubPlot1 <*:CS_GainAdvantageVsMecha&Reinforcements&Decimation>

	sub
		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1   Alert 4 ForceChat %3%  PCEnemy %3%  History 1 AlterContext .clear &SetHangingNPC 0 CancelSubPlot %plotid1% if# P%id%02 0 Alert 2>
		.clear <+H-->
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1         Trigger0 .%id%_%plotid%_GoLoss LoseSubPlot %plotid%>
		nu2 <if= T2 0   if= V1 0 V= 1 1   XPV 100  AddRenown 1   SALVAGE   Alert 3   Trigger0 .%id%_%plotid%_GoWin WinSubPlot %plotid%>
		end <SetEncounterInactive %2%>

		Msg1 <You fought %name3% and \PPR %3% lancemates.>
		Msg2 <Your reinforcements are here, as promised.>
		Msg3 <You have defeated %name3%'s lance.>
		Msg4 <You face a mecha force led by %name3% .>

		sub
			team 1
			setally 3
			SetEnemy 2
			ParaX 5
			ParaY 10

			team 2
			name <Enemies>
			SetEnemy 1 3
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction NPCFac %3%   if= p%id%03 0 else GoSmallDeploy WMecha 2 StoryDL 100>
			GoSmallDeploy <WMecha 2 StoryDL 60>
			ParaX 45
			ParaY 45

			team 3
			setally 1
			setenemy 2
			Deploy <if= PlotStatus %plotid% %id%  if# P%id%02 0   WMecha 3 StoryDL 60>
			ParaX 10
			ParaY 5
		end

		Persona 3
		special <UNLISTED>
		greeting <if= PlotStatus %plotid% %id% else %pop% Goto GoGreet>
		GoGreet <EndChat Say %id%01 AddChat %id%01>
		*result%id%01 <*THEME_EXPO&Enemy na>
		Msg%id%01 <I've been waiting for a chance to get back at you, \PC . You don't stand a chance.>
		Msg%id%01_1 <>
		CMsg%id%01_1 <ifChatNPCSociable Accept>
		Msg%id%01_2 <>
		CMsg%id%01_2 <ifChatNPCShy Accept>
		Msg%id%01_3 <>
		CMsg%id%01_3 <ifChatNPCEasygoing Accept>
		Msg%id%01_4 <>
		CMsg%id%01_4 <ifChatNPCMelancholy Accept>
		Msg%id%01_5 <>
		CMsg%id%01_5 <ifChatNPCCheerful Accept>
		Msg%id%01_6 <>
		CMsg%id%01_6 <ifChatNPCPassionate Accept>
		Prompt%id%01 <Let's get this over with.>
		Prompt%id%01_1 <Don't overestimate your chances.>
	end


Content
	name <E-Member Battle>
	size 6
	desc <Fight a member of the enemy faction.>
	requires <*:CS_MechaEncounter ~&Raiders F:++ &Secondary -!Ne -!Lo>

	% E1 is the outdoors scene where this encounter will be placed
	% E2 is the metascene to be used for this encounter
	% E3 is the enemy fighter
	Element3 <Character HasMecha !Global !Comrade -2>
	Place3 <2 (Enemies) sd enemy>

	% P%id%01 = Initialization Counter
	% P%id%02 = Have gained reinforcements
	% P%id%03 = Have gained decimation
	update <if= V%id%01 0 V= %id%01 1   SetPlotStatus %plotid1% %id1% NPCLevel %3% StoryDL>

	.%id1%_%plotid1%_GoReinforcements <P= %id%02 1>
	.%id1%_%plotid1%_GoDecimation     <P= %id%03 1>

	% SubPlot1 = Gain Advantage vs Raiders
	SubPlot1 <*:CS_GainAdvantageVsMecha&Reinforcements&Decimation>

	sub
		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1   Alert 4 ForceChat %3%  History 1 CancelSubPlot %plotid1% if# P%id%02 0 Alert 2>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1         Trigger0 .%id%_%plotid%_GoLoss LoseSubPlot %plotid%>
		nu2 <if= T2 0   if= V1 0 V= 1 1   XPV 100  AddRenown 1   SALVAGE   Alert 3   Trigger0 .%id%_%plotid%_GoWin WinSubPlot %plotid%>
		end <SetEncounterInactive %2%>

		Msg1 <You fought %name3% of \FACTION &EnemyFac .>
		Msg2 <Your reinforcements are here, as promised.>
		Msg3 <You have defeated %name3%'s lance.>
		Msg4 <You face a mecha force led by %name3% of \FACTION &EnemyFac .>

		sub
			team 1
			setally 3
			SetEnemy 2
			ParaX 5
			ParaY 10

			team 2
			name <Enemies>
			SetEnemy 1 3
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   if= p%id%03 0 else GoSmallDeploy WMecha 2 StoryDL 80>
			GoSmallDeploy <WMecha 2 StoryDL 40>
			ParaX 45
			ParaY 45

			team 3
			setally 1
			setenemy 2
			Deploy <if= PlotStatus %plotid% %id%  if# P%id%02 0   WMecha 3 StoryDL 60>
			ParaX 10
			ParaY 5
		end

		Persona 3
		special <UNLISTED>
		greeting <if= PlotStatus %plotid% %id% else %pop% Goto GoGreet>
		*GoGreet <*BattleChallenge GoThemeExpo na>
		*GoThemeExpo <*THEME_EXPO&Enemy na>
	end

Content
	name <They Are A Pirate>
	size 8
	desc <Your enemy has been hired by a pirate captain.>
	requires <*:CS_MechaEncounter E:++ F:-- -!Ne (L:FCOMS|L:MAQUI|L:RISHI) ~E:THIEF ~E:M.mer ~C:POLIC ~P:POLIC ~P:SILKN ~P:ROCKE>
	changes <F:++>

	% E1 is the outdoors scene where this encounter will be placed
	% E2 is the metascene to be used for this encounter
	% E3 is the pirate faction
	% E4 is the enemy fighter
	% E5 is the enemy NPC
	Element3 <Faction (CRIHN|REDMA) !XClude -3 -ArchAlly>
	Element4 <Prefab>
	Place4 <2 (Enemies) sd enemy>
	Element5 <Grab 1>
	Place5 </>

	% P%id%01 = Initialization Counter
	% P%id%02 = Have gained reinforcements
	% P%id%03 = Have gained decimation
	update <if= V%id%01 0 V= %id%01 1   SetPlotStatus %plotid1% %id1% NPCLevel %4% StoryDL SetNPCFaction %4% %3%>

	.%id1%_%plotid1%_GoReinforcements <P= %id%02 1>
	.%id1%_%plotid1%_GoDecimation     <P= %id%03 1>

	% SubPlot1 = Gain Advantage vs Raiders
	SubPlot1 <*:CS_GainAdvantageVsMecha&Reinforcements&Decimation>

	sub
		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		rumor%id% <%name5% has a meeting planned with some unsavory types.>
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1   Alert 4 Alert 5 ForceChat %4% &SetEnemyFac %3%  PCFEnemy %3%  History 1 CancelSubPlot %plotid1% if# P%id%02 0 Alert 2>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1         Trigger0 .%id%_%plotid%_GoLoss LoseSubPlot %plotid%>
		nu2 <if= T2 0   if= V1 0 V= 1 1   XPV 100  AddRenown 1   SALVAGE   Alert 3   Trigger0 .%id%_%plotid%_GoWin WinSubPlot %plotid%>
		end <SetEncounterInactive %2%>

		Msg1 <You learned that %name3% hired %name5%.>
		Msg2 <Your reinforcements are here, as promised.>
		Msg3 <You have defeated %name4%'s lance.>
		Msg4 <You catch a glimpse of %name5%'s mecha speeding off in the distance, and immediately give chase.>
		Msg5 <Suddenly, you are attacked by a group of pirates who were apparently traveling with \OPR %5% .>

		sub
			team 1
			setally 3
			SetEnemy 2
			ParaX 5
			ParaY 5

			team 2
			name <Enemies>
			SetEnemy 1 3
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction %3%   if= p%id%03 0 else GoSmallDeploy WMecha 2 StoryDL 100>
			GoSmallDeploy <WMecha 2 StoryDL 60>
			ParaX 45
			ParaY 45

			team 3
			setally 1
			setenemy 2
			Deploy <if= PlotStatus %plotid% %id%  if# P%id%02 0   WMecha 3 StoryDL 60>
			ParaX 10
			ParaY 5
		end

		Persona 4
		special <UNLISTED>
		greeting <if= PlotStatus %plotid% %id% else %pop% Goto GoGreet>
		GoGreet <NewChat Say 1 AddChat 1 AddChat 2>
		*result1 <*THEME_EXPO&Enemy na>
		result2 <AddEasygoing d10   Goto result1>
		Msg1 <You must be \PC ... %name5% said \SPR %5% had a fan club when \SPR %5% signed up. You better know, you pick a fight with one of us and you pick a fight with all %name3%.>
		prompt1 <I'm willing to take those odds.>
		prompt2 <My fight is just with %name5%, not with you.>
	end
	inv
		NPC Pirate
	end

Content
	name <Omega State>
	size 8
	desc <Fight a member of the enemy faction. This subplot only occurs when the beanpole is ended.>
	requires <*:CS_MechaEncounter E:A.obs E:M.nih F:++>

	% E1 is the outdoors scene where this encounter will be placed
	% E2 is the metascene to be used for this encounter
	% E3 is the enemy fighter
	Element3 <Character HasMecha !Global !Comrade -2 NeverFail>
	NeverFail3 <Mecha Pilot>
	Place3 <2 (Enemies) sd enemy>

	% P%id%01 = Initialization Counter
	% P%id%02 = Have gained reinforcements
	% P%id%03 = Have gained decimation
	update <if= V%id%01 0 V= %id%01 1   SetPlotStatus %plotid1% %id1% NPCLevel %3% StoryDL>

	.%id1%_%plotid1%_GoReinforcements <P= %id%02 1>
	.%id1%_%plotid1%_GoDecimation     <P= %id%03 1>

	% SubPlot1 = Gain Advantage vs Raiders
	SubPlot1 <*:CS_GainAdvantageVsMecha&Reinforcements&Decimation>

	sub
		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1   Alert 4 ForceChat %3%  History 1 CancelSubPlot %plotid1% if# P%id%02 0 Alert 2>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1         Trigger0 .%id%_%plotid%_GoLoss LoseSubPlot %plotid%>
		nu2 <if= T2 0   if= V1 0 V= 1 1   XPV 100  AddRenown 1   SALVAGE   Alert 3   Trigger0 .%id%_%plotid%_GoWin WinSubPlot %plotid%>
		end <SetEncounterInactive %2%>

		Msg1 <You fought %name3% of \FACTION &EnemyFac .>
		Msg2 <Your reinforcements are here, as promised.>
		Msg3 <You have defeated %name3%'s lance.>
		Msg4 <You face a mecha force led by %name3% of \FACTION &EnemyFac .>

		sub
			team 1
			setally 3
			SetEnemy 2
			ParaX 5
			ParaY 10

			team 2
			name <Enemies>
			SetEnemy 1 3
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   if= p%id%03 0 else GoSmallDeploy WMecha 2 StoryDL 100>
			GoSmallDeploy <WMecha 2 StoryDL 60>
			ParaX 45
			ParaY 45

			team 3
			setally 1
			setenemy 2
			Deploy <if= PlotStatus %plotid% %id%  if# P%id%02 0   WMecha 3 StoryDL 60>
			ParaX 10
			ParaY 5
		end

		Persona 3
		special <UNLISTED>
		greeting <if= PlotStatus %plotid% %id% else %pop% Goto GoGreet>
		*GoGreet <*BattleChallenge GoThemeExpo na>
		*GoThemeExpo <*THEME_EXPO&Enemy na>
	end


Content
	name <Henchmen Battle>
	size 6
	desc <Fight some henchmen of the enemy NPC.>
	requires <*:CS_MechaEncounter ~&Raiders E:++ -E:A.--- &Secondary -!Md -!Hi -!Ex>

	% E1 is the outdoors scene where this encounter will be placed
	% E2 is the metascene to be used for this encounter

	% P%id%01 = Initialization Counter
	% P%id%02 = Have gained reinforcements
	% P%id%03 = Have gained decimation
	update <if= V%id%01 0 V= %id%01 1   SetPlotStatus %plotid1% %id1%>

	.%id1%_%plotid1%_GoReinforcements <P= %id%02 1>
	.%id1%_%plotid1%_GoDecimation     <P= %id%03 1>

	% SubPlot1 = Gain Advantage vs Raiders
	SubPlot1 <*:CS_GainAdvantageVsMecha&Reinforcements&Decimation>

	sub
		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1   TeamMonologue 2 1  History 2 CancelSubPlot %plotid1% if# P%id%02 0 Alert 3>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1         Trigger0 .%id%_%plotid%_GoLoss LoseSubPlot %plotid%>
		nu2 <if= T2 0   if= V1 0 V= 1 1   XPV 100  AddRenown 1   SALVAGE   Alert 4   Trigger0 .%id%_%plotid%_GoWin WinSubPlot %plotid%>
		end <SetEncounterInactive %2%>

		Msg1_1 <Look, it's \PC ! Whoever defeats \OPR 0 is going to be rewarded by \PERSONA &EnemyNPC !>
		Msg1_2 <>
		Msg1_3 <>
		Msg1_4 <>
		Msg1_5 <>
		Msg2 <You fought a group of \PERSONA &EnemyNPC 's henchmen.>
		Msg3 <Your reinforcements are here, as promised.>
		Msg4 <You have defeated the raiders.>

		sub
			team 1
			setally 3
			SetEnemy 2
			ParaX 5
			ParaY 10

			team 2
			SetEnemy 1 3
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   if= p%id%03 0 else GoSmallDeploy WMecha 2 StoryDL 150>
			GoSmallDeploy <WMecha 2 StoryDL 90>
			ParaX 45
			ParaY 45

			team 3
			setally 1
			setenemy 2
			Deploy <if= PlotStatus %plotid% %id%  if# P%id%02 0   WMecha 3 StoryDL 60>
			ParaX 10
			ParaY 5
		end
	end


Content
	name <You Haven't Won Yet>
	size 12
	desc <PC waels on Enemy's henchmen, Enemy shows up immediately to wael on PC.>
	requires <*:CS_MechaEncounter (E:M.pro|E:M.see) (E:A.---|E:A.sr_) -!Ne -&Secondary>
	changes <E:A>

	% E1 is the outdoors scene where this encounter will be placed
	% E2 is the metascene to be used for this encounter
	% E3 is the encounter for the second fight. Brutal!
	% E4 is the enemy
	% E5 is a secret- that there's an ambush waiting!
	Element3 <Prefab>
	Place3 <1>
	Element4 <Grab 1>
	Place4 <3 (Enemies)>
	Element5 <Prefab>

	% P%id%01 = Initialization Counter
	% P%id%02 = Decimation Counter
	% P%id%03 = Reinforcements Counter
	% P%id%04 = Learn Secret Counter

	update <if= P%id%01 0 P= %id%01 1   SetPlotStatus %plotid1% %id1%  SetPlotStatus %plotid2% %id2%  NPCLevel %4% StoryDL>

	.%id1%_%plotid1%_GoDecimation <P= %id%02 1>
	.%id1%_%plotid1%_GoReinforcements <P= %id%03 1>
	.%id2%_%plotid2%_GoLearnSecret <P= %id%04 1>


	% SubPlot1 is the Gain Advantage task
	% SubPlot2 is the Learn Secret task
	SubPlot1 <*:CS_GainAdvantageVsNPC&Decimation&Reinforcements 4>
	SubPlot2 <*:CS_LearnSecretAboutNPC 5 4>


	sub
		MetaScene 2 2
		% This first scene is a pretty easy fight. If the PC doesn't know that there
		% is going to be an ambush, all advantages will be spent here. Otherwise the
		% advantages will be spent in the second, tougher encounter.
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1   Alert 1  CancelSubPlot %plotid1%  CancelSubPlot %plotid2%  if= p%id%04 0 if# P%id%03 0 Alert 2>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1   Alert 4 History 4   Trigger0 .%id%_%plotid%_GoLoss LoseSubPlot %plotid%>
		nu2 <if= T2 0   if= V1 0 V= 1 1   XPV 100   SALVAGE   Alert 3   SetEncounterActive %3% Return>
		end <SetEncounterInactive %2%  if= p%id%04 0 if# P%id%03 0   Alert 5>

		Msg1 <You locate the raiders. This looks like it's going to be a pretty easy fight.>
		Msg2 <Your reinforcements are here, as promised.>
		Msg3 <You have defeated the henchmen... but where is %name4%?>
		Msg4 <You were defeated by %name4%'s henchmen.>
		Msg5 <Your reinforcements head off for repairs.>

		sub
			team 1
			setally 3
			SetEnemy 2
			ParaX 5
			ParaY 10

			team 2
			SetEnemy 1 3
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   if= p%id%04 0 else GoBigDeploy if# P%id%02 0 else GoBigDeploy   WMecha 2 StoryDL 60>
			GoBigDeploy <WMecha 2 StoryDL 90>
			ParaX 45
			ParaY 45

			team 3
			setally 1
			setenemy 2
			Deploy <if= PlotStatus %plotid% %id%  if= p%id%04 0 if# P%id%03 0   WMecha 3 StoryDL 60>
			ParaX 10
			ParaY 5
		end

		MetaScene 3 2
		% This second scene is much harder. The Enemy is here, along with a full
		% complement of guards... unless the PC managed to get both the advantage and
		% the secret, that is.
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		special <ARENA>
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1   Alert 1 Monologue %4% 2  History 4  if# p%id%04 0  PCMonologue 3>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1   Monologue %4% 5  History 6   Trigger0 .%id%_%plotid%_GoLoss LoseSubPlot %plotid%>
		nu2 <if= T2 0   if= V1 0 V= 1 1   XPV 100   SALVAGE   Alert 7 Monologue %4% 8  History 9  SetXXRAttitude %4% XXR_A_IsEqual  Trigger0 .%id%_%plotid%_GoWin  WinSubPlot %plotid%>
		end <SetEncounterInactive %3% ifNPCDead %4% Print 10>

		Msg1 <Without warning, you are attacked by %name4%!>
		Msg2 <My associates have failed one too many times, \PC . Now I'll finish you myself.>
		Msg3 <Fortunately I saw this coming.>
		Msg4 <After defeating \PPR %4% lance, %name4% appeared to fight you personally.>
		Msg5 <It appears that you aren't so great after all.>
		Msg6 <You were defeated by %name4%.>
		Msg7 <You have defeated %name4% and all of \PPR %4% lancemates.>
		Msg8 <It appears that I was wrong about you, \PC ... You are a worthy adversary. I look forward to our next battle.>
		Msg9 <You defeated %name4%, earning \PPR %4% respect.>
		Msg10 <After the battle, you notice that %name4%'s cockpit is mysteriously empty.>

		sub
			team 1
			setally 3
			SetEnemy 2
			ParaX 5
			ParaY 10

			team 2
			name <Enemies>
			SetEnemy 1 3
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   if= p%id%04 1 else GoBigDeploy if# P%id%02 0 else GoBigDeploy   WMecha 2 StoryDL 40>
			GoBigDeploy <WMecha 2 StoryDL 100>
			ParaX 45
			ParaY 45

			team 3
			setally 1
			setenemy 2
			Deploy <if= PlotStatus %plotid% %id%  if= p%id%04 1 if# P%id%03 0   WMecha 3 StoryDL 60>
			ParaX 10
			ParaY 5
		end

	end
	inv
		STC CORE-MECHAAMBUSH-ACTIVATABLE
		name <Surprise Ambush>

		Secret
		Msg <%name4% has been watching you; \SPR %4% 's not going to let you get away this time.>
	end


Content
	name <You Can't Stop Me>
	size 2
	desc <Enemy NPC taunts PC, then leaves to complete some mission.>
	requires <*:CS_MechaEncounter E:++ E:A.nme -&Secondary>
	changes <E:A>

	% E1 is the outdoors scene where this encounter will be placed
	% E2 is the metascene to be used for this encounter
	% E3 is the enemy
	Element3 <Grab 1>
	Place3 </>

	% This subplot must propgate the effects of its own subplot backwards to
	% the parent plot. Yahoo.
	.%id1%_%plotid1%_GoWin  <Trigger0 .%id%_%plotid%_GoWin>
	.%id1%_%plotid1%_GoLoss <Trigger0 .%id%_%plotid%_GoLoss>

	% SubPlot1 = The enemy mission you have to stop
	SubPlot1 <*:CS_StopNPCMission&IsEnemyNPC&Secondary 3>

	sub
		Persona 3
		special <Unlisted>
		greeting <if= PlotStatus %plotid% %id% else GoChat EndChat Say %id%01 AddCHat %id%01>
		GoChat <NewChat SayAnything>
		result%id%01 <EndCHat Say %id%02 Print %id%03>
		Msg%id%01 <\PC , so we finally meet. I am %name3%. I understand that you gave my men some trouble back there.>
		Msg%id%02 <I'd advise you to not meddle in my affairs again. I've got a mission to complete and no insignificant worm like yourself is going to stand in my way. Here's a small taste of what you can expect should we happen to meet again.>
		Msg%id%03 <%name3% leaves the area.>
		Prompt%id%01 <No, I gave them a lot of trouble.>

		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 30
		MapHeight 30

		% Whether you win or lose this fight isn't important. Of course, there are some benefits
		% to winning... The timer starts from the conclusion of the fight, because I can be just
		% as cruel to my NPCs as I am to the PC.
		Start <if= L2 0 L= 2 1   ForceChat %3%  StoryNote 1   SetXXRAttitude %3% XXR_A_IsSenior>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1   AddRenown -1  SetPlotStatus %plotid1% %id1%>
		nu2 <if= T2 0   if= V1 0 V= 1 1   XPV 100  AddRenown 1   SALVAGE   Alert 2   SetPlotStatus %plotid1% %id1%>
		end <SetEncounterInactive %2% CancelSubPlot %plotid%>

		Msg1 <You fought %name3%'s lancemates, while \SPR %3% left to complete a mission.>
		Msg2 <You defeated %name3%'s lancemates, but where did \SPR %3% go?>

		sub
			team 1
			SetEnemy 2
			ParaX 5
			ParaY 5

			team 2
			SetEnemy 1
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   WMecha 2 StoryDL 100>
			ParaX 25
			ParaY 25
		end
	end

Content
	name <Learn of Enemy Leader>
	size 6
	desc <Fight some raiders; learn the identity of their leader, who isn't present.>
	requires <*:CS_MechaEncounter &Raiders E:-->
	changes <E:++>

	% E1 is the outdoors scene where this encounter will be placed
	% E2 is the metascene to be used for this encounter
	% E3 is the new enemy
	Element3 <NewNPC -2 -7>
	Place3 </>

	% P%id%01 = Initialization Counter
	% P%id%02 = Have gained reinforcements
	update <if= V%id%01 0 V= %id%01 1   SetPlotStatus %plotid1% %id1%>

	.%id1%_%plotid1%_GoReinforcements <P= %id%02 1>

	% SubPlot1 = Gain Advantage vs Raiders
	SubPlot1 <*:CS_GainAdvantageVsMecha&Reinforcements>

	sub
		MetaScene 2 2
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1   Alert 1  TeamMonologue 2 2   SetXXRAttitude %3% XXR_A_NeverMet  StoryNote 3   &SetEnemyNPC %3%  CancelSubPlot %plotid1% if# P%id%02 0 Alert 6>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1   Alert 4   Trigger0 .%id%_%plotid%_GoLoss>
		nu2 <if= T2 0   if= V1 0 V= 1 1   XPV 100  AddRenown 1   SALVAGE   Alert 5   Trigger0 .%id%_%plotid%_GoWin>
		end <SetEncounterInactive %2%>

		Msg1 <You locate the group of raiders that you've been searching for.>
		Msg2_1 <Huh, who's this? Another challenger for %name3%, I guess... \SPR %3% 's not here right now, but the rest of us should be able to handle you just fine.>
		Msg2_2 <>
		Msg2_3 <>
		Msg2_4 <>
		Msg2_5 <>
		Msg3 <You fought the raiders, but their leader %name3% wasn't present.>
		Msg4 <If the raiders were capable of this by themselves, you're probably lucky that %name3% wasn't with them.>
		Msg5 <You have defeated the raiders, but their leader %name3% is nowhere to be found.>
		Msg6 <Your reinforcements are here, as promised.>

		sub
			team 1
			setally 3
			SetEnemy 2
			ParaX 5
			ParaY 10

			team 2
			SetEnemy 1 3
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   WMecha 2 StoryDL 150>
			ParaX 45
			ParaY 45

			team 3
			setally 1
			setenemy 2
			Deploy <if= PlotStatus %plotid% %id%  if# P%id%02 0   WMecha 3 StoryDL 60>
			ParaX 10
			ParaY 5
		end
	end



