DayZ 1.24
Loading...
Searching...
No Matches
ActionSortAmmoPile Class Reference
Inheritance diagram for ActionSortAmmoPile:
[legend]
Collaboration diagram for ActionSortAmmoPile:
[legend]

Private Member Functions

void ActionSortAmmoPile ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnEndAnimationLoopServer (ActionData action_data)
 
void SortAmmo (ItemBase item)
 
- Private Member Functions inherited from ActionContinuousBase
void OnStartAnimationLoopServer (ActionData action_data)
 
void OnStartAnimationLoopClient (ActionData action_data)
 
void OnEndAnimationLoopServer (ActionData action_data)
 
void OnEndAnimationLoopClient (ActionData action_data)
 
void OnFinishProgressServer (ActionData action_data)
 
void OnFinishProgressClient (ActionData action_data)
 

Detailed Description

Definition at line 9 of file ActionSortAmmoPile.c.

Constructor & Destructor Documentation

◆ ActionSortAmmoPile()

void ActionSortAmmoPile::ActionSortAmmoPile ( )
inlineprivate

Member Function Documentation

◆ ActionCondition()

override bool ActionSortAmmoPile::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 24 of file ActionSortAmmoPile.c.

25 {
26 return false;
27 }

◆ CreateConditionComponents()

override void ActionSortAmmoPile::CreateConditionComponents ( )
inlineprivate

Definition at line 18 of file ActionSortAmmoPile.c.

19 {
22 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ OnEndAnimationLoopServer()

override void ActionSortAmmoPile::OnEndAnimationLoopServer ( ActionData action_data)
inlineprivate

Definition at line 29 of file ActionSortAmmoPile.c.

30 {
31 SortAmmo(action_data.m_MainItem);
32 }
void SortAmmo(ItemBase item)

References SortAmmo().

◆ SortAmmo()

void ActionSortAmmoPile::SortAmmo ( ItemBase item)
inlineprivate

Definition at line 34 of file ActionSortAmmoPile.c.

35 {
37 Magazine piles[5];
38 //string pile_classname = magazine.ConfigGetString("spawnPileType");
40 {
41 float health;
42 string ammo_type;
43 while (magazine.GetAmmoCount() > 0)
44 {
45 int count = magazine.GetAmmoCount();
46 if (magazine.ServerAcquireCartridge(health, ammo_type))
47 {
48 int health_label = MiscGameplayFunctions.GetHealthLevelForAmmo(ammo_type, health);
49 if (piles[health_label] == null)
50 piles[health_label] = Magazine.Cast(GetGame().CreateObjectEx(item.ClassName(), item.GetPosition(), ECE_PLACE_ON_SURFACE));
51 piles[health_label].ServerStoreCartridge(health, ammo_type);
52 }
53 }
54 }
55 }
const int ECE_PLACE_ON_SURFACE
Super root of all classes in Enforce script.
Definition EnScript.c:11
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References Class::CastTo(), ECE_PLACE_ON_SURFACE, and GetGame().

Referenced by OnEndAnimationLoopServer().


The documentation for this class was generated from the following file: