internal float BarValue(float totalDamage, bool useMeleeConstants = false) { var constants = UnityGameInstance.BattleTechGame.MechStatisticsConstants; var min = useMeleeConstants ? constants.MinStockMeleeDamage + constants.MinStockFirepower : constants.MinStockFirepower; var max = useMeleeConstants ? constants.MaxStockMeleeDamage + constants.MaxStockFirepower : constants.MaxStockFirepower; return(MechStatUtils.NormalizeToFraction(totalDamage, min, max)); }
public float BarValue(MechDef mechDef) { var armor = mechDef.MechDefAssignedArmor; armor *= ArmorMultiplier(mechDef); armor *= DamageReductionMultiplierAll(mechDef); var stats = UnityGameInstance.BattleTechGame.MechStatisticsConstants; return MechStatUtils.NormalizeToFraction(armor, 0, stats.MaxArmorFactor); }