DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ActionEmptyMagazine
+ Граф наследования:ActionEmptyMagazine:

Закрытые члены

void ActionEmptyMagazine ()
 
override bool SetupAction (PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
 
override ActionData CreateActionData ()
 
override void CreateConditionComponents ()
 
override bool HasProneException ()
 
bool CanEmpty (ItemBase item)
 
override bool ActionConditionContinue (ActionData action_data)
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool HasTarget ()
 
override void OnExecuteServer (ActionData action_data)
 
- Закрытые члены унаследованные от 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)
 

Подробное описание

Конструктор(ы)

◆ ActionEmptyMagazine()

void ActionEmptyMagazine ( )
inlineprivate
17 {
19 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_EMPTYMAG;
20 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_EMPTYMAG;
21 m_Text = "#empty_magazine";
22 }
string m_Text
Definition ActionBase.c:58
int m_CommandUIDProne
Definition AnimatedActionBase.c:144
int m_CommandUID
Definition AnimatedActionBase.c:143
m_CallbackClass
Definition AnimatedActionBase.c:145
Definition EntityAI.c:95
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки AnimatedActionBase::m_CallbackClass, AnimatedActionBase::m_CommandUID, AnimatedActionBase::m_CommandUIDProne и ActionBase::m_Text.

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
64 {
66 return CanEmpty(item);
67 }
bool CanEmpty(ItemBase item)
Definition ActionEmptyMagazine.c:52

Перекрестные ссылки CanEmpty().

◆ ActionConditionContinue()

override bool ActionConditionContinue ( ActionData action_data)
inlineprivate
59 {
60 return CanEmpty(action_data.m_MainItem);
61 }

Перекрестные ссылки CanEmpty().

◆ CanEmpty()

bool CanEmpty ( ItemBase item)
inlineprivate
53 {
55 return ( item && Class.CastTo(mag, item) && mag.GetAmmoCount() > 0 );
56 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo().

Используется в ActionCondition() и ActionConditionContinue().

◆ CreateActionData()

override ActionData CreateActionData ( )
inlineprivate
36 {
38 return action_data;
39 }
Definition ActionEmptyMagazine.c:2

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
42 {
45 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:64
ref CCTBase m_ConditionTarget
Definition ActionBase.c:65
Definition CCINonRuined.c:2
Definition CCTNone.c:2

Перекрестные ссылки ActionBase::m_ConditionItem и ActionBase::m_ConditionTarget.

◆ HasProneException()

override bool HasProneException ( )
inlineprivate
48 {
49 return true;
50 }

◆ HasTarget()

override bool HasTarget ( )
inlineprivate
70 {
71 return false;
72 }

◆ OnExecuteServer()

override void OnExecuteServer ( ActionData action_data)
inlineprivate
75 {
77
79 if (!Class.CastTo(mag, action_data.m_MainItem))
80 return;
81
82 //float dmg;
83 //string bulletType;
84
85 /*int ammoCount = mag.GetAmmoCount();
86 if(GetAmmoCount() > 0)
87 {
88 mag.Get
89 mag.SetAmmoCount( ammoCount - 1 );
90 array< Magazine > piles;
91
92 if( !callback.m_magazinePile )
93 {
94 piles = MiscGameplayFunctions.CreateMagazinePilesFromBullet(bulletType, action_data.m_Player.GetPosition(),1,dmg);
95 if( piles.Count() > 0 )
96 callback.m_magazinePile = piles.Get(0);
97 }
98 else
99 {
100 if( callback.m_magazinePile.GetAmmoMax() > callback.m_magazinePile.GetAmmoCount() && (vector.Distance(action_data.m_Player.GetPosition(), callback.m_magazinePile.GetPosition()) < MAX_GROUND_PILE_DISTANCE ) )
101 {
102 callback.m_magazinePile.StoreCartridge(dmg, bulletType);
103 }
104 else
105 {
106 piles = MiscGameplayFunctions.CreateMagazinePilesFromBullet(bulletType, action_data.m_Player.GetPosition(),1,dmg);
107 if( piles.Count() > 0 )
108 callback.m_magazinePile = piles.Get(0);
109 }
110 }
111
112
113
114 } */
115
116
117
118 //----Uncomment after AcquireCartridge will work
119
120 float dmg;
121 string ammoType;
122
123 if ( !mag.ServerAcquireCartridge(dmg,ammoType) )
124 return;
125
126 mag.ApplyManipulationDamage();
127
128 string magazineTypeName;
129 GetGame().ConfigGetText( "CfgAmmo " + ammoType + " spawnPileType" , magazineTypeName);
130
131 if ( !DayZPlayerUtils.HandleStoreCartridge(action_data.m_Player, NULL, -1, dmg, ammoType, magazineTypeName, false) )
132 {
134
135 if ( !emActionData.m_magazinePile )
136 {
137 piles = MiscGameplayFunctions.CreateMagazinePilesFromBullet(ammoType,action_data.m_Player.GetPosition(),1,dmg);
138 if ( piles.Count() > 0 )
139 emActionData.m_magazinePile = piles.Get(0);
140 }
141 else
142 {
143 if ( emActionData.m_magazinePile.GetAmmoMax() > emActionData.m_magazinePile.GetAmmoCount() && emActionData.m_magazinePile.GetType() == magazineTypeName && (vector.DistanceSq(action_data.m_Player.GetPosition(), emActionData.m_magazinePile.GetPosition()) < (UAMaxDistances.DEFAULT * UAMaxDistances.DEFAULT) ) )
144 {
145 emActionData.m_magazinePile.ServerStoreCartridge(dmg,ammoType);
146 }
147 else
148 {
149 piles = MiscGameplayFunctions.CreateMagazinePilesFromBullet(ammoType, action_data.m_Player.GetPosition(), 1, dmg);
150 if ( piles.Count() > 0 )
151 emActionData.m_magazinePile = piles.Get(0);
152 }
153 }
154 //emActionData.m_magazinePile.SetSynchDirty();
155 }
156 //mag.SetSynchDirty();
157 }
void DayZPlayerUtils()
cannot be instantiated
Definition DayZPlayerUtils.c:465
Definition ActionConstants.c:106
const float DEFAULT
Definition ActionConstants.c:108
Definition EnConvert.c:106
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
proto native CGame GetGame()

Перекрестные ссылки Class::CastTo(), DayZPlayerUtils(), UAMaxDistances::DEFAULT, vector::DistanceSq() и GetGame().

◆ SetupAction()

override bool SetupAction ( PlayerBase player,
ActionTarget target,
ItemBase item,
out ActionData action_data,
Param extra_data = NULL )
inlineprivate
25 {
26 if ( super.SetupAction( player, target, item, action_data, extra_data))
27 {
29 emActionData.m_magazinePile = NULL;
30 return true;
31 }
32 return false;
33 }

Объявления и описания членов класса находятся в файле: