Example #1
0
    protected virtual void die()
    {
        if (myAnimator != null)
        {
            myAnimator.SetBool("Dieing", true);
        }
        dieing = true;
        if (stunVFX != null)
        {
            stunVFX.Die();
            stunVFX = null;
        }
        if (fireVFX != null)
        {
            fireVFX.Die();
            fireVFX = null;
        }
        stunned = false;
        onFire  = false;
        float chance = Random.Range(0, 100);

        if (chance < lootDropChance)
        {
            //Debug.Log("Loot Dropped with " + chance.ToString() + "at position " + transform.position.ToString());
            PlayerData.Player.AddGold(Random.Range(lootDropMin, lootDropMax + 1));
            AudioControlScript.mAC.PlayGetCoin();
        }

        checkIfRelatedQuest();
    }
Example #2
0
 public void SetAlight(float burnLength = 2.0f)
 {
     onFire   = true;
     fireTime = burnLength;
     fireVFX  = GameManagerScript.G.GetFireVFX();
     fireVFX.OnSpawn(gameObject);
 }
Example #3
0
 void burn()
 {
     if (onFire)
     {
         if (fireTime <= 0)
         {
             onFire = false;
             fireVFX.Die();
             fireVFX = null;
         }
         fireTime -= Time.deltaTime;
     }
 }