#include "global.h" #include "test/battle.h" DOUBLE_BATTLE_TEST("Restore HP Item effects do not miss timing") { u16 item; PARAMETRIZE { item = ITEM_BERRY_JUICE; } PARAMETRIZE { item = ITEM_ORAN_BERRY; } PARAMETRIZE { item = ITEM_SITRUS_BERRY; } GIVEN { ASSUME(gItemsInfo[ITEM_ORAN_BERRY].holdEffect == HOLD_EFFECT_RESTORE_HP); ASSUME(gItemsInfo[ITEM_BERRY_JUICE].holdEffect == HOLD_EFFECT_RESTORE_HP); ASSUME(gItemsInfo[ITEM_SITRUS_BERRY].holdEffect == HOLD_EFFECT_RESTORE_PCT_HP); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WYNAUT) { MaxHP(100); HP(51); Item(item); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { TURN { MOVE(playerLeft, MOVE_FIRE_PLEDGE, target: opponentRight); MOVE(playerRight, MOVE_GRASS_PLEDGE, target: opponentRight); } } SCENE { ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, playerRight); MESSAGE("A sea of fire enveloped the opposing team!"); MESSAGE("The opposing Wynaut was hurt by the sea of fire!"); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponentLeft); MESSAGE("The opposing Wobbuffet was hurt by the sea of fire!"); } } DOUBLE_BATTLE_TEST("Restore HP Item effects do not miss timing after a recoil move") { u16 item; PARAMETRIZE { item = ITEM_BERRY_JUICE; } PARAMETRIZE { item = ITEM_ORAN_BERRY; } PARAMETRIZE { item = ITEM_SITRUS_BERRY; } GIVEN { ASSUME(gMovesInfo[MOVE_TAKE_DOWN].recoil == 25); ASSUME(gItemsInfo[ITEM_ORAN_BERRY].holdEffect == HOLD_EFFECT_RESTORE_HP); ASSUME(gItemsInfo[ITEM_BERRY_JUICE].holdEffect == HOLD_EFFECT_RESTORE_HP); ASSUME(gItemsInfo[ITEM_SITRUS_BERRY].holdEffect == HOLD_EFFECT_RESTORE_PCT_HP); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WYNAUT) { MaxHP(100); HP(51); Item(item); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { TURN { MOVE(opponentLeft, MOVE_TAKE_DOWN, target: playerLeft); MOVE(opponentRight, MOVE_CELEBRATE); MOVE(playerLeft, MOVE_CELEBRATE); MOVE(playerRight, MOVE_CELEBRATE); } } SCENE { ANIMATION(ANIM_TYPE_MOVE, MOVE_TAKE_DOWN, opponentLeft); HP_BAR(playerLeft); HP_BAR(opponentLeft); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponentLeft); HP_BAR(opponentLeft); ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerLeft); ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerRight); } }