Merge branch 'master' of https://github.com/pret/pokeemerald into ui-standardize
This commit is contained in:
@@ -229,7 +229,7 @@ static void Intro_WaitForHealthbox(void)
|
||||
else
|
||||
{
|
||||
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy)
|
||||
&& gSprites[gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)]].callback == SpriteCallbackDummy)
|
||||
{
|
||||
finished = TRUE;
|
||||
}
|
||||
@@ -248,7 +248,7 @@ static void Intro_WaitForHealthbox(void)
|
||||
static void Intro_ShowHealthbox(void)
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive
|
||||
&& gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& ++gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay != 1)
|
||||
@@ -257,10 +257,10 @@ static void Intro_ShowHealthbox(void)
|
||||
|
||||
if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
||||
{
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(gActiveBattler ^ BIT_FLANK);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]);
|
||||
DestroySprite(&gSprites[gBattleControllerData[BATTLE_PARTNER(gActiveBattler)]]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)], &gPlayerParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(BATTLE_PARTNER(gActiveBattler));
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)]);
|
||||
}
|
||||
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]);
|
||||
@@ -321,7 +321,7 @@ static void Task_GiveExpToMon(u8 taskId)
|
||||
u16 species = GetMonData(mon, MON_DATA_SPECIES);
|
||||
u8 level = GetMonData(mon, MON_DATA_LEVEL);
|
||||
u32 currExp = GetMonData(mon, MON_DATA_EXP);
|
||||
u32 nextLvlExp = gExperienceTables[gBaseStats[species].growthRate][level + 1];
|
||||
u32 nextLvlExp = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1];
|
||||
|
||||
if (currExp + gainedExp >= nextLvlExp)
|
||||
{
|
||||
@@ -336,7 +336,7 @@ static void Task_GiveExpToMon(u8 taskId)
|
||||
gActiveBattler = savedActiveBank;
|
||||
|
||||
if (IsDoubleBattle() == TRUE
|
||||
&& ((u16)(monId) == gBattlerPartyIndexes[battlerId] || (u16)(monId) == gBattlerPartyIndexes[battlerId ^ BIT_FLANK]))
|
||||
&& ((u16)(monId) == gBattlerPartyIndexes[battlerId] || (u16)(monId) == gBattlerPartyIndexes[BATTLE_PARTNER(battlerId)]))
|
||||
gTasks[taskId].func = Task_LaunchLvlUpAnim;
|
||||
else
|
||||
gTasks[taskId].func = DestroyExpTaskAndCompleteOnInactiveTextPrinter;
|
||||
@@ -364,11 +364,11 @@ static void Task_PrepareToGiveExpWithExpBar(u8 taskId)
|
||||
u8 level = GetMonData(mon, MON_DATA_LEVEL);
|
||||
u16 species = GetMonData(mon, MON_DATA_SPECIES);
|
||||
u32 exp = GetMonData(mon, MON_DATA_EXP);
|
||||
u32 currLvlExp = gExperienceTables[gBaseStats[species].growthRate][level];
|
||||
u32 currLvlExp = gExperienceTables[gSpeciesInfo[species].growthRate][level];
|
||||
u32 expToNextLvl;
|
||||
|
||||
exp -= currLvlExp;
|
||||
expToNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1] - currLvlExp;
|
||||
expToNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1] - currLvlExp;
|
||||
SetBattleBarStruct(battlerId, gHealthboxSpriteIds[battlerId], expToNextLvl, exp, -gainedExp);
|
||||
PlaySE(SE_EXP);
|
||||
gTasks[taskId].func = Task_GiveExpWithExpBar;
|
||||
@@ -400,7 +400,7 @@ static void Task_GiveExpWithExpBar(u8 taskId)
|
||||
level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL);
|
||||
currExp = GetMonData(&gPlayerParty[monId], MON_DATA_EXP);
|
||||
species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES);
|
||||
expOnNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1];
|
||||
expOnNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1];
|
||||
|
||||
if (currExp + gainedExp >= expOnNextLvl)
|
||||
{
|
||||
@@ -431,7 +431,7 @@ static void Task_LaunchLvlUpAnim(u8 taskId)
|
||||
u8 battlerId = gTasks[taskId].tExpTask_bank;
|
||||
u8 monIndex = gTasks[taskId].tExpTask_monId;
|
||||
|
||||
if (IsDoubleBattle() == TRUE && monIndex == gBattlerPartyIndexes[battlerId ^ BIT_FLANK])
|
||||
if (IsDoubleBattle() == TRUE && monIndex == gBattlerPartyIndexes[BATTLE_PARTNER(battlerId)])
|
||||
battlerId ^= BIT_FLANK;
|
||||
|
||||
InitAndLaunchSpecialAnimation(battlerId, battlerId, battlerId, B_ANIM_LVL_UP);
|
||||
@@ -448,8 +448,8 @@ static void Task_UpdateLvlInHealthbox(u8 taskId)
|
||||
|
||||
GetMonData(&gPlayerParty[monIndex], MON_DATA_LEVEL); // Unused return value
|
||||
|
||||
if (IsDoubleBattle() == TRUE && monIndex == gBattlerPartyIndexes[battlerId ^ BIT_FLANK])
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[battlerId ^ BIT_FLANK], &gPlayerParty[monIndex], HEALTHBOX_ALL);
|
||||
if (IsDoubleBattle() == TRUE && monIndex == gBattlerPartyIndexes[BATTLE_PARTNER(battlerId)])
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[BATTLE_PARTNER(battlerId)], &gPlayerParty[monIndex], HEALTHBOX_ALL);
|
||||
else
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[battlerId], &gPlayerParty[monIndex], HEALTHBOX_ALL);
|
||||
|
||||
@@ -1540,12 +1540,12 @@ static void PlayerPartnerHandleChoosePokemon(void)
|
||||
{
|
||||
s32 chosenMonId = GetMostSuitableMonToSwitchInto();
|
||||
|
||||
if (chosenMonId == 6) // just switch to the next mon
|
||||
if (chosenMonId == PARTY_SIZE) // just switch to the next mon
|
||||
{
|
||||
u8 playerMonIdentity = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
|
||||
u8 selfIdentity = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT);
|
||||
|
||||
for (chosenMonId = 3; chosenMonId < 6; chosenMonId++)
|
||||
for (chosenMonId = PARTY_SIZE / 2; chosenMonId < PARTY_SIZE; chosenMonId++)
|
||||
{
|
||||
if (GetMonData(&gPlayerParty[chosenMonId], MON_DATA_HP) != 0
|
||||
&& chosenMonId != gBattlerPartyIndexes[playerMonIdentity]
|
||||
|
||||
Reference in New Issue
Block a user