Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
actionfillcoolant.c
Go to the documentation of this file.
2{
3 private const float TIME_TO_REPEAT = 0.075;
4
9};
10
12{
13 const string RADIATOR_SELECTION_NAME = "radiator";
14
16 {
18 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_EMPTY_VESSEL;
19 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
20 m_FullBody = true;
21 m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_LOW;
22 m_LockTargetOnUse = false;
23 m_Text = "#refill_car";
24
25 }
26
28 {
31 }
32
33 override bool IsUsingProxies()
34 {
35 return true;
36 }
37
38 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
39 {
40 if (!target)
41 return false;
42
43 if (item.GetQuantity() <= 0)
44 return false;
45
46 if (item.GetLiquidType() != LIQUID_WATER)
47 return false;
48
49 if (item.GetIsFrozen())
50 {
51 return false;
52 }
53
54 Car car = Car.Cast( target.GetParent() );
55 if (!car)
56 return false;
57
58 if (car.GetFluidFraction( CarFluid.COOLANT ) >= 0.95)
59 return false;
60
61 array<string> selections = new array<string>;
62 target.GetObject().GetActionComponentNameList(target.GetComponentIndex(), selections);
63
64 CarScript carS = CarScript.Cast(car);
65
66 if (carS)
67 {
68 EntityAI radiator = null;
69 EntityAI carAI;
70
71 if (CastTo(carAI, car))
72 {
73 radiator = carAI.GetInventory().FindAttachment(InventorySlots.GetSlotIdFromString("CarRadiator"));
74 if (radiator && !radiator.IsRuined())
75 {
76 for (int s = 0; s < selections.Count(); s++)
77 {
78 if (selections[s] == carS.GetActionCompNameCoolant())
79 {
80 float dist = vector.Distance( carS.GetCoolantPtcPosWS(), player.GetPosition() );
81
82 if (dist < carS.GetActionDistanceCoolant())
83 return true;
84 }
85 }
86 }
87 }
88 }
89
90 return false;
91 }
92};
class ActionTargets ActionTarget
CarFluid
Type of vehicle's fluid. (native, do not change or extend).
Definition car.c:19
ActionData m_ActionData
bool m_FullBody
Definition actionbase.c:67
string m_Text
Definition actionbase.c:64
bool m_LockTargetOnUse
Definition actionbase.c:66
ref CCIBase m_ConditionItem
Definition actionbase.c:70
float m_SpecialtyWeight
Definition actionbase.c:83
ref CCTBase m_ConditionTarget
Definition actionbase.c:71
int m_StanceMask
Definition actionbase.c:68
override void CreateActionComponent()
override void CreateConditionComponents()
const string RADIATOR_SELECTION_NAME
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override bool IsUsingProxies()
Base script class for cars.
Definition carscript.c:171
provides access to slot configuration
static proto native int GetSlotIdFromString(string slot_name)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
const int LIQUID_WATER
Definition constants.c:544