From 5d9c31a610d8a6680a44b772fc1b88135d3884c3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 16 Nov 2021 13:55:02 -0500 Subject: [PATCH] Label slot machine ids, fix GetPriceReduction --- asm/macros/event.inc | 8 +- .../LilycoveCity_ContestLobby/scripts.inc | 2 +- .../scripts.inc | 4 +- data/script_cmd_table.inc | 2 +- data/scripts/roulette.inc | 4 +- include/constants/slot_machine.h | 9 ++ include/tv.h | 2 +- src/field_specials.c | 37 +++++- src/scrcmd.c | 4 +- src/shop.c | 6 +- src/slot_machine.c | 120 +++++++++++++----- src/tv.c | 14 +- 12 files changed, 151 insertions(+), 61 deletions(-) diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 9c735f666..58b3b8329 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1107,10 +1107,10 @@ .4byte \products .endm - @ Starts up the slot machine minigame. - .macro playslotmachine word:req + @ Starts up the slot machine minigame. id is a SLOT_MACHINE_* value that influences probabilities of certain reel outcomes. + .macro playslotmachine id:req .byte 0x89 - .2byte \word + .2byte \id .endm @ Sets a berry tree's specific berry and growth stage. @@ -1197,7 +1197,7 @@ .endm @ Gets the price reduction for the index given. - .macro getpricereduction index:req + .macro getpokenewsactive index:req .byte 0x96 .2byte \index .endm diff --git a/data/maps/LilycoveCity_ContestLobby/scripts.inc b/data/maps/LilycoveCity_ContestLobby/scripts.inc index 94ccc21bd..6dbd1eb84 100644 --- a/data/maps/LilycoveCity_ContestLobby/scripts.inc +++ b/data/maps/LilycoveCity_ContestLobby/scripts.inc @@ -17,7 +17,7 @@ LilycoveCity_ContestLobby_OnTransition: end LilycoveCity_ContestLobby_EventScript_TryShowBlendMaster:: - getpricereduction POKENEWS_BLENDMASTER + getpokenewsactive POKENEWS_BLENDMASTER compare VAR_RESULT, TRUE goto_if_eq LilycoveCity_ContestLobby_EventScript_ShowBlendMaster clearflag FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER_REPLACEMENT diff --git a/data/maps/LilycoveCity_DepartmentStoreRooftop/scripts.inc b/data/maps/LilycoveCity_DepartmentStoreRooftop/scripts.inc index 65f7adc67..b0fda2731 100644 --- a/data/maps/LilycoveCity_DepartmentStoreRooftop/scripts.inc +++ b/data/maps/LilycoveCity_DepartmentStoreRooftop/scripts.inc @@ -3,7 +3,7 @@ LilycoveCity_DepartmentStoreRooftop_MapScripts:: .byte 0 LilycoveCity_DepartmentStoreRooftop_OnTransition: - getpricereduction POKENEWS_LILYCOVE + getpokenewsactive POKENEWS_LILYCOVE compare VAR_RESULT, TRUE call_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_ShowSaleWoman compare VAR_RESULT, FALSE @@ -51,7 +51,7 @@ LilycoveCity_DepartmentStoreRooftop_PokemartDecor_ClearOutSale: LilycoveCity_DepartmentStoreRooftop_EventScript_Man:: lock faceplayer - getpricereduction POKENEWS_LILYCOVE + getpokenewsactive POKENEWS_LILYCOVE compare VAR_RESULT, TRUE call_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_ManClearOutSale msgbox LilycoveCity_DepartmentStoreRooftop_Text_SetDatesForClearOutSales, MSGBOX_DEFAULT diff --git a/data/script_cmd_table.inc b/data/script_cmd_table.inc index 566ac3b36..322ac0bac 100644 --- a/data/script_cmd_table.inc +++ b/data/script_cmd_table.inc @@ -150,7 +150,7 @@ gScriptCmdTable:: .4byte ScrCmd_showmoneybox @ 0x93 .4byte ScrCmd_hidemoneybox @ 0x94 .4byte ScrCmd_updatemoneybox @ 0x95 - .4byte ScrCmd_getpricereduction @ 0x96 + .4byte ScrCmd_getpokenewsactive @ 0x96 .4byte ScrCmd_fadescreen @ 0x97 .4byte ScrCmd_fadescreenspeed @ 0x98 .4byte ScrCmd_setflashradius @ 0x99 diff --git a/data/scripts/roulette.inc b/data/scripts/roulette.inc index 241b0d31c..96f5809d7 100644 --- a/data/scripts/roulette.inc +++ b/data/scripts/roulette.inc @@ -3,7 +3,7 @@ Roulette_EventScript_Table1:: compare VAR_RESULT, FALSE goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase setvar VAR_0x8004, 0 - getpricereduction POKENEWS_GAME_CORNER + getpokenewsactive POKENEWS_GAME_CORNER compare VAR_RESULT, FALSE goto_if_eq Roulette_EventScript_Play addvar VAR_0x8004, ROULETTE_SPECIAL_RATE @@ -15,7 +15,7 @@ Roulette_EventScript_Table2:: compare VAR_RESULT, FALSE goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase setvar VAR_0x8004, 1 - getpricereduction POKENEWS_GAME_CORNER + getpokenewsactive POKENEWS_GAME_CORNER compare VAR_RESULT, FALSE goto_if_eq Roulette_EventScript_Play addvar VAR_0x8004, ROULETTE_SPECIAL_RATE diff --git a/include/constants/slot_machine.h b/include/constants/slot_machine.h index 81848f208..865d7e5d0 100644 --- a/include/constants/slot_machine.h +++ b/include/constants/slot_machine.h @@ -3,4 +3,13 @@ #define SLOT_MACHINE_COUNT 12 +// Slot machine IDs +#define SLOT_MACHINE_UNLUCKIEST 0 +#define SLOT_MACHINE_UNLUCKIER 1 +#define SLOT_MACHINE_UNLUCKY 2 +#define SLOT_MACHINE_LUCKY 3 +#define SLOT_MACHINE_LUCKIER 4 +#define SLOT_MACHINE_LUCKIEST 5 +#define NUM_SLOT_MACHINE_IDS 6 + #endif // GUARD_CONSTANTS_SLOT_MACHINE_H diff --git a/include/tv.h b/include/tv.h index 30cd13326..31c8fcc50 100644 --- a/include/tv.h +++ b/include/tv.h @@ -19,7 +19,7 @@ void HideBattleTowerReporter(void); void ReceiveTvShowsData(void *src, u32 size, u8 masterIdx); void TryPutSpotTheCutiesOnAir(struct Pokemon *pokemon, u8 ribbonMonDataIdx); u32 GetPlayerIDAsU32(void); -bool8 GetPriceReduction(u8 newsKind); +bool8 IsPokeNewsActive(u8 newsKind); void SanitizeTVShowLocationsForRuby(TVShow *shows); size_t CountDigits(int value); u8 GetRibbonCount(struct Pokemon *pokemon); diff --git a/src/field_specials.c b/src/field_specials.c index dce9d8efa..22467cfee 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -1330,15 +1330,40 @@ void BufferEReaderTrainerName(void) u16 GetSlotMachineId(void) { - static const u8 sSlotMachineRandomSeeds[] = {12, 2, 4, 5, 1, 8, 7, 11, 3, 10, 9, 6}; - static const u8 sSlotMachineIds[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5}; - static const u8 sSlotMachineServiceDayIds[] = {3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5}; + static const u8 sSlotMachineRandomSeeds[SLOT_MACHINE_COUNT] = {12, 2, 4, 5, 1, 8, 7, 11, 3, 10, 9, 6}; + static const u8 sSlotMachineIds[SLOT_MACHINE_COUNT] = { + SLOT_MACHINE_UNLUCKIEST, + SLOT_MACHINE_UNLUCKIER, + SLOT_MACHINE_UNLUCKIER, + SLOT_MACHINE_UNLUCKY, + SLOT_MACHINE_UNLUCKY, + SLOT_MACHINE_UNLUCKY, + SLOT_MACHINE_LUCKY, + SLOT_MACHINE_LUCKY, + SLOT_MACHINE_LUCKY, + SLOT_MACHINE_LUCKIER, + SLOT_MACHINE_LUCKIER, + SLOT_MACHINE_LUCKIEST + }; + static const u8 sSlotMachineServiceDayIds[SLOT_MACHINE_COUNT] = { + SLOT_MACHINE_LUCKY, + SLOT_MACHINE_LUCKY, + SLOT_MACHINE_LUCKY, + SLOT_MACHINE_LUCKY, + SLOT_MACHINE_LUCKY, + SLOT_MACHINE_LUCKY, + SLOT_MACHINE_LUCKIER, + SLOT_MACHINE_LUCKIER, + SLOT_MACHINE_LUCKIER, + SLOT_MACHINE_LUCKIER, + SLOT_MACHINE_LUCKIEST, + SLOT_MACHINE_LUCKIEST + }; u32 rnd = gSaveBlock1Ptr->dewfordTrends[0].trendiness + gSaveBlock1Ptr->dewfordTrends[0].rand + sSlotMachineRandomSeeds[gSpecialVar_0x8004]; - if (GetPriceReduction(POKENEWS_GAME_CORNER)) - { + if (IsPokeNewsActive(POKENEWS_GAME_CORNER)) return sSlotMachineServiceDayIds[rnd % SLOT_MACHINE_COUNT]; - } + return sSlotMachineIds[rnd % SLOT_MACHINE_COUNT]; } diff --git a/src/scrcmd.c b/src/scrcmd.c index 98eaaf12c..04dff470b 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1936,11 +1936,11 @@ bool8 ScrCmd_setberrytree(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_getpricereduction(struct ScriptContext *ctx) +bool8 ScrCmd_getpokenewsactive(struct ScriptContext *ctx) { u16 newsKind = VarGet(ScriptReadHalfword(ctx)); - gSpecialVar_Result = GetPriceReduction(newsKind); + gSpecialVar_Result = IsPokeNewsActive(newsKind); return FALSE; } diff --git a/src/shop.c b/src/shop.c index fa4a73bbb..f6fb2b9a0 100755 --- a/src/shop.c +++ b/src/shop.c @@ -562,7 +562,7 @@ static void BuyMenuPrintPriceInList(u8 windowId, u32 itemId, u8 y) { ConvertIntToDecimalStringN( gStringVar1, - ItemId_GetPrice(itemId) >> GetPriceReduction(POKENEWS_SLATEPORT), + ItemId_GetPrice(itemId) >> IsPokeNewsActive(POKENEWS_SLATEPORT), STR_CONV_MODE_LEFT_ALIGN, 5); } @@ -934,7 +934,7 @@ static void Task_BuyMenu(u8 taskId) if (sMartInfo.martType == MART_TYPE_NORMAL) { - sShopData->totalCost = (ItemId_GetPrice(itemId) >> GetPriceReduction(POKENEWS_SLATEPORT)); + sShopData->totalCost = (ItemId_GetPrice(itemId) >> IsPokeNewsActive(POKENEWS_SLATEPORT)); } else { @@ -1014,7 +1014,7 @@ static void Task_BuyHowManyDialogueHandleInput(u8 taskId) if (AdjustQuantityAccordingToDPadInput(&tItemCount, sShopData->maxQuantity) == TRUE) { - sShopData->totalCost = (ItemId_GetPrice(tItemId) >> GetPriceReduction(POKENEWS_SLATEPORT)) * tItemCount; + sShopData->totalCost = (ItemId_GetPrice(tItemId) >> IsPokeNewsActive(POKENEWS_SLATEPORT)) * tItemCount; BuyMenuPrintItemQuantityAndPrice(taskId); } else diff --git a/src/slot_machine.c b/src/slot_machine.c index 1c21f230d..6cbcd76fd 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -557,10 +557,10 @@ static struct SpriteFrameImage *sImageTables_DigitalDisplay[NUM_DIG_DISPLAY_SPRI // Const rom data. static const struct DigitalDisplaySprite *const sDigitalDisplayScenes[]; static const u16 sUnkPalette[]; -static const u8 sLuckyRoundProbabilities[][3]; +static const u8 sLuckyRoundProbabilities[NUM_SLOT_MACHINE_IDS][MAX_BET]; static const u8 sBiasTags[]; -static const u16 sLuckyFlagSettings_Top3[]; -static const u16 sLuckyFlagSettings_NotTop3[]; +static const u16 sLuckyFlagSettings_Top3[3]; +static const u16 sLuckyFlagSettings_NotTop3[5]; static const s16 sDigitalDisplay_SpriteCoords[][2]; static const SpriteCallback sDigitalDisplay_SpriteCallbacks[]; static const struct SpriteTemplate *const sSpriteTemplates_DigitalDisplay[NUM_DIG_DISPLAY_SPRITES]; @@ -582,8 +582,8 @@ static const struct SpriteSheet sSlotMachineSpriteSheets[22]; static const struct SpritePalette sSlotMachineSpritePalettes[]; static const u16 *const sDigitalDisplay_Pal; static const s16 sInitialReelPositions[NUM_REELS][2]; -static const u8 sLuckyFlagProbabilities_Top3[][6]; -static const u8 sLuckyFlagProbabilities_NotTop3[][6]; +static const u8 sLuckyFlagProbabilities_Top3[][NUM_SLOT_MACHINE_IDS]; +static const u8 sLuckyFlagProbabilities_NotTop3[][NUM_SLOT_MACHINE_IDS]; static const u8 sReeltimeProbabilities_UnluckyGame[][17]; static const u8 sReelTimeProbabilities_LuckyGame[][17]; static const u8 sSymToMatch[]; @@ -1651,22 +1651,18 @@ static void DrawLuckyFlags(void) if (IsThisRoundLucky()) { attempts = AttemptsAtLuckyFlags_Top3(); - if (attempts != 3) // if you found a lucky number + if (attempts != ARRAY_COUNT(sLuckyFlagSettings_Top3)) // if you found a lucky number { // attempts == 1: reelTime flag set sSlotMachine->luckyFlags |= sLuckyFlagSettings_Top3[attempts]; if (attempts != 1) - { return; - } } } // if it's not a lucky round or you got reel time, roll for the lower lucky flags attempts = AttemptsAtLuckyFlags_NotTop3(); - if (attempts != 5) // if you found a lucky number - { + if (attempts != ARRAY_COUNT(sLuckyFlagSettings_NotTop3)) // if you found a lucky number sSlotMachine->luckyFlags |= sLuckyFlagSettings_NotTop3[attempts]; - } } } } @@ -1704,7 +1700,7 @@ static u8 AttemptsAtLuckyFlags_Top3(void) { s16 count; - for (count = 0; count < 3; count++) + for (count = 0; count < (int)ARRAY_COUNT(sLuckyFlagSettings_Top3); count++) { s16 rval = Random() & 0xff; s16 value = sLuckyFlagProbabilities_Top3[count][sSlotMachine->machineId]; @@ -1718,7 +1714,7 @@ static u8 AttemptsAtLuckyFlags_NotTop3(void) { s16 count; - for (count = 0; count < 5; count++) + for (count = 0; count < (int)ARRAY_COUNT(sLuckyFlagSettings_NotTop3); count++) { s16 rval = Random() & 0xff; // random byte s16 value = sLuckyFlagProbabilities_NotTop3[count][sSlotMachine->machineId]; @@ -4807,27 +4803,83 @@ static const s16 sInitialReelPositions[NUM_REELS][2] = { [RIGHT_REEL] = {0, 2} }; -static const u8 sLuckyRoundProbabilities[][3] = { - {1, 1, 12}, - {1, 1, 14}, - {2, 2, 14}, - {2, 2, 14}, - {2, 3, 16}, - {3, 3, 16} +static const u8 sLuckyRoundProbabilities[NUM_SLOT_MACHINE_IDS][MAX_BET] = { + [SLOT_MACHINE_UNLUCKIEST] = {1, 1, 12}, + [SLOT_MACHINE_UNLUCKIER] = {1, 1, 14}, + [SLOT_MACHINE_UNLUCKY] = {2, 2, 14}, + [SLOT_MACHINE_LUCKY] = {2, 2, 14}, + [SLOT_MACHINE_LUCKIER] = {2, 3, 16}, + [SLOT_MACHINE_LUCKIEST] = {3, 3, 16} }; -static const u8 sLuckyFlagProbabilities_Top3[][6] = { - {25, 25, 30, 40, 40, 50}, - {25, 25, 30, 30, 35, 35}, - {25, 25, 30, 25, 25, 30} +static const u8 sLuckyFlagProbabilities_Top3[][NUM_SLOT_MACHINE_IDS] = { + { // Probabilities for LUCKY_BIAS_777 + [SLOT_MACHINE_UNLUCKIEST] = 25, + [SLOT_MACHINE_UNLUCKIER] = 25, + [SLOT_MACHINE_UNLUCKY] = 30, + [SLOT_MACHINE_LUCKY] = 40, + [SLOT_MACHINE_LUCKIER] = 40, + [SLOT_MACHINE_LUCKIEST] = 50 + }, + { // Probabilities for LUCKY_BIAS_REELTIME + [SLOT_MACHINE_UNLUCKIEST] = 25, + [SLOT_MACHINE_UNLUCKIER] = 25, + [SLOT_MACHINE_UNLUCKY] = 30, + [SLOT_MACHINE_LUCKY] = 30, + [SLOT_MACHINE_LUCKIER] = 35, + [SLOT_MACHINE_LUCKIEST] = 35 + }, + { // Probabilities for LUCKY_BIAS_MIXED_777 + [SLOT_MACHINE_UNLUCKIEST] = 25, + [SLOT_MACHINE_UNLUCKIER] = 25, + [SLOT_MACHINE_UNLUCKY] = 30, + [SLOT_MACHINE_LUCKY] = 25, + [SLOT_MACHINE_LUCKIER] = 25, + [SLOT_MACHINE_LUCKIEST] = 30 + } }; -static const u8 sLuckyFlagProbabilities_NotTop3[][6] = { - {20, 25, 25, 20, 25, 25}, - {12, 15, 15, 18, 19, 22}, - {25, 25, 25, 30, 30, 40}, - {25, 25, 20, 20, 15, 15}, - {40, 40, 35, 35, 40, 40} +static const u8 sLuckyFlagProbabilities_NotTop3[][NUM_SLOT_MACHINE_IDS] = { + { // Probabilities for LUCKY_BIAS_POWER + [SLOT_MACHINE_UNLUCKIEST] = 20, + [SLOT_MACHINE_UNLUCKIER] = 25, + [SLOT_MACHINE_UNLUCKY] = 25, + [SLOT_MACHINE_LUCKY] = 20, + [SLOT_MACHINE_LUCKIER] = 25, + [SLOT_MACHINE_LUCKIEST] = 25 + }, + { // Probabilities for LUCKY_BIAS_AZURILL + [SLOT_MACHINE_UNLUCKIEST] = 12, + [SLOT_MACHINE_UNLUCKIER] = 15, + [SLOT_MACHINE_UNLUCKY] = 15, + [SLOT_MACHINE_LUCKY] = 18, + [SLOT_MACHINE_LUCKIER] = 19, + [SLOT_MACHINE_LUCKIEST] = 22 + }, + { // Probabilities for LUCKY_BIAS_LOTAD + [SLOT_MACHINE_UNLUCKIEST] = 25, + [SLOT_MACHINE_UNLUCKIER] = 25, + [SLOT_MACHINE_UNLUCKY] = 25, + [SLOT_MACHINE_LUCKY] = 30, + [SLOT_MACHINE_LUCKIER] = 30, + [SLOT_MACHINE_LUCKIEST] = 40 + }, + { // Probabilities for LUCKY_BIAS_CHERRY + [SLOT_MACHINE_UNLUCKIEST] = 25, + [SLOT_MACHINE_UNLUCKIER] = 25, + [SLOT_MACHINE_UNLUCKY] = 20, + [SLOT_MACHINE_LUCKY] = 20, + [SLOT_MACHINE_LUCKIER] = 15, + [SLOT_MACHINE_LUCKIEST] = 15 + }, + { // Probabilities for LUCKY_BIAS_REPLAY + [SLOT_MACHINE_UNLUCKIEST] = 40, + [SLOT_MACHINE_UNLUCKIER] = 40, + [SLOT_MACHINE_UNLUCKY] = 35, + [SLOT_MACHINE_LUCKY] = 35, + [SLOT_MACHINE_LUCKIER] = 40, + [SLOT_MACHINE_LUCKIEST] = 40 + } }; static const u8 sReeltimeProbabilities_UnluckyGame[][17] = { @@ -5708,7 +5760,7 @@ static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Insert = static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Stop = { - .tileTag = 18, + .tileTag = GFXTAG_STOP, .paletteTag = PALTAG_DIG_DISPLAY, .oam = &sOam_8x8, .anims = sAnims_SingleFrame, @@ -5741,7 +5793,7 @@ static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Lose = static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Bonus = { - .tileTag = 19, + .tileTag = GFXTAG_BONUS, .paletteTag = PALTAG_DIG_DISPLAY, .oam = &sOam_8x8, .anims = sAnims_SingleFrame, @@ -5752,7 +5804,7 @@ static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Bonus = static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Big = { - .tileTag = 20, + .tileTag = GFXTAG_BIG, .paletteTag = PALTAG_DIG_DISPLAY, .oam = &sOam_8x8, .anims = sAnims_SingleFrame, @@ -5763,7 +5815,7 @@ static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Big = static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Reg = { - .tileTag = 21, + .tileTag = GFXTAG_REG, .paletteTag = PALTAG_DIG_DISPLAY, .oam = &sOam_8x8, .anims = sAnims_SingleFrame, diff --git a/src/tv.c b/src/tv.c index 4638fc621..64c3eb783 100644 --- a/src/tv.c +++ b/src/tv.c @@ -145,7 +145,7 @@ static void ResolveNumberOneShow(u16); static void TryPutFishingAdviceOnAir(void); static u8 MonDataIdxToRibbon(u8); static void TryPutNumberOneOnAir(u8); -static bool8 IsPriceDiscounted(u8); +static bool8 ShouldApplyPokeNewsEffect(u8); static void TryPutWorldOfMastersOnAir(void); static void InterviewBefore_FanClubLetter(void); static void InterviewBefore_RecentHappenings(void); @@ -1525,7 +1525,7 @@ void TryPutSmartShopperOnAir(void) show->smartshopperShow.itemIds[i] = gMartPurchaseHistory[i].itemId; show->smartshopperShow.itemAmounts[i] = gMartPurchaseHistory[i].quantity; } - show->smartshopperShow.priceReduced = GetPriceReduction(POKENEWS_SLATEPORT); + show->smartshopperShow.priceReduced = IsPokeNewsActive(POKENEWS_SLATEPORT); StringCopy(show->smartshopperShow.playerName, gSaveBlock2Ptr->playerName); StorePlayerIdInRecordMixShow(show); show->smartshopperShow.language = gGameLanguage; @@ -2641,7 +2641,7 @@ void DoPokeNews(void) } } -bool8 GetPriceReduction(u8 newsKind) +bool8 IsPokeNewsActive(u8 newsKind) { u8 i; @@ -2652,7 +2652,7 @@ bool8 GetPriceReduction(u8 newsKind) { if (gSaveBlock1Ptr->pokeNews[i].kind == newsKind) { - if (gSaveBlock1Ptr->pokeNews[i].state == 2 && IsPriceDiscounted(newsKind)) + if (gSaveBlock1Ptr->pokeNews[i].state == 2 && ShouldApplyPokeNewsEffect(newsKind)) return TRUE; return FALSE; @@ -2661,7 +2661,11 @@ bool8 GetPriceReduction(u8 newsKind) return FALSE; } -static bool8 IsPriceDiscounted(u8 newsKind) +// Returns TRUE if the effects of the given PokeNews should be applied. +// For POKENEWS_SLATEPORT / POKENEWS_LILYCOVE, only apply the effect (price reduction) +// if the player is talking to the Energy Guru / at the Dept Store Rooftop. +// For any other type of PokeNews this is always TRUE. +static bool8 ShouldApplyPokeNewsEffect(u8 newsKind) { switch (newsKind) {