Exemple #1
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            this.FailOnDestroyedOrNull(TargetIndex.A);
            this.SetCompleteMode(ToilCompleteMode.Never);
            yield return(Toils_Reserve.Reserve(TargetIndex.A, 1));

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

            Toil      toil        = new Toil();
            Texture2D deitySymbol = ((CosmicEntityDef)DropAltar.currentOfferingDeity.def).Symbol;

            toil.PlaySustainerOrSound(CultDefOfs.RitualChanting);
            toil.initAction = delegate
            {
                this.workLeft = 2300f;
                if (deitySymbol != null)
                {
                    MoteMaker.MakeInteractionMote(this.pawn, null, ThingDefOf.Mote_Speech, deitySymbol);
                }
            };
            toil.tickAction = delegate
            {
                this.workLeft -= 1;
                if (this.workLeft <= 0f)
                {
                    //Thing thing = ThingMaker.MakeThing(ThingDefOf.Snowman, null);
                    //thing.SetFaction(this.<> f__this.pawn.Faction, null);
                    //GenSpawn.Spawn(thing, this.<> f__this.TargetLocA);
                    this.ReadyForNextToil();
                    return;
                }
                JoyUtility.JoyTickCheckEnd(this.pawn, JoyTickFullJoyAction.EndJob, 1f);
            };
            toil.WithProgressBar(TargetIndex.A, () => this.workLeft / this.BaseWorkAmount, true, -0.5f);
            toil.defaultCompleteMode = ToilCompleteMode.Never;
            //toil.FailOn(() => !JoyUtility.EnjoyableOutsideNow(this.<> f__this.pawn, null));
            yield return(toil);

            yield break;
        }