Example #1
0
        private float GetRangedDamagePerSecond(StatRequest req)
        {
            Pawn  pawn   = req.Thing as Pawn;
            Thing weapon = pawn.equipment?.Primary;

            if (weapon == null || !weapon.def.IsRangedWeapon)
            {
                return(0f);
            }

            return(RangedWeaponDPSUtility.GetDPS(weapon, Dist, pawn));
        }
Example #2
0
        public override string GetExplanationUnfinalized(StatRequest req, ToStringNumberSense numberSense)
        {
            Pawn pawn = req.Thing as Pawn;

            Thing weapon = pawn?.equipment?.Primary;

            if (weapon == null || !weapon.def.IsRangedWeapon)
            {
                return("M4_NoRangedWeapon".Translate());
            }

            return(RangedWeaponDPSUtility.GetExplanation(weapon, Dist, pawn));
        }