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); } } } } }
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; }
public void RemoveFaceHugger(Facehugger f) { facehuggers.Remove(f); }
public void AddFaceHugger(Facehugger f) { facehuggers.Add(f); }