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

Fixed AI not handling type effectiveness beyond x8 #6127

Conversation

AsparagusEduardo
Copy link
Collaborator

@AsparagusEduardo AsparagusEduardo commented Jan 27, 2025

Description

x32 can be achieved with the following:

  • 4x weak mon (non grass) such as Frosmoth (Ice/Bug)
  • Tar Shot
  • Forest's Curse
  • Dry Skin

People who collaborated with me in this PR

@/sshadowzkmao

Things to note in the release changelog:

  • Removed the use of AI_EFFECTIVENESS_ in favor of storing the actual type effectiveness.
  • Renamed AI_GetTypeEffectiveness to AI_GetMoveEffectiveness, removing the original one.

Discord contact info

AsparagusEduardo

@@ -4488,7 +4485,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move)
break;
case EFFECT_MAGNET_RISE:
if (IsBattlerGrounded(battlerAtk) && HasDamagingMoveOfType(battlerDef, TYPE_ELECTRIC)
&& !(AI_GetMoveEffectiveness(MOVE_EARTHQUAKE, battlerDef, battlerAtk) == AI_EFFECTIVENESS_x0)) // Doesn't resist ground move
&& !(AI_GetMoveEffectiveness(MOVE_EARTHQUAKE, battlerDef, battlerAtk) == UQ_4_12(0.0))) // Doesn't resist ground move
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can use the var effectiveness here?

@@ -4506,7 +4503,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move)
break;
case EFFECT_CAMOUFLAGE:
if (predictedMove != MOVE_NONE && AI_IsFaster(battlerAtk, battlerDef, move) // Attacker goes first
&& !IsBattleMoveStatus(move) && AI_GetMoveEffectiveness(predictedMove, battlerDef, battlerAtk) != AI_EFFECTIVENESS_x0)
&& !IsBattleMoveStatus(move) && AI_GetMoveEffectiveness(predictedMove, battlerDef, battlerAtk) != UQ_4_12(0.0))
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here

@hedara90 hedara90 added the category: battle-ai Pertains to Battle Engine Upgrade's AI label Jan 28, 2025
@AlexOn1ine AlexOn1ine merged commit 927bb8f into rh-hideout:upcoming Jan 28, 2025
1 check passed
@AsparagusEduardo AsparagusEduardo deleted the _RHH/pr/upcoming/AI_effectiveness branch January 28, 2025 23:41
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.

3 participants