public static bool getWeaponDamageOnJamming(Weapon weapon) { TripleBoolean result = TripleBoolean.NotSet; ExtWeaponDef extWeapon = CustomAmmoCategories.getExtWeaponDef(weapon.defId); if (extWeapon.Modes.Count > 0) { string modeId = ""; if (CustomAmmoCategories.checkExistance(weapon.StatCollection, CustomAmmoCategories.WeaponModeStatisticName) == true) { modeId = weapon.StatCollection.GetStatistic(CustomAmmoCategories.WeaponModeStatisticName).Value <string>(); } else { modeId = extWeapon.baseModeId; } if (extWeapon.Modes.ContainsKey(modeId)) { result = extWeapon.Modes[modeId].DamageOnJamming; } } if (result == TripleBoolean.NotSet) { result = extWeapon.DamageOnJamming; } return(result == TripleBoolean.True); }
public static bool getWeaponDistantVarianceReversed(Weapon weapon) { TripleBoolean result = TripleBoolean.NotSet; ExtWeaponDef extWeapon = CustomAmmoCategories.getExtWeaponDef(weapon.defId); if (extWeapon.Modes.Count > 0) { string modeId = ""; if (CustomAmmoCategories.checkExistance(weapon.StatCollection, CustomAmmoCategories.WeaponModeStatisticName) == true) { modeId = weapon.StatCollection.GetStatistic(CustomAmmoCategories.WeaponModeStatisticName).Value <string>(); } else { modeId = extWeapon.baseModeId; } if (extWeapon.Modes.ContainsKey(modeId)) { result = extWeapon.Modes[modeId].DistantVarianceReversed; } } if (result == TripleBoolean.NotSet) { if (CustomAmmoCategories.checkExistance(weapon.StatCollection, CustomAmmoCategories.AmmoIdStatName) == true) { string ammoId = weapon.StatCollection.GetStatistic(CustomAmmoCategories.AmmoIdStatName).Value <string>(); ExtAmmunitionDef extAmmo = CustomAmmoCategories.findExtAmmo(ammoId); result = extAmmo.DistantVarianceReversed; } } return(result == TripleBoolean.True); }
public ExtWeaponDef() { StreakEffect = false; HitGenerator = HitGeneratorType.NotSet; DirectFireModifier = 0; FlatJammingChance = 0; GunneryJammingBase = 0; GunneryJammingMult = 0; baseModeId = WeaponMode.NONE_MODE_NAME; DisableClustering = TripleBoolean.True; NotUseInMelee = TripleBoolean.NotSet; DamageOnJamming = TripleBoolean.NotSet; AmmoCategory = new CustomAmmoCategory(); Modes = new Dictionary <string, WeaponMode>(); }
public ExtAmmunitionDef() { AccuracyModifier = 0; DirectFireModifier = 0; DamagePerShot = 0; HeatDamagePerShot = 0; ProjectilesPerShot = 0; ShotsWhenFired = 0; CriticalChanceMultiplier = 0; DamageMultiplier = 1.0f; MinRange = 0; MaxRange = 0; LongRange = 0; MaxRange = 0; ShortRange = 0; MediumRange = 0; AIBattleValue = 100; RefireModifier = 0; Instability = 0; AttackRecoil = 0; EvasivePipsIgnored = 0; FlatJammingChance = 0; DistantVariance = 0; DistantVarianceReversed = TripleBoolean.NotSet; DamageVariance = 0; ForbiddenRange = 0; GunneryJammingBase = 0; GunneryJammingMult = 0; IndirectFireCapable = TripleBoolean.NotSet; AlwaysIndirectVisuals = TripleBoolean.NotSet; AOECapable = TripleBoolean.NotSet; WeaponEffectID = ""; HitGenerator = HitGeneratorType.NotSet; statusEffects = new EffectData[0] { }; AmmoCategory = new CustomAmmoCategory(); }