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

Clear body tests #4685

Merged
merged 10 commits into from
Jun 11, 2024
Merged

Clear body tests #4685

merged 10 commits into from
Jun 11, 2024

Conversation

Pawkkie
Copy link
Collaborator

@Pawkkie Pawkkie commented Jun 1, 2024

Description

Wrote missing Clear Body tests.

This includes:

TO_DO_BATTLE_TEST("Clear Body prevents stat stage reduction from moves"); // Growl, Leer, Confide, Fake Tears, Scary Face, Sweet Scent, Sand Attack (Attack, Defense, Sp. Attack, Sp. Defense, Speed, Evasion, Accuracy
TO_DO_BATTLE_TEST("Clear Body prevents Sticky Web");
TO_DO_BATTLE_TEST("Clear Body doesn't prevent stat stage reduction from moves used by the user"); // e.g. Superpower
TO_DO_BATTLE_TEST("Clear Body doesn't prevent Speed reduction from Iron Ball");
TO_DO_BATTLE_TEST("Clear Body doesn't prevent Speed reduction from paralysis");
TO_DO_BATTLE_TEST("Clear Body doesn't prevent Attack reduction from burn");
TO_DO_BATTLE_TEST("Clear Body doesn't prevent receiving negative stat changes from Baton Pass");
TO_DO_BATTLE_TEST("Clear Body doesn't prevent Topsy-Turvy");
TO_DO_BATTLE_TEST("Clear Body doesn't prevent Spectral Thief from resetting positive stat changes");
TO_DO_BATTLE_TEST("Clear Body is ignored by Mold Breaker");

Discord contact info

@Pawkkie

test/battle/ability/clear_body.c Outdated Show resolved Hide resolved
test/battle/ability/clear_body.c Outdated Show resolved Hide resolved
test/battle/ability/clear_body.c Outdated Show resolved Hide resolved
test/battle/ability/clear_body.c Outdated Show resolved Hide resolved
test/battle/ability/clear_body.c Outdated Show resolved Hide resolved
test/battle/ability/clear_body.c Outdated Show resolved Hide resolved
test/battle/ability/clear_body.c Outdated Show resolved Hide resolved
test/battle/ability/clear_body.c Outdated Show resolved Hide resolved
test/battle/ability/clear_body.c Outdated Show resolved Hide resolved
test/battle/ability/clear_body.c Outdated Show resolved Hide resolved
@Pawkkie
Copy link
Collaborator Author

Pawkkie commented Jun 1, 2024

I am once again unsure of why this is failing, but I've also discovered that both Full Metal Body and White Smoke are missing their tests, so even once this is fully sorted out don't merge it yet, just let me know that it's good to go and I'll copy paste all the tests over and make the necessary changes to cover both of those abilities as well :)

EDIT: It's the Superpower assumption that's failing, ASSUME(MoveHasAdditionalEffect(MOVE_SUPERPOWER, MOVE_EFFECT_ATK_DEF_DOWN) == TRUE); Looking into why.

EDIT EDIT: Needs to be MoveHasAdditionalEffectSelf

@Pawkkie
Copy link
Collaborator Author

Pawkkie commented Jun 1, 2024

Ready for re-review!

test/battle/ability/clear_body.c Outdated Show resolved Hide resolved
test/battle/ability/clear_body.c Outdated Show resolved Hide resolved
GIVEN {
ASSUME(gMovesInfo[MOVE_SPECTRAL_THIEF].additionalEffects->moveEffect == MOVE_EFFECT_SPECTRAL_THIEF);
ASSUME(gMovesInfo[MOVE_AGILITY].effect == EFFECT_SPEED_UP_2);
PLAYER(SPECIES_WOBBUFFET) { Speed(4); Moves(MOVE_SPECTRAL_THIEF, MOVE_CELEBRATE); }
Copy link
Collaborator

Choose a reason for hiding this comment

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

That's weird...

@Pawkkie
Copy link
Collaborator Author

Pawkkie commented Jun 2, 2024

Feedback incorporated! Let me know if it's good before merging it so I can paste the tests over to Full Metal Body and White Smoke as well :)

Copy link
Collaborator

@AlexOn1ine AlexOn1ine left a comment

Choose a reason for hiding this comment

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

Most tests are missing an ability check. Whether if it goes of or not.

Regarding the test that needs the moves specified. I would leave a comment for now. We shouldn't stall the PR because of it.

/Edit Duke on discord discovered that the test passes fine with Metang and no moves. It could be a problem with Beldum being illiterate

@Pawkkie
Copy link
Collaborator Author

Pawkkie commented Jun 8, 2024

Most tests are missing an ability check. Whether if it goes of or not.

Regarding the test that needs the moves specified. I would leave a comment for now. We shouldn't stall the PR because of it.

/Edit Duke on discord discovered that the test passes fine with Metang and no moves. It could be a problem with Beldum being illiterate

What d'you mean by ability check, like d'you want me to parametrize the ability?

Would you prefer I leave that specific test as is with Beldum and a comment, or change Beldum for Metang? Or change to Metang throughout?

@AlexOn1ine
Copy link
Collaborator

Would you prefer I leave that specific test as is with Beldum and a comment, or change Beldum for Metang? Or change to Metang throughout?

I think it is fine if you just replace Beldum with Metang without a comment

What d'you mean by ability check, like d'you want me to parametrize the ability?

No, an ability check like like this inside SCENE
ability goes off

ABILITY_POPUP(opponent, ABILITY_INTIMIDATE);

and does not

NOT ABILITY_POPUP(opponent, ABILITY_INTIMIDATE);

@Pawkkie
Copy link
Collaborator Author

Pawkkie commented Jun 8, 2024

Ready for re-review, again let me know if this is good before merging so I can copy the tests over to the other two abilities :)

@AlexOn1ine
Copy link
Collaborator

Ready for re-review, again let me know if this is good before merging so I can copy the tests over to the other two abilities :)

Looks good, Thx!

@AsparagusEduardo could we get a re-review?

test/battle/ability/clear_body.c Outdated Show resolved Hide resolved
test/battle/ability/clear_body.c Outdated Show resolved Hide resolved
test/battle/ability/clear_body.c Show resolved Hide resolved
test/battle/ability/clear_body.c Outdated Show resolved Hide resolved
test/battle/ability/clear_body.c Outdated Show resolved Hide resolved
test/battle/ability/clear_body.c Outdated Show resolved Hide resolved
@AsparagusEduardo
Copy link
Collaborator

@AlexOn1ine just missing yours

Copy link
Collaborator

@AlexOn1ine AlexOn1ine left a comment

Choose a reason for hiding this comment

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

Sorry Pawkkie, I found a couple more things 😅

I only made comments for two checks but it applies to some of the tests

test/battle/ability/clear_body.c Outdated Show resolved Hide resolved
test/battle/ability/clear_body.c Show resolved Hide resolved
test/battle/ability/clear_body.c Show resolved Hide resolved
Copy link
Collaborator

@AlexOn1ine AlexOn1ine left a comment

Choose a reason for hiding this comment

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

Perfect, thx. Sorry that you had to do so many revisions.

@AlexOn1ine AlexOn1ine merged commit fd08e59 into rh-hideout:master Jun 11, 2024
1 check passed
@Pawkkie Pawkkie deleted the clear-body-tests branch October 1, 2024 15:35
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