summaryrefslogtreecommitdiff
path: root/src/code_806CD90.c
diff options
context:
space:
mode:
authorSeth Barberee <seth.barberee@gmail.com>2021-11-22 12:14:58 -0600
committerGitHub <noreply@github.com>2021-11-22 12:14:58 -0600
commitfd8720b75c56ef3f641e6c5abf6c446929c824b9 (patch)
tree7b65558bd366be680c577e6a0aea7787db24dd3f /src/code_806CD90.c
parent938a88551f6ddefb7f696b738696c8ce2d8e0e36 (diff)
Label all entities in Boss Fight Cutscenes (#78)
* label all entities in cutscenes * remove commented func.. wasn't matching anyway * Skarmony -> Skarmory
Diffstat (limited to 'src/code_806CD90.c')
-rw-r--r--src/code_806CD90.c88
1 files changed, 88 insertions, 0 deletions
diff --git a/src/code_806CD90.c b/src/code_806CD90.c
new file mode 100644
index 0000000..30ca41d
--- /dev/null
+++ b/src/code_806CD90.c
@@ -0,0 +1,88 @@
+#include "global.h"
+#include "dungeon_global_data.h"
+#include "dungeon_entity.h"
+#include "constants/direction.h"
+
+extern struct DungeonGlobalData *gDungeonGlobalData;
+
+extern u8 sub_806CEBC(struct DungeonEntity *);
+extern bool8 EntityExists(struct DungeonEntity *);
+extern void sub_806CCB4(struct DungeonEntity *, u8);
+extern u32 GetEntityType(struct DungeonEntity *);
+
+void sub_806CD90(void)
+{
+ s32 iVar3;
+ struct DungeonEntity *iVar2;
+ for(iVar3 = 0; iVar3 < DUNGEON_MAX_POKEMON; iVar3++)
+ {
+ iVar2 = gDungeonGlobalData->allPokemon[iVar3];
+ if(EntityExists(iVar2))
+ sub_806CCB4(iVar2, sub_806CEBC(iVar2));
+ }
+}
+
+void sub_806CDD4(struct DungeonEntity *r0, u8 r1, u32 r2)
+{
+ if(GetEntityType(r0) == ENTITY_POKEMON)
+ {
+ r0->unk6A = r1;
+ if(r2 < NUM_DIRECTIONS) r0->facingDir = r2;
+ }
+}
+
+void sub_806CDFC(struct DungeonEntity *r0, u8 r1, u32 r2)
+{
+ if(GetEntityType(r0) == ENTITY_POKEMON)
+ {
+ if(r0->unk6B == r1)
+ {
+ if(r0->facingDir2 == r2)
+ return;
+ else
+ goto change_dir;
+ }
+ else
+ {
+change_dir:
+ sub_806CDD4(r0, r1, r2);
+ }
+ }
+}
+
+void sub_806CE34(struct DungeonEntity *r0, u32 newDir)
+{
+ if(GetEntityType(r0) == ENTITY_POKEMON)
+ {
+ r0->unk6A = sub_806CEBC(r0);
+ if(newDir < NUM_DIRECTIONS)
+ {
+ r0->entityData->facingDir = newDir & DIRECTION_MASK;
+ r0->facingDir = newDir & DIRECTION_MASK;
+ }
+ }
+}
+
+void sub_806CE68(struct DungeonEntity *r0, u32 newDir)
+{
+ if(GetEntityType(r0) == ENTITY_POKEMON)
+ {
+ r0->unk6A = sub_806CEBC(r0);
+ if(newDir < NUM_DIRECTIONS)
+ {
+ r0->facingDir = newDir;
+ }
+ }
+}
+
+void sub_806CE94(struct DungeonEntity *r0, u32 newDir)
+{
+ if(GetEntityType(r0) == ENTITY_POKEMON)
+ {
+ r0->unk6A = 6;
+ if(newDir < NUM_DIRECTIONS)
+ {
+ r0->facingDir = newDir;
+ }
+ }
+}