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

◆ OnActivate()

void WeaponParticlesBase::OnActivate ( ItemBase weapon,
int muzzle_index,
string ammoType,
ItemBase muzzle_owner,
ItemBase suppressor,
string config_to_search )
inlineprivate

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

166 {
167 if ( !g_Game.IsServer() || !g_Game.IsMultiplayer() )
168 {
169 // Handle effect's parameters
170 if ( PrtTest.m_GunParticlesState ) // Check if particles are enabled by debug
171 {
172 if ( m_MuzzleIndex == -1 || m_MuzzleIndex == muzzle_index )
173 {
174 if ( CheckBoltStateCondition(weapon) ) // onlyIfBoltIsOpen
175 {
176 if ( !suppressor || suppressor.IsRuined() || !(m_IgnoreIfSuppressed) ) // ignoreIfSuppressed
177 {
178 if ( CheckHealthCondition( muzzle_owner.GetHealthLevel() ) ) // onlyWithinHealthLabel
179 {
180 if ( CheckOverheatingCondition( muzzle_owner.GetOverheatingCoef() ) ) // onlyWithinOverheatLimits
181 {
182 if ( CheckRainCondition( g_Game.GetWeather().GetRain().GetActual() ) ) // onlyWithinRainLimits
183 {
184 if ( m_OnlyIfBulletIs == "" || m_OnlyIfBulletIs == ammoType ) // onlyIfBulletIs
185 {
186 if ( m_OnlyIfWeaponIs == "" || m_OnlyIfWeaponIs == weapon.GetType() ) // onlyIfWeaponIs
187 {
188 // Get particle ID
189 int particle_id = CheckParticleOverride(ammoType);
190
191 if (ParticleList.IsValidId(particle_id))
192 {
193 // Get position of the particle
194 vector local_pos = muzzle_owner.GetSelectionPositionLS(m_OverridePoint);
195 local_pos += m_PositionOffset;
196
197 // Set orientation of the particle
198 vector particle_ori = CheckOrientationOverride(local_pos, muzzle_owner);
199
200 // Create particle
201 Particle p = ParticleManager.GetInstance().PlayOnObject( particle_id, muzzle_owner, local_pos, particle_ori );
202 OnParticleCreated(weapon, ammoType, muzzle_owner, suppressor, config_to_search, p);
203 }
204 else
205 {
206 ErrorEx(string.Format("No valid particle found for: '%1'", m_Name));
207 }
208
209 // Create light
211 {
212 vector global_pos = muzzle_owner.ModelToWorld(local_pos + Vector(-0.2, 0, 0));
213 int randX = Math.RandomInt( 0,10 );
214 if ( randX > 8 )
215 ScriptedLightBase.CreateLight( MuzzleFlashLight_2, global_pos );
216 else if ( randX > 4 )
217 ScriptedLightBase.CreateLight( MuzzleFlashLight_1, global_pos );
218 else
219 ScriptedLightBase.CreateLight(MuzzleFlashLight, global_pos);
220 }
221 }
222 }
223 }
224 }
225 }
226 }
227 }
228 }
229 }
230 }
231 }
DayZGame g_Game
Определения DayZGame.c:3942
void MuzzleFlashLight_1()
Определения MuzzleFlashLight.c:24
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Определения ParticleManager.c:88
int particle_id
Определения SmokeSimulation.c:28
bool CheckRainCondition(float rain_coef)
Определения WeaponParticles.c:280
bool CheckHealthCondition(int health_label)
Определения WeaponParticles.c:268
vector m_PositionOffset
Определения WeaponParticles.c:25
string m_OnlyIfWeaponIs
Определения WeaponParticles.c:22
bool m_IgnoreIfSuppressed
Определения WeaponParticles.c:10
string m_OnlyIfBulletIs
Определения WeaponParticles.c:21
int m_MuzzleIndex
Определения WeaponParticles.c:12
vector CheckOrientationOverride(vector local_pos, ItemBase muzzle_owner)
Определения WeaponParticles.c:327
bool CheckOverheatingCondition(float overheating_coef)
Определения WeaponParticles.c:274
int CheckParticleOverride(string ammoType)
Определения WeaponParticles.c:286
string m_Name
Определения WeaponParticles.c:27
string m_OverridePoint
Определения WeaponParticles.c:23
void OnParticleCreated(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search, Particle p)
Определения WeaponParticles.c:233
bool CheckBoltStateCondition(ItemBase weapon)
Определения WeaponParticles.c:255
bool m_IlluminateWorld
Определения WeaponParticles.c:9
enum ShapeType ErrorEx
proto native vector Vector(float x, float y, float z)
Vector constructor from components.

Перекрестные ссылки CheckBoltStateCondition(), CheckHealthCondition(), CheckOrientationOverride(), CheckOverheatingCondition(), CheckParticleOverride(), CheckRainCondition(), ErrorEx, g_Game, ParticleList::IsValidId(), PrtTest::m_GunParticlesState, m_IgnoreIfSuppressed, m_IlluminateWorld, m_MuzzleIndex, m_Name, m_OnlyIfBulletIs, m_OnlyIfWeaponIs, m_OverridePoint, m_PositionOffset, MuzzleFlashLight_1(), OnParticleCreated(), particle_id, ParticleManager(), Math::RandomInt() и Vector().