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

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

Перечисления

enum  SoundTypeMine { DISARMING = 0 }
 

Функции

void LandMineTrap ()
 
void ~LandMineTrap ()
 
override void StartActivate (PlayerBase player)
 
override void OnActivatedByItem (notnull ItemBase item)
 Called when this item is activated by other.
 
override void OnActivate ()
 
override bool CanExplodeInFire ()
 
override void OnUpdate (EntityAI victim)
 
override void OnSteppedOn (EntityAI victim)
 
override void OnSteppedOut (EntityAI victim)
 
void OnServerSteppedOn (Object obj, string damageZone)
 
void DeleteThis ()
 
override void OnItemLocationChanged (EntityAI old_owner, EntityAI new_owner)
 
override void EEKilled (Object killer)
 
void PlaySoundActivate ()
 
override void Explode (int damageType, string ammoType="")
 
override bool CanBeDisarmed ()
 
override void OnRPC (PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
 
void PlayDisarmingLoopSound ()
 
void StopDisarmingLoopSound ()
 
override void OnPlacementComplete (Man player, vector position="0 0 0", vector orientation="0 0 0")
 
override bool IsDeployable ()
 
override string GetLoopDeploySoundset ()
 
override void SetActions ()
 

Переменные

enum SoundTypeMine m_TimerLoopSound
 
ref EffectSound m_SafetyPinSound
 
ref EffectSound m_DisarmingLoopSound
 
ref Timer m_DeleteTimer
 
const int BROKEN_LEG_PROB = 90
 
const int BLEED_SOURCE_PROB = 50
 
const int MAX_BLEED_SOURCE = 1
 

Перечисления

◆ SoundTypeMine

Элементы перечислений
DISARMING 
2{
3 DISARMING = 0
4}
@ DISARMING
Definition Trap_LandMine.c:3

Функции

◆ CanBeDisarmed()

override bool CanBeDisarmed ( )
protected
242 {
243 return true;
244 }

◆ CanExplodeInFire()

override bool CanExplodeInFire ( )
private
85 {
86 return true;
87 }

◆ DeleteThis()

void DeleteThis ( )
protected
194 {
196 m_DeleteTimer.Run(1, this, "DeleteSafe");
197 }
ref Timer m_DeleteTimer
Definition Trap_LandMine.c:11
Definition DayZPlayerImplement.c:63
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8

Перекрестные ссылки CALL_CATEGORY_SYSTEM и m_DeleteTimer.

Используется в Explode(), OnActivatedByItem() и OnSteppedOn().

◆ EEKilled()

override void EEKilled ( Object killer)
protected
205 {
206 super.EEKilled(killer);
207
208 Explode(DamageType.EXPLOSION);
209 }
DamageType
exposed from C++ (do not change)
Definition DamageSystem.c:11
override void Explode(int damageType, string ammoType="")
Definition Trap_LandMine.c:220
Definition EntityAI.c:95

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

◆ Explode()

override void Explode ( int damageType,
string ammoType = "" )
protected
221 {
222 if (ammoType == "")
223 {
224 ammoType = ConfigGetString("ammoType");
225 }
226
227 if (ammoType == "")
228 {
229 ammoType = "Dummy_Heavy";
230 }
231
232 if ( GetGame().IsServer() )
233 {
234 SynchExplosion();
235 vector offset = Vector(0, 0.1, 0); //Vertical offset applied to landmine explosion (in meters)
236 DamageSystem.ExplosionDamage(this, NULL, ammoType, GetPosition() + offset, damageType); //Offset explosion on Y axis
237 DeleteThis();
238 }
239 }
void DeleteThis()
Definition Trap_LandMine.c:193
class JsonUndergroundAreaTriggerData GetPosition
Definition UndergroundAreaLoader.c:9
Definition EnConvert.c:106
proto native CGame GetGame()
proto native vector Vector(float x, float y, float z)
Vector constructor from components.

Перекрестные ссылки DeleteThis(), GetGame(), GetPosition и Vector().

Используется в FuelStation::EEKilled(), InventoryItem::EEKilled(), EEKilled(), ExplodeNow(), InitiateExplosion(), Grenade_Base::InitiateExplosion(), OnServerSteppedOn() и OnSteppedOn().

◆ GetLoopDeploySoundset()

override string GetLoopDeploySoundset ( )
protected
302 {
303 return "landmine_deploy_SoundSet";
304 }

◆ IsDeployable()

override bool IsDeployable ( )
protected
297 {
298 return true;
299 }

◆ LandMineTrap()

void LandMineTrap ( )
private
18 {
19 m_DefectRate = 15;
20 m_DamagePlayers = 0; //How much damage player gets when caught
21 m_InitWaitTime = 10; //After this time after deployment, the trap is activated
22 m_InfoActivationTime = string.Format("#STR_LandMineTrap0%1#STR_LandMineTrap1", m_InitWaitTime.ToString());
23
25
26 //Order is important and must match clothing array in DamageClothing method
28 m_ClothingDmg.Insert(60); //Trousers
29 m_ClothingDmg.Insert(100); //BackPack
30 m_ClothingDmg.Insert(40); //Vest
31 m_ClothingDmg.Insert(10); //HeadGear
32 m_ClothingDmg.Insert(10); //Mask
33 m_ClothingDmg.Insert(40); //Body
34 m_ClothingDmg.Insert(50); //Feet
35 m_ClothingDmg.Insert(5); //Gloves
36 }
float m_DefectRate
Definition TrapBase.c:19
ref array< int > m_ClothingDmg
Definition TrapBase.c:46
string m_InfoActivationTime
Definition TrapBase.c:40
float m_InitWaitTime
Definition TrapBase.c:17
float m_DamagePlayers
Definition TrapBase.c:20
bool m_AddDeactivationDefect
Definition TrapBase.c:24
proto string ToString()
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.

Перекрестные ссылки string::Format(), m_AddDeactivationDefect, m_ClothingDmg, m_DamagePlayers, m_DefectRate, m_InfoActivationTime, m_InitWaitTime и float::ToString().

Используется в ActionCondition(), OnEndAnimationLoop(), OnExecute(), OnFinishProgressServer() и OnStartAnimationLoop().

◆ OnActivate()

◆ OnActivatedByItem()

override void OnActivatedByItem ( notnull ItemBase item)
private

Called when this item is activated by other.

62 {
63 SetHealth("", "", 0.0);
64 DeleteThis();
65 }

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

◆ OnItemLocationChanged()

override void OnItemLocationChanged ( EntityAI old_owner,
EntityAI new_owner )
protected
200 {
201 super.OnItemLocationChanged(old_owner, new_owner);
202 }

◆ OnPlacementComplete()

override void OnPlacementComplete ( Man player,
vector position = "0 0 0",
vector orientation = "0 0 0" )
protected
286 {
287 super.OnPlacementComplete(player, position, orientation);
288
289 if (GetGame().IsServer())
290 {
293 }
294 }
override void StartActivate(PlayerBase player)
Definition Trap_LandMine.c:44
Definition PlayerBaseClient.c:2

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

◆ OnRPC()

override void OnRPC ( PlayerIdentity sender,
int rpc_type,
ParamsReadContext ctx )
protected
247 {
248 super.OnRPC(sender, rpc_type, ctx);
249
250 Param1<bool> p = new Param1<bool>(false);
251
252 if (!ctx.Read(p))
253 return;
254
255 bool play = p.param1;
256 switch (rpc_type)
257 {
258 case SoundTypeMine.DISARMING:
259 if (play)
261 else
263
264 break;
265 }
266 }
void PlayDisarmingLoopSound()
Definition Trap_LandMine.c:268
SoundTypeMine
Definition Trap_LandMine.c:2
void StopDisarmingLoopSound()
Definition Trap_LandMine.c:276

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

◆ OnServerSteppedOn()

void OnServerSteppedOn ( Object obj,
string damageZone )
protected
178 {
179 if (obj.IsInherited(CarWheel))
180 {
181 obj.ProcessDirectDamage(DT_CLOSE_COMBAT, this, "", "LandMineExplosion_CarWheel", "0 0 0", 1);
182 Explode(DamageType.EXPLOSION);
183
184 if (m_UpdateTimer.IsRunning())
185 m_UpdateTimer.Stop();
186
187 }
188
189 SetInactive(false);
190 Synch(EntityAI.Cast(obj));
191 }
ref Timer m_UpdateTimer
Definition RadialMenu.c:20
void Synch(EntityAI victim)
keeping "step" here for consistency only
Definition TrapBase.c:286
void SetInactive(bool stop_timer=true)
Definition TrapBase.c:464
Definition InventoryItem.c:413
Definition Building.c:6

Перекрестные ссылки Explode(), m_UpdateTimer, SetInactive() и Synch().

◆ OnSteppedOn()

override void OnSteppedOn ( EntityAI victim)
private

CarScript specific reaction on LandMineTrap

102 {
103 int i;
104
105 if (GetGame().IsServer() && victim)
106 {
107 if (!victim.GetAllowDamage())
108 {
109 return;
110 }
111
112 if (victim.IsInherited(CarScript))
113 {
116 m_UpdateTimer.Run(UPDATE_TIMER_INTERVAL, this, "OnUpdate", params, true);
117
118 return;
119 }
120 else
121 {
122 //Check if we have a player
124 if (victim_PB && victim_PB.IsAlive())
125 {
126 int randNum; //value used for probability evaluation
127 randNum = Math.RandomInt(0, 100);
129 {
130 float damage = victim_PB.GetMaxHealth("RightLeg", ""); //deal 100% damage to break legs
131 victim_PB.DamageAllLegs( damage );
132 }
133
134 randNum = Math.RandomInt(0, 100);
136 {
137 for (i = 0; i < MAX_BLEED_SOURCE; i++)
138 {
139 //We add two bleeding sources max to lower half
140 randNum = Math.RandomIntInclusive(0, PlayerBase.m_BleedingSourcesLow.Count() - 1);
141
142 victim_PB.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection(PlayerBase.m_BleedingSourcesLow[randNum]);
143 }
144 }
145
147 }
148 else
149 {
151 if (victim_IB)
152 {
154 }
155 }
156
157 Explode(DamageType.EXPLOSION);
158 }
159
160 DeleteThis();
161 }
162
163 super.OnSteppedOn(victim);
164 }
const int BROKEN_LEG_PROB
Definition Trap_LandMine.c:13
const int MAX_BLEED_SOURCE
Definition Trap_LandMine.c:15
const int BLEED_SOURCE_PROB
Definition Trap_LandMine.c:14
const float UPDATE_TIMER_INTERVAL
Definition TrapBase.c:15
const int DAMAGE_TRIGGER_MINE
Definition TrapBase.c:14
void DamageClothing(PlayerBase player)
Definition TrapBase.c:669
Definition CivilianSedan.c:2
Definition InventoryItem.c:731
Definition EnMath.c:7
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition EnMath.c:54

Перекрестные ссылки BLEED_SOURCE_PROB, BROKEN_LEG_PROB, DAMAGE_TRIGGER_MINE, DamageClothing(), DeleteThis(), Explode(), GetGame(), m_UpdateTimer, MAX_BLEED_SOURCE, Math::RandomInt(), Math::RandomIntInclusive() и UPDATE_TIMER_INTERVAL.

◆ OnSteppedOut()

override void OnSteppedOut ( EntityAI victim)
private
167 {
168 if (victim.IsInherited(CarScript))
169 {
170 if (m_UpdateTimer && m_UpdateTimer.IsRunning())
171 {
172 m_UpdateTimer.Stop();
173 }
174 }
175 }

Перекрестные ссылки m_UpdateTimer.

◆ OnUpdate()

override void OnUpdate ( EntityAI victim)
private
90 {
91 if (victim && victim.IsInherited(CarScript))
92 {
94 if (wheel)
95 {
97 }
98 }
99 }
void OnServerSteppedOn(Object obj, string damageZone)
Definition Trap_LandMine.c:177
EntityAI GetClosestCarWheel(EntityAI victim)
Definition TrapBase.c:628

Перекрестные ссылки GetClosestCarWheel() и TrapBase::OnServerSteppedOn().

◆ PlayDisarmingLoopSound()

void PlayDisarmingLoopSound ( )
protected
269 {
270 if (!m_DisarmingLoopSound || !m_DisarmingLoopSound.IsSoundPlaying())
271 {
272 m_DisarmingLoopSound = SEffectManager.PlaySound("landmine_deploy_SoundSet", GetPosition());
273 }
274 }
ref EffectSound m_DisarmingLoopSound
Definition Trap_LandMine.c:10
Manager class for managing Effect (EffectParticle, EffectSound)
Definition EffectManager.c:6
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
Definition EffectManager.c:169

Перекрестные ссылки GetPosition, m_DisarmingLoopSound и SEffectManager::PlaySound().

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

◆ PlaySoundActivate()

void PlaySoundActivate ( )
protected
212 {
213 if (!GetGame().IsDedicatedServer())
214 {
215 EffectSound sound = SEffectManager.PlaySound("landmineActivate_SoundSet", GetPosition(), 0, 0, false);
216 sound.SetAutodestroy(true);
217 }
218 }
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5

Перекрестные ссылки GetGame(), GetPosition и SEffectManager::PlaySound().

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

◆ SetActions()

override void SetActions ( )
protected
307 {
308 super.SetActions();
309
310 AddAction(ActionAttach);
313 AddAction(ActionDeployObject);
314 }
void ActionDetach()
Definition ActionDetach.c:10
void AddAction(typename actionName)
Definition AdvancedCommunication.c:220
Definition ActionTogglePlaceObject.c:2

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

◆ StartActivate()

override void StartActivate ( PlayerBase player)
private
45 {
46 super.StartActivate(player);
47
48 if (!GetGame().IsDedicatedServer())
49 {
51 {
52 m_SafetyPinSound = SEffectManager.PlaySound("landmine_safetyPin_SoundSet", GetPosition(), 0, 0, false);
53 m_SafetyPinSound.SetAutodestroy(true);
54 }
55
57 m_TimerLoopSound = SEffectManager.PlaySound("landmine_timer2_SoundSet", GetPosition(), 0, 0, true);
58 }
59 }
ref EffectSound m_SafetyPinSound
Definition Trap_LandMine.c:9

Перекрестные ссылки GetGame(), GetPosition, m_SafetyPinSound, m_TimerLoopSound и SEffectManager::PlaySound().

◆ StopDisarmingLoopSound()

void StopDisarmingLoopSound ( )
protected
277 {
278 m_DisarmingLoopSound.SoundStop();
279 }

Перекрестные ссылки m_DisarmingLoopSound.

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

◆ ~LandMineTrap()

void ~LandMineTrap ( )
private
39 {
42 }
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Definition EffectManager.c:271

Перекрестные ссылки SEffectManager::DestroyEffect(), m_DisarmingLoopSound и m_TimerLoopSound.

Переменные

◆ BLEED_SOURCE_PROB

const int BLEED_SOURCE_PROB = 50
private

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

◆ BROKEN_LEG_PROB

const int BROKEN_LEG_PROB = 90
private

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

◆ m_DeleteTimer

ref Timer m_DeleteTimer
protected

◆ m_DisarmingLoopSound

ref EffectSound m_DisarmingLoopSound
protected

◆ m_SafetyPinSound

ref EffectSound m_SafetyPinSound
protected

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

◆ m_TimerLoopSound

enum SoundTypeMine m_TimerLoopSound

Используется в OnActivate(), StartActivate() и ~LandMineTrap().

◆ MAX_BLEED_SOURCE

const int MAX_BLEED_SOURCE = 1
private

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