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

Cannot use Belch after using Stuff Cheeks #3953

Closed
AsparagusEduardo opened this issue Jan 9, 2024 · 8 comments · Fixed by #4376
Closed

Cannot use Belch after using Stuff Cheeks #3953

AsparagusEduardo opened this issue Jan 9, 2024 · 8 comments · Fixed by #4376
Labels
bug Bug category: battle-mechanic Pertains to battle mechanics status: confirmed This bug has been confirmed to exist in the codebase

Comments

@AsparagusEduardo
Copy link
Collaborator

AsparagusEduardo commented Jan 9, 2024

Description

EDIT: Also happens in master (5498098).

In-game:
mGBA_BFLquVsMIm

Used the following test as well:

SINGLE_BATTLE_TEST("Belch cannot be used if the user hasn't eaten a berry")
{
    u16 item = 0;
    PARAMETRIZE { item = ITEM_NONE; }
    PARAMETRIZE { item = ITEM_ORAN_BERRY; }
    GIVEN {
        PLAYER(SPECIES_SKWOVET) { Item(item); }
        OPPONENT(SPECIES_WOBBUFFET);
    } WHEN {
        if (item == ITEM_NONE)
            TURN { MOVE(player, MOVE_BELCH, allowed: FALSE); MOVE(player, MOVE_CELEBRATE); }
        else {
            TURN { MOVE(player, MOVE_STUFF_CHEEKS); }
            TURN { MOVE(player, MOVE_BELCH); }
        }
    } SCENE {
        if (item == ITEM_NONE) {
            ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, player);
        }
        else {
            ANIMATION(ANIM_TYPE_MOVE, MOVE_STUFF_CHEEKS, player);
            ANIMATION(ANIM_TYPE_MOVE, MOVE_BELCH, player);
        }
    }
}

mGBA_S4XW9obD8s

Version

upcoming (Edge)

Upcoming Version

4a3954f

Discord contact info

AsparagusEduardo

@AsparagusEduardo AsparagusEduardo added bug Bug category: battle-mechanic Pertains to battle mechanics status: unconfirmed This bug has not been reproduced yet status: confirmed This bug has been confirmed to exist in the codebase and removed status: unconfirmed This bug has not been reproduced yet labels Jan 9, 2024
@AlexOn1ine
Copy link
Collaborator

Consuming a Berry through other means (such as Natural Gift, using Fling, or its Trainer giving it a Berry from the Bag) will not enable Belch to be used.

Would this apply here?

@AsparagusEduardo
Copy link
Collaborator Author

Would this apply here?

I don't understand the question.

@Bassoonian
Copy link
Collaborator

I think Alex means this may very well be intended vanilla behaviour. Someone should probably test in a vanilla game

@AlexOn1ine
Copy link
Collaborator

Tested on showdown and it does seem like a bug

Dragonite used Agility!
Dragonite's Speed rose sharply!

The opposing Skwovet used Stuff Cheeks!
The opposing Skwovet's Defense rose sharply!
(The opposing Skwovet ate its Liechi Berry!)
The Liechi Berry raised the opposing Skwovet's Attack!

Turn 2

Dragonite, come back!
Go! Dragapult!

The opposing Skwovet used Belch!
It's not very effective...
(Dragapult lost 6.6% of its health!)

@ZnogyroP
Copy link

This should probably be handled in the consumeberry macro and by extension VARIOUS_CONSUME_BERRY (which I assume will also be rewritten as a callnative), because that covers other edge cases that are also presumably not working, such as eating a berry from Fling (someone Flings a berry at you and you eat it, not you Flinging a berry), Bug Bite / Pluck, and Teatime. Just setting the ateBerry bit for the battler

@AlexOn1ine
Copy link
Collaborator

AlexOn1ine commented Feb 25, 2024

I found the problem but I am not sure what the best solution would be.

If you change the test to add an HP amount the test passes.

- PLAYER(SPECIES_SKWOVET) { Item(item); }
+ PLAYER(SPECIES_SKWOVET) { MaxHP(100); HP(90); Item(item); }

Reason is that ItemHealHp returns 0 (any reason this isn't using ITEM_NO_EFFECT?) which then never sets ateBerry

I'm not sure where to best catch it though

/Edit: A different question is, is this even a bug then? That is not clear. Stuff checks let's you consume the berry but technically you haven't eaten eat?

/Edit: It looks like ateBerry is not set anywhere?

@AsparagusEduardo
Copy link
Collaborator Author

/Edit: It looks like ateBerry is not set anywhere?

It's apparently being set at the end ItemBattleEffects
image

@AlexOn1ine
Copy link
Collaborator

/Edit: It looks like ateBerry is not set anywhere?

It's apparently being set at the end ItemBattleEffects image

Oh right, I missed that one.

ateBerry could be added to consume berry various (changed to a callnative in the process) but I'm not sure if it is optimal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug category: battle-mechanic Pertains to battle mechanics status: confirmed This bug has been confirmed to exist in the codebase
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants