DayZ 1.24
Loading...
Searching...
No Matches
ClaymoreMine Class Reference
Inheritance diagram for ClaymoreMine:
[legend]
Collaboration diagram for ClaymoreMine:
[legend]

Protected Member Functions

void ClaymoreMine ()
 
override void EOnInit (IEntity other, int extra)
 
override void EEKilled (Object killer)
 
override void EEDelete (EntityAI parent)
 
void InitiateExplosion ()
 
override void AfterStoreLoad ()
 
override void OnVariablesSynchronized ()
 
override void EEItemLocationChanged (notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
 
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour ()
 
override void PairRemote (notnull EntityAI trigger)
 
override EntityAI GetPairDevice ()
 
override bool CanBeDisarmed ()
 
override void OnActivatedByItem (notnull ItemBase item)
 
override void OnArmed ()
 
override void OnDisarmed (bool pWithTool)
 
override void OnPlacementComplete (Man player, vector position="0 0 0", vector orientation="0 0 0")
 
void UpdateVisuals ()
 
void UpdateLED (ERemoteDetonatorLEDState pState, bool pForced=false)
 
override bool IsTakeable ()
 
override bool IsDeployable ()
 
override void SetActions ()
 
override int GetViewIndex ()
 
bool UsesGlobalDeploy ()
 
override string GetDeploySoundset ()
 
override string GetLoopDeploySoundset ()
 
override void OnDebugSpawn ()
 

Protected Attributes

const string ANIM_PHASE_PACKED = "Bag"
 
const string ANIM_PHASE_DEPLOYED = "Mine"
 
const string SELECTION_NAME_LED = "LED"
 
ref RemotelyActivatedItemBehaviour m_RAIB
 
ERemoteDetonatorLEDState m_LastLEDState
 

Detailed Description

Definition at line 1 of file ClaymoreMine.c.

Constructor & Destructor Documentation

◆ ClaymoreMine()

void ClaymoreMine::ClaymoreMine ( )
inlineprotected

Definition at line 10 of file ClaymoreMine.c.

11 {
13
14 SetAmmoTypes({"ClaymoreMine_Ammo", "ClaymoreMine_Secondary_Ammo"});
16 SetParticleOrientation("90 0 0");
17
18 RegisterNetSyncVariableInt("m_RAIB.m_PairDeviceNetIdLow");
19 RegisterNetSyncVariableInt("m_RAIB.m_PairDeviceNetIdHigh");
21 }
void SetAmmoTypes(array< string > pAmmoTypes)
void SetParticleExplosion(int particle)
void SetParticleOrientation(vector local_ori)
ERemoteDetonatorLEDState
void UpdateLED(ERemoteDetonatorLEDState pState, bool pForced=false)
ref RemotelyActivatedItemBehaviour m_RAIB
Definition ClaymoreMine.c:7
static const int CLAYMORE_EXPLOSION

References ParticleList::CLAYMORE_EXPLOSION, m_RAIB, SetAmmoTypes(), SetParticleExplosion(), SetParticleOrientation(), and UpdateLED().

Member Function Documentation

◆ AfterStoreLoad()

override void ClaymoreMine::AfterStoreLoad ( )
inlineprotected

Definition at line 57 of file ClaymoreMine.c.

58 {
59 super.AfterStoreLoad();
60
62 if (GetArmed())
64 }
bool GetArmed()
void UpdateVisuals()

References GetArmed(), UpdateLED(), and UpdateVisuals().

◆ CanBeDisarmed()

override bool ClaymoreMine::CanBeDisarmed ( )
inlineprotected

Definition at line 100 of file ClaymoreMine.c.

101 {
102 return GetArmed();
103 }

References GetArmed().

◆ EEDelete()

override void ClaymoreMine::EEDelete ( EntityAI parent)
inlineprotected

Definition at line 38 of file ClaymoreMine.c.

39 {
40 super.EEDelete(parent);
41
42#ifdef DIAG_DEVELOPER
43#ifndef SERVER
45#endif
46#endif
47 }

◆ EEItemLocationChanged()

override void ClaymoreMine::EEItemLocationChanged ( notnull InventoryLocation oldLoc,
notnull InventoryLocation newLoc )
inlineprotected

Definition at line 76 of file ClaymoreMine.c.

77 {
78 super.EEItemLocationChanged(oldLoc, newLoc);
79
80 if (m_RAIB)
81 m_RAIB.Pair();
82 }

References m_RAIB.

◆ EEKilled()

override void ClaymoreMine::EEKilled ( Object killer)
inlineprotected

Definition at line 28 of file ClaymoreMine.c.

29 {
30 super.EEKilled(killer);
31#ifdef DIAG_DEVELOPER
32#ifndef SERVER
34#endif
35#endif
36 }

◆ EOnInit()

override void ClaymoreMine::EOnInit ( IEntity other,
int extra )
inlineprotected

Definition at line 23 of file ClaymoreMine.c.

24 {
26 }

References UpdateVisuals().

◆ GetDeploySoundset()

override string ClaymoreMine::GetDeploySoundset ( )
inlineprotected

Definition at line 238 of file ClaymoreMine.c.

239 {
240 return "placeClaymore_SoundSet";
241 }

◆ GetLoopDeploySoundset()

override string ClaymoreMine::GetLoopDeploySoundset ( )
inlineprotected

Definition at line 243 of file ClaymoreMine.c.

244 {
245 return "claymore_deploy_Soundset";
246 }

◆ GetPairDevice()

override EntityAI ClaymoreMine::GetPairDevice ( )
inlineprotected

Definition at line 95 of file ClaymoreMine.c.

96 {
97 return m_RAIB.GetPairDevice();
98 }

References m_RAIB.

Referenced by OnActivatedByItem().

◆ GetRemotelyActivatedItemBehaviour()

override RemotelyActivatedItemBehaviour ClaymoreMine::GetRemotelyActivatedItemBehaviour ( )
inlineprotected

Definition at line 85 of file ClaymoreMine.c.

86 {
87 return m_RAIB;
88 }

References m_RAIB.

◆ GetViewIndex()

override int ClaymoreMine::GetViewIndex ( )
inlineprotected

Definition at line 222 of file ClaymoreMine.c.

223 {
224 if (MemoryPointExists("invView2"))
225 {
226 if (GetArmed())
227 return 1;
228 }
229
230 return 0;
231 }

References GetArmed().

◆ InitiateExplosion()

void ClaymoreMine::InitiateExplosion ( )
inlineprotected

Definition at line 49 of file ClaymoreMine.c.

50 {
51 if (GetDefused())
52 return;
53
54 super.InitiateExplosion();
55 }
bool GetDefused()

References GetDefused().

◆ IsDeployable()

override bool ClaymoreMine::IsDeployable ( )
inlineprotected

Definition at line 208 of file ClaymoreMine.c.

209 {
210 return true;
211 }

◆ IsTakeable()

override bool ClaymoreMine::IsTakeable ( )
inlineprotected

Definition at line 203 of file ClaymoreMine.c.

204 {
205 return !GetArmed() && super.IsTakeable();
206 }

References GetArmed().

◆ OnActivatedByItem()

override void ClaymoreMine::OnActivatedByItem ( notnull ItemBase item)
inlineprotected

Definition at line 105 of file ClaymoreMine.c.

106 {
107 if (GetGame().IsServer())
108 {
109 if (m_RAIB.IsPaired() && GetArmed())
110 {
111 if (GetPairDevice() == item)
112 SetHealth("", "", 0.0);
113 }
114 }
115 }
override EntityAI GetPairDevice()
proto native CGame GetGame()

References GetArmed(), GetGame(), GetPairDevice(), and m_RAIB.

◆ OnArmed()

override void ClaymoreMine::OnArmed ( )
inlineprotected

Definition at line 117 of file ClaymoreMine.c.

118 {
119 super.OnArmed();
120
123
124#ifdef DIAG_DEVELOPER
125#ifndef SERVER
126 // have to call this function a little later, after claymore transform has been finalized
127 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(DrawDamageZone, 500);
128#endif
129#endif
130 }
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8

References CALL_CATEGORY_SYSTEM, GetGame(), UpdateLED(), and UpdateVisuals().

◆ OnDebugSpawn()

override void ClaymoreMine::OnDebugSpawn ( )
inlineprotected

Definition at line 248 of file ClaymoreMine.c.

249 {
250 RemoteDetonatorTrigger rdt = RemoteDetonatorTrigger.Cast(SpawnEntityOnGroundPos("RemoteDetonatorTrigger", GetPosition() + GetDirection() * 0.5));
252 Arm();
253 }
void Arm()
bool PairWithDevice(notnull ItemBase otherDevice)
Definition ItemBase.c:9308
class JsonUndergroundAreaTriggerData GetPosition

References Arm(), GetPosition, and PairWithDevice().

◆ OnDisarmed()

override void ClaymoreMine::OnDisarmed ( bool pWithTool)
inlineprotected

Definition at line 132 of file ClaymoreMine.c.

133 {
134 super.OnDisarmed(pWithTool);
135
136#ifdef DIAG_DEVELOPER
138#endif
139
141 UnpairRemote();
142
143 if (pWithTool)
144 SetHealth("", "", 0.0);
145
148 }
void SetDefused(bool state)
override void UnpairRemote()

References SetDefused(), UnpairRemote(), UpdateLED(), and UpdateVisuals().

◆ OnPlacementComplete()

override void ClaymoreMine::OnPlacementComplete ( Man player,
vector position = "0 0 0",
vector orientation = "0 0 0" )
inlineprotected

Definition at line 150 of file ClaymoreMine.c.

151 {
152 super.OnPlacementComplete(player, position, orientation);
153
154 if (GetGame().IsServer())
155 {
157 if (rdt)
158 {
160 Arm();
161 }
162 }
163 }
static RemoteDetonatorTrigger SpawnInPlayerHands(notnull EntityAI pEntity, EntityAI deviceToPair=null)

References Arm(), GetGame(), PairWithDevice(), and RemoteDetonatorTrigger::SpawnInPlayerHands().

◆ OnVariablesSynchronized()

override void ClaymoreMine::OnVariablesSynchronized ( )
inlineprotected

Definition at line 66 of file ClaymoreMine.c.

67 {
68 super.OnVariablesSynchronized();
69
70 if (m_RAIB)
71 m_RAIB.OnVariableSynchronized();
72
74 }

References m_RAIB, and UpdateVisuals().

◆ PairRemote()

override void ClaymoreMine::PairRemote ( notnull EntityAI trigger)
inlineprotected

Definition at line 90 of file ClaymoreMine.c.

91 {
92 m_RAIB.Pair(trigger);
93 }

References m_RAIB.

◆ SetActions()

override void ClaymoreMine::SetActions ( )
inlineprotected

Definition at line 213 of file ClaymoreMine.c.

214 {
215 super.SetActions();
216
218 AddAction(ActionDeployObject);
220 }
ActionArmExplosiveCB ActionContinuousBaseCB ActionArmExplosive()
void AddAction(typename actionName)

References ActionArmExplosive(), and AddAction().

◆ UpdateLED()

void ClaymoreMine::UpdateLED ( ERemoteDetonatorLEDState pState,
bool pForced = false )
inlineprotected

Definition at line 183 of file ClaymoreMine.c.

184 {
185 if (pState != m_LastLEDState || pForced)
186 {
187 int selectionIdx = GetHiddenSelectionIndex(SELECTION_NAME_LED);
188
189 switch (pState)
190 {
192 SetObjectTexture(selectionIdx, RemoteDetonator.COLOR_LED_LIT);
193 break;
194 default:
195 SetObjectTexture(selectionIdx, RemoteDetonator.COLOR_LED_OFF);
196 break;
197 }
198
200 }
201 }
const string SELECTION_NAME_LED
Definition ClaymoreMine.c:5
ERemoteDetonatorLEDState m_LastLEDState
Definition ClaymoreMine.c:8

References m_LastLEDState, and SELECTION_NAME_LED.

Referenced by AfterStoreLoad(), ClaymoreMine(), OnArmed(), and OnDisarmed().

◆ UpdateVisuals()

void ClaymoreMine::UpdateVisuals ( )
inlineprotected

Definition at line 165 of file ClaymoreMine.c.

166 {
167 if (GetArmed() || GetDefused())
168 {
169 ShowSelection(ANIM_PHASE_DEPLOYED);
170 HideSelection(ANIM_PHASE_PACKED);
171 if (GetOnViewIndexChanged())
172 GetOnViewIndexChanged().Invoke();
173 }
174 else
175 {
176 HideSelection(ANIM_PHASE_DEPLOYED);
177 ShowSelection(ANIM_PHASE_PACKED);
178 if (GetOnViewIndexChanged())
179 GetOnViewIndexChanged().Invoke();
180 }
181 }
const string ANIM_PHASE_DEPLOYED
Definition ClaymoreMine.c:4
const string ANIM_PHASE_PACKED
Definition ClaymoreMine.c:3

References ANIM_PHASE_DEPLOYED, ANIM_PHASE_PACKED, GetArmed(), and GetDefused().

Referenced by AfterStoreLoad(), EOnInit(), OnArmed(), OnDisarmed(), and OnVariablesSynchronized().

◆ UsesGlobalDeploy()

bool ClaymoreMine::UsesGlobalDeploy ( )
inlineprotected

Definition at line 233 of file ClaymoreMine.c.

234 {
235 return true;
236 }

Member Data Documentation

◆ ANIM_PHASE_DEPLOYED

const string ClaymoreMine::ANIM_PHASE_DEPLOYED = "Mine"
protected

Definition at line 4 of file ClaymoreMine.c.

Referenced by UpdateVisuals().

◆ ANIM_PHASE_PACKED

const string ClaymoreMine::ANIM_PHASE_PACKED = "Bag"
protected

Definition at line 3 of file ClaymoreMine.c.

Referenced by UpdateVisuals().

◆ m_LastLEDState

ERemoteDetonatorLEDState ClaymoreMine::m_LastLEDState
protected

Definition at line 8 of file ClaymoreMine.c.

Referenced by UpdateLED().

◆ m_RAIB

◆ SELECTION_NAME_LED

const string ClaymoreMine::SELECTION_NAME_LED = "LED"
protected

Definition at line 5 of file ClaymoreMine.c.

Referenced by UpdateLED().


The documentation for this class was generated from the following file: