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_IdentityInventoryItemComponent.c
Go to the documentation of this file.
1
[
ComponentEditorProps
(
category
:
"GameScripted/Misc"
, description:
""
)]
2
class
SCR_IdentityInventoryItemComponentClass
:
InventoryItemComponentClass
3
{
4
}
5
6
class
SCR_IdentityInventoryItemComponent :
InventoryItemComponent
7
{
8
[
Attribute
(
"1"
,
desc
:
"Check if identity item is of a hostile faction and only then will it be considered a valuable intel. The CanShowValuableIntel() function is able to force the check for faction"
)]
9
protected
bool
m_bCheckIfItemIsHostileFaction;
10
11
[
RplProp
()]
//onRplName: "OnLinkedIdentitySet")]
12
protected
RplId
m_RplIdLinkedIdentity = -1;
13
14
[
RplProp
(onRplName:
"OnIntelFactionSet"
)]
//~ Will be set to faction int which will determine if the item has valuable intel of the given faction
15
protected
int
m_iValuableIntelFaction = -1;
16
17
protected
Faction
m_IntelFaction;
18
19
//------------------------------------------------------------------------------------------------
20
void
SCR_IdentityInventoryItemComponent(
IEntityComponentSource
src,
IEntity
ent,
IEntity
parent)
21
{
22
if
(
SCR_Global
.
IsEditMode
())
23
return
;
24
25
SCR_BaseGameMode
gameMode =
SCR_BaseGameMode
.Cast(
GetGame
().
GetGameMode
());
26
if
((gameMode && !gameMode.
IsMaster
()) || (!gameMode &&
Replication
.IsClient()))
27
return
;
28
29
//~ Call a frame later so SCR_ExtendedCharacterIdentityComponent can init correctly
30
GetGame
().GetCallqueue().CallLater(
DelayedInit
,
param1
: ent);
31
}
32
33
//------------------------------------------------------------------------------------------------
34
protected
override
bool
ShouldChangeVisibilityOfHierarchy
()
35
{
36
return
true
;
37
}
38
39
//------------------------------------------------------------------------------------------------
40
protected
void
DelayedInit
(
IEntity
owner)
41
{
42
if
(!owner)
43
return
;
44
45
ChimeraCharacter
character;
46
IEntity
parent = owner.
GetParent
();
47
48
while
(parent)
49
{
50
character =
ChimeraCharacter
.Cast(parent);
51
if
(character)
52
break
;
53
54
parent = parent.
GetParent
();
55
}
56
57
if
(!character)
58
return
;
59
60
SCR_ExtendedCharacterIdentityComponent
rootExtendedIdentity =
SCR_ExtendedCharacterIdentityComponent
.Cast(character.FindComponent(
SCR_ExtendedCharacterIdentityComponent
));
61
if
(!rootExtendedIdentity)
62
return
;
63
64
RplComponent rplComp = RplComponent.Cast(rootExtendedIdentity.GetOwner().FindComponent(RplComponent));
65
if
(!rplComp)
66
return
;
67
68
m_RplIdLinkedIdentity =
Replication
.FindItemId(rplComp);
69
70
//~ This identity holds valuable intel. So make sure that is shown
71
m_iValuableIntelFaction = rootExtendedIdentity.
OnIdentityItemAdded_S
(
this
,
SCR_IdentityManagerComponent
.
Static_IsGenerateValuableIntelEnabled
());
72
73
if
(m_iValuableIntelFaction >= 0)
74
OnIntelFactionSet
();
75
76
Replication
.BumpMe();
77
}
78
79
//------------------------------------------------------------------------------------------------
80
SCR_ExtendedIdentityComponent
GetLinkedExtendedIdentity
()
81
{
82
RplComponent rplComponent = RplComponent.Cast(
Replication
.FindItem(m_RplIdLinkedIdentity));
83
if
(!rplComponent)
84
return
null;
85
86
IEntity
owner = rplComponent.GetEntity();
87
if
(!owner)
88
return
null;
89
90
return
SCR_ExtendedIdentityComponent
.Cast(owner.
FindComponent
(
SCR_ExtendedIdentityComponent
));
91
}
92
93
//------------------------------------------------------------------------------------------------
98
bool
HasValuableIntel
(
bool
forceCheckForFaction =
false
, PlayerController playerController = null)
99
{
100
if
(m_iValuableIntelFaction < 0 || !m_IntelFaction || !
SCR_IdentityManagerComponent
.
Static_IsGenerateValuableIntelEnabled
())
101
return
false
;
102
103
if
(forceCheckForFaction ||
ShouldCheckIfItemIsHostileFaction
())
104
{
105
//~ Get local player controller if none was given
106
if
(!playerController)
107
playerController =
GetGame
().GetPlayerController();
108
109
Faction
playerFaction;
110
111
//~ Get player faction
112
if
(playerController)
113
playerFaction =
SCR_FactionManager
.SGetPlayerFaction(playerController.GetPlayerId());
114
else
115
playerFaction =
SCR_FactionManager
.SGetLocalPlayerFaction();
116
117
if
(!playerFaction)
118
return
false
;
119
120
//~ Only show intel for hostile faction identity items
121
SCR_Faction
scrFaction =
SCR_Faction
.Cast(playerFaction);
122
if
((scrFaction && scrFaction.
DoCheckIfFactionFriendly
(m_IntelFaction)) || (!scrFaction && playerFaction.IsFactionFriendly(m_IntelFaction)))
123
return
false
;
124
}
125
126
return
true
;
127
}
128
129
//------------------------------------------------------------------------------------------------
131
bool
ShouldCheckIfItemIsHostileFaction
()
132
{
133
return
m_bCheckIfItemIsHostileFaction;
134
}
135
136
//------------------------------------------------------------------------------------------------
137
int
GetValuableIntelFactionID
()
138
{
139
return
m_iValuableIntelFaction;
140
}
141
142
//------------------------------------------------------------------------------------------------
143
Faction
GetValuableIntelFaction
()
144
{
145
return
m_IntelFaction;
146
}
147
148
//------------------------------------------------------------------------------------------------
149
SCR_CallsignBaseComponent
GetLinkedCallsignComponent
()
150
{
151
RplComponent rplComponent = RplComponent.Cast(
Replication
.FindItem(m_RplIdLinkedIdentity));
152
if
(!rplComponent)
153
return
null;
154
155
IEntity
owner = rplComponent.GetEntity();
156
if
(!owner)
157
return
null;
158
159
return
SCR_CallsignBaseComponent
.Cast(owner.
FindComponent
(
SCR_CallsignBaseComponent
));
160
}
161
162
//------------------------------------------------------------------------------------------------
163
protected
void
OnIntelFactionSet
()
164
{
165
if
(m_iValuableIntelFaction < 0)
166
return
;
167
168
m_IntelFaction =
GetGame
().GetFactionManager().GetFactionByIndex(m_iValuableIntelFaction);
169
}
170
171
//------------------------------------------------------------------------------------------------
172
/*void ReplicateIdentity()
173
{
174
//~ Call on Parent changed
175
176
//~ Create the identity component
177
//~ Send over values
178
//~ Fill in the identity components with given values
179
180
//~ Other values to set up are: GroupCallsign, Rank
181
}*/
182
183
//------------------------------------------------------------------------------------------------
184
/*protected void OnLinkedIdentitySet()
185
{
186
//Print(m_RplIdLinkedIdentity);
187
} */
188
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
ComponentEditorProps
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
Definition
SCR_AIGroupUtilityComponent.c:12
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition
SCR_BaseGameModeComponent.c:15
DelayedInit
override void DelayedInit(IEntity owner)
Definition
SCR_BaseItemSupportStationComponent.c:17
RplProp
SCR_CacheNoteComponentClass ScriptComponentClass RplProp()] protected ref array< string > m_aLines
DelayedInit
override void DelayedInit()
Definition
SCR_CharacterIdentityBioGroupConfig.c:270
SCR_FactionManager
void SCR_FactionManager(IEntitySource src, IEntity parent)
Definition
SCR_FactionManager.c:498
GetLinkedCallsignComponent
SCR_CallsignBaseComponent GetLinkedCallsignComponent()
Definition
SCR_IdentityInventoryItemComponent.c:149
OnIntelFactionSet
void OnIntelFactionSet()
Definition
SCR_IdentityInventoryItemComponent.c:163
ShouldCheckIfItemIsHostileFaction
bool ShouldCheckIfItemIsHostileFaction()
Definition
SCR_IdentityInventoryItemComponent.c:131
HasValuableIntel
bool HasValuableIntel(bool forceCheckForFaction=false, PlayerController playerController=null)
Definition
SCR_IdentityInventoryItemComponent.c:98
GetValuableIntelFaction
Faction GetValuableIntelFaction()
Definition
SCR_IdentityInventoryItemComponent.c:143
GetValuableIntelFactionID
int GetValuableIntelFactionID()
Definition
SCR_IdentityInventoryItemComponent.c:137
GetLinkedExtendedIdentity
SCR_ExtendedIdentityComponent GetLinkedExtendedIdentity()
Definition
SCR_IdentityInventoryItemComponent.c:80
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
ChimeraCharacter
Definition
ChimeraCharacter.c:13
Faction
Definition
Faction.c:13
IEntityComponentSource
Definition
IEntityComponentSource.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
IEntity::GetParent
proto external IEntity GetParent()
InventoryItemComponentClass
Definition
InventoryItemComponentClass.c:13
InventoryItemComponent
Definition
InventoryItemComponent.c:13
InventoryItemComponent::ShouldChangeVisibilityOfHierarchy
bool ShouldChangeVisibilityOfHierarchy()
Definition
InventoryItemComponent.c:84
Replication
Main replication API.
Definition
Replication.c:14
RplId
Replication item identifier.
Definition
RplId.c:14
SCR_BaseGameMode
Definition
SCR_BaseGameMode.c:139
SCR_BaseGameMode::IsMaster
sealed bool IsMaster()
Definition
SCR_BaseGameMode.c:367
SCR_CallsignBaseComponent
Component of assigning and storing squad names.
Definition
SCR_CallsignBaseComponent.c:12
SCR_ExtendedCharacterIdentityComponent
Definition
SCR_ExtendedCharacterIdentityComponent.c:6
SCR_ExtendedCharacterIdentityComponent::OnIdentityItemAdded_S
int OnIdentityItemAdded_S(SCR_IdentityInventoryItemComponent item, bool generateValuableIntel)
Definition
SCR_ExtendedCharacterIdentityComponent.c:134
SCR_ExtendedIdentityComponent
Definition
SCR_ExtendedIdentityComponent.c:6
SCR_Faction
Definition
SCR_Faction.c:6
SCR_Faction::DoCheckIfFactionFriendly
override bool DoCheckIfFactionFriendly(Faction faction)
Definition
SCR_Faction.c:504
SCR_Global
Definition
Functions.c:7
SCR_Global::IsEditMode
static bool IsEditMode()
Definition
Functions.c:1566
SCR_IdentityInventoryItemComponentClass
Definition
SCR_IdentityInventoryItemComponent.c:3
SCR_IdentityManagerComponent
Definition
SCR_IdentityManagerComponent.c:7
SCR_IdentityManagerComponent::Static_IsGenerateValuableIntelEnabled
static bool Static_IsGenerateValuableIntelEnabled()
Definition
SCR_IdentityManagerComponent.c:593
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
param1
Tuple param1
scripts
Game
Inventory
SCR_IdentityInventoryItemComponent.c
Generated by
1.17.0