DayZ
1.27
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
MiscEffects.c
См. документацию.
1
class
MiscEffects
:
Managed
2
{
3
protected
static
const
int
VEGE_COLLISION_COOLDOWN
= 3000;
// ms
4
protected
static
ref
map <Object, float>
m_VegeCollideColldowns
=
new
map <Object, float>
();
5
6
// Called by individual clients when player collides with a vegetation
7
static
void
PlayVegetationCollideParticles
(
Object
object
,
DayZPlayerImplement
player)
8
{
9
UpdateVegeCollisionCooldowns
();
10
if
(
m_VegeCollideColldowns
.Get(
object
))
11
return
;
12
13
int
particleID;
14
string
particleName;
15
string
configPath =
"CfgNonAIVehicles "
+
object
.GetType() +
" collisionParticle"
;
16
GetGame
().
ConfigGetText
(configPath, particleName);
17
if
(particleName ==
string
.
Empty
)
// no ptc assigned
18
return
;
19
20
particleID =
ParticleList
.
GetParticleIDByName
(particleName);
21
vector
playerPos = player.GetPosition();
22
vector
ptcPos = playerPos -
object
.GetPosition();
23
24
ptcPos[0] = ptcPos[0] *
Math
.
RandomFloat
(0, 0.5);
// randomize
25
ptcPos[2] = ptcPos[2] *
Math
.
RandomFloat
(0, 0.5);
26
27
ptcPos = playerPos - ptcPos;
28
ptcPos[1] = playerPos[1] +
Math
.
RandomFloat
(0.5, 1.5);
29
30
ParticleManager
.GetInstance().PlayInWorld(particleID, ptcPos);
31
32
m_VegeCollideColldowns
.Insert(
object
,
GetWorldTime
());
33
}
34
35
protected
static
void
UpdateVegeCollisionCooldowns
()
36
{
37
float
time =
GetWorldTime
();
38
foreach
(
Object
key,
float
cd :
m_VegeCollideColldowns
)
39
{
40
if
((time - cd) >
VEGE_COLLISION_COOLDOWN
)
41
{
42
m_VegeCollideColldowns
.Remove(key);
43
break
;
44
}
45
}
46
}
47
}
map
map
Определения
ControlsXboxNew.c:4
Empty
Empty
Определения
Hand_States.c:14
ParticleManager
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Определения
ParticleManager.c:88
CGame::ConfigGetText
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
DayZPlayerImplement
Определения
ManBase.c:2
Managed
TODO doc.
Определения
EnScript.c:118
Math
Определения
EnMath.c:7
MiscEffects::PlayVegetationCollideParticles
static void PlayVegetationCollideParticles(Object object, DayZPlayerImplement player)
Определения
MiscEffects.c:7
MiscEffects::VEGE_COLLISION_COOLDOWN
static const int VEGE_COLLISION_COOLDOWN
Определения
MiscEffects.c:3
MiscEffects::UpdateVegeCollisionCooldowns
static void UpdateVegeCollisionCooldowns()
Определения
MiscEffects.c:35
MiscEffects::m_VegeCollideColldowns
static ref map< Object, float > m_VegeCollideColldowns
Определения
MiscEffects.c:4
MiscEffects
Определения
MiscEffects.c:2
Object
Определения
ObjectTyped.c:2
ParticleList::GetParticleIDByName
static int GetParticleIDByName(string name)
Returns particle's ID based on the filename (without .ptc suffix)
Определения
ParticleList.c:500
ParticleList
Определения
ParticleList.c:12
vector
Определения
EnConvert.c:106
GetGame
proto native CGame GetGame()
Math::RandomFloat
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
GetWorldTime
proto native float GetWorldTime()
Ishodniki
scripts
4_World
Static
MiscEffects.c
Создано системой
1.13.2