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

Private Member Functions

void ActionFillCoolant ()
 
override void CreateConditionComponents ()
 
override bool IsUsingProxies ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, 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)
 

Private Attributes

const string RADIATOR_SELECTION_NAME = "radiator"
 

Detailed Description

Definition at line 11 of file ActionFillCoolant.c.

Constructor & Destructor Documentation

◆ ActionFillCoolant()

void ActionFillCoolant::ActionFillCoolant ( )
inlineprivate

Member Function Documentation

◆ ActionCondition()

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

Definition at line 38 of file ActionFillCoolant.c.

39 {
40 if (!target)
41 return false;
42
43 if (item.GetQuantity() <= 0)
44 return false;
45
46 if (item.GetLiquidType() != LIQUID_WATER && item.GetLiquidType() != LIQUID_RIVERWATER)
47 return false;
48
49 Car car = Car.Cast(target.GetParent());
50 if (!car)
51 return false;
52
53 if (car.GetFluidFraction(CarFluid.COOLANT) >= 0.95)
54 return false;
55
57 target.GetObject().GetActionComponentNameList(target.GetComponentIndex(), selections);
58
60
61 if (carS)
62 {
65
66 if (CastTo(carAI, car))
67 {
68 radiator = carAI.GetInventory().FindAttachment(InventorySlots.GetSlotIdFromString("CarRadiator"));
69 if (radiator && !radiator.IsRuined())
70 {
71 for (int s = 0; s < selections.Count(); s++)
72 {
73 if (selections[s] == carS.GetActionCompNameCoolant())
74 {
75 float dist = vector.Distance(carS.GetCoolantPtcPosWS(), player.GetPosition());
76
77 if (dist < carS.GetActionDistanceCoolant())
78 return true;
79 }
80 }
81 }
82 }
83 }
84
85 return false;
86 }
CarFluid
Type of vehicle's fluid. (native, do not change or extend)
Definition Car.c:18
provides access to slot configuration
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
const int LIQUID_WATER
Definition constants.c:504
const int LIQUID_RIVERWATER
Definition constants.c:505

References vector::Distance(), InventorySlots::GetSlotIdFromString(), LIQUID_RIVERWATER, and LIQUID_WATER.

◆ CreateConditionComponents()

override void ActionFillCoolant::CreateConditionComponents ( )
inlineprivate

Definition at line 27 of file ActionFillCoolant.c.

28 {
31 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ IsUsingProxies()

override bool ActionFillCoolant::IsUsingProxies ( )
inlineprivate

Definition at line 33 of file ActionFillCoolant.c.

34 {
35 return true;
36 }

Member Data Documentation

◆ RADIATOR_SELECTION_NAME

const string ActionFillCoolant::RADIATOR_SELECTION_NAME = "radiator"
private

Definition at line 13 of file ActionFillCoolant.c.


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