public override string GetExplanationUnfinalized(StatRequest req, ToStringNumberSense numberSense)
        {
            ThingDef thingDef = req.Def as ThingDef;

            if (thingDef == null)
            {
                return(null);
            }
            Pawn currentWeaponUser = StatWorker_MeleeAverageDPS.GetCurrentWeaponUser(req.Thing);
            IEnumerable <VerbUtility.VerbPropertiesWithSource> enumerable = from x in VerbUtility.GetAllVerbProperties(thingDef.Verbs, thingDef.tools)
                                                                            where x.verbProps.IsMeleeAttack
                                                                            select x;
            StringBuilder stringBuilder = new StringBuilder();

            foreach (VerbUtility.VerbPropertiesWithSource item in enumerable)
            {
                VerbUtility.VerbPropertiesWithSource current = item;
                float f = current.verbProps.AdjustedArmorPenetration(current.tool, currentWeaponUser, req.Thing, null);
                if (current.tool != null)
                {
                    stringBuilder.AppendLine(string.Format("  {0}: {1} ({2})", "Tool".Translate(), current.tool.LabelCap, current.ToolCapacity.defName));
                }
                else
                {
                    stringBuilder.AppendLine(string.Format("  {0}:", "StatsReport_NonToolAttack".Translate()));
                }
                stringBuilder.AppendLine("    " + f.ToStringPercent());
                stringBuilder.AppendLine();
            }
            return(stringBuilder.ToString());
        }
Beispiel #2
0
        public override string GetExplanationUnfinalized(StatRequest req, ToStringNumberSense numberSense)
        {
            ThingDef thingDef = req.Def as ThingDef;

            if (thingDef == null)
            {
                return(null);
            }
            GetVerbsAndTools(thingDef, out List <VerbProperties> verbs, out List <Tool> tools);
            Pawn currentWeaponUser = GetCurrentWeaponUser(req.Thing);
            IEnumerable <VerbUtility.VerbPropertiesWithSource> enumerable = from x in VerbUtility.GetAllVerbProperties(verbs, tools)
                                                                            where x.verbProps.IsMeleeAttack
                                                                            select x;
            StringBuilder stringBuilder = new StringBuilder();

            foreach (VerbUtility.VerbPropertiesWithSource item in enumerable)
            {
                VerbUtility.VerbPropertiesWithSource current = item;
                float num  = current.verbProps.AdjustedMeleeDamageAmount(current.tool, currentWeaponUser, req.Thing, null);
                float num2 = current.verbProps.AdjustedCooldown(current.tool, currentWeaponUser, req.Thing);
                if (current.tool != null)
                {
                    stringBuilder.AppendLine(string.Format("  {0}: {1} ({2})", "Tool".Translate(), current.tool.LabelCap, current.ToolCapacity.defName));
                }
                else
                {
                    stringBuilder.AppendLine(string.Format("  {0}:", "StatsReport_NonToolAttack".Translate()));
                }
                stringBuilder.AppendLine(string.Format("    {0} {1}", num.ToString("F1"), "DamageLower".Translate()));
                stringBuilder.AppendLine(string.Format("    {0} {1}", num2.ToString("F2"), "SecondsPerAttackLower".Translate()));
                stringBuilder.AppendLine();
            }
            return(stringBuilder.ToString());
        }
Beispiel #3
0
 internal float <> m__0(VerbUtility.VerbPropertiesWithSource x)
 {
     return(x.verbProps.AdjustedMeleeSelectionWeight(x.tool, this.attacker, this.req.Thing, null, false));
 }
Beispiel #4
0
 private static bool <GetExplanationUnfinalized> m__1(VerbUtility.VerbPropertiesWithSource x)
 {
     return(x.verbProps.IsMeleeAttack);
 }
Beispiel #5
0
 private static bool <GetValueUnfinalized> m__0(VerbUtility.VerbPropertiesWithSource x)
 {
     return(x.verbProps.IsMeleeAttack);
 }
Beispiel #6
0
 internal float <> m__1(VerbUtility.VerbPropertiesWithSource x)
 {
     return(x.verbProps.AdjustedArmorPenetration(x.tool, this.attacker, this.req.Thing, null));
 }
Beispiel #7
0
 internal float <> m__3(VerbUtility.VerbPropertiesWithSource x)
 {
     return(x.verbProps.AdjustedCooldown(x.tool, this.attacker, this.req.Thing));
 }
Beispiel #8
0
 internal float <> m__1(VerbUtility.VerbPropertiesWithSource x)
 {
     return(x.verbProps.AdjustedMeleeDamageAmount(x.tool, this.attacker, this.req.Thing, null));
 }