From cbf41c6bf31e16fa0ec0b60fc067429e387b5943 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Fri, 7 Jan 2022 23:32:32 -0600 Subject: Decomped HasNegativeStatus() --- include/dungeon_entity.h | 6 ++++-- include/status_checks.h | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 include/status_checks.h (limited to 'include') diff --git a/include/dungeon_entity.h b/include/dungeon_entity.h index 640183f..7e562fc 100644 --- a/include/dungeon_entity.h +++ b/include/dungeon_entity.h @@ -6,6 +6,8 @@ #include "item.h" #include "position.h" +#define NUM_SPEED_TURN_COUNTERS 5 + struct DungeonActionContainer { /* 0x0 */ u16 action; @@ -167,8 +169,8 @@ struct DungeonEntityData /* 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]; - /* 0x10D */ u8 slowTurnsLeft[5]; + /* 0x108 */ u8 speedUpTurnsLeft[NUM_SPEED_TURN_COUNTERS]; + /* 0x10D */ u8 slowTurnsLeft[NUM_SPEED_TURN_COUNTERS]; /* 0x112 */ u8 stockpileCount; u8 fill113; // When true, an AI Pokémon will move in a random direction every turn. diff --git a/include/status_checks.h b/include/status_checks.h new file mode 100644 index 0000000..e899f74 --- /dev/null +++ b/include/status_checks.h @@ -0,0 +1,9 @@ +#ifndef GUARD_STATUS_CHECKS_H +#define GUARD_STATUS_CHECKS_H + +#include "dungeon_entity.h" + +// 0x70A58 +bool8 HasNegativeStatus(struct DungeonEntity *pokemon); + +#endif -- cgit v1.2.3 From 52e7368f30bb1a80a470bb1492b816dd6c8e97f7 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Sat, 8 Jan 2022 00:08:00 -0600 Subject: Labeled CalculateFacingDir() --- include/position_util.h | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 include/position_util.h (limited to 'include') diff --git a/include/position_util.h b/include/position_util.h new file mode 100644 index 0000000..74019b7 --- /dev/null +++ b/include/position_util.h @@ -0,0 +1,9 @@ +#ifndef GUARD_POSITION_UTIL_H +#define GUARD_POSITION_UTIL_H + +#include "position.h" + +// 0x983D8 +s32 CalculateFacingDir(struct Position *originPos, struct Position *targetPos); + +#endif -- cgit v1.2.3 From 453618864e685eacae640dc2b317a645422264e2 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Thu, 13 Jan 2022 22:56:30 -0500 Subject: Decomped HasStatusAffectingActions() --- include/code_80521D0.h | 8 ++++++++ include/dungeon_entity.h | 2 +- include/status_checks.h | 4 ++-- include/status_checks_1.h | 9 +++++++++ 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 include/code_80521D0.h create mode 100644 include/status_checks_1.h (limited to 'include') diff --git a/include/code_80521D0.h b/include/code_80521D0.h new file mode 100644 index 0000000..588ad9b --- /dev/null +++ b/include/code_80521D0.h @@ -0,0 +1,8 @@ +#ifndef GUARD_CODE_80521D0_H +#define GUARD_CODE_80521D0_H + +#include "dungeon_entity.h" + +void SendMessage(struct DungeonEntity *pokemon, const char message[]); + +#endif diff --git a/include/dungeon_entity.h b/include/dungeon_entity.h index 7e562fc..9e9f1f7 100644 --- a/include/dungeon_entity.h +++ b/include/dungeon_entity.h @@ -11,7 +11,7 @@ struct DungeonActionContainer { /* 0x0 */ u16 action; - /* 0x2 */ s8 facingDir; + /* 0x2 */ u8 facingDir; u8 fill3; // Additional parameter alongside actionIndex. Used for things like indicating which move a Pokémon should use from its moveset. /* 0x4 */ u8 actionUseIndex; diff --git a/include/status_checks.h b/include/status_checks.h index e899f74..086711d 100644 --- a/include/status_checks.h +++ b/include/status_checks.h @@ -3,7 +3,7 @@ #include "dungeon_entity.h" -// 0x70A58 -bool8 HasNegativeStatus(struct DungeonEntity *pokemon); +// 0x7001C +bool8 HasStatusAffectingActions(struct DungeonEntity *pokemon); #endif diff --git a/include/status_checks_1.h b/include/status_checks_1.h new file mode 100644 index 0000000..770767a --- /dev/null +++ b/include/status_checks_1.h @@ -0,0 +1,9 @@ +#ifndef GUARD_STATUS_CHECKS_1_H +#define GUARD_STATUS_CHECKS_1_H + +#include "dungeon_entity.h" + +// 0x70A58 +bool8 HasNegativeStatus(struct DungeonEntity *pokemon); + +#endif -- cgit v1.2.3 From afbc7deaea1d66d39331bc078d3f2e22cbdec0a3 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Thu, 13 Jan 2022 23:18:59 -0500 Subject: Decomped SetWalkAction() --- include/dungeon_action.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/dungeon_action.h b/include/dungeon_action.h index c3631f7..48f81d5 100644 --- a/include/dungeon_action.h +++ b/include/dungeon_action.h @@ -5,5 +5,7 @@ // 0x44C94 void SetAction(struct DungeonActionContainer *actionPointer, u16 action); +// 0x44CA0 +void SetWalkAction(struct DungeonActionContainer *actionPointer, s16 species); #endif -- cgit v1.2.3 From c5cd6e137fbad180a21ec24a50fde76633db0c20 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Thu, 20 Jan 2022 18:12:17 -0500 Subject: Decomped IsSleeping() -Function provided by SethBarberee. --- include/status_checks_1.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/status_checks_1.h b/include/status_checks_1.h index 770767a..486adb2 100644 --- a/include/status_checks_1.h +++ b/include/status_checks_1.h @@ -5,5 +5,7 @@ // 0x70A58 bool8 HasNegativeStatus(struct DungeonEntity *pokemon); +// 0x70B28 +bool8 IsSleeping(struct DungeonEntity *pokemon); #endif -- cgit v1.2.3