protected override Job TryGiveJob(Pawn pawn) { if (!pawn.health.capacities.CapableOf(PawnCapacityDefOf.Manipulation)) { return(null); } Lord lord = pawn.GetLord(); Thing thing = GatherItemsForShipCaravanUtility.FindThingToHaul(pawn, lord); if (thing is null) { return(null); } return(new Job(JobDefOf_Ships.PrepareCaravan_GatheringShip, thing) { lord = lord }); }
private Toil DetermineNumToHaul() { return(new Toil { initAction = delegate() { int num = GatherItemsForShipCaravanUtility.CountLeftToTransfer(this.pawn, this.Transferable, this.job.lord); if (!(this.pawn.carryTracker.CarriedThing is null)) { num -= this.pawn.carryTracker.CarriedThing.stackCount; } if (num <= 0) { this.pawn.jobs.EndCurrentJob(JobCondition.Succeeded, true); } else { this.job.count = num; } }, defaultCompleteMode = ToilCompleteMode.Instant, atomicWithPrevious = true });