Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_CampaignPackMobileAssemblyUserAction.c
Go to the documentation of this file.
2 {
3  //------------------------------------------------------------------------------------------------
4  override bool CanBeShownScript(IEntity user)
5  {
6  if (!m_AssemblyComponent)
7  return false;
8 
9  return m_AssemblyComponent.IsDeployed();
10  }
11 
12  //------------------------------------------------------------------------------------------------
13  override bool CanBePerformedScript(IEntity user)
14  {
15  return true;
16  }
17 
18  //------------------------------------------------------------------------------------------------
19  override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
20  {
21  PlayerController playerController = GetGame().GetPlayerController();
22 
23  if (!playerController)
24  return;
25 
26  SCR_CampaignNetworkComponent campaignNetworkComponent = SCR_CampaignNetworkComponent.Cast(playerController.FindComponent(SCR_CampaignNetworkComponent));
27 
28  if (!campaignNetworkComponent)
29  return;
30 
31  campaignNetworkComponent.DeployMobileAsembly(m_AssemblyComponent, false);
32  }
33 
34  //------------------------------------------------------------------------------------------------
35  override bool GetActionNameScript(out string outName)
36  {
37  if (!m_AssemblyComponent)
38  return false;
39 
40  SCR_GameModeCampaign campaign = SCR_GameModeCampaign.GetInstance();
41 
42  if (!campaign)
43  return false;
44 
45  if (SCR_FactionManager.SGetLocalPlayerFaction() != m_AssemblyComponent.GetParentFaction())
46  return false;
47 
48  int basesCovered;
49  SCR_CampaignMobileAssemblyStandaloneComponent standaloneComponent = m_AssemblyComponent.GetStandaloneComponent();
50 
51  if (standaloneComponent)
52  basesCovered = standaloneComponent.GetCountOfExclusivelyLinkedBases();
53 
54  if (basesCovered == 0)
55  return false;
56 
57  ActionNameParams[0] = basesCovered.ToString();
58  outName = "#AR-Campaign_Action_Dismantle_BasesInfo-UC";
59  return true;
60  }
61 };
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_GameModeCampaign
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
Definition: SCR_GameModeCampaign.c:1927
SCR_CampaignPackMobileAssemblyUserAction
Definition: SCR_CampaignPackMobileAssemblyUserAction.c:1
SCR_CampaignDeployMobileAssemblyUserAction
Definition: SCR_CampaignDeployMobileAssemblyUserAction.c:1
SCR_FactionManager
void SCR_FactionManager(IEntitySource src, IEntity parent)
Definition: SCR_FactionManager.c:461