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_AIDecoTestHasMagazines.c
Go to the documentation of this file.
1
class
SCR_AIDecoTestHasMagazines
:
DecoratorTestScripted
2
{
3
SCR_InventoryStorageManagerComponent inventoryManager;
4
BaseWeaponComponent
weapon;
5
6
protected
override
bool
TestFunction
(AIAgent agent,
IEntity
controlled)
7
{
8
if
(!inventoryManager && !weapon)
9
{
10
GenericEntity
entity =
GenericEntity
.Cast(controlled);
11
if
( !entity )
12
return
false
;
13
inventoryManager = SCR_InventoryStorageManagerComponent.Cast(entity.
FindComponent
(SCR_InventoryStorageManagerComponent));
14
if
( !inventoryManager )
15
return
false
;
16
BaseWeaponManagerComponent weaponManager = BaseWeaponManagerComponent.Cast(entity.
FindComponent
(BaseWeaponManagerComponent));
17
if
(!weaponManager)
18
return
false
;
19
weapon = weaponManager.GetCurrent();
20
if
(!weapon)
21
return
false
;
22
}
23
int
ammo = inventoryManager.GetMagazineCountByWeapon(weapon);
24
return
ammo > 0;
25
}
26
};
BaseWeaponComponent
Definition
BaseWeaponComponent.c:13
DecoratorTestScripted
Definition
DecoratorTestScripted.c:13
GenericEntity
Definition
GenericEntity.c:16
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
SCR_AIDecoTestHasMagazines
Definition
SCR_AIDecoTestHasMagazines.c:2
SCR_AIDecoTestHasMagazines::TestFunction
override bool TestFunction(AIAgent agent, IEntity controlled)
Definition
SCR_AIDecoTestHasMagazines.c:6
scripts
Game
AI
ScriptedNodes
Inventory
SCR_AIDecoTestHasMagazines.c
Generated by
1.17.0