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

Change freeze dry to allow easier extendebility #4312

Merged
merged 3 commits into from
Mar 31, 2024

Conversation

AlexOn1ine
Copy link
Collaborator

@AlexOn1ine AlexOn1ine commented Mar 27, 2024

Suggested by The Sylph is in.

Removes hardcoded check in favor of an argument and renames EFFECT_FREEZE_DRY to EFFECT_SUPER_EFFECTIVE_ON_ARG

Also gives Body Press the Foul Play treatment so user can make a move based on spDef

@AlexOn1ine AlexOn1ine changed the title Change freeze dry to allow easier extensibility Change freeze dry to allow easier extendebility Mar 27, 2024
@@ -4258,7 +4258,7 @@ static u32 AI_CalcMoveScore(u32 battlerAtk, u32 battlerDef, u32 move)
ADJUST_SCORE(DECENT_EFFECT);
break;
case EFFECT_SOAK:
if (HasMoveWithType(battlerAtk, TYPE_ELECTRIC) || HasMoveWithType(battlerAtk, TYPE_GRASS) || HasMoveEffect(battlerAtk, EFFECT_FREEZE_DRY))
if (HasMoveWithType(battlerAtk, TYPE_ELECTRIC) || HasMoveWithType(battlerAtk, TYPE_GRASS) || (HasMoveEffect(battlerAtk, EFFECT_SUPER_EFFECTIVE_ON_ARG) && gMovesInfo[move].argument == TYPE_WATER) )

Choose a reason for hiding this comment

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

Worth adding a generic IsSuperEffectiveOnType function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I do think that's a great idea but I've decided not to do it right now since it's not a very common check. Though if something like this comes up again in the future I'll introduce the suggested function.

@AlexOn1ine
Copy link
Collaborator Author

Ready for review, now with tests.

Also I wanted to base the stat used for Foul Play and Body Press based on the argument but even with CFs code example (from discord) I couldn't get it to work.

@Bassoonian Bassoonian merged commit 92e2341 into rh-hideout:upcoming Mar 31, 2024
1 check passed
@AlexOn1ine AlexOn1ine deleted the freeze_dry branch April 19, 2024 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants