mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 19:54:21 +01:00
2eabcea86e
* items that can be used in battle now use battlescripts * removed ExecuteTableBasedItemEffect_ * taught AI how to use items, removed AI_itemtype/flag * X-Items store stages raised in holdEffectParam * USE_ITEM in tests
38 lines
1.0 KiB
C
38 lines
1.0 KiB
C
#include "global.h"
|
|
#include "test_battle.h"
|
|
|
|
SINGLE_BATTLE_TEST("Potion restores a battler's HP by 20")
|
|
{
|
|
s16 damage;
|
|
GIVEN {
|
|
ASSUME(gItems[ITEM_POTION].battleUsage == EFFECT_ITEM_RESTORE_HP);
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(50); MaxHP(100); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { USE_ITEM(player, ITEM_POTION, partyIndex: 0); }
|
|
} SCENE {
|
|
HP_BAR(player, captureDamage: &damage);
|
|
} FINALLY {
|
|
EXPECT_EQ(damage, -20);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Sitrus Berry restores a battler's HP")
|
|
{
|
|
s16 damage;
|
|
GIVEN {
|
|
ASSUME(gItems[ITEM_SITRUS_BERRY].battleUsage == EFFECT_ITEM_RESTORE_HP);
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(50); MaxHP(100); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { USE_ITEM(player, ITEM_SITRUS_BERRY, partyIndex: 0); }
|
|
} SCENE {
|
|
HP_BAR(player, captureDamage: &damage);
|
|
} FINALLY {
|
|
if (I_SITRUS_BERRY_HEAL >= GEN_4)
|
|
EXPECT_EQ(damage, -25);
|
|
else
|
|
EXPECT_EQ(damage, -30);
|
|
}
|
|
}
|