Merge master into ObjEvent rename
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "text.h"
|
||||
#include "util.h"
|
||||
#include "constants/songs.h"
|
||||
#include "constants/battle_arena.h"
|
||||
#include "constants/battle_string_ids.h"
|
||||
#include "constants/battle_frontier.h"
|
||||
#include "constants/frontier_util.h"
|
||||
@@ -31,7 +32,7 @@
|
||||
static void InitArenaChallenge(void);
|
||||
static void GetArenaData(void);
|
||||
static void SetArenaData(void);
|
||||
static void sub_81A5AC4(void);
|
||||
static void SaveArenaChallenge(void);
|
||||
static void SetArenaRewardItem(void);
|
||||
static void GiveArenaRewardItem(void);
|
||||
static void BufferArenaOpponentName(void);
|
||||
@@ -468,13 +469,13 @@ static const struct CompressedSpriteSheet sBattleArenaJudgementSymbolsSpriteShee
|
||||
|
||||
static void (* const sArenaFunctions[])(void) =
|
||||
{
|
||||
InitArenaChallenge,
|
||||
GetArenaData,
|
||||
SetArenaData,
|
||||
sub_81A5AC4,
|
||||
SetArenaRewardItem,
|
||||
GiveArenaRewardItem,
|
||||
BufferArenaOpponentName,
|
||||
[BATTLE_ARENA_FUNC_INIT] = InitArenaChallenge,
|
||||
[BATTLE_ARENA_FUNC_GET_DATA] = GetArenaData,
|
||||
[BATTLE_ARENA_FUNC_SET_DATA] = SetArenaData,
|
||||
[BATTLE_ARENA_FUNC_SAVE] = SaveArenaChallenge,
|
||||
[BATTLE_ARENA_FUNC_SET_REWARD] = SetArenaRewardItem,
|
||||
[BATTLE_ARENA_FUNC_GIVE_REWARD] = GiveArenaRewardItem,
|
||||
[BATTLE_ARENA_FUNC_GET_TRAINER_NAME] = BufferArenaOpponentName,
|
||||
};
|
||||
|
||||
static const u16 sShortStreakRewardItems[] =
|
||||
@@ -563,8 +564,8 @@ u8 BattleArena_ShowJudgmentWindow(u8 *state)
|
||||
break;
|
||||
case 4:
|
||||
PlaySE(SE_HANTEI1);
|
||||
ShowJudgmentSprite(80, 40, 0, 0);
|
||||
ShowJudgmentSprite(160, 40, 0, 1);
|
||||
ShowJudgmentSprite(80, 40, ARENA_CATEGORY_MIND, B_POSITION_PLAYER_LEFT);
|
||||
ShowJudgmentSprite(160, 40, ARENA_CATEGORY_MIND, B_POSITION_OPPONENT_LEFT);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgement);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, 21);
|
||||
(*state)++;
|
||||
@@ -572,8 +573,8 @@ u8 BattleArena_ShowJudgmentWindow(u8 *state)
|
||||
break;
|
||||
case 5:
|
||||
PlaySE(SE_HANTEI1);
|
||||
ShowJudgmentSprite(80, 56, 1, 0);
|
||||
ShowJudgmentSprite(160, 56, 1, 1);
|
||||
ShowJudgmentSprite(80, 56, ARENA_CATEGORY_SKILL, B_POSITION_PLAYER_LEFT);
|
||||
ShowJudgmentSprite(160, 56, ARENA_CATEGORY_SKILL, B_POSITION_OPPONENT_LEFT);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgement);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, 21);
|
||||
(*state)++;
|
||||
@@ -581,8 +582,8 @@ u8 BattleArena_ShowJudgmentWindow(u8 *state)
|
||||
break;
|
||||
case 6:
|
||||
PlaySE(SE_HANTEI1);
|
||||
ShowJudgmentSprite(80, 72, 2, 0);
|
||||
ShowJudgmentSprite(160, 72, 2, 1);
|
||||
ShowJudgmentSprite(80, 72, ARENA_CATEGORY_BODY, B_POSITION_PLAYER_LEFT);
|
||||
ShowJudgmentSprite(160, 72, ARENA_CATEGORY_BODY, B_POSITION_OPPONENT_LEFT);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgement);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, 21);
|
||||
(*state)++;
|
||||
@@ -642,15 +643,15 @@ static void ShowJudgmentSprite(u8 x, u8 y, u8 category, u8 battler)
|
||||
|
||||
switch (category)
|
||||
{
|
||||
case 0:
|
||||
case ARENA_CATEGORY_MIND:
|
||||
pointsPlayer = mindPoints[battler];
|
||||
pointsOpponent = mindPoints[BATTLE_OPPOSITE(battler)];
|
||||
break;
|
||||
case 1:
|
||||
case ARENA_CATEGORY_SKILL:
|
||||
pointsPlayer = skillPoints[battler];
|
||||
pointsOpponent = skillPoints[BATTLE_OPPOSITE(battler)];
|
||||
break;
|
||||
case 2:
|
||||
case ARENA_CATEGORY_BODY:
|
||||
pointsPlayer = (gBattleMons[battler].hp * 100) / hpAtStart[battler];
|
||||
pointsOpponent = (gBattleMons[BATTLE_OPPOSITE(battler)].hp * 100) / hpAtStart[BATTLE_OPPOSITE(battler)];
|
||||
break;
|
||||
@@ -809,13 +810,13 @@ static void GetArenaData(void)
|
||||
|
||||
switch (gSpecialVar_0x8005)
|
||||
{
|
||||
case 0:
|
||||
case ARENA_DATA_REWARD:
|
||||
gSpecialVar_Result = gSaveBlock2Ptr->frontier.arenaRewardItem;
|
||||
break;
|
||||
case 1:
|
||||
case ARENA_DATA_WIN_STREAK:
|
||||
gSpecialVar_Result = gSaveBlock2Ptr->frontier.arenaWinStreaks[lvlMode];
|
||||
break;
|
||||
case 2:
|
||||
case ARENA_DATA_WIN_STREAK_ACTIVE:
|
||||
if (lvlMode != FRONTIER_LVL_50)
|
||||
gSpecialVar_Result = gSaveBlock2Ptr->frontier.winStreakActiveFlags & STREAK_ARENA_OPEN;
|
||||
else
|
||||
@@ -830,13 +831,13 @@ static void SetArenaData(void)
|
||||
|
||||
switch (gSpecialVar_0x8005)
|
||||
{
|
||||
case 0:
|
||||
case ARENA_DATA_REWARD:
|
||||
gSaveBlock2Ptr->frontier.arenaRewardItem = gSpecialVar_0x8006;
|
||||
break;
|
||||
case 1:
|
||||
case ARENA_DATA_WIN_STREAK:
|
||||
gSaveBlock2Ptr->frontier.arenaWinStreaks[lvlMode] = gSpecialVar_0x8006;
|
||||
break;
|
||||
case 2:
|
||||
case ARENA_DATA_WIN_STREAK_ACTIVE:
|
||||
if (lvlMode != FRONTIER_LVL_50)
|
||||
{
|
||||
if (gSpecialVar_0x8006)
|
||||
@@ -855,7 +856,7 @@ static void SetArenaData(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_81A5AC4(void)
|
||||
static void SaveArenaChallenge(void)
|
||||
{
|
||||
gSaveBlock2Ptr->frontier.challengeStatus = gSpecialVar_0x8005;
|
||||
VarSet(VAR_TEMP_0, 0);
|
||||
@@ -878,7 +879,7 @@ static void GiveArenaRewardItem(void)
|
||||
if (AddBagItem(gSaveBlock2Ptr->frontier.arenaRewardItem, 1) == TRUE)
|
||||
{
|
||||
CopyItemName(gSaveBlock2Ptr->frontier.arenaRewardItem, gStringVar1);
|
||||
gSaveBlock2Ptr->frontier.arenaRewardItem = 0;
|
||||
gSaveBlock2Ptr->frontier.arenaRewardItem = ITEM_NONE;
|
||||
gSpecialVar_Result = TRUE;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -9,7 +9,9 @@
|
||||
#include "string_util.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/battle_frontier.h"
|
||||
#include "constants/battle_palace.h"
|
||||
#include "constants/frontier_util.h"
|
||||
#include "constants/trainers.h"
|
||||
|
||||
// This file's functions.
|
||||
static void sub_8195980(void);
|
||||
@@ -17,7 +19,7 @@ static void sub_8195A38(void);
|
||||
static void sub_8195AE4(void);
|
||||
static void sub_8195BB0(void);
|
||||
static void sub_8195C20(void);
|
||||
static void sub_8195C50(void);
|
||||
static void BufferOpponentIntroSpeech(void);
|
||||
static void sub_8195C7C(void);
|
||||
static void sub_8195CE4(void);
|
||||
static void sub_8195D28(void);
|
||||
@@ -26,16 +28,16 @@ static void sub_8195DB8(void);
|
||||
// Const rom data.
|
||||
static void (* const sBattlePalaceFunctions[])(void) =
|
||||
{
|
||||
sub_8195980,
|
||||
sub_8195A38,
|
||||
sub_8195AE4,
|
||||
sub_8195BB0,
|
||||
sub_8195C20,
|
||||
sub_8195C50,
|
||||
sub_8195C7C,
|
||||
sub_8195CE4,
|
||||
sub_8195D28,
|
||||
sub_8195DB8,
|
||||
[BATTLE_PALACE_FUNC_0] = sub_8195980,
|
||||
[BATTLE_PALACE_FUNC_1] = sub_8195A38,
|
||||
[BATTLE_PALACE_FUNC_2] = sub_8195AE4,
|
||||
[BATTLE_PALACE_FUNC_3] = sub_8195BB0,
|
||||
[BATTLE_PALACE_FUNC_4] = sub_8195C20,
|
||||
[BATTLE_PALACE_FUNC_GET_OPPONENT_INTRO] = BufferOpponentIntroSpeech,
|
||||
[BATTLE_PALACE_FUNC_6] = sub_8195C7C,
|
||||
[BATTLE_PALACE_FUNC_7] = sub_8195CE4,
|
||||
[BATTLE_PALACE_FUNC_8] = sub_8195D28,
|
||||
[BATTLE_PALACE_FUNC_9] = sub_8195DB8,
|
||||
};
|
||||
|
||||
static const u16 gUnknown_0860DE78[] = {ITEM_HP_UP, ITEM_PROTEIN, ITEM_IRON, ITEM_CALCIUM, ITEM_CARBOS, ITEM_ZINC};
|
||||
@@ -135,9 +137,9 @@ static void sub_8195C20(void)
|
||||
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0);
|
||||
}
|
||||
|
||||
static void sub_8195C50(void)
|
||||
static void BufferOpponentIntroSpeech(void)
|
||||
{
|
||||
if (gTrainerBattleOpponent_A < 300)
|
||||
if (gTrainerBattleOpponent_A < TRAINER_RECORD_MIXING_FRIEND)
|
||||
FrontierSpeechToString(gFacilityTrainers[gTrainerBattleOpponent_A].speechBefore);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ static const u8 gUnknown_0858D8EC[] = { 3, 4, 5, 14 };
|
||||
static void Task_ShowContestEntryMonPic(u8 taskId);
|
||||
static void Task_LinkContestWaitForConnection(u8 taskId);
|
||||
static void CB2_ReturnFromChooseHalfParty(void);
|
||||
static void sub_80F94B8(void);
|
||||
static void CB2_ReturnFromChooseBattleFrontierParty(void);
|
||||
|
||||
void SetContestTrainerGfxIds(void)
|
||||
{
|
||||
@@ -681,21 +681,21 @@ static void CB2_ReturnFromChooseHalfParty(void)
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);
|
||||
}
|
||||
|
||||
void sub_80F9490(void)
|
||||
void ChoosePartyForBattleFrontier(void)
|
||||
{
|
||||
gMain.savedCallback = sub_80F94B8;
|
||||
gMain.savedCallback = CB2_ReturnFromChooseBattleFrontierParty;
|
||||
InitChooseHalfPartyForBattle(gSpecialVar_0x8004 + 1);
|
||||
}
|
||||
|
||||
static void sub_80F94B8(void)
|
||||
static void CB2_ReturnFromChooseBattleFrontierParty(void)
|
||||
{
|
||||
switch (gSelectedOrderFromParty[0])
|
||||
{
|
||||
case 0:
|
||||
gSpecialVar_Result = 0;
|
||||
gSpecialVar_Result = FALSE;
|
||||
break;
|
||||
default:
|
||||
gSpecialVar_Result = 1;
|
||||
gSpecialVar_Result = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user