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

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

void ActionFillFuel ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
- Закрытые члены унаследованные от 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)
 

Закрытые данные

const string FUEL_SELECTION_NAME = "refill"
 

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

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

◆ ActionFillFuel()

void ActionFillFuel ( )
inlineprivate
16 {
18 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_EMPTY_VESSEL;
19 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
20 m_FullBody = true;
22 m_LockTargetOnUse = false;
23 m_Text = "#refuel";
24 }
bool m_FullBody
Definition ActionBase.c:61
string m_Text
Definition ActionBase.c:58
bool m_LockTargetOnUse
Definition ActionBase.c:60
float m_SpecialtyWeight
Definition ActionBase.c:77
int m_StanceMask
Definition ActionBase.c:62
Definition ActionFillFuel.c:2
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, ActionBase::m_FullBody, ActionBase::m_LockTargetOnUse, ActionBase::m_SpecialtyWeight, ActionBase::m_StanceMask и ActionBase::m_Text.

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
33 {
34 if ( !target || !IsTransport(target) )
35 return false;
36
37 if ( item.GetQuantity() <= 0 )
38 return false;
39
40 if ( item.GetLiquidType() != LIQUID_GASOLINE )
41 return false;
42
43 if (target.GetObject().IsDamageDestroyed())
44 return false;
45
46 Car car = Car.Cast(target.GetObject());
47 Boat boat = Boat.Cast(target.GetObject());
48 if (car)
49 {
50 if (car.GetFluidFraction( CarFluid.FUEL ) >= 0.98)
51 return false;
52 }
53 else if (boat)
54 {
55 if ( boat.GetFluidFraction( BoatFluid.FUEL ) >= 0.98 )
56 return false;
57 }
58 else
59 return false;
60
62 target.GetObject().GetActionComponentNameList(target.GetComponentIndex(), selections);
63
64 Transport vehicle = Transport.Cast(target.GetObject());
65
66 if ( vehicle )
67 {
68 for (int s = 0; s < selections.Count(); s++)
69 {
70 if ( selections[s] == vehicle.GetActionCompNameFuel() )
71 {
72 float dist = vector.DistanceSq( vehicle.GetRefillPointPosWS(), player.GetPosition() );
73
74 if ( dist < vehicle.GetActionDistanceFuel() * vehicle.GetActionDistanceFuel() )
75 return true;
76 }
77 }
78 }
79
80 return false;
81 }
BoatFluid
Type of vehicle's fluid. (native, do not change or extend)
Definition Boat.c:14
CarFluid
Type of vehicle's fluid. (native, do not change or extend)
Definition Car.c:19
bool IsTransport(ActionTarget target)
Definition ActionBase.c:1049
Base native class for all motorized wheeled vehicles.
Definition Boat.c:28
Definition EnConvert.c:106
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
const int LIQUID_GASOLINE
Definition constants.c:522

Перекрестные ссылки vector::DistanceSq(), ActionBase::IsTransport() и LIQUID_GASOLINE.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
27 {
28 m_ConditionItem = new CCINonRuined;//CCINotRuinedAndEmpty?
30 }
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.

Поля

◆ FUEL_SELECTION_NAME

const string FUEL_SELECTION_NAME = "refill"
private

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