%%
%% *CS_AmbushEncounter Content
%%
%% The PC will get jumped as soon as he enters a particular location.
%%
%% The parent plot sets the plot status to this layer's ID when ready.
%%
%% Param1: The outdoor scene where the encounter will take place
%%
%% NEEDED SCRIPTS: To deal with the ending, the parent plot must define two
%% scripts:
%% 	.%id%_%plotid%_GoWin
%% 	.%id%_%plotid%_GoLose
%% %id% is the ID of the encounter layer; so, if it was generated as subplot 1,
%% the calling plot would use %id1%.
%% Please note that it is possible this component will not exit to either of
%% the above labels, if a complete derailment of the story takes place.

Plot
	name <Generic Ambush>
	size 5
	desc <Fight some generic mecha belonging to the enemy faction.>
	requires <*CS_AmbushEncounter>

	% E1: The outdoor scene
	% E2 is the combat scene
	Element2 <Prefab>
	Place2 <1>

	Start <if= PlotStatus %plotid% %id% else %pop% if= SceneID %1% else %pop% Alert %id%01 Exit %2% Goto %pop%>
	Msg%id%01 <You are suddenly attacked by mecha!>

	sub
		MetaScene 2 2
		rumor%id% <there's been fighting in %name1%.>
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		MapWidth 30
		MapHeight 30

		nu1 <if= T1 0   Return   if= V1 0 V= 1 1   Trigger0 .%id%_%plotid%_GoLose>
		nu2 <if= T2 0   if= V1 0 V= 1 1            XPV 100   AddRenown 1  Salvage   Trigger0 .%id%_%plotid%_GoWin>

		sub
			team 1
			SetEnemy 2
			ParaX 5
			ParaY 5

			team 2
			SetEnemy 1
			Deploy <SetSelfFaction &EnemyFac   WMecha 2 StoryDL 100>
			ParaX 25
			ParaY 25
		end
	end
	inv
		STC CORE-MECHAAMBUSH
		name <Surprise Ambush>
	end

%% *CS_MechaRetribution Content
%%
%% The PC is about to fight some mecha who have apparently earned an
%% arse-kicking. This component is responsible for launching its own
%% conclusion.
%%
%% The parent plot sets the plot status to this layer's ID when ready.
%%
%% Param1: The Mission Provider
%% Param2: The outdoor scene where the fight will take place
%%

Content
	name <Normal Retribution>
	size 5
	desc <You fight the mecha you were sent after, with no incident.>
	requires <*CS_MechaRetribution>

	% E1: The Mission Provider
	% E2: The outdoor scene where the fight will take place
	% E3 is the combat scene
	Element3 <Prefab>
	Place3 <2>

	% SubPlot1 = Win the battle, get a reward
	% SubPlot2 = Lose the battle, get scorned
	SubPlot1 <*CS_Win_MechaRetribution 1>
	SubPlot2 <*CS_CALoseMission 1>

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

		Start <if= L2 0 L= 2 1 SMemo 1 History 2>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1   SetPlotStatus %plotid% %id2%>
		nu2 <if= T2 0   if= V1 0 V= 1 1            XPV 100   AddRenown 1  Salvage   SetPlotStatus %plotid% %id1%>

		Msg1 <After fighting some mysterious mecha you should report back to %name1%.>
		Msg2 <You fought a group of mysterious mecha.>
		.next <+T-->

		sub
			team 1
			SetEnemy 2
			ParaX 5
			ParaY 5

			team 2
			SetEnemy 1
			Deploy <SetSelfFaction &EnemyFac   WMecha 2 StoryDL 100>
			ParaX 25
			ParaY 25
		end
	end
	inv
		STC CORE-MECHAENCOUNTER
	end



