6 protected IEntity m_TowerRadio;
7 protected bool m_bCanBeShownResult =
false;
12 static Faction GetPlayerFaction(IEntity player)
17 if (!ChimeraCharacter.Cast(player))
20 auto foundComponent = ChimeraCharacter.Cast(player).FindComponent(FactionAffiliationComponent);
25 auto castedComponent = FactionAffiliationComponent.Cast(foundComponent);
26 faction = castedComponent.GetAffiliatedFaction();
33 override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
35 if (!pOwnerEntity || !
GetGame().InPlayMode())
38 IEntity parent = pOwnerEntity.GetParent();
44 m_TowerRadio = pOwnerEntity;
45 m_Base.RegisterHQRadio(m_TowerRadio);
49 override void OnActionStart(IEntity pUserEntity)
56 override void OnActionCanceled(IEntity pOwnerEntity, IEntity pUserEntity)
63 override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
68 bool isAI =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(pUserEntity) == 0;
72 FactionAffiliationComponent comp = FactionAffiliationComponent.Cast(pUserEntity.FindComponent(FactionAffiliationComponent));
83 PlayerController playerController =
GetGame().GetPlayerController();
85 if (!playerController)
88 SCR_CampaignNetworkComponent campaignNetworkComponent = SCR_CampaignNetworkComponent.Cast(playerController.FindComponent(SCR_CampaignNetworkComponent));
90 if (campaignNetworkComponent)
91 campaignNetworkComponent.CaptureBase(m_Base);
96 override bool CanBePerformedScript(IEntity user)
99 bool isAI =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(user) == 0;
103 FactionAffiliationComponent comp = FactionAffiliationComponent.Cast(user.FindComponent(FactionAffiliationComponent));
117 if (
m_Base.GetFaction() == playerFaction)
119 SetCannotPerformReason(
"#AR-Campaign_Action_Done-UC");
124 if (m_Base != playerFaction.GetMainBase() && !
m_Base.IsHQRadioTrafficPossible(playerFaction))
126 SetCannotPerformReason(
"#AR-Campaign_Action_NoSignal-UC");
134 override bool CanBeShownScript(IEntity user)
136 return (m_Base !=
null);
140 override bool HasLocalEffectOnlyScript()