コード例 #1
0
        public void EffectersTick()
        {
            List <Hediff> hediffs = this.pawn.health.hediffSet.hediffs;

            for (int i = 0; i < hediffs.Count; i++)
            {
                HediffComp_Effecter hediffComp_Effecter = hediffs[i].TryGetComp <HediffComp_Effecter>();
                if (hediffComp_Effecter != null)
                {
                    EffecterDef effecterDef = hediffComp_Effecter.CurrentStateEffecter();
                    if (effecterDef != null)
                    {
                        this.AddOrMaintain(effecterDef);
                    }
                }
            }
            if (this.pawn.mindState.mentalStateHandler.CurState != null)
            {
                EffecterDef effecterDef2 = this.pawn.mindState.mentalStateHandler.CurState.CurrentStateEffecter();
                if (effecterDef2 != null)
                {
                    this.AddOrMaintain(effecterDef2);
                }
            }
            for (int j = this.pairs.Count - 1; j >= 0; j--)
            {
                if (this.pairs[j].Expired)
                {
                    this.pairs[j].Cleanup();
                    this.pairs.RemoveAt(j);
                }
                else
                {
                    this.pairs[j].Tick(this.pawn);
                }
            }
        }
コード例 #2
0
        public void EffectersTick()
        {
            List <Hediff> hediffs = pawn.health.hediffSet.hediffs;

            for (int i = 0; i < hediffs.Count; i++)
            {
                HediffComp_Effecter hediffComp_Effecter = hediffs[i].TryGetComp <HediffComp_Effecter>();
                if (hediffComp_Effecter != null)
                {
                    EffecterDef effecterDef = hediffComp_Effecter.CurrentStateEffecter();
                    if (effecterDef != null)
                    {
                        AddOrMaintain(effecterDef);
                    }
                }
            }
            if (pawn.mindState.mentalStateHandler.CurState != null)
            {
                EffecterDef effecterDef2 = pawn.mindState.mentalStateHandler.CurState.CurrentStateEffecter();
                if (effecterDef2 != null)
                {
                    AddOrMaintain(effecterDef2);
                }
            }
            for (int num = pairs.Count - 1; num >= 0; num--)
            {
                if (pairs[num].Expired)
                {
                    pairs[num].Cleanup();
                    pairs.RemoveAt(num);
                }
                else
                {
                    pairs[num].Tick(pawn);
                }
            }
        }