Sprites and fixes

This commit is contained in:
kittenchilly 2023-08-11 13:36:01 -05:00
parent c3e31af5f3
commit c3a8edae32
5 changed files with 29 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

View File

@ -677,8 +677,8 @@ static const struct SpriteTemplate sSpriteTemplate_MegaTrigger =
.callback = SpriteCb_MegaTrigger .callback = SpriteCb_MegaTrigger
}; };
static const u8 ALIGNED(4) sBurstTriggerGfx[] = INCBIN_U8("graphics/battle_interface/mega_trigger.4bpp"); static const u8 ALIGNED(4) sBurstTriggerGfx[] = INCBIN_U8("graphics/battle_interface/burst_trigger.4bpp");
static const u16 sBurstTriggerPal[] = INCBIN_U16("graphics/battle_interface/mega_trigger.gbapal"); static const u16 sBurstTriggerPal[] = INCBIN_U16("graphics/battle_interface/burst_trigger.gbapal");
static const struct SpriteSheet sSpriteSheet_BurstTrigger = static const struct SpriteSheet sSpriteSheet_BurstTrigger =
{ {

View File

@ -4438,9 +4438,9 @@ static void HandleTurnActionSelectionState(void)
RecordedBattle_SetBattlerAction(gActiveBattler, gBattleResources->bufferB[gActiveBattler][2]); RecordedBattle_SetBattlerAction(gActiveBattler, gBattleResources->bufferB[gActiveBattler][2]);
RecordedBattle_SetBattlerAction(gActiveBattler, gBattleResources->bufferB[gActiveBattler][3]); RecordedBattle_SetBattlerAction(gActiveBattler, gBattleResources->bufferB[gActiveBattler][3]);
} }
gBattleStruct->chosenMovePositions[gActiveBattler] = gBattleResources->bufferB[gActiveBattler][2] & ~(RET_MEGA_EVOLUTION | RET_ULTRA_BURST); *(gBattleStruct->chosenMovePositions + gActiveBattler) = gBattleResources->bufferB[gActiveBattler][2] & ~(RET_MEGA_EVOLUTION | RET_ULTRA_BURST);
gChosenMoveByBattler[gActiveBattler] = gBattleMons[gActiveBattler].moves[gBattleStruct->chosenMovePositions[gActiveBattler]]; gChosenMoveByBattler[gActiveBattler] = gBattleMons[gActiveBattler].moves[*(gBattleStruct->chosenMovePositions + gActiveBattler)];
gBattleStruct->moveTarget[gActiveBattler] = gBattleResources->bufferB[gActiveBattler][3]; *(gBattleStruct->moveTarget + gActiveBattler) = gBattleResources->bufferB[gActiveBattler][3];
if (gBattleResources->bufferB[gActiveBattler][2] & RET_MEGA_EVOLUTION) if (gBattleResources->bufferB[gActiveBattler][2] & RET_MEGA_EVOLUTION)
gBattleStruct->mega.toEvolve |= gBitTable[gActiveBattler]; gBattleStruct->mega.toEvolve |= gBitTable[gActiveBattler];
else if (gBattleResources->bufferB[gActiveBattler][2] & RET_ULTRA_BURST) else if (gBattleResources->bufferB[gActiveBattler][2] & RET_ULTRA_BURST)

View File

@ -8628,6 +8628,8 @@ static void HandleScriptMegaPrimalBurst(u32 caseId, u32 battlerId, u32 type)
SetBattlerShadowSpriteCallback(battlerId, gBattleMons[battlerId].species); SetBattlerShadowSpriteCallback(battlerId, gBattleMons[battlerId].species);
if (type == 0) if (type == 0)
gBattleStruct->mega.alreadyEvolved[position] = TRUE; gBattleStruct->mega.alreadyEvolved[position] = TRUE;
if (type == 2)
gBattleStruct->burst.alreadyBursted[position] = TRUE;
} }
} }

View File

@ -10036,7 +10036,28 @@ bool32 CanUltraBurst(u8 battlerId)
struct Pokemon *mon; struct Pokemon *mon;
u8 battlerPosition = GetBattlerPosition(battlerId); u8 battlerPosition = GetBattlerPosition(battlerId);
u8 partnerPosition = GetBattlerPosition(BATTLE_PARTNER(battlerId)); u8 partnerPosition = GetBattlerPosition(BATTLE_PARTNER(battlerId));
struct UltraBurstData *burst = &(((struct ChooseMoveStruct *)(&gBattleResources->bufferA[gActiveBattler][4]))->burst);
// Check if Player has a Z Ring
if ((GetBattlerPosition(battlerId) == B_POSITION_PLAYER_LEFT || (!(gBattleTypeFlags & BATTLE_TYPE_MULTI) && GetBattlerPosition(battlerId) == B_POSITION_PLAYER_RIGHT))
&& !CheckBagHasItem(ITEM_Z_POWER_RING, 1))
return FALSE;
// Check if trainer already ultra bursted a pokemon.
if (gBattleStruct->burst.alreadyBursted[battlerPosition])
return FALSE;
// Cannot use z move and ultra burst on same turn
if (gBattleStruct->zmove.toBeUsed[battlerId])
return FALSE;
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE
&& IsPartnerMonFromSameTrainer(battlerId)
&& (gBattleStruct->burst.alreadyBursted[partnerPosition] || (gBattleStruct->burst.toBurst & gBitTable[BATTLE_PARTNER(battlerId)])))
return FALSE;
// Check if mon is currently held by Sky Drop
if (gStatuses3[battlerId] & STATUS3_SKY_DROPPED)
return FALSE;
// Gets mon data. // Gets mon data.
if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT) if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT)