public static void TickDoesFind(CompScanner __instance, ref float scanSpeed)
        {
            if (WorkRebalancerMod.Instance.Prof.RestoreWhenHostileDetected &&
                HostileHandler.HostileDetected)
            {
                return;
            }

            /*
             * public void Used(Pawn worker)
             *      {
             *              if (!this.CanUseNow)
             *              {
             *                      Log.Error("Used while CanUseNow is false.", false);
             *              }
             *              this.lastScanTick = (float)Find.TickManager.TicksGame;
             *              this.lastUserSpeed = 1f;
             *              if (this.Props.scanSpeedStat != null)
             *              {
             *                      this.lastUserSpeed = worker.GetStatValue(this.Props.scanSpeedStat, true); // fix 1
             *              }
             *              this.daysWorkingSinceLastFinding += this.lastUserSpeed / 60000f; // fix 2
             *              if (this.TickDoesFind(this.lastUserSpeed))
             *              {
             *                      this.DoFind(worker);
             *                      this.daysWorkingSinceLastFinding = 0f;
             *              }
             *      }
             */
            //return Find.TickManager.TicksGame % 59 == 0 && (Rand.MTBEventOccurs(this.Props.scanFindMtbDays / scanSpeed, 60000f, 59f) || (this.Props.scanFindGuaranteedDays > 0f && this.daysWorkingSinceLastFinding >= this.Props.scanFindGuaranteedDays));
            __instance.lastUserSpeed *= WorkRebalancerMod.Instance.Prof.DeepScannerJob;                // fix view 1
            __instance.daysWorkingSinceLastFinding += (__instance.lastUserSpeed - scanSpeed) / 60000f; // fix view 2
            scanSpeed = __instance.lastUserSpeed;
        }
 static bool Prefix(ref CompScanner __instance, ref bool __result, ref float scanSpeed, ref float ___daysWorkingSinceLastFinding)
 {
     __result = Find.TickManager.TicksGame % 59 < RefcellRespeedConfig.currentTimeMultiplier &&
                (Rand.MTBEventOccurs(Props(__instance).scanFindMtbDays / scanSpeed, 60000f, 59f) ||
                 (double)Props(__instance).scanFindGuaranteedDays > 0.0 &&
                 (double)___daysWorkingSinceLastFinding >= (double)Props(__instance).scanFindGuaranteedDays);
     return(false);
 }
        private static bool CanOperate(Pawn pawn, WorkGiver_OperateScanner __instance)
        {
            List <Thing> list = pawn.Map.listerThings.ThingsOfDef(__instance.ScannerDef);

            for (int i = 0; i < list.Count; i++)
            {
                if (list[i].Faction == Faction.OfPlayer)
                {
                    CompScanner compScanner = list[i].TryGetComp <CompScanner>();
                    if (compScanner != null && compScanner.CanUseNow)
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
 static CompProperties_Scanner Props(CompScanner instance)
 {
     return(null);
 }