Document battle dome.

This commit is contained in:
DizzyEggg
2018-08-25 19:59:47 +02:00
parent 62a645abaf
commit edcf04b665
37 changed files with 547 additions and 544 deletions

View File

@@ -31,13 +31,13 @@
#include "item_use.h"
#include "recorded_battle.h"
#include "party_menu.h"
#include "battle_dome.h"
extern u8 gUnknown_0203CEE8;
extern u8 gUnknown_0203CEE9;
extern u8 gUnknown_0203CF00[];
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern s32 gUnknown_0203CD70;
extern struct UnusedControllerStruct gUnknown_02022D0C;
extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern struct SpriteTemplate gMultiuseSpriteTemplate;

File diff suppressed because it is too large Load Diff

View File

@@ -33,6 +33,7 @@
#include "field_weather.h"
#include "gym_leader_rematch.h"
#include "constants/map_types.h"
#include "constants/battle_frontier.h"
enum
{
@@ -863,7 +864,7 @@ u8 sub_80B100C(s32 arg0)
return sUnknown_0854FEA7[Random() % ARRAY_COUNT(sUnknown_0854FEA7)];
}
if (VarGet(VAR_0x40CE) != 3)
if (VarGet(VAR_FRONTIER_BATTLE_MODE) != FRONTIER_MODE_LINK_MULTIS)
return sUnknown_0854FE98[Random() % ARRAY_COUNT(sUnknown_0854FE98)];
}
else
@@ -880,7 +881,7 @@ u8 sub_80B100C(s32 arg0)
return sUnknown_0854FEA7[Random() % ARRAY_COUNT(sUnknown_0854FEA7)];
}
if (VarGet(VAR_0x40CE) != 3)
if (VarGet(VAR_FRONTIER_BATTLE_MODE) != FRONTIER_MODE_LINK_MULTIS)
return sUnknown_0854FE98[Random() % ARRAY_COUNT(sUnknown_0854FE98)];
}

View File

@@ -1001,7 +1001,7 @@ void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 wi
}
}
void CopyToBgTilemapBufferRect_ChangePalette(u8 bg, void *src, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette)
void CopyToBgTilemapBufferRect_ChangePalette(u8 bg, const void *src, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette)
{
CopyRectToBgTilemapBufferRect(bg, src, 0, 0, rectWidth, rectHeight, destX, destY, rectWidth, rectHeight, palette, 0, 0);
}

View File

@@ -52,6 +52,7 @@
#include "constants/species.h"
#include "constants/moves.h"
#include "constants/vars.h"
#include "constants/battle_frontier.h"
EWRAM_DATA bool8 gBikeCyclingChallenge = FALSE;
EWRAM_DATA u8 gBikeCollisions = 0;
@@ -1667,7 +1668,7 @@ bool8 InMultiBattleRoom(void)
{
if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(BATTLE_FRONTIER_BATTLE_TOWER_MULTI_BATTLE_ROOM)
&& gSaveBlock1Ptr->location.mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_TOWER_MULTI_BATTLE_ROOM) &&
VarGet(VAR_0x40CE) == 2)
VarGet(VAR_FRONTIER_BATTLE_MODE) == FRONTIER_MODE_MULTIS)
return TRUE;
return FALSE;
}
@@ -2240,10 +2241,10 @@ void sub_813A080(void)
};
u8 i;
u16 var = VarGet(VAR_0x40CE);
u8 chosenLevel = gSaveBlock2Ptr->frontier.chosenLvl;
u16 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
if (var == 2 && !FlagGet(FLAG_0x152))
if (battleMode == 2 && !FlagGet(FLAG_0x152))
{
gSpecialVar_0x8005 = 5;
gSpecialVar_0x8006 = 4;
@@ -2252,7 +2253,7 @@ void sub_813A080(void)
for (i = 0; i < 9; i++)
{
if (gUnknown_085B2CDC[i] > gSaveBlock2Ptr->frontier.field_CE0[var][chosenLevel])
if (gUnknown_085B2CDC[i] > gSaveBlock2Ptr->frontier.field_CE0[battleMode][lvlMode])
{
gSpecialVar_0x8005 = 4;
gSpecialVar_0x8006 = i + 5;
@@ -3036,13 +3037,13 @@ void sub_813A878(u8 a0)
{
static const u16 gUnknown_085B3104[] = {0x0000, 0x0001, 0x0002, 0x0100, 0x0101, 0x0400, 0x0401, 0x0200, 0x0201, 0x0300, 0x0500, 0x0600};
u16 var1 = VarGet(VAR_0x40CE);
u16 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
u16 var2 = VarGet(VAR_FRONTIER_GAMBLER_SET_FACILITY_F);
u16 var3 = VarGet(VAR_FRONTIER_FACILITY);
u16 frontierFacilityId = VarGet(VAR_FRONTIER_FACILITY);
if (VarGet(VAR_FRONTIER_GAMBLER_PLACED_BET_F) == 1)
{
if (gUnknown_085B3104[var2] == (var3 << 8) + var1)
if (gUnknown_085B3104[var2] == (frontierFacilityId << 8) + battleMode)
{
if (a0 != 0)
{

View File

@@ -845,8 +845,8 @@ u16 CountTotalItemQuantityInBag(u16 itemId)
static bool8 CheckPyramidBagHasItem(u16 itemId, u16 count)
{
u8 i;
u16 *items = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.chosenLvl];
u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.chosenLvl];
u16 *items = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode];
u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode];
for (i = 0; i < PYRAMID_BAG_ITEMS_COUNT; i++)
{
@@ -867,8 +867,8 @@ static bool8 CheckPyramidBagHasItem(u16 itemId, u16 count)
static bool8 CheckPyramidBagHasSpace(u16 itemId, u16 count)
{
u8 i;
u16 *items = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.chosenLvl];
u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.chosenLvl];
u16 *items = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode];
u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode];
for (i = 0; i < PYRAMID_BAG_ITEMS_COUNT; i++)
{
@@ -890,8 +890,8 @@ bool8 AddPyramidBagItem(u16 itemId, u16 count)
{
u16 i;
u16 *items = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.chosenLvl];
u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.chosenLvl];
u16 *items = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode];
u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode];
u16 *newItems = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(u16));
u8 *newQuantities = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(u8));
@@ -963,8 +963,8 @@ bool8 RemovePyramidBagItem(u16 itemId, u16 count)
{
u16 i;
u16 *items = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.chosenLvl];
u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.chosenLvl];
u16 *items = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode];
u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode];
i = gUnknown_0203CF30[3] + gUnknown_0203CF30[4];
if (items[i] == itemId && quantities[i] >= count)

View File

@@ -13,6 +13,7 @@
#include "constants/hold_effects.h"
#include "constants/battle_move_effects.h"
#include "constants/songs.h"
#include "constants/battle_frontier.h"
#include "string_util.h"
#include "text.h"
#include "link.h"
@@ -1575,8 +1576,8 @@ void sub_8068338(struct Pokemon *mon, struct UnknownPokemonStruct *src, bool8 lv
u8 language;
u8 value;
if (gSaveBlock2Ptr->frontier.chosenLvl != 0)
level = BattleFrontierGetOpponentLvl(gSaveBlock2Ptr->frontier.chosenLvl);
if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_50)
level = BattleFrontierGetOpponentLvl(gSaveBlock2Ptr->frontier.lvlMode);
else if (lvl50)
level = 50;
else

View File

@@ -1293,7 +1293,7 @@ static bool32 AllocTryCopyRecordedBattleSaveData(struct RecordedBattleSave *dst)
static void CB2_RecordedBattleEnd(void)
{
gSaveBlock2Ptr->frontier.chosenLvl = sUnknown_0203C7AD;
gSaveBlock2Ptr->frontier.lvlMode = sUnknown_0203C7AD;
gBattleOutcome = 0;
gBattleTypeFlags = 0;
gTrainerBattleOpponent_A = 0;
@@ -1353,7 +1353,7 @@ static void SetRecordedBattleVarsFromSave(struct RecordedBattleSave *src)
gTrainerBattleOpponent_B = src->opponentB;
gPartnerTrainerId = src->partnerId;
gUnknown_0203C7B4 = src->field_4FA;
sUnknown_0203C7AD = gSaveBlock2Ptr->frontier.chosenLvl;
sUnknown_0203C7AD = gSaveBlock2Ptr->frontier.lvlMode;
sFrontierFacility = src->field_4FD;
sUnknown_0203C7AF = src->field_4FE;
sBattleStyle = src->battleStyle;
@@ -1375,7 +1375,7 @@ static void SetRecordedBattleVarsFromSave(struct RecordedBattleSave *src)
sUnknown_0203CCDC[i] = src->field_50E[i];
}
gSaveBlock2Ptr->frontier.chosenLvl = src->field_4FC;
gSaveBlock2Ptr->frontier.lvlMode = src->field_4FC;
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{

View File

@@ -18,6 +18,7 @@
#include "constants/maps.h"
#include "constants/species.h"
#include "constants/rgb.h"
#include "constants/battle_frontier.h"
#include "trade.h"
#include "trainer_card.h"
#include "overworld.h"
@@ -468,7 +469,7 @@ void sub_8012780(u8 taskId)
switch (data->state)
{
case 0:
if (gSpecialVar_0x8004 == 20 && gSaveBlock2Ptr->frontier.chosenLvl == 1)
if (gSpecialVar_0x8004 == 20 && gSaveBlock2Ptr->frontier.lvlMode == FRONTIER_LVL_OPEN)
gSpecialVar_0x8004++;
gUnknown_02022C2C = gUnknown_082F00C4[gSpecialVar_0x8004];
gUnknown_02022C2D = gUnknown_082F00C4[gSpecialVar_0x8004] >> 8;
@@ -1050,7 +1051,7 @@ void sub_80134E8(u8 taskId)
switch (data->state)
{
case 0:
if (gSpecialVar_0x8004 == 20 && gSaveBlock2Ptr->frontier.chosenLvl == 1)
if (gSpecialVar_0x8004 == 20 && gSaveBlock2Ptr->frontier.lvlMode == FRONTIER_LVL_OPEN)
gSpecialVar_0x8004++;
gUnknown_02022C2C = gUnknown_082F0530[gSpecialVar_0x8004];
sub_8010F84(gUnknown_02022C2C, 0, 0);