コード例 #1
0
 private IEnumerable <Pawn> AffectedPawns()
 {
     foreach (Pawn p in PawnsFinder.AllMaps_FreeColonists)
     {
         if (p.Dead)
         {
             Log.Error("Dead pawn in PawnsFinder.AllMaps_FreeColonists:" + p);
         }
         else if (!ThingOwnerUtility.ContentsFrozen(p.ParentHolder))
         {
             p.needs.mood.thoughts.GetAllMoodThoughts(Alert_Thought.tmpThoughts);
             try
             {
                 ThoughtDef requiredDef = this.Thought;
                 for (int i = 0; i < Alert_Thought.tmpThoughts.Count; i++)
                 {
                     if (Alert_Thought.tmpThoughts[i].def == requiredDef)
                     {
                         yield return(p);
                     }
                 }
             }
             finally
             {
                 base.< > __Finally0();
             }
         }
     }
 }
コード例 #2
0
        private IEnumerable <Pawn> AffectedPawns()
        {
            foreach (Pawn allMaps_FreeColonist in PawnsFinder.AllMaps_FreeColonists)
            {
                if (allMaps_FreeColonist.Dead)
                {
                    Log.Error("Dead pawn in PawnsFinder.AllMaps_FreeColonists:" + allMaps_FreeColonist);
                }
                else if (!ThingOwnerUtility.ContentsFrozen(allMaps_FreeColonist.ParentHolder))
                {
                    allMaps_FreeColonist.needs.mood.thoughts.GetAllMoodThoughts(Alert_Thought.tmpThoughts);
                    try
                    {
                        ThoughtDef requiredDef = this.Thought;
                        for (int i = 0; i < Alert_Thought.tmpThoughts.Count; i++)
                        {
                            if (Alert_Thought.tmpThoughts[i].def == requiredDef)
                            {
                                yield return(allMaps_FreeColonist);

                                /*Error: Unable to find new state assignment for yield return*/;
                            }
                        }
                    }
                    finally
                    {
                        ((_003CAffectedPawns_003Ec__Iterator0) /*Error near IL_015a: stateMachine*/)._003C_003E__Finally0();
                    }
                }
            }
            yield break;
IL_019a:
            /*Error near IL_019b: Unexpected return in MoveNext()*/;
        }
コード例 #3
0
 public static void MovableThing_Tick(this Thing thing)
 {
     if (!ThingOwnerUtility.ContentsFrozen(thing.ParentHolder) && thing is IMovableThing movableThing)
     {
         if (thing.Spawned)
         {
             movableThing?.Pather.PatherTick();
         }
         if (thing.Spawned)
         {
             movableThing?.Drawer.DrawTrackerTick();
             movableThing?.RotationTracker.RotationTrackerTick();
         }
     }
 }
コード例 #4
0
        public static void Patch_Pawn_Tick(Pawn __instance)
        {
            if (__instance.equipment != null && (__instance.ParentHolder != null && !ThingOwnerUtility.ContentsFrozen(__instance.ParentHolder)))
            {
                //Tick shield.
                ThingWithComps shield = __instance.GetShield();
                if (shield == null)
                {
                    return;
                }

                CompShield shieldComp = shield.GetComp <CompShield>();

                shield.Tick();
            }
        }
コード例 #5
0
ファイル: Zombie.cs プロジェクト: perkinslr/zombieland
        public void CustomTick()
        {
            if (!ThingOwnerUtility.ContentsFrozen(base.ParentHolder))
            {
                if (Spawned)
                {
                    if (pather != null)
                    {
                        pather.PatherTick();
                    }
                    if (jobs != null)
                    {
                        jobs.JobTrackerTick();
                    }
                    if (stances != null)
                    {
                        stances.StanceTrackerTick();
                    }
                    if (verbTracker != null)
                    {
                        verbTracker.VerbsTick();
                    }
                    if (natives != null)
                    {
                        natives.NativeVerbsTick();
                    }
                    Drawer.DrawTrackerTick();
                }

                if (health != null)
                {
                    health.HealthTick();
                }

                //if (!Dead && mindState != null)
                //	mindState.MindStateTick();
            }

            if (state == ZombieState.Emerging)
            {
                HandleRubble();
            }
        }
コード例 #6
0
ファイル: PawnAvali.cs プロジェクト: Ksisa/Avali-Continued
        public override void TickRare()
        {
            base.TickRare();
            if (!ThingOwnerUtility.ContentsFrozen(base.ParentHolder))
            {
                if (this.apparel != null)
                {
                    this.apparel.ApparelTrackerTickRare();
                }
                this.inventory.InventoryTrackerTickRare();
            }

            /*
             * if (base.Spawned && this.RaceProps.IsFlesh)
             * {
             *      GenTemperature.PushHeat(this, 0.3f * this.BodySize * 4.16666651f);
             * }
             */
        }