DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ GetUpperSoundsetVariant()

string GetUpperSoundsetVariant ( )
protected

См. определение в файле DustEffectCeilingHandler.c строка 209

210{
211 protected static int RANGE_MIN_DEFAULT = 4;
212 protected static int RANGE_MAX_DEFAULT = 8;
213 protected static float FLOOR_THICKNESS_DEFAULT = 0.4;
214
215 protected EntityAI m_Owner;
216 protected int m_StepCounter;
217 protected int m_NextEffectStepIdx;
218
220 {
221 m_Owner = owner;
222 m_StepCounter = 0;
223 }
224
225 protected void CalculateNextEffect(string surfaceType, int particleID)
226 {
227 int rangeMin = RANGE_MIN_DEFAULT;
228 int rangeMax = RANGE_MAX_DEFAULT;
229 DustEffectManager.AdjustCeilingDustEffectFrequency(surfaceType, particleID, rangeMin, rangeMax);
230 m_NextEffectStepIdx = Math.RandomIntInclusive(rangeMin,rangeMax);
231 }
232
233 void OnStepUpdate(SurfaceInfo surfaceInfo, string boneName = "")
234 {
235 int ceilingParticleID = surfaceInfo.GetCeilingDustParticleId();
236 if (ceilingParticleID <= 0)
237 return;
238
240
242 {
243 vector pos = GetBonePosition(boneName);
244 AdjustBySurfaceThickness(pos, surfaceInfo);
245 CreateEffects(ceilingParticleID, pos);
246 m_StepCounter = 0;
247 CalculateNextEffect(surfaceInfo.GetSurfaceType(), ceilingParticleID);
248 }
249 }
250
251 protected vector GetBonePosition(string boneName)
252 {
253 DayZCreature creature;
254 DayZPlayerImplement player;
255
256 vector ownerPos = m_Owner.GetPosition();
257 if (boneName == "")
258 return ownerPos;
259
260 int boneIdx = -1;
261 if (Class.CastTo(creature, m_Owner))
262 boneIdx = creature.GetBoneIndexByName(boneName);
263 if (Class.CastTo(player, m_Owner))
264 boneIdx = player.GetBoneIndexByName(boneName);
265
266 if (boneIdx == -1)
267 return ownerPos;
268
269 vector bonePos = m_Owner.GetBonePositionWS(boneIdx);
270 bonePos[1] = ownerPos[1]; //equalize Y to allow for consistent height adjustment later
271 return bonePos;
272 }
273
274 protected void AdjustBySurfaceThickness(inout vector pos, SurfaceInfo surfaceInfo)
275 {
276 float thicc = surfaceInfo.GetThickness(); //returns '-1' if not defined, for reasons
277 if (thicc < 0)
279 pos[1] = pos[1] - thicc;
280 }
281
282 protected void CreateEffects(int ceilingParticleID, vector position);
283}
284
285class DustEffectCeilingHandlerLocal : DustEffectCeilingHandlerBase
286{
287 override protected void CreateEffects(int ceilingParticleID, vector position)
288 {
289 if (DustEffectManager.GetDustEffectManager().IsCeilingDustEffectEnabled())
290 {
291 CeilingDustEffectBase effect = CeilingDustEffectBase.Cast(DustEffectManager.GetCeilingEffectType(ceilingParticleID).ToType().Spawn());
292 effect.SetParticle(ceilingParticleID);
293 effect.SetAutodestroy(true);
294 SEffectManager.PlayInWorld(effect, position);
295 }
296 }
297}
298
301{
303 override protected void CreateEffects(int ceilingParticleID, vector position)
304 {
305 //'spam' variant of effecters solution
306 SEffectManager.CreateParticleServer(position, new ParticleEffecterParameters("CeilingDustEffecter", 2.0, ceilingParticleID));
307 }
308}
309
311//effecter
312
313class CeilingDustEffecter : ParticleEffecter
314{
315 override protected typename GetEffectTypename()
316 {
317 return DustEffectManager.GetCeilingEffectType(m_ParticleEffectIDSync).ToType();
318 }
319}
320
322//effect class
323
325{
327 {
329 }
330
332 {
334 }
335
336 protected void PlayCeilingDustSound()
337 {
338 SEffectManager.PlaySound(GetAdjustedSoundSet(m_Position), m_Position).SetAutodestroy(true);
339 }
340
341 override void Start()
342 {
343 if (!DustEffectManager.GetDustEffectManager().IsCeilingDustEffectEnabled())
344 return;
345
346 super.Start();
347 }
348
349 protected string GetAdjustedSoundSet(vector effectPos)
350 {
351 vector playerPos = g_Game.GetPlayer().GetPosition();
352 bool upperVariant = effectPos[1] < playerPos[1];
353
354 if (upperVariant)
357 }
358
360 //methods to override in children classes
361
362 protected string GetLowerSoundsetVariant()
363 {
364 return "";
365 }
366
367 protected string GetUpperSoundsetVariant()
368 {
369 return "";
370 }
371}
372
373class CeilingDustEffectWood : CeilingDustEffectBase
374{
375 override protected string GetLowerSoundsetVariant()
376 {
377 return "CeilingDustEffect_SoundSet";
378 }
379
380 override protected string GetUpperSoundsetVariant()
381 {
382 return "CeilingDustEffectTop_SoundSet";
383 }
384}
DayZGame g_Game
Определения DayZGame.c:4074
class DustEffectCeilingHandlerBase CreateEffects(int ceilingParticleID, vector position)
Request from server, effecter handles the rest.
Определения DustEffectCeilingHandler.c:79
static float FLOOR_THICKNESS_DEFAULT
Определения DustEffectCeilingHandler.c:82
static int RANGE_MAX_DEFAULT
Определения DustEffectCeilingHandler.c:81
vector GetBonePosition(string boneName)
Определения DustEffectCeilingHandler.c:120
int m_StepCounter
Определения DustEffectCeilingHandler.c:85
void AdjustBySurfaceThickness(inout vector pos, SurfaceInfo surfaceInfo)
Определения DustEffectCeilingHandler.c:143
static int RANGE_MIN_DEFAULT
Определения DustEffectCeilingHandler.c:80
void CalculateNextEffect(string surfaceType, int particleID)
Определения DustEffectCeilingHandler.c:94
void CeilingDustEffectBase()
Определения DustEffectCeilingHandler.c:168
void OnStepUpdate(SurfaceInfo surfaceInfo, string boneName="")
Определения DustEffectCeilingHandler.c:102
void DustEffectCeilingHandlerBase(EntityAI owner)
Определения DustEffectCeilingHandler.c:88
int m_NextEffectStepIdx
Определения DustEffectCeilingHandler.c:86
vector position
Определения DustKickupEffects.c:20
ref ScriptInvoker Event_OnEffectStarted
Event used when the actual effect started playing.
Определения Effect.c:24
vector m_Position
Cached world position.
Определения Effect.c:43
void EffectParticleGeneral()
Определения EffectManager.c:871
enum ProcessDirectDamageFlags m_Owner
void ~CeilingDustEffectBase()
Определения DustEffectCeilingHandler.c:123
void CeilingDustEffectBase()
Определения DustEffectCeilingHandler.c:118
string GetAdjustedSoundSet(vector effectPos)
Определения DustEffectCeilingHandler.c:141
override void Start()
Определения DustEffectCeilingHandler.c:133
string GetUpperSoundsetVariant()
Определения DustEffectCeilingHandler.c:159
string GetLowerSoundsetVariant()
Определения DustEffectCeilingHandler.c:154
void PlayCeilingDustSound()
Определения DustEffectCeilingHandler.c:128
Super root of all classes in Enforce script.
Определения EnScript.c:11
Определения DayZAnimal.c:192
Определения ManBase.c:2
void CreateEffects(int ceilingParticleID, vector position)
void CreateEffects(int ceilingParticleID, vector position)
Request from server, effecter handles the rest.
Определения DustEffectCeilingHandler.c:95
Generic synced solution.
Определения DustEffectCeilingHandler.c:93
static void AdjustCeilingDustEffectFrequency(string surfaceType, int particleID, inout int min, inout int max)
optional adjustment of frequency by particleID
Определения DustEffectsManager.c:706
Определения EnMath.c:7
GetEffectTypename()
Определения EffectManager.c:857
proto bool Remove(func fn, int flags=EScriptInvokerRemoveFlags.ALL)
remove specific call from list
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
proto float GetThickness()
proto string GetSurfaceType()
proto int GetCeilingDustParticleId()
Определения SurfaceInfo.c:9
Определения EnConvert.c:119
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Определения EnMath.c:54