summaryrefslogtreecommitdiff
path: root/src/kangaskhan_storage_2.c
diff options
context:
space:
mode:
authorSeth Barberee <seth.barberee@gmail.com>2021-06-09 22:54:21 -0500
committerGitHub <noreply@github.com>2021-06-09 22:54:21 -0500
commit377bd14ea67d6177250fb401e12d7dfcf44e2cf6 (patch)
tree5440970e02a7890791b234aa233e91e5c1d65b40 /src/kangaskhan_storage_2.c
parenteaa141c612dd1689936a21bd57018a55ff686b69 (diff)
Dungeon pokemon/Floor ID JSON Part 1 (#39)
* move Thunderwave and Tiny Woods pokemon to json * rule tweaking to actually build tool before parsing JSON * delete .inc pokemon for tiny Woods and Thunderwave * silence git complaining about br_ips and ips_patch * use defines for species and pass the header file for species * convert sinister woods * convert MtThunderPeak * convert silent chasm * add trial floor_id w/ tiny woods * change make rule name to fix compile * MtSteel converted and bugfix * convert few floor headers and great canyon pokemon * code cleanup * unify unkData into UnkTextStruct2 * more code cleanup and some text decomp * doc more funcs and decomp/split some stuff * document more save stuff * more save work and move some data * pika sniped UpdateNatureTotal * decomp a litle and convert a few more dungeons * better scanning for json files * mt freeze and peak
Diffstat (limited to 'src/kangaskhan_storage_2.c')
-rw-r--r--src/kangaskhan_storage_2.c94
1 files changed, 90 insertions, 4 deletions
diff --git a/src/kangaskhan_storage_2.c b/src/kangaskhan_storage_2.c
index ebef475..d9d253c 100644
--- a/src/kangaskhan_storage_2.c
+++ b/src/kangaskhan_storage_2.c
@@ -1,6 +1,11 @@
#include "global.h"
#include "input.h"
#include "memory.h"
+#include "text.h"
+#include "item.h"
+#include "kangaskhan_storage.h"
+
+extern struct unkStruct_203B208 *gUnknown_203B208;
struct unkStruct_203B20C
{
@@ -12,10 +17,6 @@ struct unkStruct_203B20C
};
extern struct unkStruct_203B20C *gUnknown_203B20C;
-extern void sub_800641C(u8 *, u32, u32);
-extern void sub_8017F10(u32);
-
-
extern void sub_8017F10(u32);
extern void sub_8018588(void);
extern void sub_8018620(void);
@@ -29,6 +30,91 @@ extern void sub_8018AE4(void);
extern void sub_8017F28();
extern void sub_8018100();
+extern void UpdateKangaskhanStorageState(u32);
+extern s32 sub_80144A4(s32 *);
+extern void sub_801B450();
+extern u32 sub_801B410(void);
+
+extern u8 sub_8012FD8(u32 *r0);
+extern void sub_8013114(u32 *, s32 *);
+extern void sub_801CBB8();
+extern void sub_801CA08();
+
+void sub_8017D24(void)
+{
+ s32 menuAction;
+ menuAction = 0;
+ sub_801CA08();
+ if (sub_8012FD8(&gUnknown_203B208->unk58) == 0) {
+ sub_8013114(&gUnknown_203B208->unk58, &menuAction);
+ if(menuAction != 1) gUnknown_203B208->unk20 = menuAction;
+ }
+
+ switch(menuAction)
+ {
+ case 3:
+ if (sub_8090A34() > 0x13)
+ {
+ sub_801CBB8();
+ UpdateKangaskhanStorageState(0x6);
+ }
+ else
+ {
+ if(sub_8090A60(gUnknown_203B208->itemIndex))
+ UpdateKangaskhanStorageState(0x18);
+ else
+ UpdateKangaskhanStorageState(0x1B);
+ }
+ break;
+ case 6:
+ UpdateKangaskhanStorageState(0x1A);
+ break;
+ case 1:
+ UpdateKangaskhanStorageState(0x17);
+ break;
+ }
+}
+
+void sub_8017DC0(void)
+{
+ switch(sub_801B410())
+ {
+ case 0:
+ case 1:
+ default:
+ break;
+ case 2:
+ case 3:
+ sub_801B450();
+ UpdateKangaskhanStorageState(0xE);
+ break;
+ }
+}
+
+void sub_8017DDC(void)
+{
+ switch(sub_801B410())
+ {
+ case 0:
+ case 1:
+ default:
+ break;
+ case 2:
+ case 3:
+ sub_801B450();
+ UpdateKangaskhanStorageState(0x17);
+ break;
+ }
+}
+
+void sub_8017DF8(void)
+{
+ s32 temp;
+ if(sub_80144A4(&temp) == 0)
+ {
+ UpdateKangaskhanStorageState(gUnknown_203B208->unk8);
+ }
+}
u32 sub_8017E1C(void)
{