Пример #1
0
 public float MitigateSurge()
 {
     if (compBreakdownable == null || !compBreakdownable.BrokenDown)
     {
         if (breakdownOnTrip)
         {
             if (compBreakdownable != null)
             {
                 compBreakdownable.DoBreakdown();
                 return(surgeMitigation);
             }
         }
         else if (compFlickable != null)
         {
             if (compFlickable.SwitchIsOn)
             {
                 compFlickable.ResetToOn();
                 compFlickable.DoFlick();
                 FlickUtility.UpdateFlickDesignation(parent);
                 return(surgeMitigation);
             }
         }
     }
     return(0.0f);
 }
Пример #2
0
 public float ProduceThing(float amount)
 {
     if (compFlickable != null)
     {
         compFlickable.ResetToOn();
         compFlickable.DoFlick();
         FlickUtility.UpdateFlickDesignation(parent);
         return(surgeMitigation);
     }
     return(0.0f);
 }
 public override IEnumerable <Command> CompGetGizmosExtra()
 {
     if (canSwitchModes)
     {
         Command_Action commandModeSwitch = new Command_Action();
         commandModeSwitch.groupKey = 676192;
         if (switchedToChunkSilo)
         {
             commandModeSwitch.defaultLabel = "CompRTDeviceModeSwitcher_StockpileModeLabel".Translate();
             commandModeSwitch.defaultDesc  = "CompRTDeviceModeSwitcher_StockpileModeDesc".Translate();
             commandModeSwitch.icon         = Resources.stockpileTexture;
         }
         else
         {
             commandModeSwitch.defaultLabel = "CompRTDeviceModeSwitcher_ChunkSiloModeLabel".Translate();
             commandModeSwitch.defaultDesc  = "CompRTDeviceModeSwitcher_ChunkSiloModeDesc".Translate();
             commandModeSwitch.icon         = Resources.chunkSiloTexture;
         }
         commandModeSwitch.action = () =>
         {
             CompFlickable compFlickable = parent.TryGetComp <CompFlickable>();
             if (compFlickable != null)
             {
                 compFlickable.ResetToOn();
                 compFlickable.DoFlick();
                 FlickUtility.UpdateFlickDesignation(parent);
             }
             if (switchedToChunkSilo)
             {
                 CompRTQuantumChunkSilo compChunkSilo = parent.TryGetComp <CompRTQuantumChunkSilo>();
                 if (compChunkSilo != null)
                 {
                     compChunkSilo.EmptyOut();
                 }
             }
             switchedToChunkSilo = !switchedToChunkSilo;
             SortOutComps();
         };
         yield return(commandModeSwitch);
     }
 }