Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_Tutorial_Seizing_CaptureBase.c
Go to the documentation of this file.
1[EntityEditorProps(insertable: false)]
5
6//------------------------------------------------------------------------------------------------
8{
9 SCR_FactionAffiliationComponent m_AffiliationComp;
10 SCR_PopUpNotification m_PopUpNotification;
11 SCR_SeizingComponent m_SeizingComponent;
12
13 //------------------------------------------------------------------------------------------------
14 override protected void Setup()
15 {
16 SCR_HintManagerComponent.HideHint();
17 SCR_HintManagerComponent.ClearLatestHint();
18
19 m_PopUpNotification = SCR_PopUpNotification.GetInstance();
20
21 IEntity base = GetGame().GetWorld().FindEntityByName("FakeBaseLighthouseNorth");
23 m_AffiliationComp = SCR_FactionAffiliationComponent.Cast(base.FindComponent(SCR_FactionAffiliationComponent));
24 m_AffiliationComp.SetFaction(base ,GetGame().GetFactionManager().GetFactionByKey("USSR"));
25
26 BaseGameTriggerEntity trigger;
27 IEntity child = base.GetChildren();
28 while (child)
29 {
30 if (child.IsInherited(BaseGameTriggerEntity))
31 {
32 trigger = BaseGameTriggerEntity.Cast(child);
33 break;
34 }
35
36 child = child.GetSibling();
37 }
38
39 if (trigger)
40 trigger.SetSphereRadius(12);
41
42 m_SeizingComponent = SCR_SeizingComponent.Cast(base.FindComponent(SCR_SeizingComponent));
43 m_SeizingComponent.GetOnCaptureStart().Insert(OnSeizingStarted);
44 m_SeizingComponent.GetOnCaptureInterrupt().Insert(OnSeizingInterrupted);
45
46 PlayNarrativeCharacterStage("CONFLICT_Instructor_C", 5);
47
48 }
49
50 //------------------------------------------------------------------------------------------------
51 protected void OnSeizingStarted(SCR_Faction faction, SCR_SeizingComponent seizingComponent)
52 {
53 m_PopUpNotification.PopupMsg("#AR-Campaign_SeizingFriendly-UC", -1, prio: SCR_ECampaignSeizingMessagePrio.SEIZING_YOU, progressStart: m_SeizingComponent.GetSeizingStartTimestamp(), progressEnd: m_SeizingComponent.GetSeizingEndTimestamp(), category: SCR_EPopupMsgFilter.TUTORIAL);
54 }
55
56 //------------------------------------------------------------------------------------------------
57 protected void OnSeizingInterrupted(SCR_Faction faction, SCR_SeizingComponent seizingComponent)
58 {
59 m_PopUpNotification.HideCurrentMsg();
60 }
61
62 //------------------------------------------------------------------------------------------------
63 override protected bool GetIsFinished()
64 {
65 if (m_AffiliationComp)
66 {
67 if (m_AffiliationComp.GetAffiliatedFaction() == GetGame().GetFactionManager().GetFactionByKey("USSR"))
68 return false;
69
70 IEntity fakeBase = GetGame().GetWorld().FindEntityByName("FakeBaseLighthouseNorth");
71 if (fakeBase)
72 {
73 SCR_TutorialFakeBaseComponent fakeBaseComponent = SCR_TutorialFakeBaseComponent.Cast(fakeBase.FindComponent(SCR_TutorialFakeBaseComponent));
74 if (fakeBaseComponent)
75 {
76 //TODO: SUBOPTIMAL
77 fakeBaseComponent.m_BaseColor = Color.FromRGBA(4,141,231,255);
78 fakeBaseComponent.m_eMilitarySymbolIdentity = EMilitarySymbolIdentity.BLUFOR;
79 fakeBaseComponent.m_sHighlight = "Friend_Installation_Focus_Land";
80 fakeBaseComponent.CreateLinks();
81 }
82
83 return true;
84 }
85 }
86
87 return false;
88 }
89
90 //------------------------------------------------------------------------------------------------
92 {
93 m_PopUpNotification.HideCurrentMsg();
94 m_SeizingComponent.GetOnCaptureStart().Remove(OnSeizingStarted);
95 m_SeizingComponent.GetOnCaptureInterrupt().Remove(OnSeizingInterrupted);
96 }
97};
EMilitarySymbolIdentity
ArmaReforgerScripted GetGame()
Definition game.c:1398
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
Definition Color.c:13
void IEntity(IEntitySource src, IEntity parent)
protected script Constructor
proto external Managed FindComponent(typename typeName)
proto external IEntity GetSibling()
SCR_Waypoint RegisterWaypoint(string entityName, string title=string.Empty, string icon="MISC")
void PlayNarrativeCharacterStage(string characterName, int stage)
static void SetFaction(IEntity owner, Faction faction)
Takes care of dynamic and static onscreen popups.
static SCR_PopUpNotification GetInstance()
ScriptInvoker GetOnCaptureStart()
void OnSeizingInterrupted(SCR_Faction faction, SCR_SeizingComponent seizingComponent)
void OnSeizingStarted(SCR_Faction faction, SCR_SeizingComponent seizingComponent)
FactionManagerClass GenericEntityClass GetFactionByKey(FactionKey factionKey)