Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions asm/macros/frscrcmd.inc
Original file line number Diff line number Diff line change
Expand Up @@ -518,20 +518,20 @@
.short \seqID
.endm

.macro FrontierScrCmd_5C arg0, arg1, arg2
.short FRSCRCMD_5C
.short \arg0
.short \arg1
.short \arg2
.macro InitBattleFactory resumingFromSave, challengeType, isOpenLevel
.short FRSCRCMD_INITBATTLEFACTORY
.short \resumingFromSave
.short \challengeType
.short \isOpenLevel
.endm

.macro FrontierScrCmd_5D arg0
.short FRSCRCMD_5D
.short \arg0
.macro BattleFactory_LoadTrainersForRound resumingFromSave
.short FRSCRCMD_BATTLEFACTORY_LOADTRAINERSFORROUND
.short \resumingFromSave
.endm

.macro FrontierScrCmd_5E
.short FRSCRCMD_5E
.macro FreeBattleFactory
.short FRSCRCMD_FREEBATTLEFACTORY
.endm

.macro OpenBattleFactoryAppInitial
Expand All @@ -550,20 +550,20 @@
.short FRSCRCMD_OPENBATTLEFACTORYAPPFORTRADE
.endm

.macro FrontierScrCmd_63
.short FRSCRCMD_63
.macro AddSelectedRentalsToParty
.short FRSCRCMD_ADDSELECTEDRENTALSTOPARTY
.endm

.macro FrontierScrCmd_64
.short FRSCRCMD_64
.macro BattleFactory_SetupNextOpponent
.short FRSCRCMD_BATTLEFACTORY_SETUPNEXTOPPONENT
.endm

.macro FrontierScrCmd_65
.short FRSCRCMD_65
.macro BattleFactory_ApplyTrade
.short FRSCRCMD_BATTLEFACTORY_APPLYTRADE
.endm

.macro FrontierScrCmd_66
.short FRSCRCMD_66
.macro BattleFactory_SetupNextOpponentsParty
.short FRSCRCMD_BATTLEFACTORY_SETUPNEXTOPPONENTSPARTY
.endm

.macro CallBattleFactoryFunction command, arg1, arg2, destVar
Expand All @@ -579,21 +579,21 @@
.short \destVar
.endm

.macro FrontierScrCmd_69 arg0, arg1, arg2
.short FRSCRCMD_69
.short \arg0
.short \arg1
.short \arg2
.macro BattleFactory_SendCommMessage command, arg, success
.short FRSCRCMD_BATTLEFACTORY_SENDCOMMMESSAGE
.short \command
.short \arg
.short \success
.endm

.macro FrontierScrCmd_6A arg0
.short FRSCRCMD_6A
.short \arg0
.macro BattleFactory_WaitForCommResponses unused
.short FRSCRCMD_BATTLEFACTORY_WAITFORCOMMRESPONSES
.short \unused
.endm

.macro FrontierScrCmd_6B arg0
.short FRSCRCMD_6B
.byte \arg0
.macro BattleFactory_PrintTrainerIntro index
.short FRSCRCMD_BATTLEFACTORY_PRINTTRAINERINTRO
.byte \index
.endm

.macro InitNewBattleRecording
Expand Down
2 changes: 1 addition & 1 deletion generated/game_records.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ RECORD_BATTLE_FACTORY_VICTORIES
RECORD_BATTLE_CASTLE_VICTORIES
RECORD_BATTLE_HALL_VICTORIES
RECORD_BATTLE_ARCADE_VICTORIES
RECORD_UNK_064
RECORD_BATTLE_FACTORY_TRADES
RECORD_CASTLE_POINTS_RECEIVED
RECORD_UNK_066
RECORD_UNK_067
Expand Down
2 changes: 1 addition & 1 deletion include/applications/frontier/battle_factory/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
typedef struct BattleFactoryAppArgs {
SaveData *saveData;
u8 challengeType;
u8 unk_05;
u8 isOpenLevel;
u8 isExchangeMode;
u8 padding_07;
Party *personalParty;
Expand Down
16 changes: 9 additions & 7 deletions include/battle_factory_save.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef POKEPLATINUM_BATTLE_FACTORY_SAVE_H
#define POKEPLATINUM_BATTLE_FACTORY_SAVE_H

#include "constants/battle_frontier.h"

#include "savedata.h"

#define FACTORY_SAVE_OPEN_LEVEL 0
Expand All @@ -26,13 +28,13 @@ typedef struct BattleFactorySave {
u8 didSave : 1;
u8 currentBattleNum;
u16 unused2;
u16 trainerIDs[14];
u16 playerPartySets[4];
u8 playerIVs[4];
u32 playerPersonality[4];
u16 opponentPartySets[4];
u8 opponentIVs[4];
u32 opponentPersonality[4];
u16 trainerIDs[FACTORY_BATTLES_PER_ROUND * 2];
u16 playerPartySets[FACTORY_MAX_PARTY_SIZE];
u8 playerIVs[FACTORY_MAX_PARTY_SIZE];
u32 playerPersonality[FACTORY_MAX_PARTY_SIZE];
u16 opponentPartySets[FACTORY_MAX_PARTY_SIZE];
u8 opponentIVs[FACTORY_MAX_PARTY_SIZE];
u32 opponentPersonality[FACTORY_MAX_PARTY_SIZE];
} BattleFactorySave;

void BattleFactorySave_Init(BattleFactorySave *save);
Expand Down
54 changes: 27 additions & 27 deletions include/constants/battle_factory_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,47 @@

enum BattleFactoryFunction {
BF_FUNC_UNK_0 = 0,
BF_FUNC_UNK_1,
BF_FUNC_SET_IS_OPEN_LEVEL,
BF_FUNC_SET_CHALLENGE_TYPE,
BF_FUNC_UNK_3,
BF_FUNC_GET_SELECTED_APP_SLOT,
BF_FUNC_GET_CURRENT_STREAK,
BF_FUNC_INCREMENT_CURRENT_STREAK,
BF_FUNC_UNK_6,
BF_FUNC_RESET_SYSTEM,
BF_FUNC_UNK_8,
BF_FUNC_UNK_9,
BF_FUNC_UNK_10,
BF_FUNC_HAS_SAVED,
BF_FUNC_QUICKSAVE,
BF_FUNC_UNK_11,
BF_FUNC_UNK_12,
BF_FUNC_UNK_13,
BF_FUNC_UNK_14,
BF_FUNC_UNK_15,
BF_FUNC_UNK_16,
BF_FUNC_UNK_17,
BF_FUNC_UNK_18,
BF_FUNC_UNK_19,
BF_FUNC_UNK_20,
BF_FUNC_UNK_21,
BF_FUNC_UNK_22,
BF_FUNC_UNK_23,
BF_FUNC_INCREMENT_CURRENT_BATTLE,
BF_FUNC_GET_MONS_SPECIES,
BF_FUNC_GET_MONS_MOVE,
BF_FUNC_GET_MONS_TYPE,
BF_FUNC_GET_COMMON_TYPE,
BF_FUNC_GET_CURRENT_ROUND,
BF_FUNC_GET_OPPONENT_OBJECT_ID,
BF_FUNC_SAVE_ON_LOSS,
BF_FUNC_SAVE_ON_COMPLETING_ROUND,
BF_FUNC_GET_CURRENT_BATTLE,
BF_FUNC_UNK_24,
BF_FUNC_UNK_25,
BF_FUNC_UNK_26,
BF_FUNC_UNK_27,
BF_FUNC_INIT_COMM_MANAGER,
BF_FUNC_IS_MULTIPLAYER_CHALLENGE,
BF_FUNC_GET_CHALLENGE_TYPE,
BF_FUNC_UNK_30,
BF_FUNC_UNK_31,
BF_FUNC_UNK_32,
BF_FUNC_UNK_33,
BF_FUNC_UNK_34,
BF_FUNC_UNK_35,
BF_FUNC_UNK_36,
BF_FUNC_UNK_37,
BF_FUNC_UNK_38,
BF_FUNC_UNK_39,
BF_FUNC_UNK_40,
BF_FUNC_UNK_41,
BF_FUNC_UPDATE_BACKGROUND,
BF_FUNC_START_CORRIDOR_ANIMATION,
BF_FUNC_STOP_CORRIDOR_ANIMATION,
BF_FUNC_LOAD_TRAINERS,
BF_FUNC_SET_RENTED_MONS_IN_STRING,
BF_FUNC_GET_EARNED_BP,
BF_FUNC_INCREMENT_TRADE_COUNT,
BF_FUNC_GET_NEXT_BATTLE_TYPE,
BF_FUNC_UPDATE_PARTNERS_PARTY,
BF_FUNC_CREATE_OPPONENT_MONS,
BF_FUNC_CREATE_INITAL_PARTY,
BF_FUNC_CHECK_SEEN_HEAD_INTRO,
};

#endif // POKEPLATINUM_CONSTANTS_BATTLE_FACTORY_FUNCTIONS_H
10 changes: 10 additions & 0 deletions include/constants/battle_frontier.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ enum BattleFrontierScene {
#define FRONTIER_RECORDS_APP_HALL 5
#define FRONTIER_RECORDS_APP_ARCADE 6

#define FACTORY_BATTLES_PER_ROUND 7
#define FACTORY_STREAK_SILVER_BATTLE 21
#define FACTORY_STREAK_GOLD_BATTLE 49
#define FACTORY_MAX_DISTINCT_ROUNDS ((FACTORY_STREAK_GOLD_BATTLE / FACTORY_BATTLES_PER_ROUND) + 1)

#define FACTORY_INITIAL_RENTAL_OPTIONS 6
#define FACTORY_PARTY_SIZE_SOLO 3
#define FACTORY_PARTY_SIZE_MULTI 2
#define FACTORY_MAX_PARTY_SIZE MATH_MAX(FACTORY_PARTY_SIZE_SOLO, 2 * FACTORY_PARTY_SIZE_MULTI)

#define HALL_BATTLES_PER_ROUND 10
#define HALL_STREAK_SILVER_BATTLE 50
#define HALL_STREAK_GOLD_BATTLE 170
Expand Down
Loading