public TraitDegreeDataStats(TraitDegreeData d) { this.label = d.label; this.degree = d.degree; this.commonality = d.commonality; this.socialFightChanceFactor = d.socialFightChanceFactor; this.marketValueFactorOffset = d.marketValueFactorOffset; this.randomDiseaseMtbDays = d.randomDiseaseMtbDays; if (d.randomMentalStateMtbDaysMoodCurve != null) { this.randomMentalStateMtbDaysMoodCurve = new SimpleCurveStats(d.randomMentalStateMtbDaysMoodCurve); } Util.AssignDefStat(d.thinkTree, out this.thinkTree); Util.AssignDefStat(d.randomMentalState, out this.randomMentalState); this.disallowedMentalStates = Util.CreateDefStatList(d.disallowedMentalStates); this.disallowedInspirations = Util.CreateDefStatList(d.disallowedInspirations); this.theOnlyAllowedMentalBreaks = Util.CreateDefStatList(d.theOnlyAllowedMentalBreaks); Util.Populate(out this.skillGains, d.skillGains, (def, v) => new IntValueDefStat <SkillDef>(def, v)); Util.Populate(out this.statOffsets, d.statOffsets, (v) => new FloatValueDefStat <StatDef>(v.stat, v.value)); Util.Populate(out this.statFactors, d.statFactors, (v) => new FloatValueDefStat <StatDef>(v.stat, v.value)); }
public StorytellerCompPropertiesStats(StorytellerCompProperties p) { this.compClass = p.compClass.FullName; this.minDaysPassed = p.minDaysPassed; this.minIncChancePopulationIntentFactor = p.minIncChancePopulationIntentFactor; Util.Populate(out allowedTargetTags, p.allowedTargetTags, d => new DefStat <IncidentTargetTagDef>(d)); Util.Populate(out disallowedTargetTags, p.disallowedTargetTags, d => new DefStat <IncidentTargetTagDef>(d)); switch (this.compClass) { case "RimWorld.StorytellerComp_CategoryIndividualMTBByBiome": if (p is StorytellerCompProperties_CategoryIndividualMTBByBiome cb) { this.category = Util.AssignDefStat(cb.category); this.applyCaravanVisibility = cb.applyCaravanVisibility; } break; case "RimWorld.StorytellerComp_CategoryMTB": if (p is StorytellerCompProperties_CategoryMTB cm) { this.category = Util.AssignDefStat(cm.category); this.mtbDays = cm.mtbDays; this.mtbDaysFactorByDaysPassedCurve = Util.Assign(cm.mtbDaysFactorByDaysPassedCurve, v => new SimpleCurveStats(v)); } break; case "RimWorld.StorytellerComp_DeepDrillInfestation": if (p is StorytellerCompProperties_DeepDrillInfestation cd) { this.baseMtbDaysPerDrill = cd.baseMtbDaysPerDrill; } break; case "RimWorld.StorytellerComp_Disease": if (p is StorytellerCompProperties_Disease d) { this.category = Util.AssignDefStat(d.category); } break; case "RimWorld.StorytellerComp_FactionInteraction": if (p is StorytellerCompProperties_FactionInteraction fi) { this.incident = Util.AssignDefStat(fi.incident); this.baseIncidentsPerYear = fi.baseIncidentsPerYear; this.minSpacingDays = fi.minSpacingDays; this.minDanger = fi.minDanger; this.fullAlliesOnly = fi.fullAlliesOnly; } break; case "RimWorld.StorytellerComp_OnOffCycle": if (p is StorytellerCompProperties_OnOffCycle ooc) { this.category = Util.AssignDefStat(GetCategory(ooc)); this.onDays = ooc.onDays; this.offDays = ooc.offDays; this.minSpacingDays = ooc.minDaysPassed; this.numIncidentsRange = Util.Assign(ooc.numIncidentsRange, v => new MinMaxFloatStats(v)); this.acceptFractionByDaysPassedCurve = Util.Assign(ooc.acceptFractionByDaysPassedCurve, v => new SimpleCurveStats(v)); this.acceptPercentFactorPerThreatPointsCurve = Util.Assign(ooc.acceptPercentFactorPerThreatPointsCurve, v => new SimpleCurveStats(v)); this.incident = Util.AssignDefStat(ooc.incident); // TODO this.applyRaidBeaconThreatMtbFactor = ooc.applyRaidBeaconThreatMtbFactor; this.forceRaidEnemyBeforeDaysPassed = ooc.forceRaidEnemyBeforeDaysPassed; } break; case "RimWorld.StorytellerComp_RandomMain": if (p is StorytellerCompProperties_RandomMain rm) { this.mtbDays = rm.mtbDays; Util.Populate(out this.categoryWeights, rm.categoryWeights, v => new FloatValueDefStat <IncidentCategoryDef>(v.category, v.weight)); this.maxThreatBigIntervalDays = rm.maxThreatBigIntervalDays; this.randomPointsFactorRange = Util.Assign(rm.randomPointsFactorRange, v => new MinMaxFloatStats(v)); this.skipThreatBigIfRaidBeacon = rm.skipThreatBigIfRaidBeacon; } break; case "RimWorld.StorytellerComp_SingleMTB": if (p is StorytellerCompProperties_SingleMTB smtb) { this.incident = Util.AssignDefStat(smtb.incident); this.mtbDays = smtb.mtbDays; } break; case "RimWorld.StorytellerComp_Triggered": if (p is StorytellerCompProperties_Triggered t) { this.incident = Util.AssignDefStat(t.incident); this.delayTicks = t.delayTicks; } break; case "RimWorld.StorytellerCompProperties_RefiringUniqueQuest": if (p is StorytellerCompProperties_RefiringUniqueQuest ruq) { this.incident = Util.AssignDefStat(ruq.incident); this.refireEveryDays = ruq.refireEveryDays; } break; case "RimWorld.StorytellerCompProperties_SingleOnceFixed": if (p is StorytellerCompProperties_SingleOnceFixed sof) { this.incident = Util.AssignDefStat(sof.incident); this.fireAfterDaysPassed = sof.fireAfterDaysPassed; } break; case "RimWorld.StorytellerComp_ClassicIntro": case "RimWorld.StorytellerComp_ShipChunkDrop": case "RimWorld.StorytellerCompProperties_RandomQuest": case "RimWorld.StorytellerComp_SingleOnceFixed": case "RimWorld.StorytellerComp_RefiringUniqueQuest": case "RimWorld.StorytellerComp_ThreatsGenerator": case "RimWorld.StorytellerComp_RandomQuest": // Do nothing break; default: Log.Warning("Unknown StorytellerProperty type of " + this.compClass); break; } }
public RacePropertiesStats(RaceProperties p) { this.intelligence = p.intelligence; this.hasGenders = p.hasGenders; this.needsRest = p.needsRest; this.nameCategory = p.nameCategory; this.foodType = p.foodType; this.makesFootprints = p.makesFootprints; this.executionRange = p.executionRange; this.lifeExpectancy = p.lifeExpectancy; this.herdAnimal = p.herdAnimal; this.packAnimal = p.packAnimal; this.predator = p.predator; this.maxPreyBodySize = p.maxPreyBodySize; this.wildness = p.wildness; this.petness = p.petness; this.nuzzleMtbHours = p.nuzzleMtbHours; this.manhunterOnDamageChance = p.manhunterOnDamageChance; this.manhunterOnTameFailChance = p.manhunterOnTameFailChance; this.canBePredatorPrey = p.canBePredatorPrey; this.herdMigrationAllowed = p.herdMigrationAllowed; this.gestationPeriodDays = p.gestationPeriodDays; this.mateMtbHours = p.mateMtbHours; this.nameOnTameChance = p.nameOnTameChance; //this.nameOnNuzzleChance = p.nameOnNuzzleChance; this.baseBodySize = p.baseBodySize; this.baseHealthScale = p.baseHealthScale; this.baseHungerRate = p.baseHungerRate; this.meatLabel = p.meatLabel; this.meatMarketValue = p.meatMarketValue; this.meatColor = new ColorStats(p.meatColor); if (p.specialShadowData != null) { this.specialShadowData = new ShadowDataStats(p.specialShadowData); } if (p.soundCallIntervalRange != null) { this.soundCallIntervalRange = new MinMaxIntStats(p.soundCallIntervalRange); } if (p.ageGenerationCurve != null) { this.ageGenerationCurve = new SimpleCurveStats(p.ageGenerationCurve); } if (p.litterSizeCurve != null) { this.litterSizeCurve = new SimpleCurveStats(p.litterSizeCurve); } Util.Populate(out this.wildBiomes, p.wildBiomes, (v) => new FloatValueDefStat <BiomeDef>(v.biome, v.commonality)); Util.Populate(out this.lifeStageAges, p.lifeStageAges, (v) => new LifeStageAgeStats(v)); Util.Populate(out this.untrainableTags, p.untrainableTags); Util.Populate(out this.trainableTags, p.trainableTags); Util.AssignDefStat(GetFleshType(p), out this.fleshType); Util.AssignDefStat(GetBloodDef(p), out this.bloodDef); Util.AssignDefStat(p.thinkTreeMain, out this.thinkTreeMain); Util.AssignDefStat(p.thinkTreeConstant, out this.thinkTreeConstant); Util.AssignDefStat(p.body, out this.body); Util.AssignDefStat(p.trainability, out this.trainability); Util.AssignDefStat(GetNameGenerator(p), out this.nameGenerator); Util.AssignDefStat(GetNameGeneratorFemale(p), out this.nameGeneratorFemale); Util.AssignDefStat(p.useMeatFrom, out this.useMeatFrom); Util.AssignDefStat(p.useLeatherFrom, out this.useLeatherFrom); Util.AssignDefStat(p.leatherDef, out this.leatherDef); Util.AssignDefStat(p.soundMeleeHitPawn, out this.soundMeleeHitPawn); Util.AssignDefStat(p.soundMeleeHitBuilding, out this.soundMeleeHitBuilding); Util.AssignDefStat(p.soundMeleeMiss, out this.soundMeleeMiss); Util.AssignDefStat(p.meatDef, out this.meatDef); Util.AssignDefStat(p.corpseDef, out this.corpseDef); this.hediffGiverSets = Util.CreateDefStatList(p.hediffGiverSets); }