diff --git a/include/battle_controllers.h b/include/battle_controllers.h index 1de4f6b3d846..3fdebbb06a87 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -62,7 +62,7 @@ enum { REQUEST_SMART_RIBBON_BATTLE, REQUEST_TOUGH_RIBBON_BATTLE, REQUEST_IS_SHADOW_BATTLE, - // REQUEST_REVERSE_MODE_BATTLE, + REQUEST_REVERSE_MODE_BATTLE, REQUEST_HEART_VALUE_BATTLE, REQUEST_HEART_MAX_BATTLE, }; diff --git a/include/constants/battle.h b/include/constants/battle.h index df58dd816704..1df756af9410 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -116,7 +116,6 @@ #define STATUS1_TOXIC_COUNTER (1 << 8 | 1 << 9 | 1 << 10 | 1 << 11) #define STATUS1_TOXIC_TURN(num) ((num) << 8) #define STATUS1_FROSTBITE (1 << 12) -#define STATUS1_REVERSE_MODE (1 << 13) #define STATUS1_PSN_ANY (STATUS1_POISON | STATUS1_TOXIC_POISON) #define STATUS1_ANY (STATUS1_SLEEP | STATUS1_POISON | STATUS1_BURN | STATUS1_FREEZE | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON | STATUS1_FROSTBITE) diff --git a/include/constants/party_menu.h b/include/constants/party_menu.h index a0d75b8160ce..a454111122a2 100644 --- a/include/constants/party_menu.h +++ b/include/constants/party_menu.h @@ -12,7 +12,7 @@ #define AILMENT_PKRS 6 #define AILMENT_FNT 7 #define AILMENT_FSB 8 -#define AILMENT_SHDW 9 +#define AILMENT_SHADOW 9 #define PARTY_LAYOUT_SINGLE 0 #define PARTY_LAYOUT_DOUBLE 1 diff --git a/include/pokemon.h b/include/pokemon.h index 4b5e03756473..7370226afc5d 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -354,7 +354,7 @@ struct BattlePokemon /*0x5A*/ u8 shadowAggro:3; /*0x5A*/ u8 isReverse:1; /*0x5A*/ u8 snagged:1; - /*0x5A*/ u8 filler:2; + /*0x5A*/ u8 filler:3; /*0x5B*/ u8 shadowID; /*0x5C*/ u16 heartVal; /*0x5E*/ u16 heartMax; diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 2d0f6015998e..169eb2e56282 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -3045,7 +3045,7 @@ bool32 AnyPartyMemberStatused(u8 battlerId, bool32 checkSoundproof) if (checkSoundproof && GetMonAbility(&party[i]) == ABILITY_SOUNDPROOF) continue; - if (GetMonData(&party[i], MON_DATA_STATUS) & ~STATUS1_REVERSE_MODE) + if (GetMonData(&party[i], MON_DATA_STATUS)) return TRUE; } @@ -3332,7 +3332,7 @@ bool32 ShouldUseWishAromatherapy(u8 battlerAtk, u8 battlerDef, u16 move) needHealing = TRUE; } - if (GetMonData(&party[i], MON_DATA_STATUS, NULL) & ~STATUS1_REVERSE_MODE) + if (GetMonData(&party[i], MON_DATA_STATUS, NULL)) { if (move != MOVE_HEAL_BELL || GetMonAbility(&party[i]) != ABILITY_SOUNDPROOF) hasStatus = TRUE; diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 725d35feb60f..b524de325d2d 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -864,10 +864,10 @@ static u32 CopyLinkOpponentMonData(u8 monId, u8 *dst) dst[0] = GetMonData(&gEnemyParty[monId], MON_DATA_IS_SHADOW); size = 1; break; - // case REQUEST_REVERSE_MODE_BATTLE: - // dst[0] = GetMonData(&gEnemyParty[monId], MON_DATA_REVERSE_MODE); - // size = 1; - // break; + case REQUEST_REVERSE_MODE_BATTLE: + dst[0] = GetMonData(&gEnemyParty[monId], MON_DATA_REVERSE_MODE); + size = 1; + break; case REQUEST_HEART_VALUE_BATTLE: dst[0] = GetMonData(&gEnemyParty[monId], MON_DATA_HEART_VALUE); size = 1; @@ -1127,9 +1127,9 @@ static void SetLinkOpponentMonData(u8 monId) case REQUEST_IS_SHADOW_BATTLE: SetMonData(&gEnemyParty[monId], MON_DATA_IS_SHADOW, &gBattleResources->bufferA[gActiveBattler][3]); break; - // case REQUEST_REVERSE_MODE_BATTLE: - // SetMonData(&gEnemyParty[monId], MON_DATA_REVERSE_MODE, &gBattleResources->bufferA[gActiveBattler][3]); - // break; + case REQUEST_REVERSE_MODE_BATTLE: + SetMonData(&gEnemyParty[monId], MON_DATA_REVERSE_MODE, &gBattleResources->bufferA[gActiveBattler][3]); + break; case REQUEST_HEART_VALUE_BATTLE: SetMonData(&gEnemyParty[monId], MON_DATA_HEART_VALUE, &gBattleResources->bufferA[gActiveBattler][3]); break; diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 7264f4192c82..9d0406f535ed 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -758,10 +758,10 @@ static u32 CopyLinkPartnerMonData(u8 monId, u8 *dst) dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_IS_SHADOW); size = 1; break; - // case REQUEST_REVERSE_MODE_BATTLE: - // dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE); - // size = 1; - // break; + case REQUEST_REVERSE_MODE_BATTLE: + dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE); + size = 1; + break; case REQUEST_HEART_VALUE_BATTLE: dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_HEART_VALUE); size = 1; @@ -1021,9 +1021,9 @@ static void SetLinkPartnerMonData(u8 monId) case REQUEST_IS_SHADOW_BATTLE: SetMonData(&gPlayerParty[monId], MON_DATA_IS_SHADOW, &gBattleResources->bufferA[gActiveBattler][3]); break; - // case REQUEST_REVERSE_MODE_BATTLE: - // SetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE, &gBattleResources->bufferA[gActiveBattler][3]); - // break; + case REQUEST_REVERSE_MODE_BATTLE: + SetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE, &gBattleResources->bufferA[gActiveBattler][3]); + break; case REQUEST_HEART_VALUE_BATTLE: SetMonData(&gPlayerParty[monId], MON_DATA_HEART_VALUE, &gBattleResources->bufferA[gActiveBattler][3]); break; diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index d7f388538f18..0610958bbfb5 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -885,10 +885,10 @@ static u32 GetOpponentMonData(u8 monId, u8 *dst) dst[0] = GetMonData(&gEnemyParty[monId], MON_DATA_IS_SHADOW); size = 1; break; - // case REQUEST_REVERSE_MODE_BATTLE: - // dst[0] = GetMonData(&gEnemyParty[monId], MON_DATA_REVERSE_MODE); - // size = 1; - // break; + case REQUEST_REVERSE_MODE_BATTLE: + dst[0] = GetMonData(&gEnemyParty[monId], MON_DATA_REVERSE_MODE); + size = 1; + break; case REQUEST_HEART_VALUE_BATTLE: dst[0] = GetMonData(&gEnemyParty[monId], MON_DATA_HEART_VALUE); size = 1; @@ -1157,9 +1157,9 @@ static void SetOpponentMonData(u8 monId) case REQUEST_IS_SHADOW_BATTLE: SetMonData(&gEnemyParty[monId], MON_DATA_IS_SHADOW, &gBattleResources->bufferA[gActiveBattler][3]); break; - // case REQUEST_REVERSE_MODE_BATTLE: - // SetMonData(&gEnemyParty[monId], MON_DATA_REVERSE_MODE, &gBattleResources->bufferA[gActiveBattler][3]); - // break; + case REQUEST_REVERSE_MODE_BATTLE: + SetMonData(&gEnemyParty[monId], MON_DATA_REVERSE_MODE, &gBattleResources->bufferA[gActiveBattler][3]); + break; case REQUEST_HEART_VALUE_BATTLE: SetMonData(&gEnemyParty[monId], MON_DATA_HEART_VALUE, &gBattleResources->bufferA[gActiveBattler][3]); break; diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 58094007b57e..00c6a6d9400a 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -2142,10 +2142,10 @@ static u32 CopyPlayerMonData(u8 monId, u8 *dst) dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_IS_SHADOW); size = 1; break; - // case REQUEST_REVERSE_MODE_BATTLE: - // dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE); - // size = 1; - // break; + case REQUEST_REVERSE_MODE_BATTLE: + dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE); + size = 1; + break; case REQUEST_HEART_VALUE_BATTLE: dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_HEART_VALUE); size = 1; @@ -2414,9 +2414,9 @@ static void SetPlayerMonData(u8 monId) case REQUEST_IS_SHADOW_BATTLE: SetMonData(&gPlayerParty[monId], MON_DATA_IS_SHADOW, &gBattleResources->bufferA[gActiveBattler][3]); break; - // case REQUEST_REVERSE_MODE_BATTLE: - // SetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE, &gBattleResources->bufferA[gActiveBattler][3]); - // break; + case REQUEST_REVERSE_MODE_BATTLE: + SetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE, &gBattleResources->bufferA[gActiveBattler][3]); + break; case REQUEST_HEART_VALUE_BATTLE: SetMonData(&gPlayerParty[monId], MON_DATA_HEART_VALUE, &gBattleResources->bufferA[gActiveBattler][3]); break; diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index a787b2a6f080..0c3455528706 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -953,10 +953,10 @@ static u32 CopyPlayerPartnerMonData(u8 monId, u8 *dst) dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_IS_SHADOW); size = 1; break; - // case REQUEST_REVERSE_MODE_BATTLE: - // dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE); - // size = 1; - // break; + case REQUEST_REVERSE_MODE_BATTLE: + dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE); + size = 1; + break; case REQUEST_HEART_VALUE_BATTLE: dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_HEART_VALUE); size = 1; @@ -1216,9 +1216,9 @@ static void SetPlayerPartnerMonData(u8 monId) case REQUEST_IS_SHADOW_BATTLE: SetMonData(&gPlayerParty[monId], MON_DATA_IS_SHADOW, &gBattleResources->bufferA[gActiveBattler][3]); break; - // case REQUEST_REVERSE_MODE_BATTLE: - // SetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE, &gBattleResources->bufferA[gActiveBattler][3]); - // break; + case REQUEST_REVERSE_MODE_BATTLE: + SetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE, &gBattleResources->bufferA[gActiveBattler][3]); + break; case REQUEST_HEART_VALUE_BATTLE: SetMonData(&gPlayerParty[monId], MON_DATA_HEART_VALUE, &gBattleResources->bufferA[gActiveBattler][3]); break; diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index e800ed1253a0..a3030d59cf47 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -853,10 +853,10 @@ static u32 CopyRecordedOpponentMonData(u8 monId, u8 *dst) dst[0] = GetMonData(&gEnemyParty[monId], MON_DATA_IS_SHADOW); size = 1; break; - // case REQUEST_REVERSE_MODE_BATTLE: - // dst[0] = GetMonData(&gEnemyParty[monId], MON_DATA_REVERSE_MODE); - // size = 1; - // break; + case REQUEST_REVERSE_MODE_BATTLE: + dst[0] = GetMonData(&gEnemyParty[monId], MON_DATA_REVERSE_MODE); + size = 1; + break; case REQUEST_HEART_VALUE_BATTLE: dst[0] = GetMonData(&gEnemyParty[monId], MON_DATA_HEART_VALUE); size = 1; @@ -1116,9 +1116,9 @@ static void SetRecordedOpponentMonData(u8 monId) case REQUEST_IS_SHADOW_BATTLE: SetMonData(&gEnemyParty[monId], MON_DATA_IS_SHADOW, &gBattleResources->bufferA[gActiveBattler][3]); break; - // case REQUEST_REVERSE_MODE_BATTLE: - // SetMonData(&gEnemyParty[monId], MON_DATA_REVERSE_MODE, &gBattleResources->bufferA[gActiveBattler][3]); - // break; + case REQUEST_REVERSE_MODE_BATTLE: + SetMonData(&gEnemyParty[monId], MON_DATA_REVERSE_MODE, &gBattleResources->bufferA[gActiveBattler][3]); + break; case REQUEST_HEART_VALUE_BATTLE: SetMonData(&gEnemyParty[monId], MON_DATA_HEART_VALUE, &gBattleResources->bufferA[gActiveBattler][3]); break; @@ -1540,7 +1540,7 @@ static void RecordedOpponentHandleStatusIconUpdate(void) gBattlerControllerFuncs[gActiveBattler] = CompleteOnFinishedStatusAnimation; if (gTestRunnerEnabled) - TestRunner_Battle_RecordStatus1(battlerId, GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_STATUS) & ~STATUS1_REVERSE_MODE); + TestRunner_Battle_RecordStatus1(battlerId, GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_STATUS)); } } diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index 4513f410866a..d234bb5e49f8 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -832,10 +832,10 @@ static u32 CopyRecordedPlayerMonData(u8 monId, u8 *dst) dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_IS_SHADOW); size = 1; break; - // case REQUEST_REVERSE_MODE_BATTLE: - // dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE); - // size = 1; - // break; + case REQUEST_REVERSE_MODE_BATTLE: + dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE); + size = 1; + break; case REQUEST_HEART_VALUE_BATTLE: dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_HEART_VALUE); size = 1; @@ -1095,9 +1095,9 @@ static void SetRecordedPlayerMonData(u8 monId) case REQUEST_IS_SHADOW_BATTLE: SetMonData(&gPlayerParty[monId], MON_DATA_IS_SHADOW, &gBattleResources->bufferA[gActiveBattler][3]); break; - // case REQUEST_REVERSE_MODE_BATTLE: - // SetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE, &gBattleResources->bufferA[gActiveBattler][3]); - // break; + case REQUEST_REVERSE_MODE_BATTLE: + SetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE, &gBattleResources->bufferA[gActiveBattler][3]); + break; case REQUEST_HEART_VALUE_BATTLE: SetMonData(&gPlayerParty[monId], MON_DATA_HEART_VALUE, &gBattleResources->bufferA[gActiveBattler][3]); break; @@ -1562,7 +1562,7 @@ static void RecordedPlayerHandleStatusIconUpdate(void) gBattlerControllerFuncs[gActiveBattler] = CompleteOnFinishedStatusAnimation; if (gTestRunnerEnabled) - TestRunner_Battle_RecordStatus1(battlerId, GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_STATUS) & ~STATUS1_REVERSE_MODE); + TestRunner_Battle_RecordStatus1(battlerId, GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_STATUS)); } } diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index da822a852658..5ba26b8a7c2a 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -760,10 +760,10 @@ static u32 CopyWallyMonData(u8 monId, u8 *dst) dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_IS_SHADOW); size = 1; break; - // case REQUEST_REVERSE_MODE_BATTLE: - // dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE); - // size = 1; - // break; + case REQUEST_REVERSE_MODE_BATTLE: + dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE); + size = 1; + break; case REQUEST_HEART_VALUE_BATTLE: dst[0] = GetMonData(&gPlayerParty[monId], MON_DATA_HEART_VALUE); size = 1; @@ -1023,9 +1023,9 @@ static void SetWallyMonData(u8 monId) case REQUEST_IS_SHADOW_BATTLE: SetMonData(&gPlayerParty[monId], MON_DATA_IS_SHADOW, &gBattleResources->bufferA[gActiveBattler][3]); break; - // case REQUEST_REVERSE_MODE_BATTLE: - // SetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE, &gBattleResources->bufferA[gActiveBattler][3]); - // break; + case REQUEST_REVERSE_MODE_BATTLE: + SetMonData(&gPlayerParty[monId], MON_DATA_REVERSE_MODE, &gBattleResources->bufferA[gActiveBattler][3]); + break; case REQUEST_HEART_VALUE_BATTLE: SetMonData(&gPlayerParty[monId], MON_DATA_HEART_VALUE, &gBattleResources->bufferA[gActiveBattler][3]); break; diff --git a/src/battle_debug.c b/src/battle_debug.c index 23c8e51b3aa5..3e704b5863a3 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -181,7 +181,6 @@ static const u8 sText_MaxHp[] = _("HP Max"); static const u8 sText_CurrHp[] = _("HP Current"); static const u8 sText_Freeze[] = _("Freeze"); static const u8 sText_Frostbite[] = _("Frostbite"); -static const u8 sText_ReverseMode[] = _("Reverse Mode"); static const u8 sText_ToxicPoison[] = _("Toxic Poison"); static const u8 sText_ToxicCounter[] = _("Toxic Counter"); static const u8 sText_Flinch[] = _("Flinch"); @@ -259,7 +258,6 @@ static const struct BitfieldInfo sStatus1Bitfield[] = {/*Toxic Poison*/ 1, 7}, {/*Toxic Counter*/ 4, 8}, {/*Frostbite*/ 1, 12}, - {/*Reverse Mode*/1, 13}, }; static const struct BitfieldInfo sStatus2Bitfield[] = @@ -400,7 +398,6 @@ static const struct ListMenuItem sStatus1ListItems[] = {sText_ToxicPoison, 5}, {sText_ToxicCounter, 6}, {sText_Frostbite, 7}, - {sText_ReverseMode, 8} }; static const struct ListMenuItem sStatus2ListItems[] = diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index bf3a614f2a7a..cbf244ad5253 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -137,7 +137,7 @@ void ShdwLoadHealthboxPalette(u8 battlerId) LoadSpritePalette(&gSpritePalettes_HealthBoxHealthBar[palNum]); - if (GetMonData(mon, MON_DATA_STATUS) & ~STATUS1_REVERSE_MODE) + if (GetMonData(mon, MON_DATA_STATUS)) UpdateHealthboxAttribute(gHealthboxSpriteIds[battlerId], mon, HEALTHBOX_STATUS_ICON); } @@ -477,8 +477,6 @@ void InitAndLaunchChosenStatusAnimation(bool8 isStatus2, u32 status) LaunchStatusAnimation(gActiveBattler, B_ANIM_STATUS_SLP); else if (status == STATUS1_PARALYSIS) LaunchStatusAnimation(gActiveBattler, B_ANIM_STATUS_PRZ); - else if (status == STATUS1_REVERSE_MODE) - LaunchStatusAnimation(gActiveBattler, B_ANIM_STATUS_REVERSE_MODE); else // no animation gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].statusAnimActive = 0; } @@ -1302,7 +1300,7 @@ bool32 ShouldPlayNormalMonCry(struct Pokemon *mon) s16 hp, maxHP; s32 barLevel; - if (GetMonData(mon, MON_DATA_STATUS) & (STATUS1_ANY | STATUS1_TOXIC_COUNTER | STATUS1_REVERSE_MODE)) + if (GetMonData(mon, MON_DATA_STATUS) & (STATUS1_ANY | STATUS1_TOXIC_COUNTER)) return FALSE; hp = GetMonData(mon, MON_DATA_HP); diff --git a/src/battle_interface.c b/src/battle_interface.c index 2be34857680f..a582769319da 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -1008,7 +1008,7 @@ static void UpdateLvlInHealthbox(u8 healthboxSpriteId, u8 lvl) u32 xPos; u8 *objVram; u8 battler = gSprites[healthboxSpriteId].hMain_Battler; - bool32 reverse = (gBattleMons[battler].status1 & STATUS1_REVERSE_MODE) ? TRUE : FALSE; + bool32 reverse = gBattleMons[battler].isReverse;; // Don't print Lv char if mon is mega evolved, primal reverted, or reverse mode. if (IsBattlerMegaEvolved(battler) || IsBattlerPrimalReverted(battler) || reverse) @@ -1538,7 +1538,7 @@ static bool32 MegaIndicator_ShouldBeInvisible(u32 battlerId, struct Sprite *spri u32 side = GetBattlerSide(battlerId); bool32 megaEvolved = IsBattlerMegaEvolved(battlerId); bool32 primalReverted = IsBattlerPrimalReverted(battlerId); - bool32 reverseMode = (gBattleMons[battlerId].status1 & STATUS1_REVERSE_MODE) ? TRUE : FALSE; + bool32 reverseMode = gBattleMons[battlerId].isReverse; if (!reverseMode && !megaEvolved && !primalReverted) return TRUE; @@ -2200,7 +2200,7 @@ static void UpdateStatusIconInHealthbox(u8 healthboxSpriteId) healthBarSpriteId = gSprites[healthboxSpriteId].hMain_HealthBarSpriteId; if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) { - status = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_STATUS) & ~STATUS1_REVERSE_MODE; + status = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_STATUS); if (!WhichBattleCoords(battlerId)) tileNumAdder = 0x1A; else @@ -2208,7 +2208,7 @@ static void UpdateStatusIconInHealthbox(u8 healthboxSpriteId) } else { - status = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_STATUS) & ~STATUS1_REVERSE_MODE; + status = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_STATUS); tileNumAdder = 0x11; } diff --git a/src/battle_pike.c b/src/battle_pike.c index 8965fca57ac0..37dfd9997d19 100644 --- a/src/battle_pike.c +++ b/src/battle_pike.c @@ -935,7 +935,7 @@ static bool8 TryInflictRandomStatus(void) for (i = 0; i < FRONTIER_PARTY_SIZE; i++) { mon = &gPlayerParty[indices[i]]; - if (GetAilmentFromStatus(GetMonData(mon, MON_DATA_STATUS) & ~STATUS1_REVERSE_MODE) == AILMENT_NONE + if (GetAilmentFromStatus(GetMonData(mon, MON_DATA_STATUS)) == AILMENT_NONE && GetMonData(mon, MON_DATA_HP) != 0) { j++; @@ -978,7 +978,7 @@ static bool8 TryInflictRandomStatus(void) for (i = 0; i < FRONTIER_PARTY_SIZE; i++) { mon = &gPlayerParty[indices[i]]; - if (GetAilmentFromStatus(GetMonData(mon, MON_DATA_STATUS) & ~STATUS1_REVERSE_MODE) == AILMENT_NONE + if (GetAilmentFromStatus(GetMonData(mon, MON_DATA_STATUS)) == AILMENT_NONE && GetMonData(mon, MON_DATA_HP) != 0) { j++; @@ -1010,7 +1010,7 @@ static bool8 AtLeastOneHealthyMon(void) for (i = 0; i < FRONTIER_PARTY_SIZE; i++) { struct Pokemon *mon = &gPlayerParty[i]; - if (GetAilmentFromStatus(GetMonData(mon, MON_DATA_STATUS) & ~STATUS1_REVERSE_MODE) == AILMENT_NONE + if (GetAilmentFromStatus(GetMonData(mon, MON_DATA_STATUS)) == AILMENT_NONE && GetMonData(mon, MON_DATA_HP) != 0) { healthyMonsCount++; @@ -1300,7 +1300,7 @@ static void TryHealMons(u8 healCount) { canBeHealed = TRUE; } - else if (GetAilmentFromStatus(GetMonData(mon, MON_DATA_STATUS) & ~STATUS1_REVERSE_MODE) != AILMENT_NONE) + else if (GetAilmentFromStatus(GetMonData(mon, MON_DATA_STATUS)) != AILMENT_NONE) { canBeHealed = TRUE; } @@ -1568,7 +1568,7 @@ static void IsPartyFullHealed(void) struct Pokemon *mon = &gPlayerParty[i]; u16 curr = GetMonData(mon, MON_DATA_HP); u16 max = GetMonData(mon, MON_DATA_MAX_HP); - if (curr >= max && GetAilmentFromStatus(GetMonData(mon, MON_DATA_STATUS) & ~STATUS1_REVERSE_MODE) == AILMENT_NONE) + if (curr >= max && GetAilmentFromStatus(GetMonData(mon, MON_DATA_STATUS)) == AILMENT_NONE) { u8 ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES); for (j = 0; j < MAX_MON_MOVES; j++) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d51cafe6aa57..68f3505f1452 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2969,7 +2969,7 @@ void SetMoveEffect(bool32 primary, u32 certain) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT; RESET_RETURN } - if (gBattleMons[gEffectBattler].status1 & ~STATUS1_REVERSE_MODE) + if (gBattleMons[gEffectBattler].status1) break; if (CanBePoisoned(gBattleScripting.battler, gEffectBattler)) { @@ -3142,7 +3142,7 @@ void SetMoveEffect(bool32 primary, u32 certain) gBattlescriptCurrInstr++; break; case MOVE_EFFECT_TRI_ATTACK: - if (gBattleMons[gEffectBattler].status1 & ~STATUS1_REVERSE_MODE) + if (gBattleMons[gEffectBattler].status1) { gBattlescriptCurrInstr++; } @@ -3611,7 +3611,7 @@ void SetMoveEffect(bool32 primary, u32 certain) gBattlescriptCurrInstr++; break; case MOVE_EFFECT_DIRE_CLAW: - if (!gBattleMons[gEffectBattler].status1 & ~STATUS1_REVERSE_MODE) + if (!gBattleMons[gEffectBattler].status1) { static const u8 sDireClawEffects[] = { MOVE_EFFECT_POISON, MOVE_EFFECT_PARALYSIS, MOVE_EFFECT_SLEEP }; gBattleScripting.moveEffect = RandomElement(RNG_DIRE_CLAW, sDireClawEffects); @@ -5356,7 +5356,7 @@ static void Cmd_moveend(void) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; - gBattleMons[gBattlerAttacker].status1 |= STATUS1_BURN; + gBattleMons[gBattlerAttacker].status1 = STATUS1_BURN; gActiveBattler = gBattlerAttacker; BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); MarkBattlerForControllerExec(gActiveBattler); @@ -5895,14 +5895,14 @@ static void Cmd_moveend(void) break; } case MOVEEND_ENTER_REVERSE_MODE: - if (gBattleMons[gBattlerAttacker].isShadow == TRUE && !(gBattleMons[gBattlerAttacker].status1 & STATUS1_REVERSE_MODE) && GetBattlerSide(gBattlerAttacker) != B_SIDE_OPPONENT) + if (gBattleMons[gBattlerAttacker].isShadow == TRUE && !gBattleMons[gBattlerAttacker].isReverse && GetBattlerSide(gBattlerAttacker) != B_SIDE_OPPONENT) { u8 chance = GetReverseModeChance(&gBattleMons[gBattlerAttacker]); u8 roll = Random() % 100; if (roll < chance) { - gBattleMons[gBattlerAttacker].status1 |= STATUS1_REVERSE_MODE; + gBattleMons[gBattlerAttacker].isReverse = FALSE; BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gBattlerAttacker].status1), &gBattleMons[gBattlerAttacker].status1); UpdateHealthboxAttribute(gHealthboxSpriteIds[gBattlerAttacker], &gPlayerParty[gBattlerPartyIndexes[gBattlerAttacker]], HEALTHBOX_ALL); PrepareStringBattle(STRINGID_REVERSEMODE_ENTER, gBattlerAttacker); @@ -6909,7 +6909,7 @@ static void Cmd_switchineffects(void) // Healing Wish activates before hazards. // Starting from Gen8 - it heals only pokemon which can be healed. In gens 5,6,7 the effect activates anyways. else if (((gBattleStruct->storedHealingWish & gBitTable[gActiveBattler]) || (gBattleStruct->storedLunarDance & gBitTable[gActiveBattler])) - && (gBattleMons[gActiveBattler].hp != gBattleMons[gActiveBattler].maxHP || gBattleMons[gActiveBattler].status1 & ~STATUS1_REVERSE_MODE || B_HEALING_WISH_SWITCH < GEN_8)) + && (gBattleMons[gActiveBattler].hp != gBattleMons[gActiveBattler].maxHP || gBattleMons[gActiveBattler].status1 != 0 || B_HEALING_WISH_SWITCH < GEN_8)) { if (gBattleStruct->storedHealingWish & gBitTable[gActiveBattler]) { @@ -7582,7 +7582,7 @@ static void Cmd_statusanimation(void) && gDisableStructs[gActiveBattler].substituteHP == 0 && !(gHitMarker & HITMARKER_NO_ANIMATIONS)) { - BtlController_EmitStatusAnimation(BUFFER_A, FALSE, gBattleMons[gActiveBattler].status1 & ~STATUS1_REVERSE_MODE); + BtlController_EmitStatusAnimation(BUFFER_A, FALSE, gBattleMons[gActiveBattler].status1); MarkBattlerForControllerExec(gActiveBattler); } gBattlescriptCurrInstr = cmd->nextInstr; @@ -9277,7 +9277,7 @@ static void Cmd_various(void) case VARIOUS_CLEAR_STATUS: { VARIOUS_ARGS(); - gBattleMons[gActiveBattler].status1 &= STATUS1_REVERSE_MODE; + gBattleMons[gActiveBattler].status1 = 0; BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); MarkBattlerForControllerExec(gActiveBattler); break; @@ -9918,7 +9918,7 @@ static void Cmd_various(void) gBattlescriptCurrInstr = cmd->failInstr; return; } - gBattleMons[gBattlerTarget].status1 |= gBattleMons[gBattlerAttacker].status1 & STATUS1_ANY; + gBattleMons[gBattlerTarget].status1 = gBattleMons[gBattlerAttacker].status1 & STATUS1_ANY; gActiveBattler = gBattlerTarget; BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); MarkBattlerForControllerExec(gActiveBattler); @@ -9928,7 +9928,7 @@ static void Cmd_various(void) case VARIOUS_CURE_STATUS: { VARIOUS_ARGS(); - gBattleMons[gActiveBattler].status1 &= STATUS1_REVERSE_MODE; + gBattleMons[gActiveBattler].status1 = 0; BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); MarkBattlerForControllerExec(gActiveBattler); break; @@ -11504,8 +11504,7 @@ static void Cmd_trysetrest(void) else gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_REST; - gBattleMons[gBattlerTarget].status1 &= STATUS1_REVERSE_MODE; - gBattleMons[gBattlerTarget].status1 |= STATUS1_SLEEP_TURN(3); + gBattleMons[gBattlerTarget].status1 = STATUS1_SLEEP_TURN(3); BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); MarkBattlerForControllerExec(gActiveBattler); gBattlescriptCurrInstr = cmd->nextInstr; @@ -13422,7 +13421,7 @@ static void Cmd_healpartystatus(void) if (GetBattlerAbility(gBattlerAttacker) != ABILITY_SOUNDPROOF) { - gBattleMons[gBattlerAttacker].status1 &= STATUS1_REVERSE_MODE; + gBattleMons[gBattlerAttacker].status1 = 0; gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_NIGHTMARE; } else @@ -13438,7 +13437,7 @@ static void Cmd_healpartystatus(void) { if (GetBattlerAbility(gActiveBattler) != ABILITY_SOUNDPROOF) { - gBattleMons[gActiveBattler].status1 &= STATUS1_REVERSE_MODE; + gBattleMons[gActiveBattler].status1 = 0; gBattleMons[gActiveBattler].status2 &= ~STATUS2_NIGHTMARE; } else @@ -13478,14 +13477,14 @@ static void Cmd_healpartystatus(void) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SOOTHING_AROMA; toHeal = (1 << PARTY_SIZE) - 1; - gBattleMons[gBattlerAttacker].status1 &= STATUS1_REVERSE_MODE; + gBattleMons[gBattlerAttacker].status1 = 0; gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_NIGHTMARE; gActiveBattler = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerAttacker))); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && !(gAbsentBattlerFlags & gBitTable[gActiveBattler])) { - gBattleMons[gActiveBattler].status1 &= STATUS1_REVERSE_MODE; + gBattleMons[gActiveBattler].status1 = 0; gBattleMons[gActiveBattler].status2 &= ~STATUS2_NIGHTMARE; } @@ -14233,7 +14232,7 @@ static void Cmd_cureifburnedparalysedorpoisoned(void) if (gBattleMons[gBattlerAttacker].status1 & (STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON | STATUS1_FROSTBITE)) { - gBattleMons[gBattlerAttacker].status1 &= STATUS1_REVERSE_MODE; + gBattleMons[gBattlerAttacker].status1 = 0; gBattlescriptCurrInstr = cmd->nextInstr; gActiveBattler = gBattlerAttacker; BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); @@ -14835,7 +14834,7 @@ static void Cmd_switchoutabilities(void) switch (GetBattlerAbility(gActiveBattler)) { case ABILITY_NATURAL_CURE: - gBattleMons[gActiveBattler].status1 &= STATUS1_REVERSE_MODE; + gBattleMons[gActiveBattler].status1 = 0; BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, gBitTable[*(gBattleStruct->battlerPartyIndexes + gActiveBattler)], sizeof(gBattleMons[gActiveBattler].status1), @@ -15916,7 +15915,7 @@ static void Cmd_removeattackerstatus1(void) { CMD_ARGS(); - gBattleMons[gBattlerAttacker].status1 &= STATUS1_REVERSE_MODE; + gBattleMons[gBattlerAttacker].status1 = 0; gBattlescriptCurrInstr = cmd->nextInstr; } diff --git a/src/battle_util.c b/src/battle_util.c index 7e48a4991038..0d24e064eedd 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -671,9 +671,9 @@ void HandleAction_Run(void) } else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) { - if (gBattleMons[gBattlerAttacker].status1 & STATUS1_REVERSE_MODE) + if (gBattleMons[gBattlerAttacker].isReverse) { - gBattleMons[gBattlerAttacker].status1 &= ~STATUS1_REVERSE_MODE; + gBattleMons[gBattlerAttacker].isReverse = FALSE; gBattlescriptCurrInstr = BattleScript_TrainerCallToMonReverse; gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT; } @@ -3144,8 +3144,7 @@ u8 DoBattlerEndTurnEffects(void) case ENDTURN_REVERSE_MODE: MAGIC_GUARD_CHECK; - if ((gBattleMons[gActiveBattler].status1 & STATUS1_REVERSE_MODE) - && gBattleMons[gActiveBattler].hp != 0) + if (gBattleMons[gActiveBattler].isReverse && gBattleMons[gActiveBattler].hp != 0) { gBattleMoveDamage = (gBattleMons[gBattlerAttacker].maxHP / 16) + (Random() % 3) - 1; if (gBattleMoveDamage == 0) @@ -4826,7 +4825,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (gBattleMons[battler].status1 & (STATUS1_FREEZE | STATUS1_FROSTBITE)) StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn); - gBattleMons[battler].status1 &= STATUS1_REVERSE_MODE; + gBattleMons[battler].status1 = 0; gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE; gBattleScripting.battler = gActiveBattler = battler; BattleScriptPushCursorAndCallback(BattleScript_ShedSkinActivates); @@ -5864,7 +5863,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move switch (effect) { case 1: // status cleared - gBattleMons[battler].status1 &= STATUS1_REVERSE_MODE; + gBattleMons[battler].status1 = 0; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_AbilityCuredStatus; break; @@ -6885,7 +6884,7 @@ static u8 ItemEffectMoveEnd(u32 battlerId, u16 holdEffect) if (gBattleMons[battlerId].status2 & STATUS2_CONFUSION) StringCopy(gBattleTextBuff1, gStatusConditionString_ConfusionJpn); - gBattleMons[battlerId].status1 &= STATUS1_REVERSE_MODE; + gBattleMons[battlerId].status1 = 0; RemoveConfusionStatus(battlerId); BattleScriptPushCursor(); gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM; @@ -7125,7 +7124,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM; else gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_NORMALIZED_STATUS; - gBattleMons[battlerId].status1 &= STATUS1_REVERSE_MODE; + gBattleMons[battlerId].status1 = 0; RemoveConfusionStatus(battlerId); BattleScriptExecute(BattleScript_BerryCureChosenStatusEnd2); effect = ITEM_STATUS_CHANGE; @@ -7472,7 +7471,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM; else gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_NORMALIZED_STATUS; - gBattleMons[battlerId].status1 &= STATUS1_REVERSE_MODE; + gBattleMons[battlerId].status1 = 0; RemoveConfusionStatus(battlerId); BattleScriptExecute(BattleScript_BerryCureChosenStatusEnd2); effect = ITEM_STATUS_CHANGE; @@ -7817,7 +7816,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) if (CanBePoisoned(battlerId, battlerId)) { effect = ITEM_STATUS_CHANGE; - gBattleMons[battlerId].status1 |= STATUS1_TOXIC_POISON; + gBattleMons[battlerId].status1 = STATUS1_TOXIC_POISON; BattleScriptExecute(BattleScript_ToxicOrb); RecordItemEffectBattle(battlerId, battlerHoldEffect); } @@ -7826,7 +7825,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) if (CanBeBurned(battlerId)) { effect = ITEM_STATUS_CHANGE; - gBattleMons[battlerId].status1 |= STATUS1_BURN; + gBattleMons[battlerId].status1 = STATUS1_BURN; BattleScriptExecute(BattleScript_FlameOrb); RecordItemEffectBattle(battlerId, battlerHoldEffect); } diff --git a/src/debug.c b/src/debug.c index 8e2888f5f8c1..ffacba9daf99 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1790,9 +1790,7 @@ static void DebugAction_Util_PoisonMons(u8 taskId) && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG) { - - u32 curStatus = GetMonData(&gPlayerParty[i], MON_DATA_STATUS, 0) & STATUS1_REVERSE_MODE; - curStatus |= STATUS1_POISON; + u32 curStatus = STATUS1_POISON; SetMonData(&gPlayerParty[i], MON_DATA_STATUS, &curStatus); } } diff --git a/src/field_poison.c b/src/field_poison.c index 04c1d5696800..202be30e2018 100644 --- a/src/field_poison.c +++ b/src/field_poison.c @@ -43,11 +43,10 @@ static bool32 AllMonsFainted(void) static void FaintFromFieldPoison(u8 partyIdx) { struct Pokemon *pokemon = &gPlayerParty[partyIdx]; - u32 status = GetMonData(pokemon, MON_DATA_STATUS) & STATUS1_REVERSE_MODE; + u32 status = STATUS1_NONE; #if OW_POISON_DAMAGE < GEN_4 AdjustFriendship(pokemon, FRIENDSHIP_EVENT_FAINT_FIELD_PSN); - status = STATUS1_NONE; #endif SetMonData(pokemon, MON_DATA_STATUS, &status); GetMonData(pokemon, MON_DATA_NICKNAME, gStringVar1); @@ -58,9 +57,9 @@ static bool32 MonFaintedFromPoison(u8 partyIdx) { struct Pokemon *pokemon = &gPlayerParty[partyIdx]; #if OW_POISON_DAMAGE < GEN_4 - if (IsMonValidSpecies(pokemon) && GetMonData(pokemon, MON_DATA_HP) == 0 && GetAilmentFromStatus(GetMonData(pokemon, MON_DATA_STATUS) & ~STATUS1_REVERSE_MODE) == AILMENT_PSN) + if (IsMonValidSpecies(pokemon) && GetMonData(pokemon, MON_DATA_HP) == 0 && GetAilmentFromStatus(GetMonData(pokemon, MON_DATA_STATUS)) == AILMENT_PSN) #else - if (IsMonValidSpecies(pokemon) && GetMonData(pokemon, MON_DATA_HP) == 1 && GetAilmentFromStatus(GetMonData(pokemon, MON_DATA_STATUS) & ~STATUS1_REVERSE_MODE) == AILMENT_PSN) + if (IsMonValidSpecies(pokemon) && GetMonData(pokemon, MON_DATA_HP) == 1 && GetAilmentFromStatus(GetMonData(pokemon, MON_DATA_STATUS)) == AILMENT_PSN) #endif return TRUE; @@ -131,7 +130,7 @@ s32 DoPoisonFieldEffect(void) for (i = 0; i < PARTY_SIZE; i++) { - if (GetMonData(pokemon, MON_DATA_SANITY_HAS_SPECIES) && GetAilmentFromStatus(GetMonData(pokemon, MON_DATA_STATUS) & ~STATUS1_REVERSE_MODE) == AILMENT_PSN) + if (GetMonData(pokemon, MON_DATA_SANITY_HAS_SPECIES) && GetAilmentFromStatus(GetMonData(pokemon, MON_DATA_STATUS)) == AILMENT_PSN) { // Apply poison damage hp = GetMonData(pokemon, MON_DATA_HP); diff --git a/src/party_menu.c b/src/party_menu.c index eade1b0fd5cc..d96170f3f1a0 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -1961,7 +1961,7 @@ u8 GetMonAilment(struct Pokemon *mon) if (CheckPartyPokerus(mon, 0)) return AILMENT_PKRS; if (CheckPartyShadow(mon, 0)) - return AILMENT_SHDW; + return AILMENT_SHADOW; return AILMENT_NONE; } @@ -2316,7 +2316,7 @@ static void DisplayPartyPokemonLevelCheck(struct Pokemon *mon, struct PartyMenuB if (GetMonData(mon, MON_DATA_SPECIES) != SPECIES_NONE) { u8 ailment = GetMonAilment(mon); - if (ailment == AILMENT_NONE || ailment == AILMENT_PKRS || ailment == AILMENT_SHDW) + if (ailment == AILMENT_NONE || ailment == AILMENT_PKRS || ailment == AILMENT_SHADOW) { if (c != 0) menuBox->infoRects->blitFunc(menuBox->windowId, menuBox->infoRects->dimensions[4] >> 3, (menuBox->infoRects->dimensions[5] >> 3) + 1, menuBox->infoRects->dimensions[6] >> 3, menuBox->infoRects->dimensions[7] >> 3, FALSE); @@ -4242,7 +4242,7 @@ static void UpdatePartyMonAilmentGfx(u8 status, struct PartyMenuBox *menuBox) case AILMENT_PKRS: gSprites[menuBox->statusSpriteId].invisible = TRUE; break; - case AILMENT_SHDW: + case AILMENT_SHADOW: gSprites[menuBox->statusSpriteId].invisible = TRUE; break; default: diff --git a/src/pokemon.c b/src/pokemon.c index 4bf610330aab..5d0200ebed38 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5112,6 +5112,10 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data) case MON_DATA_IS_SHADOW: retVal = substruct3->isShadow; break; + case MON_DATA_REVERSE_MODE: + if (substruct3->isShadow) + retVal = boxMon->nickData.shadowData.isReverse; + break; case MON_DATA_SHADOW_ID: if (substruct3->isShadow) retVal = boxMon->nickData.shadowData.shadowID; @@ -5448,6 +5452,9 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg) case MON_DATA_IS_SHADOW: SET8(substruct3->isShadow); break; + case MON_DATA_REVERSE_MODE: + SET8(boxMon->nickData.shadowData.isReverse); + break; case MON_DATA_SHADOW_ID: SET8(boxMon->nickData.shadowData.shadowID); break; @@ -5773,6 +5780,7 @@ void PokemonToBattleMon(struct Pokemon *src, struct BattlePokemon *dst) dst->type3 = TYPE_MYSTERY; dst->ability = GetAbilityBySpecies(dst->species, dst->abilityNum); dst->isShadow = GetMonData(src, MON_DATA_IS_SHADOW, NULL); + dst->isReverse = GetMonData(src, MON_DATA_REVERSE_MODE, NULL); dst->shadowAggro = GetMonData(src, MON_DATA_SHADOW_AGGRO, NULL); dst->shadowID = GetMonData(src, MON_DATA_SHADOW_ID, NULL); GetMonData(src, MON_DATA_NICKNAME, nickname); diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 21fc119fef42..53da672c074f 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -1715,12 +1715,12 @@ static void ChangeSummaryPokemon(u8 taskId, s8 delta) ScheduleBgCopyTilemapToVram(0); HandleStatusTilemap(0, 2); } - if (sMonSummaryScreen->summary.ailment != AILMENT_SHDW) + if (sMonSummaryScreen->summary.ailment != AILMENT_SHADOW) { LoadCompressedPalette(gSummaryShadow_Pal, 0, 0x100); LoadPalette(&gPPTextPalette, 0x81, 0x1E); } - else if (sMonSummaryScreen->summary.ailment == AILMENT_SHDW) + else if (sMonSummaryScreen->summary.ailment == AILMENT_SHADOW) { LoadCompressedPalette(gSummaryScreen_Pal, 0, 0x100); LoadPalette(&gPPTextPalette, 0x81, 0x1E);