Ejemplo n.º 1
0
        // Token: 0x0600041B RID: 1051 RVA: 0x0002C940 File Offset: 0x0002AD40
        protected override Job TryGiveJob(Pawn pawn)
        {
            Room room = pawn.GetRoom(RegionType.Set_Passable);
            int  num  = 0;

            while ((float)num < JobGiver_MaintainHiveLikes.CellsInScanRadius)
            {
                IntVec3 intVec = pawn.Position + GenRadial.RadialPattern[num];
                if (intVec.InBounds(pawn.Map))
                {
                    if (intVec.GetRoom(pawn.Map, RegionType.Set_Passable) == room)
                    {
                        HiveLike hivelike = (HiveLike)pawn.Map.thingGrid.ThingsListAt(intVec).Find(x => x.def.thingClass == typeof(AdeptusMechanicus.HiveLike));
                        if (hivelike != null && pawn.CanReserve(hivelike, 1, -1, null, false))
                        {
                            CompMaintainable compMaintainable = hivelike.TryGetComp <CompMaintainable>();
                            if (compMaintainable.CurStage != MaintainableStage.Healthy)
                            {
                                if (!this.onlyIfDamagingState || compMaintainable.CurStage == MaintainableStage.Damaging)
                                {
                                    return(new Job(JobDefOf.Maintain, hivelike));
                                }
                            }
                        }
                    }
                }
                num++;
            }
            return(null);
        }
Ejemplo n.º 2
0
 static bool Prefix(ref CompMaintainable __instance)
 {
     CompTick(__instance);
     if (!Active(__instance))
     {
         return(false);
     }
     ++__instance.ticksSinceMaintain;
     if (Find.TickManager.TicksGame % 250 > RefcellRespeedConfig.currentTimeMultiplier - 1)
     {
         return(false);
     }
     CheckTakeDamage(__instance);
     return(false);
 }
Ejemplo n.º 3
0
 static void CheckTakeDamage(CompMaintainable instance)
 {
 }
Ejemplo n.º 4
0
 static bool Active(CompMaintainable instance)
 {
     return(false);
 }
Ejemplo n.º 5
0
 static void CompTick(CompMaintainable instance)
 {
 }