Beispiel #1
0
    void AIIStartsMoving(BattleHex targetToAttack)                               //determines the distance from the attack target to each hex
    {
        battleController.CleanField();                                           //clear properties of all hexes before new calculation
        targetToAttack.DefineMeAsStartingHex();                                  //the starting hex is the hex occupied by the target of the attack
        int           stepsLimit      = battleController.stepsToCheckWholeField; //number of steps enough to check the entire battlefield
        IInitialHexes getInitialHexes = new InitialPos();                        //each hex validation rule

        //determines the distance from the attack target to each hex
        tocheckTheField.GetAvailablePositions(stepsLimit, getInitialHexes, targetToAttack);
        IAdjacentFinder adjFinder = BattleController.currentAtacker.GetTypeOfHero(); //determines the type of movement

        AIDefinesPath(adjFinder);                                                    //determines the optimal path and starts moving
    }
Beispiel #2
0
    void AIIStartsMoving(BattleHex targetToAttack)                               // determina la distancia desde el objetivo del ataque a cada hex
    {
        battleController.CleanField();                                           // borrar las propiedades de todos los hexes antes de un nuevo cálculo
        targetToAttack.DefineMeAsStartingHex();                                  // el hex de inicio es el hex ocupado por el objetivo del ataque
        int           stepsLimit      = battleController.stepsToCheckWholeField; // número de pasos suficientes para comprobar todo el campo de batalla
        IInitialHexes getInitialHexes = new InitialPos();                        // cada regla de validación hexadecimal

        // determina la distancia desde el objetivo del ataque a cada hex
        tocheckTheField.GetAvailablePositions(stepsLimit, getInitialHexes, targetToAttack);
        IAdjacentFinder adjFinder = BattleController.currentAtacker.GetTypeOfHero(); // determina el tipo de movimiento

        AIDefinesPath(adjFinder);                                                    // determina la ruta óptima y comienza a moverse
    }
Beispiel #3
0
    void AIDefinesPath(IAdjacentFinder adjFinder)//determines the optimal path and starts moving
    {
        //assigns a value to the static variable used by the Move and Optimal Path classes
        BattleController.targetToMove = AISelectsPosToOcuppy();
        battleController.CleanField();                    // clear the entire battlefield from previous calculations
        IInitialHexes getInitialHexes = new InitialPos(); //each hex validation rule
        int           stepsLimit      = hero.heroData.CurrentVelocity;
        BattleHex     startingHex     = BattleController.currentAtacker.GetComponentInParent <BattleHex>();

        startingHex.DefineMeAsStartingHex();//marks a new starting hex

        //select all the hexes that the troll can occupy
        availablePos.GetAvailablePositions(stepsLimit, adjFinder, getInitialHexes);
        GetComponent <OptimalPath>().MatchPath(); //determine the optimal path
        move.StartsMoving();                      //troll begins to move
    }
Beispiel #4
0
    void AIDefinesPath(IAdjacentFinder adjFinder)// determina la ruta óptima y comienza a moverse
    {
        // asigna un valor a la variable estática utilizada por las clases Move y Optimal Path
        BattleController.targetToMove = AISelectsPosToOcuppy();
        battleController.CleanField();                    // limpia todo el campo de batalla de los cálculos anteriores
        IInitialHexes getInitialHexes = new InitialPos(); // cada regla de validación hexadecimal
        int           stepsLimit      = hero.heroData.CurrentVelocity;
        BattleHex     startingHex     = BattleController.currentAtacker.GetComponentInParent <BattleHex>();

        startingHex.DefineMeAsStartingHex();// marca un nuevo hexadecimal inicial

        // selecciona todos los hexes que puede ocupar el troll
        availablePos.GetAvailablePositions(stepsLimit, adjFinder, getInitialHexes);
        GetComponent <OptimalPath>().MatchPath(); // determina la ruta óptima
        move.StartsMoving();                      // El troll comienza a moverse
    }
    //returns the hex on which the attacking hero stands
    private void GetStartingHex()
    {
        BattleHex startingHex = BattleController.currentAtacker.GetComponentInParent <BattleHex>();

        startingHex.DefineMeAsStartingHex(); //changes the properties of the starting hex
    }
Beispiel #6
0
    // devuelve el hex en el que se encuentra el héroe atacante
    private void GetStartingHex()
    {
        BattleHex startingHex = BattleController.currentAtacker.GetComponentInParent <BattleHex>();

        startingHex.DefineMeAsStartingHex(); // cambia las propiedades del hexagono inicial
    }