diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 9d0bc6fc1f04..c510d3c74664 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -5612,7 +5612,13 @@ BattleScript_LocalBattleWonLoseTexts:: trainerslidein BS_FAINTED waitstate printstring STRINGID_TRAINER2LOSETEXT +BattleScript_LocalBattleWonBP:: + getmoneyreward + printstring STRINGID_PLAYERGOTBP + waitmessage B_WAIT_TIME_LONG + end2 BattleScript_LocalBattleWonReward:: + jumpifbyte CMP_EQUAL, gSpecialVar_0x8003, 1, BattleScript_LocalBattleWonBP getmoneyreward printstring STRINGID_PLAYERGOTMONEY waitmessage B_WAIT_TIME_LONG diff --git a/include/config/overworld.h b/include/config/overworld.h index b6664269960c..b56edbf327a4 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -75,6 +75,7 @@ #define OW_FLAG_NO_COLLISION 0 // If this flag is set, the player will be able to walk over tiles with collision. Mainly intended for debugging purposes. #define BATTLE_PYRAMID_RANDOM_ENCOUNTERS FALSE // If set to TRUE, battle pyramid Pokemon will be generated randomly based on the round's challenge instead of hardcoded in src/data/battle_frontier/battle_pyramid_level_50_wild_mons.h (or open_level_wild_mons.h) +#define BATTLE_FRONTIER_INTRO_FOR_BP_FIGHTS FALSE // If set to TRUE, battle frontier intros will be played before a fight where a player can earn BP // Map pop-up config #define OW_POPUP_GENERATION GEN_3 // Different generations display location names in overworld pop-ups differently. diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 9fbb70a22397..fc8dcc644933 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -712,8 +712,9 @@ #define STRINGID_FOGLIFTED 710 #define STRINGID_PKMNMADESHELLGLEAM 711 #define STRINGID_FICKLEBEAMDOUBLED 712 +#define STRINGID_PLAYERGOTBP 713 -#define BATTLESTRINGS_COUNT 713 +#define BATTLESTRINGS_COUNT 714 // This is the string id that gBattleStringsTable starts with. // String ids before this (e.g. STRINGID_INTROMSG) are not in the table, diff --git a/include/field_specials.h b/include/field_specials.h index 95a91d543f06..a1d78ec3d44b 100644 --- a/include/field_specials.h +++ b/include/field_specials.h @@ -33,5 +33,6 @@ void ResetFanClub(void); bool8 ShouldShowBoxWasFullMessage(void); void SetPCBoxToSendMon(u8 boxId); void PreparePartyForSkyBattle(void); +void GiveFrontierBattlePoints(void); #endif // GUARD_FIELD_SPECIALS_H diff --git a/src/battle_message.c b/src/battle_message.c index ecb2932124a3..55f2c83de70b 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -78,6 +78,7 @@ static const u8 sText_ItDoesntAffect[] = _("It doesn't affect\n{B_DEF_NAME_WITH_ static const u8 sText_AttackerFainted[] = _("{B_ATK_NAME_WITH_PREFIX}\nfainted!\p"); static const u8 sText_TargetFainted[] = _("{B_DEF_NAME_WITH_PREFIX}\nfainted!\p"); static const u8 sText_PlayerGotMoney[] = _("{B_PLAYER_NAME} got ¥{B_BUFF1}\nfor winning!\p"); +static const u8 sText_PlayerGotBP[] = _("{B_PLAYER_NAME} got {B_BUFF1} Battle Point(s)\nfor winning!\p"); static const u8 sText_PlayerLostToEnemyTrainer[] = _("{B_PLAYER_NAME} is out of\nusable POKéMON!\pPlayer lost against\n{B_TRAINER1_CLASS} {B_TRAINER1_NAME}!{PAUSE_UNTIL_PRESS}"); static const u8 sText_PlayerPaidPrizeMoney[] = _("{B_PLAYER_NAME} paid ¥{B_BUFF1} as the prize\nmoney…\p… … … …\p{B_PLAYER_NAME} whited out!{PAUSE_UNTIL_PRESS}"); static const u8 sText_PlayerWhiteout[] = _("{B_PLAYER_NAME} is out of\nusable POKéMON!\p"); @@ -1018,6 +1019,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_ATTACKERFAINTED - BATTLESTRINGS_TABLE_START] = sText_AttackerFainted, [STRINGID_TARGETFAINTED - BATTLESTRINGS_TABLE_START] = sText_TargetFainted, [STRINGID_PLAYERGOTMONEY - BATTLESTRINGS_TABLE_START] = sText_PlayerGotMoney, + [STRINGID_PLAYERGOTBP - BATTLESTRINGS_TABLE_START] = sText_PlayerGotBP, [STRINGID_PLAYERWHITEOUT - BATTLESTRINGS_TABLE_START] = sText_PlayerWhiteout, [STRINGID_PLAYERWHITEOUT2 - BATTLESTRINGS_TABLE_START] = sText_PlayerWhiteout2, [STRINGID_PREVENTSESCAPE - BATTLESTRINGS_TABLE_START] = sText_PreventsEscape, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 9e1af78714bc..53ea240e0ff4 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -7754,13 +7754,22 @@ static void Cmd_getmoneyreward(void) u32 money; u8 sPartyLevel = 1; + u8 b_buff_number = 5; if (gBattleOutcome == B_OUTCOME_WON) - { - money = GetTrainerMoneyToGive(gTrainerBattleOpponent_A); - if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) - money += GetTrainerMoneyToGive(gTrainerBattleOpponent_B); - AddMoney(&gSaveBlock1Ptr->money, money); + { + if (VarGet(gSpecialVar_0x8003) == 1) + { + money = gSpecialVar_0x8004; + b_buff_number = 3; + GiveFrontierBattlePoints(); + } + else{ + money = GetTrainerMoneyToGive(gTrainerBattleOpponent_A); + if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) + money += GetTrainerMoneyToGive(gTrainerBattleOpponent_B); + AddMoney(&gSaveBlock1Ptr->money, money); + } } else { @@ -7782,8 +7791,14 @@ static void Cmd_getmoneyreward(void) money = sWhiteOutBadgeMoney[count] * sPartyLevel; RemoveMoney(&gSaveBlock1Ptr->money, money); } + + if (VarGet(gSpecialVar_0x8003) == 1) + { + gSpecialVar_0x8003 = 0; + gSpecialVar_0x8004 = 0; + } - PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff1, 5, money); + PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff1, b_buff_number, money); gBattlescriptCurrInstr = cmd->nextInstr; } diff --git a/src/battle_setup.c b/src/battle_setup.c index 54c4f99b9289..59137cf4b24a 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -899,6 +899,9 @@ u8 GetTrainerBattleTransition(void) u32 trainerId = SanitizeTrainerId(gTrainerBattleOpponent_A); u32 trainerClass = GetTrainerClassFromId(gTrainerBattleOpponent_A); + if (BATTLE_FRONTIER_INTRO_FOR_BP_FIGHTS && VarGet(gSpecialVar_0x8003) == 1) + return GetSpecialBattleTransition(FRONTIER_MODE_DOUBLES); + if (DoesTrainerHaveMugshot(trainerId)) return B_TRANSITION_MUGSHOT;