Beispiel #1
0
        public static string CompleteStatReport(StatDef stat, ApparelFlags effectMask, Comp_NightVision comp, float relevantGlow)
        {
            float factorFromGlow = comp.FactorFromGlow(glow: relevantGlow);

            return(BasicExplanation(glow: relevantGlow, usedApparelSetting: out bool UsedApparel, comp: comp)
                   + FinalValue(stat: stat, value: factorFromGlow)
                   + (effectMask != ApparelFlags.None && UsedApparel ? ApparelPart(effectMask: effectMask, comp: comp) : ""));
        }
Beispiel #2
0
        private static string ApparelPart(ApparelFlags effectMask, Comp_NightVision comp)
        {
            var builder = new StringBuilder();

            builder.AppendLine(value: "StatsReport_RelevantGear".Translate());
            var nvApparel = Settings.Store.NVApparel;

            foreach (Apparel app in comp.PawnsNVApparel ?? Enumerable.Empty <Apparel>())
            {
                if (nvApparel.TryGetValue(key: app.def, value: out ApparelVisionSetting setting) &&
                    setting.HasEffect(effectMask))
                {
                    builder.AppendLine(value: app.LabelCap);
                }
            }

            return(builder.ToString());
        }
Beispiel #3
0
 private void SetApparelFlags()
 {
     SettingsFlags  = (NullifiesPS ? ApparelFlags.NullifiesPS : ApparelFlags.None);
     SettingsFlags |= (GrantsNV ? ApparelFlags.GrantsNV : ApparelFlags.None);
 }
Beispiel #4
0
 public bool HasEffect(ApparelFlags effectFlag)
 {
     return((SettingsFlags & effectFlag) != ApparelFlags.None);
 }