6 static float GetAmmoWeightByBulletType(
string bulletType)
8 if (m_AmmoWeightByBulletType.Contains(bulletType))
10 return m_AmmoWeightByBulletType.Get(bulletType);
16 g_Game.ConfigGetText(
string.Format(
"CfgAmmo %1 spawnPileType", bulletType) , ammoTypeName);
18 ammoWeight =
g_Game.ConfigGetFloat(
string.Format(
"CfgMagazines %1 weight", ammoTypeName));
20 ErrorEx(
"empty 'spawnPileType' for bullet type:" + bulletType);
22 m_AmmoWeightByBulletType.Insert(bulletType, ammoWeight);
27 override bool IsAmmoPile()
35 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
38 data.SetCalcDetails(
"TAmmo: ("+GetAmmoCount()+
"(Ammo count) * "+ GetConfigWeightModifiedDebugText());
42 return GetAmmoCount() * GetConfigWeightModified();
47 ServerSetAmmoCount(1);
52 float dmgPerUse =
g_Game.ConfigGetFloat(
"cfgAmmo " + info.GetAmmoType() +
" dmgPerUse");
53 float totalDmg = info.GetProjectileDamage() + dmgPerUse;
54 float health =
Math.Max(1 - totalDmg, 0);
57 SetHealth01(
"",
"", health);
61 SetCartridgeDamageAtIndex(0, totalDmg);
93 if (super.CanBeActionTarget())
98 return !parent.IsManagingArrows();
116 override void EEParentedFrom(
EntityAI parent)
159 static void PlayOnHitParticle(
vector position)
171 return GetAnimationPhase(
"Visibility") == 0;
176 if (!super.IsInventoryVisible())
192 override void OnActivatedByItem(notnull
ItemBase item)
196 DamageSystem.ExplosionDamage(
this, null,
"Explosion_40mm_Ammo", item.GetPosition(),
DamageType.EXPLOSION);
200 override void EEKilled(
Object killer)
202 super.EEKilled(killer);
203 DamageSystem.ExplosionDamage(
this, null,
"Explosion_40mm_Ammo",
GetPosition(),
DamageType.EXPLOSION);
207 override void OnDamageDestroyed(
int oldLevel)
209 super.OnDamageDestroyed(oldLevel);
222 g_Game.CreateObject(
"ContaminatedArea_Local", item.GetPosition());
228 super.EEKilled(killer);
235 super.OnDamageDestroyed(oldLevel);
255 RegisterNetSyncVariableBool(
"m_Activated");
260 super.OnVariablesSynchronized();
265 string particleStrIdentifier =
g_Game.ConfigGetTextOut(
string.Format(
"CfgMagazines %1 particleStrIdentifier",
GetType()));
289 g_Game.GetAnalyticsServer().OnEntityKilled(killer,
this);
301 super.EEDelete(parent);
311 SetHealth(
"",
"", 0.0);
eBleedingSourceType GetType()
void AddAction(typename actionName)
class PASBroadcaster extends AdvancedCommunication IsInventoryVisible
Ammo_HuntingBolt Bolt_Base SetActions()
override void EEKilled(Object killer)
override void EEParentedFrom(EntityAI parent)
Ammo_40mm_Explosive Ammo_40mm_Base OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void OnDamageDestroyed(int oldLevel)
Ammo_40mm_Base EEParentedTo
override bool ShootsExplosiveAmmo()
override void OnActivatedByItem(notnull ItemBase item)
override void EEKilled(Object killer)
special behaviour - do not call super
override bool CanPutInCargo(EntityAI parent)
override void OnVariablesSynchronized()
void Ammo_40mm_Smoke_ColorBase()
override void EEDelete(EntityAI parent)
override void SetFromProjectile(ProjectileStoppedInfo info)
float GetWeightSpecialized(bool forceRecalc=false)
override void SetQuantityToMinimum()
void RemoveArrow(EntityAI arrow)
void AddArrow(EntityAI arrow)
Legacy way of using particles in the game.
DamageType
exposed from C++ (do not change)
override bool IsTakeable()
vector GetPosition()
Get the world position of the Effect.
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor).
override bool CanBeActionTarget()