This commit is contained in:
Tourswen
2025-11-03 02:39:00 +08:00
parent 8f85bd00f3
commit 242866bada
183 changed files with 5967 additions and 3078 deletions

View File

@@ -0,0 +1,36 @@
using RimWorld;
using Verse;
using Verse.AI;
using System.Collections.Generic;
namespace WulaFallenEmpire
{
public class JobDriver_RecycleMechanoid : JobDriver
{
private Building_MechanoidRecycler Recycler => job.targetA.Thing as Building_MechanoidRecycler;
public override bool TryMakePreToilReservations(bool errorOnFailed)
{
return pawn.Reserve(job.targetA, job, 1, -1, null, errorOnFailed);
}
protected override IEnumerable<Toil> MakeNewToils()
{
// 前往回收器
yield return Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.InteractionCell);
// 进入回收器
yield return new Toil
{
initAction = () =>
{
if (Recycler != null)
{
Recycler.AcceptMechanoid(pawn);
}
},
defaultCompleteMode = ToilCompleteMode.Instant
};
}
}
}