summaryrefslogtreecommitdiff
path: root/src/object
diff options
context:
space:
mode:
authorHenny022p <73211432+Henny022p@users.noreply.github.com>2026-02-08 18:32:38 +0100
committerGitHub <noreply@github.com>2026-02-08 18:32:38 +0100
commit5ab63f00e522ff69c5bc987e379f0163943f2833 (patch)
tree53622222ac729c6ab6dc75ef7f9bafa8031daf18 /src/object
parent73901a0a012d55ebb66a4627dcb246d19737fcb5 (diff)
parent5b2cafdc894823d57beee8f3947a391d881d91de (diff)
Merge pull request #701 from Henny022p/cleanup/250302HEADmaster
Various code cleanup changes
Diffstat (limited to 'src/object')
-rw-r--r--src/object/ambientClouds.c4
-rw-r--r--src/object/backgroundCloud.c3
-rw-r--r--src/object/bakerOven.c6
-rw-r--r--src/object/barrelSpiderweb.c10
-rw-r--r--src/object/beanstalk.c8
-rw-r--r--src/object/bedCover.c2
-rw-r--r--src/object/bench.c3
-rw-r--r--src/object/bigBarrel.c2
-rw-r--r--src/object/bigIceBlock.c15
-rw-r--r--src/object/bigPushableLever.c6
-rw-r--r--src/object/bigVortex.c11
-rw-r--r--src/object/bird.c10
-rw-r--r--src/object/blockPushed.c7
-rw-r--r--src/object/board.c1
-rw-r--r--src/object/bollard.c1
-rw-r--r--src/object/book.c14
-rw-r--r--src/object/bossDoor.c22
-rw-r--r--src/object/bush.c7
-rw-r--r--src/object/button.c16
-rw-r--r--src/object/cameraTarget.c3
-rw-r--r--src/object/carlovObject.c11
-rw-r--r--src/object/chestSpawner.c32
-rw-r--r--src/object/chuchuBossCutscene.c5
-rw-r--r--src/object/chuchuBossStartParticle.c7
-rw-r--r--src/object/cloud.c9
-rw-r--r--src/object/crackingGround.c6
-rw-r--r--src/object/crenelBeanSprout.c10
-rw-r--r--src/object/cuccoMinigame.c7
-rw-r--r--src/object/cutsceneMiscObject.c16
-rw-r--r--src/object/cutsceneOrchestrator.c2
-rw-r--r--src/object/deathFx.c6
-rw-r--r--src/object/dirtParticle.c5
-rw-r--r--src/object/doubleBookshelf.c16
-rw-r--r--src/object/elementsBackground.c1
-rw-r--r--src/object/enemyItem.c13
-rw-r--r--src/object/evilSpirit.c5
-rw-r--r--src/object/ezloCap.c6
-rw-r--r--src/object/ezloCapFlying.c6
-rw-r--r--src/object/fairy.c15
-rw-r--r--src/object/fan.c6
-rw-r--r--src/object/fanWind.c3
-rw-r--r--src/object/figurineDevice.c17
-rw-r--r--src/object/fileScreenObjects.c6
-rw-r--r--src/object/fireballChain.c2
-rw-r--r--src/object/fireplace.c11
-rw-r--r--src/object/flame.c11
-rw-r--r--src/object/floatingPlatform.c4
-rw-r--r--src/object/fourElements.c10
-rw-r--r--src/object/frozenOctorok.c12
-rw-r--r--src/object/frozenWaterElement.c8
-rw-r--r--src/object/furniture.c6
-rw-r--r--src/object/gentariCurtain.c2
-rw-r--r--src/object/giantBookLadder.c12
-rw-r--r--src/object/giantLeaf.c2
-rw-r--r--src/object/giantTwig.c7
-rw-r--r--src/object/gleerokParticle.c2
-rw-r--r--src/object/graveyardKey.c3
-rw-r--r--src/object/greatFairy.c7
-rw-r--r--src/object/guruguruBar.c3
-rw-r--r--src/object/gyorgBossObject.c16
-rw-r--r--src/object/heartContainer.c11
-rw-r--r--src/object/hiddenLadderDown.c8
-rw-r--r--src/object/hittableLever.c6
-rw-r--r--src/object/houseDoorExterior.c4
-rw-r--r--src/object/houseDoorInterior.c3
-rw-r--r--src/object/itemForSale.c7
-rw-r--r--src/object/itemOnGround.c28
-rw-r--r--src/object/jailBars.c8
-rw-r--r--src/object/japaneseSubtitle.c2
-rw-r--r--src/object/jarPortal.c10
-rw-r--r--src/object/keyStealingTakkuri.c8
-rw-r--r--src/object/kinstoneSpark.c5
-rw-r--r--src/object/ladderUp.c1
-rw-r--r--src/object/lavaPlatform.c7
-rw-r--r--src/object/lightDoor.c9
-rw-r--r--src/object/lightRay.c6
-rw-r--r--src/object/lightableSwitch.c22
-rw-r--r--src/object/lilypadLarge.c23
-rw-r--r--src/object/lilypadLargeFalling.c1
-rw-r--r--src/object/lilypadSmall.c4
-rw-r--r--src/object/linkAnimation.c5
-rw-r--r--src/object/linkEmptyingBottle.c6
-rw-r--r--src/object/linkFire.c3
-rw-r--r--src/object/linkHoldingItem.c4
-rw-r--r--src/object/litArea.c5
-rw-r--r--src/object/lockedDoor.c32
-rw-r--r--src/object/macroAcorn.c2
-rw-r--r--src/object/macroBook.c4
-rw-r--r--src/object/macroDecorations.c1
-rw-r--r--src/object/macroMushroomStalk.c3
-rw-r--r--src/object/macroPlayer.c3
-rw-r--r--src/object/mask.c17
-rw-r--r--src/object/mazaalBossObject.c9
-rw-r--r--src/object/metalDoor.c12
-rw-r--r--src/object/minecart.c7
-rw-r--r--src/object/minecartDoor.c14
-rw-r--r--src/object/mineralWaterSource.c2
-rw-r--r--src/object/minishEmoticon.c3
-rw-r--r--src/object/minishPortalCloseup.c5
-rw-r--r--src/object/minishPortalStone.c20
-rw-r--r--src/object/minishSizedEntrance.c5
-rw-r--r--src/object/minishVillageObject.c8
-rw-r--r--src/object/moleMittsParticle.c5
-rw-r--r--src/object/object1F.c4
-rw-r--r--src/object/object30.c4
-rw-r--r--src/object/object37.c6
-rw-r--r--src/object/object53.c4
-rw-r--r--src/object/object63.c5
-rw-r--r--src/object/object70.c4
-rw-r--r--src/object/objectA.c11
-rw-r--r--src/object/objectA2.c10
-rw-r--r--src/object/objectA8.c15
-rw-r--r--src/object/objectBlockingStairs.c4
-rw-r--r--src/object/objectOnPillar.c8
-rw-r--r--src/object/objectOnSpinyBeetle.c5
-rw-r--r--src/object/octorokBossObject.c6
-rw-r--r--src/object/palaceArchway.c2
-rw-r--r--src/object/paper.c4
-rw-r--r--src/object/pinwheel.c13
-rw-r--r--src/object/playerClone.c2
-rw-r--r--src/object/pot.c14
-rw-r--r--src/object/pressurePlate.c5
-rw-r--r--src/object/pullableLever.c5
-rw-r--r--src/object/pullableMushroom.c7
-rw-r--r--src/object/pushableFurniture.c12
-rw-r--r--src/object/pushableGrave.c8
-rw-r--r--src/object/pushableLever.c6
-rw-r--r--src/object/pushableRock.c6
-rw-r--r--src/object/pushableStatue.c8
-rw-r--r--src/object/railtrack.c20
-rw-r--r--src/object/rotatingTrapdoor.c2
-rw-r--r--src/object/rupee.c3
-rw-r--r--src/object/shrinkingHieroglyphs.c3
-rw-r--r--src/object/smallIceBlock.c16
-rw-r--r--src/object/smoke.c2
-rw-r--r--src/object/smokeParticle.c7
-rw-r--r--src/object/specialFx.c9
-rw-r--r--src/object/steam.c1
-rw-r--r--src/object/stoneTablet.c2
-rw-r--r--src/object/swordParticle.c6
-rw-r--r--src/object/swordsmanNewsletter.c1
-rw-r--r--src/object/thunderbolt.c6
-rw-r--r--src/object/titleScreenObject.c2
-rw-r--r--src/object/trapdoor.c4
-rw-r--r--src/object/treeHidingPortal.c11
-rw-r--r--src/object/treeThorns.c1
-rw-r--r--src/object/unusedSkull.c14
-rw-r--r--src/object/vaati3PlayerObject.c2
-rw-r--r--src/object/warpPoint.c13
-rw-r--r--src/object/waterDropObject.c1
-rw-r--r--src/object/waterElement.c1
-rw-r--r--src/object/waterfallOpening.c3
-rw-r--r--src/object/well.c2
-rw-r--r--src/object/whirlwind.c8
-rw-r--r--src/object/whiteTriangleEffect.c3
-rw-r--r--src/object/windTribeFlag.c1
-rw-r--r--src/object/windTribeTeleporter.c7
-rw-r--r--src/object/windcrest.c1
158 files changed, 818 insertions, 339 deletions
diff --git a/src/object/ambientClouds.c b/src/object/ambientClouds.c
index 7e885373..cd607cbc 100644
--- a/src/object/ambientClouds.c
+++ b/src/object/ambientClouds.c
@@ -7,8 +7,10 @@
#include "asm.h"
#include "effects.h"
#include "entity.h"
-#include "functions.h"
#include "object.h"
+#include "player.h"
+#include "script.h"
+#include "color.h"
void AmbientClouds_Init(Entity* this);
void AmbientClouds_Action1(Entity* this);
diff --git a/src/object/backgroundCloud.c b/src/object/backgroundCloud.c
index 0c150823..53d29d75 100644
--- a/src/object/backgroundCloud.c
+++ b/src/object/backgroundCloud.c
@@ -5,6 +5,9 @@
* @brief BackgroundCloud object
*/
#include "object.h"
+#include "asm.h"
+#include "room.h"
+#include "physics.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/bakerOven.c b/src/object/bakerOven.c
index 1add5b41..3dce7457 100644
--- a/src/object/bakerOven.c
+++ b/src/object/bakerOven.c
@@ -4,8 +4,12 @@
*
* @brief Baker Oven object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
typedef struct {
diff --git a/src/object/barrelSpiderweb.c b/src/object/barrelSpiderweb.c
index 69a1ea77..dd694bc3 100644
--- a/src/object/barrelSpiderweb.c
+++ b/src/object/barrelSpiderweb.c
@@ -4,9 +4,17 @@
*
* @brief Barrel Spiderweb object
*/
-#include "functions.h"
#include "hitbox.h"
#include "object.h"
+#include "asm.h"
+#include "common.h"
+
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
+#include "physics.h"
+
+#include "player.h"
void BarrelSpiderweb_Init(Entity*);
void BarrelSpiderweb_Action1(Entity*);
diff --git a/src/object/beanstalk.c b/src/object/beanstalk.c
index e445d415..b0815ad0 100644
--- a/src/object/beanstalk.c
+++ b/src/object/beanstalk.c
@@ -4,9 +4,15 @@
*
* @brief Beanstalk object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
+#include "player.h"
#include "tiles.h"
+#include "vram.h"
+#include "map.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/bedCover.c b/src/object/bedCover.c
index a24189f5..10697f49 100644
--- a/src/object/bedCover.c
+++ b/src/object/bedCover.c
@@ -4,7 +4,7 @@
*
* @brief Bed Cover object
*/
-#include "functions.h"
+#include "script.h"
#include "object.h"
typedef struct {
diff --git a/src/object/bench.c b/src/object/bench.c
index 2b72fc56..8ca49a3c 100644
--- a/src/object/bench.c
+++ b/src/object/bench.c
@@ -6,9 +6,8 @@
*/
#include "asm.h"
#include "entity.h"
-#include "functions.h"
+#include "room.h"
#include "player.h"
-#include "sound.h"
typedef struct {
Entity base;
diff --git a/src/object/bigBarrel.c b/src/object/bigBarrel.c
index 74f13c50..4f7f99ee 100644
--- a/src/object/bigBarrel.c
+++ b/src/object/bigBarrel.c
@@ -10,9 +10,9 @@
#include "flags.h"
#include "map.h"
#include "object.h"
+#include "sound.h"
#include "room.h"
#include "save.h"
-#include "sound.h"
#include "tiles.h"
typedef struct {
diff --git a/src/object/bigIceBlock.c b/src/object/bigIceBlock.c
index dd204c78..543f323f 100644
--- a/src/object/bigIceBlock.c
+++ b/src/object/bigIceBlock.c
@@ -8,6 +8,13 @@
#include "hitbox.h"
#include "item.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "effects.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
typedef struct {
@@ -16,7 +23,7 @@ typedef struct {
/*0x6c*/ u16 unk_6c;
/*0x6e*/ u16 unk_6e;
/*0x70*/ u8 unk_70[0x16];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} BigIceBlockEntity;
extern void (*const BigIceBlock_Actions[])(BigIceBlockEntity*);
@@ -40,7 +47,7 @@ void BigIceBlock(BigIceBlockEntity* this) {
void BigIceBlock_Init(BigIceBlockEntity* this) {
Entity* obj;
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag)) {
DeleteThisEntity();
}
super->action = 1;
@@ -88,9 +95,9 @@ void BigIceBlock_Action2(BigIceBlockEntity* this) {
SetAffineInfo(super, 0x100, tmp, 0);
if (super->type != 1) {
if (super->type != 2) {
- SetFlag(this->unk_86);
+ SetFlag(this->flag);
} else {
- CreateGroundItemWithFlags(super, ITEM_SMALL_KEY, 0, this->unk_86);
+ CreateGroundItemWithFlags(super, ITEM_SMALL_KEY, 0, this->flag);
}
}
super->action = 3;
diff --git a/src/object/bigPushableLever.c b/src/object/bigPushableLever.c
index e7efcd56..1a01f69b 100644
--- a/src/object/bigPushableLever.c
+++ b/src/object/bigPushableLever.c
@@ -4,8 +4,12 @@
*
* @brief Big Pushable Lever object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
+#include "player.h"
#include "tiles.h"
typedef struct {
diff --git a/src/object/bigVortex.c b/src/object/bigVortex.c
index 91b510b9..ded88e94 100644
--- a/src/object/bigVortex.c
+++ b/src/object/bigVortex.c
@@ -6,13 +6,16 @@
*/
#include "entity.h"
#include "flags.h"
-#include "functions.h"
#include "object.h"
+#include "effects.h"
+#include "physics.h"
+#include "player.h"
+#include "asm.h"
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unused1[30];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} BigVortexEntity;
void sub_08098E3C(Entity*);
@@ -39,7 +42,7 @@ void BigVortex_Init(BigVortexEntity* this) {
super->action = 1;
super->z.HALF.HI = -0x10;
- temp = this->unk_86;
+ temp = this->flag;
if ((temp != 0) && !CheckFlags(temp)) {
super->action = 1;
@@ -55,7 +58,7 @@ void BigVortex_Init(BigVortexEntity* this) {
void BigVortex_Action1(BigVortexEntity* this) {
Entity* fx;
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag)) {
super->action = 2;
super->timer = 45;
fx = CreateFx(super, FX_BIG_EXPLOSION2, 0);
diff --git a/src/object/bird.c b/src/object/bird.c
index 638d2c52..083f9322 100644
--- a/src/object/bird.c
+++ b/src/object/bird.c
@@ -5,13 +5,21 @@
* @brief Bird object
*/
#include "collision.h"
-#include "functions.h"
#include "game.h"
#include "item.h"
#include "message.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "effects.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "object/cutsceneOrchestrator.h"
#include "save.h"
+#include "subtask.h"
+#include "pauseMenu.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/blockPushed.c b/src/object/blockPushed.c
index 85f45ce9..72b4a0a0 100644
--- a/src/object/blockPushed.c
+++ b/src/object/blockPushed.c
@@ -5,9 +5,14 @@
* @brief Block Pushed object
*/
#include "area.h"
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
+#include "vram.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/board.c b/src/object/board.c
index a05b42e4..ab757067 100644
--- a/src/object/board.c
+++ b/src/object/board.c
@@ -6,7 +6,6 @@
*/
#include "asm.h"
#include "entity.h"
-#include "functions.h"
#include "player.h"
#include "room.h"
#include "tiles.h"
diff --git a/src/object/bollard.c b/src/object/bollard.c
index 43286546..16dd4959 100644
--- a/src/object/bollard.c
+++ b/src/object/bollard.c
@@ -7,7 +7,6 @@
#include "asm.h"
#include "entity.h"
#include "flags.h"
-#include "functions.h"
#include "room.h"
#include "sound.h"
#include "tiles.h"
diff --git a/src/object/book.c b/src/object/book.c
index a031da2d..ef4610a1 100644
--- a/src/object/book.c
+++ b/src/object/book.c
@@ -5,18 +5,24 @@
* @brief Book object
*/
#include "collision.h"
-#include "functions.h"
#include "item.h"
#include "message.h"
#include "npc.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "effects.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unused1[24];
/*0x80*/ u8 unk_80;
/*0x81*/ u8 unused2[5];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} BookEntity;
extern void (*const Book_Actions[])(BookEntity*);
@@ -46,7 +52,7 @@ void Book_Init(BookEntity* this) {
}
super->spriteOffsetY = 3;
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag)) {
if (super->type2 == 0) {
super->y.HALF.HI += 48;
}
@@ -145,7 +151,7 @@ void Book_Action3(BookEntity* this) {
super->action = 4;
super->spritePriority.b0 = 4;
- SetFlag(this->unk_86);
+ SetFlag(this->flag);
fx = CreateFx(super, FX_DEATH, 0);
if (fx != NULL) {
diff --git a/src/object/bossDoor.c b/src/object/bossDoor.c
index fab846b9..91324598 100644
--- a/src/object/bossDoor.c
+++ b/src/object/bossDoor.c
@@ -4,10 +4,18 @@
*
* @brief Boss Door object
*/
-#include "functions.h"
+#include "object/lockedDoor.h"
#include "hitbox.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "effects.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
+#include "common.h"
typedef struct {
/*0x00*/ Entity base;
@@ -20,8 +28,8 @@ typedef struct {
/*0x7a*/ u16 unk_7a;
/*0x7c*/ u16 unk_7c;
/*0x7e*/ u8 unk_7e[6];
- /*0x84*/ u16 unk_84;
- /*0x86*/ u16 unk_86;
+ /*0x84*/ u16 flags2;
+ /*0x86*/ u16 flag;
} BossDoorEntity;
extern bool32 gUnk_02036BB8;
@@ -47,10 +55,10 @@ void BossDoor(BossDoorEntity* this) {
}
void BossDoor_Init(BossDoorEntity* this) {
- if ((this->unk_84 != 0xffff) && CheckFlags(this->unk_84)) {
+ if ((this->flags2 != 0xffff) && CheckFlags(this->flags2)) {
DeleteThisEntity();
}
- if ((this->unk_86 != BEGIN) && CheckFlags(this->unk_86)) {
+ if ((this->flag != BEGIN) && CheckFlags(this->flag)) {
DeleteThisEntity();
}
super->type2 = super->type >> 2;
@@ -86,7 +94,7 @@ void BossDoor_Action1(BossDoorEntity* this) {
if (super->interactType != INTERACTION_NONE) {
super->action = 2;
RemoveInteractableObject(super);
- SetFlag(this->unk_86);
+ SetFlag(this->flag);
}
}
@@ -155,7 +163,7 @@ void BossDoor_Action5(BossDoorEntity* this) {
}
void BossDoor_Action6(BossDoorEntity* this) {
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag)) {
super->action = 2;
}
}
diff --git a/src/object/bush.c b/src/object/bush.c
index a83a2aec..fb142371 100644
--- a/src/object/bush.c
+++ b/src/object/bush.c
@@ -4,9 +4,12 @@
*
* @brief Bush object
*/
-#include "functions.h"
-#include "hitbox.h"
#include "object.h"
+#include "asm.h"
+#include "effects.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
typedef struct {
diff --git a/src/object/button.c b/src/object/button.c
index d72e176f..a2967cac 100644
--- a/src/object/button.c
+++ b/src/object/button.c
@@ -4,9 +4,15 @@
*
* @brief Button object
*/
-#include "functions.h"
#include "tiles.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "effects.h"
+#include "room.h"
+#include "player.h"
+#include "map.h"
typedef struct {
/*0x00*/ Entity base;
@@ -16,7 +22,7 @@ typedef struct {
/*0x74*/ u16 tilePos;
/*0x76*/ u8 unused2[14];
/*0x84*/ u16 unk_84;
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} ButtonEntity;
void Button_Init(ButtonEntity* this);
@@ -45,7 +51,7 @@ void Button_Init(ButtonEntity* this) {
this->tilePos = (((super->x.HALF.HI - gRoomControls.origin_x) >> 4) & 0x3F) |
((((super->y.HALF.HI - gRoomControls.origin_y) >> 4) & 0x3F) << 6);
this->unk_72 = GetTileTypeAtTilePos(this->tilePos, super->collisionLayer);
- if (super->type == 0 && CheckFlags(this->unk_86)) {
+ if (super->type == 0 && CheckFlags(this->flag)) {
super->action = 5;
SetTileType(TILE_TYPE_122, this->tilePos, super->collisionLayer);
} else {
@@ -114,7 +120,7 @@ void Button_Action4(ButtonEntity* this) {
}
} else {
super->action = 2;
- ClearFlag(this->unk_86);
+ ClearFlag(this->flag);
SetTileType(TILE_TYPE_119, this->tilePos, super->collisionLayer);
SoundReq(SFX_BUTTON_PRESS);
}
@@ -276,7 +282,7 @@ bool32 sub_08081F7C(ButtonEntity* this, u32 tileType) {
super->child->spriteOffsetY = -4;
} else {
if (super->timer == 6) {
- SetFlag(this->unk_86);
+ SetFlag(this->flag);
SetTileType(tileType, this->tilePos, super->collisionLayer);
sub_08081F24(super);
SoundReq(SFX_BUTTON_PRESS);
diff --git a/src/object/cameraTarget.c b/src/object/cameraTarget.c
index f327c414..f025fea8 100644
--- a/src/object/cameraTarget.c
+++ b/src/object/cameraTarget.c
@@ -6,9 +6,10 @@
*/
#include "common.h"
#include "entity.h"
-#include "functions.h"
+#include "player.h"
#include "kinstone.h"
#include "message.h"
+#include "vram.h"
// typedef struct {
// Entity base;
diff --git a/src/object/carlovObject.c b/src/object/carlovObject.c
index 23873a92..00536c0b 100644
--- a/src/object/carlovObject.c
+++ b/src/object/carlovObject.c
@@ -4,8 +4,15 @@
*
* @brief Carlov Object object
*/
-#include "functions.h"
+#include "object/lockedDoor.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "effects.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
typedef struct {
@@ -168,7 +175,7 @@ void CarlovObject_Type2Init(CarlovObjectEntity* this) {
super->frameIndex = 1;
}
}
- CreateDust(super);
+ CreateDeathFx(super);
}
void CarlovObject_Type2Action1(CarlovObjectEntity* this) {
diff --git a/src/object/chestSpawner.c b/src/object/chestSpawner.c
index 7ea08cda..5c454666 100644
--- a/src/object/chestSpawner.c
+++ b/src/object/chestSpawner.c
@@ -4,12 +4,20 @@
*
* @brief Chest Spawner object
*/
-#include "functions.h"
#include "item.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "effects.h"
+#include "room.h"
+#include "player.h"
#include "screen.h"
-#include "structures.h"
+#include "script.h"
#include "tiles.h"
+#include "manager/lightManager.h"
+#include "pauseMenu.h"
+#include "beanstalkSubtask.h"
typedef struct {
/*0x00*/ Entity base;
@@ -17,7 +25,7 @@ typedef struct {
/*0x70*/ u16 tilePos;
/*0x72*/ u16 unk_72;
/*0x74*/ u8 unk_74[0x12];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} ChestSpawnerEntity;
extern const Hitbox gUnk_0811F8A8;
@@ -84,7 +92,7 @@ void ChestSpawner_Type2Init(ChestSpawnerEntity* this) {
sub_080842D8(this);
InitializeAnimation(super, 1);
} else {
- if (CheckFlags(this->unk_86) || super->type == 4) {
+ if (CheckFlags(this->flag) || super->type == 4) {
sub_08083E20(this);
} else {
super->action = 1;
@@ -94,7 +102,7 @@ void ChestSpawner_Type2Init(ChestSpawnerEntity* this) {
}
void ChestSpawner_Type2Action1(ChestSpawnerEntity* this) {
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag)) {
gScreen.controls.layerFXControl = 0xf40;
gScreen.controls.alphaBlend = 0x1000;
gPauseMenuOptions.disabled = 1;
@@ -104,7 +112,7 @@ void ChestSpawner_Type2Action1(ChestSpawnerEntity* this) {
super->spriteSettings.draw = 1;
super->spriteRendering.alphaBlend = 1;
RequestPriorityDuration(super, 30);
- sub_0805BC4C();
+ UnDarkRoom();
}
}
@@ -130,7 +138,7 @@ void ChestSpawner_Type2Action2(ChestSpawnerEntity* this) {
break;
default:
sub_0800445C(super);
- CreateMagicSparkles(super->x.HALF.HI, super->y.HALF.HI, 2);
+ CreateMagicSparklesFxAt(super->x.HALF.HI, super->y.HALF.HI, 2);
if (--super->timer == 0) {
super->timer = 8;
tmp = ++super->subtimer;
@@ -235,7 +243,7 @@ void ChestSpawner_Type0Init(ChestSpawnerEntity* this) {
if (GetTileTypeAtEntity(super) == TILE_TYPE_116) {
DeleteThisEntity();
}
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag)) {
super->action = 3;
sub_0807B7D8(0x73, this->tilePos, super->collisionLayer);
if ((super->type & 1) == 0) {
@@ -245,7 +253,7 @@ void ChestSpawner_Type0Init(ChestSpawnerEntity* this) {
}
void ChestSpawner_Type0Action1(ChestSpawnerEntity* this) {
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag)) {
super->action = 2;
}
}
@@ -259,7 +267,7 @@ void ChestSpawner_Type0Action2(ChestSpawnerEntity* this) {
break;
default:
SoundReq(SFX_SECRET);
- CreateDust(super);
+ CreateDeathFx(super);
break;
}
super->action = 3;
@@ -274,13 +282,13 @@ void ChestSpawner_Type0Action3(ChestSpawnerEntity* this) {
if (GetTileTypeAtEntity(super) == TILE_TYPE_116) {
DeleteEntity(super);
} else {
- if (!CheckFlags(this->unk_86)) {
+ if (!CheckFlags(this->flag)) {
if (this->unk_72 != 0) {
this->unk_72--;
} else {
super->action = 1;
RestorePrevTileEntity(this->tilePos, super->collisionLayer);
- CreateDust(super);
+ CreateDeathFx(super);
}
}
}
diff --git a/src/object/chuchuBossCutscene.c b/src/object/chuchuBossCutscene.c
index 9c1287f2..59d02100 100644
--- a/src/object/chuchuBossCutscene.c
+++ b/src/object/chuchuBossCutscene.c
@@ -4,9 +4,12 @@
*
* @brief Chuchu Boss Cutscene object
*/
-#include "functions.h"
#include "menu.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "room.h"
+#include "physics.h"
void ChuchuBossCutscene_Init(Entity*);
void ChuchuBossCutscene_Action1(Entity*);
diff --git a/src/object/chuchuBossStartParticle.c b/src/object/chuchuBossStartParticle.c
index 286c414c..00469edd 100644
--- a/src/object/chuchuBossStartParticle.c
+++ b/src/object/chuchuBossStartParticle.c
@@ -4,8 +4,13 @@
*
* @brief Chuchu Boss Start Particle object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
+#include "color.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/cloud.c b/src/object/cloud.c
index 58d34f12..7a51601d 100644
--- a/src/object/cloud.c
+++ b/src/object/cloud.c
@@ -4,9 +4,14 @@
*
* @brief Cloud object
*/
-#include "functions.h"
#include "object.h"
-#include "structures.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
+#include "pauseMenu.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/crackingGround.c b/src/object/crackingGround.c
index fe8488c0..bd13dadf 100644
--- a/src/object/crackingGround.c
+++ b/src/object/crackingGround.c
@@ -4,8 +4,12 @@
*
* @brief Cracking Ground object
*/
-#include "functions.h"
+#include "asm.h"
#include "object.h"
+#include "sound.h"
+#include "effects.h"
+#include "room.h"
+#include "player.h"
void CrackingGround(Entity* this) {
if (this->action == 0) {
diff --git a/src/object/crenelBeanSprout.c b/src/object/crenelBeanSprout.c
index b57c4c8c..d1d71e55 100644
--- a/src/object/crenelBeanSprout.c
+++ b/src/object/crenelBeanSprout.c
@@ -5,10 +5,16 @@
* @brief Crenel Bean Sprout object
*/
#include "asm.h"
-#include "functions.h"
#include "hitbox.h"
#include "object.h"
+#include "sound.h"
+#include "flags.h"
+#include "effects.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
+#include "ui.h"
typedef struct {
/*0x00*/ Entity base;
@@ -241,7 +247,7 @@ void CrenelBeanSprout_Action4(CrenelBeanSproutEntity* this) {
if (--super->timer == 0) {
super->action = 6;
super->subAction = 0;
- CreateDust(super);
+ CreateDeathFx(super);
}
} else {
super->timer = 192;
diff --git a/src/object/cuccoMinigame.c b/src/object/cuccoMinigame.c
index ae866925..887a1022 100644
--- a/src/object/cuccoMinigame.c
+++ b/src/object/cuccoMinigame.c
@@ -6,14 +6,19 @@
* @brief Cucco Minigame object
*/
#include "enemy.h"
+#include "sound.h"
+#include "flags.h"
+#include "common.h"
#include "entity.h"
#include "fileselect.h"
-#include "functions.h"
#include "item.h"
#include "npc.h"
#include "object.h"
+#include "room.h"
+#include "player.h"
#include "script.h"
#include "tiles.h"
+#include "map.h"
typedef struct {
Entity base;
diff --git a/src/object/cutsceneMiscObject.c b/src/object/cutsceneMiscObject.c
index 2427c370..4d052dfe 100644
--- a/src/object/cutsceneMiscObject.c
+++ b/src/object/cutsceneMiscObject.c
@@ -4,14 +4,24 @@
*
* @brief Cutscene Misc object
*/
+#include "object/cutsceneMiscObject.h"
#include "area.h"
-#include "functions.h"
#include "item.h"
#include "message.h"
#include "object.h"
-#include "screen.h"
+#include "asm.h"
+#include "common.h"
+#include "sound.h"
+#include "flags.h"
+#include "effects.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
+#include "scroll.h"
#include "script.h"
#include "tiles.h"
+#include "color.h"
+#include "fade.h"
extern u8 gUnk_08122AE0[];
extern u16 gUnk_08122AE8[];
@@ -188,7 +198,7 @@ void sub_08094B94(CutsceneMiscObjectEntity* this) {
CopyPosition(&gPlayerEntity.base, e);
e->z.HALF.HI = -48;
((CutsceneMiscObjectEntity*)e)->ctx = StartCutscene(e, &script_CutsceneMiscObjectTheLittleHat);
- CreateDust(e);
+ CreateDeathFx(e);
e->z.HALF.HI += 16;
e->y.HALF.HI++;
}
diff --git a/src/object/cutsceneOrchestrator.c b/src/object/cutsceneOrchestrator.c
index efc726a3..29312433 100644
--- a/src/object/cutsceneOrchestrator.c
+++ b/src/object/cutsceneOrchestrator.c
@@ -5,7 +5,7 @@
* @brief Cutscene Orchestrator object
*/
#include "entity.h"
-#include "functions.h"
+#include "script.h"
#include "hitbox.h"
void CutsceneOrchestrator(Entity* this) {
diff --git a/src/object/deathFx.c b/src/object/deathFx.c
index 2f51e110..779a2f5e 100644
--- a/src/object/deathFx.c
+++ b/src/object/deathFx.c
@@ -6,10 +6,12 @@
*/
#include "object/deathFx.h"
#include "enemy.h"
+#include "sound.h"
#include "entity.h"
-#include "functions.h"
+#include "item.h"
+#include "physics.h"
#include "global.h"
-#include "sound.h"
+#include "vram.h"
void sub_08081790(DeathFxObject* this);
void DeathFx_Delete(DeathFxObject* this);
diff --git a/src/object/dirtParticle.c b/src/object/dirtParticle.c
index cfd0295a..f4e80932 100644
--- a/src/object/dirtParticle.c
+++ b/src/object/dirtParticle.c
@@ -4,8 +4,11 @@
*
* @brief Dirt Particle object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "physics.h"
+#include "player.h"
+#include "color.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/doubleBookshelf.c b/src/object/doubleBookshelf.c
index 33519589..b0b706d5 100644
--- a/src/object/doubleBookshelf.c
+++ b/src/object/doubleBookshelf.c
@@ -4,9 +4,15 @@
*
* @brief Double Bookshelf object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
+#include "map.h"
typedef struct {
/*0x00*/ Entity base;
@@ -15,7 +21,7 @@ typedef struct {
/*0x82*/ u16 unk_82;
/*0x84*/ u8 unk_84;
/*0x85*/ u8 unk_85;
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} DoubleBookshelfEntity;
void sub_0809B334(DoubleBookshelfEntity*);
@@ -59,7 +65,7 @@ void DoubleBookshelf_Init(DoubleBookshelfEntity* this) {
if (child != NULL) {
(child->base).parent = super;
super->child = &child->base;
- if (CheckFlags(this->unk_86) == 0) {
+ if (CheckFlags(this->flag) == 0) {
PositionRelative(super, &child->base, 0x100000, 0x100000);
child->unk_84 = 0;
} else {
@@ -118,7 +124,7 @@ void sub_0809B0B0(DoubleBookshelfEntity* this) {
SetTile(SPECIAL_TILE_130, tilePos + 3, layer);
SetTile(SPECIAL_TILE_34, tilePos + 2, layer);
SetTile(SPECIAL_TILE_95, tilePos, layer);
- SetFlag(((DoubleBookshelfEntity*)super->parent)->unk_86);
+ SetFlag(((DoubleBookshelfEntity*)super->parent)->flag);
break;
case 3:
this->unk_84 = 0;
@@ -126,7 +132,7 @@ void sub_0809B0B0(DoubleBookshelfEntity* this) {
SetTile(SPECIAL_TILE_130, tilePos - 1, layer);
SetTile(SPECIAL_TILE_34, tilePos, layer);
SetTile(SPECIAL_TILE_95, tilePos + 2, layer);
- ClearFlag(((DoubleBookshelfEntity*)super->parent)->unk_86);
+ ClearFlag(((DoubleBookshelfEntity*)super->parent)->flag);
break;
case 4:
SetTile(SPECIAL_TILE_34, tilePos, layer);
diff --git a/src/object/elementsBackground.c b/src/object/elementsBackground.c
index f046d3b7..eaeb532f 100644
--- a/src/object/elementsBackground.c
+++ b/src/object/elementsBackground.c
@@ -5,7 +5,6 @@
* @brief Elements Background object
*/
#include "entity.h"
-#include "functions.h"
#include "screen.h"
void ElementsBackground_Init(Entity*);
diff --git a/src/object/enemyItem.c b/src/object/enemyItem.c
index 16cae432..b44b85b9 100644
--- a/src/object/enemyItem.c
+++ b/src/object/enemyItem.c
@@ -4,13 +4,16 @@
*
* @brief Enemy Item object
*/
-#include "functions.h"
+#include "scroll.h"
#include "object.h"
+#include "flags.h"
+#include "physics.h"
+#include "item.h"
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unk_68[0x1e];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} EnemyItemEntity;
void sub_080A2500(EnemyItemEntity*);
@@ -21,7 +24,7 @@ void EnemyItem(EnemyItemEntity* this) {
Entity* entity;
LinkedList* list;
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag)) {
sub_080A2500(this);
}
if (super->action == 0) {
@@ -63,7 +66,7 @@ void sub_080A2508(EnemyItemEntity* this) {
entity = (EnemyItemEntity*)CreateObjectWithParent(super, GROUND_ITEM, super->type, 0);
if (entity != NULL) {
(entity->base).timer = 5;
- entity->unk_86 = this->unk_86;
+ entity->flag = this->flag;
}
sub_080A2500(this);
}
@@ -74,7 +77,7 @@ void sub_080A2534(EnemyItemEntity* this) {
entity = (EnemyItemEntity*)CreateObjectWithParent(super, GROUND_ITEM, super->type, 0);
if (entity != NULL) {
(entity->base).timer = 4;
- entity->unk_86 = this->unk_86;
+ entity->flag = this->flag;
}
sub_080A2500(this);
}
diff --git a/src/object/evilSpirit.c b/src/object/evilSpirit.c
index bec6e328..03c65712 100644
--- a/src/object/evilSpirit.c
+++ b/src/object/evilSpirit.c
@@ -1,7 +1,9 @@
#include "entity.h"
-#include "functions.h"
#include "flags.h"
#include "object.h"
+#include "asm.h"
+#include "physics.h"
+#include "player.h"
typedef struct {
Entity base;
@@ -102,7 +104,6 @@ void EvilSpirit_Action1(EvilSpiritEntity* this) {
} else {
this->unk76 = this->unk7c - 0x20;
this->unk7a = this->unk7c + 0x50;
- ;
}
}
super->x = super->parent->x;
diff --git a/src/object/ezloCap.c b/src/object/ezloCap.c
index de1beb00..f342e00a 100644
--- a/src/object/ezloCap.c
+++ b/src/object/ezloCap.c
@@ -4,9 +4,13 @@
*
* @brief Ezlo Cap object
*/
-#include "functions.h"
#include "message.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "script.h"
+#include "player.h"
+#include "vram.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/ezloCapFlying.c b/src/object/ezloCapFlying.c
index 91c197a0..2d270232 100644
--- a/src/object/ezloCapFlying.c
+++ b/src/object/ezloCapFlying.c
@@ -4,8 +4,12 @@
*
* @brief Ezlo Cap Flying object
*/
-#include "functions.h"
+#include "asm.h"
#include "object.h"
+#include "sound.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/fairy.c b/src/object/fairy.c
index 0f2eb209..430da8d9 100644
--- a/src/object/fairy.c
+++ b/src/object/fairy.c
@@ -5,10 +5,13 @@
* @brief Fairy object
*/
#include "collision.h"
-#include "functions.h"
#include "hitbox.h"
-#include "item.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "physics.h"
+#include "player.h"
+#include "scroll.h"
typedef struct {
/*0x00*/ Entity base;
@@ -33,7 +36,7 @@ void Fairy_SubAction0(FairyEntity*);
void Fairy_SubAction1(FairyEntity*);
void Fairy_SubAction2(FairyEntity*);
-extern void sub_08081404(Entity*, u32);
+extern void ItemOnGround_SetFlagAndDelete(Entity*, u32);
void Fairy(FairyEntity* this) {
static void (*const Fairy_Actions[])(FairyEntity*) = {
@@ -167,7 +170,7 @@ void Fairy_Action2(FairyEntity* this) {
ProcessMovement1(super);
if ((AnyPrioritySet() == 0) && (super->type2 == 0)) {
if (--this->unk_78 == 0) {
- sub_08081404(super, 0);
+ ItemOnGround_SetFlagAndDelete(super, FALSE);
}
if (this->unk_78 < 0x78) {
super->spriteSettings.draw ^= 1;
@@ -177,7 +180,7 @@ void Fairy_Action2(FairyEntity* this) {
void Fairy_Action3(FairyEntity* this) {
if (*(u16*)&super->child->kind != 0x308) {
- sub_08081404(super, 0);
+ ItemOnGround_SetFlagAndDelete(super, FALSE);
} else {
CopyPosition(super->child, super);
super->z.HALF.HI--;
@@ -214,7 +217,7 @@ void Fairy_Action4(FairyEntity* this) {
if (--super->subtimer == 0) {
super->subtimer = 6;
if (--super->spriteOffsetY < -0x16) {
- sub_08081404(super, 1);
+ ItemOnGround_SetFlagAndDelete(super, TRUE);
}
}
if (super->spriteOffsetY < -0x11) {
diff --git a/src/object/fan.c b/src/object/fan.c
index f786981a..2f496c27 100644
--- a/src/object/fan.c
+++ b/src/object/fan.c
@@ -7,10 +7,12 @@
#include "collision.h"
#include "entity.h"
#include "flags.h"
-#include "functions.h"
+#include "asm.h"
#include "object.h"
-#include "player.h"
#include "sound.h"
+#include "physics.h"
+#include "player.h"
+#include "map.h"
typedef struct {
Entity base;
diff --git a/src/object/fanWind.c b/src/object/fanWind.c
index a33a58d7..b5509bb9 100644
--- a/src/object/fanWind.c
+++ b/src/object/fanWind.c
@@ -6,7 +6,8 @@
*/
#include "collision.h"
#include "entity.h"
-#include "functions.h"
+#include "physics.h"
+#include "map.h"
void FanWind(Entity* this) {
u8* collisionData;
diff --git a/src/object/figurineDevice.c b/src/object/figurineDevice.c
index 6c553dc0..b38571f0 100644
--- a/src/object/figurineDevice.c
+++ b/src/object/figurineDevice.c
@@ -6,13 +6,24 @@
*/
#include "figurineMenu.h"
#include "fileselect.h"
-#include "functions.h"
#include "item.h"
#include "kinstone.h"
#include "message.h"
#include "object.h"
+#include "asm.h"
+#include "common.h"
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "screen.h"
#include "tiles.h"
+#include "subtask.h"
+#include "color.h"
+#ifndef EU
+#include "script.h"
+#endif
typedef struct {
/*0x00*/ Entity base;
@@ -596,8 +607,8 @@ void sub_080882A8(FigurineDeviceEntity* this) {
static const u16 gUnk_08120AE4[] = { TEXT_INDEX(TEXT_CARLOV, 0x18), TEXT_INDEX(TEXT_CARLOV, 0x19) };
u8* ptr;
sub_08050384();
- sub_08057044(this->shells, gUnk_020227E8, 0x202020);
- sub_08057044(this->chance, &gUnk_020227E8[1], 0x202020);
+ NumberToAsciiPad3Digits(this->shells, &gUnk_020227E8[0], 0x202020);
+ NumberToAsciiPad3Digits(this->chance, &gUnk_020227E8[1], 0x202020);
ptr = (u8*)0x02000000;
if (ptr[7] == 0) {
ShowTextBox(gUnk_08120AE4[super->type2], (Font*)&gUnk_08120AB4); // TODO convert data
diff --git a/src/object/fileScreenObjects.c b/src/object/fileScreenObjects.c
index 3b01e789..ab8a1c1f 100644
--- a/src/object/fileScreenObjects.c
+++ b/src/object/fileScreenObjects.c
@@ -5,11 +5,15 @@
* @brief File Screen Objects object
*/
#include "fileselect.h"
-#include "functions.h"
#include "main.h"
#include "menu.h"
#include "object.h"
+#include "asm.h"
+#include "common.h"
+#include "flags.h"
+#include "physics.h"
#include "player.h"
+#include "gfx.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/fireballChain.c b/src/object/fireballChain.c
index af1aa68e..f9b08cbe 100644
--- a/src/object/fireballChain.c
+++ b/src/object/fireballChain.c
@@ -5,7 +5,7 @@
* @brief Fireball Chain object
*/
#include "entity.h"
-#include "functions.h"
+#include "physics.h"
#include "global.h"
#include "projectile.h"
#include "projectile/winder.h"
diff --git a/src/object/fireplace.c b/src/object/fireplace.c
index 4fd32aec..2c3d3eed 100644
--- a/src/object/fireplace.c
+++ b/src/object/fireplace.c
@@ -4,14 +4,17 @@
*
* @brief Fireplace object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "flags.h"
+#include "room.h"
+#include "player.h"
#include "tiles.h"
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unused1[30];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} FireplaceEntity;
void Fireplace_Action1(FireplaceEntity* this);
@@ -31,7 +34,7 @@ void Fireplace_Init(FireplaceEntity* this) {
super->action = 1;
super->spriteSettings.draw = 1;
super->speed = 0x80;
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag)) {
sub_0809B7DC(this);
DeleteThisEntity();
} else {
@@ -44,7 +47,7 @@ void Fireplace_Init(FireplaceEntity* this) {
void Fireplace_Action1(FireplaceEntity* this) {
sub_0809B7C0(this);
if (super->timer) {
- SetFlag(this->unk_86);
+ SetFlag(this->flag);
DeleteThisEntity();
}
}
diff --git a/src/object/flame.c b/src/object/flame.c
index 5b1b48a7..4fce1e8d 100644
--- a/src/object/flame.c
+++ b/src/object/flame.c
@@ -6,13 +6,16 @@
*/
#include "entity.h"
#include "flags.h"
-#include "functions.h"
+#include "physics.h"
#include "sound.h"
+#include "asm.h"
+#include "room.h"
+#include "player.h"
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unused1[30];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} FlameEntity;
extern void sub_0807AB44(Entity*, s32, s32);
@@ -43,7 +46,7 @@ void Flame_Init(FlameEntity* this) {
CopyPosition(super->parent, super);
break;
case 4:
- if (!CheckFlags(this->unk_86)) {
+ if (!CheckFlags(this->flag)) {
super->spriteSettings.draw = FALSE;
super->subAction = 1;
return;
@@ -85,7 +88,7 @@ void Flame_Action1(FlameEntity* this) {
CopyPosition(super->parent, super);
break;
case 4:
- val = CheckFlags(this->unk_86);
+ val = CheckFlags(this->flag);
if (super->subAction == 0) {
if (val)
return;
diff --git a/src/object/floatingPlatform.c b/src/object/floatingPlatform.c
index 3a260350..f9ec6f89 100644
--- a/src/object/floatingPlatform.c
+++ b/src/object/floatingPlatform.c
@@ -5,8 +5,10 @@
* @brief Floating Platform object
*/
#include "entity.h"
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "room.h"
+#include "player.h"
typedef struct {
Entity base;
diff --git a/src/object/fourElements.c b/src/object/fourElements.c
index e364d7cb..f163ee79 100644
--- a/src/object/fourElements.c
+++ b/src/object/fourElements.c
@@ -5,11 +5,17 @@
* @brief Four Elements object
*/
#include "collision.h"
-#include "functions.h"
#include "hitbox.h"
#include "message.h"
#include "object.h"
+#include "sound.h"
+#include "flags.h"
+#include "player.h"
#include "screen.h"
+#include "scroll.h"
+#include "manager/lightManager.h"
+#include "script.h"
+#include "fade.h"
typedef struct {
/*0x00*/ Entity base;
@@ -63,7 +69,7 @@ void FourElements_Init(FourElementsEntity* this) {
StartPlayerScript(script_PlayerGetElement);
gScreen.controls.layerFXControl = 0x640;
gScreen.controls.alphaBlend = 0x1000;
- sub_0805BC4C();
+ UnDarkRoom();
elementsBackground = CreateObjectWithParent(super, ELEMENTS_BACKGROUND, super->type - 0x40, 0);
if (elementsBackground != NULL) {
elementsBackground->parent = super;
diff --git a/src/object/frozenOctorok.c b/src/object/frozenOctorok.c
index be88eb5f..b7d2a2a9 100644
--- a/src/object/frozenOctorok.c
+++ b/src/object/frozenOctorok.c
@@ -5,9 +5,17 @@
* @brief Frozen Octorok object
*/
#include "enemy/octorokBoss.h"
-#include "functions.h"
#include "message.h"
#include "object.h"
+#include "common.h"
+#include "sound.h"
+#include "flags.h"
+#include "effects.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
+#include "vram.h"
+#include "color.h"
typedef struct {
/*0x00*/ Entity base;
@@ -219,7 +227,7 @@ void FrozenOctorok_Action1(FrozenOctorokEntity* this) {
FrozenOctorok_Action1SubActions[super->subAction](this);
if (super->subtimer != 0) {
if ((gRoomTransition.frameCount & 7) == 0) {
- CreateSparkle(super->child);
+ CreateSparkleFx(super->child);
}
if (this->unk_7e != 0) {
super->child->zVelocity = super->child->zVelocity - (s16)this->unk_7e;
diff --git a/src/object/frozenWaterElement.c b/src/object/frozenWaterElement.c
index 848964b3..183fc31b 100644
--- a/src/object/frozenWaterElement.c
+++ b/src/object/frozenWaterElement.c
@@ -4,8 +4,14 @@
*
* @brief Frozen Water Element object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "effects.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
typedef struct {
diff --git a/src/object/furniture.c b/src/object/furniture.c
index ddcec22f..5ebf750d 100644
--- a/src/object/furniture.c
+++ b/src/object/furniture.c
@@ -5,10 +5,14 @@
* @brief Furniture object
*/
#include "entity.h"
-#include "functions.h"
#include "object.h"
+#include "asm.h"
#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
+#include "color.h"
+#include "map.h"
enum {
FURNITURE_INIT,
diff --git a/src/object/gentariCurtain.c b/src/object/gentariCurtain.c
index 97c3aad0..9607058b 100644
--- a/src/object/gentariCurtain.c
+++ b/src/object/gentariCurtain.c
@@ -7,10 +7,10 @@
#include "asm.h"
#include "entity.h"
#include "flags.h"
-#include "functions.h"
#include "object.h"
#include "room.h"
#include "tiles.h"
+#include "map.h"
typedef struct {
Entity base;
diff --git a/src/object/giantBookLadder.c b/src/object/giantBookLadder.c
index 5f18d1b4..d0d602c5 100644
--- a/src/object/giantBookLadder.c
+++ b/src/object/giantBookLadder.c
@@ -4,10 +4,12 @@
*
* @brief Giant Book Ladder object
*/
-#include "manager.h"
#include "map.h"
#include "object.h"
+#include "asm.h"
+#include "room.h"
#include "tiles.h"
+#include "game.h"
typedef struct {
Entity base;
@@ -16,7 +18,7 @@ typedef struct {
u16 unk76;
} GiantBookLadderEntity;
-void sub_0808E55C(GiantBookLadderEntity*);
+void GiantBookLadder_OnEnterRoom(GiantBookLadderEntity*);
u32 sub_0808E670(GiantBookLadderEntity*);
void GiantBookLadder(Entity* this) {
@@ -33,14 +35,14 @@ void GiantBookLadder(Entity* this) {
this->spritePriority.b0 = spriteDefPtr[1];
((GiantBookLadderEntity*)this)->unk76 = 0;
((GiantBookLadderEntity*)this)->unk74 = COORD_TO_TILE(this);
- sub_0808E55C((GiantBookLadderEntity*)this);
- RegisterTransitionManager(this, sub_0808E55C, 0);
+ GiantBookLadder_OnEnterRoom((GiantBookLadderEntity*)this);
+ RegisterTransitionHandler(this, GiantBookLadder_OnEnterRoom, NULL);
} else if ((this->type & 1) == 0) {
sub_0808E670((GiantBookLadderEntity*)this);
}
}
-void sub_0808E55C(GiantBookLadderEntity* this) {
+void GiantBookLadder_OnEnterRoom(GiantBookLadderEntity* this) {
u32 type;
u32 uVar4;
u32 unaff_r9;
diff --git a/src/object/giantLeaf.c b/src/object/giantLeaf.c
index 6293a9d0..3dc3cda8 100644
--- a/src/object/giantLeaf.c
+++ b/src/object/giantLeaf.c
@@ -6,6 +6,8 @@
*/
#include "map.h"
#include "object.h"
+#include "asm.h"
+#include "room.h"
void sub_0808D618(Entity* this);
diff --git a/src/object/giantTwig.c b/src/object/giantTwig.c
index 00beda17..92fcdbc1 100644
--- a/src/object/giantTwig.c
+++ b/src/object/giantTwig.c
@@ -4,9 +4,14 @@
*
* @brief Giant Twig object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
+#include "color.h"
+#include "map.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/gleerokParticle.c b/src/object/gleerokParticle.c
index 7af41d2f..5cac9ce0 100644
--- a/src/object/gleerokParticle.c
+++ b/src/object/gleerokParticle.c
@@ -7,9 +7,9 @@
#include "asm.h"
#include "effects.h"
#include "entity.h"
-#include "functions.h"
#include "hitbox.h"
#include "object.h"
+#include "physics.h"
#include "player.h"
#include "room.h"
diff --git a/src/object/graveyardKey.c b/src/object/graveyardKey.c
index 577d4b09..45549be8 100644
--- a/src/object/graveyardKey.c
+++ b/src/object/graveyardKey.c
@@ -9,10 +9,11 @@
#include "effects.h"
#include "entity.h"
#include "flags.h"
-#include "functions.h"
+#include "physics.h"
#include "item.h"
#include "player.h"
#include "sound.h"
+#include "scroll.h"
typedef struct _struct_gUnk_08123FB0 {
void (*const funcEnt)(Entity*);
diff --git a/src/object/greatFairy.c b/src/object/greatFairy.c
index 3099571c..27440aa2 100644
--- a/src/object/greatFairy.c
+++ b/src/object/greatFairy.c
@@ -6,9 +6,16 @@
*/
#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "save.h"
#include "screen.h"
#include "script.h"
+#include "fade.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/guruguruBar.c b/src/object/guruguruBar.c
index 40fa7d41..d6e9ebc0 100644
--- a/src/object/guruguruBar.c
+++ b/src/object/guruguruBar.c
@@ -4,9 +4,8 @@
*
* @brief Guruguru Bar object
*/
-#include "entity.h"
-#include "functions.h"
#include "object.h"
+#include "physics.h"
#include "projectile.h"
#include "room.h"
diff --git a/src/object/gyorgBossObject.c b/src/object/gyorgBossObject.c
index 2de64ed0..3704d70b 100644
--- a/src/object/gyorgBossObject.c
+++ b/src/object/gyorgBossObject.c
@@ -4,14 +4,24 @@
*
* @brief Gyorg Boss object
*/
-#include "area.h"
#include "enemy/gyorg.h"
#include "entity.h"
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "common.h"
+#include "sound.h"
+#include "flags.h"
+#include "effects.h"
+#include "physics.h"
+#include "player.h"
#include "room.h"
#include "screen.h"
#include "screenTransitions.h"
+#include "scroll.h"
+#include "fade.h"
+#ifndef EU
+#include "area.h"
+#endif
struct GyorgChildSpawns {
s16 offsetX;
@@ -251,7 +261,7 @@ void GyorgBossObject_FightEnd(GyorgBossObjectEntity* this) {
sub_080A1E54(this);
if (--super->subtimer == 0) {
SetFlag(0x7B);
- sub_0808091C(&gUnk_0813ABD0, 8);
+ DoExitTransitionWithType(&gUnk_0813ABD0, 8);
return;
}
if (super->subtimer == 0x3C) {
diff --git a/src/object/heartContainer.c b/src/object/heartContainer.c
index 1817b8c3..732f9475 100644
--- a/src/object/heartContainer.c
+++ b/src/object/heartContainer.c
@@ -10,12 +10,13 @@
#include "functions.h"
#include "item.h"
#include "sound.h"
+#include "scroll.h"
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unused1[28];
- /*0x84*/ u16 unk_84;
- /*0x86*/ u16 unk_86;
+ /*0x84*/ u16 flag;
+ /*0x86*/ u16 flag2;
} HeartContainerEntity;
static void HeartContainer_Init(HeartContainerEntity* this);
@@ -37,7 +38,7 @@ void HeartContainer(HeartContainerEntity* this) {
}
static void HeartContainer_Init(HeartContainerEntity* this) {
- if (CheckFlags(this->unk_84)) {
+ if (CheckFlags(this->flag)) {
DeleteThisEntity();
}
super->action = 1;
@@ -49,7 +50,7 @@ static void HeartContainer_Init(HeartContainerEntity* this) {
}
static void HeartContainer_Action1(HeartContainerEntity* this) {
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag2)) {
super->action = 2;
super->spriteSettings.draw = 1;
super->spriteRendering.b0 = 3;
@@ -74,7 +75,7 @@ static void HeartContainer_Action2(HeartContainerEntity* this) {
static void HeartContainer_Action3(HeartContainerEntity* this) {
sub_08080CB4(super);
if (!(gPlayerState.flags & PL_MINISH) && IsCollidingPlayer(super)) {
- SetFlag(this->unk_84);
+ SetFlag(this->flag);
CreateItemEntity(ITEM_HEART_CONTAINER, 0, 0);
DeleteThisEntity();
}
diff --git a/src/object/hiddenLadderDown.c b/src/object/hiddenLadderDown.c
index dd7ed7d5..0cdf073e 100644
--- a/src/object/hiddenLadderDown.c
+++ b/src/object/hiddenLadderDown.c
@@ -7,7 +7,7 @@
#include "asm.h"
#include "entity.h"
#include "flags.h"
-#include "functions.h"
+#include "room.h"
#include "tiles.h"
typedef struct {
@@ -15,7 +15,7 @@ typedef struct {
/*0x68*/ u8 unused1[8];
/*0x70*/ u16 unk_70;
/*0x72*/ u8 unused2[20];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} HiddenLadderDownEntity;
void HiddenLadderDown_Init(HiddenLadderDownEntity* this);
@@ -39,7 +39,7 @@ void HiddenLadderDown_Init(HiddenLadderDownEntity* this) {
super->animIndex = 0;
this->unk_70 = COORD_TO_TILE(super);
puVar3 = &this->unk_70;
- if (CheckFlags(this->unk_86) != 0) {
+ if (CheckFlags(this->flag) != 0) {
super->action = 2;
super->spriteSettings.draw = TRUE;
SetTileType(TILE_TYPE_418, *puVar3 + TILE_POS(-1, -1), super->collisionLayer);
@@ -58,6 +58,6 @@ void HiddenLadderDown_Action1(HiddenLadderDownEntity* this) {
if (GetTileTypeAtTilePos(this->unk_70, super->collisionLayer) == 0x1a6) {
super->action = 2;
super->spriteSettings.draw = TRUE;
- SetFlag(this->unk_86);
+ SetFlag(this->flag);
}
}
diff --git a/src/object/hittableLever.c b/src/object/hittableLever.c
index a2d97301..2fc017d2 100644
--- a/src/object/hittableLever.c
+++ b/src/object/hittableLever.c
@@ -4,8 +4,12 @@
*
* @brief Hittable Lever object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
+#include "player.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/houseDoorExterior.c b/src/object/houseDoorExterior.c
index 79ecf0d8..0e64d308 100644
--- a/src/object/houseDoorExterior.c
+++ b/src/object/houseDoorExterior.c
@@ -6,9 +6,11 @@
*/
#include "entity.h"
#include "flags.h"
-#include "functions.h"
+#include "main.h"
#include "npc.h"
#include "object.h"
+#include "asm.h"
+#include "player.h"
#include "room.h"
#include "script.h"
#include "sound.h"
diff --git a/src/object/houseDoorInterior.c b/src/object/houseDoorInterior.c
index f2a51b32..6648f24e 100644
--- a/src/object/houseDoorInterior.c
+++ b/src/object/houseDoorInterior.c
@@ -6,9 +6,10 @@
*/
#include "entity.h"
#include "flags.h"
-#include "functions.h"
+#include "player.h"
#include "npc.h"
#include "sound.h"
+#include "asm.h"
typedef struct {
Entity base;
diff --git a/src/object/itemForSale.c b/src/object/itemForSale.c
index cb37efd5..61d111f2 100644
--- a/src/object/itemForSale.c
+++ b/src/object/itemForSale.c
@@ -6,10 +6,13 @@
*/
#include "object/itemForSale.h"
-#include "functions.h"
#include "hitbox.h"
-#include "kinstone.h"
#include "message.h"
+#include "scroll.h"
+#include "asm.h"
+#include "ui.h"
+#include "room.h"
+#include "player.h"
typedef struct {
u8 before[0x20];
diff --git a/src/object/itemOnGround.c b/src/object/itemOnGround.c
index 7d627de4..860f52a4 100644
--- a/src/object/itemOnGround.c
+++ b/src/object/itemOnGround.c
@@ -8,12 +8,16 @@
#include "collision.h"
#include "entity.h"
#include "flags.h"
-#include "functions.h"
+#include "scroll.h"
#include "hitbox.h"
#include "item.h"
#include "itemMetaData.h"
#include "object.h"
+#include "asm.h"
+#include "room.h"
+#include "physics.h"
#include "player.h"
+#include "script.h"
#include "sound.h"
#include "tiles.h"
@@ -51,7 +55,7 @@ void sub_080813D4(ItemOnGroundEntity* this);
void sub_080813E8(ItemOnGroundEntity* this);
void sub_080813F0(ItemOnGroundEntity* this);
bool32 CheckShouldPlayItemGetCutscene(ItemOnGroundEntity* this);
-void sub_08081404(ItemOnGroundEntity*, u32);
+void ItemOnGround_SetFlagAndDelete(ItemOnGroundEntity*, u32);
typedef struct {
u8 unk0[2];
@@ -107,7 +111,7 @@ void ItemOnGround_Init(ItemOnGroundEntity* this) {
sub_080810A8, sub_080810FC, sub_08081150, sub_08081134, sub_08081188, sub_080810A8,
sub_080810A8, sub_080811AC, sub_080811C8, sub_080811D8, sub_080810A8,
};
- if (this->unk_86 && CheckFlags(this->unk_86)) {
+ if (this->flag && CheckFlags(this->flag)) {
DeleteThisEntity();
}
@@ -257,7 +261,7 @@ void ItemOnGround_Action2(ItemOnGroundEntity* this) {
void sub_08081248(ItemOnGroundEntity* this) {
sub_08081500(this);
if (sub_080814C0(this)) {
- sub_08081404(this, 0);
+ ItemOnGround_SetFlagAndDelete(this, FALSE);
} else {
sub_0800442E(super);
}
@@ -270,7 +274,7 @@ void sub_0808126C(ItemOnGroundEntity* this) {
void sub_0808127C(ItemOnGroundEntity* this) {
if (sub_080814C0(this)) {
- sub_08081404(this, 0);
+ ItemOnGround_SetFlagAndDelete(this, FALSE);
} else {
sub_0808153C(this);
}
@@ -311,7 +315,7 @@ void nullsub_510(ItemOnGroundEntity* this) {
void ItemOnGround_Action3(ItemOnGroundEntity* this) {
Entity* other = super->child;
if (!(other->kind == PLAYER_ITEM && other->id == 3)) {
- sub_08081404(this, 0);
+ ItemOnGround_SetFlagAndDelete(this, FALSE);
} else {
CopyPosition(other, super);
super->z.HALF.HI--;
@@ -331,7 +335,7 @@ void ItemOnGround_Action4(ItemOnGroundEntity* this) {
super->spriteRendering.b3 = other->spriteRendering.b3;
GravityUpdate(super, Q_8_8(40.0));
} else {
- sub_08081404(this, 1);
+ ItemOnGround_SetFlagAndDelete(this, TRUE);
}
}
@@ -360,9 +364,9 @@ void sub_080813F0(ItemOnGroundEntity* this) {
}
}
-void sub_08081404(ItemOnGroundEntity* this, u32 arg1) {
- if (arg1 && this->unk_86) {
- SetFlag(this->unk_86);
+void ItemOnGround_SetFlagAndDelete(ItemOnGroundEntity* this, bool32 doSetFlag) {
+ if (doSetFlag && this->flag) {
+ SetFlag(this->flag);
}
DeleteThisEntity();
@@ -472,7 +476,7 @@ void sub_0808153C(ItemOnGroundEntity* this) {
void sub_08081598(ItemOnGroundEntity* this) {
if (super->health == 0) {
- sub_08081404(this, 1);
+ ItemOnGround_SetFlagAndDelete(this, 1);
}
COLLISION_OFF(super);
@@ -486,6 +490,6 @@ void sub_08081598(ItemOnGroundEntity* this) {
CopyPosition(super->child, super);
super->z.HALF.HI -= 4;
if (super->type != 0x5F && sub_08081420(this)) {
- sub_08081404(this, 1);
+ ItemOnGround_SetFlagAndDelete(this, 1);
}
}
diff --git a/src/object/jailBars.c b/src/object/jailBars.c
index b244af4e..8644a134 100644
--- a/src/object/jailBars.c
+++ b/src/object/jailBars.c
@@ -6,7 +6,7 @@
*/
#include "entity.h"
#include "flags.h"
-#include "functions.h"
+#include "beanstalkSubtask.h"
#include "room.h"
#include "sound.h"
#include "tiles.h"
@@ -14,7 +14,7 @@
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unused1[30];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} JailBarsEntity;
static void SetJailBarTiles(JailBarsEntity* this, u32);
@@ -34,7 +34,7 @@ void JailBars(JailBarsEntity* this) {
}
void JailBars_Init(JailBarsEntity* this) {
- if (CheckFlags(this->unk_86) == 0) {
+ if (CheckFlags(this->flag) == 0) {
super->action = 1;
SetJailBarTiles(this, 0);
} else {
@@ -48,7 +48,7 @@ void JailBars_Init(JailBarsEntity* this) {
}
void JailBars_Action1(JailBarsEntity* this) {
- if (CheckFlags(this->unk_86) != 0) {
+ if (CheckFlags(this->flag) != 0) {
super->action = 2;
SetJailBarTiles(this, 1);
SoundReq(SFX_10B);
diff --git a/src/object/japaneseSubtitle.c b/src/object/japaneseSubtitle.c
index 11e7f85f..5a14192e 100644
--- a/src/object/japaneseSubtitle.c
+++ b/src/object/japaneseSubtitle.c
@@ -4,9 +4,9 @@
*
* @brief Japanese Subtitle object
*/
-#include "entity.h"
#include "menu.h"
#include "object.h"
+#include "asm.h"
#include "physics.h"
extern void sub_0806FB00(Entity*, u32, u32, u32);
diff --git a/src/object/jarPortal.c b/src/object/jarPortal.c
index 99341c30..9741c9d8 100644
--- a/src/object/jarPortal.c
+++ b/src/object/jarPortal.c
@@ -5,9 +5,15 @@
* @brief Jar Portal object
*/
#include "area.h"
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "common.h"
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
+#include "player.h"
#include "tiles.h"
+#include "effects.h"
typedef struct {
/*0x00*/ Entity base;
@@ -134,7 +140,7 @@ void sub_0808C01C(JarPortalEntity* this, u32 r1) {
gArea.portal_mode = 3;
}
}
- CreateMagicSparkles(super->x.HALF.HI, super->y.HALF.HI, super->collisionLayer);
+ CreateMagicSparklesFxAt(super->x.HALF.HI, super->y.HALF.HI, super->collisionLayer);
if (super->subtimer == 0) {
super->subtimer = 1;
SoundReq(SFX_NEAR_PORTAL);
diff --git a/src/object/keyStealingTakkuri.c b/src/object/keyStealingTakkuri.c
index dfd35e6a..000bc605 100644
--- a/src/object/keyStealingTakkuri.c
+++ b/src/object/keyStealingTakkuri.c
@@ -4,8 +4,14 @@
*
* @brief Key Stealing Takkuri object
*/
-#include "functions.h"
+#include "script.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/kinstoneSpark.c b/src/object/kinstoneSpark.c
index b32609f2..7b359ee0 100644
--- a/src/object/kinstoneSpark.c
+++ b/src/object/kinstoneSpark.c
@@ -4,9 +4,12 @@
*
* @brief Kinstone Fusion Particle object
*/
-#include "functions.h"
+#include "script.h"
#include "kinstone.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "color.h"
void sub_080A0ADC(Entity*);
void sub_080A0AF0(Entity*);
diff --git a/src/object/ladderUp.c b/src/object/ladderUp.c
index 8dcd7e67..b64d56d2 100644
--- a/src/object/ladderUp.c
+++ b/src/object/ladderUp.c
@@ -7,7 +7,6 @@
#include "asm.h"
#include "effects.h"
#include "entity.h"
-#include "functions.h"
#include "player.h"
#include "room.h"
#include "sound.h"
diff --git a/src/object/lavaPlatform.c b/src/object/lavaPlatform.c
index 5e806494..9624b606 100644
--- a/src/object/lavaPlatform.c
+++ b/src/object/lavaPlatform.c
@@ -4,9 +4,14 @@
*
* @brief Lava Platform object
*/
-#include "functions.h"
#include "hitbox.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "effects.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/lightDoor.c b/src/object/lightDoor.c
index 3bb41e19..522084a0 100644
--- a/src/object/lightDoor.c
+++ b/src/object/lightDoor.c
@@ -4,15 +4,18 @@
*
* @brief Light Door object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "flags.h"
+#include "room.h"
+#include "physics.h"
#include "screen.h"
#include "tiles.h"
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unk_68[30];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} LightDoorEntity;
void LightDoor_Init(LightDoorEntity*);
@@ -31,7 +34,7 @@ void LightDoor(LightDoorEntity* this) {
void LightDoor_Init(LightDoorEntity* this) {
if (super->type == 0) {
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag)) {
DeleteThisEntity();
}
super->action = 1;
diff --git a/src/object/lightRay.c b/src/object/lightRay.c
index a48ffa53..1e4c53eb 100644
--- a/src/object/lightRay.c
+++ b/src/object/lightRay.c
@@ -4,9 +4,13 @@
*
* @brief Light Ray object
*/
-#include "functions.h"
#include "object.h"
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
+#include "player.h"
#include "screen.h"
+#include "fade.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/lightableSwitch.c b/src/object/lightableSwitch.c
index e8f22525..a8ed21cb 100644
--- a/src/object/lightableSwitch.c
+++ b/src/object/lightableSwitch.c
@@ -7,9 +7,9 @@
#include "asm.h"
#include "entity.h"
#include "flags.h"
-#include "functions.h"
#include "hitbox.h"
#include "object.h"
+#include "physics.h"
#include "room.h"
#include "sound.h"
#include "tiles.h"
@@ -19,8 +19,8 @@ typedef struct {
/*0x68*/ u8 unused1[12];
/*0x74*/ u16 unk_74;
/*0x76*/ u8 unused2[14];
- /*0x84*/ u16 unk_84;
- /*0x86*/ u16 unk_86;
+ /*0x84*/ u16 flag1;
+ /*0x86*/ u16 flag2;
} LightableSwitchEntity;
static void sub_0809EB30(LightableSwitchEntity* this);
@@ -69,10 +69,10 @@ void LightableSwitch_Type0_Init(LightableSwitchEntity* this) {
void LightableSwitch_Type0_Action1(LightableSwitchEntity* this) {
if ((super->contactFlags & CONTACT_NOW) != 0) {
- if (CheckFlags(this->unk_86) != 0) {
- ClearFlag(this->unk_86);
+ if (CheckFlags(this->flag2) != 0) {
+ ClearFlag(this->flag2);
} else {
- SetFlag(this->unk_86);
+ SetFlag(this->flag2);
}
EnqueueSFX(SFX_110);
}
@@ -82,7 +82,7 @@ void LightableSwitch_Type0_Action1(LightableSwitchEntity* this) {
static void sub_0809EABC(LightableSwitchEntity* this) {
bool32 anySet = 0;
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag2)) {
anySet = 1;
}
if (super->frameIndex != anySet) {
@@ -141,7 +141,7 @@ void LightableSwitch_Type1_Init(LightableSwitchEntity* this) {
super->hitbox = (Hitbox*)&gHitbox_0;
sub_0809EAD8(this);
UpdateSpriteForCollisionLayer(super);
- if (CheckFlags(this->unk_84)) {
+ if (CheckFlags(this->flag1)) {
super->action = 3;
super->frameIndex = 2;
}
@@ -152,21 +152,21 @@ void LightableSwitch_Type1_Action1(LightableSwitchEntity* this) {
super->action = 2;
super->timer = 16;
super->frameIndex = 2;
- SetFlag(this->unk_86);
+ SetFlag(this->flag2);
EnqueueSFX(SFX_110);
}
}
void LightableSwitch_Type1_Action2(LightableSwitchEntity* this) {
- if (CheckFlags(this->unk_84)) {
+ if (CheckFlags(this->flag1)) {
super->action = 3;
} else {
if (--super->timer == 0) {
super->action = 1;
super->frameIndex = 3;
- ClearFlag(this->unk_86);
+ ClearFlag(this->flag2);
EnqueueSFX(SFX_110);
}
}
diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c
index 03cca48a..fceb7d0c 100644
--- a/src/object/lilypadLarge.c
+++ b/src/object/lilypadLarge.c
@@ -6,12 +6,19 @@
*/
#include "object/lilypadLarge.h"
#include "area.h"
-#include "functions.h"
#include "item.h"
#include "object.h"
-#include "map.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "effects.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
+#include "scroll.h"
+extern u32 sub_080040A2(Entity*);
extern s8 gUnk_08126EE4[];
void LilypadLarge_Action1(LilypadLargeEntity*);
@@ -119,7 +126,7 @@ void LilypadLarge_Action1(LilypadLargeEntity* this) {
if (super->subtimer == 0) {
super->subtimer = 4;
while (super->subtimer != 0) {
- sub_080A2AF4(super, 8, 10);
+ CreateLargeRippleFxRandom(super, 8, 10);
super->subtimer--;
}
super->subtimer = 1;
@@ -194,7 +201,7 @@ void LilypadLarge_Action1(LilypadLargeEntity* this) {
}
if ((gRoomTransition.frameCount & 0xfU) == 0) {
- CreateLargeWaterTrace(super);
+ CreateLargeRippleFx(super);
}
sVar10 = super->x.WORD + this->unk_6c;
uVar4 = super->y.WORD + this->unk_70;
@@ -312,7 +319,7 @@ void LilypadLarge_Action1(LilypadLargeEntity* this) {
} else {
end:
if ((gRoomTransition.frameCount & 0x1fU) == 0) {
- sub_080A2AF4(super, 8, 10);
+ CreateLargeRippleFxRandom(super, 8, 10);
}
}
sub_08085F48(this);
@@ -403,7 +410,7 @@ void sub_08085B40(LilypadLargeEntity* this) {
super->action = 1;
super->subtimer = 4;
while (super->subtimer != 0) {
- sub_080A2AF4(super, 8, 10);
+ CreateLargeRippleFxRandom(super, 8, 10);
super->subtimer--;
}
super->subtimer = 1;
@@ -498,8 +505,8 @@ void sub_08085D60(LilypadLargeEntity* this) {
tmpY = gUnk_08120638[tmp + 1];
if (GetCollisionDataRelativeTo(super, tmpX, tmpY) == COLLISION_DATA_255) {
- if (sub_080806BC((super->x.HALF.HI - gRoomControls.origin_x) + tmpX,
- (super->y.HALF.HI - gRoomControls.origin_y) + tmpY, r4, 5) == 0) {
+ if (DoApplicableTransition((super->x.HALF.HI - gRoomControls.origin_x) + tmpX,
+ (super->y.HALF.HI - gRoomControls.origin_y) + tmpY, r4, 5) == 0) {
if (sub_0807BD14(&gPlayerEntity.base, r4 >> 3) != 0) {
super->direction = r4;
sub_08085E74(this);
diff --git a/src/object/lilypadLargeFalling.c b/src/object/lilypadLargeFalling.c
index d0b19b12..791f13dd 100644
--- a/src/object/lilypadLargeFalling.c
+++ b/src/object/lilypadLargeFalling.c
@@ -5,7 +5,6 @@
* @brief LilypadLargeFalling object
*/
#include "entity.h"
-#include "functions.h"
#include "object/lilypadLarge.h"
void LilypadLargeFalling(Entity* this) {
diff --git a/src/object/lilypadSmall.c b/src/object/lilypadSmall.c
index 2d92e4f0..12696e21 100644
--- a/src/object/lilypadSmall.c
+++ b/src/object/lilypadSmall.c
@@ -4,8 +4,10 @@
*
* @brief Lilypad Small object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "room.h"
+#include "player.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/linkAnimation.c b/src/object/linkAnimation.c
index 71e1a494..ec523d61 100644
--- a/src/object/linkAnimation.c
+++ b/src/object/linkAnimation.c
@@ -5,10 +5,13 @@
* @brief Link Animation object. This is used during "item get" sequences and
* replaces the player entity for the duration.
*/
-#include "functions.h"
#include "message.h"
#include "object.h"
+#include "physics.h"
+#include "player.h"
#include "object/linkAnimation.h"
+#include "item.h"
+#include "pauseMenu.h"
typedef enum {
ITEMGET_INIT,
diff --git a/src/object/linkEmptyingBottle.c b/src/object/linkEmptyingBottle.c
index 0b4200a7..93e35f16 100644
--- a/src/object/linkEmptyingBottle.c
+++ b/src/object/linkEmptyingBottle.c
@@ -5,9 +5,13 @@
* @brief Link Emptying Bottle object
* Handles effects of using water, mineral water or a fairy in a bottle in PlayerItemBottle_UseOther.
*/
-#include "functions.h"
#include "item.h"
#include "object.h"
+#include "asm.h"
+#include "effects.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
typedef struct {
diff --git a/src/object/linkFire.c b/src/object/linkFire.c
index 1a12c93f..b208398f 100644
--- a/src/object/linkFire.c
+++ b/src/object/linkFire.c
@@ -4,8 +4,9 @@
*
* @brief Link Fire object
*/
-#include "functions.h"
#include "object.h"
+#include "physics.h"
+#include "player.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/linkHoldingItem.c b/src/object/linkHoldingItem.c
index 6e5bedd2..c0920698 100644
--- a/src/object/linkHoldingItem.c
+++ b/src/object/linkHoldingItem.c
@@ -4,12 +4,14 @@
*
* @brief Link Holding Item object
*/
-#include "functions.h"
+#include "scroll.h"
#include "game.h"
#include "item.h"
#include "itemMetaData.h"
#include "message.h"
#include "object.h"
+#include "sound.h"
+#include "player.h"
#include "save.h"
typedef struct {
diff --git a/src/object/litArea.c b/src/object/litArea.c
index 53b34d1f..80332d9a 100644
--- a/src/object/litArea.c
+++ b/src/object/litArea.c
@@ -6,7 +6,6 @@
*/
#include "entity.h"
#include "flags.h"
-#include "functions.h"
#include "room.h"
#include "screen.h"
@@ -15,12 +14,12 @@ typedef struct {
/*0x68*/ u16 unk_68;
/*0x6a*/ u16 unk_6a;
/*0x6c*/ u8 unused1[26];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} LitAreaEntity;
void LitArea(LitAreaEntity* this) {
if (super->action == 0) {
- if (this->unk_86 != 0 && CheckFlags(this->unk_86) == 0) {
+ if (this->flag != 0 && CheckFlags(this->flag) == 0) {
return;
}
super->spriteSettings.draw = 1;
diff --git a/src/object/lockedDoor.c b/src/object/lockedDoor.c
index f4af4b0e..02b7614c 100644
--- a/src/object/lockedDoor.c
+++ b/src/object/lockedDoor.c
@@ -4,16 +4,20 @@
*
* @brief Looked Door object
*/
+#include "object/lockedDoor.h"
#include "asm.h"
-#include "common.h"
+#include "room.h"
#include "effects.h"
#include "entity.h"
#include "flags.h"
-#include "functions.h"
+#include "physics.h"
#include "game.h"
#include "hitbox.h"
#include "sound.h"
#include "tiles.h"
+#include "vram.h"
+#include "player.h"
+#include "color.h"
typedef struct {
/*0x00*/ Entity base;
@@ -25,8 +29,8 @@ typedef struct {
/*0x78*/ u8 unused2[6];
/*0x7e*/ u8 unk_7e;
/*0x7f*/ u8 unused3[5];
- /*0x84*/ u16 unk_84;
- /*0x86*/ u16 unk_86;
+ /*0x84*/ u16 flags;
+ /*0x86*/ u16 flag;
} LockedDoorEntity;
void LockedDoor_Init(LockedDoorEntity* this);
@@ -102,7 +106,7 @@ const u8 gLockedDoorInteractDirections[] = {
};
void LockedDoor_Init(LockedDoorEntity* this) {
- if (this->unk_84 != 0xFFFF && CheckFlags(this->unk_84)) {
+ if (this->flags != 0xFFFF && CheckFlags(this->flags)) {
DeleteThisEntity();
}
if (!sub_080837B0(this))
@@ -120,7 +124,7 @@ void LockedDoor_Init(LockedDoorEntity* this) {
this->unk_74 = GetTileIndex(this->unk_76, super->collisionLayer);
switch (super->type2) {
case 0:
- if (!CheckFlags(this->unk_86)) {
+ if (!CheckFlags(this->flag)) {
if (super->type & 0x10) {
super->action = 3;
} else {
@@ -132,14 +136,14 @@ void LockedDoor_Init(LockedDoorEntity* this) {
}
break;
case 1:
- if (!CheckFlags(this->unk_86)) {
+ if (!CheckFlags(this->flag)) {
sub_08083638(this);
} else {
sub_080836A0(this);
}
break;
case 2:
- if (!CheckFlags(this->unk_86)) {
+ if (!CheckFlags(this->flag)) {
super->frameIndex |= 4;
sub_080836DC(super, this->unk_7e, this->unk_76);
if (!AreaIsDungeon()) {
@@ -209,10 +213,10 @@ void LockedDoor_Action5(LockedDoorEntity* this) {
void LockedDoor_Action6(LockedDoorEntity* this) {
if (super->type2 == 0) {
- if (!CheckFlags(this->unk_86))
+ if (!CheckFlags(this->flag))
return;
} else {
- if (CheckFlags(this->unk_86))
+ if (CheckFlags(this->flag))
return;
}
sub_08083658(this);
@@ -220,22 +224,22 @@ void LockedDoor_Action6(LockedDoorEntity* this) {
void LockedDoor_Action7(LockedDoorEntity* this) {
if (super->type2 == 0) {
- if (CheckFlags(this->unk_86))
+ if (CheckFlags(this->flag))
return;
} else {
- if (!CheckFlags(this->unk_86))
+ if (!CheckFlags(this->flag))
return;
}
super->action = 3;
}
void LockedDoor_Action8(LockedDoorEntity* this) {
- if (super->interactType == INTERACTION_NONE && !CheckFlags(this->unk_86))
+ if (super->interactType == INTERACTION_NONE && !CheckFlags(this->flag))
return;
super->action = 1;
super->timer = 20;
sub_08083658(this);
- SetFlag(this->unk_86);
+ SetFlag(this->flag);
ModDungeonKeys(-1);
}
diff --git a/src/object/macroAcorn.c b/src/object/macroAcorn.c
index 76773942..0fb1ac7b 100644
--- a/src/object/macroAcorn.c
+++ b/src/object/macroAcorn.c
@@ -7,6 +7,8 @@
#include "entity.h"
#include "map.h"
#include "object.h"
+#include "asm.h"
+#include "room.h"
#include "physics.h"
#include "tiles.h"
diff --git a/src/object/macroBook.c b/src/object/macroBook.c
index 2b43af8b..2d14e0b5 100644
--- a/src/object/macroBook.c
+++ b/src/object/macroBook.c
@@ -7,9 +7,11 @@
#include "asm.h"
#include "entity.h"
#include "flags.h"
-#include "functions.h"
+#include "player.h"
#include "npc.h"
#include "tiles.h"
+#include "room.h"
+#include "map.h"
typedef struct {
Entity base;
diff --git a/src/object/macroDecorations.c b/src/object/macroDecorations.c
index 457dce52..9e124c33 100644
--- a/src/object/macroDecorations.c
+++ b/src/object/macroDecorations.c
@@ -9,6 +9,7 @@
#include "map.h"
#include "room.h"
#include "tiles.h"
+#include "color.h"
typedef struct {
Entity base;
diff --git a/src/object/macroMushroomStalk.c b/src/object/macroMushroomStalk.c
index 45eb8fe0..a8c544fb 100644
--- a/src/object/macroMushroomStalk.c
+++ b/src/object/macroMushroomStalk.c
@@ -5,10 +5,11 @@
* @brief Macro Mushroom Stalk object
*/
#include "area.h"
-#include "entity.h"
#include "main.h"
#include "object.h"
+#include "room.h"
#include "sound.h"
+#include "beanstalkSubtask.h"
void MacroMushroomStalk_Init(Entity*);
void MacroMushroomStalk_Action1(Entity*);
diff --git a/src/object/macroPlayer.c b/src/object/macroPlayer.c
index a313729b..270e648f 100644
--- a/src/object/macroPlayer.c
+++ b/src/object/macroPlayer.c
@@ -8,8 +8,11 @@
#include "entity.h"
#include "functions.h"
#include "object.h"
+#include "asm.h"
#include "physics.h"
#include "player.h"
+#include "beanstalkSubtask.h"
+#include "color.h"
typedef struct {
Entity base;
diff --git a/src/object/mask.c b/src/object/mask.c
index 9246fda1..0c961656 100644
--- a/src/object/mask.c
+++ b/src/object/mask.c
@@ -4,9 +4,16 @@
*
* @brief Mask object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "effects.h"
+#include "room.h"
+#include "player.h"
#include "tiles.h"
+#include "item.h"
+#include "map.h"
typedef struct {
/*0x00*/ Entity base;
@@ -16,7 +23,7 @@ typedef struct {
/*0x7c*/ u16 unk_7c;
/*0x7e*/ u16 unk_7e;
/*0x80*/ u8 unused2[6];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} MaskEntity;
void Mask_Init(MaskEntity* this);
@@ -36,7 +43,7 @@ void Mask(MaskEntity* this) {
void Mask_Init(MaskEntity* this) {
if (super->type2 & 0xC0) {
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag)) {
s32 field_0x0a;
switch (super->type2 & 0xC0) {
@@ -49,7 +56,7 @@ void Mask_Init(MaskEntity* this) {
DeleteThisEntity();
break;
default:
- ClearFlag(this->unk_86);
+ ClearFlag(this->flag);
}
break;
@@ -122,7 +129,7 @@ void Mask_Action2(MaskEntity* this) {
case 0x80:
EnqueueSFX(SFX_SECRET);
case 0x40:
- SetFlag(this->unk_86);
+ SetFlag(this->flag);
break;
}
diff --git a/src/object/mazaalBossObject.c b/src/object/mazaalBossObject.c
index 9fc03361..f668bb52 100644
--- a/src/object/mazaalBossObject.c
+++ b/src/object/mazaalBossObject.c
@@ -5,14 +5,17 @@
* @brief Mazaal Boss object
*/
#include "enemy.h"
-#include "entity.h"
-#include "functions.h"
+#include "sound.h"
+#include "effects.h"
+#include "flags.h"
#include "item.h"
#include "object.h"
+#include "physics.h"
#include "player.h"
#include "room.h"
#include "screen.h"
-#include "sound.h"
+#include "scroll.h"
+#include "script.h"
extern u16 script_MazaalBossObjectMazaal[];
diff --git a/src/object/metalDoor.c b/src/object/metalDoor.c
index 95f7f9a1..3281ff53 100644
--- a/src/object/metalDoor.c
+++ b/src/object/metalDoor.c
@@ -4,11 +4,12 @@
*
* @brief Metal Door object
*/
+#include "object/lockedDoor.h"
#include "asm.h"
#include "effects.h"
#include "entity.h"
#include "flags.h"
-#include "functions.h"
+#include "physics.h"
#include "hitbox.h"
#include "room.h"
#include "sound.h"
@@ -24,11 +25,10 @@ typedef struct {
/*0x78*/ u16 unk_78;
/*0x7a*/ u16 unk_7a;
/*0x7c*/ u8 unused2[8];
- /*0x84*/ u16 unk_84;
- /*0x86*/ u16 unk_86;
+ /*0x84*/ u16 flag1;
+ /*0x86*/ u16 flag2;
} MetalDoorEntity;
-extern u32 sub_08083734(Entity*, u32);
void sub_080A080C(MetalDoorEntity* this);
void sub_080A0870(MetalDoorEntity* this);
void MetalDoor_Init(MetalDoorEntity* this);
@@ -45,7 +45,7 @@ void MetalDoor(MetalDoorEntity* this) {
}
void MetalDoor_Init(MetalDoorEntity* this) {
- if ((this->unk_84 != 0xffff) && CheckFlags(this->unk_84)) {
+ if ((this->flag1 != 0xffff) && CheckFlags(this->flag1)) {
DeleteThisEntity();
}
super->action = 1;
@@ -97,7 +97,7 @@ void MetalDoor_Action2(MetalDoorEntity* this) {
}
void MetalDoor_Action3(MetalDoorEntity* this) {
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag2)) {
super->action = 4;
super->timer = 12;
super->direction = 0x10;
diff --git a/src/object/minecart.c b/src/object/minecart.c
index 6d101de6..207fa4dd 100644
--- a/src/object/minecart.c
+++ b/src/object/minecart.c
@@ -4,9 +4,14 @@
*
* @brief Minecart object
*/
-#include "functions.h"
+#include "collision.h"
#include "hitbox.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
typedef struct {
diff --git a/src/object/minecartDoor.c b/src/object/minecartDoor.c
index 37667af6..274b34db 100644
--- a/src/object/minecartDoor.c
+++ b/src/object/minecartDoor.c
@@ -4,8 +4,14 @@
*
* @brief Minecart Door object
*/
-#include "functions.h"
+#include "object/lockedDoor.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
typedef struct {
@@ -18,7 +24,7 @@ typedef struct {
/*0x78*/ u8 unk_78[0x6];
/*0x7e*/ u8 unk_7e;
/*0x7f*/ u8 unk_7f[0x7];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} MinecartDoorEntity;
extern bool32 sub_080837B0(Entity*); // lockedDoor
@@ -95,7 +101,7 @@ void MinecartDoor_Action2(MinecartDoorEntity* this) {
void MinecartDoor_Action3(MinecartDoorEntity* this) {
bool32 bVar3;
- if ((this->unk_7e != 0) && (CheckFlags(this->unk_86))) {
+ if ((this->unk_7e != 0) && CheckFlags(this->flag)) {
return;
}
if ((gPlayerState.flags & PL_IN_MINECART) != 0) {
@@ -128,7 +134,7 @@ void MinecartDoor_Action4(MinecartDoorEntity* this) {
}
bool32 sub_08096CEC(MinecartDoorEntity* this) {
- if (this->unk_7e != 0 && CheckFlags(this->unk_86)) {
+ if (this->unk_7e != 0 && CheckFlags(this->flag)) {
return TRUE;
} else {
if ((gPlayerState.flags & PL_IN_MINECART) != 0) {
diff --git a/src/object/mineralWaterSource.c b/src/object/mineralWaterSource.c
index 3692821b..dd602e0d 100644
--- a/src/object/mineralWaterSource.c
+++ b/src/object/mineralWaterSource.c
@@ -5,6 +5,8 @@
* @brief Mineral Water Source object
*/
#include "object.h"
+#include "asm.h"
+#include "physics.h"
void MineralWaterSource_Init(Entity*);
void MineralWaterSource_Action1(Entity*);
diff --git a/src/object/minishEmoticon.c b/src/object/minishEmoticon.c
index 147ca51d..40cb3a78 100644
--- a/src/object/minishEmoticon.c
+++ b/src/object/minishEmoticon.c
@@ -5,7 +5,8 @@
* @brief Minish Emoticon object
*/
#include "entity.h"
-#include "functions.h"
+#include "vram.h"
+#include "player.h"
void MinishEmoticon_Init(Entity*);
void MinishEmoticon_Action1(Entity*);
diff --git a/src/object/minishPortalCloseup.c b/src/object/minishPortalCloseup.c
index e9ded723..33308043 100644
--- a/src/object/minishPortalCloseup.c
+++ b/src/object/minishPortalCloseup.c
@@ -5,11 +5,12 @@
* @brief Minish Portal Closeup object
*/
#include "area.h"
-#include "functions.h"
#include "main.h"
#include "object.h"
+#include "common.h"
+#include "room.h"
#include "screen.h"
-#include "structures.h"
+#include "fade.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/minishPortalStone.c b/src/object/minishPortalStone.c
index 929f65ac..b8e7a960 100644
--- a/src/object/minishPortalStone.c
+++ b/src/object/minishPortalStone.c
@@ -4,14 +4,22 @@
*
* @brief Minish Portal Stone object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
+#include "player.h"
#include "screen.h"
+#include "beanstalkSubtask.h"
+#include "manager/lightManager.h"
+#include "effects.h"
+#include "pauseMenu.h"
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unk_68[0x1e];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} MinishPortalStoneEntity;
void MinishPortalStone_Init(MinishPortalStoneEntity* this);
@@ -37,17 +45,17 @@ void MinishPortalStone_Init(MinishPortalStoneEntity* this) {
super->action = 1;
super->spritePriority.b0 = 7;
super->hitbox = (Hitbox*)&gUnk_08123328;
- if ((this->unk_86 == 0xffff) || (CheckFlags(this->unk_86))) {
+ if ((this->flag == 0xffff) || CheckFlags(this->flag)) {
super->spriteSettings.draw = 1;
super->action = 4;
sub_08097CFC(this);
} else {
- sub_0805BC4C();
+ UnDarkRoom();
}
}
void MinishPortalStone_Action1(MinishPortalStoneEntity* this) {
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag)) {
SetPlayerControl(CONTROL_1);
gPauseMenuOptions.disabled = 1;
RequestPriorityDuration(super, 30);
@@ -67,7 +75,7 @@ void MinishPortalStone_Action3(MinishPortalStoneEntity* this) {
u32 tmp;
SetPriorityTimer(30);
sub_0800445C(super);
- CreateMagicSparkles(super->x.HALF.HI, super->y.HALF.HI, super->collisionLayer);
+ CreateMagicSparklesFxAt(super->x.HALF.HI, super->y.HALF.HI, super->collisionLayer);
if (--super->timer == 0) {
super->timer = 8;
tmp = ++super->subtimer;
diff --git a/src/object/minishSizedEntrance.c b/src/object/minishSizedEntrance.c
index cbe61fc8..b7819429 100644
--- a/src/object/minishSizedEntrance.c
+++ b/src/object/minishSizedEntrance.c
@@ -4,9 +4,12 @@
*
* @brief MinishSizedEntrance object
*/
-#include "functions.h"
#include "game.h"
#include "object.h"
+#include "asm.h"
+#include "room.h"
+#include "player.h"
+#include "vram.h"
void MinishSizedEntrance_Action1(Entity*);
void MinishSizedEntrance_Init(Entity*);
diff --git a/src/object/minishVillageObject.c b/src/object/minishVillageObject.c
index b7d09356..9c3330a7 100644
--- a/src/object/minishVillageObject.c
+++ b/src/object/minishVillageObject.c
@@ -4,10 +4,16 @@
*
* @brief Minish Village Object object
*/
-#include "functions.h"
+#include "script.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
#include "screen.h"
#include "tiles.h"
+#include "color.h"
+#include "map.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/moleMittsParticle.c b/src/object/moleMittsParticle.c
index f83472bc..a124887a 100644
--- a/src/object/moleMittsParticle.c
+++ b/src/object/moleMittsParticle.c
@@ -5,8 +5,11 @@
* @brief Mole Mitts Particle object
*/
#include "area.h"
-#include "functions.h"
#include "object.h"
+#include "room.h"
+#include "player.h"
+#include "item.h"
+#include "color.h"
void MoleMittsParticle_Init(Entity*);
void MoleMittsParticle_Action1(Entity*);
diff --git a/src/object/object1F.c b/src/object/object1F.c
index 444f616a..bbe7e166 100644
--- a/src/object/object1F.c
+++ b/src/object/object1F.c
@@ -4,10 +4,10 @@
*
* @brief Object1F object
*/
+#include "object.h"
#include "asm.h"
#include "effects.h"
-#include "entity.h"
-#include "functions.h"
+#include "physics.h"
#include "player.h"
#include "tiles.h"
diff --git a/src/object/object30.c b/src/object/object30.c
index 3f31e5e3..fc145a17 100644
--- a/src/object/object30.c
+++ b/src/object/object30.c
@@ -5,9 +5,11 @@
* @brief Object30 object
*/
#include "collision.h"
-#include "functions.h"
#include "item.h"
#include "object.h"
+#include "asm.h"
+#include "scroll.h"
+#include "map.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/object37.c b/src/object/object37.c
index 35f32e93..c6f87a1a 100644
--- a/src/object/object37.c
+++ b/src/object/object37.c
@@ -4,10 +4,12 @@
*
* @brief Object37 object
*/
-#include "entity.h"
-#include "functions.h"
+#include "object.h"
+#include "asm.h"
+#include "player.h"
#include "item.h"
#include "save.h"
+#include "map.h"
typedef struct {
Entity base;
diff --git a/src/object/object53.c b/src/object/object53.c
index 737c8967..94cc73cd 100644
--- a/src/object/object53.c
+++ b/src/object/object53.c
@@ -4,9 +4,9 @@
*
* @brief Object53 object
*/
+#include "object.h"
#include "asm.h"
-#include "entity.h"
-#include "functions.h"
+#include "effects.h"
void Object53_Init(Entity*);
void Object53_Action1(Entity*);
diff --git a/src/object/object63.c b/src/object/object63.c
index bbf74160..8557fb2f 100644
--- a/src/object/object63.c
+++ b/src/object/object63.c
@@ -4,10 +4,9 @@
*
* @brief Object63 object
*/
-#include "asm.h"
-#include "entity.h"
-#include "functions.h"
#include "object.h"
+#include "physics.h"
+#include "item.h"
void Object63_Init(Entity*);
void Object63_Action1(Entity*);
diff --git a/src/object/object70.c b/src/object/object70.c
index 605e074b..5064feb1 100644
--- a/src/object/object70.c
+++ b/src/object/object70.c
@@ -4,8 +4,10 @@
*
* @brief Object70 object
*/
-#include "functions.h"
+#include "asm.h"
#include "object.h"
+#include "effects.h"
+#include "player.h"
void Object70_Init(Entity*);
void Object70_Action1(Entity*);
diff --git a/src/object/objectA.c b/src/object/objectA.c
index ac45f99f..c0af01b5 100644
--- a/src/object/objectA.c
+++ b/src/object/objectA.c
@@ -6,11 +6,12 @@
*/
#include "entity.h"
#include "flags.h"
-#include "functions.h"
#include "game.h"
#include "hitbox.h"
#include "object.h"
+#include "effects.h"
#include "room.h"
+#include "player.h"
#include "tiles.h"
typedef struct {
@@ -18,7 +19,7 @@ typedef struct {
/*0x68*/ u8 unused1[8];
/*0x70*/ u16 unk_70;
/*0x72*/ u8 unused2[20];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} ObjectAEntity;
extern u8 gUpdateVisibleTiles;
@@ -35,7 +36,7 @@ void ObjectA(ObjectAEntity* this) {
uVar2 = TILE_TYPE_52;
}
this->unk_70 = uVar2;
- if (CheckFlags(this->unk_86) != 0) {
+ if (CheckFlags(this->flag) != 0) {
SetTileType(this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
if ((gRoomControls.reload_flags & 1) != 0) {
gUpdateVisibleTiles = 0;
@@ -46,8 +47,8 @@ void ObjectA(ObjectAEntity* this) {
}
} else if (super->interactType != INTERACTION_NONE) {
SetTileType(this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
- SetFlag(this->unk_86);
- CreateDust(super);
+ SetFlag(this->flag);
+ CreateDeathFx(super);
ModDungeonKeys(-1);
DeleteThisEntity();
}
diff --git a/src/object/objectA2.c b/src/object/objectA2.c
index d73db1f5..39372890 100644
--- a/src/object/objectA2.c
+++ b/src/object/objectA2.c
@@ -4,10 +4,16 @@
*
* @brief Object A2 object
*/
-#include "functions.h"
#include "menu.h"
#include "object.h"
-#include "structures.h"
+#include "asm.h"
+#include "sound.h"
+#include "effects.h"
+#include "physics.h"
+#include "color.h"
+#ifndef EU
+#include "save.h"
+#endif
void ObjectA2_Init(Entity*);
void ObjectA2_Action1(Entity*);
diff --git a/src/object/objectA8.c b/src/object/objectA8.c
index c5e95687..b1c68fb1 100644
--- a/src/object/objectA8.c
+++ b/src/object/objectA8.c
@@ -5,10 +5,15 @@
* @brief ObjectA8 object
*/
#include "collision.h"
-#include "functions.h"
#include "hitbox.h"
#include "item.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "scroll.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
typedef struct {
/*0x00*/ Entity base;
@@ -32,7 +37,7 @@ void ObjectA8_Action2Subaction0(ObjectA8Entity*);
void ObjectA8_Action2Subaction1(ObjectA8Entity*);
void ObjectA8_Action2Subaction2(ObjectA8Entity*);
-extern void sub_08081404(Entity*, u32);
+extern void ItemOnGround_SetFlagAndDelete(Entity*, u32);
void ObjectA8(ObjectA8Entity* this) {
static void (*const ObjectA8_Actions[])(ObjectA8Entity*) = {
@@ -160,7 +165,7 @@ void ObjectA8_Action3(ObjectA8Entity* this) {
ProcessMovement1(super);
if ((AnyPrioritySet() == 0) && (super->type == 0)) {
if (((gRoomTransition.frameCount & 1) != 0) && (--super->timer == 0)) {
- sub_08081404(super, 0);
+ ItemOnGround_SetFlagAndDelete(super, FALSE);
}
if (super->timer < 0x3c) {
super->spriteSettings.draw ^= 1;
@@ -170,7 +175,7 @@ void ObjectA8_Action3(ObjectA8Entity* this) {
void ObjectA8_Action4(ObjectA8Entity* this) {
if (*(u16*)&super->child->kind != 0xb08) {
- sub_08081404(super, 0);
+ ItemOnGround_SetFlagAndDelete(super, FALSE);
} else {
CopyPosition(super->child, super);
super->z.HALF.HI--;
@@ -217,7 +222,7 @@ void ObjectA8_Action6(ObjectA8Entity* this) {
if (--super->subtimer == 0) {
super->subtimer = 6;
if (--super->spriteOffsetY < -0x16) {
- sub_08081404(super, 1);
+ ItemOnGround_SetFlagAndDelete(super, TRUE);
}
}
if (super->spriteOffsetY < -0x11) {
diff --git a/src/object/objectBlockingStairs.c b/src/object/objectBlockingStairs.c
index 76ff017f..014485da 100644
--- a/src/object/objectBlockingStairs.c
+++ b/src/object/objectBlockingStairs.c
@@ -8,8 +8,10 @@
#include "effects.h"
#include "entity.h"
#include "flags.h"
-#include "functions.h"
#include "object.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "sound.h"
#include "tiles.h"
diff --git a/src/object/objectOnPillar.c b/src/object/objectOnPillar.c
index f48d7bcd..3d7b8c56 100644
--- a/src/object/objectOnPillar.c
+++ b/src/object/objectOnPillar.c
@@ -4,9 +4,15 @@
*
* @brief Object on Pillar object
*/
-#include "functions.h"
#include "hitbox.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "effects.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
typedef struct {
diff --git a/src/object/objectOnSpinyBeetle.c b/src/object/objectOnSpinyBeetle.c
index 52c575ca..20db5ff0 100644
--- a/src/object/objectOnSpinyBeetle.c
+++ b/src/object/objectOnSpinyBeetle.c
@@ -4,8 +4,11 @@
*
* @brief Object on Spiny Beetle object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "effects.h"
+#include "physics.h"
+#include "player.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/octorokBossObject.c b/src/object/octorokBossObject.c
index ed704166..503403d2 100644
--- a/src/object/octorokBossObject.c
+++ b/src/object/octorokBossObject.c
@@ -4,9 +4,13 @@
*
* @brief Octorok Boss Object object
*/
-#include "functions.h"
#include "game.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
typedef struct HelperStruct {
u8 field_0x0; // [0,1,2,4] is later stored in super->subtimer
diff --git a/src/object/palaceArchway.c b/src/object/palaceArchway.c
index bcf23fb2..4d48b1db 100644
--- a/src/object/palaceArchway.c
+++ b/src/object/palaceArchway.c
@@ -5,6 +5,8 @@
* @brief Palace Archway object
*/
#include "object.h"
+#include "asm.h"
+#include "room.h"
#include "tiles.h"
void PalaceArchway_Init(Entity*);
diff --git a/src/object/paper.c b/src/object/paper.c
index eb2af45d..05529683 100644
--- a/src/object/paper.c
+++ b/src/object/paper.c
@@ -4,9 +4,11 @@
*
* @brief Paper object
*/
-#include "functions.h"
#include "map.h"
#include "object.h"
+#include "asm.h"
+#include "room.h"
+#include "player.h"
#include "tiles.h"
void Paper_Init(Entity*);
diff --git a/src/object/pinwheel.c b/src/object/pinwheel.c
index 35d161a8..dc69967e 100644
--- a/src/object/pinwheel.c
+++ b/src/object/pinwheel.c
@@ -7,13 +7,14 @@
#include "entity.h"
#include "flags.h"
#include "object.h"
+#include "effects.h"
typedef struct {
/*0x00*/ Entity base;
- /*0x68*/ u16 unk_68;
+ /*0x68*/ u16 flag;
} PinwheelEntity;
-static const u16 gUnk_08125050[] = {
+static const u16 gPinwheelFlags[] = {
KUMOUE_02_AWASE_01, KUMOUE_02_AWASE_02, KUMOUE_02_AWASE_03, KUMOUE_02_AWASE_04, KUMOUE_02_AWASE_05, BEGIN_1,
};
extern u32 gUnk_020342F8;
@@ -38,9 +39,9 @@ void Pinwheel(PinwheelEntity* this) {
}
void Pinwheel_Init(PinwheelEntity* this) {
- this->unk_68 = gUnk_08125050[super->type2];
+ this->flag = gPinwheelFlags[super->type2];
super->spritePriority.b0 = 7;
- if (CheckLocalFlag(this->unk_68) != 0) {
+ if (CheckLocalFlag(this->flag) != 0) {
super->action = 2;
} else {
super->action = 1;
@@ -49,9 +50,9 @@ void Pinwheel_Init(PinwheelEntity* this) {
}
void Pinwheel_Action1(PinwheelEntity* this) {
- if (CheckLocalFlag(this->unk_68) != 0) {
+ if (CheckLocalFlag(this->flag) != 0) {
super->action = 2;
- CreateDust(super);
+ CreateDeathFx(super);
}
}
void Pinwheel_Action2(PinwheelEntity* this) {
diff --git a/src/object/playerClone.c b/src/object/playerClone.c
index 174b7a1d..f606108c 100644
--- a/src/object/playerClone.c
+++ b/src/object/playerClone.c
@@ -8,7 +8,7 @@
#include "collision.h"
#include "effects.h"
#include "entity.h"
-#include "functions.h"
+#include "physics.h"
#include "player.h"
#include "room.h"
#include "sound.h"
diff --git a/src/object/pot.c b/src/object/pot.c
index adfcb75d..758c6b92 100644
--- a/src/object/pot.c
+++ b/src/object/pot.c
@@ -6,12 +6,16 @@
*/
#include "entity.h"
#include "flags.h"
-#include "functions.h"
+#include "object/pot.h"
#include "hitbox.h"
#include "object.h"
+#include "asm.h"
+#include "effects.h"
+#include "physics.h"
#include "object/itemOnGround.h"
#include "player.h"
#include "room.h"
+#include "script.h"
#include "sound.h"
#include "tiles.h"
@@ -22,7 +26,7 @@ typedef struct {
/*0x72*/ u8 unused2[11];
/*0x7d*/ u8 unk_7d;
/*0x7e*/ u8 unused3[8];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} PotEntity;
void Pot_Action5(PotEntity*);
@@ -60,7 +64,7 @@ void Pot(PotEntity* this) {
}
void Pot_Init(PotEntity* this) {
- if (super->type2 == 1 && CheckFlags(this->unk_86)) {
+ if (super->type2 == 1 && CheckFlags(this->flag)) {
DeleteThisEntity();
}
@@ -306,7 +310,7 @@ static void BreakPot(PotEntity* this, Entity* parent) {
}
if (super->type2 == 1) {
- SetFlag(this->unk_86);
+ SetFlag(this->flag);
}
DeleteThisEntity();
@@ -327,7 +331,7 @@ u32 sub_0808288C(Entity* this, u32 form, u32 arg2, u32 arg3) {
if (entity != NULL) {
if (arg3 == 2) {
entity->base.timer = 5;
- entity->unk_86 = ((PotEntity*)this)->unk_86; // This function is also used by flyingSkull.
+ entity->flag = ((PotEntity*)this)->flag; // This function is also used by flyingSkull.
} else {
entity->base.timer = 0;
}
diff --git a/src/object/pressurePlate.c b/src/object/pressurePlate.c
index df373091..68c17a1d 100644
--- a/src/object/pressurePlate.c
+++ b/src/object/pressurePlate.c
@@ -5,9 +5,12 @@
* @brief Pressure Plate object
*/
#include "collision.h"
-#include "functions.h"
#include "hitbox.h"
#include "object.h"
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
+#include "player.h"
typedef struct {
Entity base;
diff --git a/src/object/pullableLever.c b/src/object/pullableLever.c
index c8f9b086..f986123c 100644
--- a/src/object/pullableLever.c
+++ b/src/object/pullableLever.c
@@ -4,9 +4,12 @@
*
* @brief Pullable Lever object
*/
-#include "functions.h"
#include "hitbox.h"
#include "object.h"
+#include "asm.h"
+#include "flags.h"
+#include "physics.h"
+#include "player.h"
#include "sound.h"
typedef struct {
diff --git a/src/object/pullableMushroom.c b/src/object/pullableMushroom.c
index 44d17deb..bd674d2c 100644
--- a/src/object/pullableMushroom.c
+++ b/src/object/pullableMushroom.c
@@ -4,11 +4,16 @@
*
* @brief Pullable Mushroom object
*/
-#include "functions.h"
#include "game.h"
#include "hitbox.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
+#include "color.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/pushableFurniture.c b/src/object/pushableFurniture.c
index 4a0dfda7..f869c62d 100644
--- a/src/object/pushableFurniture.c
+++ b/src/object/pushableFurniture.c
@@ -6,8 +6,14 @@
*/
#include "object/pushableFurniture.h"
-#include "functions.h"
#include "tiles.h"
+#include "flags.h"
+#include "sound.h"
+#include "asm.h"
+#include "room.h"
+#include "player.h"
+#include "physics.h"
+#include "map.h"
extern const s16 gUnk_080B4488[];
@@ -73,7 +79,7 @@ void PushableFurniture_Init(PushableFurnitureEntity* this) {
this->unk_7e = (s8)super->subtimer + super->x.HALF_U.HI;
}
if (super->parent == NULL) {
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag)) {
condition++;
}
} else {
@@ -228,7 +234,7 @@ bool32 sub_0808FC5C(PushableFurnitureEntity* this) {
this->unk_81 = 1;
if (super->parent == NULL) {
- SetFlag((u32)this->unk_86);
+ SetFlag((u32)this->flag);
} else {
if ((this->unk_82 & 0x80) != 0) {
puVar5 = super->parent->spriteAnimation + 2;
diff --git a/src/object/pushableGrave.c b/src/object/pushableGrave.c
index 4ba81982..e059b866 100644
--- a/src/object/pushableGrave.c
+++ b/src/object/pushableGrave.c
@@ -4,9 +4,15 @@
*
* @brief Pushable Grave object
*/
-#include "functions.h"
+#include "beanstalkSubtask.h"
#include "hitbox.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
typedef struct {
diff --git a/src/object/pushableLever.c b/src/object/pushableLever.c
index 592a51e2..fb523054 100644
--- a/src/object/pushableLever.c
+++ b/src/object/pushableLever.c
@@ -4,8 +4,12 @@
*
* @brief Pushable Lever object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
+#include "player.h"
#include "tiles.h"
typedef struct {
diff --git a/src/object/pushableRock.c b/src/object/pushableRock.c
index f58afa79..f2401fab 100644
--- a/src/object/pushableRock.c
+++ b/src/object/pushableRock.c
@@ -4,8 +4,12 @@
*
* @brief Pushable Rock object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
+#include "physics.h"
#include "tiles.h"
typedef struct {
diff --git a/src/object/pushableStatue.c b/src/object/pushableStatue.c
index 35fbb3bd..bda7a547 100644
--- a/src/object/pushableStatue.c
+++ b/src/object/pushableStatue.c
@@ -5,10 +5,16 @@
* @brief Pushable Statue object
*/
#include "area.h"
-#include "functions.h"
#include "hitbox.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "effects.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
#include "tiles.h"
+#include "vram.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/railtrack.c b/src/object/railtrack.c
index f5ceab8d..3639f929 100644
--- a/src/object/railtrack.c
+++ b/src/object/railtrack.c
@@ -7,10 +7,10 @@
#include "asm.h"
#include "entity.h"
#include "flags.h"
-#include "functions.h"
#include "room.h"
#include "sound.h"
#include "tiles.h"
+#include "map.h"
typedef struct {
/*0x00*/ Entity base;
@@ -19,10 +19,10 @@ typedef struct {
/*0x74*/ u16 unk_74;
/*0x76*/ u16 unk_76;
/*0x78*/ u16 unk_78;
- /*0x7a*/ u16 unk_7a;
+ /*0x7a*/ u16 flagValue;
/*0x7c*/ union SplitHWord unk_7c;
/*0x7e*/ u8 unused2[8];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} RailtrackEntity;
void sub_08085394(RailtrackEntity* this);
@@ -58,8 +58,8 @@ void Railtrack_Init(RailtrackEntity* this) {
}
super->animationState = super->type2 & 2;
if (super->type == 3) {
- uVar1 = CheckFlags(this->unk_86);
- this->unk_7a = uVar1;
+ uVar1 = CheckFlags(this->flag);
+ this->flagValue = uVar1;
if ((u16)(uVar1 & -1) != 0) {
super->animationState = (super->animationState + 2) & 3;
super->action = 3;
@@ -71,11 +71,11 @@ void Railtrack_Init(RailtrackEntity* this) {
}
void Railtrack_Action1(RailtrackEntity* this) {
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag)) {
super->action = 2;
super->subtimer = 8;
if (super->type == 1) {
- ClearFlag(this->unk_86);
+ ClearFlag(this->flag);
}
super->animationState = (super->animationState + this->unk_7c.HALF.LO) & 3;
InitializeAnimation(super, super->animationState);
@@ -88,7 +88,7 @@ void Railtrack_Action2(RailtrackEntity* this) {
if (--super->subtimer == 0) {
super->action = 3;
super->subtimer = super->timer;
- this->unk_7a = CheckFlags(this->unk_86);
+ this->flagValue = CheckFlags(this->flag);
super->animationState = (super->animationState + this->unk_7c.HALF.LO) & 3;
InitializeAnimation(super, super->animationState);
sub_08085394(this);
@@ -103,13 +103,13 @@ void Railtrack_Action3(RailtrackEntity* this) {
case 1:
break;
case 2:
- if (CheckFlags(this->unk_86) == 0) {
+ if (CheckFlags(this->flag) == 0) {
super->action = 1;
return;
}
break;
case 3:
- if (CheckFlags(this->unk_86) == this->unk_7a) {
+ if (CheckFlags(this->flag) == this->flagValue) {
super->subtimer = 255;
} else {
super->subtimer = 1;
diff --git a/src/object/rotatingTrapdoor.c b/src/object/rotatingTrapdoor.c
index 3351b1d7..b6b5f587 100644
--- a/src/object/rotatingTrapdoor.c
+++ b/src/object/rotatingTrapdoor.c
@@ -6,7 +6,7 @@
*/
#include "asm.h"
#include "entity.h"
-#include "functions.h"
+#include "player.h"
#include "room.h"
#include "sound.h"
diff --git a/src/object/rupee.c b/src/object/rupee.c
index 49ff7835..22059aed 100644
--- a/src/object/rupee.c
+++ b/src/object/rupee.c
@@ -4,9 +4,10 @@
*
* @brief Rupee object
*/
-#include "functions.h"
#include "hitbox.h"
#include "object.h"
+#include "asm.h"
+#include "physics.h"
void sub_08086A6C(Entity*);
void Rupee_Init(Entity*);
diff --git a/src/object/shrinkingHieroglyphs.c b/src/object/shrinkingHieroglyphs.c
index c490b834..d8b34eea 100644
--- a/src/object/shrinkingHieroglyphs.c
+++ b/src/object/shrinkingHieroglyphs.c
@@ -5,9 +5,10 @@
* @brief Shrinking Hieroglyphs object
*/
#include "entity.h"
-#include "functions.h"
#include "player.h"
#include "sound.h"
+#include "vram.h"
+#include "physics.h"
typedef struct {
Entity base;
diff --git a/src/object/smallIceBlock.c b/src/object/smallIceBlock.c
index 8aab1f91..dfde7891 100644
--- a/src/object/smallIceBlock.c
+++ b/src/object/smallIceBlock.c
@@ -9,6 +9,12 @@
#include "hitbox.h"
#include "item.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "effects.h"
+#include "room.h"
+#include "physics.h"
#include "tiles.h"
typedef struct {
@@ -18,7 +24,7 @@ typedef struct {
/*0x6e*/ u8 unk_6e[0x2];
/*0x70*/ u16 tilePos;
/*0x72*/ u8 unk_72[0x14];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} SmallIceBlockEntity;
extern const s16 gUnk_080B4488[];
@@ -51,7 +57,7 @@ void SmallIceBlock_Init(SmallIceBlockEntity* this) {
case 0:
case 1:
case 2:
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag)) {
DeleteThisEntity();
}
}
@@ -81,7 +87,7 @@ void SmallIceBlock_Action1(SmallIceBlockEntity* this) {
EnqueueSFX(SFX_ICE_BLOCK_MELT);
SmallIceBlock_Action3(this);
if (super->type == 0) {
- SetFlag(this->unk_86);
+ SetFlag(this->flag);
}
} else {
if (!sub_0800442E(super)) {
@@ -138,10 +144,10 @@ void SmallIceBlock_Action3(SmallIceBlockEntity* this) {
}
SetAffineInfo(super, 0x100, gUnk_08123748[super->timer >> 5], 0);
if (super->type == 1) {
- CreateGroundItemWithFlags(super, ITEM_SMALL_KEY, 0, this->unk_86);
+ CreateGroundItemWithFlags(super, ITEM_SMALL_KEY, 0, this->flag);
SoundReq(SFX_SECRET);
} else if (super->type == 2) {
- CreateGroundItemWithFlags(super, ITEM_BIG_KEY, 0, this->unk_86);
+ CreateGroundItemWithFlags(super, ITEM_BIG_KEY, 0, this->flag);
SoundReq(SFX_SECRET);
}
super->action = 4;
diff --git a/src/object/smoke.c b/src/object/smoke.c
index 62b4d1ac..534d91c2 100644
--- a/src/object/smoke.c
+++ b/src/object/smoke.c
@@ -5,6 +5,8 @@
* @brief Smoke object
*/
#include "object.h"
+#include "asm.h"
+#include "physics.h"
void Smoke_Type0(Entity*);
void Smoke_Type1(Entity*);
diff --git a/src/object/smokeParticle.c b/src/object/smokeParticle.c
index ac05de1f..68963f44 100644
--- a/src/object/smokeParticle.c
+++ b/src/object/smokeParticle.c
@@ -4,8 +4,13 @@
*
* @brief Smoke Particle object
*/
-#include "functions.h"
+#include "collision.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "script.h"
+#include "player.h"
+#include "room.h"
#include "tiles.h"
void SmokeParticle_Init(Entity*);
diff --git a/src/object/specialFx.c b/src/object/specialFx.c
index cdd72a0b..63afabd3 100644
--- a/src/object/specialFx.c
+++ b/src/object/specialFx.c
@@ -5,8 +5,15 @@
* @brief Special FX object
*/
#include "entity.h"
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "script.h"
+#include "sound.h"
+#include "effects.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
+#include "item.h"
typedef struct {
Entity base;
diff --git a/src/object/steam.c b/src/object/steam.c
index 7cef37d1..f13bde3c 100644
--- a/src/object/steam.c
+++ b/src/object/steam.c
@@ -8,6 +8,7 @@
#include "entity.h"
#include "player.h"
#include "room.h"
+#include "script.h"
#include "screen.h"
const u8 gUnk_08123484[];
diff --git a/src/object/stoneTablet.c b/src/object/stoneTablet.c
index 99e45cbe..efd6bbfe 100644
--- a/src/object/stoneTablet.c
+++ b/src/object/stoneTablet.c
@@ -5,9 +5,9 @@
* @brief Stone Tablet object
*/
#include "entity.h"
-#include "functions.h"
#include "room.h"
#include "tiles.h"
+#include "beanstalkSubtask.h"
void StoneTablet_Init(Entity*);
void StoneTablet_Action1(Entity*);
diff --git a/src/object/swordParticle.c b/src/object/swordParticle.c
index f86879a0..d5232947 100644
--- a/src/object/swordParticle.c
+++ b/src/object/swordParticle.c
@@ -4,9 +4,13 @@
*
* @brief Sword Particle object
*/
-#include "functions.h"
#include "item.h"
#include "object.h"
+#include "sound.h"
+#include "effects.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/swordsmanNewsletter.c b/src/object/swordsmanNewsletter.c
index bc17266a..2afc5657 100644
--- a/src/object/swordsmanNewsletter.c
+++ b/src/object/swordsmanNewsletter.c
@@ -6,6 +6,7 @@
*/
#include "entity.h"
#include "message.h"
+#include "player.h"
extern void AddInteractableCheckableObject(Entity*);
void SwordsmanNewsletter_Init(Entity*);
diff --git a/src/object/thunderbolt.c b/src/object/thunderbolt.c
index 543c08c4..d79159cc 100644
--- a/src/object/thunderbolt.c
+++ b/src/object/thunderbolt.c
@@ -4,8 +4,12 @@
*
* @brief Thunderbolt object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
+#include "script.h"
+#include "sound.h"
+#include "physics.h"
+#include "player.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/titleScreenObject.c b/src/object/titleScreenObject.c
index dc94e9fc..fa199270 100644
--- a/src/object/titleScreenObject.c
+++ b/src/object/titleScreenObject.c
@@ -4,8 +4,8 @@
*
* @brief Title Screen object
*/
-#include "functions.h"
#include "object.h"
+#include "asm.h"
void TitleScreenObject_Type0(Entity*);
void TitleScreenObject_Type1(Entity*);
diff --git a/src/object/trapdoor.c b/src/object/trapdoor.c
index 809643dd..1704c770 100644
--- a/src/object/trapdoor.c
+++ b/src/object/trapdoor.c
@@ -6,6 +6,10 @@
*/
#include "item.h"
#include "object.h"
+#include "asm.h"
+#include "flags.h"
+#include "physics.h"
+#include "player.h"
void sub_08099ECC(Entity*);
void Trapdoor_Init(Entity*);
diff --git a/src/object/treeHidingPortal.c b/src/object/treeHidingPortal.c
index 283d64be..da087e26 100644
--- a/src/object/treeHidingPortal.c
+++ b/src/object/treeHidingPortal.c
@@ -7,17 +7,18 @@
#include "effects.h"
#include "entity.h"
#include "flags.h"
-#include "functions.h"
#include "object.h"
+#include "asm.h"
#include "player.h"
#include "room.h"
#include "sound.h"
#include "tiles.h"
+#include "kinstone.h"
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unused1[30];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} TreeHidingPortalEntity;
extern const s16 gUnk_080B4468[];
@@ -42,7 +43,7 @@ void TreeHidingPortal(TreeHidingPortalEntity* this) {
}
void TreeHidingPortal_Init(TreeHidingPortalEntity* this) {
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag)) {
sub_0809E96C(this);
DeleteThisEntity();
}
@@ -56,7 +57,7 @@ void TreeHidingPortal_Action1(TreeHidingPortalEntity* this) {
if (sub_0800419C(super, &gPlayerEntity.base, 0x30, 0x30)) {
if (CheckGlobalFlag(EZERO_1ST)) {
if (((gRoomTransition.frameCount & 3) == 0)) {
- CreateSparkle(super);
+ CreateSparkleFx(super);
}
}
}
@@ -79,7 +80,7 @@ void TreeHidingPortal_Action2(TreeHidingPortalEntity* this) {
void TreeHidingPortal_Action3(TreeHidingPortalEntity* this) {
if (--super->timer == 0) {
- SetFlag(this->unk_86);
+ SetFlag(this->flag);
SetPlayerControl(0);
SoundReq(SFX_SECRET_BIG);
DeleteThisEntity();
diff --git a/src/object/treeThorns.c b/src/object/treeThorns.c
index 3fe27355..3c7b9f06 100644
--- a/src/object/treeThorns.c
+++ b/src/object/treeThorns.c
@@ -7,6 +7,7 @@
#include "entity.h"
#include "hitbox.h"
#include "object.h"
+#include "asm.h"
#include "physics.h"
#include "room.h"
#include "tiles.h"
diff --git a/src/object/unusedSkull.c b/src/object/unusedSkull.c
index 6bfb48a5..5198aeba 100644
--- a/src/object/unusedSkull.c
+++ b/src/object/unusedSkull.c
@@ -4,15 +4,19 @@
*
* @brief Unused Skull object
*/
-#include "functions.h"
#include "hitbox.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "effects.h"
+#include "room.h"
#include "tiles.h"
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unk_68[0x1e];
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} UnusedSkullEntity;
void UnusedSkull_Init(UnusedSkullEntity*);
@@ -40,9 +44,9 @@ void UnusedSkull_Init(UnusedSkullEntity* this) {
super->collisionMask = 2;
super->hitbox = (Hitbox*)&gHitbox_4;
SetTile(SPECIAL_TILE_80, COORD_TO_TILE(super), super->collisionLayer);
- if (super->type == 1 || CheckFlags(this->unk_86)) {
+ if (super->type == 1 || CheckFlags(this->flag)) {
super->action = 3;
- SetFlag(this->unk_86);
+ SetFlag(this->flag);
InitializeAnimation(super, 1);
} else {
InitializeAnimation(super, super->type);
@@ -62,7 +66,7 @@ void UnusedSkull_Action2(UnusedSkullEntity* this) {
GetNextFrame(super);
if ((super->frame & 1) != 0) {
super->action = 3;
- SetFlag(this->unk_86);
+ SetFlag(this->flag);
EnqueueSFX(SFX_BUTTON_PRESS);
}
}
diff --git a/src/object/vaati3PlayerObject.c b/src/object/vaati3PlayerObject.c
index 6420cbab..5a7980e0 100644
--- a/src/object/vaati3PlayerObject.c
+++ b/src/object/vaati3PlayerObject.c
@@ -7,7 +7,9 @@
#include "entity.h"
#include "physics.h"
#include "player.h"
+#ifndef EU
#include "room.h"
+#endif
void Vaati3PlayerObject(Entity* this) {
if (this->action == 0) {
diff --git a/src/object/warpPoint.c b/src/object/warpPoint.c
index 67798907..9c263eea 100644
--- a/src/object/warpPoint.c
+++ b/src/object/warpPoint.c
@@ -4,10 +4,15 @@
*
* @brief Warp Point object
*/
-#include "functions.h"
#include "game.h"
#include "hitbox.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "room.h"
+#include "physics.h"
+#include "player.h"
typedef struct {
/*0x00*/ Entity base;
@@ -18,7 +23,7 @@ typedef struct {
/*0x7d*/ u8 unk_7d;
/*0x7e*/ u8 unused3[6];
/*0x84*/ u16 unk_84;
- /*0x86*/ u16 unk_86;
+ /*0x86*/ u16 flag;
} WarpPointEntity;
extern void EnableDungeonWarp(u32);
@@ -58,7 +63,7 @@ void WarpPoint_Init(WarpPointEntity* this) {
super->hitbox = (Hitbox*)&gHitbox_1;
super->updatePriority = PRIO_NO_BLOCK;
InitializeAnimation(super, 0);
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag)) {
sub_0808B830(this);
} else {
if (AreaIsDungeon() && IsDungeonWarpActive(super->type)) {
@@ -77,7 +82,7 @@ void WarpPoint_Init(WarpPointEntity* this) {
}
void WarpPoint_Action1(WarpPointEntity* this) {
- if (CheckFlags(this->unk_86)) {
+ if (CheckFlags(this->flag)) {
sub_0808B830(this);
if (AreaIsDungeon()) {
EnableDungeonWarp(super->type);
diff --git a/src/object/waterDropObject.c b/src/object/waterDropObject.c
index 056afa57..b4dbec44 100644
--- a/src/object/waterDropObject.c
+++ b/src/object/waterDropObject.c
@@ -5,7 +5,6 @@
* @brief Water Drop object
*/
#include "entity.h"
-#include "functions.h"
void WaterDropObject(Entity* this) {
u32 iVar2;
diff --git a/src/object/waterElement.c b/src/object/waterElement.c
index 6f55a27c..4ff3d9fa 100644
--- a/src/object/waterElement.c
+++ b/src/object/waterElement.c
@@ -4,7 +4,6 @@
*
* @brief Water Element object
*/
-#include "functions.h"
#include "object.h"
void WaterElement_Init(Entity*);
diff --git a/src/object/waterfallOpening.c b/src/object/waterfallOpening.c
index c63c937a..f6f02a3f 100644
--- a/src/object/waterfallOpening.c
+++ b/src/object/waterfallOpening.c
@@ -6,11 +6,12 @@
*/
#include "entity.h"
#include "flags.h"
-#include "functions.h"
#include "menu.h"
#include "room.h"
#include "sound.h"
#include "tiles.h"
+#include "vram.h"
+#include "map.h"
typedef struct {
Entity base;
diff --git a/src/object/well.c b/src/object/well.c
index 0e19e21a..082ba849 100644
--- a/src/object/well.c
+++ b/src/object/well.c
@@ -6,10 +6,10 @@
*/
#include "asm.h"
#include "entity.h"
-#include "functions.h"
#include "player.h"
#include "room.h"
#include "tiles.h"
+#include "map.h"
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/whirlwind.c b/src/object/whirlwind.c
index add24319..218ee28b 100644
--- a/src/object/whirlwind.c
+++ b/src/object/whirlwind.c
@@ -5,9 +5,15 @@
* @brief Whirlwind object
*/
#include "area.h"
-#include "functions.h"
+#include "script.h"
#include "hitbox.h"
#include "object.h"
+#include "asm.h"
+#include "sound.h"
+#include "flags.h"
+#include "physics.h"
+#include "player.h"
+#include "color.h"
void Whirlwind_Init(Entity*);
void Whirlwind_Action1(Entity*);
diff --git a/src/object/whiteTriangleEffect.c b/src/object/whiteTriangleEffect.c
index 2d7f24e3..ce12c336 100644
--- a/src/object/whiteTriangleEffect.c
+++ b/src/object/whiteTriangleEffect.c
@@ -4,8 +4,9 @@
*
* @brief White Triangle Effect object
*/
-#include "functions.h"
#include "object.h"
+#include "common.h"
+#include "room.h"
#include "screen.h"
typedef struct {
diff --git a/src/object/windTribeFlag.c b/src/object/windTribeFlag.c
index 99b8572f..deac4c39 100644
--- a/src/object/windTribeFlag.c
+++ b/src/object/windTribeFlag.c
@@ -5,6 +5,7 @@
* @brief Wind Tribe Flag object
*/
#include "object.h"
+#include "asm.h"
void WindTribeFlag(Entity* this) {
if (this->action == 0) {
diff --git a/src/object/windTribeTeleporter.c b/src/object/windTribeTeleporter.c
index 5a238478..70d84512 100644
--- a/src/object/windTribeTeleporter.c
+++ b/src/object/windTribeTeleporter.c
@@ -5,10 +5,15 @@
* @brief Wind Tribe Teleporter object
*/
#include "collision.h"
-#include "functions.h"
#include "hitbox.h"
#include "object.h"
+#include "sound.h"
+#include "room.h"
+#include "player.h"
#include "screenTransitions.h"
+#if defined(DEMO_JP) || defined(USA) || defined(DEMO_USA)
+#include "flags.h"
+#endif
typedef struct {
/*0x00*/ Entity base;
diff --git a/src/object/windcrest.c b/src/object/windcrest.c
index ad1b63a3..f6dbba59 100644
--- a/src/object/windcrest.c
+++ b/src/object/windcrest.c
@@ -6,7 +6,6 @@
*/
#include "effects.h"
#include "entity.h"
-#include "functions.h"
#include "save.h"
#include "script.h"
#include "sound.h"