mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Some gActiveBattler Fixes (#3259)
* some gActiveBattler related fixes * fix IsBattleSEPlaying gActiveBattler->battlerId --------- Co-authored-by: ghoulslash <pokevoyager0@gmail.com>
This commit is contained in:
parent
4490e9879a
commit
326fb2605a
@ -528,7 +528,7 @@ bool8 IsBattleSEPlaying(u8 battlerId)
|
||||
if (IsSEPlaying())
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[battlerId].soundTimer++;
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].soundTimer < 30)
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[battlerId].soundTimer < 30)
|
||||
return TRUE;
|
||||
|
||||
m4aMPlayStop(&gMPlayInfo_SE1);
|
||||
|
@ -1884,7 +1884,7 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u16 check)
|
||||
else if (check & MOVE_LIMITATION_THROAT_CHOP && gDisableStructs[battlerId].throatChopTimer && gBattleMoves[gBattleMons[battlerId].moves[i]].soundMove)
|
||||
unusableMoves |= gBitTable[i];
|
||||
// Stuff Cheeks
|
||||
else if (check & MOVE_LIMITATION_STUFF_CHEEKS && gBattleMons[battlerId].moves[i] == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[gActiveBattler].item) != POCKET_BERRIES)
|
||||
else if (check & MOVE_LIMITATION_STUFF_CHEEKS && gBattleMons[battlerId].moves[i] == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[battlerId].item) != POCKET_BERRIES)
|
||||
unusableMoves |= gBitTable[i];
|
||||
// Gorilla Tactics
|
||||
else if (check & MOVE_LIMITATION_CHOICE_ITEM && GetBattlerAbility(battlerId) == ABILITY_GORILLA_TACTICS && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != gBattleMons[battlerId].moves[i])
|
||||
@ -4879,7 +4879,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
||||
&& gBattleResults.catchAttempts[gLastUsedBall - ITEM_ULTRA_BALL] >= 1
|
||||
&& !gHasFetchedBall)
|
||||
{
|
||||
gBattleScripting.battler = battler;
|
||||
gBattleScripting.battler = gActiveBattler = battler;
|
||||
BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, 2, &gLastUsedBall);
|
||||
MarkBattlerForControllerExec(battler);
|
||||
gHasFetchedBall = TRUE;
|
||||
@ -10758,7 +10758,7 @@ void TrySaveExchangedItem(u8 battlerId, u16 stolenItem)
|
||||
bool32 IsBattlerAffectedByHazards(u8 battlerId, bool32 toxicSpikes)
|
||||
{
|
||||
bool32 ret = TRUE;
|
||||
u32 holdEffect = GetBattlerHoldEffect(gActiveBattler, TRUE);
|
||||
u32 holdEffect = GetBattlerHoldEffect(battlerId, TRUE);
|
||||
if (toxicSpikes && holdEffect == HOLD_EFFECT_HEAVY_DUTY_BOOTS && !IS_BATTLER_OF_TYPE(battlerId, TYPE_POISON))
|
||||
{
|
||||
ret = FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user