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

Private Member Functions

void ActionFillOil ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnEndAnimationLoopServer (ActionData action_data)
 
- 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 11 of file ActionFillOil.c.

Constructor & Destructor Documentation

◆ ActionFillOil()

void ActionFillOil::ActionFillOil ( )
inlineprivate

Definition at line 13 of file ActionFillOil.c.

14 {
16 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_EMPTY_VESSEL;
17 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
18 m_FullBody = true;
20 m_LockTargetOnUse = false;
21 m_Text = "#refill_car";
22 }
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
bool m_LockTargetOnUse
Definition ActionBase.c:51
float m_SpecialtyWeight
Definition ActionBase.c:68
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References AnimatedActionBase::m_CallbackClass, AnimatedActionBase::m_CommandUID, m_FullBody, m_LockTargetOnUse, m_SpecialtyWeight, m_StanceMask, m_Text, and UASoftSkillsWeight::PRECISE_LOW.

Member Function Documentation

◆ ActionCondition()

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

Definition at line 30 of file ActionFillOil.c.

31 {
32 if (!target || !IsTransport(target))
33 return false;
34
35 if (item.GetQuantity() <= 0)
36 return false;
37
38 Car car = Car.Cast(target.GetObject());
39 if (!car)
40 return false;
41
42 if (car.GetFluidFraction(CarFluid.OIL) >= 0.98)
43 return false;
44
46 target.GetObject().GetActionComponentNameList(target.GetComponentIndex(), selections);
47
49 if (carS)
50 {
51 for (int s = 0; s < selections.Count(); s++)
52 {
53 if (selections[s] == carS.GetActionCompNameOil())
54 {
55 float dist = vector.Distance(carS.GetRefillPointPosWS(), player.GetPosition());
56
57 if (dist < carS.GetActionDistanceOil())
58 return true;
59 }
60 }
61 }
62
63 return false;
64 }
bool IsTransport(ActionTarget target)
Definition ActionBase.c:851
CarFluid
Type of vehicle's fluid. (native, do not change or extend)
Definition Car.c:18
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.

References vector::Distance(), and IsTransport().

◆ CreateConditionComponents()

override void ActionFillOil::CreateConditionComponents ( )
inlineprivate

Definition at line 24 of file ActionFillOil.c.

25 {
28 }
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 ActionFillOil::OnEndAnimationLoopServer ( ActionData action_data)
inlineprivate

Definition at line 66 of file ActionFillOil.c.

67 {
68 if (action_data.m_MainItem && action_data.m_MainItem.GetQuantity() <= 0.01)
69 action_data.m_MainItem.SetQuantity(0);
70 }

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