コード例 #1
0
        public override float ExtraSelectionWeightFactor(ThingSetMakerParams parms)
        {
            int  num  = 0;
            bool flag = false;

            foreach (ResearchProjectDef allDef in DefDatabase <ResearchProjectDef> .AllDefs)
            {
                if (!allDef.IsFinished && allDef.PrerequisitesCompleted)
                {
                    if (!allDef.TechprintRequirementMet && !PlayerItemAccessibilityUtility.PlayerOrQuestRewardHas(allDef.Techprint, allDef.techprintCount - allDef.TechprintsApplied))
                    {
                        flag = true;
                    }
                    else
                    {
                        num++;
                    }
                }
            }
            if (!flag)
            {
                return(1f);
            }
            return(Mathf.RoundToInt(ResearchableProjectsCountToSelectionWeightCurve.Evaluate(num)));
        }
コード例 #2
0
 private float GetSelectionWeight(Option option, ThingSetMakerParams parms)
 {
     if (option.weightIfPlayerHasNoItem.HasValue && !PlayerItemAccessibilityUtility.PlayerOrQuestRewardHas(option.weightIfPlayerHasNoItemItem))
     {
         return(option.weightIfPlayerHasNoItem.Value * option.thingSetMaker.ExtraSelectionWeightFactor(parms));
     }
     return(option.weight * option.thingSetMaker.ExtraSelectionWeightFactor(parms));
 }
コード例 #3
0
        private float GetSelectionWeight(ThingSetMaker_RandomOption.Option option, ThingSetMakerParams parms)
        {
            float?weightIfPlayerHasNoItem = option.weightIfPlayerHasNoItem;

            if (weightIfPlayerHasNoItem != null && !PlayerItemAccessibilityUtility.PlayerOrQuestRewardHas(option.weightIfPlayerHasNoItemItem))
            {
                return(option.weightIfPlayerHasNoItem.Value);
            }
            return(option.weight);
        }