Server.Items.BaseLight.Ignite C# (CSharp) Méthode

Ignite() public méthode

public Ignite ( ) : void
Résultat void
		public virtual void Ignite()
		{
			if ( !m_BurntOut )
			{
				PlayLitSound();

				m_Burning = true;
				ItemID = LitItemID;
				DoTimer( m_Duration );
			}
		}

Usage Example

        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();
                }
            }
        }
All Usage Examples Of Server.Items.BaseLight::Ignite