public abstract class BattleAIBase
extends java.lang.Object
Constructor and Description |
---|
BattleAIBase(BattleParticipant participant)
Initializes the AI.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.List<MoveChoice> |
getAttackChoices(PixelmonWrapper pw)
Gets all attack choices the AI can make during the turn.
|
protected java.util.List<MoveChoice> |
getAttackChoicesOpponentOnly(PixelmonWrapper pw)
Gets all attack choices that do not specifically target allies.
|
java.util.List<java.util.List<MoveChoice>> |
getBestAttackChoices(java.util.List<PixelmonWrapper> pokemonList)
Gets the best attack choices for multiple Pokémon.
|
java.util.List<MoveChoice> |
getBestAttackChoices(PixelmonWrapper pw)
Finds the strongest offensive move choices in the situation.
|
protected java.util.List<MoveChoice> |
getChoices(PixelmonWrapper pw)
Gets all choices that the AI can make during the turn.
|
abstract java.util.UUID |
getFaintedPokemonToRevive()
Gets a Pokémon to revive when forced to revive.
|
java.util.List<Attack> |
getMoveset(PixelmonWrapper pw)
Returns the moveset that the AI thinks a Pokémon has.
|
abstract MoveChoice |
getNextMove(PixelmonWrapper pw)
Gets the move the AI will make next.
|
abstract java.util.UUID |
getNextSwitch(PixelmonWrapper pw)
Gets a Pokémon to switch to when forced to switch.
|
protected java.util.List<java.util.UUID> |
getPossibleReviveIDs()
Gets the IDs of all Pokémon in the participant's party that can be revived.
|
protected java.util.List<java.util.UUID> |
getPossibleSwitchIDs()
Gets the IDs of all Pokémon in the participant's party that can switch in.
|
protected MoveChoice |
getRandomAttackChoice(PixelmonWrapper pw)
Gets a random attack choice to use.
|
java.util.List<MoveChoice> |
getSwitchChoices(PixelmonWrapper pw)
Gets all possible switch choices the participant can make.
|
protected java.util.List<MoveChoice> |
getWeightedOffensiveChoices(PixelmonWrapper pw)
Weights and returns all offensive move choices of a Pokémon.
|
void |
registerMove(PixelmonWrapper user)
Registers an enemy move into the AI's memory.
|
void |
registerSwitch(PixelmonWrapper switchOut,
PixelmonWrapper switchIn)
Registers an enemy switch-in into the AI's memory.
|
void |
weightFromOpponentOptions(PixelmonWrapper pw,
MoveChoice userChoice,
java.util.List<java.util.List<MoveChoice>> bestChoicesBefore,
java.util.List<java.util.List<MoveChoice>> bestChoicesAfter)
Weights a move based on the amount of turns the opponent takes to KO the Pokémon before and after using the move.
|
void |
weightFromOpponentOptions(PixelmonWrapper pw,
MoveChoice userChoice,
java.util.List<java.util.List<MoveChoice>> bestChoicesBefore,
java.util.List<java.util.List<MoveChoice>> bestChoicesAfter,
boolean weightNegative)
Weights a move based on the amount of turns the opponent takes to KO the Pokémon before and after using the move.
|
void |
weightFromUserOptions(PixelmonWrapper pw,
MoveChoice userChoice,
java.util.List<MoveChoice> bestChoicesBefore,
java.util.List<MoveChoice> bestChoicesAfter)
Weights a move based on the amount of turns the user takes to KO the opponent after using the move.
|
void |
weightFromUserOptions(PixelmonWrapper pw,
MoveChoice userChoice,
java.util.List<MoveChoice> bestChoicesBefore,
java.util.List<MoveChoice> bestChoicesAfter,
boolean weightNegative)
Weights a move based on the amount of turns the user takes to KO the opponent after using the move.
|
protected void |
weightOffensiveMove(PixelmonWrapper pw,
MoveChoice choice)
Determines the weight of offensive moves.
|
protected void |
weightOffensiveMove(PixelmonWrapper pw,
MoveChoice choice,
java.util.List<PixelmonWrapper> allies)
Determines the weight of offensive moves.
|
protected void |
weightOffensiveMoves(PixelmonWrapper pw,
java.util.List<MoveChoice> choices)
Weights all offensive moves in a list of choices.
|
void |
weightRandomMove(PixelmonWrapper pw,
MoveChoice userChoice,
java.util.List<MoveChoice> possibleChoices)
Weights a move that randomly selects from an assortment of moves.
|
void |
weightSingleTypeChange(PixelmonWrapper pw,
MoveChoice userChoice,
java.util.List<Element> newType,
PixelmonWrapper target,
java.util.List<MoveChoice> bestUserChoices,
java.util.List<MoveChoice> bestOpponentChoices)
Weights the effectiveness of a type change.
|
void |
weightStatusOpponentOptions(PixelmonWrapper pw,
MoveChoice userChoice,
PixelmonWrapper target,
StatusBase status,
java.util.List<PixelmonWrapper> opponents,
java.util.List<MoveChoice> bestOpponentChoices)
Weights a status based on the damage output of the opponent before and after applying it.
|
void |
weightTypeChange(PixelmonWrapper pw,
MoveChoice userChoice,
java.util.List<Element> possibleTypes,
java.util.List<MoveChoice> bestUserChoices,
java.util.List<MoveChoice> bestOpponentChoices)
Weights the effectiveness of a type change.
|
void |
weightTypeChange(PixelmonWrapper pw,
MoveChoice userChoice,
java.util.List<Element> possibleTypes,
PixelmonWrapper target,
java.util.List<MoveChoice> bestUserChoices,
java.util.List<MoveChoice> bestOpponentChoices)
Weights the effectiveness of a type change.
|
public BattleAIBase(BattleParticipant participant)
participant
- The participant controlled by the AI.public abstract MoveChoice getNextMove(PixelmonWrapper pw)
pw
- The Pokémon to make a move with.public abstract java.util.UUID getNextSwitch(PixelmonWrapper pw)
pw
- The Pokémon switching out.public abstract java.util.UUID getFaintedPokemonToRevive()
public void registerMove(PixelmonWrapper user)
public void registerSwitch(PixelmonWrapper switchOut, PixelmonWrapper switchIn)
protected java.util.List<MoveChoice> getChoices(PixelmonWrapper pw)
pw
- The Pokémon to get choices for, or null if the AI is forced to switch.protected java.util.List<MoveChoice> getAttackChoices(PixelmonWrapper pw)
pw
- The Pokémon to get choices for.protected java.util.List<MoveChoice> getAttackChoicesOpponentOnly(PixelmonWrapper pw)
pw
- The Pokémon to get choices for.public java.util.List<MoveChoice> getSwitchChoices(PixelmonWrapper pw)
pw
- The Pokémon making a move, or null if switching in from a fainted Pokémon.protected java.util.List<java.util.UUID> getPossibleSwitchIDs()
protected java.util.List<java.util.UUID> getPossibleReviveIDs()
protected MoveChoice getRandomAttackChoice(PixelmonWrapper pw)
pw
- The Pokémon to make a move with.protected void weightOffensiveMove(PixelmonWrapper pw, MoveChoice choice)
pw
- The Pokémon using the move.choice
- The move choice being evaluated.protected void weightOffensiveMove(PixelmonWrapper pw, MoveChoice choice, java.util.List<PixelmonWrapper> allies)
pw
- The Pokémon using the move.choice
- The move choice being evaluated.allies
- The allies of the Pokémon in battle.protected void weightOffensiveMoves(PixelmonWrapper pw, java.util.List<MoveChoice> choices)
pw
- The Pokémon deciding a move.choices
- The move choices the Pokémon has.protected java.util.List<MoveChoice> getWeightedOffensiveChoices(PixelmonWrapper pw)
pw
- The Pokémon to get choices for.public java.util.List<MoveChoice> getBestAttackChoices(PixelmonWrapper pw)
pw
- The Pokémon to get the best move choices for.public java.util.List<java.util.List<MoveChoice>> getBestAttackChoices(java.util.List<PixelmonWrapper> pokemonList)
pokemonList
- The Pokémon to get attack choices for.public java.util.List<Attack> getMoveset(PixelmonWrapper pw)
pw
- The Pokémon to get moves for.public void weightRandomMove(PixelmonWrapper pw, MoveChoice userChoice, java.util.List<MoveChoice> possibleChoices)
pw
- The Pokémon using the move.userChoice
- The move with random selection.possibleChoices
- The possible moves that the move can select.public void weightFromUserOptions(PixelmonWrapper pw, MoveChoice userChoice, java.util.List<MoveChoice> bestChoicesBefore, java.util.List<MoveChoice> bestChoicesAfter)
pw
- The Pokémon using the move.userChoice
- The move being used.bestChoicesBefore
- The user's best choices before using the move.bestChoicesAfter
- The user's best choices after using the move.public void weightFromUserOptions(PixelmonWrapper pw, MoveChoice userChoice, java.util.List<MoveChoice> bestChoicesBefore, java.util.List<MoveChoice> bestChoicesAfter, boolean weightNegative)
pw
- The Pokémon using the move.userChoice
- The move being used.bestChoicesBefore
- The user's best choices before using the move.bestChoicesAfter
- The user's best choices after using the move.weightNegative
- Whether to weight negatively if the move causes the user to take more turns to KO the
opponent.public void weightFromOpponentOptions(PixelmonWrapper pw, MoveChoice userChoice, java.util.List<java.util.List<MoveChoice>> bestChoicesBefore, java.util.List<java.util.List<MoveChoice>> bestChoicesAfter)
pw
- The Pokémon using the move.userChoice
- The move being used.bestChoicesBefore
- The opponent's best options before using the move.bestChoicesAfter
- The opponent's best options after using the move.public void weightFromOpponentOptions(PixelmonWrapper pw, MoveChoice userChoice, java.util.List<java.util.List<MoveChoice>> bestChoicesBefore, java.util.List<java.util.List<MoveChoice>> bestChoicesAfter, boolean weightNegative)
pw
- The Pokémon using the move.userChoice
- The move being used.bestChoicesBefore
- The opponent's best options before using the move.bestChoicesAfter
- The opponent's best options after using the move.weightNegative
- Whether to weight negatively if the move causes the opponent to KO the Pokémon faster.public void weightTypeChange(PixelmonWrapper pw, MoveChoice userChoice, java.util.List<Element> possibleTypes, java.util.List<MoveChoice> bestUserChoices, java.util.List<MoveChoice> bestOpponentChoices)
pw
- The Pokémon using the move.userChoice
- The move being used.possibleTypes
- The possible types the Pokémon can become.bestUserChoices
- The best user choices before the type change.bestOpponentChoices
- The best opponent choices before the type change.public void weightTypeChange(PixelmonWrapper pw, MoveChoice userChoice, java.util.List<Element> possibleTypes, PixelmonWrapper target, java.util.List<MoveChoice> bestUserChoices, java.util.List<MoveChoice> bestOpponentChoices)
pw
- The Pokémon using the move.userChoice
- The move being used.possibleTypes
- The possible types the Pokémon can become.target
- The Pokémon whose type is being changed.bestUserChoices
- The best user choices before the type change.bestOpponentChoices
- The best opponent choices before the type change.public void weightSingleTypeChange(PixelmonWrapper pw, MoveChoice userChoice, java.util.List<Element> newType, PixelmonWrapper target, java.util.List<MoveChoice> bestUserChoices, java.util.List<MoveChoice> bestOpponentChoices)
pw
- The Pokémon using the move.userChoice
- The move being used.newType
- The type that the target will become.target
- The Pokémon whose type is being changed.bestUserChoices
- The best user choices before the type change.bestOpponentChoices
- The best opponent choices before the type change.public void weightStatusOpponentOptions(PixelmonWrapper pw, MoveChoice userChoice, PixelmonWrapper target, StatusBase status, java.util.List<PixelmonWrapper> opponents, java.util.List<MoveChoice> bestOpponentChoices)
pw
- The Pokémon using the move.userChoice
- The move to be used.target
- The Pokémon targeted by the status.status
- The status being applied.opponents
- The opponents of the move's user.bestOpponentChoices
- The best choices of the opponent.