summaryrefslogtreecommitdiff
path: root/src/tv.c
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-11-16 13:55:02 -0500
committerGriffinR <griffin.g.richards@gmail.com>2021-11-16 15:43:52 -0500
commit5d9c31a610d8a6680a44b772fc1b88135d3884c3 (patch)
treed776a819221dec62b96314d2b172a50bb743007d /src/tv.c
parent63c5905914b40d33e45a6a3101ab5a7da4375918 (diff)
Label slot machine ids, fix GetPriceReduction
Diffstat (limited to 'src/tv.c')
-rw-r--r--src/tv.c14
1 files changed, 9 insertions, 5 deletions
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)
{