diff --git a/1.6/1.6/Assemblies/ArachnaeSwarm.dll b/1.6/1.6/Assemblies/ArachnaeSwarm.dll index fe07e22..84e0e9c 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/ThingDef_Races/ARA_RaceBaseSwarm.xml b/1.6/1.6/Defs/ThingDef_Races/ARA_RaceBaseSwarm.xml index 02805a9..130db61 100644 --- a/1.6/1.6/Defs/ThingDef_Races/ARA_RaceBaseSwarm.xml +++ b/1.6/1.6/Defs/ThingDef_Races/ARA_RaceBaseSwarm.xml @@ -78,15 +78,13 @@ 8 --> - - -
  • Haul
  • - - - - -
    + +
  • + Haul + true + true +
  • +
    true @@ -102,9 +100,13 @@
  • - -
  • ARA_Sowing
  • - + +
  • + ARA_Sowing + true + true +
  • +
    true
    @@ -121,10 +123,18 @@
  • - -
  • Dig
  • -
  • AttackTarget
  • - + +
  • + Dig + true + true +
  • +
  • + AttackTarget + true + true +
  • +
    true
    diff --git a/Source/ArachnaeSwarm/ARA_TrainingWork/CompAdvancedTraining.cs b/Source/ArachnaeSwarm/ARA_TrainingWork/CompAdvancedTraining.cs index 9a0b8c9..49da925 100644 --- a/Source/ArachnaeSwarm/ARA_TrainingWork/CompAdvancedTraining.cs +++ b/Source/ArachnaeSwarm/ARA_TrainingWork/CompAdvancedTraining.cs @@ -7,13 +7,13 @@ namespace ArachnaeSwarm public class CompProperties_AdvancedTraining : CompProperties { // 1. 用于设置固定技能等级 - public List skillLevels = new List(); - - // 2. 用于指定生成时立即完成的训练 - public List instantTrainables = new List(); + public List skillLevels = new List(); + + // 2. 用于配置训练项目 + public List trainables = new List(); // 3. 全局开关:是否阻止所有技能衰减 - public bool disableAllSkillDecay = false; + public bool disableAllSkillDecay = false; public CompProperties_AdvancedTraining() { @@ -25,10 +25,15 @@ namespace ArachnaeSwarm { public SkillDef skill; public int level = 0; - // 这里的 disableDecay 字段现在是冗余的,因为我们有全局的 disableAllSkillDecay - // 但为了兼容性或未来可能的需求,可以保留。 - // 在当前方案中,它的值将被忽略。 - public bool disableDecay = true; + public bool disableDecay = true; + } + + // 新增:用于定义训练项目的条目 + public class TrainableEntry + { + public TrainableDef trainable; + public bool trainInstantly = false; // 是否立即完成训练 + public bool setWanted = false; // 是否默认启用 } public class CompAdvancedTraining : ThingComp @@ -53,22 +58,28 @@ namespace ArachnaeSwarm if (skillRecord != null) { skillRecord.Level = entry.level; - // 注意: 激情 (passion) 影响学习速度,不直接阻止衰减。 - // 实际的衰减阻止逻辑在 TrainingSystem_Patcher.cs 中处理。 - // 默认情况下,我们不改变 passion,除非有特殊需求。 } } } } - // --- 2. 执行瞬间训练 (只在初次生成时) --- - if (!respawningAfterLoad && pawn.training != null && !Props.instantTrainables.NullOrEmpty()) + // --- 2. 处理训练项目 (只在初次生成时) --- + if (!respawningAfterLoad && pawn.training != null && !Props.trainables.NullOrEmpty()) { - foreach (var trainable in Props.instantTrainables) + foreach (var entry in Props.trainables) { - if (trainable != null && !pawn.training.HasLearned(trainable)) + if (entry.trainable == null) continue; + + // 2a. 立即完成训练 + if (entry.trainInstantly && !pawn.training.HasLearned(entry.trainable)) { - pawn.training.Train(trainable, null, complete: true); + pawn.training.Train(entry.trainable, null, complete: true); + } + + // 2b. 设置为默认启用 + if (entry.setWanted) + { + pawn.training.SetWantedRecursive(entry.trainable, true); } } }