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))); }
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)); }
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); }