protected override IEnumerable <Toil> MakeNewToils() { this.FailOn <JobDriver>(() => AvailQty == 0); this.FailOnIncapable <JobDriver>(PawnCapacityDefOf.Manipulation); this.FailOnDestroyedNullOrForbidden(fetch); Toil reservePart = Toils_Reserve.Reserve(fetch); yield return(reservePart); yield return(Toils_Goto.GotoThing(fetch, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden <Toil>(fetch).FailOnSomeonePhysicallyInteracting <Toil>(fetch)); pawn.CurJob.count = 1; yield return(Toils_Haul.StartCarryThing(fetch).FailOnDespawnedNullOrForbidden <Toil>(fetch)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reservePart, fetch, TargetIndex.None, true, t => { return pawn.carryTracker.CarriedThing.stackCount < DesiredQty; })); yield return(Toils_Goto.GotoThing(target, PathEndMode.ClosestTouch)); Toil toil = Toils_General.Wait(UseDuration, TargetIndex.None); toil.WithProgressBarToilDelay(fetch, false, -0.5f); yield return(toil); }
protected override IEnumerable <Toil> MakeNewToils() { this.FailOnDespawnedNullOrForbidden(TargetIndex.A); this.FailOnBurningImmobile(TargetIndex.A); yield return(Toils_General.DoAtomic(delegate { this.job.count = 1; })); Toil reserveGenes = Toils_Reserve.Reserve(TargetIndex.B, 1, -1, null); yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(TargetIndex.B).FailOnSomeonePhysicallyInteracting(TargetIndex.B)); yield return(Toils_Haul.StartCarryThing(TargetIndex.B, false, true, false).FailOnDestroyedNullOrForbidden(TargetIndex.B)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveGenes, TargetIndex.B, TargetIndex.None, true, null)); yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch)); yield return(Toils_General.Wait(10).FailOnDestroyedNullOrForbidden(TargetIndex.B).FailOnDestroyedNullOrForbidden(TargetIndex.A) .FailOnCannotTouch(TargetIndex.A, PathEndMode.Touch).WithProgressBarToilDelay(TargetIndex.A, false, -0.5f)); yield return(new Toil { initAction = delegate { var sleeveIncubator = (Building_SleeveGrower)this.job.GetTarget(TargetIndex.A).Thing; sleeveIncubator.AcceptBrainTemplate(this.job.targetB.Thing); }, defaultCompleteMode = ToilCompleteMode.Instant }); }
protected override IEnumerable <Toil> MakeNewToils() { this.FailOnDespawnedNullOrForbidden(RefuelableInd); /*base.AddEndCondition(delegate * { * if (!this.RefuelableComp.FullTank) * { * return JobCondition.Ongoing; * } * return JobCondition.Succeeded; * });*/ yield return(Toils_General.DoAtomic(delegate { job.count = RefuelableComp.FuelCountToFull; })); Toil reserveFuel = Toils_Reserve.Reserve(FuelInd, 1, -1, null); yield return(reserveFuel); yield return(Toils_Goto.GotoThing(FuelInd, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(FuelInd).FailOnSomeonePhysicallyInteracting(FuelInd)); yield return(Toils_Haul.StartCarryThing(FuelInd, false, true, false).FailOnDestroyedNullOrForbidden(FuelInd)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveFuel, FuelInd, TargetIndex.None, true, null)); yield return(Toils_Goto.GotoThing(RefuelableInd, PathEndMode.Touch)); yield return(Toils_General.Wait(RefuelingDuration, TargetIndex.None).FailOnDestroyedNullOrForbidden(FuelInd).FailOnDestroyedNullOrForbidden(RefuelableInd). FailOnCannotTouch(RefuelableInd, PathEndMode.Touch).WithProgressBarToilDelay(RefuelableInd, false, -0.5f)); yield return(FinalizeRefueling(RefuelableInd, FuelInd)); }
protected override IEnumerable <Toil> MakeNewToils() { //this.EndOnDespawnedOrNull(TargetIndex.A, JobCondition.Incompletable); var reserve = Toils_Reserve.Reserve(TargetIndex.A, 25, Info.feePerColonist); yield return(reserve); yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch)); yield return(this.DetermineNumToHaul()); yield return(Toils_Haul.StartCarryThing(TargetIndex.A, false, true)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserve, TargetIndex.A, TargetIndex.None)); var findTicketTaker = FindTicketTaker(); yield return(findTicketTaker); //yield return Toils_Reserve.Reserve(TargetIndex.B); yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.Touch) .JumpIf(() => !JobDriver_PrepareCaravan_GatherItems.IsUsableCarrier(TicketTaker, this.pawn, false), findTicketTaker)); yield return(GiveSilver()); yield return(Notify_ColonistPayedEntry()); }
protected override IEnumerable <Toil> MakeNewToils() { this.FailOn(() => !base.Map.lordManager.lords.Contains(this.job.lord)); Toil reserve = Toils_Reserve.Reserve(TargetIndex.A, 1, -1, null).FailOnDespawnedOrNull(TargetIndex.A); yield return(reserve); yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch)); yield return(this.DetermineNumToHaul()); yield return(Toils_Haul.StartCarryThing(TargetIndex.A, false, true, false)); yield return(this.AddCarriedThingToTransferables()); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserve, TargetIndex.A, TargetIndex.None, true, (Thing x) => this.Transferable.things.Contains(x))); Toil findCarrier = this.FindCarrier(); yield return(findCarrier); yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.Touch).JumpIf(() => !JobDriver_PrepareCaravan_GatherItems.IsUsableCarrier(this.Carrier, this.pawn, true), findCarrier)); yield return(Toils_General.Wait(25, TargetIndex.None).JumpIf(() => !JobDriver_PrepareCaravan_GatherItems.IsUsableCarrier(this.Carrier, this.pawn, true), findCarrier).WithProgressBarToilDelay(TargetIndex.B, false, -0.5f)); yield return(this.PlaceTargetInCarrierInventory()); yield break; }
protected override IEnumerable <Toil> MakeNewToils() { this.FailOnDespawnedNullOrForbidden(WineFermenterInd); this.FailOnBurningImmobile(WineFermenterInd); base.AddEndCondition(() => (this.WineFermenter.SpaceLeftForMust > 0) ? JobCondition.Ongoing : JobCondition.Succeeded); yield return(Toils_General.DoAtomic(delegate { this.job.count = this.WineFermenter.SpaceLeftForMust; })); Toil reserveMust = Toils_Reserve.Reserve(MustInd, 1, -1, null); yield return(reserveMust); yield return(Toils_Goto.GotoThing(MustInd, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(MustInd).FailOnSomeonePhysicallyInteracting(MustInd)); yield return(Toils_Haul.StartCarryThing(MustInd, false, true, false).FailOnDestroyedNullOrForbidden(MustInd)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveMust, MustInd, TargetIndex.None, true, null)); yield return(Toils_Goto.GotoThing(WineFermenterInd, PathEndMode.Touch)); yield return(Toils_General.Wait(Duration, TargetIndex.None).FailOnDestroyedNullOrForbidden(MustInd).FailOnDestroyedNullOrForbidden(WineFermenterInd).FailOnCannotTouch(WineFermenterInd, PathEndMode.Touch).WithProgressBarToilDelay(WineFermenterInd, false, -0.5f)); yield return(new Toil { initAction = delegate() { this.WineFermenter.AddMust(this.Must); }, defaultCompleteMode = ToilCompleteMode.Instant }); yield break; }
protected override IEnumerable <Toil> MakeNewToils() { this.FailOnDespawnedNullOrForbidden(TargetIndex.A); this.FailOnBurningImmobile(TargetIndex.A); AddEndCondition(() => (Barrel.SpaceLeftForWort > 0) ? JobCondition.Ongoing : JobCondition.Succeeded); yield return(Toils_General.DoAtomic(delegate { job.count = Barrel.SpaceLeftForWort; })); Toil reserveWort = Toils_Reserve.Reserve(TargetIndex.B); yield return(reserveWort); yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(TargetIndex.B).FailOnSomeonePhysicallyInteracting(TargetIndex.B)); yield return(Toils_Haul.StartCarryThing(TargetIndex.B, putRemainderInQueue: false, subtractNumTakenFromJobCount: true).FailOnDestroyedNullOrForbidden(TargetIndex.B)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveWort, TargetIndex.B, TargetIndex.None, takeFromValidStorage: true)); yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch)); yield return(Toils_General.Wait(200).FailOnDestroyedNullOrForbidden(TargetIndex.B).FailOnDestroyedNullOrForbidden(TargetIndex.A) .FailOnCannotTouch(TargetIndex.A, PathEndMode.Touch) .WithProgressBarToilDelay(TargetIndex.A)); Toil toil = new Toil(); toil.initAction = delegate { Barrel.AddWort(Wort); }; toil.defaultCompleteMode = ToilCompleteMode.Instant; yield return(toil); }
// Token: 0x06000028 RID: 40 RVA: 0x000030FC File Offset: 0x000020FC protected override IEnumerable <Toil> MakeNewToils() { this.FailOnDespawnedNullOrForbidden(TargetIndex.A); this.FailOnBurningImmobile(TargetIndex.A); yield return(Toils_Reserve.Reserve(TargetIndex.A, 1, -1, null)); Toil toil = Toils_Reserve.Reserve(TargetIndex.B, 1, -1, null); yield return(toil); yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(TargetIndex.B).FailOnSomeonePhysicallyInteracting(TargetIndex.B)); yield return(Toils_Haul.StartCarryThing(TargetIndex.B, false, false, false).FailOnDestroyedNullOrForbidden(TargetIndex.B)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(toil, TargetIndex.B, TargetIndex.None, false, null)); yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch)); yield return(Toils_General.Wait(200, TargetIndex.None).FailOnDestroyedNullOrForbidden(TargetIndex.B).FailOnDestroyedNullOrForbidden(TargetIndex.A).WithProgressBarToilDelay(TargetIndex.A, false, -0.5f)); yield return(new Toil { initAction = delegate() { this.Barrel.Addoil(this.sd_luciprod_mechanite_oil); }, defaultCompleteMode = ToilCompleteMode.Instant }); yield break; }
protected override IEnumerable <Toil> MakeNewToils() { this.FailOnDespawnedNullOrForbidden(TargetIndex.A); base.AddEndCondition(() => (!this.RefuelableComp.IsFull) ? JobCondition.Ongoing : JobCondition.Succeeded); base.AddFailCondition(() => !this.job.playerForced && !this.RefuelableComp.ShouldAutoRefuelNowIgnoringFuelPct); yield return(Toils_General.DoAtomic(delegate { this.job.count = this.RefuelableComp.GetFuelCountToFullyRefuel(); })); Toil reserveFuel = Toils_Reserve.Reserve(TargetIndex.B, 1, -1, null); yield return(reserveFuel); yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(TargetIndex.B).FailOnSomeonePhysicallyInteracting(TargetIndex.B)); yield return(Toils_Haul.StartCarryThing(TargetIndex.B, false, true, false).FailOnDestroyedNullOrForbidden(TargetIndex.B)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveFuel, TargetIndex.B, TargetIndex.None, true, null)); yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch)); yield return(Toils_General.Wait(240, TargetIndex.None).FailOnDestroyedNullOrForbidden(TargetIndex.B).FailOnDestroyedNullOrForbidden(TargetIndex.A).FailOnCannotTouch(TargetIndex.A, PathEndMode.Touch).WithProgressBarToilDelay(TargetIndex.A, false, -0.5f)); yield return(Toils_Refuel.FinalizeRefueling(TargetIndex.A, TargetIndex.B)); yield break; }
protected override IEnumerable <Toil> MakeNewToils() { this.FailOnAggroMentalState(TargetIndex.A); this.FailOnDespawnedNullOrForbidden(TargetIndex.A); this.FailOn(delegate { return(!Deliveree.OnBaseMechanoidPlatform()); }); Need_Maintenance need = Deliveree.needs.TryGetNeed <Need_Maintenance>() as Need_Maintenance; Toil reserveParts = null; reserveParts = ReserveParts(TargetIndex.B, need).FailOnDespawnedNullOrForbidden(TargetIndex.B); yield return(reserveParts); yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(TargetIndex.B)); yield return(PickupParts(TargetIndex.B, need).FailOnDestroyedOrNull(TargetIndex.B)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveParts, TargetIndex.B, TargetIndex.None, true, null)); PathEndMode interactionCell = (this.Deliveree != this.pawn) ? PathEndMode.InteractionCell : PathEndMode.OnCell; yield return(Toils_Goto.GotoThing(TargetIndex.A, interactionCell)); int duration = (int)(1f / this.pawn.GetStatValue(WTH_DefOf.WTH_HackingMaintenanceSpeed, true) * 600f); EffecterDef effect = DefDatabase <EffecterDef> .AllDefs.FirstOrDefault((EffecterDef ed) => ed.defName == "Repair"); yield return(Toils_General.Wait(duration, TargetIndex.None).FailOnCannotTouch(TargetIndex.A, interactionCell).WithProgressBarToilDelay(TargetIndex.A, false, -0.5f).WithEffect(effect, TargetIndex.A)); yield return(FinalizeMaintenance(this.Deliveree, need, reserveParts)); }
protected override IEnumerable <Toil> MakeNewToils() { this.FailOnDespawnedNullOrForbidden(TargetIndex.A); AddEndCondition(() => (!RefuelableComp.IsFull) ? JobCondition.Ongoing : JobCondition.Succeeded); AddFailCondition(() => !job.playerForced && !RefuelableComp.ShouldAutoRefuelNowIgnoringFuelPct); AddFailCondition(() => !RefuelableComp.allowAutoRefuel && !job.playerForced); yield return(Toils_General.DoAtomic(delegate { job.count = RefuelableComp.GetFuelCountToFullyRefuel(); })); Toil reserveFuel = Toils_Reserve.Reserve(TargetIndex.B); yield return(reserveFuel); yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(TargetIndex.B).FailOnSomeonePhysicallyInteracting(TargetIndex.B)); yield return(Toils_Haul.StartCarryThing(TargetIndex.B, putRemainderInQueue: false, subtractNumTakenFromJobCount: true).FailOnDestroyedNullOrForbidden(TargetIndex.B)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveFuel, TargetIndex.B, TargetIndex.None, takeFromValidStorage: true)); yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch)); yield return(Toils_General.Wait(240).FailOnDestroyedNullOrForbidden(TargetIndex.B).FailOnDestroyedNullOrForbidden(TargetIndex.A) .FailOnCannotTouch(TargetIndex.A, PathEndMode.Touch) .WithProgressBarToilDelay(TargetIndex.A)); yield return(Toils_Refuel.FinalizeRefueling(TargetIndex.A, TargetIndex.B)); }
protected override IEnumerable <Toil> MakeNewToils() { this.FailOnDespawnedNullOrForbidden(TargetIndex.A); yield return(Toils_Reserve.Reserve(TargetIndex.A, 1)); var reserveSeeds = ReserveSeedsIfWillPlantWholeStack(); yield return(reserveSeeds); yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.ClosestTouch) .FailOnDespawnedNullOrForbidden(TargetIndex.B) .FailOnSomeonePhysicallyInteracting(TargetIndex.B)); yield return(Toils_Haul.StartCarryThing(TargetIndex.B, false, false) .FailOnDestroyedNullOrForbidden(TargetIndex.B)); Toils_Haul.CheckForGetOpportunityDuplicate(reserveSeeds, TargetIndex.B, TargetIndex.None, false, null); var toil = Toils_Goto.GotoCell(TargetIndex.A, PathEndMode.Touch); yield return(toil); yield return(SowSeedToil()); yield return(Toils_Reserve.Release(TargetIndex.A)); yield return(TryToSetAdditionalPlantingSite()); yield return(Toils_Reserve.Reserve(TargetIndex.A, 1)); yield return(Toils_Jump.Jump(toil)); }
protected override IEnumerable <Toil> MakeNewToils() { this.FailOnDespawnedNullOrForbidden(TargetIndex.A); this.FailOnBurningImmobile(TargetIndex.A); base.AddEndCondition(() => (this.Vat.SpaceLeftForInput > 0) ? JobCondition.Ongoing : JobCondition.Succeeded); yield return(Toils_General.DoAtomic(delegate { this.job.count = this.Vat.SpaceLeftForInput; })); Toil reserveWort = Toils_Reserve.Reserve(TargetIndex.B, 1, -1, null); yield return(reserveWort); yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(TargetIndex.B).FailOnSomeonePhysicallyInteracting(TargetIndex.B)); yield return(Toils_Haul.StartCarryThing(TargetIndex.B, false, true, false).FailOnDestroyedNullOrForbidden(TargetIndex.B)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveWort, TargetIndex.B, TargetIndex.None, true, null)); yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch)); yield return(Toils_General.Wait(200).FailOnDestroyedNullOrForbidden(TargetIndex.B).FailOnDestroyedNullOrForbidden(TargetIndex.A).FailOnCannotTouch(TargetIndex.A, PathEndMode.Touch).WithProgressBarToilDelay(TargetIndex.A, false, -0.5f)); yield return(new Toil { initAction = delegate { this.Vat.AddInput(InputThing); }, defaultCompleteMode = ToilCompleteMode.Instant }); }
// Token: 0x0600004D RID: 77 RVA: 0x00004189 File Offset: 0x00002389 protected override IEnumerable <Toil> MakeNewToils() { this.FailOnDespawnedNullOrForbidden(AddTo); yield return(Toils_General.DoAtomic(delegate { job.count = 1; })); Toil reserveFish = Toils_Reserve.Reserve(FishToAdd, 1, -1, null); yield return(reserveFish); yield return(Toils_Goto.GotoThing(FishToAdd, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(FishToAdd).FailOnSomeonePhysicallyInteracting(FishToAdd)); yield return(Toils_Haul.StartCarryThing(FishToAdd, false, true, false).FailOnDestroyedNullOrForbidden(FishToAdd)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveFish, FishToAdd, TargetIndex.None, true, null)); yield return(Toils_Goto.GotoThing(AddTo, PathEndMode.Touch)); yield return(Toils_General.Wait(AddDuration, TargetIndex.None).FailOnDestroyedNullOrForbidden(FishToAdd).FailOnDestroyedNullOrForbidden(AddTo).FailOnCannotTouch(AddTo, PathEndMode.Touch).WithProgressBarToilDelay(AddTo, false, -0.5f)); yield return(Toils_AQAdding.FinalizeAdding(AddTo, FishToAdd)); yield break; }
protected override IEnumerable <Toil> MakeNewToils() { this.FailOn(() => !base.Map.lordManager.lords.Contains(job.lord)); Toil reserve = Toils_Reserve.Reserve(TargetIndex.A).FailOnDespawnedOrNull(TargetIndex.A); yield return(reserve); yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch)); yield return(DetermineNumToHaul()); yield return(Toils_Haul.StartCarryThing(TargetIndex.A, putRemainderInQueue: false, subtractNumTakenFromJobCount: true)); yield return(AddCarriedThingToTransferables()); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserve, TargetIndex.A, TargetIndex.None, takeFromValidStorage: true, (Thing x) => Transferable.things.Contains(x))); Toil findCarrier = FindCarrier(); yield return(findCarrier); yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.Touch).JumpIf(() => !IsUsableCarrier(Carrier, pawn, allowColonists: true), findCarrier)); yield return(Toils_General.Wait(25).JumpIf(() => !IsUsableCarrier(Carrier, pawn, allowColonists: true), findCarrier).WithProgressBarToilDelay(TargetIndex.B)); yield return(PlaceTargetInCarrierInventory()); }
protected override IEnumerable <Toil> MakeNewToils() { this.FailOnDespawnedNullOrForbidden(BarrelInd); this.FailOnBurningImmobile(BarrelInd); AddEndCondition(() => Barrel.SpaceLeftForWort > 0 ? JobCondition.Ongoing : JobCondition.Succeeded); yield return(Toils_General.DoAtomic(delegate { job.count = Barrel.SpaceLeftForWort; })); var reserveWort = Toils_Reserve.Reserve(WortInd); yield return(reserveWort); yield return(Toils_Goto.GotoThing(WortInd, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(WortInd) .FailOnSomeonePhysicallyInteracting(WortInd)); yield return(Toils_Haul.StartCarryThing(WortInd, false, true).FailOnDestroyedNullOrForbidden(WortInd)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveWort, WortInd, TargetIndex.None, true)); yield return(Toils_Goto.GotoThing(BarrelInd, PathEndMode.Touch)); yield return(Toils_General.Wait(Duration).FailOnDestroyedNullOrForbidden(WortInd) .FailOnDestroyedNullOrForbidden(BarrelInd).FailOnCannotTouch(BarrelInd, PathEndMode.Touch) .WithProgressBarToilDelay(BarrelInd)); yield return(new Toil { initAction = delegate { Barrel.AddWort(Wort); }, defaultCompleteMode = ToilCompleteMode.Instant }); }
protected override IEnumerable <Toil> MakeNewToils() { //Log.Message("I am inside the job now, with "+pawn.ToString(), false); Building_ItemProcessor building_processor = (Building_ItemProcessor)this.job.GetTarget(TargetIndex.A).Thing; this.FailOnDespawnedNullOrForbidden(TargetIndex.A); this.FailOnBurningImmobile(TargetIndex.A); yield return(Toils_General.DoAtomic(delegate { if (building_processor.ExpectedAmountSecondIngredient != 0) { this.job.count = building_processor.ExpectedAmountSecondIngredient - building_processor.CurrentAmountSecondIngredient; } else { this.job.count = 1; } })); Toil reserveIngredient = Toils_Reserve.Reserve(TargetIndex.B, 1, -1, null); yield return(reserveIngredient); yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(TargetIndex.B).FailOnSomeonePhysicallyInteracting(TargetIndex.B)); yield return(Toils_Haul.StartCarryThing(TargetIndex.B, false, true, false).FailOnDestroyedNullOrForbidden(TargetIndex.B)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveIngredient, TargetIndex.B, TargetIndex.None, true, null)); yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch)); yield return(Toils_General.Wait(200, TargetIndex.None).FailOnDestroyedNullOrForbidden(TargetIndex.B).FailOnDestroyedNullOrForbidden(TargetIndex.A).FailOnCannotTouch(TargetIndex.A, PathEndMode.Touch).WithProgressBarToilDelay(TargetIndex.A, false, -0.5f)); yield return(new Toil { initAction = delegate { if (building_processor.processorStage != ProcessorStage.Inactive) { if (building_processor.compItemProcessor.Props.transfersIngredientLists) { if (this.job.targetB.Thing.TryGetComp <CompIngredients>() is CompIngredients ingredientComp) { building_processor.ingredients.AddRange(ingredientComp.ingredients); } } building_processor.CurrentAmountSecondIngredient += this.job.targetB.Thing.stackCount; if (building_processor.ExpectedAmountSecondIngredient != 0) { if (building_processor.CurrentAmountSecondIngredient >= building_processor.ExpectedAmountSecondIngredient) { building_processor.secondIngredientComplete = true; } } building_processor.TryAcceptSecond(this.job.targetB.Thing, 0, true); building_processor.Notify_StartProcessing(); //this.job.targetB.Thing.Destroy(); } },
protected override IEnumerable <Toil> MakeNewToils() { //Log.Message("I am inside the job now, with "+pawn.ToString(), false); Toil reserveBees = Toils_Reserve.Reserve(TargetIndex.B, 1, -1, null); yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(TargetIndex.B).FailOnSomeonePhysicallyInteracting(TargetIndex.B)); yield return(Toils_Haul.StartCarryThing(TargetIndex.B, false, true, false).FailOnDestroyedNullOrForbidden(TargetIndex.B)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveBees, TargetIndex.B, TargetIndex.None, true, null)); yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch)); yield return(Toils_General.Wait(240).FailOnDestroyedNullOrForbidden(TargetIndex.B).FailOnDestroyedNullOrForbidden(TargetIndex.A).FailOnCannotTouch(TargetIndex.A, PathEndMode.Touch).WithProgressBarToilDelay(TargetIndex.A, false, -0.5f)); yield return(new Toil { initAction = delegate { Building_Beehouse buildingbeehouse = (Building_Beehouse)this.job.GetTarget(TargetIndex.A).Thing; //buildingbeehouse.queenThing = this.job.targetB.Thing; buildingbeehouse.TryAcceptAnyQueen(this.job.targetB.Thing, true); buildingbeehouse.BeehouseIsExpectingBees = false; //this.job.targetB.Thing.Destroy(); }, defaultCompleteMode = ToilCompleteMode.Instant }); }
protected override IEnumerable <Toil> MakeNewToils() { //Log.Message("Toil start:" + this.pawn +" is taking " + Bedding + " to " + Bed); this.FailOnDespawnedNullOrForbidden(TargetIndex.A); base.AddEndCondition(() => (!bedComp.Loaded) ? JobCondition.Ongoing : JobCondition.Succeeded); job.count = 1; Toil reserveBedding = Toils_Reserve.Reserve(TargetIndex.B, 1, -1, null); yield return(reserveBedding); yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(TargetIndex.B).FailOnSomeonePhysicallyInteracting(TargetIndex.B)); yield return(Toils_Haul.StartCarryThing(TargetIndex.B, false, true, false).FailOnDestroyedNullOrForbidden(TargetIndex.B)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveBedding, TargetIndex.B, TargetIndex.None, true, null)); yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch)); yield return(Toils_General.Wait(MakingDuration, TargetIndex.None).FailOnDestroyedNullOrForbidden(TargetIndex.B).FailOnDestroyedNullOrForbidden(TargetIndex.A).FailOnCannotTouch(TargetIndex.A, PathEndMode.Touch).WithProgressBarToilDelay(TargetIndex.A, false, -0.5f)); Toil makeTheBed = new Toil(); makeTheBed.initAction = delegate { Pawn actor = makeTheBed.actor; bedComp.LoadBedding(actor.CurJob.targetB.Thing.def, actor.CurJob.targetB.Thing);//, 1); //Building_SoftWarmBed SoftWarmBed = Bed as Building_SoftWarmBed; actor.carryTracker.innerContainer.ClearAndDestroyContents(DestroyMode.Vanish); }; makeTheBed.defaultCompleteMode = ToilCompleteMode.Instant; makeTheBed.FailOnDespawnedOrNull(TargetIndex.A); yield return(makeTheBed); yield break; }
protected override IEnumerable <Toil> MakeNewToils() { Toil reserveGenes = Toils_Reserve.Reserve(TargetIndex.B, 1, -1, null); yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(TargetIndex.B).FailOnSomeonePhysicallyInteracting(TargetIndex.B)); yield return(Toils_Haul.StartCarryThing(TargetIndex.B, false, true, false).FailOnDestroyedNullOrForbidden(TargetIndex.B)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveGenes, TargetIndex.B, TargetIndex.None, true, null)); yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch)); yield return(Toils_General.Wait(240).FailOnDestroyedNullOrForbidden(TargetIndex.B).FailOnDestroyedNullOrForbidden(TargetIndex.A).FailOnCannotTouch(TargetIndex.A, PathEndMode.Touch).WithProgressBarToilDelay(TargetIndex.A, false, -0.5f)); yield return(new Toil { initAction = delegate { Building_NewGenePod building_genepod = (Building_NewGenePod)this.job.GetTarget(TargetIndex.A).Thing; building_genepod.TryAcceptThing2(this.job.targetB.Thing, true); building_genepod.PodHasGenes2 = true; building_genepod.SignalInsertGenes2 = false; }, defaultCompleteMode = ToilCompleteMode.Instant }); }
protected override IEnumerable <Toil> MakeNewToils() { this.FailOnDestroyedOrNull(TargetIndex.A); this.FailOnBurningImmobile(TargetIndex.B); if (!forbiddenInitially) { this.FailOnForbidden(TargetIndex.A); } Toil reserveTargetA = Toils_Reserve.Reserve(TargetIndex.A, 1, -1, null); yield return(reserveTargetA); Toil toilGoto = null; toilGoto = Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.ClosestTouch).FailOnSomeonePhysicallyInteracting(TargetIndex.A); toilGoto.AddFailCondition(delegate { Pawn actor = toilGoto.actor; Job curJob = actor.jobs.curJob; if (curJob.haulMode == HaulMode.ToCellStorage) { Thing thing = curJob.GetTarget(TargetIndex.A).Thing; IntVec3 cell = actor.jobs.curJob.GetTarget(TargetIndex.B).Cell; if (!cell.IsValidStorageFor(Map, thing)) { return(true); } } return(false); }); yield return(toilGoto); yield return(Toils_Haul.StartCarryThing(TargetIndex.A, false, true, false)); if (job.haulOpportunisticDuplicates) { yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveTargetA, TargetIndex.A, TargetIndex.B, false, null)); } if (job.expiryInterval != -1) { yield return(CheckExpiry()); } Insect insect = toilGoto.actor as Insect; if (insect != null && insect.targetColonyFood) { yield return(ResetTargetColonyFoodFlag(insect)); } Toil carryToCell = Toils_Haul.CarryHauledThingToCell(TargetIndex.B); yield return(carryToCell); yield return(Toils_Haul.PlaceHauledThingInCell(TargetIndex.B, carryToCell, true)); if (insect != null && insect.stealFood) { yield return(ResetStealFoodFlag(insect)); } }
protected override IEnumerable <Toil> MakeNewToils() { // Verify processor and item validity this.FailOn(() => Processor.SpaceLeftForItem <= 0); this.FailOnDespawnedNullOrForbidden(ProcessorInd); this.FailOn(() => (Item.TryGetComp <CompRottable>() != null && Item.TryGetComp <CompRottable>().Stage != RotStage.Fresh)); AddEndCondition(() => (Processor.SpaceLeftForItem > 0) ? JobCondition.Ongoing : JobCondition.Succeeded); // Reserve resources yield return(Toils_General.DoAtomic(delegate { job.count = Processor.SpaceLeftForItem; })); Toil reserveItem = Toils_Reserve.Reserve(ItemInd); yield return(reserveItem); // Haul and add items yield return(Toils_Goto.GotoThing(ItemInd, PathEndMode.ClosestTouch) .FailOnDespawnedNullOrForbidden(ItemInd) .FailOnSomeonePhysicallyInteracting(ItemInd)); yield return(Toils_Haul.StartCarryThing(ItemInd, false, true, false) .FailOnDestroyedNullOrForbidden(ItemInd)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveItem, ItemInd, TargetIndex.None, true, null)); yield return(Toils_Goto.GotoThing(ProcessorInd, PathEndMode.Touch)); yield return(Toils_General.Wait(Static.GenericWaitDuration) .FailOnDestroyedNullOrForbidden(ItemInd) .FailOnDestroyedNullOrForbidden(ProcessorInd) .FailOnCannotTouch(ProcessorInd, PathEndMode.Touch) .WithProgressBarToilDelay(ProcessorInd)); // Use the item yield return(new Toil() { initAction = () => { int amountAccepted = Processor.AddItem(Item); if (amountAccepted <= 0) { EndJobWith(JobCondition.Incompletable); } if (amountAccepted >= pawn.carryTracker.CarriedThing.stackCount) { pawn.carryTracker.CarriedThing.Destroy(); } else { pawn.carryTracker.CarriedThing.stackCount -= amountAccepted; } }, defaultCompleteMode = ToilCompleteMode.Instant }); }
protected override IEnumerable <Toil> MakeNewToils() { CompUniversalFermenter comp = Fermenter.TryGetComp <CompUniversalFermenter>(); // Verify fermenter and ingredient validity this.FailOn(() => comp.SpaceLeftForIngredient <= 0); this.FailOnDespawnedNullOrForbidden(FermenterInd); this.FailOnBurningImmobile(FermenterInd); this.FailOnDestroyedNullOrForbidden(IngredientInd); // Reserve resources // Creating the toil before yielding allows for CheckForGetOpportunityDuplicate Toil ingrToil = Toils_Reserve.Reserve(IngredientInd); yield return(ingrToil); // Reserve fermenter yield return(Toils_Reserve.Reserve(FermenterInd)); // Go to the ingredient yield return(Toils_Goto.GotoThing(IngredientInd, PathEndMode.ClosestTouch) .FailOnSomeonePhysicallyInteracting(IngredientInd) .FailOnDestroyedNullOrForbidden(IngredientInd)); // Haul the ingredients yield return(Toils_Haul.StartCarryThing(IngredientInd, false, true).FailOnDestroyedNullOrForbidden(IngredientInd)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(ingrToil, IngredientInd, TargetIndex.None, true)); // Carry ingredients to the fermenter yield return(Toils_Haul.CarryHauledThingToCell(FermenterInd)); // Add delay for adding ingredients to the fermenter yield return(Toils_General.Wait(Duration).FailOnDestroyedNullOrForbidden(FermenterInd).WithProgressBarToilDelay(FermenterInd)); // Use ingredients // The UniversalFermenter automatically destroys held ingredients Toil add = new Toil(); add.initAction = () => { if (!comp.AddIngredient(Ingredient)) { // The ingredient is not allowed, end the job EndJobWith(JobCondition.Incompletable); Log.Message("JobCondition.Incompletable"); } }; add.defaultCompleteMode = ToilCompleteMode.Instant; yield return(add); // End the current job yield break; }
// Token: 0x06000045 RID: 69 RVA: 0x0000409D File Offset: 0x0000229D protected override IEnumerable <Toil> MakeNewToils() { this.FailOnDespawnedNullOrForbidden(Feedable); AddEndCondition(delegate { if (AQComp.foodPct > 0.95f) { return(JobCondition.Succeeded); } return(JobCondition.Ongoing); }); yield return(Toils_General.DoAtomic(delegate { job.count = AQUtility.GetFoodNumToFullyFeed(AQComp); })); Toil reserveFood = Toils_Reserve.Reserve(Foodybits, 1, -1, null); yield return(reserveFood); yield return(Toils_Goto.GotoThing(Foodybits, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(Foodybits).FailOnSomeonePhysicallyInteracting(Foodybits)); yield return(Toils_Haul.StartCarryThing(Foodybits, false, true, false).FailOnDestroyedNullOrForbidden(Foodybits)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveFood, Foodybits, TargetIndex.None, true, null)); yield return(Toils_Goto.GotoThing(Feedable, PathEndMode.Touch)); yield return(Toils_General.Wait(FeedDuration, TargetIndex.None).FailOnDestroyedNullOrForbidden(Foodybits).FailOnDestroyedNullOrForbidden(Feedable).FailOnCannotTouch(Feedable, PathEndMode.Touch).WithProgressBarToilDelay(Feedable, false, -0.5f)); yield return(Toils_AQFeed.FinalizeFeeding(Feedable, Foodybits)); if (!job.GetTarget(Foodybits).HasThing) { EndJobWith(JobCondition.Incompletable); } yield return(Toils_Reserve.Reserve(Foodybits, 1, -1, null)); yield return(Toils_Reserve.Reserve(TargetIndex.C, 1, -1, null)); yield return(Toils_Goto.GotoThing(Foodybits, PathEndMode.ClosestTouch)); yield return(Toils_Haul.StartCarryThing(Foodybits, false, false, false)); Toil carry = Toils_Haul.CarryHauledThingToCell(TargetIndex.C); yield return(carry); yield return(Toils_Haul.PlaceHauledThingInCell(TargetIndex.C, carry, true, false)); yield break; }
protected override IEnumerable <Toil> MakeNewToils() { this.FailOn(delegate { return(DestType == HaulLocation.None || !Info.ShouldHaulTrash || Info.currentLord != pawn.GetLord() || !Info.AnyCarriersCanCarry(this.ThingToHaul)); }); Toil reserve = Toils_Reserve.Reserve(TargetIndex.A); yield return(reserve); // reserve if not already reserved by this pawn yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch)); yield return(this.DetermineNumToHaul()); yield return(Toils_Haul.StartCarryThing(TargetIndex.A, false, true)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserve, TargetIndex.A, TargetIndex.None, false, t => Info.thingsToHaul.Contains(t))); if (DestType == HaulLocation.ToCarriers) { Toil findCarrier = FindCarrier(); yield return(findCarrier); //yield return Toils_Reserve.Reserve(TargetIndex.B); yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.Touch) .JumpIf(() => !JobDriver_PrepareCaravan_GatherItems.IsUsableCarrier(this.Carrier, this.pawn, false), findCarrier)); yield return(Toils_General.Wait(PlaceInInventoryDuration).WithProgressBarToilDelay(TargetIndex.B, false, -0.5f)); yield return(PlaceTargetInCarrierInventory()); } else if (DestType == HaulLocation.ToTrash || DestType == HaulLocation.ToColony) { Toil findTrashSpot = FindTrashSpot(); yield return(findTrashSpot); yield return(Toils_Reserve.Reserve(TargetIndex.B)); yield return(Toils_Goto.GotoCell(TargetIndex.B, PathEndMode.Touch)); yield return(Toils_Haul.PlaceHauledThingInCell(TargetIndex.B, findTrashSpot, false)); } yield return(RemoveThingToHaulFromInfo()); }
protected override IEnumerable <Toil> MakeNewToils() { this.pawn.jobs.curJob.count = 1; this.FailOnDestroyedOrNull(TargetIndex.A); if (!base.TargetThingA.IsForbidden(this.pawn)) { this.FailOnForbidden(TargetIndex.A); } yield return(Toils_Reserve.Reserve(TargetIndex.B, 1)); Toil toil = Toils_Reserve.Reserve(TargetIndex.A, 1); yield return(toil); yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch)); yield return(Toils_Haul.StartCarryThing(TargetIndex.A, false, false)); if (base.CurJob.haulOpportunisticDuplicates) { yield return(Toils_Haul.CheckForGetOpportunityDuplicate(toil, TargetIndex.A, TargetIndex.B, false, null)); } Toil toil3 = Toils_Haul.CarryHauledThingToCell(TargetIndex.B); yield return(toil3); yield return(Toils_Haul.PlaceHauledThingInCell(TargetIndex.B, toil3, true)); Toil toil2 = new Toil(); toil2.defaultCompleteMode = ToilCompleteMode.Delay; toil2.defaultDuration = 100; toil2.WithProgressBarToilDelay(TargetIndex.A, false, -0.5f); toil2.FailOnDespawnedNullOrForbidden(TargetIndex.A); yield return(toil2); yield return(new Toil { initAction = delegate { Pawn actor = this.pawn; CompUsable compUsable = actor.CurJob.targetA.Thing.TryGetComp <CompUsable>(); compUsable.UsedBy(actor); }, defaultCompleteMode = ToilCompleteMode.Instant }); yield break; }
protected override IEnumerable <Toil> MakeNewToils() { Toil reserveItem = Toils_Reserve.Reserve(TargetIndex.A, 1, -1, null); yield return(reserveItem); yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(TargetIndex.A)); yield return(Toils_Haul.StartCarryThing(TargetIndex.A)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveItem, TargetIndex.A, TargetIndex.None, true)); yield return(Toils_General.Wait(500).FailOnDestroyedNullOrForbidden(TargetIndex.A).WithProgressBarToilDelay(TargetIndex.A, false, -0.5f)); }
protected override IEnumerable <Toil> MakeNewToils() { //Conditions and reserve this.FailOn(delegate() { return(TargetThingA is Building_GrowerBase vat && vat.status != CrafterStatus.Filling); }); this.FailOnDestroyedNullOrForbidden(TargetIndex.A); this.FailOnDestroyedNullOrForbidden(TargetIndex.B); yield return(Toils_Reserve.Reserve(TargetIndex.A)); Toil reserveIngredient = Toils_Reserve.Reserve(TargetIndex.B); yield return(reserveIngredient); //Go and get the thing to carry. yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.OnCell)); Toil carryThing = Toils_Haul.StartCarryThing(TargetIndex.B, subtractNumTakenFromJobCount: true); carryThing.AddFinishAction( delegate() { Building_GrowerBase grower = TargetThingA as Building_GrowerBase; if (grower != null) { grower.Notify_StartedCarryThing(GetActor()); } }); yield return(carryThing); //Opportunistically haul a nearby ingredient of same ThingDef. Checks 8 square radius. yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveIngredient, TargetIndex.B, TargetIndex.None, takeFromValidStorage: true)); yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.InteractionCell)); yield return(Toils_General.WaitWith(TargetIndex.A, 100, true)); yield return(new Toil() { initAction = delegate() { Building_GrowerBase grower = TargetThingA as Building_GrowerBase; if (grower != null) { grower.FillThing(GetActor().carryTracker.CarriedThing); } } }); }
protected override IEnumerable <Toil> MakeNewToils() { CompUniversalFermenter comp = Fermenter.TryGetComp <CompUniversalFermenter>(); // Verify fermenter and ingredient validity this.FailOnDespawnedNullOrForbidden(FermenterInd); this.FailOnBurningImmobile(FermenterInd); base.AddEndCondition(delegate { if (comp.SpaceLeftForIngredient > 0) { return(JobCondition.Ongoing); } return(JobCondition.Succeeded); }); yield return(Toils_General.DoAtomic(delegate { job.count = comp.SpaceLeftForIngredient; })); // Creating the toil before yielding allows for CheckForGetOpportunityDuplicate Toil reserveIngredient = Toils_Reserve.Reserve(IngredientInd); yield return(reserveIngredient); yield return(Toils_Goto.GotoThing(IngredientInd, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(IngredientInd).FailOnSomeonePhysicallyInteracting(IngredientInd)); yield return(Toils_Haul.StartCarryThing(IngredientInd, false, true, false).FailOnDestroyedNullOrForbidden(IngredientInd)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveIngredient, IngredientInd, TargetIndex.None, true)); // Carry ingredients to the fermenter yield return(Toils_Goto.GotoThing(FermenterInd, PathEndMode.Touch)); // Add delay for adding ingredients to the fermenter yield return(Toils_General.Wait(Duration, FermenterInd).FailOnDestroyedNullOrForbidden(IngredientInd).FailOnDestroyedNullOrForbidden(FermenterInd) .FailOnCannotTouch(FermenterInd, PathEndMode.Touch).WithProgressBarToilDelay(FermenterInd, false, -0.5f)); // Use ingredients // The UniversalFermenter automatically destroys held ingredients yield return(new Toil { initAction = delegate() { comp.AddIngredient(Ingredient); }, defaultCompleteMode = ToilCompleteMode.Instant }); }
protected override IEnumerable <Toil> MakeNewToils() { this.startingPos = Refuelable.Position; this.FailOnDespawnedNullOrForbidden(TargetIndex.A); base.AddEndCondition(delegate { if (Refuelable.needs.rest.CurLevel < 0.9 || (Refuelable == pawn && pawn.Position != startingPos && pawn.CanReach(startingPos, PathEndMode.OnCell, Danger.Deadly))) { return(JobCondition.Ongoing); } return(JobCondition.Succeeded); }); yield return(Toils_General.DoAtomic(delegate { this.job.count = Convert.ToInt32((Refuelable.needs.rest.MaxLevel - Refuelable.needs.rest.CurLevel) * 10); }).FailOn(() => job.count == 0)); //base.AddFailCondition(() => !this.job.playerForced); Toil reserveFuel = Toils_Reserve.Reserve(TargetIndex.B, 1, -1, null); yield return(reserveFuel); yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.ClosestTouch).FailOnDespawnedNullOrForbidden(TargetIndex.B).FailOnSomeonePhysicallyInteracting(TargetIndex.B)); yield return(Toils_Haul.StartCarryThing(TargetIndex.B, false, true, false).FailOnDestroyedNullOrForbidden(TargetIndex.B)); yield return(Toils_Haul.CheckForGetOpportunityDuplicate(reserveFuel, TargetIndex.B, TargetIndex.None, true, null)); yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch)); yield return(Toils_General.Wait(240, TargetIndex.None).FailOnDestroyedNullOrForbidden(TargetIndex.B).FailOnDestroyedNullOrForbidden(TargetIndex.A).FailOnCannotTouch(TargetIndex.A, PathEndMode.Touch).WithProgressBarToilDelay(TargetIndex.A, false, -0.5f)); Toil toil = new Toil(); toil.initAction = delegate() { //Log.Message($"current rest: {Refuelable.needs.rest.CurLevel} stackcount: {Fuel.stackCount} calced {(Fuel.stackCount / 100f)}"); Refuelable.needs.rest.CurLevel += (Fuel.stackCount / 10f); Fuel.Destroy(); }; toil.defaultCompleteMode = ToilCompleteMode.Instant; yield return(toil); yield return(Toils_Goto.GotoCell(startingPos, PathEndMode.OnCell).FailOn(() => this.pawn != Refuelable)); yield break; }