protected override IEnumerable <Toil> MakeNewToils()
        {
            IntVec3 centercell;

            if (!DropCellFinder.TryFindDropSpotNear(this.pawn.Position, this.Map, out centercell, true, false))
            {
                yield break;
            }
            else
            {
                yield return(Toils_Goto.GotoCell(centercell, PathEndMode.OnCell));

                Toil summoning = new Toil();
                summoning.defaultCompleteMode = ToilCompleteMode.Delay;
                summoning.defaultDuration     = 10000;
                summoning.tickAction          = delegate
                {
                    List <Pawn> list = this.Map.mapPawns.AllPawnsSpawned.FindAll(x => x.CurJob.def == C_JobDefOf.SummoningTribute);
                    if (list.Count <= 0)
                    {
                        this.EndJobWith(JobCondition.InterruptForced);
                    }
                };
                yield return(summoning);

                this.AddFinishAction(delegate
                {
                    DemonUtilities.FinishedSummoningRitual(this.pawn);
                });
            }
        }
コード例 #2
0
 public override void TickRare()
 {
     //         Log.Message("Ticking");
     base.TickRare();
     if (Rand.Range(0f, 1f) > 0.9f)
     {
         Pawn demon = DemonUtilities.GenerateDemon();
         GenSpawn.Spawn(demon, this.Position, this.Map);
         spawnedGroup.Add(demon);
     }
     if (spawnedGroup.Count > 5)
     {
         LordMaker.MakeNewLord(chaos, new LordJob_AssaultColony(chaos, false, false, false, true, false), this.Map, spawnedGroup.AsEnumerable <Pawn>());
         spawnedGroup.Clear();
     }
 }
コード例 #3
0
        public override void CompPostMake()
        {
            base.CompPostMake();

            this.Demon = DemonUtilities.GenerateDemon();
        }