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_IdentityItemStorageComponent.c
Go to the documentation of this file.
1
class
SCR_IdentityItemStorageComponentClass
:
SCR_EquipmentStorageComponentClass
2
{
3
}
4
5
class
SCR_IdentityItemStorageComponent : SCR_EquipmentStorageComponent
6
{
7
//------------------------------------------------------------------------------------------------
8
//~ Make sure the identity item is not shown if 'worn'
9
protected
override
void
OnAddedToSlot
(
IEntity
item,
int
slotID)
10
{
11
super.OnAddedToSlot(item, slotID);
12
13
InventoryItemComponent
itemComponent =
InventoryItemComponent
.Cast(item.
FindComponent
(
InventoryItemComponent
));
14
if
(!itemComponent)
15
return
;
16
17
itemComponent.HideOwner();
18
}
19
20
//------------------------------------------------------------------------------------------------
21
//~ Make sure the identity item is shown when removed from the slot
22
override
void
OnRemovedFromSlot
(
IEntity
item,
int
slotID)
23
{
24
super.OnRemovedFromSlot(item, slotID);
25
26
InventoryItemComponent
itemComponent =
InventoryItemComponent
.Cast(item.
FindComponent
(
InventoryItemComponent
));
27
if
(!itemComponent)
28
return
;
29
30
itemComponent.ShowOwner();
31
}
32
33
//------------------------------------------------------------------------------------------------
34
//~ Only allow items to be stored in the slot if the identity slot is enabled
35
override
bool
CanStoreItem
(
IEntity
item,
int
slotID)
36
{
37
SCR_IdentityManagerComponent
identityManager =
SCR_IdentityManagerComponent
.
GetInstance
();
38
39
return
identityManager && identityManager.
IsIdentityItemSlotEnabled
();
40
}
41
42
//------------------------------------------------------------------------------------------------
43
//~ Only allow items to be stored in the slot if the identity slot is enabled
44
override
bool
CanStoreResource
(
ResourceName
resourceName
,
int
slotID)
45
{
46
SCR_IdentityManagerComponent
identityManager =
SCR_IdentityManagerComponent
.
GetInstance
();
47
48
return
identityManager && identityManager.
IsIdentityItemSlotEnabled
();
49
}
50
51
//------------------------------------------------------------------------------------------------
52
//~ When identity slot is enabled it will never allow the item to be removed (Unless the item is also added when character falls Unconscious)
53
override
bool
CanRemoveItem
(
IEntity
item)
54
{
55
ChimeraCharacter
character =
ChimeraCharacter
.Cast(
GetOwner
());
56
if
(!character)
57
return
true
;
58
59
SCR_IdentityManagerComponent
identityManager =
SCR_IdentityManagerComponent
.
GetInstance
();
60
61
//~ Can remove when Unconscious
62
if
(identityManager && identityManager.
HasIdentityItemGenerationType
(
SCR_EIdentityItemGenerationType
.ON_UNCONSCIOUS))
63
{
64
//~ Character is unconcious
65
SCR_CharacterControllerComponent
controllerComponent =
SCR_CharacterControllerComponent
.Cast(character.GetCharacterController());
66
if
(controllerComponent && controllerComponent.GetLifeState() ==
ECharacterLifeState
.INCAPACITATED)
67
return
true
;
68
}
69
70
//~ Allowed to remove the item if the character is dead
71
return
character && character.GetDamageManager().GetState() ==
EDamageState
.DESTROYED;
72
}
73
74
//------------------------------------------------------------------------------------------------
75
//~ When identity slot is enabled it will never allow the item to be replaced
76
override
bool
CanReplaceItem
(
IEntity
nextItem,
int
slotID)
77
{
78
return
false
;
79
}
80
}
resourceName
ResourceName resourceName
Definition
SCR_AIGroup.c:66
CanStoreItem
override bool CanStoreItem(IEntity item, int slotID)
Definition
SCR_CampaignArmoryStorageComponent.c:37
SCR_EIdentityItemGenerationType
SCR_EIdentityItemGenerationType
When will the identity item be generated on the character.
Definition
SCR_IdentityManagerComponent.c:778
ChimeraCharacter
Definition
ChimeraCharacter.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
InventoryItemComponent
Definition
InventoryItemComponent.c:13
ResourceName
Definition
ResourceName.c:13
SCR_CharacterControllerComponent
Definition
SCR_CharacterControllerComponent.c:36
SCR_EquipmentStorageComponentClass
Definition
SCR_EquipmentStorageComponent.c:2
SCR_IdentityItemStorageComponentClass
Definition
SCR_IdentityItemStorageComponent.c:2
SCR_IdentityManagerComponent
Definition
SCR_IdentityManagerComponent.c:7
SCR_IdentityManagerComponent::GetInstance
static SCR_IdentityManagerComponent GetInstance()
Definition
SCR_IdentityManagerComponent.c:62
SCR_IdentityManagerComponent::IsIdentityItemSlotEnabled
bool IsIdentityItemSlotEnabled()
Definition
SCR_IdentityManagerComponent.c:572
SCR_IdentityManagerComponent::HasIdentityItemGenerationType
bool HasIdentityItemGenerationType(SCR_EIdentityItemGenerationType type)
Definition
SCR_IdentityManagerComponent.c:565
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition
SCR_FuelNode.c:128
ECharacterLifeState
ECharacterLifeState
Definition
ECharacterLifeState.c:13
EDamageState
EDamageState
Definition
EDamageState.c:13
OnRemovedFromSlot
void OnRemovedFromSlot(IEntity item, int slotID)
Definition
SCR_HandSlotStorageComponent.c:229
CanStoreResource
event bool CanStoreResource(ResourceName resourceName, int slotID)
Implemented logics for can insert here, Manager will provide slotID of -1 in case slot is irrelevant.
Definition
BaseInventoryStorageComponent.c:136
CanReplaceItem
event bool CanReplaceItem(IEntity nextItem, int slotID)
Implemented logics for can replace to nextItem at slotID,.
Definition
BaseInventoryStorageComponent.c:140
OnAddedToSlot
void OnAddedToSlot(IEntity item, int slotID)
Definition
SCR_HandSlotStorageComponent.c:96
CanRemoveItem
event bool CanRemoveItem(IEntity item)
Implemented logics for can remove here,.
Definition
BaseInventoryStorageComponent.c:138
scripts
Game
Inventory
SCR_IdentityItemStorageComponent.c
Generated by
1.17.0