Example #1
0
 //Custom
 void OnKeyPress(int _key)
 {
     if (_key == 0 ||
         _key >= abilities.GetNumberOfAbilities())
     {
         return;
     }
     abilities.AttemptSpecialAbility(_key);
 }
Example #2
0
 private void ScanForAbilityKeyDown()
 {
     for (int keyIndex = 0; keyIndex < abilities.GetNumberOfAbilities(); keyIndex++)
     {
         if (Input.GetKeyDown(keyIndex.ToString()))
         {
             abilities.AttemptSpecialAbility(keyIndex);
         }
     }
 }
Example #3
0
 private void ScanForAbilityKeyDown()
 {
     for (int i = 0; i < abilities.GetNumberOfAbilities(); i++)
     {
         if (abilities.abilities[i] && Input.GetKeyDown(abilities.abilities[i].ButtonName))
         {
             abilities.AttemptSpecialAbility(i);
         }
     }
 }
Example #4
0
 void ScanForAbilityKeyDown()
 {
     for (int key = 1; key < specialAbilities.getNumberOfAbilities(); key++)
     {
         if (Input.GetKeyDown(key.ToString()))
         {
             specialAbilities.AttemptSpecialAbility(key);
             currentAbilityIndex = key;
         }
     }
 }
Example #5
0
        void OnMouseOverEnemy(EnemyAI enemyToSet)
        {
            this.target = enemyToSet;
            HealthSystem enemyCharacterHealth = this.target.GetComponent <HealthSystem>();

            if (Input.GetMouseButton(0) && playerCharacter.IsTargetInRange(enemyCharacterHealth.GetComponent <Character>()))
            {
                weaponSystem.AttackTarget(enemyCharacterHealth);
            }
            else if (Input.GetMouseButtonDown(1) && playerCharacter.IsTargetInRange(enemyCharacterHealth.GetComponent <Character>()))
            {
                playerAbilities.AttemptSpecialAbility(0, enemyCharacterHealth, characterStats.GetDamage());
            }
        }
 void OnMouseOverEnemy(EnemyAI enemy)
 {
     if (Input.GetMouseButton(0) && IsTargetInRange(enemy.gameObject))
     {
         weaponSystem.AttackTarget(enemy.gameObject);
     }
     else if (Input.GetMouseButton(0) && !IsTargetInRange(enemy.gameObject))
     {
         StartCoroutine(MoveAndAttack(enemy.gameObject));
     }
     else if (Input.GetMouseButtonDown(1) && IsTargetInRange(enemy.gameObject))
     {
         abilities.AttemptSpecialAbility(0, enemy.gameObject);
     }
     else if (Input.GetMouseButtonDown(1) && !IsTargetInRange(enemy.gameObject))
     {
         StartCoroutine(MoveAndPowerAttack(enemy.gameObject));
     }
 }
Example #7
0
 private void ScanForAbilityKeyDown()
 {
     for (int i = 0; i < _abilities.Abilities.Length; i++)
     {
         if (Input.GetKeyDown(i.ToString()))
         {
             _abilities.AttemptSpecialAbility(i);
         }
     }
 }
Example #8
0
 private void ProcessEnemyInteraction(EnemyAI enemy)
 {
     if (Input.GetMouseButtonDown(0) && IsTargetInRange(enemy.gameObject))
     {
         currentTarget = enemy.gameObject;
         weaponSystem.Attack(enemy.gameObject);
     }
     else if (Input.GetMouseButtonDown(0) && !IsTargetInRange(enemy.gameObject))
     {
         StartCoroutine(MoveAndAttack(enemy));
     }
     else if (Input.GetMouseButtonDown(1) && IsTargetInRange(enemy.gameObject))
     {
         abilities.AttemptSpecialAbility(2, currentTarget);
     }
     else if (Input.GetMouseButtonDown(1) && !IsTargetInRange(enemy.gameObject))
     {
         StartCoroutine(MoveAndPowerAttack(enemy));
     }
 }
Example #9
0
        IEnumerator MoveAndAbility(EnemyAI target)
        {
            yield return(StartCoroutine(MoveToTarget(target)));

            specialAbilities.AttemptSpecialAbility(0, target.gameObject);
        }