Exemplo n.º 1
0
        public IEnumerable <StatDrawEntry> SpecialDisplayStats(ThingDef parentDef)
        {
            yield return(new StatDrawEntry(StatCategoryDefOf.Basics, "Race".Translate(), parentDef.LabelCap, 2000, ""));

            yield return(new StatDrawEntry(StatCategoryDefOf.Basics, "Diet".Translate(), this.foodType.ToHumanString().CapitalizeFirst(), 0, ""));

            if (parentDef.race.leatherDef != null)
            {
                yield return(new StatDrawEntry(StatCategoryDefOf.Basics, "LeatherType".Translate(), parentDef.race.leatherDef.LabelCap, 0, ""));
            }
            if (parentDef.race.Animal || this.wildness > 0f)
            {
                yield return(new StatDrawEntry(StatCategoryDefOf.Basics, "Wildness".Translate(), this.wildness.ToStringPercent(), 0, "")
                {
                    overrideReportText = TrainableUtility.GetWildnessExplanation(parentDef)
                });
            }
            yield return(new StatDrawEntry(StatCategoryDefOf.Basics, "HarmedRevengeChance".Translate(), PawnUtility.GetManhunterOnDamageChance(parentDef.race).ToStringPercent(), 0, "")
            {
                overrideReportText = "HarmedRevengeChanceExplanation".Translate()
            });

            yield return(new StatDrawEntry(StatCategoryDefOf.Basics, "TameFailedRevengeChance".Translate(), parentDef.race.manhunterOnTameFailChance.ToStringPercent(), 0, ""));

            if (this.intelligence < Intelligence.Humanlike && this.trainability != null)
            {
                yield return(new StatDrawEntry(StatCategoryDefOf.Basics, "Trainability".Translate(), this.trainability.LabelCap, 0, ""));
            }
            yield return(new StatDrawEntry(StatCategoryDefOf.Basics, "StatsReport_LifeExpectancy".Translate(), this.lifeExpectancy.ToStringByStyle(ToStringStyle.Integer, ToStringNumberSense.Absolute), 0, ""));

            if (this.intelligence < Intelligence.Humanlike)
            {
                yield return(new StatDrawEntry(StatCategoryDefOf.Basics, "AnimalFilthRate".Translate(), (PawnUtility.AnimalFilthChancePerCell(parentDef, parentDef.race.baseBodySize) * 1000f).ToString("F2"), 0, "")
                {
                    overrideReportText = "AnimalFilthRateExplanation".Translate(new object[]
                    {
                        1000.ToString()
                    })
                });
            }
            if (this.packAnimal)
            {
                yield return(new StatDrawEntry(StatCategoryDefOf.Basics, "PackAnimal".Translate(), "Yes".Translate(), 0, "")
                {
                    overrideReportText = "PackAnimalExplanation".Translate()
                });
            }
            if (parentDef.race.nuzzleMtbHours > 0f)
            {
                yield return(new StatDrawEntry(StatCategoryDefOf.PawnSocial, "NuzzleInterval".Translate(), Mathf.RoundToInt(parentDef.race.nuzzleMtbHours * 2500f).ToStringTicksToPeriod(), 0, "")
                {
                    overrideReportText = "NuzzleIntervalExplanation".Translate()
                });
            }
            yield break;
        }
Exemplo n.º 2
0
        public IEnumerable <StatDrawEntry> SpecialDisplayStats(ThingDef parentDef, StatRequest req)
        {
            yield return(new StatDrawEntry(StatCategoryDefOf.BasicsPawn, "Race".Translate(), parentDef.LabelCap, parentDef.description, 2100));

            if (!parentDef.race.IsMechanoid)
            {
                string text = foodType.ToHumanString().CapitalizeFirst();
                yield return(new StatDrawEntry(StatCategoryDefOf.BasicsPawn, "Diet".Translate(), text, "Stat_Race_Diet_Desc".Translate(text), 1500));
            }
            if (req.HasThing && req.Thing is Pawn && (req.Thing as Pawn).needs != null && (req.Thing as Pawn).needs.food != null)
            {
                yield return(new StatDrawEntry(StatCategoryDefOf.BasicsPawn, "HungerRate".Translate(), ((req.Thing as Pawn).needs.food.FoodFallPerTickAssumingCategory(HungerCategory.Fed) * 60000f).ToString("0.##"), NutritionEatenPerDayExplanation_NewTemp(req.Thing as Pawn), 1600));
            }
            if (parentDef.race.leatherDef != null)
            {
                yield return(new StatDrawEntry(StatCategoryDefOf.BasicsPawn, "LeatherType".Translate(), parentDef.race.leatherDef.LabelCap, "Stat_Race_LeatherType_Desc".Translate(), 3550, null, new Dialog_InfoCard.Hyperlink[1]
                {
                    new Dialog_InfoCard.Hyperlink(parentDef.race.leatherDef)
                }));
            }
            if (parentDef.race.Animal || wildness > 0f)
            {
                yield return(new StatDrawEntry(StatCategoryDefOf.BasicsPawn, "Wildness".Translate(), wildness.ToStringPercent(), TrainableUtility.GetWildnessExplanation(parentDef), 2050));

                yield return(new StatDrawEntry(StatCategoryDefOf.BasicsPawn, "HarmedRevengeChance".Translate(), PawnUtility.GetManhunterOnDamageChance(parentDef.race).ToStringPercent(), "HarmedRevengeChanceExplanation".Translate(), 510));

                yield return(new StatDrawEntry(StatCategoryDefOf.BasicsPawn, "TameFailedRevengeChance".Translate(), parentDef.race.manhunterOnTameFailChance.ToStringPercent(), "Stat_Race_Animal_TameFailedRevengeChance_Desc".Translate(), 511));
            }
            if ((int)intelligence < 2 && trainability != null)
            {
                yield return(new StatDrawEntry(StatCategoryDefOf.BasicsPawn, "Trainability".Translate(), trainability.LabelCap, "Stat_Race_Trainability_Desc".Translate(), 2500));
            }
            yield return(new StatDrawEntry(StatCategoryDefOf.BasicsPawn, "StatsReport_LifeExpectancy".Translate(), lifeExpectancy.ToStringByStyle(ToStringStyle.Integer), "Stat_Race_LifeExpectancy_Desc".Translate(), 2000));

            if ((int)intelligence < 2 && !parentDef.race.IsMechanoid)
            {
                yield return(new StatDrawEntry(StatCategoryDefOf.BasicsPawn, "AnimalFilthRate".Translate(), (PawnUtility.AnimalFilthChancePerCell(parentDef, parentDef.race.baseBodySize) * 1000f).ToString("F2"), "AnimalFilthRateExplanation".Translate(1000.ToString()), 2203));
            }
            if (parentDef.race.Animal)
            {
                yield return(new StatDrawEntry(StatCategoryDefOf.BasicsPawn, "PackAnimal".Translate(), packAnimal ? "Yes".Translate() : "No".Translate(), "PackAnimalExplanation".Translate(), 2202));

                if (parentDef.race.nuzzleMtbHours > 0f)
                {
                    yield return(new StatDrawEntry(StatCategoryDefOf.PawnSocial, "NuzzleInterval".Translate(), Mathf.RoundToInt(parentDef.race.nuzzleMtbHours * 2500f).ToStringTicksToPeriod(), "NuzzleIntervalExplanation".Translate(), 500));
                }
            }
        }