Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actionfillcoolant.c
Go to the documentation of this file.
2{
3 private const float TIME_TO_REPEAT = 0.075;
4
5 override void CreateActionComponent()
6 {
7 m_ActionData.m_ActionComponent = new CAContinuousFillCoolant( UAQuantityConsumed.FUEL, TIME_TO_REPEAT );
8 }
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
27 override void CreateConditionComponents()
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};
#define LIQUID_WATER
CarFluid
Type of vehicle's fluid. (native, do not change or extend)
Definition car.c:19
ActionData m_ActionData
float m_SpecialtyWeight
Definition actionbase.c:77
int m_StanceMask
Definition actionbase.c:62
string m_Text
Definition actionbase.c:58
ref CCIBase m_ConditionItem
Definition actionbase.c:64
bool m_LockTargetOnUse
Definition actionbase.c:60
bool m_FullBody
Definition actionbase.c:61
ref CCTBase m_ConditionTarget
Definition actionbase.c:65
provides access to slot configuration
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602