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 TypeMethodDescriptionint
getHp()
Retrieves the current hit points of the Champion.int
getLevel()
Retrieves the level of the Champion.int
getLuck()
Retrieves the luck factor of the Champion.int
getMaxHp()
Retrieves the maximum hit points of the Champion.boolean
getMove()
Retrieves the move status of the Champion.int
getRange()
Retrieves the attack range of the Champion.boolean
Returns the status of the champion's regeneration.boolean
Returns the status of the champion's shield.int
Retrieves the strength of the Champion.boolean
getSword()
Retrieves the availability of a sword for the Champion.getType()
Retrieves the type of the Champion.int
Retrieves the x index position of the Champion.int
Retrieves the y index position of the Champion.void
Increases the level of the Champion.void
newIndex
(int newY, int newX) Updates the champion's position with new indices.void
setHp
(int change) Sets the current hit points of the Champion.void
setLuck
(int luck) Sets the luck factor of the Champion.void
setMaxHp
(int maxhp) Sets the maximum hit points of the Champion.void
setMove
(boolean value) Sets the move status of the Champion.void
setRegeneration
(boolean regen) Sets the status of the champion's regeneration.void
setShield
(boolean has_shield) Sets the status of the champion's shield.void
setStrength
(int power) Sets the strength of the Champion.void
setSword
(boolean has_sword) Sets the status of the champion's sword.void
takeDMG
(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, wait
Methods 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:
newIndex
in 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:
getMove
in 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:
setMove
in interfaceDefaultRequired
- Parameters:
value
- the move status of the Champion
-
getType
Retrieves the type of the Champion.- Specified by:
getType
in interfaceDefaultRequired
- Returns:
- the type of the Champion
-
getX_index
public int getX_index()Retrieves the x index position of the Champion.- Specified by:
getX_index
in 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_index
in interfaceDefaultRequired
- Returns:
- the y index position of the Champion
-
getStrength
public int getStrength()Retrieves the strength of the Champion.- Specified by:
getStrength
in 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:
getRange
in interfaceDefaultRequired
- Returns:
- the attack range of the Champion
-
getLuck
public int getLuck()Retrieves the luck factor of the Champion.- Specified by:
getLuck
in 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:
getHp
in 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:
getMaxHp
in 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:
getLevel
in 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:
getSword
in 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:
getShield
in 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:
getRegeneration
in 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
-