9 bool m_IlluminateWorld;
10 bool m_IgnoreIfSuppressed;
11 bool m_OnlyIfBoltIsOpen;
13 int m_OverrideParticle;
14 int m_OnlyWithinHealthLabelMin;
15 int m_OnlyWithinHealthLabelMax;
16 float m_OnlyWithinOverheatLimitsMin;
17 float m_OnlyWithinOverheatLimitsMax;
18 float m_OnlyWithinRainLimitsMin;
19 float m_OnlyWithinRainLimitsMax;
20 string m_OverrideDirectionPoint;
21 string m_OnlyIfBulletIs;
22 string m_OnlyIfWeaponIs;
23 string m_OverridePoint;
24 vector m_OverrideDirectionVector;
35 m_Name = config_OnFire_entry;
47 if (
GetGame().ConfigIsExisting(
string.Format(
"%1 muzzleIndex",
m_Name)))
62 GetGame().ConfigGetFloatArray(
string.Format(
"%1 onlyWithinHealthLabel",
m_Name), health_limit);
64 if (health_limit.Count() == 2)
78 GetGame().ConfigGetFloatArray(
string.Format(
"%1 onlyWithinOverheatLimits",
m_Name), overheat_limit);
80 if (overheat_limit.Count() == 2)
94 GetGame().ConfigGetFloatArray(
string.Format(
"%1 onlyWithinRainLimits",
m_Name), rain_limit);
96 if (rain_limit.Count() == 2)
116 string particle_name =
"";
117 GetGame().ConfigGetText(
string.Format(
"%1 overrideParticle",
m_Name), particle_name);
119 if (particle_name !=
"")
126 ErrorEx(
string.Format(
"'%1' does not contain a definition for 'overrideparticle'",
137 vector test_ori =
GetGame().ConfigGetVector(
string.Format(
"%1 overrideDirectionVector",
m_Name));
139 if (test_ori !=
vector.Zero)
147 GetGame().ConfigGetFloatArray(
string.Format(
"%1 positionOffset",
m_Name), v);
165 void OnActivate(
ItemBase weapon,
int muzzle_index,
string ammoType,
ItemBase muzzle_owner,
ItemBase suppressor,
string config_to_search)
170 if (
PrtTest.m_GunParticlesState )
174 if ( CheckBoltStateCondition(weapon) )
178 if ( CheckHealthCondition( muzzle_owner.GetHealthLevel() ) )
180 if ( CheckOverheatingCondition( muzzle_owner.GetOverheatingCoef() ) )
182 if ( CheckRainCondition(
GetGame().GetWeather().GetRain().GetActual() ) )
198 vector particle_ori = CheckOrientationOverride(local_pos, muzzle_owner);
202 OnParticleCreated(weapon, ammoType, muzzle_owner, suppressor, config_to_search, p);
206 ErrorEx(
string.Format(
"No valid particle found for: '%1'",
m_Name));
212 vector global_pos = muzzle_owner.ModelToWorld(local_pos +
Vector(-0.2, 0, 0));
213 int randX =
Math.RandomInt( 0,10 );
216 else if ( randX > 4 )
238 void OnDeactivate(
ItemBase weapon,
string ammoType,
ItemBase muzzle_owner,
ItemBase suppressor,
string config_to_search)
243 void OnUpdate(
ItemBase weapon,
string ammoType,
ItemBase muzzle_owner,
ItemBase suppressor,
string config_to_search)
255 bool CheckBoltStateCondition(
ItemBase weapon)
261 return current_state.IsBoltOpen();
268 bool CheckHealthCondition(
int health_label)
274 bool CheckOverheatingCondition(
float overheating_coef)
280 bool CheckRainCondition(
float rain_coef)
286 int CheckParticleOverride(
string ammoType)
290 string particle_file =
"";
291 string cfg_path =
"CfgAmmo " + ammoType +
" muzzleFlashParticle";
292 if (
GetGame().ConfigGetText( cfg_path, particle_file))
299 if (particle_file ==
"")
301 ErrorEx(
string.Format(
"Cannot spawn particle effect because item %1 is missing config parameter muzzleFlashParticle!", ammoType),
ErrorExSeverity.INFO);
311 devStr =
" Make sure it's registered there and then rebuild Scripts and Graphics PBOs.";
313 ErrorEx(
string.Format(
"Cannot play particle effect with name %1 because no such file is registered in ParticleList.c!%2", particle_file, devStr));
329 vector particle_ori =
"0 0 0";
333 target_pos =
vector.Direction(local_pos, target_pos);
334 particle_ori = target_pos.VectorToAngles();
338 if (m_OverrideDirectionVector !=
Vector(0, 0, 0))
345 particle_ori = particle_ori +
Vector(0,0,270);
371 weapon.KillAllOverheatingParticles();
377 OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
389 float m_OverheatingLimitMin;
390 float m_OverheatingLimitMax;
402 void SetOverheatingLimitMin(
float min)
404 m_OverheatingLimitMin = min;
407 void SetOverheatingLimitMax(
float max)
409 m_OverheatingLimitMax = max;
412 float GetOverheatingLimitMin()
414 return m_OverheatingLimitMin;
417 float GetOverheatingLimitMax()
419 return m_OverheatingLimitMax;
435 Object GetParticleParent()