diff --git a/1.6/1.6/Assemblies/ArachnaeSwarm.dll b/1.6/1.6/Assemblies/ArachnaeSwarm.dll index cc40cab..c8c769f 100644 Binary files a/1.6/1.6/Assemblies/ArachnaeSwarm.dll and b/1.6/1.6/Assemblies/ArachnaeSwarm.dll differ diff --git a/1.6/1.6/Defs/Thing_Misc/Apparels/ARA_Apparel.xml b/1.6/1.6/Defs/Thing_Misc/Apparels/ARA_Apparel.xml index 9d44699..c25e4cf 100644 --- a/1.6/1.6/Defs/Thing_Misc/Apparels/ARA_Apparel.xml +++ b/1.6/1.6/Defs/Thing_Misc/Apparels/ARA_Apparel.xml @@ -59,8 +59,11 @@
  • - ARA_Cocoon_Cloth -
  • + +
  • ARA_Cocoon_Cloth
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
    @@ -88,8 +91,11 @@
  • - ARA_Cocoon_Cloth -
  • + +
  • ARA_Cocoon_Cloth
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
    @@ -117,8 +123,11 @@
  • - ARA_Cocoon_Cloth -
  • + +
  • ARA_Cocoon_Cloth
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
    @@ -146,8 +155,11 @@
  • - ARA_Cocoon_Cloth -
  • + +
  • ARA_Cocoon_Cloth
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
    @@ -175,8 +187,11 @@
  • - ARA_Cocoon_Cloth -
  • + +
  • ARA_Cocoon_Cloth
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
    @@ -300,8 +315,11 @@ ARA_TerrainWorkSpeedHediff
  • - ARA_Cocoon_Cloth -
  • + +
  • ARA_Cocoon_Cloth
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    + @@ -347,8 +365,11 @@ ARA_TerrainMoveSpeedHediff
  • - ARA_Cocoon_Cloth_1Stage -
  • + +
  • ARA_Cocoon_Cloth_1Stage
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
    @@ -395,8 +416,11 @@ ARA_TerrainHealHediff
  • - ARA_Cocoon_Cloth_1Stage -
  • + +
  • ARA_Cocoon_Cloth_1Stage
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
    @@ -443,8 +467,11 @@ ARA_TerrainTemptHediff
  • - ARA_Cocoon_Cloth_2Stage -
  • + +
  • ARA_Cocoon_Cloth_2Stage
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
    @@ -491,8 +518,11 @@ ARA_TerrainTerrorRoar_Hediff
  • - ARA_Cocoon_Cloth_2Stage -
  • + +
  • ARA_Cocoon_Cloth_2Stage
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
    diff --git a/1.6/1.6/Defs/Thing_Misc/Weapons/ARA_Missile_Weapon.xml b/1.6/1.6/Defs/Thing_Misc/Weapons/ARA_Missile_Weapon.xml index a5525c7..f89ef23 100644 --- a/1.6/1.6/Defs/Thing_Misc/Weapons/ARA_Missile_Weapon.xml +++ b/1.6/1.6/Defs/Thing_Misc/Weapons/ARA_Missile_Weapon.xml @@ -170,8 +170,11 @@
  • - ARA_Cocoon_Weapon_2Stage -
  • + +
  • ARA_Cocoon_Weapon_2Stage
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
  • ARA_ChainReload 0.2 @@ -251,8 +254,11 @@
  • - ARA_Cocoon_Weapon_2Stage -
  • + +
  • ARA_Cocoon_Weapon_2Stage
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
  • ARA_ChainReload 0.1 diff --git a/1.6/1.6/Defs/Thing_Misc/Weapons/ARA_Weapon.xml b/1.6/1.6/Defs/Thing_Misc/Weapons/ARA_Weapon.xml index 908877b..9b62e51 100644 --- a/1.6/1.6/Defs/Thing_Misc/Weapons/ARA_Weapon.xml +++ b/1.6/1.6/Defs/Thing_Misc/Weapons/ARA_Weapon.xml @@ -70,8 +70,11 @@
  • - ARA_Cocoon_Weapon -
  • + +
  • ARA_Cocoon_Weapon
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
    @@ -136,8 +139,11 @@
  • - ARA_Cocoon_Weapon_1Stage -
  • + +
  • ARA_Cocoon_Weapon_1Stage
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
    @@ -211,8 +217,11 @@
  • - ARA_Cocoon_Weapon_2Stage -
  • + +
  • ARA_Cocoon_Weapon_2Stage
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
  • 90 2.5 @@ -329,8 +338,11 @@
  • - ARA_Cocoon_Weapon -
  • + +
  • ARA_Cocoon_Weapon
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
  • ARA_Weapon_Damage_Toxid
  • @@ -430,8 +442,11 @@
  • - ARA_Cocoon_Weapon_1Stage -
  • + +
  • ARA_Cocoon_Weapon_1Stage
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
  • ARA_Weapon_Damage_Toxid
  • @@ -505,8 +520,11 @@
  • - ARA_Cocoon_Weapon_1Stage -
  • + +
  • ARA_Cocoon_Weapon_1Stage
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
  • ARA_Weapon_Damage_Toxid
  • @@ -578,8 +596,11 @@
  • - ARA_Cocoon_Weapon_2Stage -
  • + +
  • ARA_Cocoon_Weapon_2Stage
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
  • ARA_ChainReload 1 @@ -679,8 +700,11 @@
  • - ARA_Cocoon_Weapon -
  • + +
  • ARA_Cocoon_Weapon
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
  • ARA_Weapon_Damage_Acid
  • @@ -787,8 +811,11 @@
  • - ARA_Cocoon_Weapon_1Stage -
  • + +
  • ARA_Cocoon_Weapon_1Stage
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
  • @@ -867,8 +894,11 @@
  • - ARA_Cocoon_Weapon_2Stage -
  • + +
  • ARA_Cocoon_Weapon_2Stage
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
  • ARA_Huge_Weapon
  • @@ -984,8 +1014,11 @@
  • - ARA_Cocoon_Weapon_1Stage -
  • + +
  • ARA_Cocoon_Weapon_1Stage
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
  • ARA_Weapon_Damage_Spawn
  • diff --git a/1.6/1.6/Defs/Thing_Misc/Weapons/ARA_Weapon_FireSpew.xml b/1.6/1.6/Defs/Thing_Misc/Weapons/ARA_Weapon_FireSpew.xml index 8e05464..487c033 100644 --- a/1.6/1.6/Defs/Thing_Misc/Weapons/ARA_Weapon_FireSpew.xml +++ b/1.6/1.6/Defs/Thing_Misc/Weapons/ARA_Weapon_FireSpew.xml @@ -69,8 +69,11 @@
  • - ARA_Cocoon_Weapon_2Stage -
  • + +
  • ARA_Cocoon_Weapon_2Stage
  • +
  • ARA_BioforgeIncubator_Thing
  • +
    +
  • ARA_Weapon_Damage_Acid
  • diff --git a/1.6/1.6/Defs/Thing_building/ARA_NutrientNetworkBuilding.xml b/1.6/1.6/Defs/Thing_building/ARA_NutrientNetworkBuilding.xml index bce3dc9..a6ca682 100644 --- a/1.6/1.6/Defs/Thing_building/ARA_NutrientNetworkBuilding.xml +++ b/1.6/1.6/Defs/Thing_building/ARA_NutrientNetworkBuilding.xml @@ -325,7 +325,7 @@ 0.8 (0,0,-1) true - + ARA_Buildings 2600 Item @@ -373,7 +373,7 @@ - + diff --git a/Source/ArachnaeSwarm/Building_Comps/ARA_CompInteractiveProducer/CompInteractiveProducer.cs b/Source/ArachnaeSwarm/Building_Comps/ARA_CompInteractiveProducer/CompInteractiveProducer.cs index 1dd2180..2e966a4 100644 --- a/Source/ArachnaeSwarm/Building_Comps/ARA_CompInteractiveProducer/CompInteractiveProducer.cs +++ b/Source/ArachnaeSwarm/Building_Comps/ARA_CompInteractiveProducer/CompInteractiveProducer.cs @@ -116,37 +116,50 @@ namespace ArachnaeSwarm if (thingDef.IsApparel || thingDef.IsWeapon) { var incubationCompProps = thingDef.GetCompProperties(); - if (incubationCompProps != null && incubationCompProps.cocoonDef == parent.def) + if (incubationCompProps != null) { - // 获取研究前提 - 从 recipeMaker 中获取 - ResearchProjectDef researchPrerequisite = null; - - // 方法1:从 recipeMaker.researchPrerequisite 获取 - if (thingDef.recipeMaker?.researchPrerequisite != null) + bool isMatch = false; + if (!incubationCompProps.cocoonDefs.NullOrEmpty()) { - researchPrerequisite = thingDef.recipeMaker.researchPrerequisite; + isMatch = incubationCompProps.cocoonDefs.Contains(parent.def); } - // 方法2:从 recipeMaker.researchPrerequisites 获取第一个 - else if (thingDef.recipeMaker?.researchPrerequisites?.Count > 0) + else if (incubationCompProps.cocoonDef != null) { - researchPrerequisite = thingDef.recipeMaker.researchPrerequisites[0]; - } - // 方法3:从 thingDef.researchPrerequisites 获取(备用) - else if (thingDef.researchPrerequisites?.Count > 0) - { - researchPrerequisite = thingDef.researchPrerequisites[0]; + isMatch = incubationCompProps.cocoonDef == parent.def; } - // 创建 ProcessDef - ProcessDef process = new ProcessDef + if (isMatch) { - thingDef = thingDef, - productionTicks = GetIncubationTimeTicks(thingDef), - totalNutritionNeeded = GetIncubationCost(thingDef), - requiredResearch = researchPrerequisite - }; + // 获取研究前提 - 从 recipeMaker 中获取 + ResearchProjectDef researchPrerequisite = null; + + // 方法1:从 recipeMaker.researchPrerequisite 获取 + if (thingDef.recipeMaker?.researchPrerequisite != null) + { + researchPrerequisite = thingDef.recipeMaker.researchPrerequisite; + } + // 方法2:从 recipeMaker.researchPrerequisites 获取第一个 + else if (thingDef.recipeMaker?.researchPrerequisites?.Count > 0) + { + researchPrerequisite = thingDef.recipeMaker.researchPrerequisites[0]; + } + // 方法3:从 thingDef.researchPrerequisites 获取(备用) + else if (thingDef.researchPrerequisites?.Count > 0) + { + researchPrerequisite = thingDef.researchPrerequisites[0]; + } - _cachedProcesses.Add(process); + // 创建 ProcessDef + ProcessDef process = new ProcessDef + { + thingDef = thingDef, + productionTicks = GetIncubationTimeTicks(thingDef), + totalNutritionNeeded = GetIncubationCost(thingDef), + requiredResearch = researchPrerequisite + }; + + _cachedProcesses.Add(process); + } } } } diff --git a/Source/ArachnaeSwarm/Building_Comps/ARA_CompInteractiveProducer/CompQueuedInteractiveProducer.cs b/Source/ArachnaeSwarm/Building_Comps/ARA_CompInteractiveProducer/CompQueuedInteractiveProducer.cs index a3f5ae9..4b90ca9 100644 --- a/Source/ArachnaeSwarm/Building_Comps/ARA_CompInteractiveProducer/CompQueuedInteractiveProducer.cs +++ b/Source/ArachnaeSwarm/Building_Comps/ARA_CompInteractiveProducer/CompQueuedInteractiveProducer.cs @@ -11,16 +11,22 @@ namespace ArachnaeSwarm // Data contract for a single production order in the queue public class QueuedProcessOrder : IExposable { - public ProcessDef process; // Using the existing ProcessDef + public ProcessDef process; public int productionUntilTick = -1; - - // Quality-related fields public int ticksUnderOptimalConditions; public float temperaturePenaltyPercent; + // Add a non-saved field to hold the defName during loading + public string tempThingDefName; + public void ExposeData() { - Scribe_Deep.Look(ref process, "process"); + if (Scribe.mode == LoadSaveMode.Saving) + { + tempThingDefName = process?.thingDef?.defName; + } + + Scribe_Values.Look(ref tempThingDefName, "thingDefName"); Scribe_Values.Look(ref productionUntilTick, "productionUntilTick", -1); Scribe_Values.Look(ref ticksUnderOptimalConditions, "ticksUnderOptimalConditions", 0); Scribe_Values.Look(ref temperaturePenaltyPercent, "temperaturePenaltyPercent", 0f); @@ -30,12 +36,10 @@ namespace ArachnaeSwarm // Properties for the new queued producer component public class CompProperties_QueuedInteractiveProducer : CompProperties { - public List processes; public List whitelist; public int productionQueueLimit = 1; public float minNutritionToStart = 0.1f; - // Quality-related properties from CompInteractiveProducer public float minSafeTemperature = 7f; public float maxSafeTemperature = 32f; public float penaltyPerDegreePerTick = 0.00001f; @@ -48,24 +52,49 @@ namespace ArachnaeSwarm } } - // The main component logic + [StaticConstructorOnStartup] public class CompQueuedInteractiveProducer : ThingComp { private List productionOrders = new List(); - public ProcessDef selectedProcess; // For passing to the JobDriver + public ProcessDef selectedProcess; private CompRefuelableNutrition _fuelComp; private CompAffectedByFacilities _facilitiesComp; + private List _cachedProcesses; public CompProperties_QueuedInteractiveProducer Props => (CompProperties_QueuedInteractiveProducer)props; private CompRefuelableNutrition FuelComp => _fuelComp ?? (_fuelComp = parent.GetComp()); private CompAffectedByFacilities FacilitiesComp => _facilitiesComp ?? (_facilitiesComp = parent.GetComp()); - + + public List Processes + { + get + { + if (_cachedProcesses == null) + { + BuildProcessList(); + } + return _cachedProcesses; + } + } + public override void Initialize(CompProperties props) { base.Initialize(props); _fuelComp = parent.GetComp(); _facilitiesComp = parent.GetComp(); + BuildProcessList(); + } + + public override void PostSpawnSetup(bool respawningAfterLoad) + { + base.PostSpawnSetup(respawningAfterLoad); + _fuelComp = parent.GetComp(); + _facilitiesComp = parent.GetComp(); + if (_cachedProcesses == null) + { + BuildProcessList(); + } } public override IEnumerable CompFloatMenuOptions(Pawn selPawn) @@ -73,11 +102,11 @@ namespace ArachnaeSwarm if (Props.whitelist == null || !Props.whitelist.Contains(selPawn.kindDef)) yield break; if (FuelComp != null && (!FuelComp.HasFuel || FuelComp.NutritionStored < Props.minNutritionToStart)) { - yield return new FloatMenuOption("CannotStartProduction".Translate(), null); + yield return new FloatMenuOption("CannotStartProduction".Translate() + ": " + "NoFuel".Translate(), null); yield break; } - foreach (var process in Props.processes) + foreach (var process in Processes) { if (process.requiredResearch != null && !process.requiredResearch.IsFinished) { @@ -85,7 +114,7 @@ namespace ArachnaeSwarm } else { - yield return new FloatMenuOption("StartProduction".Translate(process.thingDef.label), () => + yield return new FloatMenuOption("StartProduction".Translate(process.thingDef.label), () => { this.selectedProcess = process; Job job = JobMaker.MakeJob(DefDatabase.GetNamed("ARA_AddProcessToQueueJob"), parent); @@ -110,7 +139,6 @@ namespace ArachnaeSwarm float ambientTemperature = parent.AmbientTemperature; bool isTempSafe = ambientTemperature >= Props.minSafeTemperature && ambientTemperature <= Props.maxSafeTemperature; - // Update progress and penalties for active orders foreach(var order in producingOrders) { if(hasFuel && isTempSafe) @@ -124,11 +152,10 @@ namespace ArachnaeSwarm } if (!hasFuel) { - order.productionUntilTick++; // Pause production + order.productionUntilTick++; } } - // Update fuel consumption if (FuelComp != null) { float totalConsumptionRatePerDay = 0f; @@ -145,7 +172,6 @@ namespace ArachnaeSwarm FuelComp.currentConsumptionRate = totalConsumptionRatePerDay; } - // Finish completed orders productionOrders.RemoveAll(order => { if (order.productionUntilTick > 0 && Find.TickManager.TicksGame >= order.productionUntilTick) @@ -156,7 +182,6 @@ namespace ArachnaeSwarm return false; }); - // Start new orders int currentlyProducingCount = productionOrders.Count(o => o.productionUntilTick > 0); if (currentlyProducingCount < Props.productionQueueLimit) { @@ -206,32 +231,37 @@ namespace ArachnaeSwarm public override string CompInspectStringExtra() { StringBuilder sb = new StringBuilder(); - + int producingCount = productionOrders.Count(o => o.productionUntilTick > 0); int queuedCount = productionOrders.Count - producingCount; - + sb.AppendLine($"生产槽位: {producingCount} / {Props.productionQueueLimit}"); if (queuedCount > 0) sb.AppendLine($"等待队列: {queuedCount}"); if (FacilitiesComp != null) { float speedFactor = 1f + FacilitiesComp.GetStatOffset(StatDef.Named("ARA_IncubationSpeedFactor")); - if(speedFactor != 1f) sb.AppendLine($"生产速度: {speedFactor.ToStringPercent()}"); + if (speedFactor != 1f) sb.AppendLine($"生产速度: {speedFactor.ToStringPercent()}"); } - + var producingNow = productionOrders.Where(o => o.productionUntilTick > 0).OrderBy(o => o.productionUntilTick); if (producingNow.Any()) { sb.AppendLine("正在生产:"); foreach (var order in producingNow) { + if (order.process == null) continue; int remainingTicks = order.productionUntilTick - Find.TickManager.TicksGame; var qualityDetails = GetEstimatedQualityDetails(order); sb.AppendLine($" - {order.process.thingDef.LabelCap}: {remainingTicks.ToStringTicksToPeriod(true, false, true, true)} (品质: {qualityDetails.quality.GetLabel()})"); } } - - // 添加温度信息 + else if (queuedCount == 0) + { + int availableProcesses = Processes.Count(p => p.requiredResearch == null || p.requiredResearch.IsFinished); + sb.AppendLine("ARA_NeedArachnaeToStartIncubation".Translate() + $" ({availableProcesses} items available)"); + } + string tempStr = "CurrentTemperature".Translate(parent.AmbientTemperature.ToStringTemperature("F0")); tempStr += $" ({"SafeTemperatureRange".Translate()}: {Props.minSafeTemperature.ToStringTemperature("F0")} ~ {Props.maxSafeTemperature.ToStringTemperature("F0")})"; sb.AppendLine(tempStr); @@ -242,8 +272,44 @@ namespace ArachnaeSwarm public override void PostExposeData() { base.PostExposeData(); - Scribe_Collections.Look(ref productionOrders, "productionOrders", LookMode.Deep); - Scribe_Deep.Look(ref selectedProcess, "selectedProcess"); + Scribe_Collections.Look(ref productionOrders, "productionOrders", LookMode.Deep, new object[0]); + + ThingDef selectedProcessThingDef = selectedProcess?.thingDef; + Scribe_Defs.Look(ref selectedProcessThingDef, "selectedProcessThingDef"); + + if (Scribe.mode == LoadSaveMode.PostLoadInit) + { + var _ = Processes; + + if (selectedProcessThingDef != null) + { + selectedProcess = _cachedProcesses.FirstOrDefault(p => p.thingDef == selectedProcessThingDef); + } + + if (productionOrders == null) + { + productionOrders = new List(); + } + + productionOrders.RemoveAll(order => + { + if (string.IsNullOrEmpty(order.tempThingDefName)) + { + Log.Warning($"CompQueuedInteractiveProducer: Found a queued order with no thingDefName after loading. Removing it."); + return true; + } + + order.process = _cachedProcesses.FirstOrDefault(p => p.thingDef.defName == order.tempThingDefName); + + if (order.process == null) + { + Log.Warning($"CompQueuedInteractiveProducer: Could not find a matching ProcessDef for '{order.tempThingDefName}' after loading. The item may have been removed. Removing order."); + return true; + } + + return false; + }); + } } public override IEnumerable CompGetGizmosExtra() @@ -256,18 +322,101 @@ namespace ArachnaeSwarm if (productionOrders.Any()) { var lastOrder = productionOrders.Last(); - - yield return new Command_Action + if(lastOrder.process != null) { - defaultLabel = "CommandCancelProduction".Translate() + ": " + lastOrder.process.thingDef.LabelCap, - defaultDesc = "CommandCancelProductionDesc".Translate(), - icon = ContentFinder.Get("UI/Designators/Cancel"), - action = () => + yield return new Command_Action { - productionOrders.Remove(lastOrder); - } - }; + defaultLabel = "CommandCancelProduction".Translate() + ": " + lastOrder.process.thingDef.LabelCap, + defaultDesc = "CommandCancelProductionDesc".Translate(), + icon = ContentFinder.Get("UI/Designators/Cancel"), + action = () => + { + productionOrders.Remove(lastOrder); + } + }; + } } } + + private void BuildProcessList() + { + _cachedProcesses = new List(); + + foreach (ThingDef thingDef in DefDatabase.AllDefs) + { + if (thingDef.IsApparel || thingDef.IsWeapon) + { + var incubationCompProps = thingDef.GetCompProperties(); + if (incubationCompProps != null) + { + bool isMatch = false; + if (!incubationCompProps.cocoonDefs.NullOrEmpty()) + { + isMatch = incubationCompProps.cocoonDefs.Contains(parent.def); + } + else if (incubationCompProps.cocoonDef != null) + { + isMatch = incubationCompProps.cocoonDef == parent.def; + } + + if(isMatch) + { + ResearchProjectDef researchPrerequisite = null; + if (thingDef.recipeMaker?.researchPrerequisite != null) + { + researchPrerequisite = thingDef.recipeMaker.researchPrerequisite; + } + else if (thingDef.recipeMaker?.researchPrerequisites?.Count > 0) + { + researchPrerequisite = thingDef.recipeMaker.researchPrerequisites[0]; + } + else if (thingDef.researchPrerequisites?.Count > 0) + { + researchPrerequisite = thingDef.researchPrerequisites[0]; + } + + ProcessDef process = new ProcessDef + { + thingDef = thingDef, + productionTicks = GetIncubationTimeTicks(thingDef), + totalNutritionNeeded = GetIncubationCost(thingDef), + requiredResearch = researchPrerequisite + }; + + _cachedProcesses.Add(process); + } + } + } + } + _cachedProcesses.SortBy(p => p.thingDef.label); + } + + private int GetIncubationTimeTicks(ThingDef thingDef) + { + StatDef incubationTimeStat = DefDatabase.GetNamedSilentFail("ARA_IncubationTime"); + if (incubationTimeStat != null && thingDef.statBases != null) + { + var statValue = thingDef.statBases.FirstOrDefault(s => s.stat == incubationTimeStat); + if (statValue != null) + { + return Mathf.RoundToInt(statValue.value * 60000f); + } + } + return 60000; + } + + private float GetIncubationCost(ThingDef thingDef) + { + StatDef incubationCostStat = DefDatabase.GetNamedSilentFail("ARA_IncubationCost"); + if (incubationCostStat != null && thingDef.statBases != null) + { + var statValue = thingDef.statBases.FirstOrDefault(s => s.stat == incubationCostStat); + if (statValue != null) + { + return statValue.value; + } + } + return 10f; + } } } \ No newline at end of file diff --git a/Source/ArachnaeSwarm/Thing_Comps/ARA_CompExtraIncubationInfo/CompExtraIncubationInfo.cs b/Source/ArachnaeSwarm/Thing_Comps/ARA_CompExtraIncubationInfo/CompExtraIncubationInfo.cs index e89ef79..4c4a2ea 100644 --- a/Source/ArachnaeSwarm/Thing_Comps/ARA_CompExtraIncubationInfo/CompExtraIncubationInfo.cs +++ b/Source/ArachnaeSwarm/Thing_Comps/ARA_CompExtraIncubationInfo/CompExtraIncubationInfo.cs @@ -1,4 +1,5 @@ using RimWorld; +using System.Collections.Generic; using Verse; namespace ArachnaeSwarm @@ -8,6 +9,6 @@ namespace ArachnaeSwarm public CompProperties_ExtraIncubationInfo Props => (CompProperties_ExtraIncubationInfo)props; // 公开属性,供其他组件读取 - public ThingDef CocoonDef => Props.cocoonDef; + public List CocoonDefs => Props.cocoonDefs; } } diff --git a/Source/ArachnaeSwarm/Thing_Comps/ARA_CompExtraIncubationInfo/CompProperties_ExtraIncubationInfo.cs b/Source/ArachnaeSwarm/Thing_Comps/ARA_CompExtraIncubationInfo/CompProperties_ExtraIncubationInfo.cs index 9505232..bd4f9fc 100644 --- a/Source/ArachnaeSwarm/Thing_Comps/ARA_CompExtraIncubationInfo/CompProperties_ExtraIncubationInfo.cs +++ b/Source/ArachnaeSwarm/Thing_Comps/ARA_CompExtraIncubationInfo/CompProperties_ExtraIncubationInfo.cs @@ -1,11 +1,15 @@ using RimWorld; +using System.Collections.Generic; using Verse; namespace ArachnaeSwarm { public class CompProperties_ExtraIncubationInfo : CompProperties { - // 指定的茧建筑定义 + // 指定的茧建筑定义列表 (新版) + public List cocoonDefs; + + // 为了向后兼容指定的单个建筑定义 (旧版) public ThingDef cocoonDef; public CompProperties_ExtraIncubationInfo() {