Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_MilitaryBaseComponent.c
Go to the documentation of this file.
1void ScriptInvokerServiceUnregisteredMethod(SCR_MilitaryBaseComponent militaryBaseComponent, SCR_ServicePointComponent serviceComponent);
3typedef ScriptInvokerBase<ScriptInvokerServiceUnregisteredMethod> ScriptInvokerServiceUnregistered;
4
6{
7 static override bool DependsOn(string className)
8 {
9 return className.ToType().IsInherited(FactionAffiliationComponent);
10 }
11
12 static override array<typename> Requires(IEntityComponentSource src)
13 {
14 return {FactionAffiliationComponent};
15 }
16}
17
18class SCR_MilitaryBaseComponent : ScriptComponent
19{
20 [Attribute("100"), RplProp(onRplName: "OnRadiusChanged")]
21 protected int m_iRadius;
22
23 [Attribute("0", desc: "Not all capture points controlled are required for seizing this base, only the majority.")]
24 protected bool m_bSeizedByMajority;
25
26 [Attribute("1")]
27 protected bool m_bShowNotifications;
28
29 [Attribute("1")]
30 protected bool m_bShowMapIcon;
31
32 [Attribute(ENotification.BASE_SEIZING_DONE_FRIENDLIES.ToString(), uiwidget: UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(ENotification))]
33 protected ENotification m_eCapturedByFriendliesNotification;
34
35 [Attribute(ENotification.BASE_SEIZING_DONE_ENEMIES.ToString(), uiwidget: UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(ENotification))]
36 protected ENotification m_eCapturedByEnemiesNotification;
37
38 static const int INVALID_BASE_CALLSIGN = -1;
39
40 protected int m_iCallsignSignal = INVALID_BASE_CALLSIGN;
41
42 protected string m_sCallsign;
43 protected string m_sCallsignUpper;
44 protected string m_sCallsignNameOnly;
45 protected string m_sCallsignNameOnlyUC;
46
47 protected ref ScriptInvoker m_OnRadiusChanged;
48 protected ref ScriptInvoker m_OnServiceRegistered;
49 protected ref ScriptInvokerServiceUnregistered m_OnServiceUnregistered;
50
51 protected ref array<SCR_MilitaryBaseLogicComponent> m_aSystems = {};
52 protected ref array<SCR_ServicePointDelegateComponent> m_aServiceDelegates = {};
53
54 protected RplComponent m_RplComponent;
56
57 [RplProp(onRplName: "OnCapturingFactionChanged")]
59
60 [RplProp(onRplName: "OnCallsignAssigned")]
61 protected int m_iCallsign = INVALID_BASE_CALLSIGN;
62
65
66 //------------------------------------------------------------------------------------------------
74
75 //------------------------------------------------------------------------------------------------
83
84 //------------------------------------------------------------------------------------------------
85 protected bool IsProxy()
86 {
87 return (m_RplComponent && m_RplComponent.IsProxy());
88 }
89
90 //------------------------------------------------------------------------------------------------
93 void AllowNotifications(bool allow)
94 {
95 m_bShowNotifications = allow;
96 }
97
98 //------------------------------------------------------------------------------------------------
102 {
103 return m_bShowNotifications;
104 }
105
106 //------------------------------------------------------------------------------------------------
109 {
111 Replication.BumpMe();
113 }
114
115 //------------------------------------------------------------------------------------------------
118 {
120 Replication.BumpMe();
122 }
123
124 //------------------------------------------------------------------------------------------------
127 {
128 if (!m_OnRadiusChanged)
129 m_OnRadiusChanged = new ScriptInvoker();
130
131 return m_OnRadiusChanged;
132 }
133
134 //------------------------------------------------------------------------------------------------
137 {
138 if (!m_OnServiceRegistered)
139 m_OnServiceRegistered = new ScriptInvoker();
140
141 return m_OnServiceRegistered;
142 }
143
144 //------------------------------------------------------------------------------------------------
147 {
148 if (!m_OnServiceUnregistered)
149 m_OnServiceUnregistered = new ScriptInvokerServiceUnregistered();
150
151 return m_OnServiceUnregistered;
152 }
153
154 //------------------------------------------------------------------------------------------------
156 void SetCallsign(notnull SCR_Faction faction)
157 {
158 if (m_iCallsign == INVALID_BASE_CALLSIGN)
159 return;
160
161 SCR_MilitaryBaseCallsign callsignInfo = faction.GetBaseCallsignByIndex(m_iCallsign);
162
163 if (!callsignInfo)
164 return;
165
166 m_sCallsign = callsignInfo.GetCallsign();
167 m_sCallsignNameOnly = callsignInfo.GetCallsignShort();
168 m_sCallsignNameOnlyUC = callsignInfo.GetCallsignUpperCase();
169 m_iCallsignSignal = callsignInfo.GetSignalIndex();
170 }
171
172
173 //------------------------------------------------------------------------------------------------
176 {
177 return m_iCallsign;
178 }
179
180 //------------------------------------------------------------------------------------------------
183 {
184 return m_iCallsignSignal;
185 }
186
187 //------------------------------------------------------------------------------------------------
190 {
191 SCR_Faction faction = SCR_Faction.Cast(SCR_FactionManager.SGetLocalPlayerFaction());
192 if (faction)
193 {
194 SetCallsign(faction);
195 return;
196 }
197
198 PlayerController pc = GetGame().GetPlayerController();
199 if (!pc)
200 return;
201
203 if (!playerFactionAff)
204 return;
205
207 }
208
209 //------------------------------------------------------------------------------------------------
211 {
212 SCR_Faction faction = SCR_Faction.Cast(current);
213 if (!faction)
214 return;
215
216 SetCallsign(faction);
217 }
218
219 //------------------------------------------------------------------------------------------------
222 {
223 return m_sCallsignNameOnly;
224 }
225
226 //------------------------------------------------------------------------------------------------
229 {
230 return m_sCallsign;
231 }
232
233 //------------------------------------------------------------------------------------------------
236 {
237 return m_sCallsignNameOnlyUC;
238 }
239
240 //------------------------------------------------------------------------------------------------
243 {
244 return m_sCallsignUpper;
245 }
246
247 //------------------------------------------------------------------------------------------------
251 int GetServices(out array<SCR_ServicePointComponent> services = null)
252 {
253 int count;
254
255 foreach (SCR_MilitaryBaseLogicComponent component : m_aSystems)
256 {
257 SCR_ServicePointComponent service = SCR_ServicePointComponent.Cast(component);
258
259 if (service)
260 {
261 count++;
262
263 if (services)
264 services.Insert(service);
265 }
266 }
267
268 return count;
269 }
270
271 //------------------------------------------------------------------------------------------------
275 int GetServicesByType(out array<SCR_ServicePointComponent> services, SCR_EServicePointType type)
276 {
277 int count;
278
279 foreach (SCR_MilitaryBaseLogicComponent component : m_aSystems)
280 {
281 SCR_ServicePointComponent service = SCR_ServicePointComponent.Cast(component);
282
283 if (service && service.GetType() == type)
284 {
285 count++;
286
287 if (services)
288 services.Insert(service);
289 }
290 }
291
292 return count;
293 }
294
295 //------------------------------------------------------------------------------------------------
298 SCR_ServicePointComponent GetServiceByLabel(EEditableEntityLabel label)
299 {
300 foreach (SCR_MilitaryBaseLogicComponent component : m_aSystems)
301 {
302 SCR_ServicePointComponent service = SCR_ServicePointComponent.Cast(component);
303
304 if (service && service.GetLabel() == label)
305 return service;
306 }
307
308 return null;
309 }
310
311 //------------------------------------------------------------------------------------------------
314 SCR_ServicePointComponent GetServiceByType(SCR_EServicePointType type)
315 {
316 foreach (SCR_MilitaryBaseLogicComponent component : m_aSystems)
317 {
318 SCR_ServicePointComponent service = SCR_ServicePointComponent.Cast(component);
319
320 if (service && service.GetType() == type)
321 return service;
322 }
323
324 return null;
325 }
326
327 //------------------------------------------------------------------------------------------------
330 int GetServiceDelegates(out array<SCR_ServicePointDelegateComponent> delegates = null)
331 {
332 int count;
333
334 foreach (SCR_ServicePointDelegateComponent delegate : m_aServiceDelegates)
335 {
336 if (delegate)
337 {
338 count++;
339
340 if (delegates)
341 delegates.Insert(delegate);
342 }
343 }
344
345 return count;
346 }
347
348 //------------------------------------------------------------------------------------------------
352 int GetServiceDelegatesByType(out array<SCR_ServicePointDelegateComponent> delegates, SCR_EServicePointType type)
353 {
354 int count;
355
356 foreach (SCR_ServicePointDelegateComponent delegate : m_aServiceDelegates)
357 {
358 if (delegate && delegate.GetType() == type)
359 {
360 count++;
361
362 if (delegates)
363 delegates.Insert(delegate);
364 }
365 }
366
367 return count;
368 }
369
370 //------------------------------------------------------------------------------------------------
373 SCR_ServicePointDelegateComponent GetServiceDelegateByLabel(EEditableEntityLabel label)
374 {
375 foreach (SCR_ServicePointDelegateComponent delegate : m_aServiceDelegates)
376 {
377 if (delegate && delegate.GetLabel() == label)
378 return delegate;
379 }
380
381 return null;
382 }
383
384 //------------------------------------------------------------------------------------------------
387 SCR_ServicePointDelegateComponent GetServiceDelegateByType(SCR_EServicePointType type)
388 {
389 foreach (SCR_ServicePointDelegateComponent delegate : m_aServiceDelegates)
390 {
391 if (delegate && delegate.GetType() == type)
392 return delegate;
393 }
394
395 return null;
396 }
397
398 //------------------------------------------------------------------------------------------------
400 int GetBuildingProviders(out array<SCR_CampaignBuildingProviderComponent> providers)
401 {
402 int count;
403 SCR_CampaignBuildingProviderComponent provider;
404
405 providers.Clear();
406
407 foreach (SCR_MilitaryBaseLogicComponent component : m_aSystems)
408 {
409 provider = SCR_CampaignBuildingProviderComponent.Cast(component);
410
411 if (provider)
412 {
413 count++;
414
415 if (providers)
416 providers.Insert(provider);
417 }
418 }
419
420 return count;
421 }
422
423 //------------------------------------------------------------------------------------------------
427 int GetCapturePoints(out array<SCR_SeizingComponent> capturePoints)
428 {
429 int count;
430
431 foreach (SCR_MilitaryBaseLogicComponent component : m_aSystems)
432 {
433 SCR_SeizingComponent capturePoint = SCR_SeizingComponent.Cast(component);
434
435 if (capturePoint)
436 {
437 count++;
438
439 if (capturePoints)
440 capturePoints.Insert(capturePoint);
441 }
442 }
443
444 return count;
445 }
446
447 //------------------------------------------------------------------------------------------------
451 int GetFlags(out array<SCR_FlagComponent> flags)
452 {
453 int count;
454
455 foreach (SCR_MilitaryBaseLogicComponent component : m_aSystems)
456 {
457 SCR_FlagComponent flag = SCR_FlagComponent.Cast(component);
458
459 if (flag)
460 {
461 count++;
462
463 if (flags)
464 flags.Insert(flag);
465 }
466 }
467
468 return count;
469 }
470
471 //------------------------------------------------------------------------------------------------
473 void SetRadius(int radius)
474 {
475 if (IsProxy())
476 return;
477
478 if (radius == m_iRadius)
479 return;
480
481 if (radius <= 0)
482 {
483 Print("SCR_MilitaryBaseComponent: SetRadius called with suspicious value (" + radius + ").", LogLevel.WARNING);
484 radius = 0;
485 }
486
487 m_iRadius = radius;
488
489 Replication.BumpMe();
491 }
492
493 //------------------------------------------------------------------------------------------------
494 protected void OnRadiusChanged()
495 {
496 if (m_OnRadiusChanged)
497 m_OnRadiusChanged.Invoke(m_iRadius, this);
498 }
499
500 //------------------------------------------------------------------------------------------------
503 {
504 return m_iRadius;
505 }
506
507 //------------------------------------------------------------------------------------------------
509 void SetFaction(Faction faction)
510 {
511 if (IsProxy())
512 return;
513
515 return;
516
517 m_FactionComponent.SetAffiliatedFaction(faction);
518 }
519
520 //------------------------------------------------------------------------------------------------
522 void SetFaction(FactionKey faction)
523 {
524 if (IsProxy())
525 return;
526
528 return;
529
530 m_FactionComponent.SetAffiliatedFactionByKey(faction);
531 }
532
533 //------------------------------------------------------------------------------------------------
534 protected void OnFactionChanged(FactionAffiliationComponent owner, Faction previousFaction, Faction faction)
535 {
536 if (!GetGame().InPlayMode())
537 return;
538
539 if (!IsProxy())
541
542 foreach (SCR_MilitaryBaseLogicComponent comp : m_aSystems)
543 {
544 if (!comp)
545 continue;
546
547 comp.OnBaseFactionChanged(faction);
548 }
549
551 if (!faction)
552 return;
553
554 ChangeFlags(faction);
555
556 if (m_bShowNotifications)
557 NotifyPlayerInRadius(faction);
558 }
559
560 //------------------------------------------------------------------------------------------------
563 Faction GetFaction(bool checkDefaultFaction = false)
564 {
566 return null;
567
568 Faction faction = m_FactionComponent.GetAffiliatedFaction();
569
570 if (!faction && checkDefaultFaction)
571 faction = m_FactionComponent.GetDefaultAffiliatedFaction();
572
573 return faction;
574 }
575
576 //------------------------------------------------------------------------------------------------
579 {
580 FactionManager fManager = GetGame().GetFactionManager();
581
582 if (!fManager)
583 return null;
584
585 return fManager.GetFactionByKey(m_sCapturingFaction);
586 }
587
588 //------------------------------------------------------------------------------------------------
592 // To be overridden in inherited classes
593 void OnServiceStateChanged(SCR_EServicePointStatus state, notnull SCR_ServicePointComponent serviceComponent)
594 {
595
596 }
597
598 //------------------------------------------------------------------------------------------------
601 void RegisterServiceDelegate(notnull SCR_ServicePointDelegateComponent delegate)
602 {
603 m_aServiceDelegates.Insert(delegate);
604 }
605
606 //------------------------------------------------------------------------------------------------
609 void UnregisterServiceDelegate(notnull SCR_ServicePointDelegateComponent delegate)
610 {
611 m_aServiceDelegates.RemoveItem(delegate);
612 }
613
614 //------------------------------------------------------------------------------------------------
617 void RegisterLogicComponent(notnull SCR_MilitaryBaseLogicComponent component)
618 {
619 if (m_aSystems.Contains(component))
620 return;
621
622 m_aSystems.Insert(component);
623
624 SCR_ServicePointComponent service = SCR_ServicePointComponent.Cast(component);
625
626 if (service)
627 {
628 if (m_OnServiceRegistered)
629 m_OnServiceRegistered.Invoke(this, service);
630
631 OnServiceStateChanged(service.GetServiceState(), service);
632 service.GetOnServiceStateChanged().Insert(OnServiceStateChanged);
633 }
634
636
637 SCR_FlagComponent flag = SCR_FlagComponent.Cast(component);
638
639 if (flag && GetFaction())
640 GetGame().GetCallqueue().CallLater(UpdateFlags, 500, false); // Give the system time to properly register slots
641
642 if (!IsProxy())
643 {
644 SCR_SeizingComponent seizingComponent = SCR_SeizingComponent.Cast(component);
645
646 if (seizingComponent)
647 {
648 seizingComponent.GetOnCaptureFinish().Insert(OnPointCaptured);
649 seizingComponent.GetOnCaptureStart().Insert(OnPointContested);
650 seizingComponent.GetOnCaptureInterrupt().Insert(OnPointSecured);
651 }
652 }
653
655 m_OnMilitaryBaseRegistered.Invoke(component);
656 }
657
658 //------------------------------------------------------------------------------------------------
661 void UnregisterLogicComponent(notnull SCR_MilitaryBaseLogicComponent component)
662 {
663 if (!m_aSystems.Contains(component))
664 return;
665
666 m_aSystems.RemoveItem(component);
667
668 SCR_ServicePointComponent service = SCR_ServicePointComponent.Cast(component);
670
671 if (baseManager)
672 baseManager.OnLogicUnregisteredInBase(component, this);
673
674 if (service && baseManager)
675 {
676 service.GetOnServiceStateChanged().Remove(OnServiceStateChanged);
677
678 if (m_OnServiceUnregistered)
679 m_OnServiceUnregistered.Invoke(this, service);
680 }
681
682 if (!IsProxy())
683 {
684 SCR_SeizingComponent seizingComponent = SCR_SeizingComponent.Cast(component);
685
686 if (seizingComponent)
687 {
688 seizingComponent.GetOnCaptureFinish().Remove(OnPointCaptured);
689 seizingComponent.GetOnCaptureStart().Remove(OnPointContested);
690 seizingComponent.GetOnCaptureInterrupt().Remove(OnPointSecured);
691 }
692 }
693
695 m_OnMilitaryBaseUnregistered.Invoke(component);
696 }
697
698 //------------------------------------------------------------------------------------------------
702 void OnPointCaptured(notnull SCR_Faction faction, notnull SCR_SeizingComponent point)
703 {
704 if (faction == GetFaction())
705 return;
706
707 array<SCR_SeizingComponent> capturePoints = {};
708 int pointsCount = GetCapturePoints(capturePoints);
709 int controlled;
710
711 foreach (SCR_SeizingComponent capturePoint : capturePoints)
712 {
713 if (capturePoint == point || capturePoint.GetFaction() == faction)
714 controlled++;
715 }
716
717 // Capture this base if the required amount of registered capture points has been seized
718 if (pointsCount == controlled || (m_bSeizedByMajority && controlled > (pointsCount - controlled)))
720 }
721
722 //------------------------------------------------------------------------------------------------
726 void OnPointContested(notnull SCR_Faction faction, notnull SCR_SeizingComponent point)
727 {
728 if (faction == GetFaction())
729 return;
730
731 array<SCR_SeizingComponent> capturePoints = {};
732 int pointsCount = GetCapturePoints(capturePoints);
733 int controlled;
734
735 foreach (SCR_SeizingComponent capturePoint : capturePoints)
736 {
737 if (capturePoint.GetFaction() == faction)
738 controlled++;
739 }
740
741 // This base is currently being seized
742 if (controlled + 1 == pointsCount || (m_bSeizedByMajority && controlled + 1 > (pointsCount - controlled)))
743 {
744 m_sCapturingFaction = faction.GetFactionKey();
746 }
747 }
748
749 //------------------------------------------------------------------------------------------------
753 void OnPointSecured(notnull SCR_Faction faction, notnull SCR_SeizingComponent point)
754 {
755 if (faction != GetCapturingFaction())
756 return;
757
758 array<SCR_SeizingComponent> capturePoints = {};
759 int pointsCount = GetCapturePoints(capturePoints);
760 int controlled;
761
762 foreach (SCR_SeizingComponent capturePoint : capturePoints)
763 {
764 if (capturePoint.GetFaction() == faction)
765 controlled++;
766 }
767
768 // This base is no longer being seized
769 if (controlled + 1 == pointsCount || (m_bSeizedByMajority && controlled + 1 > (pointsCount - controlled)))
770 {
773 }
774 }
775
776 //------------------------------------------------------------------------------------------------
780 {
781 SetFaction(faction);
782 }
783
784 //------------------------------------------------------------------------------------------------
787 {
788 foreach (SCR_MilitaryBaseLogicComponent comp : m_aSystems)
789 {
790 if (!comp)
791 continue;
792
793 comp.OnCapturingFactionChanged(m_sCapturingFaction);
794 }
795 }
796
797 //------------------------------------------------------------------------------------------------
798 protected void UpdateFlags()
799 {
800 Faction faction = GetFaction();
801 if (!faction)
802 return;
803
804 ChangeFlags(faction);
805 }
806
807 //------------------------------------------------------------------------------------------------
808 protected void ChangeFlags(notnull Faction faction)
809 {
810 SCR_Faction factionCast = SCR_Faction.Cast(faction);
811
812 if (!factionCast)
813 return;
814
815 array<SCR_FlagComponent> flags = {};
817
818 foreach (SCR_FlagComponent flagComponent : flags)
819 {
820 flagComponent.ChangeMaterial(factionCast.GetFactionFlagMaterial());
821 }
822 }
823
824 //------------------------------------------------------------------------------------------------
825 protected bool GetIsLocalPlayerPresent()
826 {
827 IEntity player = GetGame().GetPlayerManager().GetPlayerControlledEntity(SCR_PlayerController.GetLocalPlayerId());
828
829 if (!player)
830 return false;
831
832 return GetIsEntityPresent(player);
833 }
834
835 //------------------------------------------------------------------------------------------------
838 bool GetIsEntityPresent(notnull IEntity entity)
839 {
840 return (vector.DistanceSqXZ(entity.GetOrigin(), GetOwner().GetOrigin()) <= (m_iRadius * m_iRadius));
841 }
842
843 //------------------------------------------------------------------------------------------------
844 protected void NotifyPlayerInRadius(notnull Faction faction)
845 {
846 Faction playerFaction = SCR_FactionManager.SGetLocalPlayerFaction();
847
848 if (!playerFaction)
849 return;
850
852 return;
853
854 if (playerFaction == faction)
855 SCR_NotificationsComponent.SendLocal(m_eCapturedByFriendliesNotification);
856 else
857 SCR_NotificationsComponent.SendLocal(m_eCapturedByEnemiesNotification);
858 }
859
860 //------------------------------------------------------------------------------------------------
861 override void EOnInit(IEntity owner)
862 {
863 super.EOnInit(owner);
864
865 // Check for play mode again in case init event was set from outside of this class
866 if (!GetGame().InPlayMode())
867 return;
868
870
871 if (baseManager)
872 baseManager.RegisterBase(this);
873 }
874
875 //------------------------------------------------------------------------------------------------
876 override void OnPostInit(IEntity owner)
877 {
878 super.OnPostInit(owner);
879
880 m_RplComponent = RplComponent.Cast(owner.FindComponent(RplComponent));
882
883 // Attributes check
884 if (!m_RplComponent)
885 Print("SCR_MilitaryBaseComponent: RplComponent not found on owner entity. Multiplayer functionality will not be available.", LogLevel.WARNING);
886
888 Print("SCR_MilitaryBaseComponent: SCR_FactionAffiliationComponent not found on owner entity. Faction handling will not be available.", LogLevel.WARNING);
889
890 if (m_iRadius <= 0)
891 {
892 Print("SCR_MilitaryBaseComponent: m_iRadius set to suspicious value (" + m_iRadius + ").", LogLevel.WARNING);
893 m_iRadius = 0;
894 }
895
896 if (!GetGame().InPlayMode())
897 return;
898
900 m_FactionComponent.GetOnFactionChanged().Insert(OnFactionChanged);
901
902 SetEventMask(owner, EntityEvent.INIT);
903 }
904
905 override void OnDelete(IEntity owner)
906 {
908
909 if (baseManager)
910 baseManager.UnregisterBase(this);
911
912 foreach (SCR_MilitaryBaseLogicComponent component : m_aSystems)
913 {
914 if (component)
915 component.UnregisterBase(this);
916 }
917 }
918}
SCR_EAIThreatSectorFlags flags
EEditableEntityLabel
ENotification
ArmaReforgerScripted GetGame()
Definition game.c:1398
vector GetOrigin()
FactionAffiliationComponent m_FactionComponent
SCR_CacheNoteComponentClass ScriptComponentClass RplProp()] protected ref array< string > m_aLines
void OnFactionChanged(Faction faction)
RplComponent m_RplComponent
override void OnServiceStateChanged(SCR_EServicePointStatus state, notnull SCR_ServicePointComponent serviceComponent)
override void SetCallsign(notnull SCR_Faction faction)
override void OnCapturingFactionChanged()
Event which is triggered when the capturing faction changes.
override void SetCallsignIndexAutomatic(int index)
void SetFaction(SCR_CampaignFaction faction)
override void RegisterLogicComponent(notnull SCR_MilitaryBaseLogicComponent component)
SCR_CampaignFaction GetFaction()
EDamageType type
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
void SCR_FactionManager(IEntitySource src, IEntity parent)
void RegisterServiceDelegate(notnull SCR_ServicePointDelegateComponent delegate)
int GetCallsignSignal()
LocalizedString GetCallsignDisplayName()
Faction GetCapturingFaction()
ScriptInvokerServiceUnregistered GetOnServiceUnregistered()
void OnCallsignAssigned()
int GetServiceDelegatesByType(out array< SCR_ServicePointDelegateComponent > delegates, SCR_EServicePointType type)
SCR_ServicePointComponent GetServiceByType(SCR_EServicePointType type)
ScriptInvoker GetOnServiceRegistered()
void OnPlayerFactionChanged(SCR_PlayerFactionAffiliationComponent component, Faction previous, Faction current)
void SetCallsignIndex(int index)
void SetRadius(int radius)
void OnRequiredPointsCaptured(notnull SCR_Faction faction)
int GetServices(out array< SCR_ServicePointComponent > services=null)
int GetCallsign()
int GetServiceDelegates(out array< SCR_ServicePointDelegateComponent > delegates=null)
LocalizedString GetCallsignDisplayNameOnly()
bool GetIsEntityPresent(notnull IEntity entity)
bool NotificationsAllowed()
ScriptInvoker GetOnRadiusChanged()
ScriptInvokerBase< ScriptInvokerServiceUnregisteredMethod > ScriptInvokerServiceUnregistered
int GetBuildingProviders(out array< SCR_CampaignBuildingProviderComponent > providers)
Get all registered systems inherited from SCR_CampaignBuildingProviderComponent.
int GetServicesByType(out array< SCR_ServicePointComponent > services, SCR_EServicePointType type)
ScriptInvoker GetOnMilitaryBaseUnregistered()
SCR_ServicePointDelegateComponent GetServiceDelegateByLabel(EEditableEntityLabel label)
void UnregisterServiceDelegate(notnull SCR_ServicePointDelegateComponent delegate)
void OnPointContested(notnull SCR_Faction faction, notnull SCR_SeizingComponent point)
void UpdateFlags()
void ChangeFlags(notnull Faction faction)
SCR_ServicePointComponent GetServiceByLabel(EEditableEntityLabel label)
int GetCapturePoints(out array< SCR_SeizingComponent > capturePoints)
SCR_ServicePointDelegateComponent GetServiceDelegateByType(SCR_EServicePointType type)
ref array< SCR_ServicePointDelegateComponent > m_aServiceDelegates
void NotifyPlayerInRadius(notnull Faction faction)
void UnregisterLogicComponent(notnull SCR_MilitaryBaseLogicComponent component)
func ScriptInvokerServiceUnregisteredMethod
void OnPointSecured(notnull SCR_Faction faction, notnull SCR_SeizingComponent point)
int GetFlags(out array< SCR_FlagComponent > flags)
ScriptInvoker GetOnMilitaryBaseRegistered()
void AllowNotifications(bool allow)
LocalizedString GetCallsignDisplayNameOnlyUC()
LocalizedString GetCallsignDisplayNameUpperCase()
FactionKey m_sCapturingFaction
void OnRadiusChanged()
bool GetIsLocalPlayerPresent()
ref ScriptInvoker< SCR_MilitaryBaseLogicComponent > m_OnMilitaryBaseUnregistered
ref ScriptInvoker< SCR_MilitaryBaseLogicComponent > m_OnMilitaryBaseRegistered
void OnPointCaptured(notnull SCR_Faction faction, notnull SCR_SeizingComponent point)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
Main replication API.
Definition Replication.c:14
ResourceName GetFactionFlagMaterial()
void OnLogicUnregisteredInBase(SCR_MilitaryBaseLogicComponent logic, SCR_MilitaryBaseComponent base)
void RegisterBase(notnull SCR_MilitaryBaseComponent base)
void UnregisterBase(notnull SCR_MilitaryBaseComponent base)
static SCR_MilitaryBaseSystem GetInstance()
void OnBaseFactionChanged(Faction faction, SCR_MilitaryBaseComponent base)
void OnLogicRegisteredInBase(SCR_MilitaryBaseLogicComponent logic, SCR_MilitaryBaseComponent base)
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
ScriptInvoker GetOnCaptureStart()
ScriptInvoker GetOnCaptureFinish()
ScriptInvoker GetOnCaptureInterrupt()
IEntity GetOwner()
Owner entity of the fuel tank.
override void EOnInit(IEntity owner)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.
Definition EntityEvent.c:14
ScriptInvokerBase< func > ScriptInvoker
Definition tools.c:134