Пример #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);
                        }
                    }
                }
            }
        }
Пример #2
0
    public void GetTarget(Facehugger f)
    {
        float best       = 10000;
        Human bestTarget = null;

        players = GameObject.FindObjectsOfType <Human>();
        for (int i = 0; i < players.Length; i++)
        {
            if (!players[i].facehugged)
            {
                float d = Vector3.Distance(f.transform.position, players[i].transform.position);
                if (d < best)
                {
                    best                = d;
                    bestTarget          = players[i];
                    players[i].targeted = true;
                }
            }
        }

        f.target = bestTarget;
    }
Пример #3
0
 public void RemoveFaceHugger(Facehugger f)
 {
     facehuggers.Remove(f);
 }
Пример #4
0
 public void AddFaceHugger(Facehugger f)
 {
     facehuggers.Add(f);
 }