DayZ
1.24
Loading...
Searching...
No Matches
Hit_Wood.c
Go to the documentation of this file.
1
class
Hit_Wood
:
EffBulletImpactBase
2
{
3
void
Hit_Wood
()
4
{
5
SetEnterParticle
(
ParticleList
.
IMPACT_WOOD_ENTER
);
6
SetExitParticle
(
ParticleList
.
IMPACT_WOOD_EXIT
);
7
SetRicochetParticle
(
ParticleList
.
IMPACT_WOOD_RICOCHET
);
8
}
9
10
override
void
OnEnterCalculations
(
Particle
p
)
11
{
12
// All values represent scale
13
float
velocity_min
=
MIN_SCALING_PARAM
+ (
m_StoppingForce
*
m_EnterSplashCoef
);
14
float
velocity_max
=
MIN_SCALING_PARAM
+ (
m_StoppingForce
*
m_EnterSplashCoef
);
15
float
size
=
MIN_SCALING_PARAM
+ (
m_StoppingForce
*
m_EnterSplashCoef
) * 0.5;
16
float
birth_rate
=
MIN_SCALING_PARAM
+ (
m_StoppingForce
*
m_EnterSplashCoef
) * 0.5;
17
18
if
(
velocity_min
<
MIN_SCALING_PARAM
)
19
velocity_min
=
MIN_SCALING_PARAM
;
20
21
if
(
size
<
MIN_SCALING_PARAM
)
22
size
=
MIN_SCALING_PARAM
;
23
24
if
(
birth_rate
<
MIN_SCALING_PARAM
)
25
birth_rate
=
MIN_SCALING_PARAM
;
26
27
28
p
.ScaleParticleParam(
EmitorParam
.VELOCITY,
velocity_min
);
29
p
.ScaleParticleParam(
EmitorParam
.VELOCITY_RND,
velocity_max
);
30
p
.ScaleParticleParam(
EmitorParam
.SIZE,
size
);
31
p
.ScaleParticleParam(
EmitorParam
.BIRTH_RATE,
birth_rate
);
32
}
33
34
override
void
OnExitCalculations
(
Particle
p
,
float
outSpeedf
)
35
{
36
float
velocity_min
= 1 + (
outSpeedf
*
m_ExitSplashCoef
);
37
float
velocity_max
= 1 + (
outSpeedf
*
m_ExitSplashCoef
);
38
float
size
= 1 + (
outSpeedf
*
m_ExitSplashCoef
) * 0.5;
39
float
birth_rate
= 1 + (
outSpeedf
*
m_ExitSplashCoef
) * 0.5;
40
41
if
(
velocity_min
<
MIN_SCALING_PARAM
)
42
velocity_min
=
MIN_SCALING_PARAM
;
43
44
if
(
size
<
MIN_SCALING_PARAM
)
45
size
=
MIN_SCALING_PARAM
;
46
47
if
(
birth_rate
<
MIN_SCALING_PARAM
)
48
birth_rate
=
MIN_SCALING_PARAM
;
49
50
p
.ScaleParticleParam(
EmitorParam
.VELOCITY,
velocity_min
);
51
p
.ScaleParticleParam(
EmitorParam
.VELOCITY_RND,
velocity_max
);
52
p
.ScaleParticleParam(
EmitorParam
.SIZE,
size
);
53
p
.ScaleParticleParam(
EmitorParam
.BIRTH_RATE,
birth_rate
);
54
}
55
}
EffBulletImpactBase
Definition
BulletImpactBase.c:2
EffBulletImpactBase::SetExitParticle
void SetExitParticle(int id)
Definition
BulletImpactBase.c:50
EffBulletImpactBase::SetEnterParticle
void SetEnterParticle(int id)
Definition
BulletImpactBase.c:45
EffBulletImpactBase::m_StoppingForce
float m_StoppingForce
Definition
BulletImpactBase.c:10
EffBulletImpactBase::m_EnterSplashCoef
float m_EnterSplashCoef
Definition
BulletImpactBase.c:29
EffBulletImpactBase::SetRicochetParticle
void SetRicochetParticle(int id)
Definition
BulletImpactBase.c:55
EffBulletImpactBase::m_ExitSplashCoef
float m_ExitSplashCoef
Definition
BulletImpactBase.c:30
EffBulletImpactBase::MIN_SCALING_PARAM
float MIN_SCALING_PARAM
Definition
BulletImpactBase.c:7
Hit_Wood
Definition
Hit_Wood.c:2
Hit_Wood::OnExitCalculations
override void OnExitCalculations(Particle p, float outSpeedf)
Definition
Hit_Wood.c:34
Hit_Wood::Hit_Wood
void Hit_Wood()
Definition
Hit_Wood.c:3
Hit_Wood::OnEnterCalculations
override void OnEnterCalculations(Particle p)
Definition
Hit_Wood.c:10
Param3
Definition
EntityAI.c:95
Particle
Legacy way of using particles in the game.
Definition
Particle.c:7
ParticleList
Definition
ParticleList.c:12
ParticleList::IMPACT_WOOD_ENTER
static const int IMPACT_WOOD_ENTER
Definition
ParticleList.c:200
ParticleList::IMPACT_WOOD_RICOCHET
static const int IMPACT_WOOD_RICOCHET
Definition
ParticleList.c:201
ParticleList::IMPACT_WOOD_EXIT
static const int IMPACT_WOOD_EXIT
Definition
ParticleList.c:202
EmitorParam
EmitorParam
Definition
EnVisual.c:114
scripts
3_Game
Effects
EffectParticle
BulletImpactBase
Hit_Wood.c
Generated by
1.10.0