Douse() public method

public Douse ( ) : void
return void
コード例 #1
0
        public static void CalculateLightOutage(BaseLight baseLight, EffectsObject eo)
        {
            if (!Data.UseRandomLightOutage || IsDefraggable(baseLight) || !IsControllable(baseLight, eo) || !eo.EffectsMap.UseRandomLightOutage || (baseLight is TSBaseLight && !((TSBaseLight)baseLight).UseRandomLightOutage))
            {
                return;
            }

            int lowNumber = Support.GetRandom(0, (100 - eo.EffectsMap.LightOutageChancePerTick));
            int highNumber = lowNumber + eo.EffectsMap.LightOutageChancePerTick;

            int randomChance = Support.GetRandom(0, 100);

            if (randomChance >= lowNumber && randomChance <= highNumber)
            {
                if (baseLight.Burning)
                {
                    baseLight.Douse();
                }
                else
                {
                    baseLight.Ignite();
                }
            }
        }
コード例 #2
0
 public static void UpdateManagedLight(BaseLight baseLight, int currentLevel)
 {
     if (currentLevel >= Data.LightsOnLevel && !baseLight.Burning)
     {
         baseLight.Ignite();
     }
     else if (currentLevel < Data.LightsOnLevel && baseLight.Burning)
     {
         baseLight.Douse();
     }
 }