diff options
author | AnonymousRandomPerson <chenghanngan.us@gmail.com> | 2022-03-04 23:49:00 -0500 |
---|---|---|
committer | AnonymousRandomPerson <chenghanngan.us@gmail.com> | 2022-03-10 22:32:17 -0500 |
commit | 9a4864c1cf8c0a6da847f3b8977aaca23b712a5a (patch) | |
tree | 76958584a3a92c8b713821de6e0c72f8437628eb /include | |
parent | 8c0df48b9ebd0fa794a97c6280cc59b6dfcb9eef (diff) |
Decomped WeightWeakTypePicker()
Diffstat (limited to 'include')
-rw-r--r-- | include/constants/type.h | 2 | ||||
-rw-r--r-- | include/dungeon_entity.h | 3 | ||||
-rw-r--r-- | include/type_chart.h | 17 | ||||
-rw-r--r-- | include/type_effectiveness.h | 9 |
4 files changed, 29 insertions, 2 deletions
diff --git a/include/constants/type.h b/include/constants/type.h index 6ca9177..c6fab07 100644 --- a/include/constants/type.h +++ b/include/constants/type.h @@ -1,6 +1,8 @@ #ifndef GUARD_CONSTANTS_TYPE_H #define GUARD_CONSTANTS_TYPE_H +#define NUM_TYPES 18 + #define TYPE_NONE 0x0 #define TYPE_NORMAL 0x1 #define TYPE_FIRE 0x2 diff --git a/include/dungeon_entity.h b/include/dungeon_entity.h index 1c7a269..1e4b884 100644 --- a/include/dungeon_entity.h +++ b/include/dungeon_entity.h @@ -81,8 +81,7 @@ struct DungeonEntityData u8 fill55[0x58 - 0x55]; // Position of the target that the Pokémon wants throw an item at. /* 0x58 */ struct Position itemTargetPosition; - /* 0x5C */ u8 type1; - /* 0x5D */ u8 type2; + /* 0x5C */ u8 types[2]; /* 0x5E */ u8 abilities[2]; /* 0x60 */ struct ItemSlot heldItem; u8 fill64[0x68 - 0x64]; diff --git a/include/type_chart.h b/include/type_chart.h new file mode 100644 index 0000000..4be0b33 --- /dev/null +++ b/include/type_chart.h @@ -0,0 +1,17 @@ +#ifndef GUARD_TYPE_CHART_H +#define GUARD_TYPE_CHART_H + +#include "global.h" +#include "constants/type.h" + +#define NUM_EFFECTIVENESS 4 + +#define EFFECTIVENESS_IMMUNE 0 +#define EFFECTIVENESS_RESIST 1 +#define EFFECTIVENESS_NEUTRAL 2 +#define EFFECTIVENESS_SUPER 3 + +// [Attacking type][Defending type] +extern const s16 gTypeEffectivenessChart[NUM_TYPES][NUM_TYPES]; + +#endif
\ No newline at end of file diff --git a/include/type_effectiveness.h b/include/type_effectiveness.h new file mode 100644 index 0000000..1847850 --- /dev/null +++ b/include/type_effectiveness.h @@ -0,0 +1,9 @@ +#ifndef GUARD_TYPE_EFFECTIVENESS_H +#define GUARD_TYPE_EFFECTIVENESS_H + +#include "dungeon_entity.h" + +// 0x6E654 +s32 WeightWeakTypePicker(struct DungeonEntity *user, struct DungeonEntity *target, u8 moveType); + +#endif |