Exemplo n.º 1
0
 public void SpellCast(Ability spell, CharacterCollection allies, EnemyCollection enemies)
 {
     playerCasting = true;
     while (playerCasting == true)
     {
         if (spell.targetOption == AbilityTargetOption.SELF)
         {
             Enqueue(spell, new Character(), new Vector3());
             playerCasting = false;
         }
         else if (spell.targetOption == AbilityTargetOption.TARGET_ALLY)
         {                   //for now, targeting based on pressing numbers - will implement click-targeting
             if (Input.GetButtonDown("Ability 1"))
             {
                 Enqueue(spell, allies.getHero(0), new Vector3());
                 playerCasting = false;
             }
             else if (Input.GetButtonDown("Ability 2"))
             {
                 Enqueue(spell, allies.getHero(1), new Vector3());
                 playerCasting = false;
             }
             else if (Input.GetButtonDown("Ability 3"))
             {
                 Enqueue(spell, allies.getHero(2), new Vector3());
                 playerCasting = false;
             }
         }
         else if (spell.targetOption == AbilityTargetOption.TARGET_ENEMY)
         {
             if (Input.GetButtonDown("Ability 1"))
             {
                 Enqueue(spell, enemies.getEnemy(0), new Vector3());
                 playerCasting = false;
             }
             else if (Input.GetButtonDown("Ability 2"))
             {
                 Enqueue(spell, enemies.getEnemy(1), new Vector3());
                 playerCasting = false;
             }
             else if (Input.GetButtonDown("Ability 3"))
             {
                 Enqueue(spell, enemies.getEnemy(2), new Vector3());
                 playerCasting = false;
             }
         }
         else if (spell.targetOption == AbilityTargetOption.TARGET_LOCATION)
         {
         }
         else if (spell.targetOption == AbilityTargetOption.NONE)
         {
             Enqueue(spell, new Character(), new Vector3());
             playerCasting = false;
         }
     }
 }