summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/field/choose_party.c3
-rw-r--r--src/field/field_effect.c1
-rw-r--r--src/pokemon/pokemon_storage_system.c88
3 files changed, 91 insertions, 1 deletions
diff --git a/src/field/choose_party.c b/src/field/choose_party.c
index d278eda4a..52763b911 100644
--- a/src/field/choose_party.c
+++ b/src/field/choose_party.c
@@ -1,5 +1,5 @@
#include "global.h"
-#include "decoration.h"
+#include "event_data.h"
#include "field_fadetransition.h"
#include "main.h"
#include "menu.h"
@@ -7,6 +7,7 @@
#include "palette.h"
#include "party_menu.h"
#include "pokemon_menu.h"
+#include "field_weather.h"
#include "pokemon.h"
#include "pokemon_summary_screen.h"
#include "overworld.h"
diff --git a/src/field/field_effect.c b/src/field/field_effect.c
index 1e2aaa4ed..1fe238901 100644
--- a/src/field/field_effect.c
+++ b/src/field/field_effect.c
@@ -25,6 +25,7 @@
#include "field_map_obj.h"
#include "util.h"
#include "field_effect_helpers.h"
+#include "pokemon_storage_system.h"
#define subsprite_table(ptr) {.subsprites = ptr, .subspriteCount = (sizeof ptr) / (sizeof(struct Subsprite))}
diff --git a/src/pokemon/pokemon_storage_system.c b/src/pokemon/pokemon_storage_system.c
index 4a68b846a..2ea7161cf 100644
--- a/src/pokemon/pokemon_storage_system.c
+++ b/src/pokemon/pokemon_storage_system.c
@@ -2,6 +2,7 @@
#include "pokemon_storage_system.h"
#include "menu.h"
#include "string_util.h"
+#include "event_data.h"
#include "ewram.h"
struct StorageAction {
@@ -13,6 +14,93 @@ extern const struct StorageAction gUnknown_083B6DF4[];
EWRAM_DATA struct PokemonStorage gPokemonStorage = {0};
+u8 sub_8095ADC(u8 boxId)
+{
+ u16 i;
+ u16 count;
+
+ for (i = 0, count = 0; i < 30; i++)
+ {
+ if (GetBoxMonData(gPokemonStorage.boxes[boxId] + i, MON_DATA_SPECIES) != 0)
+ count++;
+ }
+ return count;
+}
+
+s16 sub_8095B24(u8 boxId)
+{
+ u16 i;
+
+ for (i = 0; i < 30; i++)
+ {
+ if (GetBoxMonData(gPokemonStorage.boxes[boxId] + i, MON_DATA_SPECIES) == 0)
+ return i;
+ }
+ return -1;
+}
+
+u8 GetNumValidDaycarePartyMons(void)
+{
+ u16 i;
+ u16 count;
+
+ for (i = 0, count = 0; i < PARTY_SIZE; i++)
+ {
+ struct Pokemon *pokemon = gPlayerParty + i;
+ if (GetMonData(pokemon, MON_DATA_SPECIES) != 0 && !GetMonData(pokemon, MON_DATA_IS_EGG))
+ count++;
+ }
+ return count;
+}
+
+u8 CountAlivePartyMonsExceptOne(u8 toSkip)
+{
+ u16 i;
+ u16 count;
+
+ for (i = 0, count = 0; i < PARTY_SIZE; i++)
+ {
+ if (i != toSkip)
+ {
+ struct Pokemon *pokemon = gPlayerParty + i;
+ if (GetMonData(pokemon, MON_DATA_SPECIES) != 0 && !GetMonData(pokemon, MON_DATA_IS_EGG) && GetMonData(pokemon, MON_DATA_HP) != 0)
+ count++;
+ }
+ }
+ return count;
+}
+
+u8 CountAlivePartyMonsExceptSelectedOne(void)
+{
+ return CountAlivePartyMonsExceptOne(gSpecialVar_0x8004);
+}
+
+u8 StorageSystemGetPartySize(void)
+{
+ u16 i;
+ u16 count;
+
+ for (i = 0, count = 0; i < PARTY_SIZE; i++)
+ {
+ if (GetMonData(gPlayerParty + i, MON_DATA_SPECIES) != 0)
+ count++;
+ }
+ return count;
+}
+
+u8 *unref_sub_8095C60(u8 *dest, const u8 *src, u16 pad)
+{
+ u8 *_dest = StringCopy(dest, src);
+ while (_dest < dest + pad)
+ {
+ *_dest++ = CHAR_SPACE;
+ }
+ *_dest = EOS;
+ return _dest;
+}
+
+asm(".section .text.8098898");
+
void sub_8098898(u8 index) {
u8 *ptr;