Interface BattleAILogic
- All Known Implementing Classes:
AdvancedAI,AggressiveAI,BattleAI,BattleAIBase,NoOpAI,RaidAI,RandomAI,TacticalAI
public interface BattleAILogic
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<? extends BattleAIBase> codec()Finds the strongest offensive move choices in the situation.default List<List<MoveChoice>> getBestAttackChoices(List<PixelmonWrapper> pokemonList) Gets the best attack choices for multiple Pokémon.getFaintedPokemonToRevive(BattleParticipant participant) Gets a Pokémon to revive when forced to revive.Returns the moveset that the AI thinks a Pokémon has.Gets the move the AI will make next.Gets a Pokémon to switch to when forced to switch.default List<MoveChoice> getTopNAttackChoices(int count, PixelmonWrapper pw) Weights and returns all offensive move choices of a Pokémon.default voidregisterMove(PixelmonWrapper user) Registers an enemy move into the AI's memory.default voidregisterSwitch(PixelmonWrapper switchOut, PixelmonWrapper switchIn) Registers an enemy switch-in into the AI's memory.BattleAIType<? extends BattleAIBase> type()default voidweightFromOpponentOptions(PixelmonWrapper pw, MoveChoice userChoice, List<List<MoveChoice>> bestChoicesBefore, List<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.voidweightFromOpponentOptions(PixelmonWrapper pw, MoveChoice userChoice, List<List<MoveChoice>> bestChoicesBefore, List<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.default voidweightFromUserOptions(PixelmonWrapper pw, MoveChoice userChoice, List<MoveChoice> bestChoicesBefore, List<MoveChoice> bestChoicesAfter) Weights a move based on the amount of turns the user takes to KO the opponent after using the move.voidweightFromUserOptions(PixelmonWrapper pw, MoveChoice userChoice, List<MoveChoice> bestChoicesBefore, 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.voidweightRandomMove(PixelmonWrapper pw, MoveChoice userChoice, List<MoveChoice> possibleChoices) Weights a move that randomly selects from an assortment of moves.voidweightSingleTypeChange(PixelmonWrapper pw, MoveChoice userChoice, List<net.minecraft.core.Holder<Type>> newType, PixelmonWrapper target, List<MoveChoice> bestUserChoices, List<MoveChoice> bestOpponentChoices) Weights the effectiveness of a type change.voidweightStatusOpponentOptions(PixelmonWrapper pw, MoveChoice userChoice, PixelmonWrapper target, StatusBase status, List<PixelmonWrapper> opponents, List<MoveChoice> bestOpponentChoices) Weights a status based on the damage output of the opponent before and after applying it.voidweightTypeChange(PixelmonWrapper pw, MoveChoice userChoice, List<net.minecraft.resources.ResourceKey<Type>> possibleTypes, PixelmonWrapper target, List<MoveChoice> bestUserChoices, List<MoveChoice> bestOpponentChoices) Weights the effectiveness of a type change.default voidweightTypeChange(PixelmonWrapper pw, MoveChoice userChoice, List<net.minecraft.resources.ResourceKey<Type>> possibleTypes, List<MoveChoice> bestUserChoices, List<MoveChoice> bestOpponentChoices) Weights the effectiveness of a type change.
-
Field Details
-
CODEC
-
-
Method Details
-
codec
com.mojang.serialization.MapCodec<? extends BattleAIBase> codec() -
type
BattleAIType<? extends BattleAIBase> type() -
getNextMove
Gets the move the AI will make next.- Parameters:
pw- The Pokémon to make a move with.- Returns:
- The move the AI will make next.
-
getNextSwitch
Gets a Pokémon to switch to when forced to switch.- Parameters:
pw- The Pokémon switching out.- Returns:
- The ID of the Pokémon to switch to.
-
getFaintedPokemonToRevive
Gets a Pokémon to revive when forced to revive.- Returns:
- The ID of the Pokémon to switch to.
-
registerMove
Registers an enemy move into the AI's memory. -
registerSwitch
Registers an enemy switch-in into the AI's memory. -
getTopNAttackChoices
-
getMoveset
Returns the moveset that the AI thinks a Pokémon has.- Parameters:
pw- The Pokémon to get moves for.- Returns:
- The moveset that the AI thinks the Pokémon has.
-
getBestAttackChoices
Gets the best attack choices for multiple Pokémon.- Parameters:
pokemonList- The Pokémon to get attack choices for.- Returns:
- A list of attack choices for each specified Pokémon.
-
getBestAttackChoices
Finds the strongest offensive move choices in the situation. This should only be called when already in simulate mode.- Parameters:
pw- The Pokémon to get the best move choices for.- Returns:
- The strongest offensive move choices in the situation.
-
getWeightedOffensiveChoices
Weights and returns all offensive move choices of a Pokémon.- Parameters:
pw- The Pokémon to get choices for.- Returns:
- A list of offensive move choices that can be made by the Pokémon.
-
weightFromUserOptions
default void weightFromUserOptions(PixelmonWrapper pw, MoveChoice userChoice, List<MoveChoice> bestChoicesBefore, List<MoveChoice> bestChoicesAfter) Weights a move based on the amount of turns the user takes to KO the opponent after using the move.- Parameters:
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.
-
weightFromUserOptions
void weightFromUserOptions(PixelmonWrapper pw, MoveChoice userChoice, List<MoveChoice> bestChoicesBefore, 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.- Parameters:
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.
-
weightRandomMove
Weights a move that randomly selects from an assortment of moves.- Parameters:
pw- The Pokémon using the move.userChoice- The move with random selection.possibleChoices- The possible moves that the move can select.
-
weightFromOpponentOptions
default void weightFromOpponentOptions(PixelmonWrapper pw, MoveChoice userChoice, List<List<MoveChoice>> bestChoicesBefore, List<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.- Parameters:
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.
-
weightFromOpponentOptions
void weightFromOpponentOptions(PixelmonWrapper pw, MoveChoice userChoice, List<List<MoveChoice>> bestChoicesBefore, List<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.- Parameters:
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.
-
weightTypeChange
default void weightTypeChange(PixelmonWrapper pw, MoveChoice userChoice, List<net.minecraft.resources.ResourceKey<Type>> possibleTypes, List<MoveChoice> bestUserChoices, List<MoveChoice> bestOpponentChoices) Weights the effectiveness of a type change.- Parameters:
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.
-
weightTypeChange
void weightTypeChange(PixelmonWrapper pw, MoveChoice userChoice, List<net.minecraft.resources.ResourceKey<Type>> possibleTypes, PixelmonWrapper target, List<MoveChoice> bestUserChoices, List<MoveChoice> bestOpponentChoices) Weights the effectiveness of a type change.- Parameters:
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.
-
weightStatusOpponentOptions
void weightStatusOpponentOptions(PixelmonWrapper pw, MoveChoice userChoice, PixelmonWrapper target, StatusBase status, List<PixelmonWrapper> opponents, List<MoveChoice> bestOpponentChoices) Weights a status based on the damage output of the opponent before and after applying it.- Parameters:
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.
-
weightSingleTypeChange
void weightSingleTypeChange(PixelmonWrapper pw, MoveChoice userChoice, List<net.minecraft.core.Holder<Type>> newType, PixelmonWrapper target, List<MoveChoice> bestUserChoices, List<MoveChoice> bestOpponentChoices) Weights the effectiveness of a type change.- Parameters:
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.
-