Пример #1
0
        public override void CompTick()
        {
            if (Facehugger.Faction == null && Find.FactionManager.FirstFactionOfDef(XenomorphDefOf.RRY_Xenomorph) != null)
            {
                Facehugger.SetFaction(Find.FactionManager.FirstFactionOfDef(XenomorphDefOf.RRY_Xenomorph));
            }
            base.CompTick();
            this.ticksSinceHeal++;
            if (Impregnations >= maxImpregnations)
            {
                this.ticksSinceImpregnation++;
            }
            bool flag = this.ticksSinceHeal > this.healIntervalTicks;

            if (flag)
            {
                bool flag2 = Facehugger.health.hediffSet.HasNaturallyHealingInjury();
                if (flag2)
                {
                    float         num           = 4f;
                    Hediff_Injury hediff_Injury = GenCollection.RandomElement <Hediff_Injury>(from x in Facehugger.health.hediffSet.GetHediffs <Hediff_Injury>()
                                                                                              where HediffUtility.CanHealNaturally(x)
                                                                                              select x);
                    hediff_Injury.Heal(num * Facehugger.HealthScale * 0.01f);
                    string text = string.Format("{0} healed.", Facehugger.LabelCap);
                }
                if (Impregnations >= maxImpregnations)
                {
                    bool flag3 = this.ticksSinceImpregnation > this.deathIntervalTicks;
                    if (flag3)
                    {
                        this.ticksSinceImpregnation = 0;
                        if (Rand.Chance(0.5f))
                        {
                            Facehugger.Kill(null);
                        }
                    }
                }
            }
        }