コード例 #1
0
        public static string GetFromBaseStatString(StatDef stat)
        {
            string result = "";

            if (stat is DerivedStatDef)
            {
                DerivedStatDef derivedStat = (stat as DerivedStatDef);
                if (derivedStat != null)
                {
                    StatDef baseStat = derivedStat.defaultBaseStat;
                    if (baseStat != null)
                    {
                        result = " (from " + baseStat.LabelCap + ")";
                    }
                }
            }
            return(result);
        }
コード例 #2
0
        static public float DoGetBaseValueFor(StatDef stat, StatRequest request)
        {
            float result = stat.defaultBaseValue;

            if (stat is DerivedStatDef)
            {
                DerivedStatDef derivedStat = (stat as DerivedStatDef);
                if (stat != null)
                {
                    StatDef baseStat = derivedStat.defaultBaseStat;
                    if (baseStat != null)
                    {
                        Thing thing = request.Thing;
                        if (thing != null)
                        {
                            result = thing.GetStatValue(baseStat, true);
                        }
                    }
                }
            }
            return(result);
        }