Class AlienPlayer


public class AlienPlayer extends Player
Alien — a magic-oriented character with very low HP and defense, but attacks bypass defense. Special trait: can move diagonally, unlike other characters who can only move in straight lines. Skill: Fireball — magic damage x1.5, fully bypasses defense.
  • Constructor Details

    • AlienPlayer

      public AlienPlayer()
      Creates an Alien with default stats. HP 70, ATK 20, DEF 2, Skill: Fireball (MAGIC_DAMAGE).
  • Method Details

    • calculateAttack

      public int calculateAttack()
      Calculates the Alien's attack value using attackPower directly. (Defense bypass is handled by BattleManager during action processing.)
      Specified by:
      calculateAttack in class Entity
      Returns:
      Attack value
    • getDescription

      public String getDescription()
      Returns a short description of the Alien for the UI.
      Specified by:
      getDescription in class Entity
      Returns:
      Description text
    • isValidMove

      public boolean isValidMove(int fromRow, int fromCol, int toRow, int toCol)
      Alien can also move diagonally, unlike the default which only allows straight-line moves. The rule is at most 1 step in any direction, and staying in place is not allowed.
      Overrides:
      isValidMove in class Player
      Parameters:
      fromRow - Starting row
      fromCol - Starting column
      toRow - Destination row
      toCol - Destination column
      Returns:
      true if this move is valid