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

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

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

class  ActionDisarmExplosiveCB
 

Функции

ActionDisarmExplosiveCB ActionContinuousBaseCB ActionDisarmExplosive ()
 
override void CreateActionComponent ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
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
34 ExplosivesBase explosive;
35 if (Class.CastTo(explosive, target.GetObject()) && item)
36 {
37 return explosive.GetArmed() && explosive.CanBeDisarmed();
38 }
39
40 return false;
41 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition EntityAI.c:95
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

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

◆ ActionDisarmExplosive()

12 {
13 m_CallbackClass = ActionDisarmExplosiveCB;
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 ActionDisarmExplosive.c:2
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

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

◆ CreateActionComponent()

override void CreateActionComponent ( )
12 {
13 m_CallbackClass = ActionDisarmExplosiveCB;
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

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
44 {
45 ExplosivesBase explosive = ExplosivesBase.Cast(action_data.m_Target.GetObject());
46 ToolBase tool = ToolBase.Cast(action_data.m_MainItem);
47
48 if (Math.RandomIntInclusive(0, 100) < tool.GetDisarmRate())
49 {
50 explosive.OnBeforeDisarm();
51 explosive.Disarm(true);
52 }
53 else
54 {
55 explosive.SetHealth("", "", 0.0);
56 }
57
59 }
Definition EnMath.c:7
Definition BoneKnife.c:2
Definition ActionConstants.c:142
const float DEFUSE_TOOLS
Definition ActionConstants.c:150
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition EnMath.c:54

Перекрестные ссылки UADamageApplied::DEFUSE_TOOLS и Math::RandomIntInclusive().