//public override string GetReport()
        //{
        //    //if (job?.plantDefToSow == null) return base.GetReport();
        //    return "JobDineGoReport".Translate();
        //}

        protected override IEnumerable <Toil> MakeNewToils()
        {
            var wait = Toils_General.Wait(50, IndexSpot).FailOnNotDiningQueued(IndexPatron);
            var end  = Toils_General.Wait(5);

            this.FailOnNotDiningQueued(IndexPatron);                                      // Careful never to use B for something else

            yield return(Toils_Waiting.FindRandomAdjacentCell(IndexSpot, IndexStanding)); // A is first the dining spot, then where we'll stand

            yield return(Toils_Goto.GotoCell(IndexStanding, PathEndMode.OnCell).FailOnRestaurantClosed());

            yield return(Toils_Interpersonal.WaitToBeAbleToInteract(pawn));

            yield return(wait);

            yield return(Toils_Jump.JumpIf(wait, () => !(Patron?.jobs.curDriver is JobDriver_Dine))); // Not dining right now

            yield return(Toils_Waiting.GetDiningSpot(IndexPatron, IndexSpot));                        // A is dining spot again now

            yield return(Toils_Waiting.GetSpecificDiningSpotCellForMakingTable(IndexSpot, IndexPatron, IndexChairPos));

            yield return(Toils_Waiting.TakeOrder(IndexPatron));

            yield return(Toils_Interpersonal.SetLastInteractTime(IndexPatron));

            yield return(Toils_Jump.JumpIf(end, () => DiningSpot?.IsSpotReady(ChairPos) == true));

            yield return(Toils_Goto.GotoCell(IndexSpot, PathEndMode.ClosestTouch));

            yield return(Toils_Waiting.MakeTableReady(IndexSpot, IndexChairPos));

            yield return(end);
        }
Esempio n. 2
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            var begin = Toils_Waiting.GetRandomDiningSpotCellForMakingTable(IndexSpot, IndexInteractionCell);
            var end   = Toils_General.Wait(10, IndexSpot);

            this.FailOnDestroyedOrNull(IndexSpot);
            this.FailOnForbidden(IndexSpot);
            yield return(begin);

            yield return(Toils_Jump.JumpIf(end, () => pawn.CurJob?.GetTarget(IndexInteractionCell).IsValid == false));

            yield return(Toils_Goto.GotoThing(IndexInteractionCell, PathEndMode.OnCell).FailOnDespawnedNullOrForbidden(IndexInteractionCell));

            yield return(Toils_Waiting.MakeTableReady(IndexSpot, IndexInteractionCell));

            yield return(end);
        }