Пример #1
0
        public bool Burn()
        {
            if (HasComponent <UnburnableFlag>())
            {
                return(false);
            }

            _fire.Kindle();

            // TODO: Get this from content data
            var limit = 2;

            if (_fire.Amount <= limit)
            {
                return(false);
            }

            if (CantBurnt())
            {
                return(false);
            }

            _fire.Extinguish();
            DestroyStructure();
            Burnt?.Invoke();

            return(true);
        }
Пример #2
0
    protected virtual void XLDFireNotFireFrom(DamageData damageData)
    {
        Freeze fre = GetComponent <Freeze>();

        if (fre != null)
        {
            damageData.Mediated = true;
            fre.EndUp();
        }
        else
        if (Random.Range(0, 1f) < damageData.FireRatio)
        {
            Burnt.Chay(this, damageData.FireTime);
        }
    }
Пример #3
0
    protected virtual void XLDIce(DamageData damaData)
    {
        Burnt b = GetComponent <Burnt>();

        if (b)
        {
            damaData.Mediated = true;
            b.EndUp();
        }
        else
        {
            if (Random.Range(0, 1f) < damaData.IceRatio)
            {
                Freeze.Freezed(this, damaData.IceTime);
            }
        }
    }
Пример #4
0
 void State()
 {
     if (slider.value >= .70f && slider.value <= .75f)
     {
         success = true;
         Ready.SetActive(true);
     }
     else if (slider.value > .75f)
     {
         Burnt.SetActive(true);
         Ready.SetActive(false);
         success = false;
     }
     else if (slider.value > .35f)
     {
         KindOf.SetActive(true);
         UnCooked.SetActive(false);
         success = false;
     }
     else
     {
         success = false;
     }
 }