Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_CampaignRadioRegisteringComponent.c
Go to the documentation of this file.
1
class
SCR_CampaignRadioRegisteringComponentClass
:
SCR_MilitaryBaseLogicComponentClass
2
{
3
}
4
5
class
SCR_CampaignRadioRegisteringComponent : SCR_MilitaryBaseLogicComponent
6
{
7
protected
static
const
string
RADIO_CHATTER_SIGNAL_NAME
=
"RadioChatter"
;
8
protected
static
const
string
ESTABLISH_ACTION_SIGNAL_NAME =
"EstablishAction"
;
9
10
//------------------------------------------------------------------------------------------------
11
override
void
OnCapturingFactionChanged
(
FactionKey
faction)
12
{
13
super.OnCapturingFactionChanged(faction);
14
15
// SFX not needed for headless
16
if
(
System
.IsConsoleApp())
17
return
;
18
19
// Play or stop radio tuning SFX
20
SignalsManagerComponent
comp =
SignalsManagerComponent
.Cast(
GetOwner
().FindComponent(
SignalsManagerComponent
));
21
22
if
(!comp)
23
return
;
24
25
if
(faction.IsEmpty())
26
comp.SetSignalValue(comp.AddOrFindSignal(ESTABLISH_ACTION_SIGNAL_NAME), 0);
27
else
28
comp.SetSignalValue(comp.AddOrFindSignal(ESTABLISH_ACTION_SIGNAL_NAME), 1);
29
}
30
31
//------------------------------------------------------------------------------------------------
33
override
void
OnBaseFactionChanged
(
Faction
faction)
34
{
35
super.OnBaseFactionChanged(faction);
36
37
SetRadioChatterSignal
(faction);
38
}
39
40
//------------------------------------------------------------------------------------------------
42
override
void
OnBaseRegistered
(notnull SCR_MilitaryBaseComponent
base
)
43
{
44
super.OnBaseRegistered(
base
);
45
46
SCR_CampaignMilitaryBaseComponent
campaignBase =
SCR_CampaignMilitaryBaseComponent
.Cast(
base
);
47
48
if
(!campaignBase)
49
return
;
50
51
SetRadioChatterSignal
(
base
.GetFaction());
52
}
53
54
//------------------------------------------------------------------------------------------------
56
void
SetRadioChatterSignal
(
Faction
faction)
57
{
58
// SFX not needed for headless
59
if
(
System
.IsConsoleApp())
60
return
;
61
62
SCR_GameModeCampaign
campaign =
SCR_GameModeCampaign
.GetInstance();
63
64
if
(!campaign)
65
return
;
66
67
SignalsManagerComponent
comp =
SignalsManagerComponent
.Cast(
GetOwner
().FindComponent(
SignalsManagerComponent
));
68
69
if
(!comp)
70
return
;
71
72
if
(!faction || faction.GetFactionKey() == campaign.GetFactionKeyByEnum(
SCR_ECampaignFaction
.INDFOR))
73
{
74
comp.SetSignalValue(comp.AddOrFindSignal(
RADIO_CHATTER_SIGNAL_NAME
), 0);
75
}
76
else
77
{
78
if
(faction.GetFactionKey() == campaign.GetFactionKeyByEnum(
SCR_ECampaignFaction
.BLUFOR))
79
comp.SetSignalValue(comp.AddOrFindSignal(
RADIO_CHATTER_SIGNAL_NAME
), 1);
80
else
81
comp.SetSignalValue(comp.AddOrFindSignal(
RADIO_CHATTER_SIGNAL_NAME
), 2);
82
}
83
}
84
}
SCR_ECampaignFaction
SCR_ECampaignFaction
Definition
SCR_CampaignFactionManager.c:134
OnBaseFactionChanged
void OnBaseFactionChanged(notnull SCR_MilitaryBaseComponent base, Faction faction)
Definition
SCR_CampaignFeedbackComponent.c:1029
OnCapturingFactionChanged
override void OnCapturingFactionChanged()
Event which is triggered when the capturing faction changes.
Definition
SCR_CampaignMilitaryBaseComponent.c:1391
RADIO_CHATTER_SIGNAL_NAME
SCR_CampaignRadioRegisteringComponentClass RADIO_CHATTER_SIGNAL_NAME
SetRadioChatterSignal
void SetRadioChatterSignal(Faction faction)
Definition
SCR_CampaignRadioRegisteringComponent.c:56
OnBaseRegistered
override void OnBaseRegistered(notnull SCR_MilitaryBaseComponent base)
Definition
SCR_CampaignRadioRegisteringComponent.c:42
SCR_GameModeCampaign
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
Definition
SCR_GameModeCampaign.c:1812
base
around base
Definition
SCR_HoldCampaignMilitaryBaseTaskEntity.c:9
Faction
Definition
Faction.c:13
FactionKey
Definition
FactionKey.c:3
SCR_CampaignMilitaryBaseComponent
Definition
SCR_CampaignMilitaryBaseComponent.c:38
SCR_CampaignRadioRegisteringComponentClass
Definition
SCR_CampaignRadioRegisteringComponent.c:2
SCR_MilitaryBaseLogicComponentClass
Definition
SCR_MilitaryBaseLogicComponent.c:2
SignalsManagerComponent
Definition
SignalsManagerComponent.c:13
System
Definition
System.c:13
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition
SCR_FuelNode.c:128
scripts
Game
Campaign
SCR_CampaignRadioRegisteringComponent.c
Generated by
1.17.0