static bool Prefix(ref IEnumerable <Toil> __result, JobDriver_LayEgg __instance) { __result = new List <Toil> { Toils_Goto.GotoCell(TargetIndex.A, PathEndMode.OnCell), new Toil { defaultCompleteMode = ToilCompleteMode.Delay, defaultDuration = 500 }, new Toil { initAction = delegate { Pawn actor = __instance.pawn; Thing egg = GenSpawn.Spawn(actor.GetComp <CompEggLayer>().ProduceEgg(), actor.Position, __instance.pawn.Map); if (actor.Faction == null || actor.Faction != Faction.OfPlayerSilentFail) { egg.SetForbiddenIfOutsideHomeArea(); } }, defaultCompleteMode = ToilCompleteMode.Instant } }; return(false); }
static bool Prefix(ref IEnumerable <Toil> __result, JobDriver_LayEgg __instance) { __result = new List <Toil> { Toils_Goto.GotoCell(TargetIndex.A, PathEndMode.OnCell), Toils_General.Wait(500), Toils_General.Do(delegate { Pawn actor = __instance.pawn; Thing egg = GenSpawn.Spawn(actor.GetComp <CompEggLayer>().ProduceEgg(), actor.Position, __instance.pawn.Map); if (actor.Faction == null || actor.Faction != Faction.OfPlayerSilentFail) { egg.SetForbiddenIfOutsideHomeArea(); } }), }; return(false); }