%%
%% *:CS_TellSecretAboutNPC Content
%%		&LearnPlans	The PC is trying to learn the NPC's plans
%%		&IsEnemy	The NPC is an enemy of the PC
%%
%% The PC must learn a secret about this NPC in order to continue with
%% the adventure.
%%
%% If this subplot is won, the following trigger must be set:
%%		.%id%_%plotid%_GoLearnSecret
%%
%% PARAM1: The Secret
%% PARAM2: The NPC
%%

Content
	name <Let's Beat It Out Of Them>
	desc <Find some of your enemy's henchmen, and beat them until they spill the beans.>
	requires <*:CS_TellSecretAboutNPC -!Ne &IsEnemy ~&LearnPlans ~+Gpo ~+Gre>
	Size 5

	% E1 is the secret
	% E2 is the NPC whom it involves
	% E3 is an environs scene
	% E4 is the encounter involved
	Element3 <Scene Environs !Near -7>
	Element4 <Prefab>
	Place4 <3>

	sub
		MetaScene 4 2
		% Defeat all but one of the raiders, and the last guy standing
		% will reveal the secret. This mission had so many bugs in GH1 I
		% must be insane for trying it again...
		rumor%id% <%name2%'s lancemates have been hanging out in %name3%.>

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

		start <if= L2 0 L= 2 1 L= 1 0   Alert 1>
		nu1 <if= T1 0   Return   if= V1 0 V= 1 1    AddRenown -1>
		nu2 <if= V1 0   if= T2 1 else GoCheckComplete L= 1 1   Alert 2 PCMonologue 3 TeamMonologue 2 4   XPV 100   SALVAGE  WinSubPlot %plotid% Trigger0 .%id%_%plotid%_GoLearnSecret  Return>
		GoCheckComplete <if= T2 0 L= 1 1 Alert 5 Return>
		end <L= 2 0>

		Msg1 <You face a group of %name2%'s lancemates. Hopefully you can beat some information out of them.>
		Msg2 <Finding himself alone, the last lancemate surrenders.>
		Msg3_1 <Tell me about %name2%'s plans.>
		Msg3_2 <I'm looking for %name2%. What do you know?>
		Msg3_3 <Good decision. Now, tell me about %name2%.>
		Msg4_1 <I'll tell! \SECRET %1%>
		Msg4_2 <Don't hurt me! \SECRET %1%>
		Msg4_3 <\SECRET %1% That's all I know, I swear!>
		Msg5 <Unfortunately, there's no one left for you to question.>

		sub
			team 1
			SetEnemy 2
			ParaX 5
			ParaY 5

			team 2
			SetEnemy 1
			%% This plot will fail if only one enemy mecha is generated. How to solve this? By doing two
			%% separtate generations, so we'll always have at least two! Why didn't I think of this for
			%% GearHead1?
			Deploy <if= PlotStatus %plotid% %id%   SetSelfFaction &EnemyFac   WMecha 2 StoryDL 60 WMecha 2 StoryDL 60>
			ParaX 45
			ParaY 45
		end
	end
	inv
		Encounter
		name <%name2%'s Lance>
		% V1 = Recharge Counter
		% This encounter will appear once every 3 hours, as long as this is the active subplot.
		update <if= PlotStatus %plotid% %id% else GoHide ifG ComTime V1 else GoHide SetStat STAT_MetaVisibility 0  Goto GoSetOrders>
		GoSetOrders <GrabSource GSetNAtt NAG_EpisodeData NAS_Orders 3>
		use <ifG StatVal STAT_MetaVisibility -1  V= 1 ComTime V+ 1 10800  Print -1 Exit Destination>
		GoAutoAttack <V= 1 ComTime V+ 1 10800  Alert -2 Exit Destination>
		GoAvoidAttack <V= 1 ComTime V+ 1 7200  Print -6 AddSociable -1 UpdateProps>
	end

Content
	name <Really Smegging Trivial>
	desc <Ask someone and get told the secret. How lame is that?>
	requires <*:CS_TellSecretAboutNPC ~!Ne -!Hi -!Ex>
	Size 1

	% E1 is the secret
	% E2 is the NPC whom it involves
	% E3 is a person who can tell the secret
	Element3 <Character (Citizen|LABOR|ADVEN) !Okay 2 !Near -7>

	% FAIL CONDITIONS:
	% - E3 dies

	start <ifNPCDead %3% LoseSubPlot %plotid%>

	sub
		Persona 3
		rumor%id% <%name3% knows something about %name2%.>
		greeting <if= PlotStatus %plotid% %id% else %pop% Goto GoGreet>
		*GoGreet <*IWantToTalkAboutNPC %2% GoInform>
		GoInform <NewChat Say 1 Trigger0 .%id%_%plotid%_GoLearnSecret  WinSubPlot %plotid%>
		Msg1 <I don't know much, but I've heard rumors. \SECRET %1%>
	end

%%
%% *:CS_LearnSecretAboutNPC Content
%%
%% The PC will have a chance to learn something about this particular NPC.
%% Unlike the previous subplot type, this secret is purely optional.
%%
%% If this subplot is won, the following trigger must be set:
%%		.%id%_%plotid%_GoLearnSecret
%%
%% PARAM1: The Secret
%% PARAM2: The NPC
%%

Content
	name <Gossip Monger>
	desc <You can buy a secret from a reporter.>
	requires <*:CS_LearnSecretAboutNPC>
	Size 2

	% E1 is the secret
	% E2 is the NPC whom it involves
	% E3 is a public scene
	% E4 is the journalist
	Element3 <Scene Public !Near -7>
	Element4 <Character MEDIA !Near 3 !Xclude 2 NeverFail>
	NeverFail4 <Journalist>

	start <ifNPCDead %4% LoseSubPlot %plotid%>

	sub
		Persona 4
		rumor%id% <%name4% has been doing a story on %name2%.>
		% V1 = Information Cost
		% V2 = Got the Discount
		greeting <if= PlotStatus %plotid% %id% else GoChat Goto GoGreet>
		GoChat <NewChat SayAnything>
		*GoGreet <*IHaveInformation&AboutNPC GoCalc %2%>
		GoCalc <if= v1 0 else GoInform v= 1 Price StoryDL 50 Goto GoInform>
		GoInform <NewChat Say 1 AddChat 1 AddChat 2 AddChat 3 AddChat 4 AddChat 5>
		GoFFFail <V= 1 Price StoryDL 25 V= 2 1 NewChat Say 3 AddChat 1 AddChat 2>
		GoLFail <V= 1 Price StoryDL 25 V= 2 1 NewChat Say 5 AddChat 1 AddChat 2>
		result1 <NewChat Say 2 Cash+ -v1 Trigger0 .%id%_%plotid%_GoLearnSecret  WinSubPlot %plotid%>
		*result2 <*HurryBackWithMoney>
		result3 <ifConversation SkillTar StoryDL else GoFFFail NewChat Say 4  Trigger0 .%id%_%plotid%_GoLearnSecret  WinSubPlot %plotid%>
		result4 <ifConversation SkillTar StoryDL else GoLFail NewChat Say 6  Trigger0 .%id%_%plotid%_GoLearnSecret  WinSubPlot %plotid%>
		result5 <ifConversation HardSkillTar StoryDL else GoFFFail AddReact -10 NewChat Say 4  Trigger0 .%id%_%plotid%_GoLearnSecret  WinSubPlot %plotid%>
		Msg1 <I've been doing a story on %name2%. I have some potentially explosive information, but it's not going to come cheap. You can have it for $ \VAL V1 .>
		Msg2 <It's been a pleasure doing business with you. \SECRET %1%>
		Msg3 <Well, I suppose I can give you a discount... You can have the information for $ \VAL V1 . Isn't that a bargain?>
		Msg4 <I guess this could be pretty important to you... fine, I'll tell you. \SECRET %1%>
		Msg5 <You aren't THAT good. Just to show you that I still care, though, I'll give you a discount- how does $ \VAL V1 sound?>
		Msg6 <You make a very tempting offer. I'll give you the info in exchange for a rain check. \SECRET %1%e>
		Prompt1 <Alright, give me the info. [Pay $ \VAL V1 ]>
		CPrompt1 <ifG PC$ v1 Accept>
		Prompt2 <I'll be back for it some other time.>
		Prompt3 <Come on, we're family!>
		CPrompt3 <if= V2 0 ifChatNPCFamily Accept>
		Prompt4 <Couldn't I just sleep with you for it?>
		CPrompt4 <if= V2 0 ifChatNPCLover Accept>
		Prompt5 <Oh come on, after all we've been through together...>
		CPrompt5 <if= V2 0 ifChatNPCFriend Accept>
	end

