Пример #1
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            this.FailOnDespawnedOrNull(TargetIndex.A);
            yield return(Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A));

            yield return(this.InsultingSpreeDelayToil());

            yield return(Toils_Interpersonal.WaitToBeAbleToInteract(this.pawn));

            Toil finalGoto = Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A);

            finalGoto.socialMode = RandomSocialMode.Off;
            yield return(finalGoto);

            yield return(this.InteractToil());
        }
Пример #2
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            this.FailOnAggroMentalState(TargetIndex.A);
            yield return(Toils_Interpersonal.GotoPrisoner(pawn, Victim, PrisonerInteractionModeDefOf.Execution).FailOn(() => !Victim.IsPrisonerOfColony || !Victim.guest.PrisonerIsSecure));

            Toil execute = new Toil();

            execute.initAction = delegate
            {
                ExecutionUtility.DoExecutionByCut(execute.actor, Victim);
                ThoughtUtility.GiveThoughtsForPawnExecuted(Victim, PawnExecutionKind.GenericBrutal);
                TaleRecorder.RecordTale(TaleDefOf.ExecutedPrisoner, pawn, Victim);
            };
            execute.defaultCompleteMode = ToilCompleteMode.Instant;
            yield return(execute);
        }
        protected override IEnumerable <Toil> MakeNewToils()
        {
            this.FailOnDespawnedNullOrForbidden(TargetIndex.A);
            this.FailOnDowned(TargetIndex.A);
            this.FailOnNotCasualInterruptible(TargetIndex.A);
            yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch));

            yield return(Toils_Interpersonal.WaitToBeAbleToInteract(this.pawn));

            yield return(Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A));

            yield return(JobDriver_InteractAnimal.TalkToAnimal(TargetIndex.A));

            yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch));

            yield return(Toils_Interpersonal.WaitToBeAbleToInteract(this.pawn));

            yield return(Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A));

            yield return(JobDriver_InteractAnimal.TalkToAnimal(TargetIndex.A));

            foreach (Toil t in this.FeedToils())
            {
                yield return(t);
            }
            yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch));

            yield return(Toils_Interpersonal.WaitToBeAbleToInteract(this.pawn));

            yield return(Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A));

            yield return(JobDriver_InteractAnimal.TalkToAnimal(TargetIndex.A));

            foreach (Toil t2 in this.FeedToils())
            {
                yield return(t2);
            }
            yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch));

            yield return(Toils_Interpersonal.SetLastInteractTime(TargetIndex.A));

            yield return(Toils_Interpersonal.WaitToBeAbleToInteract(this.pawn));

            yield return(Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A));

            yield return(this.FinalInteractToil());
        }
Пример #4
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            this.FailOnDespawnedNullOrForbidden(TargetIndex.A);
            this.FailOnDowned(TargetIndex.A);
            this.FailOnNotCasualInterruptible(TargetIndex.A);
            yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch));

            yield return(Toils_Interpersonal.WaitToBeAbleToInteract(pawn));

            yield return(Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A));

            yield return(TalkToAnimal(TargetIndex.A));

            yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch));

            yield return(Toils_Interpersonal.WaitToBeAbleToInteract(pawn));

            yield return(Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A));

            yield return(TalkToAnimal(TargetIndex.A));

            foreach (Toil item in FeedToils())
            {
                yield return(item);
            }
            yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch));

            yield return(Toils_Interpersonal.WaitToBeAbleToInteract(pawn));

            yield return(Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A));

            yield return(TalkToAnimal(TargetIndex.A));

            foreach (Toil item2 in FeedToils())
            {
                yield return(item2);
            }
            yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch).FailOn(() => !CanInteractNow));

            yield return(Toils_Interpersonal.SetLastInteractTime(TargetIndex.A));

            yield return(Toils_Interpersonal.WaitToBeAbleToInteract(pawn));

            yield return(Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A));

            yield return(FinalInteractToil());
        }
            public bool MoveNext()
            {
                uint num = (uint)this.$PC;

                this.$PC = -1;
                switch (num)
                {
                case 0u:
                    this.FailOnDespawnedNullOrForbidden(TargetIndex.A);
                    this.FailOnNotCasualInterruptible(TargetIndex.A);
                    this.$current = Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch);
                    if (!this.$disposing)
                    {
                        this.$PC = 1;
                    }
                    return(true);

                case 1u:
                    this.$current = Toils_Interpersonal.WaitToBeAbleToInteract(this.pawn);
                    if (!this.$disposing)
                    {
                        this.$PC = 2;
                    }
                    return(true);

                case 2u:
                    gotoTarget            = Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch);
                    gotoTarget.socialMode = RandomSocialMode.Off;
                    wait            = Toils_General.WaitWith(TargetIndex.A, 100, false, true);
                    wait.socialMode = RandomSocialMode.Off;
                    this.$current   = Toils_General.Do(delegate
                    {
                        Pawn recipient = (Pawn)this.pawn.CurJob.targetA.Thing;
                        this.pawn.interactions.TryInteractWith(recipient, InteractionDefOf.Nuzzle);
                    });
                    if (!this.$disposing)
                    {
                        this.$PC = 3;
                    }
                    return(true);

                case 3u:
                    this.$PC = -1;
                    break;
                }
                return(false);
            }
        protected override IEnumerable <Toil> MakeNewToils()
        {
            this.FailOnDespawnedOrNull(TargetIndex.A);
            this.FailOnMentalState(TargetIndex.A);
            this.FailOnNotAwake(TargetIndex.A);
            this.FailOn(() => !this.$this.Talkee.IsPrisonerOfColony || !this.$this.Talkee.guest.PrisonerIsSecure);
            yield return(Toils_Interpersonal.GotoPrisoner(this.pawn, this.Talkee, this.Talkee.guest.interactionMode));

            yield return(Toils_Interpersonal.WaitToBeAbleToInteract(this.pawn));

            yield return(Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A));

            yield return(Toils_Interpersonal.ConvinceRecruitee(this.pawn, this.Talkee));

            yield return(Toils_Interpersonal.GotoPrisoner(this.pawn, this.Talkee, this.Talkee.guest.interactionMode));

            yield return(Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A));

            yield return(Toils_Interpersonal.ConvinceRecruitee(this.pawn, this.Talkee));

            yield return(Toils_Interpersonal.GotoPrisoner(this.pawn, this.Talkee, this.Talkee.guest.interactionMode));

            yield return(Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A));

            yield return(Toils_Interpersonal.ConvinceRecruitee(this.pawn, this.Talkee));

            yield return(Toils_Interpersonal.GotoPrisoner(this.pawn, this.Talkee, this.Talkee.guest.interactionMode));

            yield return(Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A));

            yield return(Toils_Interpersonal.ConvinceRecruitee(this.pawn, this.Talkee));

            yield return(Toils_Interpersonal.GotoPrisoner(this.pawn, this.Talkee, this.Talkee.guest.interactionMode));

            yield return(Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A));

            yield return(Toils_Interpersonal.ConvinceRecruitee(this.pawn, this.Talkee));

            yield return(Toils_Interpersonal.GotoPrisoner(this.pawn, this.Talkee, this.Talkee.guest.interactionMode));

            yield return(Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A).FailOn(() => !this.$this.Talkee.guest.ScheduledForInteraction));

            yield return(Toils_Interpersonal.SetLastInteractTime(TargetIndex.A));

            yield return(Toils_Interpersonal.TryRecruit(TargetIndex.A));
        }
        protected override IEnumerable <Toil> MakeNewToils()
        {
            this.FailOnDespawnedNullOrForbidden(TargetIndex.A);
            this.FailOn(() => !this.Patient.InBed() || !this.Patient.Awake());
            if (this.Chair != null)
            {
                this.FailOnDespawnedNullOrForbidden(TargetIndex.B);
            }
            if (this.Chair != null)
            {
                yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.OnCell));
            }
            else
            {
                yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.InteractionCell));
            }
            yield return(Toils_Interpersonal.WaitToBeAbleToInteract(this.pawn));

            yield return(new Toil
            {
                tickAction = delegate()
                {
                    this.Patient.needs.joy.GainJoy(this.job.def.joyGainRate * 0.000144f, this.job.def.joyKind);
                    if (this.pawn.IsHashIntervalTick(320))
                    {
                        InteractionDef intDef = (Rand.Value >= 0.8f) ? InteractionDefOf.DeepTalk : InteractionDefOf.Chitchat;
                        this.pawn.interactions.TryInteractWith(this.Patient, intDef);
                    }
                    this.pawn.rotationTracker.FaceCell(this.Patient.Position);
                    this.pawn.GainComfortFromCellIfPossible();
                    JoyUtility.JoyTickCheckEnd(this.pawn, JoyTickFullJoyAction.None, 1f, null);
                    if (this.pawn.needs.joy.CurLevelPercentage > 0.9999f && this.Patient.needs.joy.CurLevelPercentage > 0.9999f)
                    {
                        this.pawn.jobs.EndCurrentJob(JobCondition.Succeeded, true);
                    }
                },
                handlingFacing = true,
                socialMode = RandomSocialMode.Off,
                defaultCompleteMode = ToilCompleteMode.Delay,
                defaultDuration = this.job.def.joyDuration
            });

            yield break;
        }
			public bool MoveNext()
			{
				uint num = (uint)this.$PC;
				this.$PC = -1;
				switch (num)
				{
				case 0u:
					this.FailOnDespawnedOrNull(TargetIndex.A);
					this.$current = Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A);
					if (!this.$disposing)
					{
						this.$PC = 1;
					}
					return true;
				case 1u:
					this.$current = Toils_Interpersonal.WaitToBeAbleToInteract(this.pawn);
					if (!this.$disposing)
					{
						this.$PC = 2;
					}
					return true;
				case 2u:
					finalGoto = Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A);
					finalGoto.socialMode = RandomSocialMode.Off;
					this.$current = finalGoto;
					if (!this.$disposing)
					{
						this.$PC = 3;
					}
					return true;
				case 3u:
					this.$current = Toils_Interpersonal.Interact(TargetIndex.A, this.job.interaction);
					if (!this.$disposing)
					{
						this.$PC = 4;
					}
					return true;
				case 4u:
					this.$PC = -1;
					break;
				}
				return false;
			}
Пример #9
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            this.FailOnDespawnedNullOrForbidden(TargetIndex.A);
            this.FailOnNotCasualInterruptible(TargetIndex.A);
            yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch));

            yield return(Toils_Interpersonal.WaitToBeAbleToInteract(this.pawn));

            Toil gotoTarget = Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch);

            gotoTarget.socialMode = RandomSocialMode.Off;
            Toil wait = Toils_General.WaitWith(TargetIndex.A, 100, false, true);

            wait.socialMode = RandomSocialMode.Off;
            yield return(Toils_General.Do(delegate
            {
                Pawn recipient = (Pawn)this.$this.pawn.CurJob.targetA.Thing;
                this.$this.pawn.interactions.TryInteractWith(recipient, InteractionDefOf.Nuzzle);
            }));
        }
 protected override Toil FinalInteractToil()
 {
     return(Toils_Interpersonal.TryRecruit(TargetIndex.A));
 }
            public bool MoveNext()
            {
                uint num = (uint)this.$PC;

                this.$PC = -1;
                switch (num)
                {
                case 0u:
                    this.FailOnDespawnedOrNull(TargetIndex.A);
                    this.FailOnMentalState(TargetIndex.A);
                    this.FailOnNotAwake(TargetIndex.A);
                    this.FailOn(() => !base.Talkee.IsPrisonerOfColony || !base.Talkee.guest.PrisonerIsSecure);
                    this.$current = Toils_Interpersonal.GotoPrisoner(this.pawn, base.Talkee, base.Talkee.guest.interactionMode);
                    if (!this.$disposing)
                    {
                        this.$PC = 1;
                    }
                    return(true);

                case 1u:
                    this.$current = Toils_Interpersonal.WaitToBeAbleToInteract(this.pawn);
                    if (!this.$disposing)
                    {
                        this.$PC = 2;
                    }
                    return(true);

                case 2u:
                    this.$current = Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A);
                    if (!this.$disposing)
                    {
                        this.$PC = 3;
                    }
                    return(true);

                case 3u:
                    this.$current = Toils_Interpersonal.ConvinceRecruitee(this.pawn, base.Talkee);
                    if (!this.$disposing)
                    {
                        this.$PC = 4;
                    }
                    return(true);

                case 4u:
                    this.$current = Toils_Interpersonal.GotoPrisoner(this.pawn, base.Talkee, base.Talkee.guest.interactionMode);
                    if (!this.$disposing)
                    {
                        this.$PC = 5;
                    }
                    return(true);

                case 5u:
                    this.$current = Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A);
                    if (!this.$disposing)
                    {
                        this.$PC = 6;
                    }
                    return(true);

                case 6u:
                    this.$current = Toils_Interpersonal.ConvinceRecruitee(this.pawn, base.Talkee);
                    if (!this.$disposing)
                    {
                        this.$PC = 7;
                    }
                    return(true);

                case 7u:
                    this.$current = Toils_Interpersonal.GotoPrisoner(this.pawn, base.Talkee, base.Talkee.guest.interactionMode);
                    if (!this.$disposing)
                    {
                        this.$PC = 8;
                    }
                    return(true);

                case 8u:
                    this.$current = Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A);
                    if (!this.$disposing)
                    {
                        this.$PC = 9;
                    }
                    return(true);

                case 9u:
                    this.$current = Toils_Interpersonal.ConvinceRecruitee(this.pawn, base.Talkee);
                    if (!this.$disposing)
                    {
                        this.$PC = 10;
                    }
                    return(true);

                case 10u:
                    this.$current = Toils_Interpersonal.GotoPrisoner(this.pawn, base.Talkee, base.Talkee.guest.interactionMode);
                    if (!this.$disposing)
                    {
                        this.$PC = 11;
                    }
                    return(true);

                case 11u:
                    this.$current = Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A);
                    if (!this.$disposing)
                    {
                        this.$PC = 12;
                    }
                    return(true);

                case 12u:
                    this.$current = Toils_Interpersonal.ConvinceRecruitee(this.pawn, base.Talkee);
                    if (!this.$disposing)
                    {
                        this.$PC = 13;
                    }
                    return(true);

                case 13u:
                    this.$current = Toils_Interpersonal.GotoPrisoner(this.pawn, base.Talkee, base.Talkee.guest.interactionMode);
                    if (!this.$disposing)
                    {
                        this.$PC = 14;
                    }
                    return(true);

                case 14u:
                    this.$current = Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A);
                    if (!this.$disposing)
                    {
                        this.$PC = 15;
                    }
                    return(true);

                case 15u:
                    this.$current = Toils_Interpersonal.ConvinceRecruitee(this.pawn, base.Talkee);
                    if (!this.$disposing)
                    {
                        this.$PC = 16;
                    }
                    return(true);

                case 16u:
                    this.$current = Toils_Interpersonal.GotoPrisoner(this.pawn, base.Talkee, base.Talkee.guest.interactionMode);
                    if (!this.$disposing)
                    {
                        this.$PC = 17;
                    }
                    return(true);

                case 17u:
                    this.$current = Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A);
                    if (!this.$disposing)
                    {
                        this.$PC = 18;
                    }
                    return(true);

                case 18u:
                    this.$current = Toils_Interpersonal.SetLastInteractTime(TargetIndex.A);
                    if (!this.$disposing)
                    {
                        this.$PC = 19;
                    }
                    return(true);

                case 19u:
                    if (this.job.def == JobDefOf.PrisonerAttemptRecruit)
                    {
                        this.$current = Toils_Interpersonal.TryRecruit(TargetIndex.A);
                        if (!this.$disposing)
                        {
                            this.$PC = 20;
                        }
                        return(true);
                    }
                    break;

                case 20u:
                    break;

                default:
                    return(false);
                }
                this.$PC = -1;
                return(false);
            }
Пример #12
0
            public bool MoveNext()
            {
                uint num = (uint)this.$PC;

                this.$PC = -1;
                bool flag = false;

                switch (num)
                {
                case 0u:
                    this.FailOnDespawnedNullOrForbidden(TargetIndex.A);
                    this.FailOnDowned(TargetIndex.A);
                    this.FailOnNotCasualInterruptible(TargetIndex.A);
                    this.$current = Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch);
                    if (!this.$disposing)
                    {
                        this.$PC = 1;
                    }
                    return(true);

                case 1u:
                    this.$current = Toils_Interpersonal.WaitToBeAbleToInteract(this.pawn);
                    if (!this.$disposing)
                    {
                        this.$PC = 2;
                    }
                    return(true);

                case 2u:
                    this.$current = Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A);
                    if (!this.$disposing)
                    {
                        this.$PC = 3;
                    }
                    return(true);

                case 3u:
                    this.$current = JobDriver_InteractAnimal.TalkToAnimal(TargetIndex.A);
                    if (!this.$disposing)
                    {
                        this.$PC = 4;
                    }
                    return(true);

                case 4u:
                    this.$current = Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch);
                    if (!this.$disposing)
                    {
                        this.$PC = 5;
                    }
                    return(true);

                case 5u:
                    this.$current = Toils_Interpersonal.WaitToBeAbleToInteract(this.pawn);
                    if (!this.$disposing)
                    {
                        this.$PC = 6;
                    }
                    return(true);

                case 6u:
                    this.$current = Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A);
                    if (!this.$disposing)
                    {
                        this.$PC = 7;
                    }
                    return(true);

                case 7u:
                    this.$current = JobDriver_InteractAnimal.TalkToAnimal(TargetIndex.A);
                    if (!this.$disposing)
                    {
                        this.$PC = 8;
                    }
                    return(true);

                case 8u:
                    enumerator = base.FeedToils().GetEnumerator();
                    num        = 4294967293u;
                    break;

                case 9u:
                    break;

                case 10u:
                    this.$current = Toils_Interpersonal.WaitToBeAbleToInteract(this.pawn);
                    if (!this.$disposing)
                    {
                        this.$PC = 11;
                    }
                    return(true);

                case 11u:
                    this.$current = Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A);
                    if (!this.$disposing)
                    {
                        this.$PC = 12;
                    }
                    return(true);

                case 12u:
                    this.$current = JobDriver_InteractAnimal.TalkToAnimal(TargetIndex.A);
                    if (!this.$disposing)
                    {
                        this.$PC = 13;
                    }
                    return(true);

                case 13u:
                    enumerator2 = base.FeedToils().GetEnumerator();
                    num         = 4294967293u;
                    goto Block_15;

                case 14u:
                    goto IL_2E4;

                case 15u:
                    this.$current = Toils_Interpersonal.SetLastInteractTime(TargetIndex.A);
                    if (!this.$disposing)
                    {
                        this.$PC = 16;
                    }
                    return(true);

                case 16u:
                    this.$current = Toils_Interpersonal.WaitToBeAbleToInteract(this.pawn);
                    if (!this.$disposing)
                    {
                        this.$PC = 17;
                    }
                    return(true);

                case 17u:
                    this.$current = Toils_Interpersonal.GotoInteractablePosition(TargetIndex.A);
                    if (!this.$disposing)
                    {
                        this.$PC = 18;
                    }
                    return(true);

                case 18u:
                    this.$current = this.FinalInteractToil();
                    if (!this.$disposing)
                    {
                        this.$PC = 19;
                    }
                    return(true);

                case 19u:
                    this.$PC = -1;
                    return(false);

                default:
                    return(false);
                }
                try
                {
                    switch (num)
                    {
                    }
                    if (enumerator.MoveNext())
                    {
                        t             = enumerator.Current;
                        this.$current = t;
                        if (!this.$disposing)
                        {
                            this.$PC = 9;
                        }
                        flag = true;
                        return(true);
                    }
                }
                finally
                {
                    if (!flag)
                    {
                        if (enumerator != null)
                        {
                            enumerator.Dispose();
                        }
                    }
                }
                this.$current = Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch);
                if (!this.$disposing)
                {
                    this.$PC = 10;
                }
                return(true);

Block_15:
                try
                {
IL_2E4:
                    switch (num)
                    {
                    }
                    if (enumerator2.MoveNext())
                    {
                        t2            = enumerator2.Current;
                        this.$current = t2;
                        if (!this.$disposing)
                        {
                            this.$PC = 14;
                        }
                        flag = true;
                        return(true);
                    }
                }
                finally
                {
                    if (!flag)
                    {
                        if (enumerator2 != null)
                        {
                            enumerator2.Dispose();
                        }
                    }
                }
                this.$current = Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch);
                if (!this.$disposing)
                {
                    this.$PC = 15;
                }
                return(true);
            }
            public bool MoveNext()
            {
                uint num = (uint)this.$PC;

                this.$PC = -1;
                switch (num)
                {
                case 0u:
                    this.FailOnDespawnedNullOrForbidden(TargetIndex.A);
                    this.FailOn(() => !base.Patient.InBed() || !base.Patient.Awake());
                    if (base.Chair != null)
                    {
                        this.FailOnDespawnedNullOrForbidden(TargetIndex.B);
                    }
                    if (base.Chair != null)
                    {
                        this.$current = Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.OnCell);
                        if (!this.$disposing)
                        {
                            this.$PC = 1;
                        }
                        return(true);
                    }
                    this.$current = Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.InteractionCell);
                    if (!this.$disposing)
                    {
                        this.$PC = 2;
                    }
                    return(true);

                case 1u:
                    break;

                case 2u:
                    break;

                case 3u:
                {
                    Toil waitAndTalk = new Toil();
                    waitAndTalk.tickAction = delegate()
                    {
                        base.Patient.needs.joy.GainJoy(this.job.def.joyGainRate * 0.000144f, this.job.def.joyKind);
                        if (this.pawn.IsHashIntervalTick(320))
                        {
                            InteractionDef intDef = (Rand.Value >= 0.8f) ? InteractionDefOf.DeepTalk : InteractionDefOf.Chitchat;
                            this.pawn.interactions.TryInteractWith(base.Patient, intDef);
                        }
                        this.pawn.rotationTracker.FaceCell(base.Patient.Position);
                        this.pawn.GainComfortFromCellIfPossible();
                        JoyUtility.JoyTickCheckEnd(this.pawn, JoyTickFullJoyAction.None, 1f, null);
                        if (this.pawn.needs.joy.CurLevelPercentage > 0.9999f && base.Patient.needs.joy.CurLevelPercentage > 0.9999f)
                        {
                            this.pawn.jobs.EndCurrentJob(JobCondition.Succeeded, true);
                        }
                    };
                    waitAndTalk.handlingFacing      = true;
                    waitAndTalk.socialMode          = RandomSocialMode.Off;
                    waitAndTalk.defaultCompleteMode = ToilCompleteMode.Delay;
                    waitAndTalk.defaultDuration     = this.job.def.joyDuration;
                    this.$current = waitAndTalk;
                    if (!this.$disposing)
                    {
                        this.$PC = 4;
                    }
                    return(true);
                }

                case 4u:
                    this.$PC = -1;
                    return(false);

                default:
                    return(false);
                }
                this.$current = Toils_Interpersonal.WaitToBeAbleToInteract(this.pawn);
                if (!this.$disposing)
                {
                    this.$PC = 3;
                }
                return(true);
            }