Exemple #1
0
 void attackCharged()
 {
     Debug.Log("ChargeBar: " + _chargeBar.chargePercentage);
     if (_chargeBar != null && _chargeBar.chargePercentage >= 100)
     {
         if (hasMermaidCannon)
         {
             _anim.SetTrigger("MermaidCannon");
             StartCoroutine(fireMermaidCannon());
         }
         else if (hasClownDrill)
         {
             _anim.SetTrigger("ClownDrill");
             StartCoroutine(fireClownDrill());
         }
         else if (hasMaceOfTrit)
         {
             _anim.SetTrigger("Mace");
             StartCoroutine(fireMaceOfTrit());
         }
         else if (hasRARLaser)
         {
             _anim.SetTrigger("Staff");
             StartCoroutine(fireRARLaser());
         }
         else
         {
             inputD    = true;
             dc.damage = 100;
             dc.type   = AbstractDamageCollider.DamageType.heavy;
         }
         _chargeBar.IncreaseChargePercentage(-200);
         setState(PlayerStates.attacking);
     }
 }
Exemple #2
0
    public virtual void enemyDied(AbstractEnemyControl enemy)
    {
        Debug.Log("Remove Enemy: " + enemy);

        // Only works if this is a registered enemy.
        if (enemiesPacing.Contains(enemy) || enemiesAttacking.Contains(enemy))
        {
            // Increase charge bar.
            if (chargeBar != null && player.earnKills)
            {
                chargeBar.IncreaseChargePercentage(20);
            }
            killCount++;
            currentEnemyCount--;

            // Clean up enemies.
            enemiesPacing.Remove(enemy);
            enemiesAttacking.Remove(enemy);
        }
    }