コード例 #1
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));

            Toil toil = Toils_General.WaitWith(TargetIndex.A, 500);

            toil.tickAction = delegate
            {
                if (pawn.IsHashIntervalTick(100))
                {
                    MoteMaker.ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart);
                }
                if (Female.IsHashIntervalTick(100))
                {
                    MoteMaker.ThrowMetaIcon(Female.Position, pawn.Map, ThingDefOf.Mote_Heart);
                }
            };
            yield return(toil);

            yield return(Toils_General.Do(delegate
            {
                PawnUtility.Mated(pawn, Female);
            }));
        }
コード例 #2
0
            public bool MoveNext()
            {
                uint num = (uint)this.$PC;

                this.$PC = -1;
                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:
                    prepare            = Toils_General.WaitWith(TargetIndex.A, 500, false, false);
                    prepare.tickAction = delegate()
                    {
                        if (this.pawn.IsHashIntervalTick(100))
                        {
                            MoteMaker.ThrowMetaIcon(this.pawn.Position, this.pawn.Map, ThingDefOf.Mote_Heart);
                        }
                        if (base.Female.IsHashIntervalTick(100))
                        {
                            MoteMaker.ThrowMetaIcon(base.Female.Position, this.pawn.Map, ThingDefOf.Mote_Heart);
                        }
                    };
                    this.$current = prepare;
                    if (!this.$disposing)
                    {
                        this.$PC = 2;
                    }
                    return(true);

                case 2u:
                    this.$current = Toils_General.Do(delegate
                    {
                        PawnUtility.Mated(this.pawn, base.Female);
                    });
                    if (!this.$disposing)
                    {
                        this.$PC = 3;
                    }
                    return(true);

                case 3u:
                    this.$PC = -1;
                    break;
                }
                return(false);
            }