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_WeaponStatsManagerComponent.c
Go to the documentation of this file.
1
class
SCR_WeaponStatsManagerComponentClass
:
BaseWeaponStatsManagerComponentClass
2
{
3
}
4
5
class
SCR_WeaponStatsManagerComponent: BaseWeaponStatsManagerComponent
6
{
7
8
override
void
OnWeaponAttachedAttachment
(
IEntity
entity,
int
iMuzzleIndex)
9
{
10
InventoryItemComponent
inventoryItem =
InventoryItemComponent
.Cast(entity.
FindComponent
(
InventoryItemComponent
));
11
if
(inventoryItem)
12
{
13
ItemAttributeCollection
attribs = inventoryItem.GetAttributes();
14
// Is there a way to find all of them?
15
SCR_WeaponAttachmentAttributes
waa =
SCR_WeaponAttachmentAttributes
.Cast(attribs.FindAttribute(
SCR_WeaponAttachmentAttributes
));
16
if
(waa)
17
{
18
if
(!waa.ApplyModifiers(
this
, iMuzzleIndex, entity))
19
{
20
Print
(
"WARNING: One or more override stats failed to set"
,
LogLevel
.ERROR);
21
Print
(
string
.Format(
"Entity: %1, Attachment Entity %2"
,
GetOwner
(), entity),
LogLevel
.ERROR);
22
}
23
}
24
}
25
}
26
27
override
void
OnWeaponDetachedAttachment
(
IEntity
entity,
int
iMuzzleIndex)
28
{
29
InventoryItemComponent
inventoryItem =
InventoryItemComponent
.Cast(entity.
FindComponent
(
InventoryItemComponent
));
30
if
(inventoryItem)
31
{
32
ItemAttributeCollection
attribs = inventoryItem.GetAttributes();
33
// Is there a way to find all of them?
34
SCR_WeaponAttachmentAttributes
waa =
SCR_WeaponAttachmentAttributes
.Cast(attribs.FindAttribute(
SCR_WeaponAttachmentAttributes
));
35
if
(waa)
36
{
37
waa.ClearModifiers(
this
, iMuzzleIndex, entity);
38
}
39
}
40
}
41
}
BaseWeaponStatsManagerComponentClass
Definition
BaseWeaponStatsManagerComponent.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
InventoryItemComponent
Definition
InventoryItemComponent.c:13
ItemAttributeCollection
Definition
ItemAttributeCollection.c:13
SCR_WeaponAttachmentAttributes
Definition
SCR_WeaponAttachmentAttributes.c:2
SCR_WeaponStatsManagerComponentClass
Definition
SCR_WeaponStatsManagerComponent.c:2
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition
SCR_FuelNode.c:128
Print
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
OnWeaponDetachedAttachment
event void OnWeaponDetachedAttachment(IEntity entity, int iMuzzleIndex)
Definition
SCR_WeaponStatsManagerComponent.c:27
OnWeaponAttachedAttachment
event void OnWeaponAttachedAttachment(IEntity entity, int iMuzzleIndex)
Definition
SCR_WeaponStatsManagerComponent.c:8
scripts
Game
Weapon
SCR_WeaponStatsManagerComponent.c
Generated by
1.17.0