rh-hideout/pokeemerald-expansion

Take Heart doesn't cure sleep (or freeze)

Closed this issue · 3 comments

Description

BattleScript_EffectTakeHeart uses cureifburnedparalysedorpoisoned to cure its status, which doesn't include sleep. This means that if Take Heart is called by Sleep Talk, it won't wake up the mon using it. Both Bulbapedia and Smogon agree that Take Heart should cure all status conditions. This is hilariously not the same as Refresh, which doesn't cure sleep.

EDIT: Occurs to me that since cureifburnedparalysedorpoisoned doesn't cure Freeze as Refresh doesn't, Take Heart also doesn't cure Freeze. The test below is exclusively for sleep, but both would be missing.

Here's a test to to verify.

SINGLE_BATTLE_TEST("Take Heart cures sleep when used by Sleep Talk")
{
    GIVEN {
        ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP);
        ASSUME(gMovesInfo[MOVE_SLEEP_TALK].effect == EFFECT_SLEEP_TALK);
        ASSUME(gMovesInfo[MOVE_TAKE_HEART].effect == EFFECT_TAKE_HEART);
        PLAYER(SPECIES_ZIGZAGOON);
        OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_SLEEP_TALK, MOVE_TAKE_HEART); }
    } WHEN {
        TURN { MOVE(player, MOVE_SPORE); MOVE(opponent, MOVE_SLEEP_TALK); }
        TURN { MOVE(player, MOVE_SPORE); MOVE(opponent, MOVE_TAKE_HEART); }
    } SCENE {
        MESSAGE("Zigzagoon used Spore!");
        ANIMATION(ANIM_TYPE_MOVE, MOVE_SPORE, player);
        ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_SLP, opponent);
        MESSAGE("Foe Zigzagoon fell asleep!");
        MESSAGE("Foe Zigzagoon used Sleep Talk!");
        ANIMATION(ANIM_TYPE_MOVE, MOVE_SLEEP_TALK, opponent);
        MESSAGE("Foe Zigzagoon used Take Heart!");
        ANIMATION(ANIM_TYPE_MOVE, MOVE_TAKE_HEART, opponent);
        MESSAGE("Zigzagoon used Spore!");
        ANIMATION(ANIM_TYPE_MOVE, MOVE_SPORE, player);
        ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_SLP, opponent);
    }
}

Alternatively just change the existing Take Heart test as follows

SINGLE_BATTLE_TEST("Take Heart cures the user of all status conditions")
{
    u32 status1;
    PARAMETRIZE { status1 = STATUS1_SLEEP; }
    PARAMETRIZE { status1 = STATUS1_POISON; }
    PARAMETRIZE { status1 = STATUS1_FREEZE; }
    PARAMETRIZE { status1 = STATUS1_BURN; }
    PARAMETRIZE { status1 = STATUS1_PARALYSIS; }
    PARAMETRIZE { status1 = STATUS1_TOXIC_POISON; }
    GIVEN {
        PLAYER(SPECIES_WOBBUFFET) { Status1(status1); };
        OPPONENT(SPECIES_WOBBUFFET);
    } WHEN {
        TURN { MOVE(player, MOVE_TAKE_HEART); }
    } SCENE {
        MESSAGE("Wobbuffet's status returned to normal!");
        ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
    }
}

I get this is an obscenely obscure scenario, I just happened to stumble into it while writing tests for the sleep clause branch iriv and I are working on lol

Version

1.9.3 (Latest release)

Upcoming/master Version

No response

Discord contact info

@Pawkkie

Note that if we aren't able to use curestatus for this, whatever new function is used will require additional sleep clause handling.

How is Take Heart supposed to cure freeze and why would Sleep Talk not cure sleep when it calls refresh?

I have it fixed but don't know how to write a test for it

How is Take Heart supposed to cure freeze and why would Sleep Talk not cure sleep when it calls refresh?

Bulbapedia just says Take Heart cures all nonvolatile status, which would include freeze.

Refresh weirdly explicitly does not cure sleep or freeze, it only cures burn poison and paralysis. Game Freak have some bizarre design choices lol.