From a61f7ea2a1913df28ea4f3ecd71c57fa4e5bbf5c Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Wed, 29 Dec 2021 23:33:22 -0600 Subject: Decomped HasItem() --- include/dungeon_items.h | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 include/dungeon_items.h (limited to 'include') diff --git a/include/dungeon_items.h b/include/dungeon_items.h new file mode 100644 index 0000000..8eb1718 --- /dev/null +++ b/include/dungeon_items.h @@ -0,0 +1,9 @@ +#ifndef GUARD_DUNGEON_ITEMS_H +#define GUARD_DUNGEON_ITEMS_H + +#include "dungeon_entity.h" + +// 0x46CB0 +bool8 HasItem(struct DungeonEntity *pokemon, u8 itemIndex); + +#endif -- cgit v1.2.3 From c30cf5c6da8283330bc352d58acc037739cd8b72 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Tue, 4 Jan 2022 00:00:31 -0600 Subject: Decomped EvaluateItem() --- include/constants/item.h | 14 +++++++------- include/dungeon_ai_item_weight.h | 9 +++++++++ include/dungeon_entity.h | 3 +-- include/moves.h | 8 ++++++++ 4 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 include/dungeon_ai_item_weight.h create mode 100644 include/moves.h (limited to 'include') diff --git a/include/constants/item.h b/include/constants/item.h index 1268bd8..2f79b4d 100644 --- a/include/constants/item.h +++ b/include/constants/item.h @@ -162,18 +162,18 @@ #define ITEM_ID_CALM_MIND 0x80 #define ITEM_ID_ROAR 0x81 #define ITEM_ID_TOXIC 0x82 -#define ITEM_ID_HAIL_ORB 0x83 +#define ITEM_ID_HAIL 0x83 #define ITEM_ID_BULK_UP 0x84 #define ITEM_ID_BULLET_SEED 0x85 #define ITEM_ID_HIDDEN_POWER 0x86 -#define ITEM_ID_SUNNY_ORB 0x87 +#define ITEM_ID_SUNNY_DAY 0x87 #define ITEM_ID_TAUNT 0x88 #define ITEM_ID_ICE_BEAM 0x89 #define ITEM_ID_BLIZZARD 0x8A #define ITEM_ID_HYPER_BEAM 0x8B #define ITEM_ID_LIGHT_SCREEN 0x8C #define ITEM_ID_PROTECT 0x8D -#define ITEM_ID_RAINY_ORB 0x8E +#define ITEM_ID_RAIN_DANCE 0x8E #define ITEM_ID_GIGA_DRAIN 0x8F #define ITEM_ID_SAFEGUARD 0x90 #define ITEM_ID_FRUSTRATION 0x91 @@ -187,14 +187,14 @@ #define ITEM_ID_PSYCHIC 0x99 #define ITEM_ID_SHADOW_BALL 0x9A #define ITEM_ID_BRICK_BREAK 0x9B -#define ITEM_ID_EVASION_ORB 0x9C +#define ITEM_ID_DOUBLE_TEAM 0x9C #define ITEM_ID_REFLECT 0x9D #define ITEM_ID_SHOCK_WAVE 0x9E #define ITEM_ID_FLAMETHROWER 0x9F #define ITEM_ID_SLUDGE_BOMB 0xA0 -#define ITEM_ID_SANDY_ORB 0xA1 +#define ITEM_ID_SANDSTORM 0xA1 #define ITEM_ID_FIRE_BLAST 0xA2 -#define ITEM_ID_ROCKY_ORB 0xA3 +#define ITEM_ID_ROCK_TOMB 0xA3 #define ITEM_ID_AERIAL_ACE 0xA4 #define ITEM_ID_TORMENT 0xA5 #define ITEM_ID_FACADE 0xA6 @@ -204,7 +204,7 @@ #define ITEM_ID_THIEF 0xAA #define ITEM_ID_STEEL_WING 0xAB #define ITEM_ID_SKILL_SWAP 0xAC -#define ITEM_ID_SNATCH_ORB 0xAD +#define ITEM_ID_SNATCH 0xAD #define ITEM_ID_OVERHEAT 0xAE #define ITEM_ID_WIDE_SLASH 0xAF #define ITEM_ID_EXCAVATE 0xB0 diff --git a/include/dungeon_ai_item_weight.h b/include/dungeon_ai_item_weight.h new file mode 100644 index 0000000..705c0ca --- /dev/null +++ b/include/dungeon_ai_item_weight.h @@ -0,0 +1,9 @@ +#ifndef GUARD_DUNGEON_AI_ITEM_WEIGHT_H +#define GUARD_DUNGEON_AI_ITEM_WEIGHT_H + +#include "dungeon_entity.h" + +// 0x48F28 +u32 EvaluateItem(struct DungeonEntity *targetPokemon, struct ItemSlot *item, u32 itemTargetFlags); + +#endif diff --git a/include/dungeon_entity.h b/include/dungeon_entity.h index 233ef8e..d5c2871 100644 --- a/include/dungeon_entity.h +++ b/include/dungeon_entity.h @@ -164,8 +164,7 @@ struct DungeonEntityData u8 fillFE[0x100 - 0xFE]; /* 0x100 */ u8 targetingDecoy; // If the Pokémon is targeting a decoy, this indicates whether the decoy target is a team or wild Pokémon. u8 fill101[0x104 - 0x101]; - /* 0x104 */ u8 movementSpeed; - u8 fill105[0x108 - 0x105]; + /* 0x104 */ s32 movementSpeed; // The turn counter for movement speed up/down is split into five timers each. Multiple timers are used if the Pokémon is affected by multiple // speed-up/slow effects at once, like using Agility twice. /* 0x108 */ u8 speedUpTurnsLeft[5]; diff --git a/include/moves.h b/include/moves.h new file mode 100644 index 0000000..bba50b3 --- /dev/null +++ b/include/moves.h @@ -0,0 +1,8 @@ +#ifndef GUARD_MOVES_H +#define GUARD_MOVES_H + +#include "constants/move.h" + +u32 GetMoveMaxPP(struct PokemonMove *move); + +#endif -- cgit v1.2.3 From d9b1ef43a69d9c33791719d8f510ee5be048a7d0 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Thu, 6 Jan 2022 21:52:23 -0600 Subject: Labeled Warp Scarf variables --- include/dungeon_entity.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/dungeon_entity.h b/include/dungeon_entity.h index d5c2871..640183f 100644 --- a/include/dungeon_entity.h +++ b/include/dungeon_entity.h @@ -194,7 +194,9 @@ struct DungeonEntityData u8 unk15D; u8 unk15E; u8 unk15F; - u8 fill160[0x16C - 0x160]; + u8 fill160[0x169 - 0x160]; + u8 turnsSinceWarpScarfActivation; + u8 fill16A[0x16C - 0x16A]; /* 0x16C */ struct Position targetPosition; /* 0x170 */ struct Position posPixel; u32 unk174; -- cgit v1.2.3 From 05768ae71decc1539bd7f6e2c6d371b8c619cb24 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Thu, 6 Jan 2022 23:11:38 -0600 Subject: Decomped RoundUpFixedPoint() --- include/number_util.h | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 include/number_util.h (limited to 'include') diff --git a/include/number_util.h b/include/number_util.h new file mode 100644 index 0000000..c42ef1c --- /dev/null +++ b/include/number_util.h @@ -0,0 +1,7 @@ +#ifndef GUARD_NUMBER_UTIL_H +#define GUARD_NUMBER_UTIL_H + +// 0x94450 +s32 RoundUpFixedPoint(s32 fixedPointNumber); + +#endif -- cgit v1.2.3 From 42bcb068b61656f083009816b927207393a35b10 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Fri, 7 Jan 2022 01:45:35 -0600 Subject: Decomped CanTargetAdjacentPokemon() --- include/dungeon_ai_item_weight.h | 2 ++ include/dungeon_util.h | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'include') diff --git a/include/dungeon_ai_item_weight.h b/include/dungeon_ai_item_weight.h index 705c0ca..a498744 100644 --- a/include/dungeon_ai_item_weight.h +++ b/include/dungeon_ai_item_weight.h @@ -5,5 +5,7 @@ // 0x48F28 u32 EvaluateItem(struct DungeonEntity *targetPokemon, struct ItemSlot *item, u32 itemTargetFlags); +// 0x494EC +bool8 CanTargetAdjacentPokemon(struct DungeonEntity *pokemon); #endif diff --git a/include/dungeon_util.h b/include/dungeon_util.h index 82d44ba..4d91b29 100644 --- a/include/dungeon_util.h +++ b/include/dungeon_util.h @@ -1,7 +1,11 @@ #ifndef GUARD_DUNGEON_UTIL_H #define GUARD_DUNGEON_UTIL_H +#include "constants/direction.h" #include "dungeon_entity.h" +#include "position.h" + +extern const struct Position gAdjacentTileOffsets[NUM_DIRECTIONS]; // 0x450E0 bool8 EntityExists(struct DungeonEntity *pokemon); -- cgit v1.2.3