summaryrefslogtreecommitdiff
path: root/src/dungeon_movement.c
diff options
context:
space:
mode:
authorCheng Hann Gan <chenghanngan.us@gmail.com>2021-12-12 15:52:06 -0500
committerGitHub <noreply@github.com>2021-12-12 12:52:06 -0800
commitc53bdc35f8bdd401e90dfae263a3f5fc9182f86b (patch)
tree6111353227b153e4aa56422d91e4e79288ce7376 /src/dungeon_movement.c
parenta34c9ab91b553fcb1f72b94eb912b94bea58885b (diff)
Dungeon random/AI decomp + converted positions to structs (#83)
* Decomped RollPercentChance() * Decomped DungeonRandomCapped() * Decomped DungeonRandom() * Decomped FindRockItemTargets() -Added position struct.
Diffstat (limited to 'src/dungeon_movement.c')
-rw-r--r--src/dungeon_movement.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dungeon_movement.c b/src/dungeon_movement.c
index 6bb225e..9ea894e 100644
--- a/src/dungeon_movement.c
+++ b/src/dungeon_movement.c
@@ -9,6 +9,7 @@
#include "dungeon_capabilities_1.h"
#include "dungeon_global_data.h"
#include "dungeon_pokemon_attributes_1.h"
+#include "dungeon_random.h"
#include "dungeon_util.h"
#include "dungeon_util_1.h"
#include "map.h"
@@ -26,7 +27,6 @@ extern bool8 HasStatusAffectingActions(struct DungeonEntity*);
extern bool8 CanSee(struct DungeonEntity*, struct DungeonEntity*);
extern void ResetAction(u16*);
extern void SetWalkAction(u16*, s16);
-extern s32 DungeonRandomCapped(s32);
extern void DecideAttack(struct DungeonEntity*);
extern void MoveIfPossible(struct DungeonEntity*, bool8);
extern u8 sub_8044B28(void);
@@ -143,7 +143,7 @@ void sub_8075900(struct DungeonEntity *pokemon, u8 r1)
gDungeonGlobalData->unk672 = 1;
sub_807AB38(pokemon, r1);
sub_8041888(0);
- if(sub_803F428(&pokemon->posWorldX) != 0)
+ if(sub_803F428(&pokemon->posWorld.x) != 0)
sub_803E708(0x78, 0x39);
}
}
@@ -211,8 +211,8 @@ void DecideAction(struct DungeonEntity *pokemon)
{
SetWalkAction(&pokemonData->action.action, pokemonData->entityID);
pokemonData->action.facingDir = DungeonRandomCapped(8);
- pokemonData->targetPositionX = pokemon->posWorldX;
- pokemonData->targetPositionY = pokemon->posWorldY - 1;
+ pokemonData->targetPosition.x = pokemon->posWorld.x;
+ pokemonData->targetPosition.y = pokemon->posWorld.y - 1;
}
else
{