Ejemplo n.º 1
0
        private void AttempSpecialAbility(int abilityIndex)
        {
            var           energyComponent = GetComponent <Energy>();
            AbilityConfig specialAbility  = abilities[abilityIndex];

            if (energyComponent.IsEnergyAvailable(specialAbility.GetEnergyCost()))
            {
                energyComponent.ConsumeEnergy(specialAbility.GetEnergyCost());
                var abilityParams = new AbilityUseParams(this.currentEnemy, baseDamage);
                specialAbility.Use(abilityParams);
            }
            else
            {
                print("Not enough mana");
            }
        }