10 static const int RESPAWN_COOLDOWN = 60000;
29 [
RplProp(onRplName:
"OnFactionChanged")]
32 [
RplProp(onRplName:
"OnParentFactionIDSet")]
54 super.OnPostInit(owner);
56 m_RplComponent = RplComponent.Cast(owner.FindComponent(RplComponent));
69 if (world.GetWorldTime() > 10000)
82 if (RplSession.Mode() == RplMode.Dedicated)
92 super.OnDelete(owner);
102 if (RplSession.Mode() != RplMode.Dedicated)
116 array<SCR_MilitaryBaseComponent> bases = {};
120 vector truckPosition =
GetOwner().GetOrigin();
125 foreach (SCR_MilitaryBaseComponent base : bases)
129 if (!campaignBase || !campaignBase.IsInitialized())
132 if (campaignBase.IsHQ() && campaignBase.GetFaction() !=
m_ParentFaction)
135 if (vector.DistanceSqXZ(truckPosition, campaignBase.GetOwner().GetOrigin()) < radioRange)
183 props.SetLineWidth(hq.GetLineWidth());
185 Color c = Color.FromInt(props.GetLineColor().PackToInt());
195 MapItem otherEnd = link.Target();
198 otherEnd = link.Owner();
200 IEntity otherEndOwner = otherEnd.Entity();
213 c.SetA(linesData.GetHighlightedAlpha());
217 c.SetA(linesData.GetDefaultAlpha());
220 props.SetLineColor(c);
229 base.GetMapDescriptor().HandleMapLinks(onDelete);
234 base.GetMapDescriptor().HandleMapLinks();
271 Replication.BumpMe();
284 SCR_CampaignFactionManager fManager = SCR_CampaignFactionManager.Cast(
GetGame().GetFactionManager());
292 if (RplSession.Mode() != RplMode.Dedicated)
294 SCR_MapDescriptorComponent mapDescriptor = SCR_MapDescriptorComponent.Cast(
GetOwner().FindComponent(SCR_MapDescriptorComponent));
308 m_MapItem.SetFactionIndex(EFactionMapID.WEST);
314 m_MapItem.SetFactionIndex(EFactionMapID.EAST);
320 m_MapItem.SetFactionIndex(EFactionMapID.UNKNOWN);
359 int GetBasesInRange(notnull out array<SCR_CampaignMilitaryBaseComponent> basesInRange)
381 SCR_CampaignFactionManager fManager = SCR_CampaignFactionManager.Cast(
GetGame().GetFactionManager());
391 fKey = f.GetFactionKey();
418 Replication.BumpMe();
439 if (refreshLinks && RplSession.Mode() != RplMode.Dedicated)
443 base.GetMapDescriptor().HandleMapLinks();
449 if (damageComponent && damageComponent.GetState() ==
EDamageState.DESTROYED)
456 IEntity vehicle =
GetOwner().GetParent();
460 BaseRadioComponent radioComponent = BaseRadioComponent.Cast(vehicle.FindComponent(BaseRadioComponent));
463 radioComponent.SetPower(
false);
474 Replication.BumpMe();
481 Replication.BumpMe();
497 ImageWidget respawnImg;
499 ResourceName imageset = hq.GetBuildingIconImageset();
503 respawn = TextWidget.Cast(w.FindAnyWidget(
"Respawn"));
504 respawnImg = ImageWidget.Cast(w.FindAnyWidget(
"RespawnIMG"));
505 respawnImg.LoadImageFromSet(0, imageset,
"RespawnBig");
514 if (RplSession.Mode() != RplMode.Dedicated)
517 s_OnUpdateRespawnCooldown.Invoke();
520 respawn.SetVisible(
true);
521 respawnImg.SetVisible(
true);
532 respawn.SetTextFormat(
"#AR-Campaign_MobileAssemblyCooldown", m, sStr);
542 if (RplSession.Mode() != RplMode.Dedicated)
544 respawn.SetVisible(
false);
545 respawnImg.SetVisible(
false);
553 s_OnUpdateRespawnCooldown.Invoke();
558 Replication.BumpMe();