From 0ed3bb1a562e96104374590bbdf4178795f7b3a0 Mon Sep 17 00:00:00 2001 From: Charles Averill Date: Thu, 8 Jan 2026 20:37:45 -0600 Subject: [PATCH 01/15] DachoraInit --- src/sprites_AI/dachora.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/sprites_AI/dachora.c diff --git a/src/sprites_AI/dachora.c b/src/sprites_AI/dachora.c new file mode 100644 index 00000000..b9c96b29 --- /dev/null +++ b/src/sprites_AI/dachora.c @@ -0,0 +1,38 @@ +#include "event_checks.h" +#include "structs/sprite.h" +#include "constants/sprite.h" + +void DachoraInit(void) +{ + u32 animals_released; + + animals_released = EventCheckAfter_AnimalsReleased(); + + if (animals_released) { + gCurrentSprite.status = 0x0; + } + else { + gCurrentSprite.properties = gCurrentSprite.properties | SP_ALWAYS_ACTIVE; + gCurrentSprite.samusCollision = SSC_NONE; + gCurrentSprite.drawOrder = 0xe; + gCurrentSprite.bgPriority = 3; + gCurrentSprite.drawDistanceTop = 0x30; + gCurrentSprite.drawDistanceBottom = 8; + gCurrentSprite.drawDistanceHorizontal = 0x20; + gCurrentSprite.hitboxTop = -4; + gCurrentSprite.hitboxBottom = 4; + gCurrentSprite.hitboxLeft = -4; + gCurrentSprite.hitboxRight = 4; + gCurrentSprite.yPosition = gCurrentSprite.yPosition - 0x20; + gCurrentSprite.workX = gCurrentSprite.xPosition; + // gCurrentSprite.samusCollision = animals_released; + MakeSpriteFaceSamusXFlip(); + gCurrentSprite.pose = 2; + gCurrentSprite.pOam = (struct FrameData*)0x0838451c; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = animals_released; + gCurrentSprite.work3 = 0; + gCurrentSprite.work1 = 0xb4; + } + return; +} From 41eb751161565963dc8ec8fab0ea9ba45fe07357 Mon Sep 17 00:00:00 2001 From: Charles Averill Date: Thu, 8 Jan 2026 20:53:11 -0600 Subject: [PATCH 02/15] DachoraCheckDoHeadMovement --- src/sprites_AI/dachora.c | 45 +++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/src/sprites_AI/dachora.c b/src/sprites_AI/dachora.c index b9c96b29..083ac1b7 100644 --- a/src/sprites_AI/dachora.c +++ b/src/sprites_AI/dachora.c @@ -2,16 +2,52 @@ #include "structs/sprite.h" #include "constants/sprite.h" +boolu32 DachoraCheckDoHeadMovement(void) { + boolu32 do_head_movement; + + do_head_movement = 1; + switch (gSpriteRandomNumber) { + case 0: + case 1: + case 2: + case 3: + gCurrentSprite.pose = 7; + gCurrentSprite.work2 = 0; + break; + case 4: + case 5: + case 6: + case 7: + gCurrentSprite.pose = 7; + gCurrentSprite.work2 = 1; + break; + case 8: + case 9: + gCurrentSprite.pose = 7; + gCurrentSprite.work2 = 2; + break; + case 10: + case 11: + case 12: + gCurrentSprite.pose = 7; + gCurrentSprite.work2 = 3; + break; + default: + do_head_movement = FALSE; + break; + } + return do_head_movement; +} + void DachoraInit(void) { - u32 animals_released; + boolu32 animals_released; animals_released = EventCheckAfter_AnimalsReleased(); if (animals_released) { gCurrentSprite.status = 0x0; - } - else { + } else { gCurrentSprite.properties = gCurrentSprite.properties | SP_ALWAYS_ACTIVE; gCurrentSprite.samusCollision = SSC_NONE; gCurrentSprite.drawOrder = 0xe; @@ -25,10 +61,9 @@ void DachoraInit(void) gCurrentSprite.hitboxRight = 4; gCurrentSprite.yPosition = gCurrentSprite.yPosition - 0x20; gCurrentSprite.workX = gCurrentSprite.xPosition; - // gCurrentSprite.samusCollision = animals_released; MakeSpriteFaceSamusXFlip(); gCurrentSprite.pose = 2; - gCurrentSprite.pOam = (struct FrameData*)0x0838451c; + gCurrentSprite.pOam = (struct FrameData*)0x0838451c; // ? gCurrentSprite.animationDurationCounter = 0; gCurrentSprite.currentAnimationFrame = animals_released; gCurrentSprite.work3 = 0; From 59e68013b7da6faee19f9c5ecc2a01cefd913e2b Mon Sep 17 00:00:00 2001 From: Charles Averill Date: Thu, 8 Jan 2026 20:58:41 -0600 Subject: [PATCH 03/15] DachoraIdleInit --- src/sprites_AI/dachora.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/sprites_AI/dachora.c b/src/sprites_AI/dachora.c index 083ac1b7..264e43f7 100644 --- a/src/sprites_AI/dachora.c +++ b/src/sprites_AI/dachora.c @@ -71,3 +71,13 @@ void DachoraInit(void) } return; } + +void DachoraIdleInit(void) { + gCurrentSprite.pose = 2; + gCurrentSprite.pOam = (struct FrameData*)0x0838451c; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.work3 = 0; + gCurrentSprite.work1 = gSpriteRandomNumber * 4 + 0x3c; + return; +} From 37b66135411ca81545861b13f8f0965f05074e7a Mon Sep 17 00:00:00 2001 From: Charles Averill Date: Fri, 9 Jan 2026 01:46:49 -0600 Subject: [PATCH 04/15] DachoraIdle --- src/sprites_AI/dachora.c | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/sprites_AI/dachora.c b/src/sprites_AI/dachora.c index 264e43f7..695fb3ff 100644 --- a/src/sprites_AI/dachora.c +++ b/src/sprites_AI/dachora.c @@ -1,3 +1,4 @@ +#include "globals.h" #include "event_checks.h" #include "structs/sprite.h" #include "constants/sprite.h" @@ -81,3 +82,54 @@ void DachoraIdleInit(void) { gCurrentSprite.work1 = gSpriteRandomNumber * 4 + 0x3c; return; } + +void DachoraIdle(void) +{ + u16 var1; + u16 var2; + + if (CheckOnAfterAnimalsReleasedEvent()) { + if (gSpriteData[gBossWork2].pose == 0x1A) { + var1 = (gAbilityRestingXPosition - 0x100) & 0xFFFF; + if (gCurrentSprite.xPosition > var1 - 0x20 && + gCurrentSprite.xPosition < var1 + 0x20) { + gCurrentSprite.pose = 0x17; + return; + } + } + } else if (gCurrentSprite.xPosition > gAbilityRestingXPosition + 0x1C0 || + gCurrentSprite.xPosition < gAbilityRestingXPosition - 0x1C0) { + + if (gCurrentSprite.work1 != 0) { + gCurrentSprite.work1--; + } else if ((gFrameCounter8Bit & 0x1F) == 0 && + (boolu8)DachoraCheckDoHeadMovement()) { + return; + } + } + + var2 = gCurrentSprite.work3 >> 2; + + if (gCurrentSprite.work3 <= 0x0F) + gCurrentSprite.work3++; + + if (gCurrentSprite.status & 0x40) { + if (gCurrentSprite.workX + 0x380 >= gCurrentSprite.xPosition) { + var1 = gCurrentSprite.xPosition; + var1 = var1 + var2; + gCurrentSprite.xPosition = var1; + return; + } + gCurrentSprite.pose = 3; + } else { + if (gCurrentSprite.workX - 0x380 > gCurrentSprite.xPosition) { + gCurrentSprite.pose = 3; + } else { + gCurrentSprite.xPosition -= var2; + } + } + + return; +} + +asm (".short 0x0000"); From 6a9668a0740b91596b041ac25802a2ac4fd58eeb Mon Sep 17 00:00:00 2001 From: Charles Averill Date: Fri, 9 Jan 2026 01:53:37 -0600 Subject: [PATCH 05/15] DachoraStandingIdle --- src/sprites_AI/dachora.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sprites_AI/dachora.c b/src/sprites_AI/dachora.c index 695fb3ff..1aa7ddaa 100644 --- a/src/sprites_AI/dachora.c +++ b/src/sprites_AI/dachora.c @@ -133,3 +133,11 @@ void DachoraIdle(void) } asm (".short 0x0000"); + +void DachoraStandingIdle(void) { + gCurrentSprite.pose = 8; + gCurrentSprite.pOam = (struct FrameData*)0x0838450c; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.work1 = 0xb; +} From cfd2ad92ae4e7a6aba40aaf20b679023fb092d61 Mon Sep 17 00:00:00 2001 From: Charles Averill Date: Fri, 9 Jan 2026 01:56:20 -0600 Subject: [PATCH 06/15] DachoraStanding --- src/sprites_AI/dachora.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sprites_AI/dachora.c b/src/sprites_AI/dachora.c index 1aa7ddaa..d0ba41d1 100644 --- a/src/sprites_AI/dachora.c +++ b/src/sprites_AI/dachora.c @@ -141,3 +141,11 @@ void DachoraStandingIdle(void) { gCurrentSprite.currentAnimationFrame = 0; gCurrentSprite.work1 = 0xb; } + +void DachoraStanding(void) { + gCurrentSprite.work1 = gCurrentSprite.work1 - 1; + if (gCurrentSprite.work1) + return; + + gCurrentSprite.pose = 9; +} From baab2bc7a86907a0e9b6505e59252996b1a4e47b Mon Sep 17 00:00:00 2001 From: Charles Averill Date: Fri, 9 Jan 2026 02:18:47 -0600 Subject: [PATCH 07/15] DachoraHeadMovementInit --- src/sprites_AI/dachora.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/sprites_AI/dachora.c b/src/sprites_AI/dachora.c index d0ba41d1..abed1ade 100644 --- a/src/sprites_AI/dachora.c +++ b/src/sprites_AI/dachora.c @@ -149,3 +149,20 @@ void DachoraStanding(void) { gCurrentSprite.pose = 9; } + +void DachoraHeadMovementInit(void) { + gCurrentSprite.pose = 0xA; + + if (gCurrentSprite.work2 == 1) { + gCurrentSprite.pOam = (struct FrameData*)0x083845c4; + } else if (gCurrentSprite.work2 == 2) { + gCurrentSprite.pOam = (struct FrameData*)0x083845e4; + } else if (gCurrentSprite.work2 == 3) { + gCurrentSprite.pOam = (struct FrameData*)0x083845fc; + } else { + gCurrentSprite.pOam = (struct FrameData*)0x08384584; + } + + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; +} From f0fcc3e28007dc1c4596d304f97949cb641eab27 Mon Sep 17 00:00:00 2001 From: Charles Averill Date: Fri, 9 Jan 2026 02:27:56 -0600 Subject: [PATCH 08/15] DachoraHeadMovement --- src/sprites_AI/dachora.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/sprites_AI/dachora.c b/src/sprites_AI/dachora.c index abed1ade..e8db64fd 100644 --- a/src/sprites_AI/dachora.c +++ b/src/sprites_AI/dachora.c @@ -166,3 +166,22 @@ void DachoraHeadMovementInit(void) { gCurrentSprite.animationDurationCounter = 0; gCurrentSprite.currentAnimationFrame = 0; } + +void DachoraHeadMovement(void) { + if (!SpriteUtilHasCurrentAnimationEnded()) { + return; + } + + if (gCurrentSprite.work2 == 1 && + gSpriteRandomNumber > 0xc) { + return; + } + + if (gSpriteRandomNumber <= 2) { + gCurrentSprite.pose = 3; + } else { + gCurrentSprite.pose = 1; + } +} + +asm (".short 0x0000"); From 78f56c168363847484a9a7493658937ec143704e Mon Sep 17 00:00:00 2001 From: Charles Averill Date: Fri, 9 Jan 2026 02:45:25 -0600 Subject: [PATCH 09/15] DachoraTurningAround... --- src/sprites_AI/dachora.c | 61 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/src/sprites_AI/dachora.c b/src/sprites_AI/dachora.c index e8db64fd..d2bbe600 100644 --- a/src/sprites_AI/dachora.c +++ b/src/sprites_AI/dachora.c @@ -185,3 +185,64 @@ void DachoraHeadMovement(void) { } asm (".short 0x0000"); + +void DachoraTurningAroundInit(void) { + gCurrentSprite.pose = 4; + gCurrentSprite.pOam = (struct FrameData* )0x08384554; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; +} + +void DachoraTurningAround(void) { + if (!SpriteUtilHasCurrentAnimationEnded()) { + return; + } + + gCurrentSprite.pose = 5; + gCurrentSprite.pOam = (struct FrameData* )0x0838456C; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.status ^= 0x40; + + if (gCurrentSprite.drawOrder == 0xE) { + gCurrentSprite.drawOrder = 0xf; + } else { + gCurrentSprite.drawOrder = 0xe; + } +} + +void DachoraTurningAroundSecondPart(void) { + if (SpriteUtilHasCurrentAnimationNearlyEnded() != 0) { + gCurrentSprite.pose = 1; + } +} + +void DachoraTurningAroundWhileLeavingInit(void) { + gCurrentSprite.pose = 0x38; + gCurrentSprite.pOam = (struct FrameData* )0x08384554; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; +} + +void DachoraTurningAroundWhileLeaving(void) { + if (SpriteUtilHasCurrentAnimationEnded() != 0) { + gCurrentSprite.pose = 0x3A; + gCurrentSprite.pOam = (struct FrameData* )0x0838456C; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.status ^= 0x40; + } +} + +void DachoraTurningAroundWhileLeavingSecondPart(void) { + if (SpriteUtilHasCurrentAnimationNearlyEnded() != 0) { + gCurrentSprite.pose = 0x19; + } +} + +void DachoraLeavingEnclosureInit(void) { + gCurrentSprite.pose = 0x18; + gCurrentSprite.work4 = 0; + gCurrentSprite.bgPriority = 2; + gCurrentSprite.drawOrder = 4; +} From 31ce70d603c67537cb933d88aa78bcee7b7807f5 Mon Sep 17 00:00:00 2001 From: Charles Averill Date: Fri, 9 Jan 2026 12:19:54 -0600 Subject: [PATCH 10/15] DachoraWaiting... --- src/sprites_AI/dachora.c | 136 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 132 insertions(+), 4 deletions(-) diff --git a/src/sprites_AI/dachora.c b/src/sprites_AI/dachora.c index d2bbe600..7335ae6b 100644 --- a/src/sprites_AI/dachora.c +++ b/src/sprites_AI/dachora.c @@ -2,6 +2,8 @@ #include "event_checks.h" #include "structs/sprite.h" #include "constants/sprite.h" +#include "samus.h" +#include "data/samus_data.h" boolu32 DachoraCheckDoHeadMovement(void) { boolu32 do_head_movement; @@ -132,8 +134,6 @@ void DachoraIdle(void) return; } -asm (".short 0x0000"); - void DachoraStandingIdle(void) { gCurrentSprite.pose = 8; gCurrentSprite.pOam = (struct FrameData*)0x0838450c; @@ -184,8 +184,6 @@ void DachoraHeadMovement(void) { } } -asm (".short 0x0000"); - void DachoraTurningAroundInit(void) { gCurrentSprite.pose = 4; gCurrentSprite.pOam = (struct FrameData* )0x08384554; @@ -246,3 +244,133 @@ void DachoraLeavingEnclosureInit(void) { gCurrentSprite.bgPriority = 2; gCurrentSprite.drawOrder = 4; } + +extern const s16 sArray_838188c[]; + +void DachoraLeavingEnclosure(void) +{ + s16 offset; + u8 index; + + index = gCurrentSprite.work4; + offset = sArray_838188c[index]; + + if (offset == SHORT_MAX) + { + if (gCurrentSprite.status & SPRITE_STATUS_X_FLIP) + gCurrentSprite.pose = 0x1a; + else + gCurrentSprite.pose = 0x37; + } + else + { + gCurrentSprite.work4++; + gCurrentSprite.yPosition += offset; + + if (gCurrentSprite.status & SPRITE_STATUS_X_FLIP) + gCurrentSprite.xPosition += PIXEL_SIZE; + else + gCurrentSprite.xPosition -= PIXEL_SIZE; + } +} + +void DachoraWalkingToWaitingSpotInit(void) { + gCurrentSprite.pOam = (struct FrameData* )0x0838451C; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.pose = 0x1A; +} + +void DachoraWalkingToWaitingSpot(void) { + if ((s32) gCurrentSprite.xPosition < (s32) (gAbilityRestingXPosition - 0xC0)) { + gCurrentSprite.xPosition += 4; + return; + } + gCurrentSprite.pOam = (struct FrameData* )0x083846CC; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.pose = 0x1B; +} + +void DachoraWaitingForOthers(void) { + u8 count; + u8 i; + + if (gCurrentSprite.currentAnimationFrame == 0 && gCurrentSprite.animationDurationCounter == 1) { + SoundPlay(0x122); + } + + for (count = 0, i = 0; i < 0x18; i++) { + if (gSpriteData[i].status & 1 && + !(gSpriteData[i].properties & 0x80) && + gSpriteData[i].spriteId == 0xB6 && + gSpriteData[i].pose == 0x1C) + count++; + } + + if (count == 3) { + gCurrentSprite.pose = 0x1C; + gCurrentSprite.work1 = 0x3C; + } +} + +void DachoraWaitingToSpawnBaby(void) { + if (gCurrentSprite.currentAnimationFrame == 0 && + gCurrentSprite.animationDurationCounter == 1) { + SoundPlay(0x122); + } + + gCurrentSprite.work1--; + if (gCurrentSprite.work1 == 0) { + gCurrentSprite.pose = 0x1D; + SpriteSpawnSecondary(0x69, 0, gCurrentSprite.spritesetGfxSlot, + gCurrentSprite.primarySpriteRamSlot, + gCurrentSprite.yPosition - 0x20, gCurrentSprite.xPosition - 0xC0, 0x40); + gCurrentSprite.work1 = 0x78; + } +} + +void DachoraWaitingForBaby(void) { + u32 var; + + if (gCurrentSprite.currentAnimationFrame == 0 && + gCurrentSprite.animationDurationCounter == 1) { + SoundPlay(0x122); + } + + var = (--gCurrentSprite.work1) & 0xff; + if (var == 0) { + gCurrentSprite.pose = 0x1E; + gPreventMovementTimer = var; + sSamusSetPoseFunctionPointer[gSamusData.unk_0](0x3B); + gCurrentSprite.work1 = 0x3C; + gCurrentSprite.work2 = 1; + } +} + +void DachoraBowing(void) { + u32 var1, var2; + + if (gCurrentSprite.work1 != 0) { + var1 = --gCurrentSprite.work1; + if (var1 == 0) { + gCurrentSprite.pOam = (struct FrameData* )0x08384584; + gCurrentSprite.animationDurationCounter = var1; + gCurrentSprite.currentAnimationFrame = var1; + SoundPlay(0x123); + } else if (gCurrentSprite.currentAnimationFrame == 0 && + gCurrentSprite.animationDurationCounter == 1) { + SoundPlay(0x122); + } + } else if (SpriteUtilHasCurrentAnimationEnded() != 0) { + var2 = --gCurrentSprite.work2; + if (var2 == 0) { + gCurrentSprite.pose = 0x1F; + gCurrentSprite.work1 = 0x3C; + gCurrentSprite.pOam = (struct FrameData* )0x083846CC; + gCurrentSprite.animationDurationCounter = var2; + gCurrentSprite.currentAnimationFrame = var2; + } + } +} + From 3cbc2ae7f480a1308efa076f0057bd59eb2733dc Mon Sep 17 00:00:00 2001 From: Charles Averill Date: Fri, 9 Jan 2026 13:44:03 -0600 Subject: [PATCH 11/15] BabyDachora... --- src/sprites_AI/dachora.c | 644 +++++++++++++++++++++++---------------- 1 file changed, 385 insertions(+), 259 deletions(-) diff --git a/src/sprites_AI/dachora.c b/src/sprites_AI/dachora.c index 7335ae6b..20616d15 100644 --- a/src/sprites_AI/dachora.c +++ b/src/sprites_AI/dachora.c @@ -1,51 +1,50 @@ -#include "globals.h" -#include "event_checks.h" -#include "structs/sprite.h" #include "constants/sprite.h" -#include "samus.h" #include "data/samus_data.h" +#include "event_checks.h" +#include "globals.h" +#include "samus.h" +#include "structs/sprite.h" boolu32 DachoraCheckDoHeadMovement(void) { - boolu32 do_head_movement; - - do_head_movement = 1; - switch (gSpriteRandomNumber) { - case 0: - case 1: - case 2: - case 3: - gCurrentSprite.pose = 7; - gCurrentSprite.work2 = 0; - break; - case 4: - case 5: - case 6: - case 7: - gCurrentSprite.pose = 7; - gCurrentSprite.work2 = 1; - break; - case 8: - case 9: - gCurrentSprite.pose = 7; - gCurrentSprite.work2 = 2; - break; - case 10: - case 11: - case 12: - gCurrentSprite.pose = 7; - gCurrentSprite.work2 = 3; - break; - default: - do_head_movement = FALSE; - break; - } - return do_head_movement; + boolu32 do_head_movement; + + do_head_movement = 1; + switch (gSpriteRandomNumber) { + case 0: + case 1: + case 2: + case 3: + gCurrentSprite.pose = 7; + gCurrentSprite.work2 = 0; + break; + case 4: + case 5: + case 6: + case 7: + gCurrentSprite.pose = 7; + gCurrentSprite.work2 = 1; + break; + case 8: + case 9: + gCurrentSprite.pose = 7; + gCurrentSprite.work2 = 2; + break; + case 10: + case 11: + case 12: + gCurrentSprite.pose = 7; + gCurrentSprite.work2 = 3; + break; + default: + do_head_movement = FALSE; + break; + } + return do_head_movement; } -void DachoraInit(void) -{ +void DachoraInit(void) { boolu32 animals_released; - + animals_released = EventCheckAfter_AnimalsReleased(); if (animals_released) { @@ -66,7 +65,7 @@ void DachoraInit(void) gCurrentSprite.workX = gCurrentSprite.xPosition; MakeSpriteFaceSamusXFlip(); gCurrentSprite.pose = 2; - gCurrentSprite.pOam = (struct FrameData*)0x0838451c; // ? + gCurrentSprite.pOam = (struct FrameData *)0x0838451c; // ? gCurrentSprite.animationDurationCounter = 0; gCurrentSprite.currentAnimationFrame = animals_released; gCurrentSprite.work3 = 0; @@ -77,7 +76,7 @@ void DachoraInit(void) void DachoraIdleInit(void) { gCurrentSprite.pose = 2; - gCurrentSprite.pOam = (struct FrameData*)0x0838451c; + gCurrentSprite.pOam = (struct FrameData *)0x0838451c; gCurrentSprite.animationDurationCounter = 0; gCurrentSprite.currentAnimationFrame = 0; gCurrentSprite.work3 = 0; @@ -85,292 +84,419 @@ void DachoraIdleInit(void) { return; } -void DachoraIdle(void) -{ - u16 var1; - u16 var2; - - if (CheckOnAfterAnimalsReleasedEvent()) { - if (gSpriteData[gBossWork2].pose == 0x1A) { - var1 = (gAbilityRestingXPosition - 0x100) & 0xFFFF; - if (gCurrentSprite.xPosition > var1 - 0x20 && - gCurrentSprite.xPosition < var1 + 0x20) { - gCurrentSprite.pose = 0x17; - return; - } - } - } else if (gCurrentSprite.xPosition > gAbilityRestingXPosition + 0x1C0 || - gCurrentSprite.xPosition < gAbilityRestingXPosition - 0x1C0) { - - if (gCurrentSprite.work1 != 0) { - gCurrentSprite.work1--; - } else if ((gFrameCounter8Bit & 0x1F) == 0 && - (boolu8)DachoraCheckDoHeadMovement()) { - return; - } +void DachoraIdle(void) { + u16 var1; + u16 var2; + + if (CheckOnAfterAnimalsReleasedEvent()) { + if (gSpriteData[gBossWork2].pose == 0x1A) { + var1 = (gAbilityRestingXPosition - 0x100) & 0xFFFF; + if (gCurrentSprite.xPosition > var1 - 0x20 && + gCurrentSprite.xPosition < var1 + 0x20) { + gCurrentSprite.pose = 0x17; + return; + } + } + } else if (gCurrentSprite.xPosition > gAbilityRestingXPosition + 0x1C0 || + gCurrentSprite.xPosition < gAbilityRestingXPosition - 0x1C0) { + + if (gCurrentSprite.work1 != 0) { + gCurrentSprite.work1--; + } else if ((gFrameCounter8Bit & 0x1F) == 0 && + (boolu8)DachoraCheckDoHeadMovement()) { + return; } + } - var2 = gCurrentSprite.work3 >> 2; + var2 = gCurrentSprite.work3 >> 2; - if (gCurrentSprite.work3 <= 0x0F) - gCurrentSprite.work3++; + if (gCurrentSprite.work3 <= 0x0F) + gCurrentSprite.work3++; - if (gCurrentSprite.status & 0x40) { - if (gCurrentSprite.workX + 0x380 >= gCurrentSprite.xPosition) { - var1 = gCurrentSprite.xPosition; - var1 = var1 + var2; - gCurrentSprite.xPosition = var1; - return; - } - gCurrentSprite.pose = 3; + if (gCurrentSprite.status & 0x40) { + if (gCurrentSprite.workX + 0x380 >= gCurrentSprite.xPosition) { + var1 = gCurrentSprite.xPosition; + var1 = var1 + var2; + gCurrentSprite.xPosition = var1; + return; + } + gCurrentSprite.pose = 3; + } else { + if (gCurrentSprite.workX - 0x380 > gCurrentSprite.xPosition) { + gCurrentSprite.pose = 3; } else { - if (gCurrentSprite.workX - 0x380 > gCurrentSprite.xPosition) { - gCurrentSprite.pose = 3; - } else { - gCurrentSprite.xPosition -= var2; - } + gCurrentSprite.xPosition -= var2; } + } - return; + return; } void DachoraStandingIdle(void) { - gCurrentSprite.pose = 8; - gCurrentSprite.pOam = (struct FrameData*)0x0838450c; - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.work1 = 0xb; + gCurrentSprite.pose = 8; + gCurrentSprite.pOam = (struct FrameData *)0x0838450c; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.work1 = 0xb; } void DachoraStanding(void) { - gCurrentSprite.work1 = gCurrentSprite.work1 - 1; - if (gCurrentSprite.work1) - return; + gCurrentSprite.work1 = gCurrentSprite.work1 - 1; + if (gCurrentSprite.work1) + return; - gCurrentSprite.pose = 9; + gCurrentSprite.pose = 9; } void DachoraHeadMovementInit(void) { - gCurrentSprite.pose = 0xA; - - if (gCurrentSprite.work2 == 1) { - gCurrentSprite.pOam = (struct FrameData*)0x083845c4; - } else if (gCurrentSprite.work2 == 2) { - gCurrentSprite.pOam = (struct FrameData*)0x083845e4; - } else if (gCurrentSprite.work2 == 3) { - gCurrentSprite.pOam = (struct FrameData*)0x083845fc; - } else { - gCurrentSprite.pOam = (struct FrameData*)0x08384584; - } - - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.pose = 0xA; + + if (gCurrentSprite.work2 == 1) { + gCurrentSprite.pOam = (struct FrameData *)0x083845c4; + } else if (gCurrentSprite.work2 == 2) { + gCurrentSprite.pOam = (struct FrameData *)0x083845e4; + } else if (gCurrentSprite.work2 == 3) { + gCurrentSprite.pOam = (struct FrameData *)0x083845fc; + } else { + gCurrentSprite.pOam = (struct FrameData *)0x08384584; + } + + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; } void DachoraHeadMovement(void) { - if (!SpriteUtilHasCurrentAnimationEnded()) { - return; - } + if (!SpriteUtilHasCurrentAnimationEnded()) { + return; + } - if (gCurrentSprite.work2 == 1 && - gSpriteRandomNumber > 0xc) { - return; - } - - if (gSpriteRandomNumber <= 2) { - gCurrentSprite.pose = 3; - } else { - gCurrentSprite.pose = 1; - } + if (gCurrentSprite.work2 == 1 && gSpriteRandomNumber > 0xc) { + return; + } + + if (gSpriteRandomNumber <= 2) { + gCurrentSprite.pose = 3; + } else { + gCurrentSprite.pose = 1; + } } void DachoraTurningAroundInit(void) { - gCurrentSprite.pose = 4; - gCurrentSprite.pOam = (struct FrameData* )0x08384554; - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.pose = 4; + gCurrentSprite.pOam = (struct FrameData *)0x08384554; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; } void DachoraTurningAround(void) { - if (!SpriteUtilHasCurrentAnimationEnded()) { - return; - } + if (!SpriteUtilHasCurrentAnimationEnded()) { + return; + } - gCurrentSprite.pose = 5; - gCurrentSprite.pOam = (struct FrameData* )0x0838456C; - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.status ^= 0x40; + gCurrentSprite.pose = 5; + gCurrentSprite.pOam = (struct FrameData *)0x0838456C; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.status ^= 0x40; - if (gCurrentSprite.drawOrder == 0xE) { - gCurrentSprite.drawOrder = 0xf; - } else { - gCurrentSprite.drawOrder = 0xe; - } + if (gCurrentSprite.drawOrder == 0xE) { + gCurrentSprite.drawOrder = 0xf; + } else { + gCurrentSprite.drawOrder = 0xe; + } } void DachoraTurningAroundSecondPart(void) { - if (SpriteUtilHasCurrentAnimationNearlyEnded() != 0) { - gCurrentSprite.pose = 1; - } + if (SpriteUtilHasCurrentAnimationNearlyEnded() != 0) { + gCurrentSprite.pose = 1; + } } void DachoraTurningAroundWhileLeavingInit(void) { - gCurrentSprite.pose = 0x38; - gCurrentSprite.pOam = (struct FrameData* )0x08384554; - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.pose = 0x38; + gCurrentSprite.pOam = (struct FrameData *)0x08384554; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; } void DachoraTurningAroundWhileLeaving(void) { - if (SpriteUtilHasCurrentAnimationEnded() != 0) { - gCurrentSprite.pose = 0x3A; - gCurrentSprite.pOam = (struct FrameData* )0x0838456C; - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.status ^= 0x40; - } + if (SpriteUtilHasCurrentAnimationEnded() != 0) { + gCurrentSprite.pose = 0x3A; + gCurrentSprite.pOam = (struct FrameData *)0x0838456C; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.status ^= 0x40; + } } void DachoraTurningAroundWhileLeavingSecondPart(void) { - if (SpriteUtilHasCurrentAnimationNearlyEnded() != 0) { - gCurrentSprite.pose = 0x19; - } + if (SpriteUtilHasCurrentAnimationNearlyEnded() != 0) { + gCurrentSprite.pose = 0x19; + } } void DachoraLeavingEnclosureInit(void) { - gCurrentSprite.pose = 0x18; - gCurrentSprite.work4 = 0; - gCurrentSprite.bgPriority = 2; - gCurrentSprite.drawOrder = 4; + gCurrentSprite.pose = 0x18; + gCurrentSprite.work4 = 0; + gCurrentSprite.bgPriority = 2; + gCurrentSprite.drawOrder = 4; } extern const s16 sArray_838188c[]; -void DachoraLeavingEnclosure(void) -{ - s16 offset; - u8 index; - - index = gCurrentSprite.work4; - offset = sArray_838188c[index]; - - if (offset == SHORT_MAX) - { - if (gCurrentSprite.status & SPRITE_STATUS_X_FLIP) - gCurrentSprite.pose = 0x1a; - else - gCurrentSprite.pose = 0x37; - } - else - { - gCurrentSprite.work4++; - gCurrentSprite.yPosition += offset; - - if (gCurrentSprite.status & SPRITE_STATUS_X_FLIP) - gCurrentSprite.xPosition += PIXEL_SIZE; - else - gCurrentSprite.xPosition -= PIXEL_SIZE; - } +void DachoraLeavingEnclosure(void) { + s16 offset; + u8 index; + + index = gCurrentSprite.work4; + offset = sArray_838188c[index]; + + if (offset == SHORT_MAX) { + if (gCurrentSprite.status & SPRITE_STATUS_X_FLIP) + gCurrentSprite.pose = 0x1a; + else + gCurrentSprite.pose = 0x37; + } else { + gCurrentSprite.work4++; + gCurrentSprite.yPosition += offset; + + if (gCurrentSprite.status & SPRITE_STATUS_X_FLIP) + gCurrentSprite.xPosition += PIXEL_SIZE; + else + gCurrentSprite.xPosition -= PIXEL_SIZE; + } } void DachoraWalkingToWaitingSpotInit(void) { - gCurrentSprite.pOam = (struct FrameData* )0x0838451C; - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.pose = 0x1A; + gCurrentSprite.pOam = (struct FrameData *)0x0838451C; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.pose = 0x1A; } void DachoraWalkingToWaitingSpot(void) { - if ((s32) gCurrentSprite.xPosition < (s32) (gAbilityRestingXPosition - 0xC0)) { - gCurrentSprite.xPosition += 4; - return; - } - gCurrentSprite.pOam = (struct FrameData* )0x083846CC; - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.pose = 0x1B; + if ((s32)gCurrentSprite.xPosition < (s32)(gAbilityRestingXPosition - 0xC0)) { + gCurrentSprite.xPosition += 4; + return; + } + gCurrentSprite.pOam = (struct FrameData *)0x083846CC; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.pose = 0x1B; } void DachoraWaitingForOthers(void) { - u8 count; - u8 i; - - if (gCurrentSprite.currentAnimationFrame == 0 && gCurrentSprite.animationDurationCounter == 1) { - SoundPlay(0x122); - } + u8 count; + u8 i; - for (count = 0, i = 0; i < 0x18; i++) { - if (gSpriteData[i].status & 1 && - !(gSpriteData[i].properties & 0x80) && - gSpriteData[i].spriteId == 0xB6 && - gSpriteData[i].pose == 0x1C) - count++; - } - - if (count == 3) { - gCurrentSprite.pose = 0x1C; - gCurrentSprite.work1 = 0x3C; - } + if (gCurrentSprite.currentAnimationFrame == 0 && + gCurrentSprite.animationDurationCounter == 1) { + SoundPlay(0x122); + } + + for (count = 0, i = 0; i < 0x18; i++) { + if (gSpriteData[i].status & 1 && !(gSpriteData[i].properties & 0x80) && + gSpriteData[i].spriteId == 0xB6 && gSpriteData[i].pose == 0x1C) + count++; + } + + if (count == 3) { + gCurrentSprite.pose = 0x1C; + gCurrentSprite.work1 = 0x3C; + } } void DachoraWaitingToSpawnBaby(void) { - if (gCurrentSprite.currentAnimationFrame == 0 && - gCurrentSprite.animationDurationCounter == 1) { - SoundPlay(0x122); - } + if (gCurrentSprite.currentAnimationFrame == 0 && + gCurrentSprite.animationDurationCounter == 1) { + SoundPlay(0x122); + } - gCurrentSprite.work1--; - if (gCurrentSprite.work1 == 0) { - gCurrentSprite.pose = 0x1D; - SpriteSpawnSecondary(0x69, 0, gCurrentSprite.spritesetGfxSlot, - gCurrentSprite.primarySpriteRamSlot, - gCurrentSprite.yPosition - 0x20, gCurrentSprite.xPosition - 0xC0, 0x40); - gCurrentSprite.work1 = 0x78; - } + gCurrentSprite.work1--; + if (gCurrentSprite.work1 == 0) { + gCurrentSprite.pose = 0x1D; + SpriteSpawnSecondary(0x69, 0, gCurrentSprite.spritesetGfxSlot, + gCurrentSprite.primarySpriteRamSlot, + gCurrentSprite.yPosition - 0x20, + gCurrentSprite.xPosition - 0xC0, 0x40); + gCurrentSprite.work1 = 0x78; + } } void DachoraWaitingForBaby(void) { - u32 var; + u32 var; - if (gCurrentSprite.currentAnimationFrame == 0 && - gCurrentSprite.animationDurationCounter == 1) { - SoundPlay(0x122); - } + if (gCurrentSprite.currentAnimationFrame == 0 && + gCurrentSprite.animationDurationCounter == 1) { + SoundPlay(0x122); + } - var = (--gCurrentSprite.work1) & 0xff; - if (var == 0) { - gCurrentSprite.pose = 0x1E; - gPreventMovementTimer = var; - sSamusSetPoseFunctionPointer[gSamusData.unk_0](0x3B); - gCurrentSprite.work1 = 0x3C; - gCurrentSprite.work2 = 1; - } + var = (--gCurrentSprite.work1) & 0xff; + if (var == 0) { + gCurrentSprite.pose = 0x1E; + gPreventMovementTimer = var; + sSamusSetPoseFunctionPointer[gSamusData.unk_0](0x3B); + gCurrentSprite.work1 = 0x3C; + gCurrentSprite.work2 = 1; + } } void DachoraBowing(void) { - u32 var1, var2; - - if (gCurrentSprite.work1 != 0) { - var1 = --gCurrentSprite.work1; - if (var1 == 0) { - gCurrentSprite.pOam = (struct FrameData* )0x08384584; - gCurrentSprite.animationDurationCounter = var1; - gCurrentSprite.currentAnimationFrame = var1; - SoundPlay(0x123); - } else if (gCurrentSprite.currentAnimationFrame == 0 && - gCurrentSprite.animationDurationCounter == 1) { - SoundPlay(0x122); - } - } else if (SpriteUtilHasCurrentAnimationEnded() != 0) { - var2 = --gCurrentSprite.work2; - if (var2 == 0) { - gCurrentSprite.pose = 0x1F; - gCurrentSprite.work1 = 0x3C; - gCurrentSprite.pOam = (struct FrameData* )0x083846CC; - gCurrentSprite.animationDurationCounter = var2; - gCurrentSprite.currentAnimationFrame = var2; - } + u32 var1, var2; + + if (gCurrentSprite.work1 != 0) { + var1 = --gCurrentSprite.work1; + if (var1 == 0) { + gCurrentSprite.pOam = (struct FrameData *)0x08384584; + gCurrentSprite.animationDurationCounter = var1; + gCurrentSprite.currentAnimationFrame = var1; + SoundPlay(0x123); + } else if (gCurrentSprite.currentAnimationFrame == 0 && + gCurrentSprite.animationDurationCounter == 1) { + SoundPlay(0x122); + } + } else if (SpriteUtilHasCurrentAnimationEnded() != 0) { + var2 = --gCurrentSprite.work2; + if (var2 == 0) { + gCurrentSprite.pose = 0x1F; + gCurrentSprite.work1 = 0x3C; + gCurrentSprite.pOam = (struct FrameData *)0x083846CC; + gCurrentSprite.animationDurationCounter = var2; + gCurrentSprite.currentAnimationFrame = var2; + } + } +} + +void DachoraWaitingToRun(void) { + u32 var; + + var = --gCurrentSprite.work1; + if (var == 0) { + *(&gCurrentSprite.work1 - 0xA) = 0x20; + gCurrentSprite.pOam = (struct FrameData *)0x0838451C; + gCurrentSprite.animationDurationCounter = var; + gCurrentSprite.currentAnimationFrame = var; + SoundPlay_3b1c(0x124); + } +} + +void DachoraRunning(void) { + u16 temp_r0; + + gCurrentSprite.xPosition += 0xE; + gCurrentSprite.animationDurationCounter += 2; + temp_r0 = 2 & gCurrentSprite.status; + if (temp_r0 == 0) { + gCurrentSprite.status = temp_r0; + } +} + +void BabyDachoraInit(void) { + gCurrentSprite.status &= 0xFFFB; + gCurrentSprite.properties |= SP_ALWAYS_ACTIVE; + gCurrentSprite.drawOrder = 0xC; + gCurrentSprite.bgPriority = 3; + gCurrentSprite.samusCollision = SSC_NONE; + gCurrentSprite.drawDistanceTop = 0x10; + gCurrentSprite.drawDistanceBottom = 0; + gCurrentSprite.drawDistanceHorizontal = 8; + gCurrentSprite.hitboxTop = -4; + gCurrentSprite.hitboxBottom = 4; + gCurrentSprite.hitboxLeft = -4; + gCurrentSprite.hitboxRight = 4; + gCurrentSprite.pOam = (struct FrameData *)0x0838462C; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.pose = 1; + gCurrentSprite.work1 = 0x20; +} + +void BabyDachoraWalkingToGate(void) { + u8 var; + + var = --gCurrentSprite.work1; + if (var != 0) { + gCurrentSprite.xPosition += 4; + } else { + gCurrentSprite.pose = 2; + gCurrentSprite.work4 = var; + } +} + +extern const s16 sArray_0x0838188c[]; + +void BabyDachoraLeavingEnclosure(void) { + u8 var; + + var = gCurrentSprite.work4; + + if (sArray_0x0838188c[var] == 0x7FFF) { + gCurrentSprite.pose = 0x17; + gCurrentSprite.work1 = 0x28; + gCurrentSprite.bgPriority = 2; + } else { + gCurrentSprite.work4 = var + 1; + gCurrentSprite.yPosition += sArray_0x0838188c[var]; + gCurrentSprite.xPosition += 4; + } +} + +void BabyDachoraWalkingToWaitingSpot(void) { + u8 var; + + var = --gCurrentSprite.work1; + if (var) { + gCurrentSprite.xPosition += 2; + } else { + gCurrentSprite.pose = 0x18; + gCurrentSprite.drawOrder = 5; + gCurrentSprite.pOam = (struct FrameData *)0x083846F4; + gCurrentSprite.animationDurationCounter = var; + gCurrentSprite.currentAnimationFrame = var; + } +} + +extern u8 sVar_0x030006ea[]; + +void BabyDachoraWaitingToRun(void) { + u8 i; + u8 *e0; + u8 *ea; + struct SpriteData *sprites; + + i = 0; + sprites = gSpriteData; + ea = sVar_0x030006ea; + e0 = ea - 0xA; + + while (i < 0x18) { + if (sprites[i].status & 1 && !(sprites[i].properties & 0x80) && + sprites[i].spriteId == 0xB8 && sprites[i].pose == 0x20) { + *e0 = 0x19; + *ea = 0x5A; } + i++; + } } +void BabyDachoraRunning(void) { + u16 var1, var2; + + if (gCurrentSprite.work1 != 0) { + var1 = --gCurrentSprite.work1; + if (var1 == 0) { + gCurrentSprite.pOam = (struct FrameData *)0x0838462C; + gCurrentSprite.animationDurationCounter = var1; + gCurrentSprite.currentAnimationFrame = var1; + } + } else { + gCurrentSprite.xPosition += 8; + gCurrentSprite.animationDurationCounter += 4; + + var2 = gCurrentSprite.status & 2; + if (var2 == 0) { + gSamusData.currentAnimationFrame++; + gCurrentSprite.status = var2; + } + } +} From d7e634e15dc6caad7759173ea5a72094c418bfd6 Mon Sep 17 00:00:00 2001 From: Charles Averill Date: Fri, 9 Jan 2026 13:59:49 -0600 Subject: [PATCH 12/15] cleanup --- include/sprites_AI/dachora.h | 49 ++++++++++++++++++++++++++++++++++++ src/sprites_AI/dachora.c | 17 +++---------- 2 files changed, 52 insertions(+), 14 deletions(-) create mode 100644 include/sprites_AI/dachora.h diff --git a/include/sprites_AI/dachora.h b/include/sprites_AI/dachora.h new file mode 100644 index 00000000..3d19ac5d --- /dev/null +++ b/include/sprites_AI/dachora.h @@ -0,0 +1,49 @@ +#ifndef DACHORA_H +#define DACHORA_H + +#include "constants/sprite.h" +#include "data/samus_data.h" +#include "event_checks.h" +#include "globals.h" +#include "samus.h" +#include "structs/sprite.h" +#include "sprite_util.h" +#include "sprite.h" + +boolu32 DachoraCheckDoHeadMovement(void); +void DachoraInit(void); +void DachoraIdleInit(void); +void DachoraIdle(void); +void DachoraStandingIdle(void); +void DachoraStanding(void); +void DachoraHeadMovementInit(void); +void DachoraHeadMovement(void); +void DachoraTurningAroundInit(void); +void DachoraTurningAround(void); +void DachoraTurningAroundSecondPart(void); +void DachoraTurningAroundWhileLeavingInit(void); +void DachoraTurningAroundWhileLeaving(void); +void DachoraTurningAroundWhileLeavingSecondPart(void); +void DachoraLeavingEnclosureInit(void); +void DachoraLeavingEnclosure(void); +void DachoraWalkingToWaitingSpotInit(void); +void DachoraWalkingToWaitingSpot(void); +void DachoraWaitingForOthers(void); +void DachoraWaitingToSpawnBaby(void); +void DachoraWaitingForBaby(void); +void DachoraBowing(void); +void DachoraWaitingToRun(void); +void DachoraRunning(void); + +void BabyDachoraInit(void); +void BabyDachoraWalkingToGate(void); +void BabyDachoraLeavingEnclosure(void); +void BabyDachoraWalkingToWaitingSpot(void); +void BabyDachoraWaitingToRun(void); +void BabyDachoraRunning(void); + +extern const s16 sArray_838188c[]; +extern const s16 sArray_0x0838188c[]; +extern u8 sVar_0x030006ea[]; + +#endif /* DACHORA_H */ diff --git a/src/sprites_AI/dachora.c b/src/sprites_AI/dachora.c index 20616d15..072359a6 100644 --- a/src/sprites_AI/dachora.c +++ b/src/sprites_AI/dachora.c @@ -1,9 +1,4 @@ -#include "constants/sprite.h" -#include "data/samus_data.h" -#include "event_checks.h" -#include "globals.h" -#include "samus.h" -#include "structs/sprite.h" +#include "sprites_AI/dachora.h" boolu32 DachoraCheckDoHeadMovement(void) { boolu32 do_head_movement; @@ -65,7 +60,7 @@ void DachoraInit(void) { gCurrentSprite.workX = gCurrentSprite.xPosition; MakeSpriteFaceSamusXFlip(); gCurrentSprite.pose = 2; - gCurrentSprite.pOam = (struct FrameData *)0x0838451c; // ? + gCurrentSprite.pOam = (struct FrameData *)0x0838451c; gCurrentSprite.animationDurationCounter = 0; gCurrentSprite.currentAnimationFrame = animals_released; gCurrentSprite.work3 = 0; @@ -88,7 +83,7 @@ void DachoraIdle(void) { u16 var1; u16 var2; - if (CheckOnAfterAnimalsReleasedEvent()) { + if (EventCheckAfter_AnimalsReleased()) { if (gSpriteData[gBossWork2].pose == 0x1A) { var1 = (gAbilityRestingXPosition - 0x100) & 0xFFFF; if (gCurrentSprite.xPosition > var1 - 0x20 && @@ -242,8 +237,6 @@ void DachoraLeavingEnclosureInit(void) { gCurrentSprite.drawOrder = 4; } -extern const s16 sArray_838188c[]; - void DachoraLeavingEnclosure(void) { s16 offset; u8 index; @@ -423,8 +416,6 @@ void BabyDachoraWalkingToGate(void) { } } -extern const s16 sArray_0x0838188c[]; - void BabyDachoraLeavingEnclosure(void) { u8 var; @@ -456,8 +447,6 @@ void BabyDachoraWalkingToWaitingSpot(void) { } } -extern u8 sVar_0x030006ea[]; - void BabyDachoraWaitingToRun(void) { u8 i; u8 *e0; From 1c75d554aee09a6bebcc832e2b58677f233dc320 Mon Sep 17 00:00:00 2001 From: Charles Averill Date: Fri, 9 Jan 2026 19:29:57 -0600 Subject: [PATCH 13/15] Document data and format --- include/data/sprites/dachora.h | 8 + include/sprites_AI/dachora.h | 6 +- src/data/sprites/dachora.c | 3 + src/sprites_AI/dachora.c | 907 ++++++++++++++++++--------------- 4 files changed, 514 insertions(+), 410 deletions(-) create mode 100644 include/data/sprites/dachora.h create mode 100644 src/data/sprites/dachora.c diff --git a/include/data/sprites/dachora.h b/include/data/sprites/dachora.h new file mode 100644 index 00000000..2ab992a1 --- /dev/null +++ b/include/data/sprites/dachora.h @@ -0,0 +1,8 @@ +#ifndef DACHORA_DATA_H +#define DACHORA_DATA_H + +#include "types.h" + +extern const s16 sAnimalsEnclosure_38188c[13]; + +#endif diff --git a/include/sprites_AI/dachora.h b/include/sprites_AI/dachora.h index 3d19ac5d..b60ffcff 100644 --- a/include/sprites_AI/dachora.h +++ b/include/sprites_AI/dachora.h @@ -10,6 +10,8 @@ #include "sprite_util.h" #include "sprite.h" +#include "data/sprites/dachora.h" + boolu32 DachoraCheckDoHeadMovement(void); void DachoraInit(void); void DachoraIdleInit(void); @@ -42,8 +44,4 @@ void BabyDachoraWalkingToWaitingSpot(void); void BabyDachoraWaitingToRun(void); void BabyDachoraRunning(void); -extern const s16 sArray_838188c[]; -extern const s16 sArray_0x0838188c[]; -extern u8 sVar_0x030006ea[]; - #endif /* DACHORA_H */ diff --git a/src/data/sprites/dachora.c b/src/data/sprites/dachora.c new file mode 100644 index 00000000..d191189a --- /dev/null +++ b/src/data/sprites/dachora.c @@ -0,0 +1,3 @@ +#include "data/sprites/dachora.h" + +const s16 sAnimalsEnclosure_38188c[13] = {0xfffa, 0xfffc, 0xfffe, 0, 0, 2, 4, 6, 8, 8, 8, 8, 0x7fff}; diff --git a/src/sprites_AI/dachora.c b/src/sprites_AI/dachora.c index 072359a6..db8c512b 100644 --- a/src/sprites_AI/dachora.c +++ b/src/sprites_AI/dachora.c @@ -1,491 +1,586 @@ #include "sprites_AI/dachora.h" -boolu32 DachoraCheckDoHeadMovement(void) { - boolu32 do_head_movement; - - do_head_movement = 1; - switch (gSpriteRandomNumber) { - case 0: - case 1: - case 2: - case 3: - gCurrentSprite.pose = 7; - gCurrentSprite.work2 = 0; - break; - case 4: - case 5: - case 6: - case 7: - gCurrentSprite.pose = 7; - gCurrentSprite.work2 = 1; - break; - case 8: - case 9: - gCurrentSprite.pose = 7; - gCurrentSprite.work2 = 2; - break; - case 10: - case 11: - case 12: - gCurrentSprite.pose = 7; - gCurrentSprite.work2 = 3; - break; - default: - do_head_movement = FALSE; - break; - } - return do_head_movement; +boolu32 DachoraCheckDoHeadMovement(void) +{ + boolu32 do_head_movement; + + do_head_movement = 1; + switch (gSpriteRandomNumber) + { + case 0: + case 1: + case 2: + case 3: + gCurrentSprite.pose = 7; + gCurrentSprite.work2 = 0; + break; + case 4: + case 5: + case 6: + case 7: + gCurrentSprite.pose = 7; + gCurrentSprite.work2 = 1; + break; + case 8: + case 9: + gCurrentSprite.pose = 7; + gCurrentSprite.work2 = 2; + break; + case 10: + case 11: + case 12: + gCurrentSprite.pose = 7; + gCurrentSprite.work2 = 3; + break; + default: + do_head_movement = FALSE; + break; + } + return do_head_movement; } -void DachoraInit(void) { - boolu32 animals_released; +void DachoraInit(void) +{ + boolu32 animals_released; - animals_released = EventCheckAfter_AnimalsReleased(); + animals_released = EventCheckAfter_AnimalsReleased(); - if (animals_released) { - gCurrentSprite.status = 0x0; - } else { - gCurrentSprite.properties = gCurrentSprite.properties | SP_ALWAYS_ACTIVE; - gCurrentSprite.samusCollision = SSC_NONE; - gCurrentSprite.drawOrder = 0xe; - gCurrentSprite.bgPriority = 3; - gCurrentSprite.drawDistanceTop = 0x30; - gCurrentSprite.drawDistanceBottom = 8; - gCurrentSprite.drawDistanceHorizontal = 0x20; - gCurrentSprite.hitboxTop = -4; - gCurrentSprite.hitboxBottom = 4; - gCurrentSprite.hitboxLeft = -4; - gCurrentSprite.hitboxRight = 4; - gCurrentSprite.yPosition = gCurrentSprite.yPosition - 0x20; - gCurrentSprite.workX = gCurrentSprite.xPosition; - MakeSpriteFaceSamusXFlip(); + if (animals_released) + { + gCurrentSprite.status = 0x0; + } + else + { + gCurrentSprite.properties = gCurrentSprite.properties | SP_ALWAYS_ACTIVE; + gCurrentSprite.samusCollision = SSC_NONE; + gCurrentSprite.drawOrder = 0xe; + gCurrentSprite.bgPriority = 3; + gCurrentSprite.drawDistanceTop = 0x30; + gCurrentSprite.drawDistanceBottom = 8; + gCurrentSprite.drawDistanceHorizontal = 0x20; + gCurrentSprite.hitboxTop = -4; + gCurrentSprite.hitboxBottom = 4; + gCurrentSprite.hitboxLeft = -4; + gCurrentSprite.hitboxRight = 4; + gCurrentSprite.yPosition = gCurrentSprite.yPosition - 0x20; + gCurrentSprite.workX = gCurrentSprite.xPosition; + MakeSpriteFaceSamusXFlip(); + gCurrentSprite.pose = 2; + gCurrentSprite.pOam = (struct FrameData*)0x0838451c; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = animals_released; + gCurrentSprite.work3 = 0; + gCurrentSprite.work1 = 0xb4; + } + return; +} + +void DachoraIdleInit(void) +{ gCurrentSprite.pose = 2; - gCurrentSprite.pOam = (struct FrameData *)0x0838451c; + gCurrentSprite.pOam = (struct FrameData*)0x0838451c; gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = animals_released; + gCurrentSprite.currentAnimationFrame = 0; gCurrentSprite.work3 = 0; - gCurrentSprite.work1 = 0xb4; - } - return; -} - -void DachoraIdleInit(void) { - gCurrentSprite.pose = 2; - gCurrentSprite.pOam = (struct FrameData *)0x0838451c; - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.work3 = 0; - gCurrentSprite.work1 = gSpriteRandomNumber * 4 + 0x3c; - return; + gCurrentSprite.work1 = gSpriteRandomNumber * 4 + 0x3c; + return; } -void DachoraIdle(void) { - u16 var1; - u16 var2; - - if (EventCheckAfter_AnimalsReleased()) { - if (gSpriteData[gBossWork2].pose == 0x1A) { - var1 = (gAbilityRestingXPosition - 0x100) & 0xFFFF; - if (gCurrentSprite.xPosition > var1 - 0x20 && - gCurrentSprite.xPosition < var1 + 0x20) { - gCurrentSprite.pose = 0x17; - return; - } +void DachoraIdle(void) +{ + u16 var1; + u16 var2; + + if (EventCheckAfter_AnimalsReleased()) + { + if (gSpriteData[gBossWork2].pose == 0x1A) + { + var1 = (gAbilityRestingXPosition - 0x100) & 0xFFFF; + if (gCurrentSprite.xPosition > var1 - 0x20 && gCurrentSprite.xPosition < var1 + 0x20) + { + gCurrentSprite.pose = 0x17; + return; + } + } } - } else if (gCurrentSprite.xPosition > gAbilityRestingXPosition + 0x1C0 || - gCurrentSprite.xPosition < gAbilityRestingXPosition - 0x1C0) { - - if (gCurrentSprite.work1 != 0) { - gCurrentSprite.work1--; - } else if ((gFrameCounter8Bit & 0x1F) == 0 && - (boolu8)DachoraCheckDoHeadMovement()) { - return; + else if (gCurrentSprite.xPosition > gAbilityRestingXPosition + 0x1C0 || + gCurrentSprite.xPosition < gAbilityRestingXPosition - 0x1C0) + { + if (gCurrentSprite.work1 != 0) + { + gCurrentSprite.work1--; + } + else if ((gFrameCounter8Bit & 0x1F) == 0 && (boolu8)DachoraCheckDoHeadMovement()) + { + return; + } } - } - - var2 = gCurrentSprite.work3 >> 2; - if (gCurrentSprite.work3 <= 0x0F) - gCurrentSprite.work3++; - - if (gCurrentSprite.status & 0x40) { - if (gCurrentSprite.workX + 0x380 >= gCurrentSprite.xPosition) { - var1 = gCurrentSprite.xPosition; - var1 = var1 + var2; - gCurrentSprite.xPosition = var1; - return; + var2 = gCurrentSprite.work3 >> 2; + + if (gCurrentSprite.work3 <= 0x0F) + gCurrentSprite.work3++; + + if (gCurrentSprite.status & 0x40) + { + if (gCurrentSprite.workX + 0x380 >= gCurrentSprite.xPosition) + { + var1 = gCurrentSprite.xPosition; + var1 = var1 + var2; + gCurrentSprite.xPosition = var1; + return; + } + gCurrentSprite.pose = 3; } - gCurrentSprite.pose = 3; - } else { - if (gCurrentSprite.workX - 0x380 > gCurrentSprite.xPosition) { - gCurrentSprite.pose = 3; - } else { - gCurrentSprite.xPosition -= var2; + else + { + if (gCurrentSprite.workX - 0x380 > gCurrentSprite.xPosition) + { + gCurrentSprite.pose = 3; + } + else + { + gCurrentSprite.xPosition -= var2; + } } - } - return; + return; } -void DachoraStandingIdle(void) { - gCurrentSprite.pose = 8; - gCurrentSprite.pOam = (struct FrameData *)0x0838450c; - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.work1 = 0xb; +void DachoraStandingIdle(void) +{ + gCurrentSprite.pose = 8; + gCurrentSprite.pOam = (struct FrameData*)0x0838450c; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.work1 = 0xb; } -void DachoraStanding(void) { - gCurrentSprite.work1 = gCurrentSprite.work1 - 1; - if (gCurrentSprite.work1) - return; +void DachoraStanding(void) +{ + gCurrentSprite.work1 = gCurrentSprite.work1 - 1; + if (gCurrentSprite.work1) + return; - gCurrentSprite.pose = 9; + gCurrentSprite.pose = 9; } -void DachoraHeadMovementInit(void) { - gCurrentSprite.pose = 0xA; - - if (gCurrentSprite.work2 == 1) { - gCurrentSprite.pOam = (struct FrameData *)0x083845c4; - } else if (gCurrentSprite.work2 == 2) { - gCurrentSprite.pOam = (struct FrameData *)0x083845e4; - } else if (gCurrentSprite.work2 == 3) { - gCurrentSprite.pOam = (struct FrameData *)0x083845fc; - } else { - gCurrentSprite.pOam = (struct FrameData *)0x08384584; - } - - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; +void DachoraHeadMovementInit(void) +{ + gCurrentSprite.pose = 0xA; + + if (gCurrentSprite.work2 == 1) + { + gCurrentSprite.pOam = (struct FrameData*)0x083845c4; + } + else if (gCurrentSprite.work2 == 2) + { + gCurrentSprite.pOam = (struct FrameData*)0x083845e4; + } + else if (gCurrentSprite.work2 == 3) + { + gCurrentSprite.pOam = (struct FrameData*)0x083845fc; + } + else + { + gCurrentSprite.pOam = (struct FrameData*)0x08384584; + } + + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; } -void DachoraHeadMovement(void) { - if (!SpriteUtilHasCurrentAnimationEnded()) { - return; - } +void DachoraHeadMovement(void) +{ + if (!SpriteUtilHasCurrentAnimationEnded()) + { + return; + } - if (gCurrentSprite.work2 == 1 && gSpriteRandomNumber > 0xc) { - return; - } + if (gCurrentSprite.work2 == 1 && gSpriteRandomNumber > 0xc) + { + return; + } - if (gSpriteRandomNumber <= 2) { - gCurrentSprite.pose = 3; - } else { - gCurrentSprite.pose = 1; - } + if (gSpriteRandomNumber <= 2) + { + gCurrentSprite.pose = 3; + } + else + { + gCurrentSprite.pose = 1; + } } -void DachoraTurningAroundInit(void) { - gCurrentSprite.pose = 4; - gCurrentSprite.pOam = (struct FrameData *)0x08384554; - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; +void DachoraTurningAroundInit(void) +{ + gCurrentSprite.pose = 4; + gCurrentSprite.pOam = (struct FrameData*)0x08384554; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; } -void DachoraTurningAround(void) { - if (!SpriteUtilHasCurrentAnimationEnded()) { - return; - } - - gCurrentSprite.pose = 5; - gCurrentSprite.pOam = (struct FrameData *)0x0838456C; - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.status ^= 0x40; - - if (gCurrentSprite.drawOrder == 0xE) { - gCurrentSprite.drawOrder = 0xf; - } else { - gCurrentSprite.drawOrder = 0xe; - } -} +void DachoraTurningAround(void) +{ + if (!SpriteUtilHasCurrentAnimationEnded()) + { + return; + } -void DachoraTurningAroundSecondPart(void) { - if (SpriteUtilHasCurrentAnimationNearlyEnded() != 0) { - gCurrentSprite.pose = 1; - } + gCurrentSprite.pose = 5; + gCurrentSprite.pOam = (struct FrameData*)0x0838456C; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.status ^= 0x40; + + if (gCurrentSprite.drawOrder == 0xE) + { + gCurrentSprite.drawOrder = 0xf; + } + else + { + gCurrentSprite.drawOrder = 0xe; + } } -void DachoraTurningAroundWhileLeavingInit(void) { - gCurrentSprite.pose = 0x38; - gCurrentSprite.pOam = (struct FrameData *)0x08384554; - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; +void DachoraTurningAroundSecondPart(void) +{ + if (SpriteUtilHasCurrentAnimationNearlyEnded() != 0) + { + gCurrentSprite.pose = 1; + } } -void DachoraTurningAroundWhileLeaving(void) { - if (SpriteUtilHasCurrentAnimationEnded() != 0) { - gCurrentSprite.pose = 0x3A; - gCurrentSprite.pOam = (struct FrameData *)0x0838456C; +void DachoraTurningAroundWhileLeavingInit(void) +{ + gCurrentSprite.pose = 0x38; + gCurrentSprite.pOam = (struct FrameData*)0x08384554; gCurrentSprite.animationDurationCounter = 0; gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.status ^= 0x40; - } } -void DachoraTurningAroundWhileLeavingSecondPart(void) { - if (SpriteUtilHasCurrentAnimationNearlyEnded() != 0) { - gCurrentSprite.pose = 0x19; - } +void DachoraTurningAroundWhileLeaving(void) +{ + if (SpriteUtilHasCurrentAnimationEnded() != 0) + { + gCurrentSprite.pose = 0x3A; + gCurrentSprite.pOam = (struct FrameData*)0x0838456C; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.status ^= 0x40; + } } -void DachoraLeavingEnclosureInit(void) { - gCurrentSprite.pose = 0x18; - gCurrentSprite.work4 = 0; - gCurrentSprite.bgPriority = 2; - gCurrentSprite.drawOrder = 4; +void DachoraTurningAroundWhileLeavingSecondPart(void) +{ + if (SpriteUtilHasCurrentAnimationNearlyEnded() != 0) + { + gCurrentSprite.pose = 0x19; + } } -void DachoraLeavingEnclosure(void) { - s16 offset; - u8 index; +void DachoraLeavingEnclosureInit(void) +{ + gCurrentSprite.pose = 0x18; + gCurrentSprite.work4 = 0; + gCurrentSprite.bgPriority = 2; + gCurrentSprite.drawOrder = 4; +} - index = gCurrentSprite.work4; - offset = sArray_838188c[index]; +void DachoraLeavingEnclosure(void) +{ + s16 offset; + u8 index; - if (offset == SHORT_MAX) { - if (gCurrentSprite.status & SPRITE_STATUS_X_FLIP) - gCurrentSprite.pose = 0x1a; - else - gCurrentSprite.pose = 0x37; - } else { - gCurrentSprite.work4++; - gCurrentSprite.yPosition += offset; + index = gCurrentSprite.work4; + offset = sAnimalsEnclosure_38188c[index]; - if (gCurrentSprite.status & SPRITE_STATUS_X_FLIP) - gCurrentSprite.xPosition += PIXEL_SIZE; + if (offset == SHORT_MAX) + { + if (gCurrentSprite.status & SPRITE_STATUS_X_FLIP) + gCurrentSprite.pose = 0x1a; + else + gCurrentSprite.pose = 0x37; + } else - gCurrentSprite.xPosition -= PIXEL_SIZE; - } + { + gCurrentSprite.work4++; + gCurrentSprite.yPosition += offset; + + if (gCurrentSprite.status & SPRITE_STATUS_X_FLIP) + gCurrentSprite.xPosition += PIXEL_SIZE; + else + gCurrentSprite.xPosition -= PIXEL_SIZE; + } } -void DachoraWalkingToWaitingSpotInit(void) { - gCurrentSprite.pOam = (struct FrameData *)0x0838451C; - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.pose = 0x1A; +void DachoraWalkingToWaitingSpotInit(void) +{ + gCurrentSprite.pOam = (struct FrameData*)0x0838451C; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.pose = 0x1A; } -void DachoraWalkingToWaitingSpot(void) { - if ((s32)gCurrentSprite.xPosition < (s32)(gAbilityRestingXPosition - 0xC0)) { - gCurrentSprite.xPosition += 4; - return; - } - gCurrentSprite.pOam = (struct FrameData *)0x083846CC; - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.pose = 0x1B; +void DachoraWalkingToWaitingSpot(void) +{ + if ((s32)gCurrentSprite.xPosition < (s32)(gAbilityRestingXPosition - 0xC0)) + { + gCurrentSprite.xPosition += 4; + return; + } + gCurrentSprite.pOam = (struct FrameData*)0x083846CC; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.pose = 0x1B; } -void DachoraWaitingForOthers(void) { - u8 count; - u8 i; - - if (gCurrentSprite.currentAnimationFrame == 0 && - gCurrentSprite.animationDurationCounter == 1) { - SoundPlay(0x122); - } - - for (count = 0, i = 0; i < 0x18; i++) { - if (gSpriteData[i].status & 1 && !(gSpriteData[i].properties & 0x80) && - gSpriteData[i].spriteId == 0xB6 && gSpriteData[i].pose == 0x1C) - count++; - } - - if (count == 3) { - gCurrentSprite.pose = 0x1C; - gCurrentSprite.work1 = 0x3C; - } +void DachoraWaitingForOthers(void) +{ + u8 count; + u8 i; + + if (gCurrentSprite.currentAnimationFrame == 0 && gCurrentSprite.animationDurationCounter == 1) + { + SoundPlay(0x122); + } + + for (count = 0, i = 0; i < 0x18; i++) + { + if (gSpriteData[i].status & 1 && !(gSpriteData[i].properties & 0x80) && gSpriteData[i].spriteId == 0xB6 && + gSpriteData[i].pose == 0x1C) + count++; + } + + if (count == 3) + { + gCurrentSprite.pose = 0x1C; + gCurrentSprite.work1 = 0x3C; + } } -void DachoraWaitingToSpawnBaby(void) { - if (gCurrentSprite.currentAnimationFrame == 0 && - gCurrentSprite.animationDurationCounter == 1) { - SoundPlay(0x122); - } - - gCurrentSprite.work1--; - if (gCurrentSprite.work1 == 0) { - gCurrentSprite.pose = 0x1D; - SpriteSpawnSecondary(0x69, 0, gCurrentSprite.spritesetGfxSlot, - gCurrentSprite.primarySpriteRamSlot, - gCurrentSprite.yPosition - 0x20, - gCurrentSprite.xPosition - 0xC0, 0x40); - gCurrentSprite.work1 = 0x78; - } +void DachoraWaitingToSpawnBaby(void) +{ + if (gCurrentSprite.currentAnimationFrame == 0 && gCurrentSprite.animationDurationCounter == 1) + { + SoundPlay(0x122); + } + + gCurrentSprite.work1--; + if (gCurrentSprite.work1 == 0) + { + gCurrentSprite.pose = 0x1D; + SpriteSpawnSecondary(0x69, 0, gCurrentSprite.spritesetGfxSlot, gCurrentSprite.primarySpriteRamSlot, + gCurrentSprite.yPosition - 0x20, gCurrentSprite.xPosition - 0xC0, 0x40); + gCurrentSprite.work1 = 0x78; + } } -void DachoraWaitingForBaby(void) { - u32 var; - - if (gCurrentSprite.currentAnimationFrame == 0 && - gCurrentSprite.animationDurationCounter == 1) { - SoundPlay(0x122); - } - - var = (--gCurrentSprite.work1) & 0xff; - if (var == 0) { - gCurrentSprite.pose = 0x1E; - gPreventMovementTimer = var; - sSamusSetPoseFunctionPointer[gSamusData.unk_0](0x3B); - gCurrentSprite.work1 = 0x3C; - gCurrentSprite.work2 = 1; - } +void DachoraWaitingForBaby(void) +{ + u32 var; + + if (gCurrentSprite.currentAnimationFrame == 0 && gCurrentSprite.animationDurationCounter == 1) + { + SoundPlay(0x122); + } + + var = (--gCurrentSprite.work1) & 0xff; + if (var == 0) + { + gCurrentSprite.pose = 0x1E; + gPreventMovementTimer = var; + sSamusSetPoseFunctionPointer[gSamusData.unk_0](0x3B); + gCurrentSprite.work1 = 0x3C; + gCurrentSprite.work2 = 1; + } } -void DachoraBowing(void) { - u32 var1, var2; - - if (gCurrentSprite.work1 != 0) { - var1 = --gCurrentSprite.work1; - if (var1 == 0) { - gCurrentSprite.pOam = (struct FrameData *)0x08384584; - gCurrentSprite.animationDurationCounter = var1; - gCurrentSprite.currentAnimationFrame = var1; - SoundPlay(0x123); - } else if (gCurrentSprite.currentAnimationFrame == 0 && - gCurrentSprite.animationDurationCounter == 1) { - SoundPlay(0x122); - } - } else if (SpriteUtilHasCurrentAnimationEnded() != 0) { - var2 = --gCurrentSprite.work2; - if (var2 == 0) { - gCurrentSprite.pose = 0x1F; - gCurrentSprite.work1 = 0x3C; - gCurrentSprite.pOam = (struct FrameData *)0x083846CC; - gCurrentSprite.animationDurationCounter = var2; - gCurrentSprite.currentAnimationFrame = var2; - } - } +void DachoraBowing(void) +{ + u32 var1, var2; + + if (gCurrentSprite.work1 != 0) + { + var1 = --gCurrentSprite.work1; + if (var1 == 0) + { + gCurrentSprite.pOam = (struct FrameData*)0x08384584; + gCurrentSprite.animationDurationCounter = var1; + gCurrentSprite.currentAnimationFrame = var1; + SoundPlay(0x123); + } + else if (gCurrentSprite.currentAnimationFrame == 0 && gCurrentSprite.animationDurationCounter == 1) + { + SoundPlay(0x122); + } + } + else if (SpriteUtilHasCurrentAnimationEnded() != 0) + { + var2 = --gCurrentSprite.work2; + if (var2 == 0) + { + gCurrentSprite.pose = 0x1F; + gCurrentSprite.work1 = 0x3C; + gCurrentSprite.pOam = (struct FrameData*)0x083846CC; + gCurrentSprite.animationDurationCounter = var2; + gCurrentSprite.currentAnimationFrame = var2; + } + } } -void DachoraWaitingToRun(void) { - u32 var; - - var = --gCurrentSprite.work1; - if (var == 0) { - *(&gCurrentSprite.work1 - 0xA) = 0x20; - gCurrentSprite.pOam = (struct FrameData *)0x0838451C; - gCurrentSprite.animationDurationCounter = var; - gCurrentSprite.currentAnimationFrame = var; - SoundPlay_3b1c(0x124); - } +void DachoraWaitingToRun(void) +{ + u32 var; + + var = --gCurrentSprite.work1; + if (var == 0) + { + *(&gCurrentSprite.work1 - 0xA) = 0x20; + gCurrentSprite.pOam = (struct FrameData*)0x0838451C; + gCurrentSprite.animationDurationCounter = var; + gCurrentSprite.currentAnimationFrame = var; + SoundPlay_3b1c(0x124); + } } -void DachoraRunning(void) { - u16 temp_r0; +void DachoraRunning(void) +{ + u16 temp_r0; - gCurrentSprite.xPosition += 0xE; - gCurrentSprite.animationDurationCounter += 2; - temp_r0 = 2 & gCurrentSprite.status; - if (temp_r0 == 0) { - gCurrentSprite.status = temp_r0; - } + gCurrentSprite.xPosition += 0xE; + gCurrentSprite.animationDurationCounter += 2; + temp_r0 = 2 & gCurrentSprite.status; + if (temp_r0 == 0) + { + gCurrentSprite.status = temp_r0; + } } -void BabyDachoraInit(void) { - gCurrentSprite.status &= 0xFFFB; - gCurrentSprite.properties |= SP_ALWAYS_ACTIVE; - gCurrentSprite.drawOrder = 0xC; - gCurrentSprite.bgPriority = 3; - gCurrentSprite.samusCollision = SSC_NONE; - gCurrentSprite.drawDistanceTop = 0x10; - gCurrentSprite.drawDistanceBottom = 0; - gCurrentSprite.drawDistanceHorizontal = 8; - gCurrentSprite.hitboxTop = -4; - gCurrentSprite.hitboxBottom = 4; - gCurrentSprite.hitboxLeft = -4; - gCurrentSprite.hitboxRight = 4; - gCurrentSprite.pOam = (struct FrameData *)0x0838462C; - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.pose = 1; - gCurrentSprite.work1 = 0x20; +void BabyDachoraInit(void) +{ + gCurrentSprite.status &= 0xFFFB; + gCurrentSprite.properties |= SP_ALWAYS_ACTIVE; + gCurrentSprite.drawOrder = 0xC; + gCurrentSprite.bgPriority = 3; + gCurrentSprite.samusCollision = SSC_NONE; + gCurrentSprite.drawDistanceTop = 0x10; + gCurrentSprite.drawDistanceBottom = 0; + gCurrentSprite.drawDistanceHorizontal = 8; + gCurrentSprite.hitboxTop = -4; + gCurrentSprite.hitboxBottom = 4; + gCurrentSprite.hitboxLeft = -4; + gCurrentSprite.hitboxRight = 4; + gCurrentSprite.pOam = (struct FrameData*)0x0838462C; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.pose = 1; + gCurrentSprite.work1 = 0x20; } -void BabyDachoraWalkingToGate(void) { - u8 var; +void BabyDachoraWalkingToGate(void) +{ + u8 var; - var = --gCurrentSprite.work1; - if (var != 0) { - gCurrentSprite.xPosition += 4; - } else { - gCurrentSprite.pose = 2; - gCurrentSprite.work4 = var; - } + var = --gCurrentSprite.work1; + if (var != 0) + { + gCurrentSprite.xPosition += 4; + } + else + { + gCurrentSprite.pose = 2; + gCurrentSprite.work4 = var; + } } -void BabyDachoraLeavingEnclosure(void) { - u8 var; +void BabyDachoraLeavingEnclosure(void) +{ + u8 var; - var = gCurrentSprite.work4; + var = gCurrentSprite.work4; - if (sArray_0x0838188c[var] == 0x7FFF) { - gCurrentSprite.pose = 0x17; - gCurrentSprite.work1 = 0x28; - gCurrentSprite.bgPriority = 2; - } else { - gCurrentSprite.work4 = var + 1; - gCurrentSprite.yPosition += sArray_0x0838188c[var]; - gCurrentSprite.xPosition += 4; - } + if (sAnimalsEnclosure_38188c[var] == 0x7FFF) + { + gCurrentSprite.pose = 0x17; + gCurrentSprite.work1 = 0x28; + gCurrentSprite.bgPriority = 2; + } + else + { + gCurrentSprite.work4 = var + 1; + gCurrentSprite.yPosition += sAnimalsEnclosure_38188c[var]; + gCurrentSprite.xPosition += 4; + } } -void BabyDachoraWalkingToWaitingSpot(void) { - u8 var; +void BabyDachoraWalkingToWaitingSpot(void) +{ + u8 var; - var = --gCurrentSprite.work1; - if (var) { - gCurrentSprite.xPosition += 2; - } else { - gCurrentSprite.pose = 0x18; - gCurrentSprite.drawOrder = 5; - gCurrentSprite.pOam = (struct FrameData *)0x083846F4; - gCurrentSprite.animationDurationCounter = var; - gCurrentSprite.currentAnimationFrame = var; - } + var = --gCurrentSprite.work1; + if (var) + { + gCurrentSprite.xPosition += 2; + } + else + { + gCurrentSprite.pose = 0x18; + gCurrentSprite.drawOrder = 5; + gCurrentSprite.pOam = (struct FrameData*)0x083846F4; + gCurrentSprite.animationDurationCounter = var; + gCurrentSprite.currentAnimationFrame = var; + } } -void BabyDachoraWaitingToRun(void) { - u8 i; - u8 *e0; - u8 *ea; - struct SpriteData *sprites; - - i = 0; - sprites = gSpriteData; - ea = sVar_0x030006ea; - e0 = ea - 0xA; - - while (i < 0x18) { - if (sprites[i].status & 1 && !(sprites[i].properties & 0x80) && - sprites[i].spriteId == 0xB8 && sprites[i].pose == 0x20) { - *e0 = 0x19; - *ea = 0x5A; - } - i++; - } +void BabyDachoraWaitingToRun(void) +{ + u8 i; + u8* e0; + u8* ea; + struct SpriteData* sprites; + + i = 0; + sprites = gSpriteData; + ea = &gCurrentSprite.work1; + e0 = ea - 0xA; + + while (i < 0x18) + { + if (sprites[i].status & 1 && !(sprites[i].properties & 0x80) && sprites[i].spriteId == 0xB8 && + sprites[i].pose == 0x20) + { + *e0 = 0x19; + *ea = 0x5A; + } + i++; + } } -void BabyDachoraRunning(void) { - u16 var1, var2; - - if (gCurrentSprite.work1 != 0) { - var1 = --gCurrentSprite.work1; - if (var1 == 0) { - gCurrentSprite.pOam = (struct FrameData *)0x0838462C; - gCurrentSprite.animationDurationCounter = var1; - gCurrentSprite.currentAnimationFrame = var1; +void BabyDachoraRunning(void) +{ + u16 var1, var2; + + if (gCurrentSprite.work1 != 0) + { + var1 = --gCurrentSprite.work1; + if (var1 == 0) + { + gCurrentSprite.pOam = (struct FrameData*)0x0838462C; + gCurrentSprite.animationDurationCounter = var1; + gCurrentSprite.currentAnimationFrame = var1; + } } - } else { - gCurrentSprite.xPosition += 8; - gCurrentSprite.animationDurationCounter += 4; - - var2 = gCurrentSprite.status & 2; - if (var2 == 0) { - gSamusData.currentAnimationFrame++; - gCurrentSprite.status = var2; + else + { + gCurrentSprite.xPosition += 8; + gCurrentSprite.animationDurationCounter += 4; + + var2 = gCurrentSprite.status & 2; + if (var2 == 0) + { + gSamusData.currentAnimationFrame++; + gCurrentSprite.status = var2; + } } - } } From 6589e999a75f0802a0d7a2d958cf1c9557c08566 Mon Sep 17 00:00:00 2001 From: Charles Averill Date: Fri, 9 Jan 2026 21:00:55 -0600 Subject: [PATCH 14/15] [Baby]?Dachora --- asm/disasm_0x08049888.s | 6 +- include/sprites_AI/dachora.h | 16 +-- src/sprites_AI/dachora.c | 200 ++++++++++++++++++++++++++++------- 3 files changed, 170 insertions(+), 52 deletions(-) diff --git a/asm/disasm_0x08049888.s b/asm/disasm_0x08049888.s index 6f523467..e37e3905 100644 --- a/asm/disasm_0x08049888.s +++ b/asm/disasm_0x08049888.s @@ -7407,8 +7407,8 @@ _0804D588: .align 2, 0 _0804D58C: .4byte 0x083846CC - thumb_func_start DachorawaitingForOthers -DachorawaitingForOthers: @ 0x0804D590 + thumb_func_start DachoraWaitingForOthers +DachoraWaitingForOthers: @ 0x0804D590 push {r4, r5, lr} ldr r1, _0804D608 @ =gCurrentSprite ldrh r0, [r1, #0x16] @@ -9592,7 +9592,7 @@ _0804E686: bl DachoraWalkingToWaitingSpot b _0804E6AE _0804E68C: - bl DachorawaitingForOthers + bl DachoraWaitingForOthers b _0804E6AE _0804E692: bl DachoraWaitingToSpawnBaby diff --git a/include/sprites_AI/dachora.h b/include/sprites_AI/dachora.h index b60ffcff..1326f994 100644 --- a/include/sprites_AI/dachora.h +++ b/include/sprites_AI/dachora.h @@ -1,22 +1,14 @@ #ifndef DACHORA_H #define DACHORA_H -#include "constants/sprite.h" -#include "data/samus_data.h" -#include "event_checks.h" -#include "globals.h" -#include "samus.h" -#include "structs/sprite.h" -#include "sprite_util.h" -#include "sprite.h" +#include "types.h" -#include "data/sprites/dachora.h" - -boolu32 DachoraCheckDoHeadMovement(void); +boolu8 DachoraCheckDoHeadMovement(void); void DachoraInit(void); void DachoraIdleInit(void); void DachoraIdle(void); void DachoraStandingIdle(void); +void DachoraStandingInit(void); void DachoraStanding(void); void DachoraHeadMovementInit(void); void DachoraHeadMovement(void); @@ -36,6 +28,7 @@ void DachoraWaitingForBaby(void); void DachoraBowing(void); void DachoraWaitingToRun(void); void DachoraRunning(void); +void Dachora(void); void BabyDachoraInit(void); void BabyDachoraWalkingToGate(void); @@ -43,5 +36,6 @@ void BabyDachoraLeavingEnclosure(void); void BabyDachoraWalkingToWaitingSpot(void); void BabyDachoraWaitingToRun(void); void BabyDachoraRunning(void); +void BabyDachora(void); #endif /* DACHORA_H */ diff --git a/src/sprites_AI/dachora.c b/src/sprites_AI/dachora.c index db8c512b..823aa1a3 100644 --- a/src/sprites_AI/dachora.c +++ b/src/sprites_AI/dachora.c @@ -1,8 +1,22 @@ #include "sprites_AI/dachora.h" -boolu32 DachoraCheckDoHeadMovement(void) +#include "constants/audio.h" +#include "event_checks.h" +#include "globals.h" +#include "samus.h" +#include "sprite.h" +#include "sprite_util.h" + +#include "data/samus_data.h" +#include "data/sprites/dachora.h" + +#include "constants/sprite.h" + +#include "structs/sprite.h" + +boolu8 DachoraCheckDoHeadMovement(void) { - boolu32 do_head_movement; + boolu8 do_head_movement; do_head_movement = 1; switch (gSpriteRandomNumber) @@ -47,7 +61,7 @@ void DachoraInit(void) if (animals_released) { - gCurrentSprite.status = 0x0; + gCurrentSprite.status = SPRITE_STATUS_EXISTS; } else { @@ -95,7 +109,7 @@ void DachoraIdle(void) { if (gSpriteData[gBossWork2].pose == 0x1A) { - var1 = (gAbilityRestingXPosition - 0x100) & 0xFFFF; + var1 = gAbilityRestingXPosition - 0x100; if (gCurrentSprite.xPosition > var1 - 0x20 && gCurrentSprite.xPosition < var1 + 0x20) { gCurrentSprite.pose = 0x17; @@ -110,7 +124,7 @@ void DachoraIdle(void) { gCurrentSprite.work1--; } - else if ((gFrameCounter8Bit & 0x1F) == 0 && (boolu8)DachoraCheckDoHeadMovement()) + else if ((gFrameCounter8Bit & 0x1F) == 0 && DachoraCheckDoHeadMovement()) { return; } @@ -121,7 +135,7 @@ void DachoraIdle(void) if (gCurrentSprite.work3 <= 0x0F) gCurrentSprite.work3++; - if (gCurrentSprite.status & 0x40) + if (gCurrentSprite.status & SPRITE_STATUS_X_FLIP) { if (gCurrentSprite.workX + 0x380 >= gCurrentSprite.xPosition) { @@ -156,6 +170,15 @@ void DachoraStandingIdle(void) gCurrentSprite.work1 = 0xb; } +void DachoraStandingInit(void) +{ + gCurrentSprite.pose = 8; + gCurrentSprite.pOam = (struct FrameData*)0x0838450C; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.work1 = 0xB; +} + void DachoraStanding(void) { gCurrentSprite.work1 = gCurrentSprite.work1 - 1; @@ -231,7 +254,7 @@ void DachoraTurningAround(void) gCurrentSprite.pOam = (struct FrameData*)0x0838456C; gCurrentSprite.animationDurationCounter = 0; gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.status ^= 0x40; + gCurrentSprite.status ^= SPRITE_STATUS_X_FLIP; if (gCurrentSprite.drawOrder == 0xE) { @@ -267,7 +290,7 @@ void DachoraTurningAroundWhileLeaving(void) gCurrentSprite.pOam = (struct FrameData*)0x0838456C; gCurrentSprite.animationDurationCounter = 0; gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.status ^= 0x40; + gCurrentSprite.status ^= SPRITE_STATUS_X_FLIP; } } @@ -324,7 +347,7 @@ void DachoraWalkingToWaitingSpotInit(void) void DachoraWalkingToWaitingSpot(void) { - if ((s32)gCurrentSprite.xPosition < (s32)(gAbilityRestingXPosition - 0xC0)) + if (gCurrentSprite.xPosition < gAbilityRestingXPosition - 0xC0) { gCurrentSprite.xPosition += 4; return; @@ -335,6 +358,7 @@ void DachoraWalkingToWaitingSpot(void) gCurrentSprite.pose = 0x1B; } + void DachoraWaitingForOthers(void) { u8 count; @@ -342,13 +366,13 @@ void DachoraWaitingForOthers(void) if (gCurrentSprite.currentAnimationFrame == 0 && gCurrentSprite.animationDurationCounter == 1) { - SoundPlay(0x122); + SoundPlay(SOUND_122); } for (count = 0, i = 0; i < 0x18; i++) { - if (gSpriteData[i].status & 1 && !(gSpriteData[i].properties & 0x80) && gSpriteData[i].spriteId == 0xB6 && - gSpriteData[i].pose == 0x1C) + if (gSpriteData[i].status & SPRITE_STATUS_EXISTS && !(gSpriteData[i].properties & SP_SECONDARY_SPRITE) && + gSpriteData[i].spriteId == PSPRITE_ETECOON && gSpriteData[i].pose == 0x1C) count++; } @@ -363,7 +387,7 @@ void DachoraWaitingToSpawnBaby(void) { if (gCurrentSprite.currentAnimationFrame == 0 && gCurrentSprite.animationDurationCounter == 1) { - SoundPlay(0x122); + SoundPlay(SOUND_122); } gCurrentSprite.work1--; @@ -382,10 +406,10 @@ void DachoraWaitingForBaby(void) if (gCurrentSprite.currentAnimationFrame == 0 && gCurrentSprite.animationDurationCounter == 1) { - SoundPlay(0x122); + SoundPlay(SOUND_122); } - var = (--gCurrentSprite.work1) & 0xff; + var = --gCurrentSprite.work1; if (var == 0) { gCurrentSprite.pose = 0x1E; @@ -408,14 +432,14 @@ void DachoraBowing(void) gCurrentSprite.pOam = (struct FrameData*)0x08384584; gCurrentSprite.animationDurationCounter = var1; gCurrentSprite.currentAnimationFrame = var1; - SoundPlay(0x123); + SoundPlay(SOUND_123); } else if (gCurrentSprite.currentAnimationFrame == 0 && gCurrentSprite.animationDurationCounter == 1) { - SoundPlay(0x122); + SoundPlay(SOUND_123); } } - else if (SpriteUtilHasCurrentAnimationEnded() != 0) + else if (SpriteUtilHasCurrentAnimationEnded()) { var2 = --gCurrentSprite.work2; if (var2 == 0) @@ -440,20 +464,20 @@ void DachoraWaitingToRun(void) gCurrentSprite.pOam = (struct FrameData*)0x0838451C; gCurrentSprite.animationDurationCounter = var; gCurrentSprite.currentAnimationFrame = var; - SoundPlay_3b1c(0x124); + SoundPlay_3b1c(SOUND_124); } } void DachoraRunning(void) { - u16 temp_r0; + u16 temp; gCurrentSprite.xPosition += 0xE; gCurrentSprite.animationDurationCounter += 2; - temp_r0 = 2 & gCurrentSprite.status; - if (temp_r0 == 0) + temp = gCurrentSprite.status & SPRITE_STATUS_ONSCREEN; + if (temp == 0) { - gCurrentSprite.status = temp_r0; + gCurrentSprite.status = temp; } } @@ -536,24 +560,23 @@ void BabyDachoraWalkingToWaitingSpot(void) void BabyDachoraWaitingToRun(void) { u8 i; - u8* e0; - u8* ea; - struct SpriteData* sprites; - - i = 0; - sprites = gSpriteData; - ea = &gCurrentSprite.work1; - e0 = ea - 0xA; - while (i < 0x18) + for (i = 0; i < MAX_AMOUNT_OF_SPRITES; i++) { - if (sprites[i].status & 1 && !(sprites[i].properties & 0x80) && sprites[i].spriteId == 0xB8 && - sprites[i].pose == 0x20) + if (!(gSpriteData[i].status & SPRITE_STATUS_EXISTS)) + continue; + + if (gSpriteData[i].properties & SP_SECONDARY_SPRITE) + continue; + + if (gSpriteData[i].spriteId != PSPRITE_DACHORA) + continue; + + if (gSpriteData[i].pose == 0x20) { - *e0 = 0x19; - *ea = 0x5A; + gCurrentSprite.pose = 0x19; + gCurrentSprite.work1 = 0x5A; } - i++; } } @@ -576,7 +599,7 @@ void BabyDachoraRunning(void) gCurrentSprite.xPosition += 8; gCurrentSprite.animationDurationCounter += 4; - var2 = gCurrentSprite.status & 2; + var2 = gCurrentSprite.status & SPRITE_STATUS_ONSCREEN; if (var2 == 0) { gSamusData.currentAnimationFrame++; @@ -584,3 +607,104 @@ void BabyDachoraRunning(void) } } } + +// Etecoon stuff here + +// TireSwing stuff here + +void Dachora(void) +{ + gCurrentSprite.ignoreSamusCollisionTimer = 1; + switch (gCurrentSprite.pose) + { + case 0x0: + DachoraInit(); + break; + case 0x1: + DachoraIdleInit(); + case 0x2: + DachoraIdle(); + break; + case 0x3: + DachoraTurningAroundInit(); + case 0x4: + DachoraTurningAround(); + break; + case 0x5: + DachoraTurningAroundSecondPart(); + break; + case 0x7: + DachoraStandingInit(); + case 0x8: + DachoraStanding(); + break; + case 0x9: + DachoraHeadMovementInit(); + case 0xA: + DachoraHeadMovement(); + break; + case 0x37: + DachoraTurningAroundWhileLeavingInit(); + case 0x38: + DachoraTurningAroundWhileLeaving(); + break; + case 0x3A: + DachoraTurningAroundWhileLeavingSecondPart(); + break; + case 0x17: + DachoraLeavingEnclosureInit(); + case 0x18: + DachoraLeavingEnclosure(); + break; + case 0x19: + DachoraWalkingToWaitingSpotInit(); + case 0x1A: + DachoraWalkingToWaitingSpot(); + break; + case 0x1B: + DachoraWaitingForOthers(); + break; + case 0x1C: + DachoraWaitingToSpawnBaby(); + break; + case 0x1D: + DachoraWaitingForBaby(); + break; + case 0x1E: + DachoraBowing(); + break; + case 0x1F: + DachoraWaitingToRun(); + break; + case 0x20: + DachoraRunning(); + break; + } +} + +void BabyDachora(void) +{ + gCurrentSprite.ignoreSamusCollisionTimer = 1; + switch (gCurrentSprite.pose) + { + case 0: + BabyDachoraInit(); + break; + case 1: + BabyDachoraWalkingToGate(); + break; + case 2: + BabyDachoraLeavingEnclosure(); + break; + case 23: + BabyDachoraWalkingToWaitingSpot(); + break; + case 24: + BabyDachoraWaitingToRun(); + break; + case 25: + BabyDachoraRunning(); + default: + break; + } +} From 4c08a6e5af14edcad9335fc1fd5a901b5bc4c453 Mon Sep 17 00:00:00 2001 From: Charles Averill Date: Sat, 10 Jan 2026 00:00:25 -0600 Subject: [PATCH 15/15] more cleanup, document dachora poses --- include/data/sprites/{dachora.h => animals.h} | 0 include/sprites_AI/{dachora.h => animals.h} | 1 - src/data/sprites/{dachora.c => animals.c} | 2 +- src/sprites_AI/{dachora.c => animals.c} | 261 +++++++++--------- 4 files changed, 136 insertions(+), 128 deletions(-) rename include/data/sprites/{dachora.h => animals.h} (100%) rename include/sprites_AI/{dachora.h => animals.h} (97%) rename src/data/sprites/{dachora.c => animals.c} (75%) rename src/sprites_AI/{dachora.c => animals.c} (66%) diff --git a/include/data/sprites/dachora.h b/include/data/sprites/animals.h similarity index 100% rename from include/data/sprites/dachora.h rename to include/data/sprites/animals.h diff --git a/include/sprites_AI/dachora.h b/include/sprites_AI/animals.h similarity index 97% rename from include/sprites_AI/dachora.h rename to include/sprites_AI/animals.h index 1326f994..1a0d5595 100644 --- a/include/sprites_AI/dachora.h +++ b/include/sprites_AI/animals.h @@ -7,7 +7,6 @@ boolu8 DachoraCheckDoHeadMovement(void); void DachoraInit(void); void DachoraIdleInit(void); void DachoraIdle(void); -void DachoraStandingIdle(void); void DachoraStandingInit(void); void DachoraStanding(void); void DachoraHeadMovementInit(void); diff --git a/src/data/sprites/dachora.c b/src/data/sprites/animals.c similarity index 75% rename from src/data/sprites/dachora.c rename to src/data/sprites/animals.c index d191189a..5b3513c3 100644 --- a/src/data/sprites/dachora.c +++ b/src/data/sprites/animals.c @@ -1,3 +1,3 @@ -#include "data/sprites/dachora.h" +#include "data/sprites/animals.h" const s16 sAnimalsEnclosure_38188c[13] = {0xfffa, 0xfffc, 0xfffe, 0, 0, 2, 4, 6, 8, 8, 8, 8, 0x7fff}; diff --git a/src/sprites_AI/dachora.c b/src/sprites_AI/animals.c similarity index 66% rename from src/sprites_AI/dachora.c rename to src/sprites_AI/animals.c index 823aa1a3..e795d8ed 100644 --- a/src/sprites_AI/dachora.c +++ b/src/sprites_AI/animals.c @@ -1,6 +1,5 @@ -#include "sprites_AI/dachora.h" +#include "sprites_AI/animals.h" -#include "constants/audio.h" #include "event_checks.h" #include "globals.h" #include "samus.h" @@ -8,12 +7,39 @@ #include "sprite_util.h" #include "data/samus_data.h" -#include "data/sprites/dachora.h" +#include "data/sprites/animals.h" +#include "constants/audio.h" #include "constants/sprite.h" #include "structs/sprite.h" +enum DachoraPose { + DACHORA_POSE_INIT = 0, + DACHORA_POSE_IDLE_INIT = 1, + DACHORA_POSE_IDLE = 2, + DACHORA_POSE_TURNING_AROUND_INIT = 3, + DACHORA_POSE_TURNING_AROUND = 4, + DACHORA_POSE_TURNING_AROUND_SECOND_PART = 5, + DACHORA_POSE_STANDING_INIT = 7, + DACHORA_POSE_STANDING = 8, + DACHORA_POSE_HEAD_MOVEMENT_INIT = 9, + DACHORA_POSE_HEAD_MOVEMENT = 10, + DACHORA_POSE_LEAVING_ENCLOSURE_INIT = 23, + DACHORA_POSE_LEAVING_ENCLOSURE = 24, + DACHORA_POSE_WALKING_TO_WAITING_SPOT_INIT = 25, + DACHORA_POSE_WALKING_TO_WAITING_SPOT = 26, + DACHORA_POSE_WAITING_FOR_OTHERS = 27, + DACHORA_POSE_WAITING_TO_SPAWN_BABY = 28, + DACHORA_POSE_WAITING_FOR_BABY = 29, + DACHORA_POSE_BOWING = 30, + DACHORA_POSE_WAITING_TO_RUN = 31, + DACHORA_POSE_RUNNING = 32, + DACHORA_POSE_TURNING_AROUND_WHILE_LEAVING_INIT = 55, + DACHORA_POSE_TURNING_AROUND_WHILE_LEAVING = 56, + DACHORA_POSE_TURNING_AROUND_WHILE_LEAVING_SECOND_PART = 58, +}; + boolu8 DachoraCheckDoHeadMovement(void) { boolu8 do_head_movement; @@ -25,25 +51,25 @@ boolu8 DachoraCheckDoHeadMovement(void) case 1: case 2: case 3: - gCurrentSprite.pose = 7; + gCurrentSprite.pose = DACHORA_POSE_STANDING_INIT; gCurrentSprite.work2 = 0; break; case 4: case 5: case 6: case 7: - gCurrentSprite.pose = 7; + gCurrentSprite.pose = DACHORA_POSE_STANDING_INIT; gCurrentSprite.work2 = 1; break; case 8: case 9: - gCurrentSprite.pose = 7; + gCurrentSprite.pose = DACHORA_POSE_STANDING_INIT; gCurrentSprite.work2 = 2; break; case 10: case 11: case 12: - gCurrentSprite.pose = 7; + gCurrentSprite.pose = DACHORA_POSE_STANDING_INIT; gCurrentSprite.work2 = 3; break; default: @@ -67,37 +93,35 @@ void DachoraInit(void) { gCurrentSprite.properties = gCurrentSprite.properties | SP_ALWAYS_ACTIVE; gCurrentSprite.samusCollision = SSC_NONE; - gCurrentSprite.drawOrder = 0xe; + gCurrentSprite.drawOrder = 14; gCurrentSprite.bgPriority = 3; - gCurrentSprite.drawDistanceTop = 0x30; + gCurrentSprite.drawDistanceTop = 48; gCurrentSprite.drawDistanceBottom = 8; - gCurrentSprite.drawDistanceHorizontal = 0x20; + gCurrentSprite.drawDistanceHorizontal = 32; gCurrentSprite.hitboxTop = -4; gCurrentSprite.hitboxBottom = 4; gCurrentSprite.hitboxLeft = -4; gCurrentSprite.hitboxRight = 4; - gCurrentSprite.yPosition = gCurrentSprite.yPosition - 0x20; + gCurrentSprite.yPosition = gCurrentSprite.yPosition - 32; gCurrentSprite.workX = gCurrentSprite.xPosition; MakeSpriteFaceSamusXFlip(); - gCurrentSprite.pose = 2; + gCurrentSprite.pose = DACHORA_POSE_IDLE; gCurrentSprite.pOam = (struct FrameData*)0x0838451c; gCurrentSprite.animationDurationCounter = 0; gCurrentSprite.currentAnimationFrame = animals_released; gCurrentSprite.work3 = 0; - gCurrentSprite.work1 = 0xb4; + gCurrentSprite.work1 = 180; } - return; } void DachoraIdleInit(void) { - gCurrentSprite.pose = 2; + gCurrentSprite.pose = DACHORA_POSE_IDLE; gCurrentSprite.pOam = (struct FrameData*)0x0838451c; gCurrentSprite.animationDurationCounter = 0; gCurrentSprite.currentAnimationFrame = 0; gCurrentSprite.work3 = 0; - gCurrentSprite.work1 = gSpriteRandomNumber * 4 + 0x3c; - return; + gCurrentSprite.work1 = gSpriteRandomNumber * 4 + 60; } void DachoraIdle(void) @@ -107,24 +131,24 @@ void DachoraIdle(void) if (EventCheckAfter_AnimalsReleased()) { - if (gSpriteData[gBossWork2].pose == 0x1A) + if (gSpriteData[gBossWork2].pose == DACHORA_POSE_WALKING_TO_WAITING_SPOT) { - var1 = gAbilityRestingXPosition - 0x100; - if (gCurrentSprite.xPosition > var1 - 0x20 && gCurrentSprite.xPosition < var1 + 0x20) + var1 = gAbilityRestingXPosition - 256; + if (gCurrentSprite.xPosition > var1 - 32 && gCurrentSprite.xPosition < var1 + 32) { - gCurrentSprite.pose = 0x17; + gCurrentSprite.pose = DACHORA_POSE_LEAVING_ENCLOSURE_INIT; return; } } } - else if (gCurrentSprite.xPosition > gAbilityRestingXPosition + 0x1C0 || - gCurrentSprite.xPosition < gAbilityRestingXPosition - 0x1C0) + else if (gCurrentSprite.xPosition > gAbilityRestingXPosition + 448 || + gCurrentSprite.xPosition < gAbilityRestingXPosition - 448) { if (gCurrentSprite.work1 != 0) { gCurrentSprite.work1--; } - else if ((gFrameCounter8Bit & 0x1F) == 0 && DachoraCheckDoHeadMovement()) + else if ((gFrameCounter8Bit & 31) == 0 && DachoraCheckDoHeadMovement()) { return; } @@ -132,65 +156,53 @@ void DachoraIdle(void) var2 = gCurrentSprite.work3 >> 2; - if (gCurrentSprite.work3 <= 0x0F) + if (gCurrentSprite.work3 < 16) gCurrentSprite.work3++; if (gCurrentSprite.status & SPRITE_STATUS_X_FLIP) { - if (gCurrentSprite.workX + 0x380 >= gCurrentSprite.xPosition) + if (gCurrentSprite.workX + 896 >= gCurrentSprite.xPosition) { var1 = gCurrentSprite.xPosition; var1 = var1 + var2; gCurrentSprite.xPosition = var1; return; } - gCurrentSprite.pose = 3; + gCurrentSprite.pose = DACHORA_POSE_TURNING_AROUND_INIT; } else { - if (gCurrentSprite.workX - 0x380 > gCurrentSprite.xPosition) + if (gCurrentSprite.workX - 896 > gCurrentSprite.xPosition) { - gCurrentSprite.pose = 3; + gCurrentSprite.pose = DACHORA_POSE_TURNING_AROUND_INIT; } else { gCurrentSprite.xPosition -= var2; } } - - return; -} - -void DachoraStandingIdle(void) -{ - gCurrentSprite.pose = 8; - gCurrentSprite.pOam = (struct FrameData*)0x0838450c; - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.work1 = 0xb; } void DachoraStandingInit(void) { - gCurrentSprite.pose = 8; - gCurrentSprite.pOam = (struct FrameData*)0x0838450C; + gCurrentSprite.pose = DACHORA_POSE_STANDING; + gCurrentSprite.pOam = (struct FrameData*)0x0838450c; gCurrentSprite.animationDurationCounter = 0; gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.work1 = 0xB; + gCurrentSprite.work1 = 11; } void DachoraStanding(void) { - gCurrentSprite.work1 = gCurrentSprite.work1 - 1; - if (gCurrentSprite.work1) - return; - - gCurrentSprite.pose = 9; + gCurrentSprite.work1--; + if (!gCurrentSprite.work1) + gCurrentSprite.pose = DACHORA_POSE_HEAD_MOVEMENT_INIT; } + void DachoraHeadMovementInit(void) { - gCurrentSprite.pose = 0xA; + gCurrentSprite.pose = DACHORA_POSE_HEAD_MOVEMENT; if (gCurrentSprite.work2 == 1) { @@ -215,29 +227,24 @@ void DachoraHeadMovementInit(void) void DachoraHeadMovement(void) { - if (!SpriteUtilHasCurrentAnimationEnded()) - { - return; - } - - if (gCurrentSprite.work2 == 1 && gSpriteRandomNumber > 0xc) + if (!SpriteUtilHasCurrentAnimationEnded() || (gCurrentSprite.work2 == 1 && gSpriteRandomNumber > 12)) { return; } if (gSpriteRandomNumber <= 2) { - gCurrentSprite.pose = 3; + gCurrentSprite.pose = DACHORA_POSE_TURNING_AROUND_INIT; } else { - gCurrentSprite.pose = 1; + gCurrentSprite.pose = DACHORA_POSE_IDLE_INIT; } } void DachoraTurningAroundInit(void) { - gCurrentSprite.pose = 4; + gCurrentSprite.pose = DACHORA_POSE_TURNING_AROUND; gCurrentSprite.pOam = (struct FrameData*)0x08384554; gCurrentSprite.animationDurationCounter = 0; gCurrentSprite.currentAnimationFrame = 0; @@ -250,19 +257,19 @@ void DachoraTurningAround(void) return; } - gCurrentSprite.pose = 5; + gCurrentSprite.pose = DACHORA_POSE_TURNING_AROUND_SECOND_PART; gCurrentSprite.pOam = (struct FrameData*)0x0838456C; gCurrentSprite.animationDurationCounter = 0; gCurrentSprite.currentAnimationFrame = 0; gCurrentSprite.status ^= SPRITE_STATUS_X_FLIP; - if (gCurrentSprite.drawOrder == 0xE) + if (gCurrentSprite.drawOrder == 14) { - gCurrentSprite.drawOrder = 0xf; + gCurrentSprite.drawOrder = 15; } else { - gCurrentSprite.drawOrder = 0xe; + gCurrentSprite.drawOrder = 14; } } @@ -270,13 +277,13 @@ void DachoraTurningAroundSecondPart(void) { if (SpriteUtilHasCurrentAnimationNearlyEnded() != 0) { - gCurrentSprite.pose = 1; + gCurrentSprite.pose = DACHORA_POSE_IDLE_INIT; } } void DachoraTurningAroundWhileLeavingInit(void) { - gCurrentSprite.pose = 0x38; + gCurrentSprite.pose = DACHORA_POSE_TURNING_AROUND_WHILE_LEAVING; gCurrentSprite.pOam = (struct FrameData*)0x08384554; gCurrentSprite.animationDurationCounter = 0; gCurrentSprite.currentAnimationFrame = 0; @@ -286,7 +293,7 @@ void DachoraTurningAroundWhileLeaving(void) { if (SpriteUtilHasCurrentAnimationEnded() != 0) { - gCurrentSprite.pose = 0x3A; + gCurrentSprite.pose = DACHORA_POSE_TURNING_AROUND_WHILE_LEAVING_SECOND_PART; gCurrentSprite.pOam = (struct FrameData*)0x0838456C; gCurrentSprite.animationDurationCounter = 0; gCurrentSprite.currentAnimationFrame = 0; @@ -298,13 +305,13 @@ void DachoraTurningAroundWhileLeavingSecondPart(void) { if (SpriteUtilHasCurrentAnimationNearlyEnded() != 0) { - gCurrentSprite.pose = 0x19; + gCurrentSprite.pose = DACHORA_POSE_WALKING_TO_WAITING_SPOT_INIT; } } void DachoraLeavingEnclosureInit(void) { - gCurrentSprite.pose = 0x18; + gCurrentSprite.pose = DACHORA_POSE_LEAVING_ENCLOSURE; gCurrentSprite.work4 = 0; gCurrentSprite.bgPriority = 2; gCurrentSprite.drawOrder = 4; @@ -321,9 +328,9 @@ void DachoraLeavingEnclosure(void) if (offset == SHORT_MAX) { if (gCurrentSprite.status & SPRITE_STATUS_X_FLIP) - gCurrentSprite.pose = 0x1a; + gCurrentSprite.pose = DACHORA_POSE_WALKING_TO_WAITING_SPOT; else - gCurrentSprite.pose = 0x37; + gCurrentSprite.pose = DACHORA_POSE_TURNING_AROUND_WHILE_LEAVING_INIT; } else { @@ -342,20 +349,22 @@ void DachoraWalkingToWaitingSpotInit(void) gCurrentSprite.pOam = (struct FrameData*)0x0838451C; gCurrentSprite.animationDurationCounter = 0; gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.pose = 0x1A; + gCurrentSprite.pose = DACHORA_POSE_WALKING_TO_WAITING_SPOT; } void DachoraWalkingToWaitingSpot(void) { - if (gCurrentSprite.xPosition < gAbilityRestingXPosition - 0xC0) + if (gCurrentSprite.xPosition < gAbilityRestingXPosition - 192) { gCurrentSprite.xPosition += 4; - return; } - gCurrentSprite.pOam = (struct FrameData*)0x083846CC; - gCurrentSprite.animationDurationCounter = 0; - gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.pose = 0x1B; + else + { + gCurrentSprite.pOam = (struct FrameData*)0x083846CC; + gCurrentSprite.animationDurationCounter = 0; + gCurrentSprite.currentAnimationFrame = 0; + gCurrentSprite.pose = DACHORA_POSE_WAITING_FOR_OTHERS; + } } @@ -369,17 +378,17 @@ void DachoraWaitingForOthers(void) SoundPlay(SOUND_122); } - for (count = 0, i = 0; i < 0x18; i++) + for (count = 0, i = 0; i < 24; i++) { if (gSpriteData[i].status & SPRITE_STATUS_EXISTS && !(gSpriteData[i].properties & SP_SECONDARY_SPRITE) && - gSpriteData[i].spriteId == PSPRITE_ETECOON && gSpriteData[i].pose == 0x1C) + gSpriteData[i].spriteId == PSPRITE_ETECOON && gSpriteData[i].pose == DACHORA_POSE_WAITING_TO_SPAWN_BABY) count++; } if (count == 3) { - gCurrentSprite.pose = 0x1C; - gCurrentSprite.work1 = 0x3C; + gCurrentSprite.pose = DACHORA_POSE_WAITING_TO_SPAWN_BABY; + gCurrentSprite.work1 = 60; } } @@ -393,10 +402,10 @@ void DachoraWaitingToSpawnBaby(void) gCurrentSprite.work1--; if (gCurrentSprite.work1 == 0) { - gCurrentSprite.pose = 0x1D; - SpriteSpawnSecondary(0x69, 0, gCurrentSprite.spritesetGfxSlot, gCurrentSprite.primarySpriteRamSlot, - gCurrentSprite.yPosition - 0x20, gCurrentSprite.xPosition - 0xC0, 0x40); - gCurrentSprite.work1 = 0x78; + gCurrentSprite.pose = DACHORA_POSE_WAITING_FOR_BABY; + SpriteSpawnSecondary(105, 0, gCurrentSprite.spritesetGfxSlot, gCurrentSprite.primarySpriteRamSlot, + gCurrentSprite.yPosition - 32, gCurrentSprite.xPosition - 192, 64); + gCurrentSprite.work1 = 120; } } @@ -412,10 +421,10 @@ void DachoraWaitingForBaby(void) var = --gCurrentSprite.work1; if (var == 0) { - gCurrentSprite.pose = 0x1E; + gCurrentSprite.pose = DACHORA_POSE_BOWING; gPreventMovementTimer = var; - sSamusSetPoseFunctionPointer[gSamusData.unk_0](0x3B); - gCurrentSprite.work1 = 0x3C; + sSamusSetPoseFunctionPointer[gSamusData.unk_0](59); + gCurrentSprite.work1 = 60; gCurrentSprite.work2 = 1; } } @@ -444,8 +453,8 @@ void DachoraBowing(void) var2 = --gCurrentSprite.work2; if (var2 == 0) { - gCurrentSprite.pose = 0x1F; - gCurrentSprite.work1 = 0x3C; + gCurrentSprite.pose = DACHORA_POSE_WAITING_TO_RUN; + gCurrentSprite.work1 = 60; gCurrentSprite.pOam = (struct FrameData*)0x083846CC; gCurrentSprite.animationDurationCounter = var2; gCurrentSprite.currentAnimationFrame = var2; @@ -460,7 +469,7 @@ void DachoraWaitingToRun(void) var = --gCurrentSprite.work1; if (var == 0) { - *(&gCurrentSprite.work1 - 0xA) = 0x20; + *(&gCurrentSprite.work1 - 10) = 32; gCurrentSprite.pOam = (struct FrameData*)0x0838451C; gCurrentSprite.animationDurationCounter = var; gCurrentSprite.currentAnimationFrame = var; @@ -472,7 +481,7 @@ void DachoraRunning(void) { u16 temp; - gCurrentSprite.xPosition += 0xE; + gCurrentSprite.xPosition += 14; gCurrentSprite.animationDurationCounter += 2; temp = gCurrentSprite.status & SPRITE_STATUS_ONSCREEN; if (temp == 0) @@ -485,10 +494,10 @@ void BabyDachoraInit(void) { gCurrentSprite.status &= 0xFFFB; gCurrentSprite.properties |= SP_ALWAYS_ACTIVE; - gCurrentSprite.drawOrder = 0xC; + gCurrentSprite.drawOrder = 12; gCurrentSprite.bgPriority = 3; gCurrentSprite.samusCollision = SSC_NONE; - gCurrentSprite.drawDistanceTop = 0x10; + gCurrentSprite.drawDistanceTop = 16; gCurrentSprite.drawDistanceBottom = 0; gCurrentSprite.drawDistanceHorizontal = 8; gCurrentSprite.hitboxTop = -4; @@ -498,8 +507,8 @@ void BabyDachoraInit(void) gCurrentSprite.pOam = (struct FrameData*)0x0838462C; gCurrentSprite.animationDurationCounter = 0; gCurrentSprite.currentAnimationFrame = 0; - gCurrentSprite.pose = 1; - gCurrentSprite.work1 = 0x20; + gCurrentSprite.pose = DACHORA_POSE_IDLE_INIT; + gCurrentSprite.work1 = 32; } void BabyDachoraWalkingToGate(void) @@ -513,7 +522,7 @@ void BabyDachoraWalkingToGate(void) } else { - gCurrentSprite.pose = 2; + gCurrentSprite.pose = DACHORA_POSE_IDLE; gCurrentSprite.work4 = var; } } @@ -524,10 +533,10 @@ void BabyDachoraLeavingEnclosure(void) var = gCurrentSprite.work4; - if (sAnimalsEnclosure_38188c[var] == 0x7FFF) + if (sAnimalsEnclosure_38188c[var] == SHORT_MAX) { - gCurrentSprite.pose = 0x17; - gCurrentSprite.work1 = 0x28; + gCurrentSprite.pose = DACHORA_POSE_LEAVING_ENCLOSURE_INIT; + gCurrentSprite.work1 = 40; gCurrentSprite.bgPriority = 2; } else @@ -549,7 +558,7 @@ void BabyDachoraWalkingToWaitingSpot(void) } else { - gCurrentSprite.pose = 0x18; + gCurrentSprite.pose = DACHORA_POSE_LEAVING_ENCLOSURE; gCurrentSprite.drawOrder = 5; gCurrentSprite.pOam = (struct FrameData*)0x083846F4; gCurrentSprite.animationDurationCounter = var; @@ -572,10 +581,10 @@ void BabyDachoraWaitingToRun(void) if (gSpriteData[i].spriteId != PSPRITE_DACHORA) continue; - if (gSpriteData[i].pose == 0x20) + if (gSpriteData[i].pose == DACHORA_POSE_RUNNING) { - gCurrentSprite.pose = 0x19; - gCurrentSprite.work1 = 0x5A; + gCurrentSprite.pose = DACHORA_POSE_WALKING_TO_WAITING_SPOT_INIT; + gCurrentSprite.work1 = 90; } } } @@ -617,66 +626,66 @@ void Dachora(void) gCurrentSprite.ignoreSamusCollisionTimer = 1; switch (gCurrentSprite.pose) { - case 0x0: + case DACHORA_POSE_INIT: DachoraInit(); break; - case 0x1: + case DACHORA_POSE_IDLE_INIT: DachoraIdleInit(); - case 0x2: + case DACHORA_POSE_IDLE: DachoraIdle(); break; - case 0x3: + case DACHORA_POSE_TURNING_AROUND_INIT: DachoraTurningAroundInit(); - case 0x4: + case DACHORA_POSE_TURNING_AROUND: DachoraTurningAround(); break; - case 0x5: + case DACHORA_POSE_TURNING_AROUND_SECOND_PART: DachoraTurningAroundSecondPart(); break; - case 0x7: + case DACHORA_POSE_STANDING_INIT: DachoraStandingInit(); - case 0x8: + case DACHORA_POSE_STANDING: DachoraStanding(); break; - case 0x9: + case DACHORA_POSE_HEAD_MOVEMENT_INIT: DachoraHeadMovementInit(); - case 0xA: + case DACHORA_POSE_HEAD_MOVEMENT: DachoraHeadMovement(); break; - case 0x37: + case DACHORA_POSE_TURNING_AROUND_WHILE_LEAVING_INIT: DachoraTurningAroundWhileLeavingInit(); - case 0x38: + case DACHORA_POSE_TURNING_AROUND_WHILE_LEAVING: DachoraTurningAroundWhileLeaving(); break; - case 0x3A: + case DACHORA_POSE_TURNING_AROUND_WHILE_LEAVING_SECOND_PART: DachoraTurningAroundWhileLeavingSecondPart(); break; - case 0x17: + case DACHORA_POSE_LEAVING_ENCLOSURE_INIT: DachoraLeavingEnclosureInit(); - case 0x18: + case DACHORA_POSE_LEAVING_ENCLOSURE: DachoraLeavingEnclosure(); break; - case 0x19: + case DACHORA_POSE_WALKING_TO_WAITING_SPOT_INIT: DachoraWalkingToWaitingSpotInit(); - case 0x1A: + case DACHORA_POSE_WALKING_TO_WAITING_SPOT: DachoraWalkingToWaitingSpot(); break; - case 0x1B: + case DACHORA_POSE_WAITING_FOR_OTHERS: DachoraWaitingForOthers(); break; - case 0x1C: + case DACHORA_POSE_WAITING_TO_SPAWN_BABY: DachoraWaitingToSpawnBaby(); break; - case 0x1D: + case DACHORA_POSE_WAITING_FOR_BABY: DachoraWaitingForBaby(); break; - case 0x1E: + case DACHORA_POSE_BOWING: DachoraBowing(); break; - case 0x1F: + case DACHORA_POSE_WAITING_TO_RUN: DachoraWaitingToRun(); break; - case 0x20: + case DACHORA_POSE_RUNNING: DachoraRunning(); break; }