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

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

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

class  ActionActivateTrapCB
 

Функции

ActionActivateTrapCB ActionContinuousBaseCB ActionActivateTrap ()
 
override void CreateActionComponent ()
 
override void InitActionComponent ()
 
override void CreateConditionComponents ()
 
override GetInputType ()
 
override bool HasProgress ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnStartAnimationLoop (ActionData action_data)
 
override void OnEnd (ActionData action_data)
 
override void OnEndAnimationLoop (ActionData action_data)
 
override void OnFinishProgressServer (ActionData action_data)
 

Функции

◆ ActionActivateTrap()

19 {
20 m_CallbackClass = ActionActivateTrapCB;
21 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
22 m_FullBody = true;
23 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
24 m_Sound = "craft_universal_0";
25 m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_LOW;
26
27 m_Text = "#activate";
28 }
int m_CommandUID
Definition ActionBase.c:31
int m_StanceMask
Definition ActionBase.c:33
EffectSound m_Sound
Definition HungerSoundHandler.c:18
Definition ActionActivateTrap.c:2
Definition EntityAI.c:95
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

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

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
47 {
48 ItemBase targetItem = ItemBase.Cast(target.GetObject());
49 if (targetItem && targetItem.IsBeingPlaced())
50 return false;
51
52 Object targetObject = target.GetObject();
53 if (targetObject != null)
54 {
55 if (targetObject.IsInherited(TrapBase))
56 {
58 if (trap.IsActivable())
59 return true;
60 }
61 else if (targetObject.IsInherited(TrapSpawnBase))
62 {
64
65 if (spawnTrap && !spawnTrap.IsActive())
66 return spawnTrap.IsPlaceableAtPosition(spawnTrap.GetPosition());
67 }
68 }
69
70 return false;
71 }
Definition InventoryItem.c:731
Definition ObjectTyped.c:2
Definition Trap_Bear.c:2
Definition Trap_FishNet.c:2

◆ CreateActionComponent()

override void CreateActionComponent ( )
19 {
20 m_CallbackClass = ActionActivateTrapCB;
21 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
22 m_FullBody = true;

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

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
31 {
32 m_ConditionTarget = new CCTNonRuined( UAMaxDistances.DEFAULT );
33 m_ConditionItem = new CCINotPresent;
34 }
Definition CCINotPresent.c:2
Definition CCTNonRuined.c:2
Definition ActionConstants.c:106
const float DEFAULT
Definition ActionConstants.c:108

Перекрестные ссылки UAMaxDistances::DEFAULT.

◆ GetInputType()

override GetInputType ( )
37 {
39 }
Definition ActionInput.c:522

◆ HasProgress()

override bool HasProgress ( )
42 {
43 return true;
44 }

Используется в OnStartAnimationLoop().

◆ InitActionComponent()

override void InitActionComponent ( )

◆ OnEnd()

override void OnEnd ( ActionData action_data)
89 {
90 if ( !GetGame().IsMultiplayer() || GetGame().IsServer() )
91 {
92 TrapBase trap = TrapBase.Cast( action_data.m_Target.GetObject());
93 if ( trap )
94 {
95 Param1<bool> play = new Param1<bool>( false );
96 GetGame().RPCSingleParam( trap, SoundTypeTrap.ACTIVATING, play, true );
97 }
98 }
99 }
SoundTypeTrap
Definition TrapBase.c:2
proto native CGame GetGame()

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

◆ OnEndAnimationLoop()

override void OnEndAnimationLoop ( ActionData action_data)
102 {
103 super.OnEndAnimationLoop(action_data);
104
105 if (!GetGame().IsMultiplayer() || GetGame().IsServer())
106 {
107 TrapBase trap = TrapBase.Cast( action_data.m_Target.GetObject());
108 Param1<bool> play = new Param1<bool>(false);
109 GetGame().RPCSingleParam(trap, SoundTypeTrap.ACTIVATING, play, true);
110 }
111 }

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

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
114 {
115 Object targetObject = action_data.m_Target.GetObject();
116 if (targetObject != null)
117 {
118 vector orientation = action_data.m_Player.GetOrientation();
119 vector position = targetObject.GetPosition();
120
121 if (targetObject.IsInherited(TrapBase))
122 {
124 trap.OnPlacementComplete(action_data.m_Player, position, orientation);
125 trap.StartActivate(action_data.m_Player);
126 }
127 else if (targetObject.IsInherited(TrapSpawnBase))
128 {
130 spawnTrap.OnPlacementComplete(action_data.m_Player, position, orientation);
131 }
132 }
133 }
Definition EnConvert.c:106

◆ OnStartAnimationLoop()

override void OnStartAnimationLoop ( ActionData action_data)
74 {
75 super.OnStartAnimationLoop( action_data );
76
77 if ( !GetGame().IsMultiplayer() || GetGame().IsServer() )
78 {
79 TrapBase trap = TrapBase.Cast( action_data.m_Target.GetObject() );
80 if ( trap )
81 {
82 Param1<bool> play = new Param1<bool>( true );
83 GetGame().RPCSingleParam( trap, SoundTypeTrap.ACTIVATING, play, true );
84 }
85 }
86 }

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