protected override Verse.AI.Job TryGiveJob(Pawn pawn) { if (pawn.Downed) { return(null); } var need = pawn.needs.TryGetNeed <PartEnergyNeed>(); if (need == null || !need.CanBeSatisfied || !need.SeekSatisfaction) { return(null); } var result = ChargeSourceUtility.ClosestChargeSource(pawn); return(result != null ? new Verse.AI.Job(CyberizationDefOf.SeekPartPower, result) : null); }
protected override void Update() { _needPower = PartPowerUsers.Where(pawn => ChargeSourceUtility.ClosestChargeSource(pawn) == null).ToList(); _needPowerLive = _needPower.Where(PartUtility.RequiresPartsToLive <AddedPartPowerConsumer>).ToList(); _needPowerMove = _needPower.Where(PartUtility.RequiresPartsForMovement <AddedPartPowerConsumer>).ToList(); }