DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionSortAmmoPile.c
См. документацию.
8
11{
13 {
15 m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_LOW;
16 m_Text = "#sort_ammunition";
17 }
18
24
25 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
26 {
27 return false;
28 }
29
30 override void OnEndAnimationLoopServer( ActionData action_data )
31 {
32 SortAmmo(action_data.m_MainItem);
33 }
34
35 void SortAmmo(ItemBase item)
36 {
37 Magazine magazine;
38 Magazine piles[5];
39 //string pile_classname = magazine.ConfigGetString("spawnPileType");
40 if( Class.CastTo(magazine, item) )
41 {
42 float health;
43 string ammo_type;
44 while( magazine.GetAmmoCount() > 0)
45 {
46 int count = magazine.GetAmmoCount();
47 if(magazine.ServerAcquireCartridge(health, ammo_type))
48 {
49 int health_label = MiscGameplayFunctions.GetHealthLevelForAmmo(ammo_type,health);
50 if( piles[health_label] == null )
51 {
52 piles[health_label] = Magazine.Cast( GetGame().CreateObjectEx( item.ClassName(), item.GetPosition(), ECE_PLACE_ON_SURFACE ) );
53 }
54 piles[health_label].ServerStoreCartridge(health,ammo_type);
55 }
56 }
57 }
58 }
59};
ActionBase ActionData
Определения ActionBase.c:30
class ActionTargets ActionTarget
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
float m_SpecialtyWeight
Определения ActionBase.c:77
string m_Text
Определения ActionBase.c:58
ref CCIBase m_ConditionItem
Определения ActionBase.c:64
ref CCTBase m_ConditionTarget
Определения ActionBase.c:65
ActionData m_ActionData
Определения AnimatedActionBase.c:3
void ActionContinuousBase()
Определения ActionContinuousBase.c:124
override void CreateConditionComponents()
Определения ActionSortAmmoPile.c:19
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionSortAmmoPile.c:25
void SortAmmo(ItemBase item)
Определения ActionSortAmmoPile.c:35
override void OnEndAnimationLoopServer(ActionData action_data)
Определения ActionSortAmmoPile.c:30
void ActionSortAmmoPile()
Определения ActionSortAmmoPile.c:12
override void CreateActionComponent()
Определения ActionSortAmmoPile.c:3
Определения CCINonRuined.c:2
Определения CCTSelf.c:2
Super root of all classes in Enforce script.
Определения EnScript.c:11
Определения InventoryItem.c:731
Определения PlayerBaseClient.c:2
const float DEFAULT_SORT
Определения ActionConstants.c:32
Определения ActionConstants.c:28
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.