Class AlienPlayer
java.lang.Object
model.entity.Entity
model.entity.Player
model.entity.AlienPlayer
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.
-
Field Summary
Fields inherited from class model.entity.Player
col, inventory, isDefending, maxInventorySize, playerNumber, row, selectedItemIndex, skillFields inherited from class model.entity.Entity
attackPower, baseAttackPower, baseDefense, currentHp, defense, maxHp, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCalculates the Alien's attack value using attackPower directly.Returns a short description of the Alien for the UI.booleanisValidMove(int fromRow, int fromCol, int toRow, int toCol) Alien can also move diagonally, unlike the default which only allows straight-line moves.Methods inherited from class model.entity.Player
canMoveTo, getCol, getInventory, getMaxInventorySize, getPlayerNumber, getRow, getSelectedItemIndex, getSkill, isDefending, isInventoryFull, move, pickUpItem, setDefending, setPlayerNumber, setSelectedItemIndex, takeDamage, useFirstItemMethods inherited from class model.entity.Entity
getAttackPower, getCurrentHp, getDefense, getMaxHp, getName, heal, isAlive, resetAttackPower, resetDefense, setAttackPower, setBaseAttackPower, setBaseDefense, setCurrentHp, setDefense, setMaxHp
-
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:
calculateAttackin classEntity- Returns:
- Attack value
-
getDescription
Returns a short description of the Alien for the UI.- Specified by:
getDescriptionin classEntity- 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:
isValidMovein classPlayer- Parameters:
fromRow- Starting rowfromCol- Starting columntoRow- Destination rowtoCol- Destination column- Returns:
trueif this move is valid
-