Beispiel #1
0
 // Check whether the unit wanhts to perform a missile attack and if the target is in range
 // If the target is in range, schedule an attack on ground
 // Finally set the goal to staying in the place it currently is in
 public void scheduleMissileAttack()
 {
     //if it already did something this turn
     if (hasMoved || hasDied)
     {
         return;
     }
     if (actionController.checkIfMissileAttack())
     {
         Debug.Log("going for missile");
         goalCoordinates = attackTarget.GetComponent <UnitController>().getCurrentPosition();
         if (hexMath.hexDistance(x - goalCoordinates[0], y - goalCoordinates[1]) < actionController.getAttackRange(1))
         {
             attackOnGround = true;
             Debug.Log("kill him!");
         }
     }
 }