%% *:CS_StopNPCMission Content
%%
%%	&IsEnemyNPC	The character to be stopped is the enemy NPC
%%	&Secondary	Is a secondary combat; disallow this tag if calling
%%			a second main course subplot
%%
%% Somebody is going on a mission. It's the PC's job to locate that
%% person and stop them from completing the mission. Most of these
%% components are timed- if the PC doesn't discover and halt the mission
%% in time, it counts as a loss.
%%
%% This subplot may alter the story context.
%%
%% 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. Favored by: POLIC
%%
%%
%%  Param1: The NPC to be stopped
%%

Content
	name <In It For The Money>
	% desc <The enemy NPC? In it for the money.>
	desc <敵の NPC？ 金稼ぎ中。>
	requires <*:CS_StopNPCMission &IsEnemyNPC E:M.--- -E:A.nme F:P.art -F:POLIC I:++ ~+Gmo>
	changes <E:M>
	Size 8

	% E1 is the NPC to be stopped
	% E2 is an outdoor scene for the encounter
	% E3 is the encounter itself
	% E4 is the core story item
	Element2 <Scene Outdoors !Near -7>
	Element3 <Prefab>
	Place3 <2>
	Element4 <Grab 8>

	HINT_%id% <:%id1%>

	% P%id%01 = Initialization Counter
	% P%id%02 = Decimation Counter
	% P%id%03 = Reinforcements Counter

	%% FAIL CONDITIONS
	%% - SubPlot1 (DiscoverNPCMission) Lost

	update <if= P%id%01 0 P= %id%01 1   SetPlotStatus %plotid1% %id1% SetPlotStatus %plotid2% %id2%    NPCLevel %1% StoryDL  MoveNPC %1% %3%  SetNPCTeam %1% 4>
	end <ifSubPlotLost %plotid1% CancelSubPlot %plotid2% LoseSubPlot %plotid% Trigger0 .%id%_%plotid%_GoLoss>

	.%id2%_%plotid2%_GoDecimation <P= %id%02 1>
	.%id2%_%plotid2%_GoReinforcements <P= %id%03 1>

	%% SubPlot1 = Discover the NPC's mission
	%% SubPlot2 = Gain advantage vs NPC
	SubPlot1 <*:CS_DiscoverNPCMission&EnemyNPC&Searching 2 3 1>
	SubPlot2 <*:CS_GainAdvantageVsNPC&Decimation&Reinforcements 1>

	sub
		MetaScene 3 2
		%% This battle starts with an offer from the enemy: switch sides and
		%% share the wealth.
		% L1 = Encounter Over Counter
		% L2 = Initialization Counter
		special <ARENA>
		MapWidth 50
		MapHeight 50

		Start <if= L2 0 L= 2 1   ForceChat %1%   CancelSubPlot %plotid2%>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1   Monologue %1% 1  FreezeNPC %1%  History 2   Trigger0 .%id%_%plotid%_GoLoss LoseSubPlot %plotid%>
		nu2 <if= T2 0   if= V1 0 V= 1 1  ifG t4 0 else GoOddWin  Monologue %1% 4 Alert 5 Retreat 4  Goto GoWinMission>
		nu4 <if= T4 0   if= V1 0 V= 1 1  ifG t2 0 else GoOddWin  TeamMonologue 2 7 Alert 8 Retreat 2  Goto GoWinMission>

		GoOddWin <Alert 3 Goto GoWinMission>
		GoWinMission <Alert 6 History 6  XPV 100   SALVAGE   Trigger0 .%id%_%plotid%_GoWin  WinSubPlot %plotid%>

		end <SetEncounterInactive %3%>

		% Msg1 <Such a shame... You should have taken me up on that offer while you had the chance.>
		% Msg2 <You were defeated by %name1%.>
		% Msg3 <You have defeated all of %name1%'s forces.>
		% Msg4 <It would seem that you have the advantage today... It's not worth it to keep fighting.>
		% Msg5 <%name1% flees the battlefield.>
		% Msg6 <You defeated %name1%'s lance.>
		% Msg7 <%name1% is down! Let's get the blazes out of here!>
		% Msg8 <%name1%'s lancemates flee the battlefield.>
		Msg1 <愚かな話%JV_M_DA%JV_F_NE……大人しく%JF2の提案を受け入れておけばよかったものを。>
		Msg2 <%name1% に敗北した。>
		Msg3 <%name1% の仲間をすべて撃破した。>
		Msg4 <今日は%JS_AGGに利があるよう%JV_M_DA%JV_NA……これ以上続けても割に合わない%JV_F_WA。>
		Msg5 <%name1% は戦場から逃げていった。>
		Msg6 <%name1% の部隊を撃破した。>
		Msg7 <%name1% がやられた%JV_ZO！ すぐにここから撤退%JG_DA！>
		Msg8 <%name1% の仲間は戦場から逃げていった。>

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

			team 2
			name <Enemies>
			SetEnemy 1 3
			SetAlly 4
			Deploy <if= PlotStatus %plotid% %id% SetSelfFaction &EnemyFac   if# P%id%02 0 else GoBigDeploy   WMecha 2 StoryDL 60>
			GoBigDeploy <WMecha 2 StoryDL 120>
			ParaX 45
			ParaY 45

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

			team 4
			name <Boss>
			SetEnemy 1 3
			SetAlly 4
			ParaX 45
			ParaY 45
		end

		Persona 1
		special <UNLISTED NOESCAPE>
		% V1 = First time counter
		greeting <if= PlotStatus %plotid% %id% else GoChat if= V1 0 else GoChat EndChat Say 1 AddChat 1 History 2 SetXXRMotivation %1% XXR_M_Mercenary V= 1 1>
		GoChat <NewChat SayAnything>
		result1 <EndChat Say 3 AddChat 2 AddChat 3 AddChat 4>
		result2 <EndChat Say 4 AddChat 5 AddChat 6>
		result3 <EndChat Say 6 AddChat 7 History 10>
		result4 <AddEasygoing -d8 Goto result3>
		result5 <Goto result3>
		result6 <EndChat Say 8 SMemo 0 L= 1 1 Return History 9 CashPrize Reward StoryDL 500 CustomMecha .fac StoryDL XPV 100  PCFEnemy &AllyFac &SetAllyFac &EnemyFac SetPCFac &EnemyFac &SetEnemyFac 0 PCAlly %1% AddLancemate %1% PyrrhicWinEpisode Retreat 2 Retreat 3>
		.fac <GENERAL \FACTION_DESIG &EnemyFac>
		*result7 <*THEME_EXPO&Enemy na>
		% Msg1 <Let me guess, you came here to stop me? Too late. I've already determined that the %name4% isn't in \SCENE RootSceneID .>
		% Msg1_1 <You're really a persistant one, aren't you? If you're here to stop me then you're going to be disappointed since I've already completed my mission.>
		% CMsg1_1 <ifNPCSociable Accept>
		% Msg1_2 <Oh, it's you. You're late, I've already finished my mission.>
		% CMsg1_2 <ifNPCShy Accept>
		% Msg1_3 <>
		% CMsg1_3 <ifNPCCheerful Accept>
		% Msg1_4 <Late again, \PC - I've already determined that the %name4% isn't in \SCENE RootSceneID .>
		% CMsg1_4 <ifNPCMelancholy Accept>
		% Msg1_5 <You're too late to stop me... not that I actually managed to accomplish anything. The %name4% isn't in \SCENE RootSceneID .>
		% CMsg1_5 <ifNPCEasygoing Accept>
		% Msg1_6 <>
		% CMsg1_6 <ifNPCPassionate Accept>
		% Msg2 <You met %name1%, who offered you a chance to join \FACTION &EnemyFac .>
		% Msg3 <You know, the %name4% is worth an awful lot of money to \FACTION &EnemyFac . We could use someone like you on our side. I can guarantee that we pay more than whoever's footing your bills right now.>
		% Msg4 <To start with, you'll get a brand new custom mecha and an equipment allowance. Afterwards you'll have access to our secret base, training facilities, dental plan... and when we find the %name4%, we can split the reward.>
		% gh2-0628r673 にて、Msg5, Msg5_1, Msg7, Msg7_1 は削除された。
		% Msg5 <Don't do it, \PC ; it could be a trap!>
		% Msg5_1 <Don't do it, \PC ; some things in life are worth more than money!>
		% Msg6 <If you aren't with us, that means you're against us. I guess you know what that means...>
		% Msg7 <I don't want any part of this...>
		% Msg7_1 <I guess this is where we part ways, \PC ...>
		% Msg8 <Welcome to \FACTION &EnemyFac .>
		% Msg9 <You accepted %name1%'s offer.>
		% Msg10 <You rejected the offer.>
		% Prompt1 <[Continue]>
		% Prompt2 <Hmm... That does sound tempting.>
		% Prompt3 <Forget it. I've got some standards.>
		% Prompt4 <I'll never join you! Never!!!>
		% Prompt5 <I think I'd rather not.>
		% Prompt6 <Sign me up!>
		% Prompt7 <[Continue]>
		Msg1 <まさか、%JS_AGGは%JF2を邪魔しに来たの%JV_KA_Q？ 遅すぎた%JG_NE。もう \SCENE RootSceneID に %name4% が存在しないことは確認済み%JG_DAYO。>
		Msg1_1 <%JS_AGG、かなりしつこいタイプ%JV_DAROU？ もし%JF2の邪魔をしに来たつもりなら、残念だった%JG_NE%JV_SIL_Rもう目的は済んだ後%JG_DAYO。>
		CMsg1_1 <ifNPCSociable Accept>
		Msg1_2 <ああ、%JS_AGGなの%JV_KA_Q%JV_SIL。遅かった%JG_NE%JV_SIL_Rもう仕事は終わってる%JG_YO。>
		CMsg1_2 <ifNPCShy Accept>
		Msg1_3 <>
		CMsg1_3 <ifNPCCheerful Accept>
		Msg1_4 <また遅刻したの%JV_KA_Q、\PC。もう \SCENE RootSceneID に %name4% が存在しないことは確認済み%JG_DAYO。>
		CMsg1_4 <ifNPCMelancholy Accept>
		Msg1_5 <邪魔しに来たなら遅すぎた%JG_NE%JV_SIL_Rまあこっちも成果があったわけじゃない%JG_GA。%name4% は \SCENE RootSceneID には存在しない%JG_YO。>
		CMsg1_5 <ifNPCEasygoing Accept>
		Msg1_6 <>
		CMsg1_6 <ifNPCPassionate Accept>
		Msg2 <%name1% と遭遇し、\FACTION &EnemyFac への加入を提案された。>
		Msg3 <知っている%JV_DAROU、%name4% は \FACTION &EnemyFac に莫大な利益をもたらす%JG_NDA。%JS_AGGは敵にしておくのは惜しい……%JF2%JF_TACHIと共に来れば、今の雇い主よりも多くの報酬を与えることを保証し%JV_YOU。>
		Msg4 <まず手始めに、%JS_AGGには新しいカスタムメック１台と装備品の支給がある。それから%JF2%JF_TACHIの秘密基地、訓練施設、歯医者の利用権……そして %name4% を手に入れた暁には、報酬を山分けし%JV_YOU。>
		Msg5 <駄目%JV_M_DA%JV_F_YO \PC、罠かもしれない%JV_ZO！>
		Msg5_1 <駄目%JV_M_DA%JV_F_YO \PC、世の中には金よりも大事なことがある%JV_ZO！>
		Msg6 <協力する気がないのなら、それは%JF2%JF_TACHIの敵であるということ%JG_DA。どういうことかは分かっている%JV_DAROU……。>
		Msg7 <%JF2には付いていけない%JV_F_WA……。>
		Msg7_1 <ここでお別れみたい%JV_M_DA%JV_NA、\PC ……。>
		Msg8 <ようこそ \FACTION &EnemyFac へ……。>
		Msg9 <%name1% の提案を受け入れた。>
		Msg10 <あなたはその提案を断った。>
		Prompt1 <[続ける]>
		Prompt2 <むむ……それは魅力的な……。>
		Prompt3 <無駄%JG_DA。一線は弁えてるつもりだから%JV_NA%JV_SIL。>
		Prompt4 <絶対に入らない%JV_F_WA！ 絶対に%JV_M_DA%JV_F_YO！！！>
		Prompt5 <遠慮しておく%JG_YO。>
		Prompt6 <その話、乗った%JV_F_WA！>
		Prompt7 <[続ける]>
	end
	inv
		stc CORE-ACTIVATABLE
		name <%name1%'s Lance>
		name_I18N <%name1% の部隊>
	end

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

Content
	name <Testing Destiny>
	% desc <The enemy believes that the PC is their soul-foe, destined to destroy one another for eternity.>
	desc <敵は PC が魂の宿敵、永遠の殺し合いを運命付けられた相手だと信じ込んでいる。>
	requires <*:CS_StopNPCMission &IsEnemyNPC (E:A.hat|E:A.mut) (E:M.---|E:M.rev|E:M.nih) F:++ -!Ne -!Lo -&Secondary>
	changes <E:A>
	Size 10

	% E1 is the NPC to be stopped
	% E2 is an outdoors scene for the first McGuffin encounter
	% E3 is the McGuffin encounter
	% E4 is the enemy faction
	Place1 </>
	Element2 <Scene Outdoors !Near -7>
	Element3 <Prefab>
	Place3 <2>
	Element4 <Grab 2>

	HINT_%id% <:%id2%>

	% P%id%01 = Initialization Counter

	%% FAIL CONDITIONS:
	%% - Reveal Encounter (SP2) fails
	%% - Either of the two combats are lost

	% At the beginning, activate the McGuiffin encounter and its locator.
	update <if= P%id%01 0 P= %id%01 1 SetPlotStatus %plotid1% %id1% SetPlotStatus %plotid2% %id2%>
	end <ifSubPlotLost %plotid2% CancelSubPlot %plotid1% Goto .%id%_GoLoseMission>
	.%id%_GoLoseMission <LoseSubPlot %plotid% Trigger0 .%id%_%plotid%_GoLoss>

	% Failure in either of the sub-missions results in the failure of the main mission.
	.%id1%_%plotid1%_GoLoss <Goto .%id%_GoLoseMission>
	.%id2%_%plotid2%_GoLoss <Goto .%id%_GoLoseMission>

	.%id1%_%plotid1%_GoWin <ForceChat %1% SMemo %id%01 History %id%02 SetXXRAttitude %1% XXR_A_Obsession   SetPlotStatus %plotid3% %id3%>
	.%id3%_%plotid3%_GoWin <Monologue %1% %id%03 History %id%04                                            WinSubPlot %plotid% Trigger0 .%id%_%plotid%_GoWin>

	% Msg%id%01 <%name1% challenged you to stop \OPR %1% from attacking a location in town; \SPR %1% did not appear to be acting rationally.>
	% Msg%id%02 <%name1% challenged you to stop \OPR %1% .>
	% Msg%id%03 <Just as I thought... You really are my soul-foe. We are destined to die in each other's arms, just as we have countless times through eternity... But do not despair. Our final battle approaches shortly.>
	% Msg%id%04 <%name1% claimed that you are soul-foes, destined to kill one another.>
	Msg%id%01 <%name1% は\SPR %1%が市街の一角を攻撃するのを阻止してみろとあなたに告げた。\SPR %1%の行動は支離滅裂であるように思える。>
	Msg%id%02 <%name1% は自分の計画を止めてみろとあなたを煽り立てた。>
	Msg%id%03 <思った通り%JV_M_DA%JV_F_NE……%JS_AGGこそが%JF2の魂の宿敵%JV_M_DA%JV_F_YO。%JF2%JF_TACHIは互いの腕の中で死に続けることを運命付けられている%JG_NDA%JV_SIL_Rこれまでもずっと、永劫の時の中で繰り返してきたように%JV_NA。だ%JG_GA嘆くことはない%JV_ZO、最後となる戦いは刻々と近づいているのだから……。>
	Msg%id%04 <%name1% はあなたが魂の宿敵であり、互いに殺し合うことを運命付けられていると主張した。>

	% SubPlot1 is a McGuffin combat encounter used to set up the rest of the plot
	% SubPlot2 is the task to reveal the above encounter
	% SubPlot3 is the attack the PC must prevent
	SubPlot1 <*:CS_MechaEncounter&Secondary 2 3>
	SubPlot2 <*:CS_DiscoverNPCMission&EnemyNPC 2 3 1>
	SubPlot3 <*:CS_StopAttack 4>

	sub
		Persona 1
		special <UNLISTED>
		greeting <if= PlotStatus %plotid% %id% else %pop% EndChat Say %id%01 AddChat %id%01 AddChat %id%02>
		result%id%01 <EndChat Say %id%02>
		result%id%02 <EndChat Say %id%02>
		% Msg%id%01 <I knew that this diversion would bring you here, \PC ... Do you believe in destiny? I've designed a test so that we can find out whether or not it exists.>
		% Msg%id%02 <In just a few short hours I intend to destroy something, something very big. If you are fated to be my soul-foe then you will prove yourself to me. If you die trying, well, it was never meant to be...>
		% Prompt%id%01 <Shut up, I'm in no mood for your games.>
		% Prompt%id%02 <What the blazes are you talking about!?>
		Msg%id%01 <こうすれば%JS_AGGが現れると分かっていた%JV_ZO、\PC ……%JS_AGGは運命というものを信じる%JV_Q？ それが本当に存在するのか、%JF2はそれを確かめるためのテストを用意した%JG_SK。>
		Msg%id%02 <あと数時間ほど後に、%JF2はあるものを破壊する……とても大きなものを%JV_NA。もし%JS_AGGが%JF2の魂の宿敵であるのなら、%JS_AGGは自分自身を証明しなければならない%JV_F_NO。もしその過程で死んだのなら……そう、それは元から別人だったということな%JG_NDA。>
		Prompt%id%01 <うるさい%JV_F_WA、%JS_AGGの遊びに付き合う気分じゃない%JG_NDA。>
		Prompt%id%02 <いったい何を言ってる%JG_NDA！？>
	end
	inv
		stc CORE-ACTIVATABLE
		name <%name1%'s Lance>
		name_I18N <%name1% の部隊>
	end

Content
	name <Friends are fair game>
	% desc <The enemy NPC kidnaps one of the PC's friends to torture for information.>
	desc <敵 NPC が拷問で情報を得るために PC の友人を誘拐する。>
	requires <*:CS_StopNPCMission &IsEnemyNPC E:A.hat (E:M.---|E:M.mer|E:M.com|E:M.rev|E:M.nih) -!Ne ~E:evil_ -E:good_>
	changes <E:A>
	Size 8

	% E1 is the NPC to be stopped
	% E2 is an urban scene for the base
	% E3 is the base
	% E4 is the friend
	% E5 is the friend's stand-in, a VICTIM prop
	% E6 is a local hospital scene
	% E7 is the secret
	Element2 <Scene Urban !Near -7>
	Element3 <Prefab>
	Place3 <2>
	Element4 <Character (Friend|Family|Lover)  !Xclude 1  !Global (@:A.---|@:A.jr_|@:A.sr_|@:A.ant)>
	Place4 </>
	Element5 <Prefab>
	Place5 <3>
	Element6 <Scene Hospital !Near -7>
	Element7 <Prefab>

	HINT_%id% <:%id1%>

	%% FAIL CONDITIONS
	%% - TellSecret fails
	%% - RevealEncounter fails

	% P%id%01 = Initialization Counter
	% P%id%02 = Time Limit
	% P%id%03 = Gain peaceful entry counter

	start <ifSubPlotLost %plotid1% else .%id%_GoCheckSP2   LoseSubPlot %plotid%   Trigger0 .%id%_%plotid%_GoLoss>
	.%id%_GoCheckSP2 <ifSubPlotLost %plotid2% DeleteNPC %4% History %id%01    LoseSubPlot %plotid%   Trigger0 .%id%_%plotid%_GoLoss>

	% At first, start the Tell Secret subplot.
	update <if= p%id%01 0 p= %id%01 1 SetPlotStatus %plotid1% %id1%>

	% When the secret is revealed set the timer and start the Reveal Base subplot.
	% Oh, and change the attitude to mutual hatred. Can't forget that.
	.%id1%_%plotid1%_GoLearnSecret <if= p%id%02 0 P= %id%02 ComTime P+ %id%02 86400  SetPlotStatus %plotid2% %id2%  SetPlotStatus %plotid3% %id3%  SMemo %id%02 History %id%03 SetXXRAttitude %1% XXR_A_MutualHate PCEnemy %1%>

	% If the PC gains peaceful entry, that's a good thing.
	.%id3%_%plotid3%_GoPeacefulEntry <P= %id%03 1>

	% Msg%id%01 <You failed to rescue %name4%.>
	% Msg%id%02 <%name1% has kidnapped %name4%; \SPR %1% is likely planning to torture \OPR %4% for information about you.>
	% Msg%id%03 <You learned that %name1% kidnapped %name4%.>
	Msg%id%01 <%name4% の救出に失敗した。>
	Msg%id%02 <%name1% が %name4% を誘拐した。おそらく拷問によりあなたの情報を聞き出すつもりだ。>
	Msg%id%03 <%name1% が %name4% を誘拐したことを知った。>

	% SubPlot1 is the FindSecret: this one starts the timer and the rest of the plot.
	% SubPlot2 is the locate base task
	% SubPlot3 is the peaceful entry task
	SubPlot1 <*:CS_TellSecretAboutNPC&LearnPlans&IsEnemy 7 1>
	SubPlot2 <*:CS_RevealEncounter_NPCBase&EnemyNPC&Kidnapping 2 3 1>
	SubPlot3 <*:CS_PeacefulEntry_NPCBase 3 1>

	sub
		MetaScene 3
		mapwidth 35
		mapheight 35
		MonkeyMap
		LockedDoorChance 10
		SecretDoorChance 5
		IndustrialTiles

		NeededCells 3

		% L1 = Friend has died

		start <Print 1 CancelSubPlot %plotid3% ifG P%id%03 0 TeamNeutral 2>
		end <if# L1 0 else GoCheckWin   History 2   LoseSubPlot %plotid%   Trigger0 .%id%_%plotid%_GoLoss   DeleteNPC %4%  SetEncounterInactive %3%>
		GoCheckWin <ifSubPlotWon %plotid%   SetEncounterInactive %3%>

		% If the PC attacks at all after gaining peaceful entry, the guards will become
		% hostile again.
		PCAttack <ifG P%id%03 0 P= %id%03 0 Alert 3 TeamAttack 2>

		% Msg1 <You enter %name1%'s base.>
		% Msg2 <You didn't arrive quickly enough to save %name4%.>
		% Msg3 <Suddenly, an alarm sounds!>
		Msg1 <%name1% の基地に入った。>
		Msg2 <あなたが辿り着いた時には、%name4% はもう手遅れだった。>
		Msg3 <突然、警報が鳴り響いた！>

		sub
			Team 1
			SetEnemy 2 3

			Team 2
			name <Guards>
			type <SYNTH ROBOT MILITARY>
			SetEnemy 1
			Deploy <if= V1 0 V= 1 1 MonsterUp 2 StoryDL>

			Team 3
			name <First Monsters>
			home <Entry Grid>
			type <SYNTH ROBOT MILITARY>
			SetEnemy 1
			Deploy <if= V1 0 if= P%id%03 0 V= 1 1 WMonster 3 StoryDL 50>

			room
			name <Entry Grid>
			name_I18N <入口>
			special <STARTHERE>
			sub
				TrapDoor
				Destination -1
				use <Print 1 Return>
			end

			room
			desig <HOME %e5%>
			minimap <......###..#1=..###......>
		end

		Persona 4
		special <UNLISTED>
		greeting <EndChat Say 1>
		% Msg1 <I don't feel well enough to talk just yet.>
		Msg1 <まだ話のできる気分じゃない%JV_N%JV_M_DA……。>
	end
	inv
		STC CORE-ACTIVATABLE-STATIONARY-DEFENDED
		name <Secret Base>
		name_I18N <秘密基地>

		STC VICTIM
		name <%name4%>
		name_I18N <%name4%>
		use <ifG P%id%02 ComTime else GoFriendDied Goto GoSaveFriend>
		GoFriendDied <Alert 1 L= 1 1>
		CLUE_MEDICINE <Goto GoSaveFriend>
		Pass -100
		GoSaveFriend <Alert 2 History 3 XPV 100 Return MoveNPC %4% %6%  SetXXRAttitude %4% XXR_A_Thankful WinSubPlot %plotid% Trigger0 .%id%_%plotid%_GoWin>
		% Msg1 <You've arrived too late. %name4% shows no sign of life.>
		% Msg2 <You tend to %name4%'s wounds and quickly bring \OPR %4% to the hospital.>
		% Msg3 <You rescued %name4% from %name1%'s base.>
		Msg1 <遅すぎたようだ。%name4% は生きている気配がない。>
		Msg2 <%name4% に応急処置を施し、急いで病院へと搬送した。>
		Msg3 <%name1% の基地から %name4% を救出した。>

		Secret
		% Msg <%name1% has captured %name4%. As far as I know, it's because \SPR %1% wants to learn about your weaknesses.>
		Msg <%name1% が %name4% を誘拐した%JG_NDA。知る限りだと、%JS2の弱点を探ろうとしてのことらしい%JG_YO。>
	end


Content
	name <Mecha Encounters are the foundation of our democracy>
	% desc <Call a mecha encounter, but by another way>
	desc <敵メック部隊を呼び出すための別のやり方>
	requires <*:CS_StopNPCMission &Secondary &IsEnemyNPC>

	% E1 is the NPC to be stopped
	% E2 is an outdoors scene
	% E3 is an encounter for the mecha encounter
	Element2 <Scene Outdoors !Near -7>
	Element3 <Prefab>
	Place3 <2>

	HINT_%id% <:%id2%>

	%% FAIL CONDITIONS
	%% - DiscoverNPCMission fails

	% P%id%01 = Initialization Counter
	update <if= P%id%01 0 P= %id%01 1 SetPlotStatus %plotid1% %id1% SetPlotStatus %plotid2% %id2%>
	end <ifSubPlotLost %plotid2% LoseSubPlot %plotid% LoseSubPlot %plotid1% Trigger0 .%id%_%plotid%_GoLoss>

	% Pass the results of the mecha encounter backwards to whatever subplot called this one.
	.%id1%_%plotid1%_GoWin  <WinSubPlot %plotid%  Trigger0 .%id%_%plotid%_GoWin>
	.%id1%_%plotid1%_GoLoss <LoseSubPlot %plotid% Trigger0 .%id%_%plotid%_GoLoss>

	% SubPlot1 is the mecha encounter
	% SubPlot2 is the DiscoverNPCMission task
	SubPlot1 <*:CS_MechaEncounter&Raiders&Secondary 2 3>
	SubPlot2 <*:CS_DiscoverNPCMission&EnemyNPC&GatheringForces 2 3 1>

	inv
		stc CORE-ACTIVATABLE
		name <%name1%'s Forces>
		name_I18N <%name1% の部隊>
	end

Content
	name <Mix Encounters are the foundation of our technocracy>
	%% Based on the above component, but different.
	% desc <Use a mix encounter for the Enemy's mission>
	desc <MIX 系のスクリプトを用いての敵ミッションの定義>
	requires <*:CS_StopNPCMission &IsEnemyNPC E:++ ~F:++ ~P:++ -&Beancounter>

	% E1 is the NPC to be stopped
	% E2 is an outdoors scene
	% E3 is an encounter for the mix encounter
	Element2 <Scene Outdoors !Near -7>
	Element3 <Prefab>
	Place3 <2>

	HINT_%id% <:%id2%>

	%% FAIL CONDITIONS
	%% - DiscoverNPCMission fails

	% P%id%01 = Initialization Counter
	update <if= P%id%01 0 P= %id%01 1 SetPlotStatus %plotid1% %id1% SetPlotStatus %plotid2% %id2%>
	end <ifSubPlotLost %plotid2% LoseSubPlot %plotid% LoseSubPlot %plotid1% Trigger0 .%id%_%plotid%_GoLoss>

	% Pass the results of the mecha encounter backwards to whatever subplot called this one.
	.%id1%_%plotid1%_GoWin  <WinSubPlot %plotid%  Trigger0 .%id%_%plotid%_GoWin>
	.%id1%_%plotid1%_GoLoss <LoseSubPlot %plotid% Trigger0 .%id%_%plotid%_GoLoss>

	% SubPlot1 is the mix encounter
	% SubPlot2 is the DiscoverNPCMission task
	SubPlot1 <*:CS_MIX_Encounter 2 3 1>
	SubPlot2 <*:CS_DiscoverNPCMission&EnemyNPC&GatheringForces 2 3 1>

	inv
		stc CORE-ACTIVATABLE
		name <%name1%'s Forces>
		name_I18N <%name1% の部隊>
	end


Content
	name <Mook Factory Attack>
	% desc <The NPC is going to launch an attack against a factory.>
	desc <NPC がとある工場に襲撃を仕掛けようとしている。>
	requires <*:CS_StopNPCMission -&IsEnemyNPC &Secondary>
	Size 8

	% E1 is the NPC launching the attack
	% E2 is an urban scene for placing the factory
	% E3 is the metascene for the mission
	Element2 <Scene Urban !Near -7>
	Element3 <Prefab>
	Place3 <2>

	HINT_%id% <:%id1%>

	%% FAIL CONDITIONS
	%% - The DiscoverNPCMission subplot fails
	%% - The timer runs out before combat is entered

	% p%id%01 = Initialization Counter
	% p%id%02 = Timer (24 to 30 hours)
	% p%id%03 = Reinforcements Counter

	% At initialization, set the timer and activate the two subplots.
	update <if= p%id%01 0 p= %id%01 1 p= %id%02 ComTime P+ %id%02 86400 P+ %id%02 d21600 SetPlotStatus %plotid1% %id1% SetPlotStatus %plotid2% %id2% NPCLevel %1% StortDL MoveNPC %1% %3% SetNPCTeam %1% 2>
	HalfHour <if# p%id%02 0 ifG ComTime p%id%02  CancelSubPlot %plotid1%  CancelSubPlot %plotid2%  LoseSubPlot %plotid% Trigger0 .%id%_%plotid%_GoLoss  History %id%01 if= RootSceneID &EpisodeScene else .%id%_GoDistant Alert %id%02>
	.%id%_GoDistant <Alert %id%03>

	end <ifSubPlotLost %plotid1% CancelSubPlot %plotid2% P= %id%02 -1 Goto HalfHour>

	.%id2%_%plotid2%_GoReinforcements <P= %id%03 1>

	% Msg%id%01 <You were too late to prevent %name1% from destroying a factory.>
	% Msg%id%02 <\SCENE &EpisodeScene is rocked as %name1%'s lance destroys its target.>
	% Msg%id%03 <You feel a great disturbance in \SCENE &EpisodeScene .>
	Msg%id%01 <%name1% が工場を破壊するのを阻止できなかった。>
	Msg%id%02 <%name1% の部隊が目標を破壊しながら暴れ回り、\SCENE &EpisodeScene は混乱に陥っている。>
	Msg%id%03 <\SCENE &EpisodeScene で何か大変なことが起こっているという直感が走った。>

	% SubPlot1 is the DiscoverNPCMission task
	% SubPlot2 is the GainAdvantage_VsNPC task
	SubPlot1 <*:CS_DiscoverNPCMission&EnemyNPC&DestroyFactory 2 3 1>
	SubPlot2 <*:CS_GainAdvantageVsMecha&Reinforcements>

	sub
		MetaScene 3 2
		% L1 = Initialization Counter
		% L2 = Victory Counter
		MapWidth 50
		MapHeight 50

		CityBlockMap
		terrain <GROUND>

		% At startup, clear the timer so the mission doesn't timeout while the PC is defending
		% the factory. That would just be silly.
		Start <if= L1 0  Alert 1 ForceChat %1%  L= 1 1 P= %id%02 0  if# P%id%03 0 Alert 4>
		nu1 <if= T1 0 Return if= L2 0 L= 2 1 Goto GoLoseMission>
		nu2 <if= T2 0 if= L2 0 L= 2 1 Salvage ifG T3 0 else GoLoseMission Goto GoWinMission>
		GoLoseMission <Alert 2             Trigger0 .%id%_%plotid%_GoLoss  LoseSubPlot %plotid%>
		GoWinMission  <Alert 3   History 5   XPV 100   Trigger0 .%id%_%plotid%_GoWin   WinSubPlot %plotid%>

		end <SetEncounterInactive %3%>

		% Msg1 <You arrive just in time to defend the factory against %name1%'s forces.>
		% Msg2 <You did not manage to save the factory.>
		% Msg3 <You defended the factory against %name1%.>
		% Msg4 <Your reinforcements are here, as promised.>
		% Msg5 <You defended a factory against %name1%.>
		Msg1 <あなたが到着したのは、%name1% の部隊が工場に攻撃を仕掛けるまさにその瞬間だった。>
		Msg2 <工場を守ることができなかった。>
		Msg3 <%name1% の手から工場を守った。>
		Msg4 <味方の援軍が到着した。>
		Msg5 <%name1% の手から工場を守った。>

		sub
			Team 1
			SetEnemy 2
			SetAlly 3 4
			ParaX 7
			ParaY 7

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

			Team 3
			SetEnemy 2
			SetAlly 1 4

			team 4
			setally 1 3
			setenemy 2
			Deploy <if= PlotStatus %plotid% %id%  if# P%id%03 0   WMecha 4 StoryDL 80>
			ParaX 25
			ParaY 7


			rect
			name <The Factory>
			desig <NW>
			sub
				SuperProp
				requires <*Fortress>
				SetTeam 3
			end
		end

		Persona 1
		special <UNLISTED>
		greeting <if= PlotStatus %plotid% %id% else %pop% Goto GoGreet>
		*GoGreet <*BattleChallenge GoThemeExpo na>
		*GoThemeExpo <*THEME_EXPO&Enemy na>
	end
	inv
		stc CORE-ACTIVATABLE
		name <%name1%'s Goal>
		name_I18N <%name1% の目標>
	end


Content
	name <A Little Help From Your Friends>
	% desc <The NPC reacts badly to a loss, but fortunately you have backup.>
	desc <NPC が敗北により激昂するが、幸いあなたには支援がある。>
	requires <*:CS_StopNPCMission &IsEnemyNPC E:A.equ (E:M.com|E:M.ggd)>
	changes <E:A>

	% E1 is the NPC launching this attack
	% E2 is an outdoors scene for the encounters
	% E3 is an encounter for the supposed mission- the PC completes this one first
	% E4 is the encounter for the ambush- after the PC wins E3
	% E5 is a friend/lover/ally to come to the rescue
	% E6 is a second one
	Place1 </>
	Element2 <Scene Outdoors !Near -7>
	Element3 <Prefab>
	Place3 <2>
	Element4 <Prefab>
	Place4 <2>
	Element5 <Character (Friend|Lover|Family|Lancemate) HasMecha !Global>
	Place5 <4 (Allies) sd ally>
	Element6 <Character (Friend|Lover|Family|Lancemate|PCFAC) HasMecha !Global>
	Place6 <4 (Allies) sd ally>

	HINT_%id% <:%id2%>

	% P%id%01 = Initialization Counter

	% At initialization, activate all the subplots and level the NPCs.
	update <if= p%id%01 0 p= %id%01 1 NPCLevel %5% StoryDL NPCLevel %6% StoryDL  SetPlotStatus %plotid1% %id1%  SetPlotStatus %plotid2% %id2%>

	% Upon the Mecha Encounter subplot being won, this subplot's ambush will be activated.
	% If the sub-encounter is lost, this plot is lost without needing an ambush.
	.%id1%_%plotid1%_GoWin <SetEncounterActive %4%>
	.%id1%_%plotid1%_GoLoss <Trigger0 .%id%_%plotid%_GoLoss LoseSubPlot %plotid%>

	% SubPlot1 is the combat encounter that serves as the supposed mission
	% SubPlot2 is the locate encounter thingamabob
	SubPlot1 <*:CS_MechaEncounter&Secondary&Raiders 2 3>
	SubPlot2 <*:CS_DiscoverNPCMission&EnemyNPC&GatheringForces 2 3 1>

	sub
		Persona 1
		special <UNLISTED NOESCAPE>
		greeting <EndChat Say 1 AddChat 1 AddChat 2>
		GoEndConversation <EndChat Say 2>
		result1 <AddSociable -d8   Goto GoEndConversation>
		result2 <AddSociable  d8   Goto GoEndConversation>
		% Msg1 <You!!! I had this perfectly planned out, why did your friends have to come along and ruin it!?>
		% Msg2 <I have to go, but my lance should still be able to defeat you! Men, don't allow any of them to escape!>
		% Prompt1 <Don't look at me. I'm just as surprised as you are.>
		% Prompt2 <Hey, I can't help it if I'm popular.>
		Msg1 <%JS_AGG！！！ %JF2の計画は完璧だったのに、どうして%JS_AGGの仲間に台無しにされなければならない%JG_NDA！？>
		Msg2 <%JF2はもう行かせてもらう%JV_ZO。だ%JG_GA、まだ%JF2の部下だけでも%JS_AGGを倒すには十分%JG_DA！ 全員、奴らを一人たりとも逃がすんじゃない%JV_ZO%JV_F_YO！>
		Prompt1 <こっちを見ないで%JG_R_AGG。%JF2も同じくらい驚いてる%JG_YO%JV_SIL_R。>
		Prompt2 <%JR_YES、人気者だと仕方ない%JG_NE。>

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

		start <if= L2 0 L= 2 1  Alert 1 Monologue %1% 2 Monologue %5% 3 Monologue %1% 4 Monologue %6% 5 ForceChat %1% History 6 SetXXRAttitude %1% XXR_A_EnviesPC>
		end <SetEncounterInactive %4%>

		nu1 <if= T1 0   Return   if= L1 0 L= 1 1  History 7                     Trigger0 .%id%_%plotid%_GoLoss   LoseSubPlot %plotid%>
		nu2 <if= T2 0   if= L1 0 L= 1 1   Alert 8 History 9  XPV 100  SALVAGE   Trigger0 .%id%_%plotid%_GoWin    WinSubPlot %plotid%>

		% Msg1 <Without warning, you are ambushed by %name1%!>
		% Msg2 <You can't win, \PC . As you can see I have predicted your every move.>
		% Msg3 <Yeah, but you didn't predict that \PC would have backup!>
		% Msg4 <Huh!? What in the name of vector sigma are you doing here?>
		% Msg5 <We're here to defeat you once and for all. Don't worry, \PC , we can handle these creeps.>
		% Msg6 <You were ambushed by %name1%, but %name5% and %name6% came to your aid.>
		% Msg7 <Despite their help you were defeated.>
		% Msg8 <%name1%'s lance has been defeated.>
		% Msg9 <With their help you defeated %name1%'s lance.>
		Msg1 <%name1% の奇襲を受けた！>
		Msg2 <%JS_AGGは勝てない%JV_ZO、\PC。見ての通り、%JS_AGGの動きはすべてお見通しな%JG_SK。>
		Msg3 <%JR_YES、でも \PC の味方が現れるところまでは予測してなかった%JV_DAROU！>
		Msg4 <%JR_BIKKURI！？ ああ Vector Sigma よ、一体全体コイツらは何をしに来た%JG_NDA！>
		% vector sigma はトランスフォーマーに出てくるコンピュータ
		Msg5 <%JS_AGGを完全に叩きのめしに%JG_DAYO。心配いらない%JV_ZO、\PC。%JF2%JF_TACHIはこんな奴らに負けはしないから%JV_NA。>
		Msg6 <%name1% に奇襲を受けたが、%name5% と %name6% が助けに現れた。>
		Msg7 <その助力の甲斐もなく、あなたは敗北した。>
		Msg8 <%name1% の部隊は撃退された。>
		Msg9 <\SPR %5%らの助けを得て、あなたは %name1% の部隊を撃破した。>

		sub
			team 1
			SetEnemy 2
			SetAlly 3
			ParaX 5
			ParaY 10

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

			team 3
			name <Allies>
			SetAlly 1
			SetEnemy 2
			ParaX 10
			ParaY 5
		end
	end
	inv
		stc CORE-ACTIVATABLE
		name <%name1%'s Forces>
		name_I18N <%name1% の部隊>

		STC CORE-MECHAAMBUSH-ACTIVATABLE
		name <Surprise Ambush>
		name_I18N <奇襲>
	end


Content
	name <Factory Attack>
	% desc <The NPC is going to launch an attack against a factory, but won't participate himself.>
	desc <NPC がとある工場に襲撃を仕掛けようとしているが、彼自身は参加しない。>
	requires <*:CS_StopNPCMission ~&IsEnemyNPC (!Ne|!Lo) &Secondary>
	Size 8

	% E1 is the NPC launching the attack
	% E2 is an urban scene for placing the factory
	% E3 is the metascene for the mission
	Element2 <Scene Urban !Near -7>
	Element3 <Prefab>
	Place3 <2>

	HINT_%id% <:%id1%>

	%% FAIL CONDITIONS
	%% - The DiscoverNPCMission subplot fails
	%% - The timer runs out before combat is entered

	% p%id%01 = Initialization Counter
	% p%id%02 = Timer (24 to 30 hours)
	% p%id%03 = Reinforcements Counter

	% At initialization, set the timer and activate the two subplots.
	update <if= p%id%01 0 p= %id%01 1 p= %id%02 ComTime P+ %id%02 86400 P+ %id%02 d21600 SetPlotStatus %plotid1% %id1% SetPlotStatus %plotid2% %id2%>
	HalfHour <if# p%id%02 0 ifG ComTime p%id%02  CancelSubPlot %plotid1%  CancelSubPlot %plotid2%  LoseSubPlot %plotid% Trigger0 .%id%_%plotid%_GoLoss  History %id%01 if= RootSceneID &EpisodeScene else .%id%_GoDistant Alert %id%02>
	.%id%_GoDistant <Alert %id%03>

	end <ifSubPlotLost %plotid1% CancelSubPlot %plotid2% P= %id%02 -1 Goto HalfHour>

	.%id2%_%plotid2%_GoReinforcements <P= %id%03 1>

	% Msg%id%01 <You were too late to prevent %name1% from destroying a factory.>
	% Msg%id%02 <\SCENE &EpisodeScene is rocked as %name1%'s lance destroys its target.>
	% Msg%id%03 <You feel a great disturbance in \SCENE &EpisodeScene .>
	Msg%id%01 <%name1% が工場を破壊するのを阻止できなかった。>
	Msg%id%02 <%name1% の部隊が目標を破壊しながら暴れ回り、\SCENE &EpisodeScene は混乱に陥っている。>
	Msg%id%03 <\SCENE &EpisodeScene で何か大変なことが起こっているという直感が走った。>

	% SubPlot1 is the DiscoverNPCMission task
	% SubPlot2 is the GainAdvantage_VsNPC task
	SubPlot1 <*:CS_DiscoverNPCMission&EnemyNPC&DestroyFactory 2 3 1>
	SubPlot2 <*:CS_GainAdvantageVsMecha&Reinforcements>

	sub
		MetaScene 3 2
		% L1 = Initialization Counter
		% L2 = Victory Counter
		MapWidth 50
		MapHeight 50

		CityBlockMap
		terrain <GROUND>

		% At startup, clear the timer so the mission doesn't timeout while the PC is defending
		% the factory. That would just be silly.
		Start <if= L1 0  Alert 1  L= 1 1 P= %id%02 0  if# P%id%03 0 Alert 4>
		nu1 <if= T1 0 Return if= L2 0 L= 2 1 Goto GoLoseMission>
		nu2 <if= T2 0 if= L2 0 L= 2 1 Salvage ifG T3 0 else GoLoseMission Goto GoWinMission>
		GoLoseMission <Alert 2             Trigger0 .%id%_%plotid%_GoLoss  LoseSubPlot %plotid%>
		GoWinMission  <Alert 3   History 5   XPV 100   Trigger0 .%id%_%plotid%_GoWin   WinSubPlot %plotid%>

		end <SetEncounterInactive %3%>

		% Msg1 <You arrive just in time to defend the factory against %name1%'s forces. Fortunately, %name1% doesn't appear to be present.>
		% Msg2 <You did not manage to save the factory.>
		% Msg3 <You defended the factory against %name1%'s forces.>
		% Msg4 <Your reinforcements are here, as promised.>
		% Msg5 <You defended a factory against %name1%'s forces.>
		Msg1 <あなたが到着したのは、%name1% の部隊が工場に攻撃を仕掛けるまさにその瞬間だった。幸運にも %name1% は不在のようだ。>
		Msg2 <工場を守ることができなかった。>
		Msg3 <%name1% の部隊から工場を守った。>
		Msg4 <味方の援軍が到着した。>
		Msg5 <%name1% の部隊から工場を守った。>

		sub
			Team 1
			SetEnemy 2
			SetAlly 3 4
			ParaX 7
			ParaY 7

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

			Team 3
			SetEnemy 2
			SetAlly 1 4

			team 4
			setally 1 3
			setenemy 2
			Deploy <if= PlotStatus %plotid% %id%  if# P%id%03 0   WMecha 4 StoryDL 80>
			ParaX 25
			ParaY 7


			rect
			name <The Factory>
			desig <NW>
			sub
				SuperProp
				requires <*Fortress>
				SetTeam 3
			end
		end

	end
	inv
		stc CORE-ACTIVATABLE
		name <%name1%'s Goal>
		name_I18N <%name1% の目標>
	end

Content
	name <Sorting Battle>
	% desc <The PC and the never-met NPC fight.>
	desc <それまで会ったことのない NPC と PC が戦う。>
	requires <*:CS_StopNPCMission &IsEnemyNPC E:A.nme>
	changes <E:++>

	% E1 is the new enemy
	% E2 is the metascene to be used for this encounter
	% E3 is the scene in which to place it
	Place1 <2 (Enemies) SD Enemy>
	Element2 <Prefab>
	Place2 <3>
	Element3 <Scene Outdoors !Near -7>

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

	%% FAIL CONDITIONS:
	%%  - RevealEncounter subplot fails.
	end <ifSubPlotLost %plotid2% CancelSubPlot %plotid1%  Alert %id%01 Trigger0 .%id%_%plotid%_GoLoss>

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

	% Msg%id%01 <%name1% has gotten away.>
	Msg%id%01 <%name1% に逃げられた。>

	%%  Hint Redirection
	HINT_%id% <:%id2%>

	% SubPlot1 = Gain Advantage vs Raiders
	% SubPlot2 = Discover NPC mission
	SubPlot1 <*:CS_GainAdvantageVsMecha&Reinforcements>
	SubPlot2 <*:CS_RevealEncounter_Raiders 3 2>

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

		Start <if= L2 0 L= 2 1   Alert 1  ForceChat %1%   StoryNote 2  CancelSubPlot %plotid1% if# P%id%02 0 Alert 3>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1   Alert 4 Monologue %1% 5 History 6   LoseSubPlot %plotid% Trigger0 .%id%_%plotid%_GoLoss  SetXXRAttitude %1% XXR_A_IsSenior>
		nu2 <if= T2 0   if= V1 0 V= 1 1   XPV 100  AddRenown 1   SALVAGE   Alert 7 Monologue %1% 8   WinSubPlot %plotid%  Trigger0 .%id%_%plotid%_GoWin  SetXXRAttitude %1% XXR_A_IsJunior>
		end <SetEncounterInactive %2% ifNPCDead %1% else GoFreeze Print 9 Goto GoFreeze>
		GoFreeze <FreezeNPC %1%>

		% Msg1 <You locate %name1%'s lance.>
		% Msg2 <You fought %name1% and \PPR %1% lance.>
		% Msg3 <Your reinforcements are here, as promised.>
		% Msg4 <You have been defeated by %name1%.>
		% Msg5 <Just as I expected, you're a mere amateur. Don't bother me again until you're worth my time.>
		% Msg5_1 <Sorry that I had to hurt you, but you left me no other choice. Stay out of my business from now on.>
		% CMsg5_1 <ifNPCHeroic Accept>
		% Msg5_2 <Do you understand now, worm? Challenge me again and you won't live to tell about it.>
		% CMsg5_2 <ifNPCVillainous Accept>
		% Msg6 <%name1% defeated you.>
		% Msg7 <You defeated %name1%'s lance.>
		% Msg8 <Aw, man, I didn't expect you to be so tough... Would you be willing to go best two out of three?>
		% Msg8_1 <Hmph, so you're tough... Being strong still doesn't make you right, you know.>
		% CMsg8_1 <ifNPCHeroic Accept>
		% Msg8_2 <What, how could I lose to a jerk like you!? That's it, next time I won't hold back at all!>
		% CMsg8_2 <ifNPCVillainous Accept>
		% Msg9 <%name1%'s cockpit is mysteriously empty. Could \SPR %1% have survived?>
		Msg1 <%name1% の部隊を発見した。>
		Msg2 <%name1% とその部隊と戦った。>
		Msg3 <味方の援軍が到着した。>
		Msg4 <%name1% に敗北した。>
		Msg5 <思った通り、ただのアマチュアだった%JV_F_WA%JV_NA。相手をする価値のある腕になるまで、%JF2には関わらないこと%JG_DAYO。>
		Msg5_1 <傷つける結果になったのは残念だ%JG_GA、%JS2が他の選択肢を与えてくれなかったから%JG_DAYO。これからは%JF2の仕事の邪魔をしないで%JG_R。>
		CMsg5_1 <ifNPCHeroic Accept>
		Msg5_2 <これで虫ケラにも理解できた%JV_Q？ 次にまた邪魔することがあれば、もうそれが分かるまで生きてはいられない%JV_ZO。>
		CMsg5_2 <ifNPCVillainous Accept>
		Msg6 <%name1% に敗北した。>
		Msg7 <%name1% の部隊を撃破した。>
		Msg8 <ぐぐ、ここまで強いとは思わなかった%JV_ZO……今回のは、３ラウンド制の１本目ってことで引き下がってやる%JG_YO。>
		Msg8_1 <むむ、手強い%JV_F_WA……だ%JG_GA知ってる%JV_DAROU、強いものが正しいわけじゃない%JV_ZO。>
		CMsg8_1 <ifNPCHeroic Accept>
		Msg8_2 <何故%JV_M_DA……どうして%JF2が%JS_AGGのようなマヌケに負ける%JG_NDA！？ 上等%JV_M_DA%JV_F_YO、次は一切の手加減をしない%JV_ZO！>
		CMsg8_2 <ifNPCVillainous Accept>
		Msg9 <奇妙にも、%name1% のコクピットはもぬけの殻だった。生き延びたのだろうか？>

		sub
			team 1
			setally 3
			SetEnemy 2
			ParaX 5
			ParaY 5

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

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

		Persona 1
		special <UNLISTED>
		greeting <if= PlotStatus %plotid% %id% else %pop% EndChat Say %id%01 AddChat %id%01 AddChat %id%02>
		*result%id%01 <*THEME_EXPO&Enemy na>
		result%id%02 <AddEasygoing -d10 Goto result%id%01>
		% Msg%id%01 <So you must be \PC ... I wonder, will you be a worthy opponent or not?>
		% Msg%id%01_1 <At last we meet. I am %name1%; you must be \PC . Will you be a challenge worthy of my attention?>
		% CMsg%id%01_1 <ifNPCHeroic Accept>
		% Msg%id%01_2 <>
		% CMsg%id%01_2 <ifNPCVillainous Accept>
		% Prompt%id%01 <Let's find out.>
		% Prompt%id%01_1 <Let's get this over with.>
		% Prompt%id%01_2 <Let's do it.>
		% Prompt%id%02 <You're going to lose, because I'm the best!>
		% Prompt%id%02_1 <Yeah, I'm the one who's gonna defeat you!>
		% Prompt%id%02_2 <Big words, but you're not in the same league as me.>
		Msg%id%01 <%JS_AGGが \PC %JG_DANE%JV_SIL_Rさあ、%JS_AGGは%JF2の実力に相応しい相手%JG_KANA？>
		Msg%id%01_1 <ようやく会えた%JG_NE。%JF2は %name1%、%JS_AGGは \PC %JG_DANE？ さて、%JS_AGGは%JF2の注目に値する相手%JG_KANA？>
		CMsg%id%01_1 <ifNPCHeroic Accept>
		Msg%id%01_2 <>
		CMsg%id%01_2 <ifNPCVillainous Accept>
		Prompt%id%01 <確かめてみ%JV_YOUか。>
		Prompt%id%01_1 <さっさと終わらせる%JV_ZO。>
		Prompt%id%01_2 <始め%JV_YOUか。>
		Prompt%id%02 <負けるのは%JS_AGG%JV_M_DA%JV_F_YO、最強はこの%JF2だから%JV_NA！>
		Prompt%id%02_1 <%JR_YES、勝つのはこの%JF2%JG_DAYO！>
		Prompt%id%02_2 <口先は立派だ%JG_GA、%JS_AGGじゃ格下すぎる%JG_NE。>
	end
	inv
		stc CORE-ACTIVATABLE
		name <%name1%'s Lance>
		name_I18N <%name1% の部隊>
	end

Content
	name <New Unknown Enemy>
	% desc <The PC arrives too late to catch the NPC, but can defeat the henchmen.>
	desc <NPC に追いつこうとしていた PC の到着は遅すぎたが、取り巻きを叩くことはできる。>
	requires <*:CS_StopNPCMission -&IsEnemyNPC E:-->
	changes <E:++>

	% E1 is the new enemy
	% E2 is the metascene to be used for this encounter
	% E3 is the scene in which to place it
	Place1 </>
	Element2 <Prefab>
	Place2 <3>
	Element3 <Scene Outdoors !Near -7>

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

	%% FAIL CONDITIONS:
	%%  - RevealEncounter subplot fails.
	end <ifSubPlotLost %plotid2% CancelSubPlot %plotid1%  Alert %id%01 Trigger0 .%id%_%plotid%_GoLoss>

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

	% Msg%id%01 <%name1% has gotten away.>
	Msg%id%01 <%name1% に逃げられた。>

	%%  Hint Redirection
	HINT_%id% <:%id2%>

	% SubPlot1 = Gain Advantage vs Raiders
	% SubPlot2 = Discover NPC mission
	SubPlot1 <*:CS_GainAdvantageVsMecha&Reinforcements>
	SubPlot2 <*:CS_DiscoverNPCMission&EnemyNPC&DestroyFactory 3 2 1>

	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 %1% XXR_A_NeverMet  StoryNote 3   &SetEnemyNPC %1%  CancelSubPlot %plotid1% if# P%id%02 0 Alert 6>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1   Alert 4   LoseSubPlot %plotid% Trigger0 .%id%_%plotid%_GoLoss>
		nu2 <if= T2 0   if= V1 0 V= 1 1   XPV 100  AddRenown 1   SALVAGE   Alert 5   WinSubPlot %plotid%  Trigger0 .%id%_%plotid%_GoWin>
		end <SetEncounterInactive %2%>

		% Msg1 <You locate %name1%'s lance. %name1%, however, appears to be missing.>
		% Msg2_1 <You're too late; %name1% has finished what \SPR %1% came here for... of course the rest of us are still spoiling for a good fight!>
		% Msg2_2 <If you're looking for %name1%, you're too late. Also, you're dead meat...>
		% Msg2_3 <%name1% doesn't like senseless violence, so \SPR %1% left as soon as \PPR %1% mission was done. The rest of us, on the other hand, can't get enough of the stuff...>
		% CMsg2_3 <ifG NPCHeroism %1% 0 Accept>
		% Msg2_4 <Look at that, %name1% missed one! If you were hoping to fight the boss you're too late, but the rest of us will give you a good pounding!>
		% CMsg2_4 <ifG 0 NPCHeroism %1% Accept>
		% Msg2_5 <Looking for %name1%? Too late, \SPR %1% 's already finished... but if you take on one member of \FACTION &EnemyFac , you take on the lot of us!>
		% CMsg2_5 <ifFactionExists &EnemyFac Accept>
		% Msg3 <You fought %name1%'s lance, but were too late to catch \OPR %1% .>
		% Msg4 <If %name1%'s subordinates were capable of this by themselves, you're probably lucky that \SPR %1% wasn't with them.>
		% Msg5 <You have defeated %name1%'s lance.>
		% Msg6 <Your reinforcements are here, as promised.>
		Msg1 <%name1% の部隊を発見した。しかし、%name1% の姿が見当たらない。>
		Msg2_1 <遅かった%JV_F_WA%JV_NA、%name1% はもう目的を達成した後%JV_M_DA%JV_F_YO……もちろん、ここにいる%JF2%JF_TACHIはまだ戦いたくて仕方ないんだ%JG_GA%JV_NA！>
		Msg2_2 <%name1% を探しに来たのなら、来るのが遅すぎた%JG_NE。ついでに、%JS_AGGはもう死んだ%JV_ZO%JV_F_YO……。>
		Msg2_3 <%name1% は無駄な争いを好まないから、目的を達成したらすぐに帰っていった%JG_YO。でも%JV_NA、%JF2%JF_TACHIのほうは……まだまだ暴れ足りない%JG_SK。>
		CMsg2_3 <ifG NPCHeroism %1% 0 Accept>
		Msg2_4 <あれは……どうやら %name1% は獲物を１つ逃したみたい%JG_DANE！ %JT_Aと戦いに来たのなら遅かった%JV_F_WA%JV_NA、でも代わりに%JF2%JF_TACHIが叩きのめしてやる%JG_YO！>
		CMsg2_4 <ifG 0 NPCHeroism %1% Accept>
		Msg2_5 <%name1% に会いたいの%JV_KA_Q？ 遅かった%JV_F_WA%JV_NA、%JT_Aはもう仕事を終えた後%JG_DA%JV_SIL_Rだ%JG_GA、\FACTION &EnemyFac の１人に喧嘩を売るってことは、%JF2%JF_TACHI全員に喧嘩を売るってこと%JG_DAYO！>
		CMsg2_5 <ifFactionExists &EnemyFac Accept>
		Msg3 <%name1% の部隊と戦ったが、\SPR %1%自身は既に去った後だった。>
		Msg4 <手下だけでこれだけの力を持っているなら、%name1% 自身がここにいなかったことは幸運だったのだろう。>
		Msg5 <%name1% の部隊を撃破した。>
		Msg6 <味方の援軍が到着した。>

		sub
			team 1
			setally 3
			SetEnemy 2
			ParaX 5
			ParaY 5

			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
	inv
		stc CORE-ACTIVATABLE
		name <%name1%'s Goal>
		name_I18N <%name1% の目標>
	end


Content
	name <New Junior Enemy>
	% desc <The NPC is going to launch an attack against a factory, ineptly.>
	desc <NPC がとある工場に襲撃を仕掛けようとしている。拙い。>
	requires <*:CS_StopNPCMission -&IsEnemyNPC E:-- (!Ne|!Lo)>
	changes <E:++>

	% E1 is the NPC launching the attack
	% E2 is an urban scene for placing the factory
	% E3 is the metascene for the mission
	Place1 <3 (Enemies) SD enemy>
	Element2 <Scene Urban !Near -7>
	Element3 <Prefab>
	Place3 <2>

	HINT_%id% <:%id1%>

	%% FAIL CONDITIONS
	%% - The DiscoverNPCMission subplot fails
	%% - The timer runs out before combat is entered

	% p%id%01 = Initialization Counter
	% p%id%02 = Timer (24 to 30 hours)
	% p%id%03 = Reinforcements Counter
	% P%id%04 = Combat Started

	% At initialization, set the timer and activate the two subplots.
	% If the timer runs out, set E1 as the core story enemy + set attitude
	update <if= p%id%01 0 p= %id%01 1 p= %id%02 ComTime P+ %id%02 86400 P+ %id%02 d21600 SetPlotStatus %plotid1% %id1% SetPlotStatus %plotid2% %id2% NPCLevel %1% StoryDL SetNPCFaction %1% &EnemyFac>
	HalfHour <if# p%id%02 0 ifG ComTime p%id%02  CancelSubPlot %plotid1%  CancelSubPlot %plotid2%  LoseSubPlot %plotid% Trigger0 .%id%_%plotid%_GoLoss  History %id%01 FreezeNPC %1% &SetEnemyNPC %1% SetXXRAttitude %1% XXR_A_NeverMet if= RootSceneID &EpisodeScene else .%id%_GoDistant Alert %id%02>
	.%id%_GoDistant <Alert %id%03>

	end <ifSubPlotLost %plotid1% CancelSubPlot %plotid2% P= %id%02 -1 Goto HalfHour>

	.%id2%_%plotid2%_GoReinforcements <P= %id%03 1>

	% Msg%id%01 <You were too late to prevent %name1% from destroying a factory.>
	% Msg%id%02 <\SCENE &EpisodeScene is rocked as %name1%'s lance destroys its target.>
	% Msg%id%03 <You feel a great disturbance in \SCENE &EpisodeScene .>
	Msg%id%01 <%name1% が工場を破壊するのを阻止できなかった。>
	Msg%id%02 <%name1% の部隊が目標を破壊しながら暴れ回り、\SCENE &EpisodeScene は混乱に陥っている。>
	Msg%id%03 <\SCENE &EpisodeScene で何か大変なことが起こっているという直感が走った。>

	% SubPlot1 is the DiscoverNPCMission task
	% SubPlot2 is the GainAdvantage_VsNPC task
	SubPlot1 <*:CS_DiscoverNPCMission&EnemyNPC&DestroyFactory 2 3 1>
	SubPlot2 <*:CS_GainAdvantageVsMecha&Reinforcements>

	sub
		MetaScene 3 2
		% L1 = Initialization Counter
		% L2 = Victory Counter
		MapWidth 50
		MapHeight 50

		CityBlockMap
		terrain <GROUND>

		% At startup, clear the timer so the mission doesn't timeout while the PC is defending
		% the factory. That would just be silly.
		Start <if= L1 0  Alert 1  P= %id%04 1  ForceChat %1%  L= 1 1 P= %id%02 0  if# P%id%03 0 Alert 4>
		nu1 <if= T1 0 Return if= L2 0 L= 2 1 Goto GoLoseMission>
		nu2 <if= T2 0 if= L2 0 L= 2 1 Salvage ifG T3 0 else GoLoseMission Goto GoWinMission>
		GoLoseMission <Alert 2             Trigger0 .%id%_%plotid%_GoLoss  LoseSubPlot %plotid%>
		GoWinMission  <Alert 3   History 5   XPV 100   Trigger0 .%id%_%plotid%_GoWin   WinSubPlot %plotid%>

		end <SetEncounterInactive %3%  FreezeNPC %1%>

		% Msg1 <You arrive just in time to defend the factory against %name1%'s forces.>
		% Msg2 <You did not manage to save the factory.>
		% Msg3 <You defended the factory against %name1%'s forces.>
		% Msg4 <Your reinforcements are here, as promised.>
		% Msg5 <You defended a factory against %name1%'s forces.>
		Msg1 <あなたが到着したのは、%name1% の部隊が工場に攻撃を仕掛けるまさにその瞬間だった。>
		Msg2 <工場を守ることができなかった。>
		Msg3 <%name1% の部隊から工場を守った。>
		Msg4 <味方の援軍が到着した。>
		Msg5 <%name1% の部隊から工場を守った。>

		sub
			Team 1
			SetEnemy 2
			SetAlly 4
			ParaX 7
			ParaY 7

			Team 2
			name <Enemies>
			SetEnemy 1 4
			Deploy <if= PlotStatus %plotid% %id%  SetSelfFaction &EnemyFac WMecha 2 StoryDL 100>
			ParaX 45
			ParaY 45

			Team 3
			SetAlly 1 4

			team 4
			setally 1
			setenemy 2
			Deploy <if= PlotStatus %plotid% %id%  if# P%id%03 0   WMecha 4 StoryDL 80>
			ParaX 25
			ParaY 7


			rect
			name <The Factory>
			desig <NW>
			sub
				SuperProp
				requires <*Fortress>
				SetTeam 3
			end
		end

		Persona 1
		greeting <if= P%id%04 0 else .%id%_GoCombatGreet EndChat Say %id%01>
		.%id%_GoCombatGreet <EndChat Say %id%02 AddChat %id%01 &SetEnemyNPC %1% SetXXRAttitude %1% XXR_A_IsJunior>
		*result%id%01 <*THEME_EXPO&Enemy na>
		% Msg%id%01 <Hello? Ashes, I was supposed to leave my cell phone off for this... Goodbye!!!>
		% Msg%id%01_1 <Hi, I can't talk right now because I'm on a mission. Please leave a message at the tone.>
		% Msg%id%01_2 <Stop calling me, I am not interested in your lower rates!!!>
		% Msg%id%02 <You with the robot! This is my first time blowing up a factory, and I'm not going to let you ruin my precious memories!>
		% Msg%id%02_1 <Please get out of here! I've got orders to blow up that factory, and it's going to be much harder with you in the way...>
		% CMsg%id%02_1 <ifNPCHeroic Accept>
		% Msg%id%02_2 <Bwa-ha-ha! My first factory assault mission is going better than expected, there are some guards for me to fight! Maybe I'll kill someone finally!>
		% CMsg%id%02_2 <ifNPCVillainous Accept>
		% Msg%id%02_11 <On behaf of \FACTION &EnemyFac , I'm warning you to get out of here! I have to blow up that building and you're standing right in front of it...>
		% CMsg%id%02_11 <ifFactionExists &EnemyFac ifNPCHeroic Accept>
		% Msg%id%02_12 <Yeah, I'm the god of death from \FACTION &EnemyFac and I'm gonna destroy this entire place! Man, this is way better than the simulator!>
		% CMsg%id%02_12 <ifFactionExists &EnemyFac ifNPCVillainous Accept>
		% Prompt%id%01 <A f‏irst timer, huh? This'll be easy...>
		% Prompt%id%01_1 <Get out of here before I hurt you, newb.>
		% Prompt%id%01_2 <I take it that you're new at this...>
		Msg%id%01 <もしもし？ あっ、携帯は切っておくつもりだったんだ%JV_F_WA……失礼！！！>
		Msg%id%01_1 <はい。ただいま任務中ですので電話には出られません。発信音の後にメッセージをどうぞ。>
		Msg%id%01_2 <もう電話しないで%JG_R_AGG！ %JS_AGGの上から目線の言葉なんて聞きたくない%JV_F_WA%JV_NA！！！>
		Msg%id%02 <そこのメック！ これは%JF2の初めての工場爆破な%JG_NDA%JV_SIL_Rこの最高の思い出は誰にも邪魔させない%JV_ZO%JV_F_YO！>
		Msg%id%02_1 <どうかここから去って%JG_R！ %JF2はこの工場を破壊せよと命令を受けている%JV_N%JV_M_DA、%JS2がいたのでは仕事が一気に難しくなる%JV_F_WA……。>
		CMsg%id%02_1 <ifNPCHeroic Accept>
		Msg%id%02_2 <うははっ！ この%JF2の最初の工場襲撃ミッション、思ってたよりもずっと楽しい%JG_NE！ 倒してもいい相手までいる……やっと人が殺せる%JV_ZO！>
		CMsg%id%02_2 <ifNPCVillainous Accept>
		Msg%id%02_11 <\FACTION &EnemyFac の代表として、%JS2にここから退去するよう警告する%JV_ZO！ %JF2はこの建物を破壊しなければいけない%JV_N%JV_M_DA、%JS2にそんなところに立たれていると……。>
		CMsg%id%02_11 <ifFactionExists &EnemyFac ifNPCHeroic Accept>
		Msg%id%02_12 <そう、%JF2は \FACTION &EnemyFac から来た死神……この場所を焼け野原にしてやる%JG_SK！ ああ、シミュレーターなんかよりずっと良い%JV_ZO！>
		CMsg%id%02_12 <ifFactionExists &EnemyFac ifNPCVillainous Accept>
		Prompt%id%01 <新米さんなの%JV_KA_Q？ これは楽そう%JG_DANE%JV_SIL_R。>
		Prompt%id%01_1 <痛い目に遭う前にさっさと帰る%JV_N%JV_M_DA%JV_F_YO、新人君%JV_SIL。>
		Prompt%id%01_2 <要するに新米ってこと%JV_KA_Q%JV_F_NE……。>
	end
	inv
		stc CORE-ACTIVATABLE
		name <%name1%'s Goal>
		name_I18N <%name1% の目標>
	end



%%
%% *:CS_StopAttack Content
%%
%%	&IsEnemyFac	The faction to be stopped is the core story enemy
%%
%% A faction is planning to attack something. The PC will have 24 hours to find
%% out what and prevent the attack. This is kind of like the above subplot type
%% but involves a faction rather than an NPC and is not a main course. Generally,
%% this subplot will be invoked when a threat is discovered, and may well form
%% the primary combat for an episode.
%%
%% When this subplot concludes, it sets one of the following triggers:
%%  .%id%_%plotid%_GoWin
%%  .%id%_%plotid%_GoLoss
%%
%% PARAM1: The faction behind the attack
%%

Content
	name <Blow Up Your Factory>
	% desc <The faction is going to launch an attack against a factory.>
	desc <敵勢力がとある工場に襲撃を仕掛けようとしている。>
	requires <*:CS_StopAttack>
	Size 8

	% E1 is the faction launching the attack
	% E2 is an urban scene for placing the factory
	% E3 is the metascene for the mission
	Element2 <Scene Urban !Near -7>
	Element3 <Prefab>
	Place3 <2>

	%% FAIL CONDITIONS
	%% - The DiscoverNPCMission subplot fails
	%% - The timer runs out before combat is entered

	% p%id%01 = Initialization Counter
	% p%id%02 = Timer (24 to 30 hours)
	% p%id%03 = Reinforcements Counter

	% At initialization, set the timer and activate the two subplots.
	update <if= p%id%01 0 p= %id%01 1 p= %id%02 ComTime P+ %id%02 86400 P+ %id%02 d21600 SetPlotStatus %plotid1% %id1% SetPlotStatus %plotid2% %id2%>
	HalfHour <if# p%id%02 0 ifG ComTime p%id%02  CancelSubPlot %plotid1%  CancelSubPlot %plotid2%  LoseSubPlot %plotid% Trigger0 .%id%_%plotid%_GoLoss  History %id%01 if= RootSceneID &EpisodeScene else .%id%_GoDistant Alert %id%02>
	.%id%_GoDistant <Alert %id%03>

	end <ifSubPlotLost %plotid1% CancelSubPlot %plotid2% P= %id%02 -1 Goto HalfHour>

	.%id2%_%plotid2%_GoReinforcements <P= %id%03 1>

	% Msg%id%01 <You were too late to prevent %name1% from destroying a factory.>
	% Msg%id%02 <\SCENE &EpisodeScene is rocked as mecha from %name1% destroy their target.>
	% Msg%id%03 <You feel a great disturbance in \SCENE &EpisodeScene .>
	Msg%id%01 <%name1% が工場を破壊するのを阻止できなかった。>
	Msg%id%02 <%name1% のメックが目標を破壊しながら暴れ回り、\SCENE &EpisodeScene は混乱に陥っている。>
	Msg%id%03 <\SCENE &EpisodeScene で何か大変なことが起こっているという直感が走った。>

	% SubPlot1 is the DiscoverNPCMission task
	% SubPlot2 is the GainAdvantage_VsNPC task
	SubPlot1 <*:CS_RevealEncounter_FactionTarget&IsEnemy&OfAttack 2 3 1>
	SubPlot2 <*:CS_GainAdvantageVsMecha&Reinforcements>

	sub
		MetaScene 3 2
		% L1 = Initialization Counter
		% L2 = Victory Counter
		MapWidth 50
		MapHeight 50

		CityBlockMap
		terrain <GROUND>

		% At startup, clear the timer so the mission doesn't timeout while the PC is defending
		% the factory. That would just be silly.
		Start <if= L1 0  Alert 1  L= 1 1 P= %id%02 0  if# P%id%03 0 Alert 4>
		nu1 <if= T1 0 Return if= L2 0 L= 2 1 Goto GoLoseMission>
		nu2 <if= T2 0 if= L2 0 L= 2 1 Salvage ifG T3 0 else GoLoseMission Goto GoWinMission>
		GoLoseMission <Alert 2   History 2             Trigger0 .%id%_%plotid%_GoLoss  LoseSubPlot %plotid%>
		GoWinMission  <Alert 3   History 5   XPV 100   Trigger0 .%id%_%plotid%_GoWin   WinSubPlot %plotid%>

		end <SetEncounterInactive %3%>

		% Msg1 <You arrive just in time to defend the factory against %name1%.>
		% Msg2 <You did not manage to save the factory %name1% attacked.>
		% Msg3 <You defended the factory against %name1%.>
		% Msg4 <Your reinforcements are here, as promised.>
		% Msg5 <You defended a factory against %name1%.>
		Msg1 <あなたが到着したのは、%name1% が工場に攻撃を仕掛けるまさにその瞬間だった。>
		Msg2 <%name1% に攻撃された工場を守ることができなかった。>
		Msg3 <%name1% の手から工場を守った。>
		Msg4 <味方の援軍が到着した。>
		Msg5 <%name1% の手から工場を守った。>

		sub
			Team 1
			SetEnemy 2
			SetAlly 3 4
			ParaX 7
			ParaY 7

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

			Team 3
			SetEnemy 2
			SetAlly 1 4

			team 4
			setally 1 3
			setenemy 2
			Deploy <if= PlotStatus %plotid% %id%  if# P%id%03 0   WMecha 4 StoryDL 80>
			ParaX 25
			ParaY 7


			rect
			name <The Factory>
			desig <NW>
			sub
				SuperProp
				requires <*Fortress>
				SetTeam 3
			end
		end

	end
	inv
		stc CORE-ACTIVATABLE
		name <Attack Target>
		name_I18N <攻撃目標>
	end

