summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2017-05-18 22:24:04 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2017-05-18 22:24:04 -0400
commitbcfb366618c16aad592b737b6037aac504a45b66 (patch)
treed67b9d84e81b41379cd341bab10797a97e3df48f /src
parentbeb5af337bfe2c1ac4f2503d561ac389c5bf1068 (diff)
GetPriceReduction
Diffstat (limited to 'src')
-rw-r--r--src/tv.c58
1 files changed, 57 insertions, 1 deletions
diff --git a/src/tv.c b/src/tv.c
index 3b5b8cd54..d8ff22316 100644
--- a/src/tv.c
+++ b/src/tv.c
@@ -56,7 +56,8 @@ extern void sub_80BEBF4(void);
extern u16 gUnknown_020387E0;
extern u16 gUnknown_020387E2;
-extern const u8 *gUnknown_083CE048[];;
+extern const u8 *gUnknown_083CE048[];
+extern u16 gScriptLastTalked;
u32 GetPlayerTrainerId(void);
@@ -463,6 +464,61 @@ void sub_80BEC10(u8);
void sub_80BEC40(void);
void sub_80BF588(TVShow tvShows[]);
+bool8 IsPriceDiscounted(u8);
+
+bool8 GetPriceReduction(u8 arg0)
+{
+ u8 i;
+ if (arg0 == 0)
+ {
+ return FALSE;
+ }
+ for (i=0; i<16; i++)
+ {
+ if (gSaveBlock1.unknown_2ABC[i].val0 == arg0)
+ {
+ if (gSaveBlock1.unknown_2ABC[i].val1 == 2 && IsPriceDiscounted(arg0) != 0)
+ {
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+ }
+ }
+ return FALSE;
+}
+
+bool8 IsPriceDiscounted(u8 arg0)
+{
+ switch (arg0)
+ {
+ case 1:
+ if (gSaveBlock1.location.mapGroup == MAP_GROUP_SLATEPORT_CITY && gSaveBlock1.location.mapNum == MAP_ID_SLATEPORT_CITY && gScriptLastTalked == 0x1a)
+ {
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+ break;
+ case 3:
+ if (gSaveBlock1.location.mapGroup == MAP_GROUP_LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP && gSaveBlock1.location.mapNum == MAP_ID_LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP)
+ {
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+ break;
+ default:
+ return TRUE;
+ }
+}
+
bool8 sub_80BEE48(u8 arg0)
{
u8 i;