Fix status curing of full restore when used on party member (#4603)
* fix getboxmondata for evolutiontracker if compiled with agbcc * fixed full restore curing status condition when used in battle on party member with missing hp added more full restore tests * formatting, removed unused
This commit is contained in:
parent
57ec87387d
commit
b73e33618d
5 changed files with 72 additions and 9 deletions
|
@ -1387,9 +1387,10 @@
|
||||||
.4byte \jumpInstr
|
.4byte \jumpInstr
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro itemrestorehp jumpInstr:req
|
.macro itemrestorehp jumpInstr:req, restoreBattlerInstr:req
|
||||||
callnative BS_ItemRestoreHP
|
callnative BS_ItemRestoreHP
|
||||||
.4byte \jumpInstr
|
.4byte \jumpInstr
|
||||||
|
.4byte \restoreBattlerInstr
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro itemcurestatus jumpInstr:req
|
.macro itemcurestatus jumpInstr:req
|
||||||
|
|
|
@ -57,7 +57,11 @@ BattleScript_ItemRestoreHPRet:
|
||||||
|
|
||||||
BattleScript_ItemRestoreHP::
|
BattleScript_ItemRestoreHP::
|
||||||
call BattleScript_UseItemMessage
|
call BattleScript_UseItemMessage
|
||||||
itemrestorehp BattleScript_ItemRestoreHPEnd
|
itemrestorehp BattleScript_ItemRestoreHPEnd, BattleScript_ItemRestoreHP_Battler
|
||||||
|
call BattleScript_ItemRestoreHP_Party
|
||||||
|
goto BattleScript_ItemRestoreHPEnd
|
||||||
|
|
||||||
|
BattleScript_ItemRestoreHP_Battler::
|
||||||
call BattleScript_ItemRestoreHPRet
|
call BattleScript_ItemRestoreHPRet
|
||||||
BattleScript_ItemRestoreHPEnd:
|
BattleScript_ItemRestoreHPEnd:
|
||||||
end
|
end
|
||||||
|
@ -67,7 +71,7 @@ BattleScript_ItemRestoreHP_Party::
|
||||||
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
||||||
printstring STRINGID_ITEMRESTOREDSPECIESHEALTH
|
printstring STRINGID_ITEMRESTOREDSPECIESHEALTH
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
end
|
return
|
||||||
|
|
||||||
BattleScript_ItemRestoreHP_SendOutRevivedBattler:
|
BattleScript_ItemRestoreHP_SendOutRevivedBattler:
|
||||||
switchinanim BS_SCRIPTING, FALSE
|
switchinanim BS_SCRIPTING, FALSE
|
||||||
|
@ -87,8 +91,13 @@ BattleScript_ItemCureStatusEnd:
|
||||||
|
|
||||||
BattleScript_ItemHealAndCureStatus::
|
BattleScript_ItemHealAndCureStatus::
|
||||||
call BattleScript_UseItemMessage
|
call BattleScript_UseItemMessage
|
||||||
itemrestorehp BattleScript_ItemCureStatusAfterItemMsg
|
itemrestorehp BattleScript_ItemCureStatusAfterItemMsg, BattleScript_ItemHealAndCureStatus_Battler
|
||||||
|
call BattleScript_ItemRestoreHP_Party
|
||||||
|
goto BattleScript_ItemHealAndCureStatusEnd
|
||||||
|
|
||||||
|
BattleScript_ItemHealAndCureStatus_Battler::
|
||||||
call BattleScript_ItemRestoreHPRet
|
call BattleScript_ItemRestoreHPRet
|
||||||
|
BattleScript_ItemHealAndCureStatusEnd::
|
||||||
goto BattleScript_ItemCureStatusAfterItemMsg
|
goto BattleScript_ItemCureStatusAfterItemMsg
|
||||||
|
|
||||||
BattleScript_ItemIncreaseStat::
|
BattleScript_ItemIncreaseStat::
|
||||||
|
|
|
@ -496,7 +496,6 @@ extern const u8 BattleScript_TheRainbowDisappeared[];
|
||||||
extern const u8 BattleScript_HurtByTheSeaOfFire[];
|
extern const u8 BattleScript_HurtByTheSeaOfFire[];
|
||||||
extern const u8 BattleScript_TheSeaOfFireDisappeared[];
|
extern const u8 BattleScript_TheSeaOfFireDisappeared[];
|
||||||
extern const u8 BattleScript_TheSwampDisappeared[];
|
extern const u8 BattleScript_TheSwampDisappeared[];
|
||||||
extern const u8 BattleScript_ItemRestoreHP_Party[];
|
|
||||||
extern const u8 BattleScript_EffectPsychicNoise[];
|
extern const u8 BattleScript_EffectPsychicNoise[];
|
||||||
extern const u8 BattleScript_AromaVeilProtectsRet[];
|
extern const u8 BattleScript_AromaVeilProtectsRet[];
|
||||||
|
|
||||||
|
|
|
@ -16021,7 +16021,7 @@ void ApplyExperienceMultipliers(s32 *expAmount, u8 expGetterMonId, u8 faintedBat
|
||||||
|
|
||||||
void BS_ItemRestoreHP(void)
|
void BS_ItemRestoreHP(void)
|
||||||
{
|
{
|
||||||
NATIVE_ARGS(const u8 *alreadyMaxHpInstr);
|
NATIVE_ARGS(const u8 *alreadyMaxHpInstr, const u8 *restoreBattlerInstr);
|
||||||
u16 healAmount;
|
u16 healAmount;
|
||||||
u32 battler = MAX_BATTLERS_COUNT;
|
u32 battler = MAX_BATTLERS_COUNT;
|
||||||
u32 healParam = ItemId_GetEffect(gLastUsedItem)[6];
|
u32 healParam = ItemId_GetEffect(gLastUsedItem)[6];
|
||||||
|
@ -16074,7 +16074,7 @@ void BS_ItemRestoreHP(void)
|
||||||
if (battler != MAX_BATTLERS_COUNT && hp != 0)
|
if (battler != MAX_BATTLERS_COUNT && hp != 0)
|
||||||
{
|
{
|
||||||
gBattleMoveDamage = -healAmount;
|
gBattleMoveDamage = -healAmount;
|
||||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
gBattlescriptCurrInstr = cmd->restoreBattlerInstr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -16087,7 +16087,7 @@ void BS_ItemRestoreHP(void)
|
||||||
gAbsentBattlerFlags &= ~gBitTable[battler];
|
gAbsentBattlerFlags &= ~gBitTable[battler];
|
||||||
gBattleCommunication[MULTIUSE_STATE] = TRUE;
|
gBattleCommunication[MULTIUSE_STATE] = TRUE;
|
||||||
}
|
}
|
||||||
gBattlescriptCurrInstr = BattleScript_ItemRestoreHP_Party;
|
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ SINGLE_BATTLE_TEST("Full Restore restores a battler's HP and cures any primary s
|
||||||
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(300); Status1(status); }
|
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(300); Status1(status); }
|
||||||
OPPONENT(SPECIES_WOBBUFFET);
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
} WHEN {
|
} WHEN {
|
||||||
TURN{ USE_ITEM(player, ITEM_FULL_RESTORE, partyIndex: 0); }
|
TURN { USE_ITEM(player, ITEM_FULL_RESTORE, partyIndex: 0); }
|
||||||
} SCENE {
|
} SCENE {
|
||||||
MESSAGE("Wobbuffet had its HP restored!");
|
MESSAGE("Wobbuffet had its HP restored!");
|
||||||
if (status != STATUS1_NONE) {
|
if (status != STATUS1_NONE) {
|
||||||
|
@ -32,6 +32,35 @@ SINGLE_BATTLE_TEST("Full Restore restores a battler's HP and cures any primary s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Full Restore restores a party members HP and cures any primary status")
|
||||||
|
{
|
||||||
|
u16 status;
|
||||||
|
PARAMETRIZE{ status = STATUS1_BURN; }
|
||||||
|
PARAMETRIZE{ status = STATUS1_FREEZE; }
|
||||||
|
PARAMETRIZE{ status = STATUS1_PARALYSIS; }
|
||||||
|
PARAMETRIZE{ status = STATUS1_POISON; }
|
||||||
|
PARAMETRIZE{ status = STATUS1_TOXIC_POISON; }
|
||||||
|
PARAMETRIZE{ status = STATUS1_SLEEP; }
|
||||||
|
PARAMETRIZE{ status = STATUS1_NONE; }
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(300); Status1(status); }
|
||||||
|
PLAYER(SPECIES_WYNAUT) { HP(1); MaxHP(300); Status1(status); }
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { USE_ITEM(player, ITEM_FULL_RESTORE, partyIndex: 1); }
|
||||||
|
TURN { SWITCH(player, 1); }
|
||||||
|
} SCENE {
|
||||||
|
MESSAGE("Wynaut had its HP restored!");
|
||||||
|
if (status != STATUS1_NONE) {
|
||||||
|
MESSAGE("Wynaut had its status healed!"); // The message is not printed if status wasn't healed.
|
||||||
|
}
|
||||||
|
} THEN {
|
||||||
|
EXPECT_EQ(player->hp, player->maxHP);
|
||||||
|
EXPECT_EQ(player->species, SPECIES_WYNAUT);
|
||||||
|
EXPECT_EQ(player->status1, STATUS1_NONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SINGLE_BATTLE_TEST("Full Restore heals a battler from any primary status")
|
SINGLE_BATTLE_TEST("Full Restore heals a battler from any primary status")
|
||||||
{
|
{
|
||||||
u16 status;
|
u16 status;
|
||||||
|
@ -54,6 +83,31 @@ SINGLE_BATTLE_TEST("Full Restore heals a battler from any primary status")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Full Restore heals a party member from any primary status")
|
||||||
|
{
|
||||||
|
u16 status;
|
||||||
|
PARAMETRIZE{ status = STATUS1_BURN; }
|
||||||
|
PARAMETRIZE{ status = STATUS1_FREEZE; }
|
||||||
|
PARAMETRIZE{ status = STATUS1_PARALYSIS; }
|
||||||
|
PARAMETRIZE{ status = STATUS1_POISON; }
|
||||||
|
PARAMETRIZE{ status = STATUS1_TOXIC_POISON; }
|
||||||
|
PARAMETRIZE{ status = STATUS1_SLEEP; }
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
PLAYER(SPECIES_WYNAUT) { Status1(status); }
|
||||||
|
OPPONENT(SPECIES_WYNAUT);
|
||||||
|
} WHEN {
|
||||||
|
TURN { USE_ITEM(player, ITEM_FULL_RESTORE, partyIndex: 1); }
|
||||||
|
TURN { SWITCH(player, 1); }
|
||||||
|
} SCENE {
|
||||||
|
NOT MESSAGE("Wynaut had its HP restored!"); // The message is not printed if mon has max HP.
|
||||||
|
MESSAGE("Wynaut had its status healed!");
|
||||||
|
} THEN {
|
||||||
|
EXPECT_EQ(player->species, SPECIES_WYNAUT);
|
||||||
|
EXPECT_EQ(player->status1, STATUS1_NONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SINGLE_BATTLE_TEST("Full Restore restores a battler's HP and cures confusion")
|
SINGLE_BATTLE_TEST("Full Restore restores a battler's HP and cures confusion")
|
||||||
{
|
{
|
||||||
GIVEN {
|
GIVEN {
|
||||||
|
|
Loading…
Reference in a new issue