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

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

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

class  ActionDisarmMineCB
 

Функции

ActionDisarmMineCB ActionContinuousBaseCB ActionDisarmMine ()
 
override void CreateActionComponent ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnStartAnimationLoop (ActionData action_data)
 
override void OnExecute (ActionData action_data)
 
override void OnEndAnimationLoop (ActionData action_data)
 
override void OnFinishProgressServer (ActionData action_data)
 

Функции

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
28 {
29 if (!target)
30 {
31 return false;
32 }
33
35 if (Class.CastTo(targetMine, target.GetObject()) && item && IsInReach(player, target, UAMaxDistances.DEFAULT))
36 {
37 return targetMine.IsActive() && targetMine.CanBeDisarmed();
38 }
39
40 return false;
41 }
void LandMineTrap()
Definition Trap_LandMine.c:17
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition EntityAI.c:95
Definition ActionConstants.c:106
const float DEFAULT
Definition ActionConstants.c:108
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), UAMaxDistances::DEFAULT и LandMineTrap().

◆ ActionDisarmMine()

12 {
13 m_CallbackClass = ActionDisarmMineCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
15 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
16 m_FullBody = true;
17
18 m_Text = "#disarm";
19 }
int m_CommandUID
Definition ActionBase.c:31
int m_StanceMask
Definition ActionBase.c:33
Definition ActionDisarmMine.c:2
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

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

◆ CreateActionComponent()

override void CreateActionComponent ( )
12 {
13 m_CallbackClass = ActionDisarmMineCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
15 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;

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

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
22 {
23 m_ConditionItem = new CCINonRuined;
24 m_ConditionTarget = new CCTCursor;
25 }
Definition CCINonRuined.c:2
Definition CCTCursor.c:2

◆ OnEndAnimationLoop()

override void OnEndAnimationLoop ( ActionData action_data)
64 {
65 if (!GetGame().IsMultiplayer() || GetGame().IsServer())
66 {
67 LandMineTrap targetMine = LandMineTrap.Cast(action_data.m_Target.GetObject());
68 Param1<bool> play = new Param1<bool>(false);
69 GetGame().RPCSingleParam(targetMine, SoundTypeMine.DISARMING, play, true);
70 }
71 }
SoundTypeMine
Definition Trap_LandMine.c:2
proto native CGame GetGame()

Перекрестные ссылки GetGame() и LandMineTrap().

◆ OnExecute()

override void OnExecute ( ActionData action_data)
54 {
55 if (!GetGame().IsMultiplayer() || GetGame().IsServer())
56 {
57 LandMineTrap targetMine = LandMineTrap.Cast(action_data.m_Target.GetObject());
58 Param1<bool> play = new Param1<bool>(true);
59 GetGame().RPCSingleParam(targetMine, SoundTypeMine.DISARMING, play, true);
60 }
61 }

Перекрестные ссылки GetGame() и LandMineTrap().

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
74 {
76 Class.CastTo(targetMine, action_data.m_Target.GetObject());
77
79 Class.CastTo(tool, action_data.m_MainItem);
80
81 if (Math.RandomIntInclusive(0, 100) < tool.GetDisarmRate())
82 {
83 targetMine.Disarm();
84 }
85 else
86 {
87 targetMine.OnSteppedOn(action_data.m_Player);
88 }
89
90 MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem, 2);
91 }
Definition EnMath.c:7
Definition BoneKnife.c:2
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition EnMath.c:54

Перекрестные ссылки Class::CastTo(), LandMineTrap() и Math::RandomIntInclusive().

◆ OnStartAnimationLoop()

override void OnStartAnimationLoop ( ActionData action_data)
44 {
45 if (!GetGame().IsMultiplayer() || GetGame().IsServer())
46 {
47 LandMineTrap targetMine = LandMineTrap.Cast(action_data.m_Target.GetObject());
48 Param1<bool> play = new Param1<bool>(true);
49 GetGame().RPCSingleParam(targetMine, SoundTypeMine.DISARMING, play, true);
50 }
51 }

Перекрестные ссылки GetGame() и LandMineTrap().