DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл ActionRepairBoatEngine.c

См. исходные тексты.

Структуры данных

class  ActionRepairBoatEngineCB
 

Функции

ActionRepairBoatEngineCB ActionRepairVehiclePartCB ActionRepairBoatEngine ()
 
override void CreateActionComponent ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void AdjustVehicleHealthServer (ActionData action_data)
 
override void OnStartAnimationLoopServer (ActionData action_data)
 
override void OnFinishProgressServer (ActionData action_data)
 
override void OnEndServer (ActionData action_data)
 

Функции

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
22 {
23 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
24 return false;
25
26 Blowtorch bt = Blowtorch.Cast(item);
27 if (!bt.HasEnoughEnergyForRepair(UATimeSpent.BASEBUILDING_REPAIR_MEDIUM))
28 return false;
29
30 BoatScript boat = BoatScript.Cast(target.GetObject());
31 if (!boat || boat.EngineIsOn())
32 return false;
33
34 if (GetGame().IsDedicatedServer())
35 return true;
36
37 string damageZone = "";
39 boat.GetActionComponentNameList(target.GetComponentIndex(), selections, LOD.NAME_VIEW);
40
41 foreach (string selection : selections)
42 {
43 if (boat && DamageSystem.GetDamageZoneFromComponentName(boat, selection, damageZone))
44 {
45 if (damageZone == "Engine")
46 {
47 int zoneHP = boat.GetHealthLevel(damageZone);
49 {
50 m_CurrentDamageZone = damageZone;
51 return true;
52 }
53 }
54 }
55 }
56
57 return false;
58 }
eBrokenLegs
Definition EBrokenLegs.c:2
Definition BoatScript.c:27
Definition constants.c:638
LOD class.
Definition gameplay.c:203
static const string NAME_VIEW
Definition gameplay.c:206
Definition EntityAI.c:95
Definition ActionConstants.c:28
const float BASEBUILDING_REPAIR_MEDIUM
Definition ActionConstants.c:67
proto native CGame GetGame()
const int STATE_RUINED
Definition constants.c:807
const int STATE_WORN
Definition constants.c:810

Перекрестные ссылки UATimeSpent::BASEBUILDING_REPAIR_MEDIUM, GetGame(), LOD::NAME_VIEW, GameConstants::STATE_RUINED и GameConstants::STATE_WORN.

◆ ActionRepairBoatEngine()

12 {
13 m_CallbackClass = ActionRepairBoatEngineCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_FLAME_REPAIR;
15 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
16 m_FullBody = true;
17 m_LockTargetOnUse = false;
18 m_Text = "#repair";
19 }
int m_CommandUID
Definition ActionBase.c:31
int m_StanceMask
Definition ActionBase.c:33
Definition ActionRepairBoatEngine.c:2
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Используется в ActionConstructor::RegisterActions() и ItemBase::SetActions().

◆ AdjustVehicleHealthServer()

override void AdjustVehicleHealthServer ( ActionData action_data)
61 {
62 super.AdjustVehicleHealthServer(action_data);
63
64 MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem, UADamageApplied.BUILD);
65 }
Definition ActionConstants.c:142
const float BUILD
Definition ActionConstants.c:143

Перекрестные ссылки UADamageApplied::BUILD.

◆ CreateActionComponent()

override void CreateActionComponent ( )
12 {
13 m_CallbackClass = ActionRepairBoatEngineCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_FLAME_REPAIR;
15 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;

Перекрестные ссылки m_CommandUID и m_StanceMask.

◆ OnEndServer()

override void OnEndServer ( ActionData action_data)
82 {
83 super.OnEndServer(action_data);
84
85 action_data.m_MainItem.GetCompEM().SwitchOff();
86 }

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
75 {
76 super.OnFinishProgressServer(action_data);
77
78 action_data.m_MainItem.GetCompEM().SwitchOff();
79 }

◆ OnStartAnimationLoopServer()

override void OnStartAnimationLoopServer ( ActionData action_data)
68 {
69 super.OnStartAnimationLoopServer(action_data);
70
71 action_data.m_MainItem.GetCompEM().SwitchOn();
72 }