AI switches in absorbing mon incorrectly #6124
Labels
bug
Bug
category: battle-ai
Pertains to Battle Engine Upgrade's AI
status: confirmed
This bug has been confirmed to exist in the codebase
Description
The AI uses
FindMonThatAbsorbsOpponentsMove
to determine if it should switch in an absorber. This function isn't used when determining what mon to send in after a KO, so there are cases where they AI sends in a new mon, then immediately switch in a mon to try to absorb the incoming attack.This doesn't sound like bad behaviour, except the AI isn't predicting the incoming attack, it is just referencing whatever attack the player used most recently. This data is no longer reliable if the AI has just sent out a new mon for the player to engage with, so this behaviour should be disabled if the AI just sent out a new mon.
Basically we need to track if the AI sent out a new mon on the previous turn, and if they have, return false inside
FindMonThatAbsorbsOpponentsMove
. This can then be overridden once we haveAI_FLAG_PREDICT_MOVE
.I had a PR for this #6118 that I couldn't get to work properly, tried a few different implementations (only one of which ever got committed), need to take a break. Issue instead lol.
Here's a test it needs to pass
Version
upcoming (Edge)
Upcoming/master Version
No response
Discord contact info
@Pawkkie
The text was updated successfully, but these errors were encountered: