Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AI for Palafin to activate Zero to Hero #5806

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kittenchilly
Copy link

Description

Adds logic for the AI to use Palafin properly. If it has Flip Turn (or some other pivoting move somehow) it'll always prioritize using it to get Zero to Hero to activate as soon as possible. If it doesn't have or can't use a pivoting move, it always tries to switch Palafin-Zero out as well.

Discord contact info

kittenchilly

case ABILITY_ZERO_TO_HERO:
//Zero to Hero only works on Palafin-Zero
if (gBattleMons[battler].species == SPECIES_PALAFIN_ZERO
&& AI_DATA->mostSuitableMonId[battler] != PARTY_SIZE)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question, this implementation means Zero to Hero will only prompt switches if the AI sees it has a good switchin candidate. Is Zero to Hero worth switching for even if the AI doesn't have a good switchin candidate? If so we don't need need the mostSuitableMonId check, if it isn't worth it then everything's fine as is :)

(I know nothing about Palafin other than hearing that it needs to switch from you)

Copy link
Collaborator

@Bassoonian Bassoonian Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say a bad switch-in is also preferable - even if the mon you send out dies because it's at low health or whatever, it still powers up Palafin. If anything, I would actually encourage some sort of viability curve where medium health is discouraged, but high HP and low HP are both discouraged (either because they're a good switch-in according to the AI, or because they likely served their use and can be sacrificed to power up Palafin who is likely to be more useful in battle than them at that point)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I wrote this thinking that Palafin wants to switch at all costs so I'll tweak it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm if I remove this, then it will always switch and won't use a pivoting move when it should probably prioritize pivoting moves.

@AlexOn1ine AlexOn1ine added the category: battle-ai Pertains to Battle Engine Upgrade's AI label Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: battle-ai Pertains to Battle Engine Upgrade's AI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants