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

Private Member Functions

void Hit_MeatBones ()
 
override float CalculateStoppingForce (float in_speedf, float out_speedf, string ammoType, float weight)
 
override void Event_OnStarted ()
 
void BloodSplatGround (vector start_pos, vector speed_vector, float decay_coef)
 
void BloodSplatWall ()
 
override void OnEnterCalculations (Particle p)
 
override void OnExitCalculations (Particle p, float outSpeedf)
 

Private Attributes

float m_ScalingByDistance
 

Detailed Description

Definition at line 1 of file Hit_MeatBones.c.

Constructor & Destructor Documentation

◆ Hit_MeatBones()

void Hit_MeatBones::Hit_MeatBones ( )
inlineprivate

Definition at line 5 of file Hit_MeatBones.c.

References ParticleList::IMPACT_MEATBONES_ENTER, ParticleList::IMPACT_MEATBONES_EXIT, ParticleList::IMPACT_MEATBONES_RICOCHET, EffBulletImpactBase::m_AngledEnter, EffBulletImpactBase::m_EnterSplashCoef, EffBulletImpactBase::m_ExitSplashCoef, m_ScalingByDistance, EffBulletImpactBase::MIN_SCALING_PARAM, EffBulletImpactBase::SetEnterParticle(), EffBulletImpactBase::SetExitParticle(), and EffBulletImpactBase::SetRicochetParticle().

Member Function Documentation

◆ BloodSplatGround()

void Hit_MeatBones::BloodSplatGround ( vector start_pos,
vector speed_vector,
float decay_coef )
inlineprivate

Definition at line 64 of file Hit_MeatBones.c.

65 {
66 vector pos = start_pos;
67 float power = m_StoppingForce;
68 float upscale = 1;
69 float rnd_offset = 0.5;
70 float rnd_offset_2 = rnd_offset * 0.5;
71
72 while (power > 200)
73 {
74 pos = pos + (speed_vector * 0.001);
76 pos[1] = GetGame().SurfaceY(pos[0], pos[2]);
77
79 eff.SetAutodestroy(true);
81
82 Particle blood = eff.GetParticle(); // TO DO: Handle particle changes inside the Effect instance itself! Not here!
83
84 vector ori = GetGame().GetSurfaceOrientation(pos[0], pos[2]);
85
86 blood.SetOrientation(ori);
87 blood.ScaleParticleParam(EmitorParam.SIZE, upscale);
88
90 blood_chunks.SetOrientation(ori);
91
93 upscale = upscale + Math.RandomFloat(0.1, 1);
94
96 }
97 }
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Wrapper class for managing particles through SEffectManager.
void BloodSplatWall()
Definition EnMath.c:7
Legacy way of using particles in the game.
Definition Particle.c:7
static const int BLOOD_SURFACE_CHUNKS
Manager class for managing Effect (EffectParticle, EffectSound)
static int PlayInWorld(notnull Effect eff, vector pos)
Play an Effect.
proto native CGame GetGame()
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
EmitorParam
Definition EnVisual.c:114

References ParticleList::BLOOD_SURFACE_CHUNKS, BloodSplatWall(), GetGame(), EffBulletImpactBase::m_StoppingForce, ParticleManager(), SEffectManager::PlayInWorld(), Math::RandomFloat(), and Vector().

Referenced by Event_OnStarted().

◆ BloodSplatWall()

void Hit_MeatBones::BloodSplatWall ( )
inlineprivate

Definition at line 99 of file Hit_MeatBones.c.

100 {
101 // Commented out due to age rating process :(
102
103 /*
104 if (m_OutSpeed.Length() > 0)
105 {
106 Object projected_surface;
107 vector hit_pos;
108 vector hit_normal;
109 float hit_fraction;
110 DayZPhysics.RayCastBullet(m_ExitPos, m_ExitPos + m_OutSpeed, PhxInteractionLayers.BUILDING, m_Object, projected_surface, hit_pos, hit_normal, hit_fraction);
111
112 hit_normal = hit_normal.VectorToAngles();
113 hit_normal[1] = hit_normal[1] + 90;
114
115 EffectParticle eff = new BloodSplatter();
116 eff.SetAutodestroy(true);
117 SEffectManager.PlayInWorld(eff, hit_pos);
118 Particle blood = eff.GetParticle();
119 blood.SetOrientation(hit_normal);
120 }
121 */
122 }

Referenced by BloodSplatGround().

◆ CalculateStoppingForce()

override float Hit_MeatBones::CalculateStoppingForce ( float in_speedf,
float out_speedf,
string ammoType,
float weight )
inlineprivate

Definition at line 19 of file Hit_MeatBones.c.

20 {
21 if (m_ImpactType == ImpactTypes.MELEE)
22 return 400;
23
25
27
28 if (m_DirectHit)
29 {
30 /*
31 // TO DO: Doesn't work because IsAlive() is false, even when it shouldn't be.
32 if ( m_DirectHit.IsMan() && m_componentIndex == SURVIVOR_HEAD && m_DirectHit.IsAlive() ) // Is the victim a survivor?
33 {
34 stopping_force = stopping_force * 2;
35 }
36 */
37
38 /*
39 // TO DO: Doesn't work. Need to recognize a zombie somehow
40 else if ( m_DirectHit.IsInherited(DayZCreatureAIType) && m_componentIndex == INFECTED_HEAD ) // Is the victim a survivor that's hit in the head?
41 {
42 stopping_force = stopping_force * 2;
43 }*/
44 }
45
46 return stopping_force;
47 }
ImpactTypes
static float DEFAULT_PROJECTILE_WEIGHT

References EffBulletImpactBase::DEFAULT_PROJECTILE_WEIGHT, EffBulletImpactBase::m_DirectHit, and EffBulletImpactBase::m_ImpactType.

◆ Event_OnStarted()

override void Hit_MeatBones::Event_OnStarted ( )
inlineprivate

Definition at line 49 of file Hit_MeatBones.c.

50 {
51 super.Event_OnStarted();
52
53 if (m_ImpactType != ImpactTypes.MELEE)
54 {
55 vector in_speed = m_InSpeed * (-1); // Compiler demands to have this variable
56
58
59 if (m_OutSpeed.Length() > 0)
61 }
62 }
class JsonUndergroundAreaTriggerData GetPosition
void BloodSplatGround(vector start_pos, vector speed_vector, float decay_coef)
proto native float Length()
Returns length of vector (magnitude)

References BloodSplatGround(), GetPosition, vector::Length(), EffBulletImpactBase::m_ExitPos, EffBulletImpactBase::m_ImpactType, EffBulletImpactBase::m_InSpeed, and EffBulletImpactBase::m_OutSpeed.

◆ OnEnterCalculations()

override void Hit_MeatBones::OnEnterCalculations ( Particle p)
inlineprivate

Definition at line 124 of file Hit_MeatBones.c.

125 {
126 // Calculate particle's size based on bullet's speed
131
132 if (m_AmmoType == "Bullet_12GaugePellets")
133 {
134 birth_rate *= 0.5;
135 velocity_min *= 2;
136 velocity_max *= 2;
137 }
138
139 // Additional size increase by distance from camera
140 vector camera_pos = GetGame().GetCurrentCameraPosition();
143
144 // Now scale down the above size increase by player's zoom-in value
145 float current_FOV = Camera.GetCurrentFOV();
146 float config_FOV = GetDayZGame().GetUserFOVFromConfig();
149
150 if (scaling_by_distance > 5)
152
156
159
162
165
168
169 p.ScaleParticleParam(EmitorParam.VELOCITY, velocity_min);
170 p.ScaleParticleParam(EmitorParam.VELOCITY_RND, velocity_max);
171 p.ScaleParticleParam(EmitorParam.SIZE, size);
172 p.ScaleParticleParam(EmitorParam.BIRTH_RATE, birth_rate);
173 }
DayZGame GetDayZGame()
Definition DayZGame.c:3530
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.

References vector::Distance(), GetDayZGame(), GetGame(), EffBulletImpactBase::m_AmmoType, EffBulletImpactBase::m_EnterSplashCoef, EffBulletImpactBase::m_Pos, m_ScalingByDistance, EffBulletImpactBase::m_StoppingForce, and EffBulletImpactBase::MIN_SCALING_PARAM.

◆ OnExitCalculations()

override void Hit_MeatBones::OnExitCalculations ( Particle p,
float outSpeedf )
inlineprivate

Definition at line 175 of file Hit_MeatBones.c.

176 {
180
183
186
187 if (size > 1)
188 size = 1;
189
192
193 p.ScaleParticleParam(EmitorParam.VELOCITY_RND, velocity_rnd);
194 p.ScaleParticleParam(EmitorParam.BIRTH_RATE, birth_rate_rnd_def);
195 p.ScaleParticleParam(EmitorParam.SIZE, size);
196 }

References EffBulletImpactBase::m_ExitSplashCoef, and EffBulletImpactBase::MIN_SCALING_PARAM.

Member Data Documentation

◆ m_ScalingByDistance

float Hit_MeatBones::m_ScalingByDistance
private

Definition at line 3 of file Hit_MeatBones.c.

Referenced by Hit_MeatBones(), and OnEnterCalculations().


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