Beispiel #1
0
 public override string GetExplanationUnfinalized(StatRequest req, ToStringNumberSense numberSense)
 {
     if (req.HasThing && req.Thing is Pawn)
     {
         Pawn          pawn          = (Pawn)req.Thing;
         StringBuilder stringBuilder = new StringBuilder(base.GetExplanationUnfinalized(req, numberSense));
         PriceUtility.PawnQualityPriceFactor(pawn, stringBuilder);
         PriceUtility.PawnQualityPriceOffset(pawn, stringBuilder);
         return(stringBuilder.ToString());
     }
     if (req.StatBases.StatListContains(StatDefOf.MarketValue))
     {
         return(base.GetExplanationUnfinalized(req, numberSense));
     }
     return("StatsReport_MarketValueFromStuffsAndWork".TranslateSimple().TrimEnd('.') + ": " + CalculatedBaseMarketValue(req.BuildableDef, req.StuffDef).ToStringByStyle(stat.ToStringStyleUnfinalized, numberSense));
 }
        public override float GetValueUnfinalized(StatRequest req, bool applyPostProcess = true)
        {
            if (req.HasThing && req.Thing is Pawn)
            {
                return(base.GetValueUnfinalized(StatRequest.For(req.Def, req.StuffDef, QualityCategory.Normal), applyPostProcess) * PriceUtility.PawnQualityPriceFactor((Pawn)req.Thing, null) + PriceUtility.PawnQualityPriceOffset((Pawn)req.Thing, null));
            }
            float result;

            if (req.Def.statBases.StatListContains(StatDefOf.MarketValue))
            {
                result = base.GetValueUnfinalized(req, true);
            }
            else
            {
                result = StatWorker_MarketValue.CalculatedBaseMarketValue(req.Def, req.StuffDef);
            }
            return(result);
        }
Beispiel #3
0
 public override float GetValueUnfinalized(StatRequest req, bool applyPostProcess = true)
 {
     if (req.HasThing && req.Thing is Pawn)
     {
         return(base.GetValueUnfinalized(StatRequest.For(req.BuildableDef, req.StuffDef), applyPostProcess) * PriceUtility.PawnQualityPriceFactor((Pawn)req.Thing) + PriceUtility.PawnQualityPriceOffset((Pawn)req.Thing));
     }
     if (req.StatBases.StatListContains(StatDefOf.MarketValue))
     {
         return(base.GetValueUnfinalized(req));
     }
     return(CalculatedBaseMarketValue(req.BuildableDef, req.StuffDef));
 }