Package me.simulation.players
Class Champion
java.lang.Object
me.simulation.players.Champion
- All Implemented Interfaces:
DefaultRequired
Represents an abstract Champion in the simulation.
Implements the DefaultRequired interface.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a Champion object with the specified type, x index, and y index.Champion(String type, int level, int maxhp, int hp, int strength, int range, int luck, boolean move, boolean has_shield, boolean has_sword, int x_index, int y_index, boolean regeneration) Constructs a Champion object with the specified attributes. -
Method Summary
Modifier and TypeMethodDescriptionintgetHp()Retrieves the current hit points of the Champion.intgetLevel()Retrieves the level of the Champion.intgetLuck()Retrieves the luck factor of the Champion.intgetMaxHp()Retrieves the maximum hit points of the Champion.booleangetMove()Retrieves the move status of the Champion.intgetRange()Retrieves the attack range of the Champion.booleanReturns the status of the champion's regeneration.booleanReturns the status of the champion's shield.intRetrieves the strength of the Champion.booleangetSword()Retrieves the availability of a sword for the Champion.getType()Retrieves the type of the Champion.intRetrieves the x index position of the Champion.intRetrieves the y index position of the Champion.voidIncreases the level of the Champion.voidnewIndex(int newY, int newX) Updates the champion's position with new indices.voidsetHp(int change) Sets the current hit points of the Champion.voidsetLuck(int luck) Sets the luck factor of the Champion.voidsetMaxHp(int maxhp) Sets the maximum hit points of the Champion.voidsetMove(boolean value) Sets the move status of the Champion.voidsetRegeneration(boolean regen) Sets the status of the champion's regeneration.voidsetShield(boolean has_shield) Sets the status of the champion's shield.voidsetStrength(int power) Sets the strength of the Champion.voidsetSword(boolean has_sword) Sets the status of the champion's sword.voidtakeDMG(int strength, int level, int range, int luck) Simulates the Champion taking damage based on various factors.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.simulation.game.DefaultRequired
getLvl
-
Constructor Details
-
Champion
Constructs a Champion object with the specified type, x index, and y index.- Parameters:
type- the type of the Championx_index- the x index position of the Championy_index- the y index position of the Champion
-
Champion
public Champion(String type, int level, int maxhp, int hp, int strength, int range, int luck, boolean move, boolean has_shield, boolean has_sword, int x_index, int y_index, boolean regeneration) Constructs a Champion object with the specified attributes.- Parameters:
type- the type of the Championlevel- the level of the Championmaxhp- the maximum hit points of the Championhp- the current hit points of the Championstrength- the strength of the Championrange- the attack range of the Championluck- the luck factor of the Championmove- indicates if the Champion can movehas_shield- indicates if the Champion has a shieldhas_sword- indicates if the Champion has a swordx_index- the x index position of the Championy_index- the y index position of the Championregeneration- indicates if the Champion has regeneration ability
-
-
Method Details
-
newIndex
public void newIndex(int newY, int newX) Updates the champion's position with new indices.- Specified by:
newIndexin interfaceDefaultRequired- Parameters:
newY- the new y-coordinate indexnewX- the new x-coordinate index
-
getMove
public boolean getMove()Retrieves the move status of the Champion.- Specified by:
getMovein interfaceDefaultRequired- Returns:
- true if the Champion can move, false otherwise
-
setMove
public void setMove(boolean value) Sets the move status of the Champion.- Specified by:
setMovein interfaceDefaultRequired- Parameters:
value- the move status of the Champion
-
getType
Retrieves the type of the Champion.- Specified by:
getTypein interfaceDefaultRequired- Returns:
- the type of the Champion
-
getX_index
public int getX_index()Retrieves the x index position of the Champion.- Specified by:
getX_indexin interfaceDefaultRequired- Returns:
- the x index position of the Champion
-
getY_index
public int getY_index()Retrieves the y index position of the Champion.- Specified by:
getY_indexin interfaceDefaultRequired- Returns:
- the y index position of the Champion
-
getStrength
public int getStrength()Retrieves the strength of the Champion.- Specified by:
getStrengthin interfaceDefaultRequired- Returns:
- the strength of the Champion
-
setStrength
public void setStrength(int power) Sets the strength of the Champion.- Parameters:
power- the strength of the Champion
-
getRange
public int getRange()Retrieves the attack range of the Champion.- Specified by:
getRangein interfaceDefaultRequired- Returns:
- the attack range of the Champion
-
getLuck
public int getLuck()Retrieves the luck factor of the Champion.- Specified by:
getLuckin interfaceDefaultRequired- Returns:
- the luck factor of the Champion
-
setLuck
public void setLuck(int luck) Sets the luck factor of the Champion.- Parameters:
luck- the luck factor of the Champion
-
getHp
public int getHp()Retrieves the current hit points of the Champion.- Specified by:
getHpin interfaceDefaultRequired- Returns:
- the current hit points of the Champion
-
setHp
public void setHp(int change) Sets the current hit points of the Champion.- Parameters:
change- the new current hit points of the Champion
-
takeDMG
public void takeDMG(int strength, int level, int range, int luck) Simulates the Champion taking damage based on various factors.- Parameters:
strength- the strength factor for calculating damagelevel- the level of the Championrange- the attack range of the Championluck- the luck factor for calculating damage
-
getMaxHp
public int getMaxHp()Retrieves the maximum hit points of the Champion.- Specified by:
getMaxHpin interfaceDefaultRequired- Returns:
- the maximum hit points of the Champion
-
setMaxHp
public void setMaxHp(int maxhp) Sets the maximum hit points of the Champion.- Parameters:
maxhp- the maximum hit points of the Champion
-
getLevel
public int getLevel()Retrieves the level of the Champion.- Specified by:
getLevelin interfaceDefaultRequired- Returns:
- the level of the Champion
-
increaseLevel
public void increaseLevel()Increases the level of the Champion. -
getSword
public boolean getSword()Retrieves the availability of a sword for the Champion.- Specified by:
getSwordin interfaceDefaultRequired- Returns:
- true if the Champion has a sword, false otherwise
-
setSword
public void setSword(boolean has_sword) Sets the status of the champion's sword.- Parameters:
has_sword- the status of the sword to set
-
getShield
public boolean getShield()Returns the status of the champion's shield.- Specified by:
getShieldin interfaceDefaultRequired- Returns:
- true if the champion has a shield, false otherwise
-
setShield
public void setShield(boolean has_shield) Sets the status of the champion's shield.- Parameters:
has_shield- the status of the shield to set
-
getRegeneration
public boolean getRegeneration()Returns the status of the champion's regeneration.- Specified by:
getRegenerationin interfaceDefaultRequired- Returns:
- true if the champion has regeneration, false otherwise
-
setRegeneration
public void setRegeneration(boolean regen) Sets the status of the champion's regeneration.- Parameters:
regen- the status of the regeneration to set
-