Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actionrepaircarengine.c
Go to the documentation of this file.
1
class
ActionRepairCarEngineCB
:
ActionRepairVehiclePartCB
2
{}
3
4
class
ActionRepairCarEngine
:
ActionRepairVehiclePartBase
5
{
6
typename
m_LastValidType
;
// deprecated
7
int
m_LastValidComponentIndex
= -1;
8
9
void
ActionRepairCarEngine
()
10
{
11
m_CallbackClass =
ActionRepairCarEngineCB
;
12
m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_LOW;
13
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONFB_INTERACT;
14
m_StanceMask
=
DayZPlayerConstants
.STANCEMASK_ERECT;
15
m_FullBody =
true
;
16
m_LockTargetOnUse =
false
;
17
m_Text =
"#repair"
;
18
}
19
20
override
bool
ActionCondition
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item)
21
{
22
if
(player.GetBrokenLegs() ==
eBrokenLegs
.BROKEN_LEGS)
23
return
false
;
24
25
CarScript
car =
CarScript
.Cast(target.GetObject());
26
if
(!car || car.EngineIsOn())
27
return
false
;
28
29
if
(
g_Game
.IsDedicatedServer())
30
return
true
;
31
32
if
(
m_LastValidType
!= target.Type() ||
m_LastValidComponentIndex
!= target.GetComponentIndex() || m_CurrentDamageZone ==
""
)
33
{
34
string
damageZone =
""
;
35
array<string>
selections =
new
array<string>
();
36
car.GetActionComponentNameList(target.GetComponentIndex(), selections,
LOD
.
NAME_VIEW
);
37
38
foreach
(
string
selection : selections)
39
{
40
if
(car && DamageSystem.GetDamageZoneFromComponentName(car, selection, damageZone))
41
{
42
if
(damageZone ==
"Engine"
)
43
{
44
int
zoneHP = car.GetHealthLevel(damageZone);
45
if
(zoneHP >
GameConstants
.
STATE_WORN
&& zoneHP <
GameConstants
.
STATE_RUINED
)
46
{
47
m_CurrentDamageZone = damageZone;
48
m_LastValidComponentIndex
= target.GetComponentIndex();
49
50
return
true
;
51
}
52
}
53
}
54
}
55
}
56
57
return
false
;
58
}
59
60
override
void
AdjustVehicleHealthServer
(
ActionData
action_data)
61
{
62
super.AdjustVehicleHealthServer(action_data);
63
64
MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem,
UADamageApplied
.
BUILD
);
65
}
66
}
67
68
// deprecated
69
class
RepairCarEngineActionReciveData
:
RepairVehiclePartActionReciveData
70
{}
71
72
class
RepairCarEngineActionData : RepairVehiclePartActionData
73
{}
m_CommandUID
int m_CommandUID
Definition
actionbase.c:31
m_StanceMask
int m_StanceMask
Definition
actionbase.c:33
ActionData
ActionBase ActionData
Definition
actionbase.c:30
m_LastValidComponentIndex
int m_LastValidComponentIndex
Definition
actionrepaircarengine.c:7
m_LastValidType
ActionRepairCarEngineCB m_LastValidType
ActionRepairCarEngine
void ActionRepairCarEngine()
Definition
actionrepaircarengine.c:9
ActionTarget
class ActionTargets ActionTarget
ActionRepairCarEngineCB
Definition
actionrepaircarengine.c:2
ActionRepairVehiclePartBase
Definition
actionrepairvehiclepartbase.c:20
ActionRepairVehiclePartBase::AdjustVehicleHealthServer
void AdjustVehicleHealthServer(ActionData action_data)
Definition
actionrepairvehiclepartbase.c:35
ActionRepairVehiclePartCB
Definition
actionrepairvehiclepartbase.c:12
AnimatedActionBase::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
animatedactionbase.c:240
CarScript
Definition
civiliansedan.c:2
GameConstants
Definition
constants.c:664
ItemBase
Definition
inventoryitem.c:742
LOD
LOD class.
Definition
gameplay.c:204
LOD::NAME_VIEW
static const string NAME_VIEW
Definition
gameplay.c:207
PlayerBase
Definition
playerbaseclient.c:2
RepairCarEngineActionReciveData
Definition
actionrepaircarengine.c:70
RepairVehiclePartActionReciveData
Definition
actionrepairvehiclepartbase.c:2
UADamageApplied
Definition
actionconstants.c:147
UADamageApplied::BUILD
const float BUILD
Definition
actionconstants.c:148
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition
isboxcollidinggeometryproxyclasses.c:28
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition
dayzplayer.c:602
eBrokenLegs
eBrokenLegs
Definition
ebrokenlegs.c:2
GameConstants::STATE_RUINED
const int STATE_RUINED
Definition
constants.c:851
GameConstants::STATE_WORN
const int STATE_WORN
Definition
constants.c:854
Games
Dayz
scripts
4_world
classes
useractionscomponent
actions
continuous
actionrepaircarengine.c
Generated by
1.17.0