summaryrefslogtreecommitdiff
path: root/src/object
diff options
context:
space:
mode:
authoroctorock <79596758+octorock@users.noreply.github.com>2023-12-31 02:12:41 +0100
committeroctorock <79596758+octorock@users.noreply.github.com>2023-12-31 02:12:41 +0100
commit109b1020dcbfa17e80d28c522b5d792f7b3c6d46 (patch)
treecf23c1134de2891d0eed3b55549e70b29eb1997f /src/object
parent957da774e4c34100e0bd352b1570af02bb7f7521 (diff)
parent9c87bcca8ea4b52199ed908c0ea28ab08b1d0747 (diff)
Merge branch 'master' into tilemap-docs
Diffstat (limited to 'src/object')
-rw-r--r--src/object/ambientClouds.c29
-rw-r--r--src/object/angryStatue.c1
-rw-r--r--src/object/archway.c1
-rw-r--r--src/object/backgroundCloud.c1
-rw-r--r--src/object/bakerOven.c15
-rw-r--r--src/object/barrelInside.c1
-rw-r--r--src/object/barrelSpiderweb.c7
-rw-r--r--src/object/beanstalk.c9
-rw-r--r--src/object/bedCover.c1
-rw-r--r--src/object/bell.c1
-rw-r--r--src/object/bench.c1
-rw-r--r--src/object/bigBarrel.c5
-rw-r--r--src/object/bigIceBlock.c1
-rw-r--r--src/object/bigPushableLever.c7
-rw-r--r--src/object/bigVortex.c13
-rw-r--r--src/object/bird.c55
-rw-r--r--src/object/blockPushed.c1
-rw-r--r--src/object/board.c7
-rw-r--r--src/object/bollard.c1
-rw-r--r--src/object/book.c15
-rw-r--r--src/object/bossDoor.c3
-rw-r--r--src/object/bush.c5
-rw-r--r--src/object/button.c7
-rw-r--r--src/object/cabinFurniture.c1
-rw-r--r--src/object/cameraTarget.c7
-rw-r--r--src/object/carlovObject.c1
-rw-r--r--src/object/chestSpawner.c7
-rw-r--r--src/object/chuchuBossCutscene.c1
-rw-r--r--src/object/chuchuBossParticle.c1
-rw-r--r--src/object/chuchuBossStartParticle.c1
-rw-r--r--src/object/cloud.c5
-rw-r--r--src/object/crackingGround.c1
-rw-r--r--src/object/crenelBeanSprout.c19
-rw-r--r--src/object/cuccoMinigame.c1
-rw-r--r--src/object/cutsceneMiscObject.c45
-rw-r--r--src/object/cutsceneOrchestrator.c1
-rw-r--r--src/object/deathFx.c3
-rw-r--r--src/object/dirtParticle.c3
-rw-r--r--src/object/doubleBookshelf.c3
-rw-r--r--src/object/elementsBackground.c1
-rw-r--r--src/object/enemyItem.c1
-rw-r--r--src/object/evilSpirit.c10
-rw-r--r--src/object/eyeSwitch.c1
-rw-r--r--src/object/ezloCap.c23
-rw-r--r--src/object/ezloCapFlying.c34
-rw-r--r--src/object/fairy.c11
-rw-r--r--src/object/fan.c7
-rw-r--r--src/object/fanWind.c1
-rw-r--r--src/object/figurineDevice.c13
-rw-r--r--src/object/fileScreenObjects.c1
-rw-r--r--src/object/fireballChain.c1
-rw-r--r--src/object/fireplace.c1
-rw-r--r--src/object/flame.c1
-rw-r--r--src/object/floatingBlock.c1
-rw-r--r--src/object/floatingPlatform.c5
-rw-r--r--src/object/fourElements.c5
-rw-r--r--src/object/frozenFlower.c1
-rw-r--r--src/object/frozenOctorok.c18
-rw-r--r--src/object/frozenWaterElement.c1
-rw-r--r--src/object/furniture.c12
-rw-r--r--src/object/gentariCurtain.c3
-rw-r--r--src/object/giantBookLadder.c1
-rw-r--r--src/object/giantLeaf.c1
-rw-r--r--src/object/giantRock.c1
-rw-r--r--src/object/giantRock2.c1
-rw-r--r--src/object/giantTwig.c3
-rw-r--r--src/object/gleerokParticle.c5
-rw-r--r--src/object/graveyardKey.c12
-rw-r--r--src/object/greatFairy.c13
-rw-r--r--src/object/guruguruBar.c3
-rw-r--r--src/object/gustJarParticle.c9
-rw-r--r--src/object/gyorgBossObject.c9
-rw-r--r--src/object/heartContainer.c1
-rw-r--r--src/object/hiddenLadderDown.c1
-rw-r--r--src/object/hitSwitch.c1
-rw-r--r--src/object/hittableLever.c1
-rw-r--r--src/object/houseDoorExterior.c7
-rw-r--r--src/object/houseDoorInterior.c4
-rw-r--r--src/object/houseSign.c11
-rw-r--r--src/object/itemForSale.c30
-rw-r--r--src/object/itemOnGround.c17
-rw-r--r--src/object/jailBars.c1
-rw-r--r--src/object/japaneseSubtitle.c1
-rw-r--r--src/object/jarPortal.c1
-rw-r--r--src/object/keyStealingTakkuri.c16
-rw-r--r--src/object/kinstoneSpark.c1
-rw-r--r--src/object/ladderHoleInBookshelf.c11
-rw-r--r--src/object/ladderUp.c3
-rw-r--r--src/object/lamp.c1
-rw-r--r--src/object/lampParticle.c1
-rw-r--r--src/object/lavaPlatform.c5
-rw-r--r--src/object/lightDoor.c1
-rw-r--r--src/object/lightRay.c29
-rw-r--r--src/object/lightableSwitch.c1
-rw-r--r--src/object/lilypadLarge.c69
-rw-r--r--src/object/lilypadLargeFalling.c1
-rw-r--r--src/object/lilypadSmall.c5
-rw-r--r--src/object/linkAnimation.c135
-rw-r--r--src/object/linkEmptyingBottle.c13
-rw-r--r--src/object/linkFire.c21
-rw-r--r--src/object/linkHoldingItem.c13
-rw-r--r--src/object/litArea.c1
-rw-r--r--src/object/lockedDoor.c9
-rw-r--r--src/object/macroAcorn.c1
-rw-r--r--src/object/macroBook.c5
-rw-r--r--src/object/macroDecorations.c1
-rw-r--r--src/object/macroMushroomStalk.c1
-rw-r--r--src/object/macroPlayer.c1
-rw-r--r--src/object/macroShoe.c1
-rw-r--r--src/object/mask.c11
-rw-r--r--src/object/mazaalBossObject.c4
-rw-r--r--src/object/mazaalObject.c1
-rw-r--r--src/object/metalDoor.c1
-rw-r--r--src/object/minecart.c69
-rw-r--r--src/object/minecartDoor.c17
-rw-r--r--src/object/mineralWaterSource.c1
-rw-r--r--src/object/minishEmoticon.c3
-rw-r--r--src/object/minishLight.c1
-rw-r--r--src/object/minishPortalCloseup.c1
-rw-r--r--src/object/minishPortalStone.c1
-rw-r--r--src/object/minishSizedArchway.c1
-rw-r--r--src/object/minishSizedEntrance.c6
-rw-r--r--src/object/minishVillageObject.c3
-rw-r--r--src/object/moleMittsParticle.c9
-rw-r--r--src/object/mulldozerSpawnPoint.c1
-rw-r--r--src/object/object1D.c1
-rw-r--r--src/object/object1F.c3
-rw-r--r--src/object/object30.c3
-rw-r--r--src/object/object37.c3
-rw-r--r--src/object/object53.c1
-rw-r--r--src/object/object63.c1
-rw-r--r--src/object/object70.c35
-rw-r--r--src/object/objectA.c1
-rw-r--r--src/object/objectA2.c3
-rw-r--r--src/object/objectA7.c1
-rw-r--r--src/object/objectA8.c11
-rw-r--r--src/object/objectBF.c1
-rw-r--r--src/object/objectBlockingStairs.c15
-rw-r--r--src/object/objectOnPillar.c11
-rw-r--r--src/object/objectOnSpinyBeetle.c3
-rw-r--r--src/object/octorokBossObject.c5
-rw-r--r--src/object/palaceArchway.c1
-rw-r--r--src/object/paper.c4
-rw-r--r--src/object/parallaxRoomView.c3
-rw-r--r--src/object/picoBloom.c1
-rw-r--r--src/object/pinwheel.c1
-rw-r--r--src/object/playerClone.c43
-rw-r--r--src/object/pot.c5
-rw-r--r--src/object/pressurePlate.c5
-rw-r--r--src/object/pullableLever.c17
-rw-r--r--src/object/pullableMushroom.c34
-rw-r--r--src/object/pushableFurniture.c30
-rw-r--r--src/object/pushableGrave.c3
-rw-r--r--src/object/pushableLever.c7
-rw-r--r--src/object/pushableRock.c1
-rw-r--r--src/object/pushableStatue.c31
-rw-r--r--src/object/railtrack.c1
-rw-r--r--src/object/rotatingTrapdoor.c1
-rw-r--r--src/object/rupee.c1
-rw-r--r--src/object/sanctuaryStoneTablet.c1
-rw-r--r--src/object/shrinkingHieroglyphs.c7
-rw-r--r--src/object/smallIceBlock.c1
-rw-r--r--src/object/smoke.c1
-rw-r--r--src/object/smokeParticle.c1
-rw-r--r--src/object/specialChest.c1
-rw-r--r--src/object/specialFx.c7
-rw-r--r--src/object/steam.c3
-rw-r--r--src/object/stoneTablet.c1
-rw-r--r--src/object/swordParticle.c17
-rw-r--r--src/object/swordsmanNewsletter.c1
-rw-r--r--src/object/thoughtBubble.c1
-rw-r--r--src/object/thunderbolt.c3
-rw-r--r--src/object/titleScreenObject.c1
-rw-r--r--src/object/trapdoor.c5
-rw-r--r--src/object/treeHidingPortal.c9
-rw-r--r--src/object/treeThorns.c1
-rw-r--r--src/object/unusedSkull.c1
-rw-r--r--src/object/vaati1Portal.c5
-rw-r--r--src/object/vaati2Particle.c1
-rw-r--r--src/object/vaati3Arm.c1
-rw-r--r--src/object/vaati3Death.c1
-rw-r--r--src/object/vaati3PlayerObject.c3
-rw-r--r--src/object/warpPoint.c42
-rw-r--r--src/object/waterDropObject.c1
-rw-r--r--src/object/waterElement.c1
-rw-r--r--src/object/waterfallOpening.c1
-rw-r--r--src/object/well.c7
-rw-r--r--src/object/whirlwind.c24
-rw-r--r--src/object/whiteTriangleEffect.c1
-rw-r--r--src/object/windTribeFlag.c1
-rw-r--r--src/object/windTribeTeleporter.c41
-rw-r--r--src/object/windcrest.c1
192 files changed, 653 insertions, 876 deletions
diff --git a/src/object/ambientClouds.c b/src/object/ambientClouds.c
index c24b16f4..7e885373 100644
--- a/src/object/ambientClouds.c
+++ b/src/object/ambientClouds.c
@@ -4,7 +4,6 @@
*
* @brief Ambient Clouds object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "effects.h"
#include "entity.h"
@@ -83,12 +82,12 @@ void AmbientClouds_Action1(Entity* this) {
this->spriteOrientation.flipY = 1;
this->spriteRendering.b3 = 0;
if ((this->type2 == 1) || (this->child->action == 2)) {
- if (gPlayerEntity.z.HALF.HI < -0x24)
+ if (gPlayerEntity.base.z.HALF.HI < -0x24)
this->timer = 1;
else
this->timer = 0;
this->y.HALF.HI += (this->type2 - 1) * -0x24;
- if (EntityInRectRadius(this, &gPlayerEntity, 15, 15) && (this->timer != 0)) {
+ if (EntityInRectRadius(this, &gPlayerEntity.base, 15, 15) && (this->timer != 0)) {
this->action = 2;
this->spriteOrientation.flipY = 2;
this->spriteRendering.b3 = 3;
@@ -96,23 +95,23 @@ void AmbientClouds_Action1(Entity* this) {
this->child->action = 1;
}
gPlayerState.field_0x14 = 1;
- gPlayerEntity.y.HALF.HI -= 0x24;
- gPlayerEntity.z.HALF.HI += 0x24;
- sub_0807AA80(&gPlayerEntity);
+ gPlayerEntity.base.y.HALF.HI -= 0x24;
+ gPlayerEntity.base.z.HALF.HI += 0x24;
+ sub_0807AA80(&gPlayerEntity.base);
if (this->subtimer == 0) {
- Entity* fx = CreateFx(&gPlayerEntity, FX_DEATH, 0);
+ Entity* fx = CreateFx(&gPlayerEntity.base, FX_DEATH, 0);
if (fx != NULL) {
fx->x.HALF.HI += 8;
}
- fx = CreateFx(&gPlayerEntity, FX_DEATH, 0);
+ fx = CreateFx(&gPlayerEntity.base, FX_DEATH, 0);
if (fx != NULL) {
fx->x.HALF.HI -= 8;
}
- fx = CreateFx(&gPlayerEntity, FX_DEATH, 0);
+ fx = CreateFx(&gPlayerEntity.base, FX_DEATH, 0);
if (fx != NULL) {
fx->y.HALF.HI += 8;
}
- fx = CreateFx(&gPlayerEntity, FX_DEATH, 0);
+ fx = CreateFx(&gPlayerEntity.base, FX_DEATH, 0);
if (fx != NULL) {
fx->y.HALF.HI -= 8;
}
@@ -126,20 +125,20 @@ void AmbientClouds_Action1(Entity* this) {
void AmbientClouds_Action2(Entity* this) {
this->y.HALF.HI += this->type2 * -0x24;
- if (EntityInRectRadius(this, &gPlayerEntity, 15, 15)) {
+ if (EntityInRectRadius(this, &gPlayerEntity.base, 15, 15)) {
gPlayerState.field_0x14 = 1;
gPlayerState.flags |= PL_FLAGS2;
} else {
this->action = 1;
- gPlayerEntity.z.HALF_U.HI += this->z.HALF_U.HI;
- gPlayerEntity.y.HALF_U.HI -= this->z.HALF_U.HI;
- gPlayerEntity.collisionLayer = 1;
+ gPlayerEntity.base.z.HALF_U.HI += this->z.HALF_U.HI;
+ gPlayerEntity.base.y.HALF_U.HI -= this->z.HALF_U.HI;
+ gPlayerEntity.base.collisionLayer = 1;
}
this->y.HALF.HI += this->type2 * 0x24;
}
void AmbientClouds_Action3(Entity* this) {
- if (EntityInRectRadius(this, &gPlayerEntity, 15, 15)) {
+ if (EntityInRectRadius(this, &gPlayerEntity.base, 15, 15)) {
gPlayerState.field_0x14 = 1;
}
}
diff --git a/src/object/angryStatue.c b/src/object/angryStatue.c
index cac153d1..bc9d357c 100644
--- a/src/object/angryStatue.c
+++ b/src/object/angryStatue.c
@@ -4,7 +4,6 @@
*
* @brief Angry Statue object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "hitbox.h"
diff --git a/src/object/archway.c b/src/object/archway.c
index 2feceae8..76a9df16 100644
--- a/src/object/archway.c
+++ b/src/object/archway.c
@@ -4,7 +4,6 @@
*
* @brief Archway object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "game.h"
diff --git a/src/object/backgroundCloud.c b/src/object/backgroundCloud.c
index 691ff2cb..0c150823 100644
--- a/src/object/backgroundCloud.c
+++ b/src/object/backgroundCloud.c
@@ -4,7 +4,6 @@
*
* @brief BackgroundCloud object
*/
-#define NENT_DEPRECATED
#include "object.h"
typedef struct {
diff --git a/src/object/bakerOven.c b/src/object/bakerOven.c
index 497fd432..219cefc3 100644
--- a/src/object/bakerOven.c
+++ b/src/object/bakerOven.c
@@ -4,7 +4,6 @@
*
* @brief Baker Oven object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "tiles.h"
@@ -77,15 +76,15 @@ void BakerOven_Action1(BakerOvenEntity* this) {
}
/* Damage minish link if he touches a steam cloud */
- if (super->subtimer == 0 && gPlayerEntity.iframes == 0 && super->frameIndex &&
- sub_0806FC80(super, &gPlayerEntity, 4)) {
+ if (super->subtimer == 0 && gPlayerEntity.base.iframes == 0 && super->frameIndex &&
+ sub_0806FC80(super, &gPlayerEntity.base, 4)) {
super->subtimer++;
ModHealth(-2);
- SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6);
- gPlayerEntity.iframes = 16;
- gPlayerEntity.knockbackDirection = 16;
- gPlayerEntity.knockbackDuration = 12;
- gPlayerEntity.knockbackSpeed = 16;
+ SoundReqClipped(&gPlayerEntity.base, SFX_PLY_VO6);
+ gPlayerEntity.base.iframes = 16;
+ gPlayerEntity.base.knockbackDirection = 16;
+ gPlayerEntity.base.knockbackDuration = 12;
+ gPlayerEntity.base.knockbackSpeed = 16;
}
}
}
diff --git a/src/object/barrelInside.c b/src/object/barrelInside.c
index 1bd43f7e..3ef99da4 100644
--- a/src/object/barrelInside.c
+++ b/src/object/barrelInside.c
@@ -4,7 +4,6 @@
*
* @brief Barrel Inside object
*/
-#define NENT_DEPRECATED
#include "entity.h"
typedef struct {
diff --git a/src/object/barrelSpiderweb.c b/src/object/barrelSpiderweb.c
index a3dcc448..386f2c74 100644
--- a/src/object/barrelSpiderweb.c
+++ b/src/object/barrelSpiderweb.c
@@ -4,7 +4,6 @@
*
* @brief Barrel Spiderweb object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "hitbox.h"
#include "object.h"
@@ -44,7 +43,7 @@ void BarrelSpiderweb_Init(Entity* this) {
this->flags2 = 4;
this->hitbox = (Hitbox*)&gHitbox_0;
this->frameIndex = 2;
- this->collisionLayer = gPlayerEntity.collisionLayer;
+ this->collisionLayer = gPlayerEntity.base.collisionLayer;
sub_0808BDB0(this);
this->y.HALF.HI = 0x170 - (this->parent)->zVelocity;
sub_0808BBE0(this);
@@ -116,9 +115,9 @@ void BarrelSpiderweb_Action2(Entity* this) {
SetAffineInfo(this, 0x200 - this->subtimer, 0x200 - this->subtimer, 0);
}
if (this->contactFlags == 0x93) {
- this->direction = GetFacingDirection(this, &gPlayerEntity);
+ this->direction = GetFacingDirection(this, &gPlayerEntity.base);
LinearMoveUpdate(this);
- if (EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI - 6, 0x1c)) {
+ if (EntityWithinDistance(this, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI - 6, 0x1c)) {
sub_0808BD00(this);
}
} else {
diff --git a/src/object/beanstalk.c b/src/object/beanstalk.c
index f788253a..54745987 100644
--- a/src/object/beanstalk.c
+++ b/src/object/beanstalk.c
@@ -4,7 +4,6 @@
*
* @brief Beanstalk object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "tiles.h"
@@ -68,7 +67,7 @@ void Beanstalk_Init(BeanstalkEntity* this) {
super->spriteRendering.b3 = 2;
super->spriteOrientation.flipY = 1;
- SetDefaultPriority(super, 4);
+ SetEntityPriority(super, 4);
if (super->type == 7) {
#ifndef EU
if ((super->flags & ENT_DID_INIT) == 0) {
@@ -277,7 +276,7 @@ void Beanstalk_Action1Type7(BeanstalkEntity* this) {
case 3:
case 4:
if (gPlayerState.floor_type == SURFACE_LADDER) {
- if (EntityInRectRadius(super, &gPlayerEntity, 0, 8)) {
+ if (EntityInRectRadius(super, &gPlayerEntity.base, 0, 8)) {
if ((super->animIndex == (super->type2 - 1) * 3 + 1) && (super->timer == 0)) {
super->timer = 1;
InitializeAnimation(super, super->animIndex + 1);
@@ -336,8 +335,8 @@ void Beanstalk_Action1Type9(BeanstalkEntity* this) {
super->y.HALF.HI += 0x28;
this->unk_72 = sub_080B1A0C(super, 0, -24);
}
- super->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
- super->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
+ super->spriteOrientation.flipY = gPlayerEntity.base.spriteOrientation.flipY;
+ super->spriteRendering.b3 = gPlayerEntity.base.spriteRendering.b3;
if (gPlayerState.floor_type == SURFACE_LADDER) {
super->spritePriority.b0 = 0;
if (sub_080B1A0C(super, 0, -24) != SPECIAL_META_TILE_20) {
diff --git a/src/object/bedCover.c b/src/object/bedCover.c
index 7e9f62a3..a24189f5 100644
--- a/src/object/bedCover.c
+++ b/src/object/bedCover.c
@@ -4,7 +4,6 @@
*
* @brief Bed Cover object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
diff --git a/src/object/bell.c b/src/object/bell.c
index 59d9baf5..5898b204 100644
--- a/src/object/bell.c
+++ b/src/object/bell.c
@@ -4,7 +4,6 @@
*
* @brief Bell object
*/
-#define NENT_DEPRECATED
#include "object.h"
void Bell_Init(Entity* this);
diff --git a/src/object/bench.c b/src/object/bench.c
index 03ae3442..2b72fc56 100644
--- a/src/object/bench.c
+++ b/src/object/bench.c
@@ -4,7 +4,6 @@
*
* @brief Bench object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "functions.h"
diff --git a/src/object/bigBarrel.c b/src/object/bigBarrel.c
index 5a827374..b3c3a6d2 100644
--- a/src/object/bigBarrel.c
+++ b/src/object/bigBarrel.c
@@ -4,7 +4,6 @@
*
* @brief Big Barrel object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "common.h"
#include "entity.h"
@@ -210,7 +209,7 @@ void BigBarrel_Type2(BigBarrelEntity* this) {
super->spriteSettings.draw = 1;
super->frameIndex = super->type2 * 4 + 6;
super->collisionLayer = 2;
- SetDefaultPriority(super, 3);
+ SetEntityPriority(super, 3);
super->type2 = super->type2 == 0 ? 0x15 : 0x16;
UpdateSpriteForCollisionLayer(super);
break;
@@ -348,7 +347,7 @@ void sub_08089094(BigBarrelEntity* this) {
void sub_080890EC(BigBarrelEntity* this, const s16* offsets, s32 yOffset) {
Entity* pEVar1 = CreateObject(BIG_BARREL, 3, 0);
if (pEVar1) {
- SetDefaultPriority(pEVar1, 3);
+ SetEntityPriority(pEVar1, 3);
pEVar1->x.HALF.HI = super->x.HALF.HI;
pEVar1->y.HALF.HI = super->y.HALF.HI + yOffset;
pEVar1->parent = super;
diff --git a/src/object/bigIceBlock.c b/src/object/bigIceBlock.c
index 2e907d92..ef33cbe3 100644
--- a/src/object/bigIceBlock.c
+++ b/src/object/bigIceBlock.c
@@ -4,7 +4,6 @@
*
* @brief Big Ice Block object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "hitbox.h"
#include "item.h"
diff --git a/src/object/bigPushableLever.c b/src/object/bigPushableLever.c
index f0a691ae..97866857 100644
--- a/src/object/bigPushableLever.c
+++ b/src/object/bigPushableLever.c
@@ -4,7 +4,6 @@
*
* @brief Big Pushable Lever object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "tiles.h"
@@ -57,9 +56,9 @@ void BigPushableLever_Idle(BigPushableLeverEntity* this) {
gPlayerState.pushedObject = 0x98;
gPlayerState.queued_action = PLAYER_PUSH;
gPlayerState.flags |= PL_BUSY;
- gPlayerEntity.x.HALF.LO = 0;
- gPlayerEntity.y.HALF.LO = 0;
- gPlayerEntity.direction = gPlayerEntity.animationState << 2;
+ gPlayerEntity.base.x.HALF.LO = 0;
+ gPlayerEntity.base.y.HALF.LO = 0;
+ gPlayerEntity.base.direction = gPlayerEntity.base.animationState << 2;
}
}
}
diff --git a/src/object/bigVortex.c b/src/object/bigVortex.c
index f7bacd3d..91b510b9 100644
--- a/src/object/bigVortex.c
+++ b/src/object/bigVortex.c
@@ -4,7 +4,6 @@
*
* @brief Big Vortex object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "flags.h"
#include "functions.h"
@@ -49,7 +48,7 @@ void BigVortex_Init(BigVortexEntity* this) {
super->spriteSettings.draw = TRUE;
sub_08098E88(super);
}
- SetDefaultPriority(super, PRIO_PLAYER_EVENT);
+ SetEntityPriority(super, PRIO_PLAYER_EVENT);
InitAnimationForceUpdate(super, 0);
}
@@ -76,12 +75,12 @@ void BigVortex_Action2(BigVortexEntity* this) {
void BigVortex_Action3(BigVortexEntity* this) {
- if (sub_0800419C(super, &gPlayerEntity, 8, 8) != 0) {
- CopyPosition(super, &gPlayerEntity);
+ if (sub_0800419C(super, &gPlayerEntity.base, 8, 8) != 0) {
+ CopyPosition(super, &gPlayerEntity.base);
sub_08004542(super);
- sub_08004542(&gPlayerEntity);
- gPlayerEntity.collisionLayer = 1;
- SortEntityAbove(super, &gPlayerEntity);
+ sub_08004542(&gPlayerEntity.base);
+ gPlayerEntity.base.collisionLayer = 1;
+ SortEntityAbove(super, &gPlayerEntity.base);
gPlayerState.queued_action = PLAYER_PARACHUTE;
gPlayerState.field_0x38 = 1;
gPlayerState.field_0x39 = super->type2;
diff --git a/src/object/bird.c b/src/object/bird.c
index 390b9344..cb475264 100644
--- a/src/object/bird.c
+++ b/src/object/bird.c
@@ -4,7 +4,6 @@
*
* @brief Bird object
*/
-#define NENT_DEPRECATED
#include "collision.h"
#include "functions.h"
#include "game.h"
@@ -212,26 +211,26 @@ void Bird_Type8(BirdEntity* this) {
super->spriteRendering.b3 = 0;
super->spriteOrientation.flipY = 1;
super->x.HALF.HI = gRoomControls.scroll_x;
- super->y.HALF.HI = gPlayerEntity.y.HALF.HI;
+ super->y.HALF.HI = gPlayerEntity.base.y.HALF.HI;
super->child = NULL;
- SetDefaultPriority(super, 6);
+ SetEntityPriority(super, 6);
InitAnimationForceUpdate(super, 0);
SoundReq(0x123);
break;
case 1:
- super->collisionLayer = gPlayerEntity.collisionLayer;
+ super->collisionLayer = gPlayerEntity.base.collisionLayer;
super->speed += 8;
if (super->speed > 0x300) {
super->speed = 0x300;
}
- if ((gPlayerEntity.flags & ENT_COLLIDE) && (gMessage.doTextBox & 0x7f) == 0 &&
- gPlayerEntity.action != PLAYER_SLEEP && gPlayerEntity.action != PLAYER_BOUNCE &&
- gPlayerEntity.action != PLAYER_MINISH && gPlayerState.framestate != PL_STATE_CLIMB &&
+ if ((gPlayerEntity.base.flags & ENT_COLLIDE) && (gMessage.state & MESSAGE_ACTIVE) == 0 &&
+ gPlayerEntity.base.action != PLAYER_SLEEP && gPlayerEntity.base.action != PLAYER_BOUNCE &&
+ gPlayerEntity.base.action != PLAYER_MINISH && gPlayerState.framestate != PL_STATE_CLIMB &&
gPlayerState.framestate != PL_STATE_JUMP && gPlayerState.framestate != PL_STATE_PARACHUTE &&
- PlayerCanBeMoved() && (EntityInRectRadius(super, &gPlayerEntity, 0xe, 0xe))) {
- s32 z = gPlayerEntity.z.HALF.HI - super->z.HALF.HI - 8;
- if ((u16)z < 0x20 && gPlayerEntity.health != 0) {
+ PlayerCanBeMoved() && (EntityInRectRadius(super, &gPlayerEntity.base, 0xe, 0xe))) {
+ s32 z = gPlayerEntity.base.z.HALF.HI - super->z.HALF.HI - 8;
+ if ((u16)z < 0x20 && gPlayerEntity.base.health != 0) {
pEVar5 = CreateObject(BIRD, 10, 0);
if (pEVar5 != NULL) {
super->child = pEVar5;
@@ -240,22 +239,22 @@ void Bird_Type8(BirdEntity* this) {
super->speed = 0x300;
this->gravity = Q_8_8(-32.0);
PlayerDropHeldObject();
- sub_08078B48();
+ PausePlayer();
ResetPlayerAnimationAndAction();
PutAwayItems();
gPlayerState.swim_state = 0;
gPlayerState.jump_status = 0;
- gPlayerEntity.flags &= ~0x80;
- gPlayerEntity.spriteSettings.draw = 0;
- gPriorityHandler.sys_priority = 6;
+ gPlayerEntity.base.flags &= ~0x80;
+ gPlayerEntity.base.spriteSettings.draw = 0;
+ gPriorityHandler.event_priority = 6;
gPauseMenuOptions.disabled = 1;
}
}
}
break;
default:
- sub_08078B48();
- gPlayerEntity.spriteSettings.draw = 0;
+ PausePlayer();
+ gPlayerEntity.base.spriteSettings.draw = 0;
break;
}
LinearMoveUpdate(super);
@@ -263,7 +262,7 @@ void Bird_Type8(BirdEntity* this) {
UpdateAnimationSingleFrame(super);
pEVar5 = super->child;
if (pEVar5 != NULL) {
- if (gPlayerEntity.x.HALF.HI < super->x.HALF.HI - 8) {
+ if (gPlayerEntity.base.x.HALF.HI < super->x.HALF.HI - 8) {
super->timer = 0;
}
@@ -275,7 +274,7 @@ void Bird_Type8(BirdEntity* this) {
pEVar5->spriteOrientation.flipY = super->spriteOrientation.flipY;
} else {
super->timer--;
- CopyPosition(&gPlayerEntity, pEVar5);
+ CopyPosition(&gPlayerEntity.base, pEVar5);
}
}
@@ -307,15 +306,15 @@ void Bird_Type9(BirdEntity* this) {
super->spritePriority.b0 = 0;
super->spriteRendering.b3 = 0;
super->spriteOrientation.flipY = 1;
- SetDefaultPriority(super, 6);
+ SetEntityPriority(super, 6);
super->x.HALF.HI = gRoomControls.scroll_x;
- super->y.HALF.HI = gPlayerEntity.y.HALF.HI;
+ super->y.HALF.HI = gPlayerEntity.base.y.HALF.HI;
SoundReq(SFX_123);
super->spritePriority.b1 = 2;
InitAnimationForceUpdate(super, 0);
- sub_08078B48();
+ PausePlayer();
} else if (super->action == 1) {
- gPlayerEntity.spriteSettings.draw = 0;
+ gPlayerEntity.base.spriteSettings.draw = 0;
child = super->child;
if (child != NULL) {
PositionRelative(super, child, Q_16_16(-8), 0);
@@ -324,15 +323,15 @@ void Bird_Type9(BirdEntity* this) {
child->spriteRendering.b3 = super->spriteRendering.b3;
child->spriteOrientation.flipY = super->spriteOrientation.flipY;
}
- sub_08078B48();
+ PausePlayer();
if (gRoomControls.scroll_x + 0x78 < super->x.HALF.HI) {
super->action++;
super->spritePriority.b1 = 1;
if (child != NULL) {
child->action++;
}
- gRoomControls.camera_target = &gPlayerEntity;
- gPlayerEntity.spriteSettings.draw = 1;
+ gRoomControls.camera_target = &gPlayerEntity.base;
+ gPlayerEntity.base.spriteSettings.draw = 1;
ResetPlayerAnimationAndAction();
ResetPlayerEventPriority();
gPauseMenuOptions.disabled = 0;
@@ -355,7 +354,7 @@ void Bird_Type9(BirdEntity* this) {
}
void Bird_Type10(BirdEntity* this) {
- super->palette.b.b0 = gPlayerEntity.palette.b.b0;
+ super->palette.b.b0 = gPlayerEntity.base.palette.b.b0;
switch (super->action) {
case 0:
super->action = 1;
@@ -364,7 +363,7 @@ void Bird_Type10(BirdEntity* this) {
super->spritePriority.b0 = 0;
super->spriteRendering.b3 = 0;
super->spriteOrientation.flipY = 1;
- SetDefaultPriority(super, 6);
+ SetEntityPriority(super, 6);
InitAnimationForceUpdate(super, 0xe0);
case 1:
UpdateAnimationSingleFrame(super);
@@ -401,7 +400,7 @@ void sub_0809D738(void) {
pEVar1 = CreateObject(BIRD, 9, 0);
if (pEVar1 != NULL) {
gRoomControls.camera_target = NULL;
- SetDefaultPriority(pEVar1, 6);
+ SetEntityPriority(pEVar1, 6);
SetPlayerEventPriority();
pEVar2 = CreateObject(BIRD, 10, 0);
if (pEVar2 != NULL) {
diff --git a/src/object/blockPushed.c b/src/object/blockPushed.c
index f6a4fb40..44de24d1 100644
--- a/src/object/blockPushed.c
+++ b/src/object/blockPushed.c
@@ -4,7 +4,6 @@
*
* @brief Block Pushed object
*/
-#define NENT_DEPRECATED
#include "area.h"
#include "functions.h"
#include "object.h"
diff --git a/src/object/board.c b/src/object/board.c
index e2254e90..ab06c063 100644
--- a/src/object/board.c
+++ b/src/object/board.c
@@ -4,7 +4,6 @@
*
* @brief Board object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "functions.h"
@@ -65,10 +64,10 @@ void Board_Action1(BoardEntity* this) {
}
void sub_08098BE8(BoardEntity* this) {
- if ((gPlayerState.flags & PL_MINISH) && sub_08098C30(this, &gPlayerEntity) && PlayerCanBeMoved() &&
- gPlayerEntity.z.HALF.HI == 0) {
+ if ((gPlayerState.flags & PL_MINISH) && sub_08098C30(this, &gPlayerEntity.base) && PlayerCanBeMoved() &&
+ gPlayerEntity.base.z.HALF.HI == 0) {
gPlayerState.field_0x14 = 1;
- sub_0807AAF8(&gPlayerEntity, this->tile);
+ sub_0807AAF8(&gPlayerEntity.base, this->tile);
}
}
diff --git a/src/object/bollard.c b/src/object/bollard.c
index fa728e67..18891082 100644
--- a/src/object/bollard.c
+++ b/src/object/bollard.c
@@ -4,7 +4,6 @@
*
* @brief Bollard object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "flags.h"
diff --git a/src/object/book.c b/src/object/book.c
index 36f76c6a..6a516500 100644
--- a/src/object/book.c
+++ b/src/object/book.c
@@ -4,7 +4,6 @@
*
* @brief Book object
*/
-#define NENT_DEPRECATED
#include "collision.h"
#include "functions.h"
#include "item.h"
@@ -111,9 +110,9 @@ void Book_Action1(BookEntity* this) {
gPlayerState.queued_action = PLAYER_PUSH;
gPlayerState.flags |= PL_BUSY;
- gPlayerEntity.x.HALF.LO = 0;
- gPlayerEntity.y.HALF.LO = 0;
- gPlayerEntity.direction = gPlayerEntity.animationState << 2;
+ gPlayerEntity.base.x.HALF.LO = 0;
+ gPlayerEntity.base.y.HALF.LO = 0;
+ gPlayerEntity.base.direction = gPlayerEntity.base.animationState << 2;
EnqueueSFX(SFX_10F);
} else {
super->timer = 22;
@@ -208,10 +207,10 @@ void Book_Action5(BookEntity* this) {
break;
}
case 1: {
- u8 doTextBox = gMessage.doTextBox & 0x7f;
- if (!doTextBox) {
+ u8 status = gMessage.state & MESSAGE_ACTIVE;
+ if (!status) {
super->spriteSettings.draw = 1;
- super->subAction = doTextBox;
+ super->subAction = status;
}
break;
}
@@ -220,7 +219,7 @@ void Book_Action5(BookEntity* this) {
}
u32 sub_0809B688(Entity* this) {
- u32 ret = EntityInRectRadius(this, &gPlayerEntity, 6, 12);
+ u32 ret = EntityInRectRadius(this, &gPlayerEntity.base, 6, 12);
if (ret == 1 && gPlayerState.direction != DirectionSouth) {
ret = 0;
diff --git a/src/object/bossDoor.c b/src/object/bossDoor.c
index a8fc0d4d..f40de13f 100644
--- a/src/object/bossDoor.c
+++ b/src/object/bossDoor.c
@@ -4,7 +4,6 @@
*
* @brief Boss Door object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "hitbox.h"
#include "object.h"
@@ -107,7 +106,7 @@ void BossDoor_Action3(BossDoorEntity* this) {
if (--super->timer == 0) {
if (super->type < 4) {
sub_08078AC0(0x40, 0, 1);
- gPlayerEntity.direction = super->type << 3;
+ gPlayerEntity.base.direction = super->type << 3;
}
DeleteThisEntity();
}
diff --git a/src/object/bush.c b/src/object/bush.c
index 83b20fcc..1e54316b 100644
--- a/src/object/bush.c
+++ b/src/object/bush.c
@@ -4,7 +4,6 @@
*
* @brief Bush object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "hitbox.h"
#include "object.h"
@@ -39,7 +38,7 @@ void Bush(BushEntity* this) {
Bush_Action1,
Bush_Action2,
};
- if (!EntityIsDeleted(super)) {
+ if (!EntityDisabled(super)) {
Bush_Actions[super->action](this);
}
}
@@ -62,7 +61,7 @@ void Bush_Init(BushEntity* this) {
super->gustJarTolerance = gUnk_08120588[super->type].unk_1;
super->gustJarFlags = gUnk_08120588[super->type].unk_2;
super->speed = 0x80;
- super->collisionLayer = gPlayerEntity.collisionLayer;
+ super->collisionLayer = gPlayerEntity.base.collisionLayer;
super->health = 1;
super->collisionFlags = 7;
super->hitType = 0x6e;
diff --git a/src/object/button.c b/src/object/button.c
index 317d8e50..6c88ace8 100644
--- a/src/object/button.c
+++ b/src/object/button.c
@@ -4,7 +4,6 @@
*
* @brief Button object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "tiles.h"
#include "object.h"
@@ -173,7 +172,7 @@ Entity* sub_08081D74(ButtonEntity* this) {
ent = 0;
if (sub_08081E0C(super)) {
if ((gPlayerState.flags & PL_CAPTURED) == 0 && (gPlayerState.flags & PL_MINISH) == 0) {
- ent = &gPlayerEntity;
+ ent = &gPlayerEntity.base;
}
} else {
if (gPlayerState.flags & PL_CLONING) {
@@ -191,7 +190,7 @@ Entity* sub_08081D74(ButtonEntity* this) {
}
u32 sub_08081E0C(Entity* this) {
- Entity* tmp = &gPlayerEntity;
+ Entity* tmp = &gPlayerEntity.base;
if (tmp->z.HALF.HI != 0 || !PlayerCanBeMoved()) {
return 0;
} else {
@@ -292,7 +291,7 @@ bool32 sub_08081F7C(ButtonEntity* this, u32 metaTileType) {
void sub_08081FF8(Entity* this) {
u32 direction;
u32 i;
- if (this->child != &gPlayerEntity)
+ if (this->child != &gPlayerEntity.base)
return;
direction = GetFacingDirection(this->child, this);
sub_080044AE(this->child, 0x200, direction);
diff --git a/src/object/cabinFurniture.c b/src/object/cabinFurniture.c
index 1ddbd3ac..0aa744a2 100644
--- a/src/object/cabinFurniture.c
+++ b/src/object/cabinFurniture.c
@@ -4,7 +4,6 @@
*
* @brief Cabin Furniture object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "flags.h"
diff --git a/src/object/cameraTarget.c b/src/object/cameraTarget.c
index 9c001915..f327c414 100644
--- a/src/object/cameraTarget.c
+++ b/src/object/cameraTarget.c
@@ -4,7 +4,6 @@
*
* @brief Camera Target object
*/
-#define NENT_DEPRECATED
#include "common.h"
#include "entity.h"
#include "functions.h"
@@ -53,7 +52,7 @@ void CameraTarget(Entity* this) {
case FUSION_STATE_0:
case FUSION_STATE_1:
case FUSION_STATE_2:
- if ((gMessage.doTextBox & 0x7f) == 0) {
+ if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
break;
}
default:
@@ -96,7 +95,7 @@ void CameraTarget_Init(Entity* this) {
}
this->action = 1;
this->flags |= ENT_PERSIST;
- SetDefaultPriority(this, 6);
+ SetEntityPriority(this, 6);
}
void CameraTarget_Action1(Entity* this) {
@@ -151,7 +150,7 @@ void sub_08083A40(Entity* this) {
this->spriteSettings.draw = 1;
this->action = 2;
- if (this->child->x.HALF.HI > gPlayerEntity.x.HALF.HI) {
+ if (this->child->x.HALF.HI > gPlayerEntity.base.x.HALF.HI) {
bVar1 = 0;
this->spriteOffsetX = 8;
} else {
diff --git a/src/object/carlovObject.c b/src/object/carlovObject.c
index 662a48fe..b5cce22d 100644
--- a/src/object/carlovObject.c
+++ b/src/object/carlovObject.c
@@ -4,7 +4,6 @@
*
* @brief Carlov Object object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "tiles.h"
diff --git a/src/object/chestSpawner.c b/src/object/chestSpawner.c
index 66d035a1..18fc3a52 100644
--- a/src/object/chestSpawner.c
+++ b/src/object/chestSpawner.c
@@ -4,7 +4,6 @@
*
* @brief Chest Spawner object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "item.h"
#include "object.h"
@@ -115,14 +114,14 @@ void ChestSpawner_Type2Action2(ChestSpawnerEntity* this) {
SetPriorityTimer(30);
switch (super->subAction) {
case 0:
- if (EntityInRectRadius(super, &gPlayerEntity, 0x10, 8)) {
+ if (EntityInRectRadius(super, &gPlayerEntity.base, 0x10, 8)) {
sub_08078AC0(0x10, 0, 0);
- gPlayerEntity.direction = 0x10;
+ gPlayerEntity.base.direction = 0x10;
}
super->subAction = 1;
break;
case 1:
- if ((super->type == 5) || (gPlayerEntity.action == PLAYER_NORMAL)) {
+ if ((super->type == 5) || (gPlayerEntity.base.action == PLAYER_NORMAL)) {
super->subAction = 2;
super->timer = 8;
super->subtimer = 0;
diff --git a/src/object/chuchuBossCutscene.c b/src/object/chuchuBossCutscene.c
index 235a1f91..9c1287f2 100644
--- a/src/object/chuchuBossCutscene.c
+++ b/src/object/chuchuBossCutscene.c
@@ -4,7 +4,6 @@
*
* @brief Chuchu Boss Cutscene object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "menu.h"
#include "object.h"
diff --git a/src/object/chuchuBossParticle.c b/src/object/chuchuBossParticle.c
index b0b0da51..355405c4 100644
--- a/src/object/chuchuBossParticle.c
+++ b/src/object/chuchuBossParticle.c
@@ -4,7 +4,6 @@
*
* @brief Chuchu Boss Particle object
*/
-#define NENT_DEPRECATED
#include "entity.h"
void ChuchuBossParticle_Init(Entity*);
diff --git a/src/object/chuchuBossStartParticle.c b/src/object/chuchuBossStartParticle.c
index 25763c0f..ddd7032a 100644
--- a/src/object/chuchuBossStartParticle.c
+++ b/src/object/chuchuBossStartParticle.c
@@ -4,7 +4,6 @@
*
* @brief Chuchu Boss Start Particle object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
diff --git a/src/object/cloud.c b/src/object/cloud.c
index 1252aca6..58d34f12 100644
--- a/src/object/cloud.c
+++ b/src/object/cloud.c
@@ -4,7 +4,6 @@
*
* @brief Cloud object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "structures.h"
@@ -104,7 +103,7 @@ void sub_0809F5F0(CloudEntity* this) {
super->action = 2;
super->timer = 120;
SetPlayerControl(3);
- sub_08078B48();
+ PausePlayer();
gRoomControls.camera_target = super;
}
}
@@ -135,7 +134,7 @@ void sub_0809F69C(CloudEntity* this) {
if (--super->timer == 0) {
super->timer = 30;
super->action = 4;
- gRoomControls.camera_target = &gPlayerEntity;
+ gRoomControls.camera_target = &gPlayerEntity.base;
SoundReq(SFX_SECRET_BIG);
}
}
diff --git a/src/object/crackingGround.c b/src/object/crackingGround.c
index 21845417..3c8c9e85 100644
--- a/src/object/crackingGround.c
+++ b/src/object/crackingGround.c
@@ -4,7 +4,6 @@
*
* @brief Cracking Ground object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
diff --git a/src/object/crenelBeanSprout.c b/src/object/crenelBeanSprout.c
index 1dae7789..bdf509af 100644
--- a/src/object/crenelBeanSprout.c
+++ b/src/object/crenelBeanSprout.c
@@ -4,7 +4,6 @@
*
* @brief Crenel Bean Sprout object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "functions.h"
#include "hitbox.h"
@@ -54,7 +53,7 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) {
case 0:
if (CheckGlobalFlag(WATERBEAN_OUT)) {
if (CheckGlobalFlag(WATERBEAN_PUT) == 0) {
- PositionRelative(&gPlayerEntity, super, 0, 0x10000);
+ PositionRelative(&gPlayerEntity.base, super, 0, 0x10000);
SetMetaTile(SPECIAL_META_TILE_34, 0xdc, super->collisionLayer);
} else {
if (CheckLocalFlag(super->type2) == 0) {
@@ -80,9 +79,9 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) {
case 3:
if (CheckGlobalFlag(WATERBEAN_OUT)) {
if (CheckGlobalFlag(WATERBEAN_PUT) == 0) {
- super->spritePriority.b0 = gPlayerEntity.spritePriority.b0 - 1;
- *(((u8*)&gPlayerEntity) + 0x79) = tmp;
- PositionRelative(&gPlayerEntity, super, 0, -0x180000);
+ super->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0 - 1;
+ *(((u8*)&gPlayerEntity.base) + 0x79) = tmp;
+ PositionRelative(&gPlayerEntity.base, super, 0, -0x180000);
} else {
DeleteThisEntity();
}
@@ -100,7 +99,7 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) {
break;
case 1:
super->spriteRendering.b0 = 3;
- SetDefaultPriority(super, 6);
+ SetEntityPriority(super, 6);
break;
case 2:
if (CheckLocalFlag((u32)super->type2) == 0) {
@@ -166,7 +165,7 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) {
} else {
GetNextFrame(super);
}
- tmp = gPlayerEntity.animationState & 6;
+ tmp = gPlayerEntity.base.animationState & 6;
this->unk_70 = ((super->x.HALF.HI + (s8)gUnk_08123184[tmp]) & -0x10) | 8;
this->unk_72 = ((super->y.HALF.HI + (s8)gUnk_08123184[(tmp) + 1]) & -0x10) | 8;
if (GetVvvAtWorldCoords(this->unk_70, this->unk_72, super->collisionLayer) == VVV_25) {
@@ -174,12 +173,12 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) {
} else {
gHUD.rActionPlayerState = R_ACTION_NONE;
}
- PositionRelative(&gPlayerEntity, super, 0, 0x10000);
+ PositionRelative(&gPlayerEntity.base, super, 0, 0x10000);
if (GetVvvAtEntity(super) == VVV_25) {
RestorePrevTileEntity(0xdc, super->collisionLayer);
sub_08096A78(this);
}
- if ((gPlayerState.playerInput.newInput & (PLAYER_INPUT_80 | PLAYER_INPUT_40)) == 0) {
+ if ((gPlayerState.playerInput.newInput & (INPUT_ACTION | INPUT_40)) == 0) {
return;
}
if (gHUD.rActionPlayerState != R_ACTION_THROW) {
@@ -266,7 +265,7 @@ void CrenelBeanSprout_Action6(CrenelBeanSproutEntity* this) {
CrenelBeanSprout_Action6SubAction2,
};
if (super->subAction != 2) {
- sub_08078B48();
+ PausePlayer();
}
CrenelBeanSprout_Action6SubActions[super->subAction](this);
}
diff --git a/src/object/cuccoMinigame.c b/src/object/cuccoMinigame.c
index 69900125..0aaa8a4c 100644
--- a/src/object/cuccoMinigame.c
+++ b/src/object/cuccoMinigame.c
@@ -5,7 +5,6 @@
*
* @brief Cucco Minigame object
*/
-#define NENT_DEPRECATED
#include "enemy.h"
#include "entity.h"
#include "fileselect.h"
diff --git a/src/object/cutsceneMiscObject.c b/src/object/cutsceneMiscObject.c
index 5e552ab0..d325566a 100644
--- a/src/object/cutsceneMiscObject.c
+++ b/src/object/cutsceneMiscObject.c
@@ -4,7 +4,6 @@
*
* @brief Cutscene Misc object
*/
-#define NENT_DEPRECATED
#include "area.h"
#include "functions.h"
#include "item.h"
@@ -186,7 +185,7 @@ void sub_08094B80(CutsceneMiscObjectEntity* this) {
void sub_08094B94(CutsceneMiscObjectEntity* this) {
Entity* e = CreateObject(CUTSCENE_MISC_OBJECT, 0x22, 0);
if (e != NULL) {
- CopyPosition(&gPlayerEntity, e);
+ CopyPosition(&gPlayerEntity.base, e);
e->z.HALF.HI = -48;
((CutsceneMiscObjectEntity*)e)->ctx = StartCutscene(e, &script_CutsceneMiscObjectTheLittleHat);
CreateDust(e);
@@ -198,7 +197,7 @@ void sub_08094B94(CutsceneMiscObjectEntity* this) {
void sub_08094BE0(Entity* this) {
Entity* e = FindEntity(OBJECT, CUTSCENE_MISC_OBJECT, 6, 0x22, 0);
if (e != NULL) {
- CopyPosition(&gPlayerEntity, e);
+ CopyPosition(&gPlayerEntity.base, e);
e->z.HALF.HI = -12;
e->y.HALF.HI++;
e->collisionLayer = 2;
@@ -213,7 +212,7 @@ void CutsceneMiscObject_Type2(CutsceneMiscObjectEntity* this) {
DeleteThisEntity();
if (super->action == 0) {
super->action++;
- SetDefaultPriority(super, PRIO_MESSAGE);
+ SetEntityPriority(super, PRIO_MESSAGE);
super->spriteRendering.b3 = gUnk_08114F30[p->spriteRendering.b3];
InitAnimationForceUpdate(super, 1);
}
@@ -232,7 +231,7 @@ void CutsceneMiscObject_Type3(CutsceneMiscObjectEntity* this) {
} else {
super->action++;
super->spriteSettings.draw = 1;
- SetDefaultPriority(super, PRIO_NO_BLOCK);
+ SetEntityPriority(super, PRIO_NO_BLOCK);
switch (super->type2) {
case 0x40:
case 0x41:
@@ -291,7 +290,7 @@ void CutsceneMiscObject_Type4(CutsceneMiscObjectEntity* this) {
} else {
super->action++;
super->spriteSettings.draw = 1;
- SetDefaultPriority(super, PRIO_NO_BLOCK);
+ SetEntityPriority(super, PRIO_NO_BLOCK);
InitAnimationForceUpdate(super, 0);
}
UpdateAnimationSingleFrame(super);
@@ -331,7 +330,7 @@ void CutsceneMiscObject_Type5(CutsceneMiscObjectEntity* this) {
super->action++;
super->z.WORD = Q_16_16(-160.0);
super->zVelocity = 0;
- SetDefaultPriority(super, PRIO_PLAYER_EVENT);
+ SetEntityPriority(super, PRIO_PLAYER_EVENT);
InitializeAnimation(super, 0);
if (GetVvvAtEntity(super) == VVV_13) {
super->action = 3;
@@ -414,7 +413,7 @@ void CutsceneMiscObject_Type6(CutsceneMiscObjectEntity* this) {
}
break;
case 3:
- if (gPlayerEntity.action != PLAYER_EMPTYBOTTLE) {
+ if (gPlayerEntity.base.action != PLAYER_EMPTYBOTTLE) {
super->action = 4;
#ifndef EU
if (!CheckGlobalFlag(BIN_DOGFOOD)) {
@@ -458,7 +457,7 @@ void CutsceneMiscObject_Type7(CutsceneMiscObjectEntity* this) {
}
break;
case 2:
- if ((gMessage.doTextBox & 0x7F) == 0) {
+ if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
CreateItemEntity(ITEM_JABBERNUT, 0, 0);
DeleteThisEntity();
}
@@ -473,7 +472,7 @@ void CutsceneMiscObject_Type7(CutsceneMiscObjectEntity* this) {
void CutsceneMiscObject_Type8(CutsceneMiscObjectEntity* this) {
if (super->action == 0) {
super->action = 1;
- SetDefaultPriority(super, PRIO_NO_BLOCK);
+ SetEntityPriority(super, PRIO_NO_BLOCK);
SortEntityBelow(super, super);
sub_0807DD64(super);
InitAnimationForceUpdate(super, 2);
@@ -493,7 +492,7 @@ void sub_08095164(CutsceneMiscObjectEntity* this) {
void CutsceneMiscObject_Type9(CutsceneMiscObjectEntity* this) {
if (super->action == 0) {
super->action = 1;
- SetDefaultPriority(super, PRIO_NO_BLOCK);
+ SetEntityPriority(super, PRIO_NO_BLOCK);
SortEntityBelow(super, super);
sub_0807DD64(super);
InitAnimationForceUpdate(super, 0);
@@ -548,7 +547,7 @@ void CutsceneMiscObject_Type11(CutsceneMiscObjectEntity* this) {
if (super->action == 0) {
super->action++;
super->subAction = 0;
- SetDefaultPriority(super, PRIO_NO_BLOCK);
+ SetEntityPriority(super, PRIO_NO_BLOCK);
InitAnimationForceUpdate(super, 0);
}
if (super->subAction != 0) {
@@ -608,7 +607,7 @@ void CutsceneMiscObject_Type12(CutsceneMiscObjectEntity* this) {
if (super->action == 0) {
super->action++;
super->z.HALF.HI = -16;
- SetDefaultPriority(super, PRIO_MESSAGE);
+ SetEntityPriority(super, PRIO_MESSAGE);
super->spriteRendering.b3 = gUnk_08114F30[super->spriteRendering.b3];
SortEntityAbove(super, super);
sub_0807DD64(super);
@@ -846,7 +845,7 @@ void CutsceneMiscObject_Type19(CutsceneMiscObjectEntity* this) {
void CutsceneMiscObject_Type20(CutsceneMiscObjectEntity* this) {
if (super->action == 0) {
super->action++;
- SetDefaultPriority(super, PRIO_PLAYER_EVENT);
+ SetEntityPriority(super, PRIO_PLAYER_EVENT);
sub_0807DD64(super);
InitializeAnimation(super, 0);
}
@@ -881,7 +880,7 @@ void CutsceneMiscObject_Type22(CutsceneMiscObjectEntity* this) {
if (super->action == 0) {
super->action++;
super->spriteSettings.draw = 0;
- SetDefaultPriority(super, PRIO_NO_BLOCK);
+ SetEntityPriority(super, PRIO_NO_BLOCK);
sub_0807DD64(super);
}
ExecuteScriptForEntity(super, 0);
@@ -1037,7 +1036,7 @@ void CutsceneMiscObject_Type28(CutsceneMiscObjectEntity* this) {
if (super->action == 0) {
super->action++;
super->spriteSettings.draw = 0;
- SetDefaultPriority(super, PRIO_PLAYER_EVENT);
+ SetEntityPriority(super, PRIO_PLAYER_EVENT);
sub_0807DD64(super);
}
ExecuteScriptForEntity(super, 0);
@@ -1054,7 +1053,7 @@ void sub_08095D30(CutsceneMiscObjectEntity* this, u32 a2) {
void sub_08095D54(CutsceneMiscObjectEntity* this, ScriptExecutionContext* ctx) {
Entity* e = CreateObject(CUTSCENE_MISC_OBJECT, 0x1C, 0);
if (e != NULL) {
- CopyPosition(&gPlayerEntity, e);
+ CopyPosition(&gPlayerEntity.base, e);
e->collisionLayer = 2;
((CutsceneMiscObjectEntity*)e)->ctx = StartCutscene(e, (u16*)ctx->intVariable);
}
@@ -1155,7 +1154,7 @@ void CutsceneMiscObject_Type31(CutsceneMiscObjectEntity* this) {
break;
}
ChangeObjPalette(super, pal);
- if ((gPlayerEntity.frame & 1) == 0) {
+ if ((gPlayerEntity.base.frame & 1) == 0) {
local->anim = 0x8BF;
super->timer = 52;
super->subtimer = -75;
@@ -1164,16 +1163,16 @@ void CutsceneMiscObject_Type31(CutsceneMiscObjectEntity* this) {
super->timer = 85;
super->subtimer = -42;
}
- CopyPosition(&gPlayerEntity, super);
+ CopyPosition(&gPlayerEntity.base, super);
super->spritePriority.b0 = 3;
}
- if (gPlayerEntity.frame & 0x10) {
- gPlayerEntity.frame &= ~0x10;
+ if (gPlayerEntity.base.frame & 0x10) {
+ gPlayerEntity.base.frame &= ~0x10;
SoundReq(468);
}
- if ((u16)gPlayerEntity.spriteIndex != local->anim >> 8 || gPlayerEntity.animIndex != (u8)local->anim)
+ if ((u16)gPlayerEntity.base.spriteIndex != local->anim >> 8 || gPlayerEntity.base.animIndex != (u8)local->anim)
DeleteThisEntity();
- tmp = gPlayerEntity.frameIndex - super->timer + super->subtimer;
+ tmp = gPlayerEntity.base.frameIndex - super->timer + super->subtimer;
if (tmp != super->frameIndex) {
super->frameIndex = tmp;
sub_080042D0(super, super->frameIndex, (u16)super->spriteIndex);
diff --git a/src/object/cutsceneOrchestrator.c b/src/object/cutsceneOrchestrator.c
index e844b93d..efc726a3 100644
--- a/src/object/cutsceneOrchestrator.c
+++ b/src/object/cutsceneOrchestrator.c
@@ -4,7 +4,6 @@
*
* @brief Cutscene Orchestrator object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "functions.h"
#include "hitbox.h"
diff --git a/src/object/deathFx.c b/src/object/deathFx.c
index e6121ec0..2f51e110 100644
--- a/src/object/deathFx.c
+++ b/src/object/deathFx.c
@@ -4,7 +4,6 @@
*
* @brief Death Fx object
*/
-#define NENT_DEPRECATED
#include "object/deathFx.h"
#include "enemy.h"
#include "entity.h"
@@ -81,7 +80,7 @@ void DeathFx_Action0(DeathFxObject* this) {
super->action = 1;
EnqueueSFX(SFX_FF);
}
- SetDefaultPriority(super, 3);
+ SetEntityPriority(super, 3);
}
void DeathFx_Action1(DeathFxObject* this) {
diff --git a/src/object/dirtParticle.c b/src/object/dirtParticle.c
index 8bf6bd31..827456c2 100644
--- a/src/object/dirtParticle.c
+++ b/src/object/dirtParticle.c
@@ -4,7 +4,6 @@
*
* @brief Dirt Particle object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
@@ -91,7 +90,7 @@ void DirtParticle_Init(DirtParticleEntity* this) {
}
super->x.HALF.HI += tmp;
super->y.HALF.HI += tmp;
- super->collisionLayer = gPlayerEntity.collisionLayer;
+ super->collisionLayer = gPlayerEntity.base.collisionLayer;
InitializeAnimation(super, 10);
return;
case 1:
diff --git a/src/object/doubleBookshelf.c b/src/object/doubleBookshelf.c
index f35c0684..b2eac828 100644
--- a/src/object/doubleBookshelf.c
+++ b/src/object/doubleBookshelf.c
@@ -4,7 +4,6 @@
*
* @brief Double Bookshelf object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "tiles.h"
@@ -147,7 +146,7 @@ void sub_0809B234(DoubleBookshelfEntity* this) {
}
void sub_0809B274(DoubleBookshelfEntity* this) {
- Entity* player = &gPlayerEntity;
+ Entity* player = &gPlayerEntity.base;
switch (this->unk_84) {
case 0:
if (player->y.HALF.HI + 0x14 >= super->y.HALF.HI) {
diff --git a/src/object/elementsBackground.c b/src/object/elementsBackground.c
index e02bba1b..f046d3b7 100644
--- a/src/object/elementsBackground.c
+++ b/src/object/elementsBackground.c
@@ -4,7 +4,6 @@
*
* @brief Elements Background object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "functions.h"
#include "screen.h"
diff --git a/src/object/enemyItem.c b/src/object/enemyItem.c
index 3f199ff8..16cae432 100644
--- a/src/object/enemyItem.c
+++ b/src/object/enemyItem.c
@@ -4,7 +4,6 @@
*
* @brief Enemy Item object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
diff --git a/src/object/evilSpirit.c b/src/object/evilSpirit.c
index 3b1a2d1e..8cda56fe 100644
--- a/src/object/evilSpirit.c
+++ b/src/object/evilSpirit.c
@@ -1,4 +1,3 @@
-#define NENT_DEPRECATED
#include "entity.h"
#include "functions.h"
#include "flags.h"
@@ -87,7 +86,8 @@ void EvilSpirit_Action1(EvilSpiritEntity* this) {
CalculateDirectionFromOffsets(super->parent->x.WORD - super->x.WORD, super->parent->y.WORD - super->y.WORD) ^ 0x80;
} else {
super->speed = 0x600;
- dir = CalculateDirectionFromOffsets(gPlayerEntity.x.WORD - super->x.WORD, gPlayerEntity.y.WORD - super->y.WORD) ^ 0x80;
+ dir = CalculateDirectionFromOffsets(gPlayerEntity.base.x.WORD - super->x.WORD, gPlayerEntity.base.y.WORD - super->y.WORD) ^
+ 0x80;
if (dir != super->direction) {
if ((u8)(dir - super->direction) > 0x80) {
super->direction += 3;
@@ -95,7 +95,7 @@ void EvilSpirit_Action1(EvilSpiritEntity* this) {
super->direction -= 3;
}
}
- if ((gPlayerEntity.animationState & 2) == 0) {
+ if ((gPlayerEntity.base.animationState & 2) == 0) {
this->unk76 = this->unk7c + 0x40;
} else {
this->unk76 = this->unk7c - 0x20;
@@ -113,7 +113,7 @@ void EvilSpirit_Action1(EvilSpiritEntity* this) {
super->direction++;
super->gustJarTolerance--;
this->unk7f = 1;
- if ((gPlayerEntity.animationState & 2) == 0) {
+ if ((gPlayerEntity.base.animationState & 2) == 0) {
this->unk76 = this->unk7c + 0x10;
} else {
this->unk76 = this->unk7c - 0x20;
@@ -184,7 +184,7 @@ void EvilSpirit_Action3(EvilSpiritEntity* this) {
super->gustJarTolerance--;
this->unk7f = 1;
- if ((gPlayerEntity.animationState & 2) == 0) {
+ if ((gPlayerEntity.base.animationState & 2) == 0) {
this->unk76 = this->unk7c + 0x10;
} else {
this->unk76 = this->unk7c - 0x20;
diff --git a/src/object/eyeSwitch.c b/src/object/eyeSwitch.c
index 8769fd4f..152d511a 100644
--- a/src/object/eyeSwitch.c
+++ b/src/object/eyeSwitch.c
@@ -4,7 +4,6 @@
*
* @brief EyeSwitch object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "flags.h"
#include "hitbox.h"
diff --git a/src/object/ezloCap.c b/src/object/ezloCap.c
index 6465dad9..de1beb00 100644
--- a/src/object/ezloCap.c
+++ b/src/object/ezloCap.c
@@ -4,7 +4,6 @@
*
* @brief Ezlo Cap object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "message.h"
#include "object.h"
@@ -56,12 +55,12 @@ void EzloCap(EzloCapEntity* this) {
void EzloCap_Type0Init(EzloCapEntity* this) {
super->updatePriority = 6;
- super->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
- super->spritePriority.b0 = gPlayerEntity.spritePriority.b0 - 1;
- super->palette.b.b0 = gPlayerEntity.palette.b.b0;
- super->collisionLayer = gPlayerEntity.collisionLayer;
+ super->spriteRendering.b3 = gPlayerEntity.base.spriteRendering.b3;
+ super->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0 - 1;
+ super->palette.b.b0 = gPlayerEntity.base.palette.b.b0;
+ super->collisionLayer = gPlayerEntity.base.collisionLayer;
super->action = 1;
- if (gPlayerEntity.animationState == 2) {
+ if (gPlayerEntity.base.animationState == 2) {
super->spriteSettings.flipX = 1;
}
LoadSwapGFX(super, 1, 3);
@@ -79,13 +78,13 @@ void EzloCap_Type0Init(EzloCapEntity* this) {
void EzloCap_Type0Action1(EzloCapEntity* this) {
static const u8 gUnk_0811F16C[] = { 4, 0, 2, 6, 10, 8, 9, 5, 1, 0, 0, 0 };
- u32 tmp = gPlayerEntity.palette.b.b0;
+ u32 tmp = gPlayerEntity.base.palette.b.b0;
super->palette.b.b0 = tmp;
- if ((gMessage.doTextBox & 0x7f) == 0) {
+ if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
DeleteEntity(super);
return;
}
- if ((gMessage.doTextBox & 0x7f) != 5) {
+ if ((gMessage.state & MESSAGE_ACTIVE) != 5) {
if (((gMessage.unk == 0xa) || (gMessage.unk == 0)) || ((gMessage.unk & 0xf) > 9)) {
if (super->animIndex != (super->subtimer | 3)) {
InitAnimationForceUpdate(super, super->subtimer | 3);
@@ -161,8 +160,8 @@ void EzloCap_Type1Action1(EzloCapEntity* this) {
void EzloCap_ScriptedInit(EzloCapEntity* this) {
super->updatePriority = 2;
- super->palette.b.b0 = gPlayerEntity.palette.b.b0;
- super->collisionLayer = gPlayerEntity.collisionLayer;
+ super->palette.b.b0 = gPlayerEntity.base.palette.b.b0;
+ super->collisionLayer = gPlayerEntity.base.collisionLayer;
super->spritePriority.b1 = 3;
super->spriteSettings.shadow = 1;
super->action = 1;
@@ -171,7 +170,7 @@ void EzloCap_ScriptedInit(EzloCapEntity* this) {
this->unk_82 = 0;
ExecuteScript(super, this->unk_84);
sub_08082D20(this, this->unk_84);
- if (gPlayerEntity.animationState == 2) {
+ if (gPlayerEntity.base.animationState == 2) {
super->spriteSettings.flipX = 1;
}
sub_08082C5C(this);
diff --git a/src/object/ezloCapFlying.c b/src/object/ezloCapFlying.c
index d05ada5f..91c197a0 100644
--- a/src/object/ezloCapFlying.c
+++ b/src/object/ezloCapFlying.c
@@ -4,9 +4,7 @@
*
* @brief Ezlo Cap Flying object
*/
-#define NENT_DEPRECATED
#include "functions.h"
-#include "new_player.h"
#include "object.h"
typedef struct {
@@ -32,7 +30,7 @@ void EzloCapFlying(EzloCapFlyingEntity* this) {
};
if ((gPlayerState.flags & PL_PARACHUTE) == 0) {
if (super->type == 0) {
- gRoomControls.camera_target = &gPlayerEntity;
+ gRoomControls.camera_target = &gPlayerEntity.base;
}
DeleteThisEntity();
}
@@ -42,7 +40,7 @@ void EzloCapFlying(EzloCapFlyingEntity* this) {
void EzloCapFlying_Init(EzloCapFlyingEntity* this) {
super->action = 1;
super->lastFrameIndex = 0xff;
- super->palette.b.b0 = gPlayerEntity.palette.b.b0;
+ super->palette.b.b0 = gPlayerEntity.base.palette.b.b0;
if (super->type == 0) {
gRoomControls.camera_target = super;
super->spriteRendering.b0 = 3;
@@ -66,7 +64,7 @@ void EzloCapFlying_Action1Type0(EzloCapFlyingEntity* this) {
if ((s16)this->unk_6e < 0) {
this->unk_6e = -this->unk_6e;
}
- switch (gPlayerEntity.subAction) {
+ switch (gPlayerEntity.base.subAction) {
case 1:
this->unk_72 -= 4;
break;
@@ -104,10 +102,10 @@ void EzloCapFlying_Action1Type0(EzloCapFlyingEntity* this) {
sub_080936C8(this);
break;
}
- tmp = gPlayerEntity.animationState & 2;
+ tmp = gPlayerEntity.base.animationState & 2;
if (tmp != 0) {
super->frameIndex = 1;
- if (gPlayerEntity.animationState == 2) {
+ if (gPlayerEntity.base.animationState == 2) {
this->unk_6e = -this->unk_6e;
}
} else {
@@ -117,32 +115,32 @@ void EzloCapFlying_Action1Type0(EzloCapFlyingEntity* this) {
super->lastFrameIndex = super->frameIndex;
sub_080042D0(super, super->frameIndex, super->spriteIndex);
}
- CopyPosition(&gPlayerEntity, super);
+ CopyPosition(&gPlayerEntity.base, super);
- super->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
- super->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
+ super->spriteOrientation.flipY = gPlayerEntity.base.spriteOrientation.flipY;
+ super->spriteRendering.b3 = gPlayerEntity.base.spriteRendering.b3;
sub_0806FCF4(super, this->unk_72, 10, 2);
SetAffineInfo(super, this->unk_6e, this->unk_72, 0);
- sub_0806FEBC(&gPlayerEntity, 1, super);
+ sub_0806FEBC(&gPlayerEntity.base, 1, super);
}
void EzloCapFlying_Action1Type1(EzloCapFlyingEntity* this) {
- super->frameIndex = ((gPlayerEntity.direction + (gPlayerEntity.direction >> 1)) >> 2) + 2;
+ super->frameIndex = ((gPlayerEntity.base.direction + (gPlayerEntity.base.direction >> 1)) >> 2) + 2;
if (super->frameIndex != super->lastFrameIndex) {
super->lastFrameIndex = super->frameIndex;
sub_080042D0(super, super->frameIndex, super->spriteIndex);
}
- CopyPosition(&gPlayerEntity, super);
- super->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
- super->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
+ CopyPosition(&gPlayerEntity.base, super);
+ super->spriteOrientation.flipY = gPlayerEntity.base.spriteOrientation.flipY;
+ super->spriteRendering.b3 = gPlayerEntity.base.spriteRendering.b3;
sub_0806FCF4(super, ((EzloCapFlyingEntity*)super->parent)->unk_72, 0x18, 0);
super->spriteOffsetY = -super->spriteOffsetY;
- sub_0806FEBC(&gPlayerEntity, 0, super);
+ sub_0806FEBC(&gPlayerEntity.base, 0, super);
}
void sub_080936C8(EzloCapFlyingEntity* this) {
- s32 tmp = gNewPlayerEntity.unk_7c;
- this->unk_76 = 0x138 - (gNewPlayerEntity.unk_7c >> 2);
+ s32 tmp = gPlayerEntity.unk_7c.WORD_U;
+ this->unk_76 = 0x138 - (gPlayerEntity.unk_7c.WORD_U >> 2);
this->unk_74 = 8 - (tmp / 0x3c);
if (super->timer == 0) {
if (this->unk_76 < this->unk_6e) {
diff --git a/src/object/fairy.c b/src/object/fairy.c
index ba3b6703..871da3dd 100644
--- a/src/object/fairy.c
+++ b/src/object/fairy.c
@@ -4,7 +4,6 @@
*
* @brief Fairy object
*/
-#define NENT_DEPRECATED
#include "collision.h"
#include "functions.h"
#include "hitbox.h"
@@ -110,7 +109,7 @@ void Fairy_Init(FairyEntity* this) {
super->gustJarFlags = 1;
this->unk_74 = super->x.HALF.HI;
this->unk_76 = super->y.HALF.HI;
- SetDefaultPriority(super, 6);
+ SetEntityPriority(super, 6);
EnqueueSFX(SFX_136);
switch (super->type2) {
@@ -182,7 +181,7 @@ void Fairy_Action3(FairyEntity* this) {
} else {
CopyPosition(super->child, super);
super->z.HALF.HI--;
- if (IsColliding(super, &gPlayerEntity)) {
+ if (IsColliding(super, &gPlayerEntity.base)) {
sub_0808DB2C(this);
}
}
@@ -246,8 +245,8 @@ void sub_0808DAD0(FairyEntity* this) {
super->spriteSettings.draw = 1;
super->spritePriority.b1 = 2;
super->spriteOffsetY = -5;
- super->child = &gPlayerEntity;
- CopyPosition(&gPlayerEntity, super);
+ super->child = &gPlayerEntity.base;
+ CopyPosition(&gPlayerEntity.base, super);
}
void sub_0808DB2C(FairyEntity* this) {
@@ -255,5 +254,5 @@ void sub_0808DB2C(FairyEntity* this) {
super->subAction = 0;
super->flags |= ENT_COLLIDE;
super->flags2 = 1;
- CopyPosition(&gPlayerEntity, super);
+ CopyPosition(&gPlayerEntity.base, super);
}
diff --git a/src/object/fan.c b/src/object/fan.c
index b1197147..f786981a 100644
--- a/src/object/fan.c
+++ b/src/object/fan.c
@@ -4,7 +4,6 @@
*
* @brief Fan object
*/
-#define NENT_DEPRECATED
#include "collision.h"
#include "entity.h"
#include "flags.h"
@@ -115,7 +114,7 @@ void sub_0809EE44(FanEntity* this) {
uVar4 = (super->frame & 7);
super->speed = this->unk7e << uVar4;
if (uVar4 != 0) {
- pEVar1 = &gPlayerEntity;
+ pEVar1 = &gPlayerEntity.base;
if (sub_0809EF78(this, pEVar1)) {
if (PlayerCanBeMoved()) {
sub_08079E58(super->speed, super->direction);
@@ -136,8 +135,8 @@ void sub_0809EE44(FanEntity* this) {
bVar3 = 1;
break;
case 0x3:
- if (pEVar1->x.HALF.HI != gPlayerEntity.x.HALF.HI ||
- pEVar1->y.HALF.HI != gPlayerEntity.y.HALF.HI)
+ if (pEVar1->x.HALF.HI != gPlayerEntity.base.x.HALF.HI ||
+ pEVar1->y.HALF.HI != gPlayerEntity.base.y.HALF.HI)
bVar3 = 1;
break;
break;
diff --git a/src/object/fanWind.c b/src/object/fanWind.c
index 3f6d74b3..a33a58d7 100644
--- a/src/object/fanWind.c
+++ b/src/object/fanWind.c
@@ -4,7 +4,6 @@
*
* @brief Fan Wind object
*/
-#define NENT_DEPRECATED
#include "collision.h"
#include "entity.h"
#include "functions.h"
diff --git a/src/object/figurineDevice.c b/src/object/figurineDevice.c
index 2412f3e8..a9f97275 100644
--- a/src/object/figurineDevice.c
+++ b/src/object/figurineDevice.c
@@ -4,7 +4,6 @@
*
* @brief Figurine Device object
*/
-#define NENT_DEPRECATED
#include "figurineMenu.h"
#include "fileselect.h"
#include "functions.h"
@@ -103,7 +102,7 @@ void FigurineDevice_Init(FigurineDeviceEntity* this) {
case 2:
this->unk_7a = 0;
- SetDefaultPriority(super, 7);
+ SetEntityPriority(super, 7);
InitializeAnimation(super, 1);
break;
case 3:
@@ -114,7 +113,7 @@ void FigurineDevice_Init(FigurineDeviceEntity* this) {
this->unk_7b = 0;
this->unk_80 = 0;
sub_0808804C(this);
- SetDefaultPriority(super, 6);
+ SetEntityPriority(super, 6);
break;
}
}
@@ -719,7 +718,7 @@ void FigurineDevice_NoFigurinesLeftMessage(void) {
gMessage.rupees = 5;
}
#ifndef EU
- gPlayerEntity.animationState = 6;
+ gPlayerEntity.base.animationState = 6;
#endif
}
@@ -796,9 +795,9 @@ void sub_0808861C(FigurineDeviceEntity* this, ScriptExecutionContext* context) {
// If I understand this correctly then it checks if the player is at the lever
context->condition = CheckPlayerInRegion(168, 84, 12, 8);
#ifdef JP
- if ((gPlayerEntity.animationState != 0)) {
+ if ((gPlayerEntity.base.animationState != 0)) {
#else
- if ((gPlayerEntity.animationState != 0) || (gPlayerEntity.z.HALF.HI != 0)) {
+ if ((gPlayerEntity.base.animationState != 0) || (gPlayerEntity.base.z.HALF.HI != 0)) {
#endif
context->condition = 0;
}
@@ -808,7 +807,7 @@ void sub_0808861C(FigurineDeviceEntity* this, ScriptExecutionContext* context) {
#if !defined(JP)
void sub_08088658(FigurineDeviceEntity* this, ScriptExecutionContext* context) {
context->condition = CheckPlayerInRegion(120, 120, 16, 8); // And this is if the player is at the door
- if (gPlayerEntity.z.HALF.HI != 0) {
+ if (gPlayerEntity.base.z.HALF.HI != 0) {
context->condition = 0;
}
gActiveScriptInfo.flags |= 1;
diff --git a/src/object/fileScreenObjects.c b/src/object/fileScreenObjects.c
index ffb63ed0..ef5e45ca 100644
--- a/src/object/fileScreenObjects.c
+++ b/src/object/fileScreenObjects.c
@@ -4,7 +4,6 @@
*
* @brief File Screen Objects object
*/
-#define NENT_DEPRECATED
#include "fileselect.h"
#include "functions.h"
#include "main.h"
diff --git a/src/object/fireballChain.c b/src/object/fireballChain.c
index 3e9905a7..af1aa68e 100644
--- a/src/object/fireballChain.c
+++ b/src/object/fireballChain.c
@@ -4,7 +4,6 @@
*
* @brief Fireball Chain object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "functions.h"
#include "global.h"
diff --git a/src/object/fireplace.c b/src/object/fireplace.c
index 719ab4c9..95f29eee 100644
--- a/src/object/fireplace.c
+++ b/src/object/fireplace.c
@@ -4,7 +4,6 @@
*
* @brief Fireplace object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "tiles.h"
diff --git a/src/object/flame.c b/src/object/flame.c
index b31ae8a2..34013762 100644
--- a/src/object/flame.c
+++ b/src/object/flame.c
@@ -4,7 +4,6 @@
*
* @brief Flame object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "flags.h"
#include "functions.h"
diff --git a/src/object/floatingBlock.c b/src/object/floatingBlock.c
index 7457797f..79b784b5 100644
--- a/src/object/floatingBlock.c
+++ b/src/object/floatingBlock.c
@@ -4,7 +4,6 @@
*
* @brief Floating Block object
*/
-#define NENT_DEPRECATED
#include "object.h"
void FloatingBlock(Entity* this) {
diff --git a/src/object/floatingPlatform.c b/src/object/floatingPlatform.c
index 76f00964..3a260350 100644
--- a/src/object/floatingPlatform.c
+++ b/src/object/floatingPlatform.c
@@ -4,7 +4,6 @@
*
* @brief Floating Platform object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "functions.h"
#include "object.h"
@@ -64,9 +63,9 @@ bool32 sub_08086168(FloatingPlatformEntity* this) {
const u8* ptr;
ptr = gUnk_08120658 + super->type * 2;
- if (((EntityInRectRadius(super, &gPlayerEntity, ptr[0], ptr[1])) && PlayerCanBeMoved())) {
+ if (((EntityInRectRadius(super, &gPlayerEntity.base, ptr[0], ptr[1])) && PlayerCanBeMoved())) {
gPlayerState.field_0x14 = 1;
- if (gPlayerEntity.z.HALF.HI == 0) {
+ if (gPlayerEntity.base.z.HALF.HI == 0) {
return TRUE;
} else {
return FALSE;
diff --git a/src/object/fourElements.c b/src/object/fourElements.c
index 8576cf97..e364d7cb 100644
--- a/src/object/fourElements.c
+++ b/src/object/fourElements.c
@@ -4,7 +4,6 @@
*
* @brief Four Elements object
*/
-#define NENT_DEPRECATED
#include "collision.h"
#include "functions.h"
#include "hitbox.h"
@@ -108,7 +107,7 @@ void FourElements_Action3(FourElementsEntity* this) {
if (super->timer != 0) {
sub_080A0424(this);
if (--super->timer == 0) {
- SetDefaultPriority(&gPlayerEntity, 0);
+ SetEntityPriority(&gPlayerEntity.base, 0);
}
} else {
RequestPriorityDuration(NULL, 60);
@@ -138,7 +137,7 @@ void FourElements_Action5(FourElementsEntity* this) {
void FourElements_Action6(FourElementsEntity* this) {
RequestPriorityDuration(NULL, 10);
- if ((gMessage.doTextBox & 0x7f) == 0) {
+ if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
SetPriorityTimer(90);
gPlayerState.controlMode = 1;
EnablePauseMenu();
diff --git a/src/object/frozenFlower.c b/src/object/frozenFlower.c
index d046715c..0b93b1de 100644
--- a/src/object/frozenFlower.c
+++ b/src/object/frozenFlower.c
@@ -4,7 +4,6 @@
*
* @brief Frozen Flower object
*/
-#define NENT_DEPRECATED
#include "object.h"
void FrozenFlower_Init(Entity*);
diff --git a/src/object/frozenOctorok.c b/src/object/frozenOctorok.c
index 7aaaac94..be88eb5f 100644
--- a/src/object/frozenOctorok.c
+++ b/src/object/frozenOctorok.c
@@ -4,7 +4,6 @@
*
* @brief Frozen Octorok object
*/
-#define NENT_DEPRECATED
#include "enemy/octorokBoss.h"
#include "functions.h"
#include "message.h"
@@ -64,7 +63,7 @@ void FrozenOctorok_Init(FrozenOctorokEntity* this) {
super->action = 1;
switch (super->type) {
case 0:
- SetDefaultPriority(super, 6);
+ SetEntityPriority(super, 6);
this->unk_7e = 0;
case 6:
super->timer = 1;
@@ -267,7 +266,7 @@ void FrozenOctorok_Action1SubAction0(FrozenOctorokEntity* this) {
void FrozenOctorok_Action1SubAction1(FrozenOctorokEntity* this) {
Entity* obj;
- if ((gMessage.doTextBox & 0x7f) == 0) {
+ if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
if (this->unk_79-- == 0) {
obj = CreateObjectWithParent(super, FROZEN_OCTOROK, 7, 0);
if (obj != NULL) {
@@ -387,7 +386,7 @@ void FrozenOctorok_Action1SubAction6(FrozenOctorokEntity* this) {
LinearMoveUpdate(super);
if ((gRoomControls.origin_y + 0x1c8) < super->y.HALF.HI) {
gRoomControls.scrollSpeed = 4;
- gRoomControls.camera_target = &gPlayerEntity;
+ gRoomControls.camera_target = &gPlayerEntity.base;
SetLocalFlag(0x9b);
DeleteEntity(super->parent);
DeleteEntity(&this->heap->mouthObject->base);
@@ -421,16 +420,9 @@ void sub_0809CB70(FrozenOctorokEntity* this, s32 angle, s32 radius) {
}
void sub_0809CBE4(FrozenOctorokEntity* this) {
- u16 tmp1;
- FORCE_REGISTER(u8 tmp4, r4);
- u8* tmp3 = &this->unk_79;
- tmp1 = super->subtimer;
- tmp4 = *tmp3;
- tmp1 += tmp4;
- this->unk_79 = tmp1;
+ this->unk_79 += super->subtimer;
if ((s8)super->subtimer < 0) {
- u8 tmp_r0 = super->timer;
- if (tmp1 << 0x18 < -tmp_r0 << 0x18) {
+ if ((s8)this->unk_79 < (s8)-super->timer) {
super->subtimer = -super->subtimer;
SoundReq(SFX_19E);
}
diff --git a/src/object/frozenWaterElement.c b/src/object/frozenWaterElement.c
index c5f620f1..a9bfed05 100644
--- a/src/object/frozenWaterElement.c
+++ b/src/object/frozenWaterElement.c
@@ -4,7 +4,6 @@
*
* @brief Frozen Water Element object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "tiles.h"
diff --git a/src/object/furniture.c b/src/object/furniture.c
index d3b3f652..77599943 100644
--- a/src/object/furniture.c
+++ b/src/object/furniture.c
@@ -4,7 +4,6 @@
*
* @brief Furniture object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "functions.h"
#include "object.h"
@@ -309,7 +308,8 @@ static void FurnitureInit(FurnitureEntity* this) {
static void FurnitureUpdate(FurnitureEntity* this) {
switch (this->flags & 0x7FFF) {
case 0x1:
- if (gPlayerEntity.y.HALF.HI < super->y.HALF.HI || gPlayerEntity.y.HALF.HI > super->y.HALF.HI + 24) {
+ if (gPlayerEntity.base.y.HALF.HI < super->y.HALF.HI ||
+ gPlayerEntity.base.y.HALF.HI > super->y.HALF.HI + 24) {
super->spriteRendering.b3 = 2;
} else {
super->spriteRendering.b3 = 3;
@@ -337,7 +337,7 @@ static void FurnitureUpdate(FurnitureEntity* this) {
}
break;
case 0x80:
- if (gPlayerEntity.y.HALF.HI < super->y.HALF.HI + 8) {
+ if (gPlayerEntity.base.y.HALF.HI < super->y.HALF.HI + 8) {
if (gPlayerState.floor_type != SURFACE_LADDER &&
GetMetaTileTypeByEntity(super) == SPECIAL_META_TILE_23) {
SetMetaTile(SPECIAL_META_TILE_38, this->tilePos, super->collisionLayer);
@@ -345,9 +345,9 @@ static void FurnitureUpdate(FurnitureEntity* this) {
SetMetaTile(SPECIAL_META_TILE_61, this->tilePos + TILE_POS(0, -2), super->collisionLayer);
}
} else {
- if (gPlayerEntity.collisionLayer & 2) {
- gPlayerEntity.collisionLayer = 1;
- UpdateSpriteForCollisionLayer(&gPlayerEntity);
+ if (gPlayerEntity.base.collisionLayer & 2) {
+ gPlayerEntity.base.collisionLayer = 1;
+ UpdateSpriteForCollisionLayer(&gPlayerEntity.base);
}
if (GetMetaTileTypeByEntity(super) != SPECIAL_META_TILE_23) {
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos, super->collisionLayer);
diff --git a/src/object/gentariCurtain.c b/src/object/gentariCurtain.c
index 6e525c1a..f6f86b8c 100644
--- a/src/object/gentariCurtain.c
+++ b/src/object/gentariCurtain.c
@@ -4,7 +4,6 @@
*
* @brief Gentari Curtain object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "flags.h"
@@ -97,7 +96,7 @@ void sub_080921BC(GentariCurtainEntity* this) {
GenericEntity* pEVar1;
GenericEntity* end;
- pEVar1 = (GenericEntity*)gItemGetEntities;
+ pEVar1 = (GenericEntity*)gAuxPlayerEntities;
end = pEVar1 + 0x4f;
do {
diff --git a/src/object/giantBookLadder.c b/src/object/giantBookLadder.c
index 37e60040..1cf7d455 100644
--- a/src/object/giantBookLadder.c
+++ b/src/object/giantBookLadder.c
@@ -4,7 +4,6 @@
*
* @brief Giant Book Ladder object
*/
-#define NENT_DEPRECATED
#include "manager.h"
#include "map.h"
#include "object.h"
diff --git a/src/object/giantLeaf.c b/src/object/giantLeaf.c
index 92199533..338678e0 100644
--- a/src/object/giantLeaf.c
+++ b/src/object/giantLeaf.c
@@ -4,7 +4,6 @@
*
* @brief Giant Leaf object
*/
-#define NENT_DEPRECATED
#include "map.h"
#include "object.h"
diff --git a/src/object/giantRock.c b/src/object/giantRock.c
index 9c7cf68f..c8a5747e 100644
--- a/src/object/giantRock.c
+++ b/src/object/giantRock.c
@@ -4,7 +4,6 @@
*
* @brief Giant Rock object
*/
-#define NENT_DEPRECATED
#include "entity.h"
void GiantRock(Entity* this) {
diff --git a/src/object/giantRock2.c b/src/object/giantRock2.c
index 8c0a21a7..6cd33a02 100644
--- a/src/object/giantRock2.c
+++ b/src/object/giantRock2.c
@@ -4,7 +4,6 @@
*
* @brief Giant Rock 2 object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "room.h"
diff --git a/src/object/giantTwig.c b/src/object/giantTwig.c
index 3acf592b..29e74d1a 100644
--- a/src/object/giantTwig.c
+++ b/src/object/giantTwig.c
@@ -4,7 +4,6 @@
*
* @brief Giant Twig object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "tiles.h"
@@ -104,7 +103,7 @@ void GiantTwig_Type0Init(GiantTwigEntity* this) {
void GiantTwig_Type0Idle(GiantTwigEntity* this) {
if (super->type == 0) {
- if (gPlayerEntity.y.HALF.HI < super->y.HALF.HI + 0x20) {
+ if (gPlayerEntity.base.y.HALF.HI < super->y.HALF.HI + 0x20) {
super->spriteRendering.b3 = 1;
} else {
super->spriteRendering.b3 = 2;
diff --git a/src/object/gleerokParticle.c b/src/object/gleerokParticle.c
index 5595ccda..23bd5d17 100644
--- a/src/object/gleerokParticle.c
+++ b/src/object/gleerokParticle.c
@@ -4,7 +4,6 @@
*
* @brief Gleerok Particle object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "effects.h"
#include "entity.h"
@@ -78,11 +77,11 @@ void GleerokParticle_Init(GleerokParticleEntity* this) {
gRoomControls.camera_target = super;
} else {
if (--this->unk78 == -1) {
- gRoomControls.camera_target = &gPlayerEntity;
+ gRoomControls.camera_target = &gPlayerEntity.base;
DeleteThisEntity();
}
}
- sub_08078B48();
+ PausePlayer();
return;
case 0:
super->direction = gUnk_081229D0[super->type2].direction;
diff --git a/src/object/graveyardKey.c b/src/object/graveyardKey.c
index bef307ed..699bb95a 100644
--- a/src/object/graveyardKey.c
+++ b/src/object/graveyardKey.c
@@ -4,7 +4,6 @@
*
* @brief Graveyard Key object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "collision.h"
#include "effects.h"
@@ -93,7 +92,7 @@ void GraveyardKey_Init(Entity* this, const struct_gUnk_08123FB0* param_2) {
if ((this->direction & DIR_NOT_MOVING_CHECK)) {
dir = this->direction;
if (dir == (DIR_NOT_MOVING_CHECK | 0x1)) {
- this->direction = (((gPlayerEntity.animationState * 4 + (Random() & 3)) - 2) & 0x1f) ^ DirectionSouth;
+ this->direction = (((gPlayerEntity.base.animationState * 4 + (Random() & 3)) - 2) & 0x1f) ^ DirectionSouth;
}
}
UpdateSpriteForCollisionLayer(this);
@@ -131,7 +130,7 @@ void GraveyardKey_Action2(Entity* this, const struct_gUnk_08123FB0* param_2) {
this->zVelocity = param_2->unk14 << 3;
} else {
this->action++;
- this->collisionLayer = gPlayerEntity.collisionLayer;
+ this->collisionLayer = gPlayerEntity.base.collisionLayer;
UpdateSpriteForCollisionLayer(this);
if (param_2->funcEnt != NULL) {
param_2->funcEnt(this);
@@ -178,13 +177,14 @@ void sub_0809D91C(Entity* this) {
bool32 sub_0809D93C(Entity* this, const struct_gUnk_08123FB0* param_2) {
u32 uVar1;
- if (gPlayerEntity.action == PLAYER_BOUNCE && ((param_2->unk0c >> gPlayerEntity.animationState & 1) != 0)) {
- uVar1 = (gPlayerEntity.x.HALF.HI - this->x.HALF.HI) + param_2->unk08 + param_2->unk0a;
+ if (gPlayerEntity.base.action == PLAYER_BOUNCE &&
+ ((param_2->unk0c >> gPlayerEntity.base.animationState & 1) != 0)) {
+ uVar1 = (gPlayerEntity.base.x.HALF.HI - this->x.HALF.HI) + param_2->unk08 + param_2->unk0a;
if (param_2->unk0a * 2 <= (u16)uVar1) {
return 0;
}
- uVar1 = (gPlayerEntity.y.HALF.HI - (this->y.HALF.HI + param_2->y)) + param_2->unk09 + param_2->unk0b;
+ uVar1 = (gPlayerEntity.base.y.HALF.HI - (this->y.HALF.HI + param_2->y)) + param_2->unk09 + param_2->unk0b;
if (param_2->unk0b * 2 > (u16)uVar1) {
return 1;
}
diff --git a/src/object/greatFairy.c b/src/object/greatFairy.c
index 6820317a..3099571c 100644
--- a/src/object/greatFairy.c
+++ b/src/object/greatFairy.c
@@ -4,7 +4,6 @@
*
* @brief Great Fairy object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "save.h"
@@ -66,12 +65,12 @@ void GreatFairy(GreatFairyEntity* this) {
void GreatFairy_CallBehavior(GreatFairyEntity* this) {
GreatFairy_Behaviors[super->action](this);
- if ((gPlayerEntity.y.HALF.HI - gRoomControls.origin_y) < 168) {
+ if ((gPlayerEntity.base.y.HALF.HI - gRoomControls.origin_y) < 168) {
gRoomControls.camera_target = super;
gRoomControls.scrollSpeed = 2;
} else {
- gRoomControls.camera_target = &gPlayerEntity;
+ gRoomControls.camera_target = &gPlayerEntity.base;
gRoomControls.scrollSpeed = 2;
}
}
@@ -497,7 +496,7 @@ void GreatFairy_InitializeAnimation(GreatFairyEntity* this) {
super->type2 = super->type % temp;
super->collisionLayer = 2;
InitializeAnimation(super, super->type2);
- SetDefaultPriority(super, PRIO_MESSAGE);
+ SetEntityPriority(super, PRIO_MESSAGE);
}
Entity* GreatFairy_CreateForm(GreatFairyEntity* this, u32 curForm, u32 parameter) {
@@ -542,9 +541,9 @@ void sub_08087424(GreatFairyEntity* this, ScriptExecutionContext* context) {
ResetPlayerAnimationAndAction();
ent = CreateObject(THUNDERBOLT, 0, 0);
if (ent != NULL) {
- ent->parent = &gPlayerEntity;
- CopyPosition(&gPlayerEntity, ent);
- SetDefaultPriority(ent, PRIO_MESSAGE);
+ ent->parent = &gPlayerEntity.base;
+ CopyPosition(&gPlayerEntity.base, ent);
+ SetEntityPriority(ent, PRIO_MESSAGE);
}
switch (context->intVariable) {
diff --git a/src/object/guruguruBar.c b/src/object/guruguruBar.c
index 0de3796d..40fa7d41 100644
--- a/src/object/guruguruBar.c
+++ b/src/object/guruguruBar.c
@@ -4,7 +4,6 @@
*
* @brief Guruguru Bar object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "functions.h"
#include "object.h"
@@ -52,7 +51,7 @@ void GuruguruBar_Init(GuruguruBarEntity* this) {
bVar1 = this->unk7e;
this->unk76 = bVar1 << 8;
super->animationState = bVar1 << 6;
- SetDefaultPriority(super, 0);
+ SetEntityPriority(super, 0);
if (super->type != 0) {
super->child = (Entity*)GetCurrentRoomProperty(super->type);
UpdateRailMovement(super, (u16**)&super->child, &this->unk74);
diff --git a/src/object/gustJarParticle.c b/src/object/gustJarParticle.c
index 4c03551f..afbc0aa1 100644
--- a/src/object/gustJarParticle.c
+++ b/src/object/gustJarParticle.c
@@ -4,7 +4,6 @@
*
* @brief Gust Jar Particle object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "physics.h"
@@ -26,10 +25,10 @@ void GustJarParticle(Entity* this) {
void GustJarParticle_Init(Entity* this) {
this->action = 1;
this->speed = 0x80;
- this->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
- this->spritePriority.b0 = gPlayerEntity.spritePriority.b0;
- this->collisionLayer = gPlayerEntity.collisionLayer;
- this->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
+ this->spriteRendering.b3 = gPlayerEntity.base.spriteRendering.b3;
+ this->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0;
+ this->collisionLayer = gPlayerEntity.base.collisionLayer;
+ this->spriteOrientation.flipY = gPlayerEntity.base.spriteOrientation.flipY;
this->type = Random() & 1;
InitializeAnimation(this, 0x11);
}
diff --git a/src/object/gyorgBossObject.c b/src/object/gyorgBossObject.c
index a5c34d89..2de64ed0 100644
--- a/src/object/gyorgBossObject.c
+++ b/src/object/gyorgBossObject.c
@@ -4,7 +4,6 @@
*
* @brief Gyorg Boss object
*/
-#define NENT_DEPRECATED
#include "area.h"
#include "enemy/gyorg.h"
#include "entity.h"
@@ -229,7 +228,7 @@ void GyorgBossObject_FemalePhase4(GyorgBossObjectEntity* this) {
}
this->unk_6c = 0;
gRoomTransition.field_0x39 = 0;
- if (PlayerCanBeMoved() && gPlayerEntity.z.HALF.HI == 0) {
+ if (PlayerCanBeMoved() && gPlayerEntity.base.z.HALF.HI == 0) {
super->action = 9;
super->timer = 0;
super->subtimer = 240;
@@ -237,7 +236,7 @@ void GyorgBossObject_FemalePhase4(GyorgBossObjectEntity* this) {
super->direction = 0;
super->speed = 0x60;
gPlayerState.flags &= ~PL_GYORG_FIGHT;
- CopyPosition(&gPlayerEntity, super);
+ CopyPosition(&gPlayerEntity.base, super);
gRoomControls.camera_target = super;
SetPlayerControl(2);
}
@@ -464,7 +463,7 @@ void sub_080A1FF0(GyorgBossObjectEntity* this) {
}
}
if (this->unk_7b) {
- if (EntityWithinDistance(&gPlayerEntity, gRoomControls.origin_x + 0x200, gRoomControls.origin_y + 0x210,
+ if (EntityWithinDistance(&gPlayerEntity.base, gRoomControls.origin_x + 0x200, gRoomControls.origin_y + 0x210,
0x100)) {
if (super->timer == 0) {
super->timer = 120;
@@ -483,7 +482,7 @@ u32 sub_080A20B8(GyorgBossObjectEntity* this, GyorgMaleEntity* other) {
if (other == NULL) {
return 1;
}
- if (PlayerCanBeMoved() && gPlayerEntity.z.HALF.HI == 0) {
+ if (PlayerCanBeMoved() && gPlayerEntity.base.z.HALF.HI == 0) {
return other->unk_7c == 0 && gPlayerState.field_0x14 != 0;
}
return 0;
diff --git a/src/object/heartContainer.c b/src/object/heartContainer.c
index 95d1b074..1817b8c3 100644
--- a/src/object/heartContainer.c
+++ b/src/object/heartContainer.c
@@ -4,7 +4,6 @@
*
* @brief HeartContainer object
*/
-#define NENT_DEPRECATED
#include "collision.h"
#include "entity.h"
#include "flags.h"
diff --git a/src/object/hiddenLadderDown.c b/src/object/hiddenLadderDown.c
index 2f482dfe..5013d7d0 100644
--- a/src/object/hiddenLadderDown.c
+++ b/src/object/hiddenLadderDown.c
@@ -4,7 +4,6 @@
*
* @brief Hidden Ladder Down object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "flags.h"
diff --git a/src/object/hitSwitch.c b/src/object/hitSwitch.c
index a0931519..4763a4ac 100644
--- a/src/object/hitSwitch.c
+++ b/src/object/hitSwitch.c
@@ -4,7 +4,6 @@
*
* @brief Hit Switch object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "physics.h"
diff --git a/src/object/hittableLever.c b/src/object/hittableLever.c
index d92fbfa3..8e6b63be 100644
--- a/src/object/hittableLever.c
+++ b/src/object/hittableLever.c
@@ -4,7 +4,6 @@
*
* @brief Hittable Lever object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
diff --git a/src/object/houseDoorExterior.c b/src/object/houseDoorExterior.c
index 5b0a94f6..79ecf0d8 100644
--- a/src/object/houseDoorExterior.c
+++ b/src/object/houseDoorExterior.c
@@ -4,7 +4,6 @@
*
* @brief House Door Exterior object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "flags.h"
#include "functions.h"
@@ -62,7 +61,7 @@ void HouseDoorExterior_Type0(HouseDoorExteriorEntity* this) {
super->action = 1;
*((u32*)(&this->unk_68)) = 0;
this->unk_6c = super->timer;
- SetDefaultPriority(super, PRIO_PLAYER_EVENT);
+ SetEntityPriority(super, PRIO_PLAYER_EVENT);
}
prop = GetCurrentRoomProperty(this->unk_6c);
@@ -183,8 +182,8 @@ void sub_0808692C(HouseDoorExteriorEntity* this) {
static u8 sub_08086954(HouseDoorExteriorEntity* this) {
if (sub_0800445C(super)) {
- if (GetAnimationStateInRectRadius(super, 6, 20) >= 0 && gPlayerEntity.animationState == 0 &&
- (u16)gPlayerState.playerInput.heldInput == PLAYER_INPUT_UP && gPlayerState.jump_status == 0) {
+ if (GetAnimationStateInRectRadius(super, 6, 20) >= 0 && gPlayerEntity.base.animationState == 0 &&
+ (u16)gPlayerState.playerInput.heldInput == INPUT_UP && gPlayerState.jump_status == 0) {
super->timer--;
}
} else {
diff --git a/src/object/houseDoorInterior.c b/src/object/houseDoorInterior.c
index 8e69feef..f2a51b32 100644
--- a/src/object/houseDoorInterior.c
+++ b/src/object/houseDoorInterior.c
@@ -4,7 +4,6 @@
*
* @brief House Door Interior object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "flags.h"
#include "functions.h"
@@ -92,7 +91,8 @@ void HouseDoorInterior_Action1(HouseDoorInteriorEntity* this) {
if (sub_0800445C(super) && this->unk7d == 0) {
ptr = gUnk_081227CC + super->type2;
if (GetAnimationStateInRectRadius(super, ptr->x, ptr->y) >= 0 &&
- ptr->animationState == gPlayerEntity.animationState && gPlayerState.playerInput.heldInput & ptr->unk2) {
+ ptr->animationState == gPlayerEntity.base.animationState &&
+ gPlayerState.playerInput.heldInput & ptr->unk2) {
--super->timer;
}
} else {
diff --git a/src/object/houseSign.c b/src/object/houseSign.c
index 4353e3ad..149d3cc6 100644
--- a/src/object/houseSign.c
+++ b/src/object/houseSign.c
@@ -4,16 +4,9 @@
*
* @brief HouseSign object
*/
-#define NENT_DEPRECATED
-#include "asm.h"
-#include "entity.h"
+#include "object/houseSign.h"
-typedef struct {
- /*0x00*/ Entity base;
- /*0x68*/ u8 unused1[24];
- /*0x80*/ s16 unk_80;
- /*0x82*/ s16 unk_82;
-} HouseSignEntity;
+#include "asm.h"
/*
This object is created by HouseSignManager.
diff --git a/src/object/itemForSale.c b/src/object/itemForSale.c
index c0712e1f..bf5367a3 100644
--- a/src/object/itemForSale.c
+++ b/src/object/itemForSale.c
@@ -4,20 +4,12 @@
*
* @brief Item for Sale object
*/
-#define NENT_DEPRECATED
+#include "object/itemForSale.h"
+
#include "functions.h"
#include "hitbox.h"
#include "kinstone.h"
#include "message.h"
-#include "new_player.h"
-#include "object.h"
-
-typedef struct {
- /*0x00*/ Entity base;
- /*0x68*/ u8 unk_68[0x18];
- /*0x80*/ u16 unk_80;
- /*0x82*/ u16 unk_82;
-} ItemForSaleEntity;
typedef struct {
u8 before[0x20];
@@ -66,7 +58,7 @@ void ItemForSale_Init(ItemForSaleEntity* this) {
super->spritePriority.b1 = 0;
super->carryFlags = 0;
#ifdef EU
- SetDefaultPriority(super, 6);
+ SetEntityPriority(super, 6);
#endif
super->child = super;
ItemForSale_MakeInteractable(this);
@@ -96,10 +88,10 @@ void ItemForSale_Action1(ItemForSaleEntity* this) {
if (super->interactType != INTERACTION_NONE) {
super->interactType = INTERACTION_NONE;
super->subAction = 1;
- sub_08078B48();
+ PausePlayer();
ResetActiveItems();
gPlayerState.heldObject = 4;
- gNewPlayerEntity.unk_74 = super;
+ gPlayerEntity.unk_74 = super;
gHUD.rActionPlayerState = R_ACTION_DROP;
MessageClose();
}
@@ -111,15 +103,15 @@ void ItemForSale_Action2(ItemForSaleEntity* this) {
void* ptr;
gHUD.rActionPlayerState = R_ACTION_DROP;
- super->spriteSettings.draw = gPlayerEntity.spriteSettings.draw;
- if ((gPlayerState.heldObject == 0) || (super != gNewPlayerEntity.unk_74)) {
+ super->spriteSettings.draw = gPlayerEntity.base.spriteSettings.draw;
+ if ((gPlayerState.heldObject == 0) || (super != gPlayerEntity.unk_74)) {
sub_080819B4(this);
} else {
ptr = sub_080784E4();
if (((*(int*)(ptr + 8) == 0) || ((*(u8*)(ptr + 1) != 1 || (gHUD.rActionPlayerState = R_ACTION_SPEAK,
(gPlayerState.playerInput.newInput &
- (PLAYER_INPUT_80 | PLAYER_INPUT_8)) == 0)))) &&
- ((gPlayerState.playerInput.newInput & (PLAYER_INPUT_80 | PLAYER_INPUT_10 | PLAYER_INPUT_8)) != 0)) {
+ (INPUT_ACTION | INPUT_INTERACT)) == 0)))) &&
+ ((gPlayerState.playerInput.newInput & (INPUT_ACTION | INPUT_CANCEL | INPUT_INTERACT)) != 0)) {
sub_080819B4(this);
}
}
@@ -137,7 +129,7 @@ void sub_080819B4(ItemForSaleEntity* this) {
DeleteThisEntity();
}
gPlayerState.heldObject = 0;
- gNewPlayerEntity.unk_74 = 0;
+ gPlayerEntity.unk_74 = 0;
ptr = &gHUD;
gRoomVars.shopItemType = 0;
ptr->rActionInteractObject = R_ACTION_NONE;
@@ -148,7 +140,7 @@ void sub_080819B4(ItemForSaleEntity* this) {
super->z.WORD = 0;
super->action = 1;
super->subAction = 0;
- super->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
+ super->spriteOrientation.flipY = gPlayerEntity.base.spriteOrientation.flipY;
super->collisionLayer = 1;
super->spritePriority.b0 = 4;
UpdateSpriteForCollisionLayer(super);
diff --git a/src/object/itemOnGround.c b/src/object/itemOnGround.c
index 55762e21..8c74419c 100644
--- a/src/object/itemOnGround.c
+++ b/src/object/itemOnGround.c
@@ -4,7 +4,6 @@
*
* @brief Item On Ground object
*/
-#define NENT_DEPRECATED
#include "object/itemOnGround.h"
#include "collision.h"
#include "entity.h"
@@ -97,7 +96,7 @@ void ItemOnGround(ItemOnGroundEntity* this) {
}
if (super->type == 0x5C) {
- gRoomVars.field_0x4++;
+ gRoomVars.numKinstoneDrops++;
}
sub_08080CB4(super);
@@ -144,7 +143,7 @@ void ItemOnGround_Init(ItemOnGroundEntity* this) {
this->unk_6c = 0;
this->unk_68 = 0;
super->timer = 0;
- SetDefaultPriority(super, PRIO_NO_BLOCK);
+ SetEntityPriority(super, PRIO_NO_BLOCK);
super->gustJarFlags = sub_0808147C(super->type);
gUnk_0811E7E8[this->unk_69](this);
} else {
@@ -189,7 +188,7 @@ void sub_080810FC(ItemOnGroundEntity* this) {
super->subAction = 0;
COLLISION_ON(super);
super->flags2 = 0x11;
- CopyPosition(&gPlayerEntity, super);
+ CopyPosition(&gPlayerEntity.base, super);
}
}
@@ -298,10 +297,10 @@ void sub_080812A8(ItemOnGroundEntity* this) {
void sub_080812E8(ItemOnGroundEntity* this) {
PlayerState* playerState = &gPlayerState;
#ifdef EU
- if ((playerState->swim_state & 0x80) && IsColliding(super, &gPlayerEntity)) {
+ if ((playerState->swim_state & 0x80) && IsColliding(super, &gPlayerEntity.base)) {
#else
if ((playerState->swim_state & 0x80) && (playerState->flags & PL_MINISH) == 0 &&
- IsColliding(super, &gPlayerEntity)) {
+ IsColliding(super, &gPlayerEntity.base)) {
#endif
sub_080810FC(this);
}
@@ -317,7 +316,7 @@ void ItemOnGround_Action3(ItemOnGroundEntity* this) {
} else {
CopyPosition(other, super);
super->z.HALF.HI--;
- other = &gPlayerEntity;
+ other = &gPlayerEntity.base;
if (IsColliding(super, other)) {
sub_080810FC(this);
}
@@ -372,7 +371,7 @@ void sub_08081404(ItemOnGroundEntity* this, u32 arg1) {
bool32 sub_08081420(ItemOnGroundEntity* this) {
if (CheckShouldPlayItemGetCutscene(this)) {
- SetDefaultPriority(super, PRIO_PLAYER_EVENT);
+ SetEntityPriority(super, PRIO_PLAYER_EVENT);
CreateItemEntity(super->type, super->type2, 0);
return TRUE;
} else {
@@ -484,7 +483,7 @@ void sub_08081598(ItemOnGroundEntity* this) {
super->spriteSettings.draw = 1;
super->spritePriority.b1 = 2;
super->spritePriority.b0 = 3;
- super->child = &gPlayerEntity;
+ super->child = &gPlayerEntity.base;
CopyPosition(super->child, super);
super->z.HALF.HI -= 4;
if (super->type != 0x5F && sub_08081420(this)) {
diff --git a/src/object/jailBars.c b/src/object/jailBars.c
index d7bb0d2d..69e380fa 100644
--- a/src/object/jailBars.c
+++ b/src/object/jailBars.c
@@ -4,7 +4,6 @@
*
* @brief Jail Bars object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "flags.h"
#include "functions.h"
diff --git a/src/object/japaneseSubtitle.c b/src/object/japaneseSubtitle.c
index 745b7b1a..11e7f85f 100644
--- a/src/object/japaneseSubtitle.c
+++ b/src/object/japaneseSubtitle.c
@@ -4,7 +4,6 @@
*
* @brief Japanese Subtitle object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "menu.h"
#include "object.h"
diff --git a/src/object/jarPortal.c b/src/object/jarPortal.c
index 28512994..3d13c20a 100644
--- a/src/object/jarPortal.c
+++ b/src/object/jarPortal.c
@@ -4,7 +4,6 @@
*
* @brief Jar Portal object
*/
-#define NENT_DEPRECATED
#include "area.h"
#include "functions.h"
#include "object.h"
diff --git a/src/object/keyStealingTakkuri.c b/src/object/keyStealingTakkuri.c
index 98a0d543..a91b4845 100644
--- a/src/object/keyStealingTakkuri.c
+++ b/src/object/keyStealingTakkuri.c
@@ -4,7 +4,6 @@
*
* @brief Key Stealing Takkuri object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
@@ -170,7 +169,7 @@ void KeyStealingTakkuri_Type5_Action1(KeyStealingTakkuriEntity* this) {
super->zVelocity = Q_16_16(1.0);
} else {
super->action++;
- super->collisionLayer = gPlayerEntity.collisionLayer;
+ super->collisionLayer = gPlayerEntity.base.collisionLayer;
UpdateSpriteForCollisionLayer(super);
}
SoundReq(SFX_RUPEE_BOUNCE);
@@ -393,7 +392,7 @@ void sub_0809E0A0(KeyStealingTakkuriEntity* this) {
obj->parent = super;
super->child = obj;
super->subtimer = 0;
- CopyPosition(&gPlayerEntity, obj);
+ CopyPosition(&gPlayerEntity.base, obj);
obj->z.HALF.HI = -8;
}
}
@@ -415,7 +414,7 @@ void sub_0809E0D4(KeyStealingTakkuriEntity* this, ScriptExecutionContext* contex
return;
}
} else {
- entity = &gPlayerEntity;
+ entity = &gPlayerEntity.base;
}
context->unk_18++;
LookAt(super, context, entity->x.HALF.HI, entity->y.HALF.HI);
@@ -476,7 +475,8 @@ void sub_0809E1F0(KeyStealingTakkuriEntity* this) {
}
void sub_0809E210(KeyStealingTakkuriEntity* this) {
- gPlayerEntity.animationState = GetAnimationStateForDirection8(GetFacingDirection(&gPlayerEntity, super)) & 0xfe;
+ gPlayerEntity.base.animationState =
+ GetAnimationStateForDirection8(GetFacingDirection(&gPlayerEntity.base, super)) & 0xfe;
gPlayerState.animation = ANIM_DEFAULT;
}
@@ -505,8 +505,8 @@ u32 sub_0809E2C4(KeyStealingTakkuriEntity* this, u32 param_2) {
s32 roomY;
ptr = &gUnk_08124178[param_2 * 2];
- roomX = gPlayerEntity.x.HALF.HI - (gRoomControls.origin_x + ptr[0]);
- roomY = gPlayerEntity.y.HALF.HI - (gRoomControls.origin_y + ptr[1]);
+ roomX = gPlayerEntity.base.x.HALF.HI - (gRoomControls.origin_x + ptr[0]);
+ roomY = gPlayerEntity.base.y.HALF.HI - (gRoomControls.origin_y + ptr[1]);
tmp = gUnk_08124158;
counter = 0;
while (counter < 4) {
@@ -516,7 +516,7 @@ u32 sub_0809E2C4(KeyStealingTakkuriEntity* this, u32 param_2) {
uVar1 = roomY - tmp->unk_2 + tmp->unk_5;
uVar2 = tmp->unk_5 * 2;
if (uVar2 > (u16)uVar1) {
- if (tmp->unk_6 == gPlayerEntity.animationState && gPlayerEntity.action == PLAYER_BOUNCE) {
+ if (tmp->unk_6 == gPlayerEntity.base.animationState && gPlayerEntity.base.action == PLAYER_BOUNCE) {
return 1;
}
return 2;
diff --git a/src/object/kinstoneSpark.c b/src/object/kinstoneSpark.c
index 9591b100..b32609f2 100644
--- a/src/object/kinstoneSpark.c
+++ b/src/object/kinstoneSpark.c
@@ -4,7 +4,6 @@
*
* @brief Kinstone Fusion Particle object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "kinstone.h"
#include "object.h"
diff --git a/src/object/ladderHoleInBookshelf.c b/src/object/ladderHoleInBookshelf.c
index 9c856fe8..0082e9d3 100644
--- a/src/object/ladderHoleInBookshelf.c
+++ b/src/object/ladderHoleInBookshelf.c
@@ -4,7 +4,6 @@
*
* @brief Ladder Hole In Bookshelf object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "player.h"
@@ -30,7 +29,7 @@ void LadderHoleInBookshelf_Init(Entity* this) {
void LadderHoleInBookshelf_Action1(Entity* this) {
if (sub_08094064(this)) {
if (this->collisionLayer == 2) {
- switch (gPlayerEntity.action) {
+ switch (gPlayerEntity.base.action) {
case PLAYER_CLIMB:
case PLAYER_USEENTRANCE:
return;
@@ -39,7 +38,7 @@ void LadderHoleInBookshelf_Action1(Entity* this) {
UpdateSpriteForCollisionLayer(this);
this->spritePriority.b0 = 5;
} else {
- switch (gPlayerEntity.action) {
+ switch (gPlayerEntity.base.action) {
case PLAYER_CLIMB:
case PLAYER_USEENTRANCE:
this->collisionLayer = 2;
@@ -47,10 +46,10 @@ void LadderHoleInBookshelf_Action1(Entity* this) {
this->spritePriority.b0 = 1;
break;
default:
- if ((gPlayerEntity.collisionLayer & 2) == 0) {
+ if ((gPlayerEntity.base.collisionLayer & 2) == 0) {
break;
}
- gPlayerEntity.collisionLayer = 1;
+ gPlayerEntity.base.collisionLayer = 1;
break;
}
}
@@ -59,7 +58,7 @@ void LadderHoleInBookshelf_Action1(Entity* this) {
bool32 sub_08094064(Entity* this) {
bool32 rv = 1;
- if (gPlayerEntity.x.HALF.HI - this->x.HALF.HI + 0x1cU >= 0x39) {
+ if (gPlayerEntity.base.x.HALF.HI - this->x.HALF.HI + 0x1cU >= 0x39) {
rv = 0;
}
diff --git a/src/object/ladderUp.c b/src/object/ladderUp.c
index 4af652e7..4956d11d 100644
--- a/src/object/ladderUp.c
+++ b/src/object/ladderUp.c
@@ -4,7 +4,6 @@
*
* @brief Ladder Up object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "effects.h"
#include "entity.h"
@@ -66,7 +65,7 @@ void LadderUp(Entity* this) {
#endif
default:
if (this->type2 == 0) {
- if (gPlayerEntity.y.HALF.HI < this->y.HALF.HI) {
+ if (gPlayerEntity.base.y.HALF.HI < this->y.HALF.HI) {
if (gPlayerState.floor_type != SURFACE_LADDER &&
(GetMetaTileTypeByEntity(this) == SPECIAL_META_TILE_23)) {
SetMetaTile(SPECIAL_META_TILE_35, COORD_TO_TILE(this), this->collisionLayer);
diff --git a/src/object/lamp.c b/src/object/lamp.c
index 705d43e5..1992f36a 100644
--- a/src/object/lamp.c
+++ b/src/object/lamp.c
@@ -4,7 +4,6 @@
*
* @brief Lamp object
*/
-#define NENT_DEPRECATED
#include "entity.h"
void Lamp_Init(Entity* this);
diff --git a/src/object/lampParticle.c b/src/object/lampParticle.c
index 85c73532..fbdd3abb 100644
--- a/src/object/lampParticle.c
+++ b/src/object/lampParticle.c
@@ -4,7 +4,6 @@
*
* @brief LampParticle object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "item.h"
#include "player.h"
diff --git a/src/object/lavaPlatform.c b/src/object/lavaPlatform.c
index be968d08..5db1f0b9 100644
--- a/src/object/lavaPlatform.c
+++ b/src/object/lavaPlatform.c
@@ -4,7 +4,6 @@
*
* @brief Lava Platform object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "hitbox.h"
#include "object.h"
@@ -279,10 +278,10 @@ void sub_0809264C(LavaPlatformEntity* this) {
}
bool32 LavaPlatform_IsPlayerOnPlatform(LavaPlatformEntity* this) {
- if ((gPlayerState.flags & PL_MINISH) == 0 && EntityInRectRadius(super, &gPlayerEntity, 0x10, 0x10) &&
+ if ((gPlayerState.flags & PL_MINISH) == 0 && EntityInRectRadius(super, &gPlayerEntity.base, 0x10, 0x10) &&
PlayerCanBeMoved()) {
gPlayerState.field_0x14 = 1;
- if (gPlayerEntity.z.HALF.HI == 0) {
+ if (gPlayerEntity.base.z.HALF.HI == 0) {
super->subtimer = 1;
return TRUE;
}
diff --git a/src/object/lightDoor.c b/src/object/lightDoor.c
index 3b99e841..4c334e79 100644
--- a/src/object/lightDoor.c
+++ b/src/object/lightDoor.c
@@ -4,7 +4,6 @@
*
* @brief Light Door object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "screen.h"
diff --git a/src/object/lightRay.c b/src/object/lightRay.c
index bd437bc6..a48ffa53 100644
--- a/src/object/lightRay.c
+++ b/src/object/lightRay.c
@@ -4,7 +4,6 @@
*
* @brief Light Ray object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "screen.h"
@@ -42,12 +41,12 @@ void LightRay_Type0(LightRayEntity* this) {
super->subtimer = 0;
gRoomControls.camera_target = super;
gRoomControls.scrollSpeed = 1;
- if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) {
+ if (super->x.HALF.HI > gPlayerEntity.base.x.HALF.HI) {
tmp = 2;
} else {
tmp = 6;
}
- gPlayerEntity.animationState = tmp;
+ gPlayerEntity.base.animationState = tmp;
gScreen.lcd.displayControl = (gScreen.lcd.displayControl & 0xbfff) | 0x2800;
gScreen.controls.window0HorizontalDimensions = 0;
gScreen.controls.window0VerticalDimensions = 0xa0;
@@ -67,7 +66,7 @@ void LightRay_Type0(LightRayEntity* this) {
super->action = 2;
super->timer = 60;
gScreen.lcd.displayControl &= 0xdfff;
- gRoomControls.camera_target = &gPlayerEntity;
+ gRoomControls.camera_target = &gPlayerEntity.base;
SoundReq(SFX_134);
}
}
@@ -116,12 +115,12 @@ void LightRay_Type1(LightRayEntity* this) {
super->subtimer = 32;
gRoomControls.camera_target = super;
gRoomControls.scrollSpeed = 1;
- if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) {
+ if (super->x.HALF.HI > gPlayerEntity.base.x.HALF.HI) {
tmp = 2;
} else {
tmp = 6;
}
- gPlayerEntity.animationState = tmp;
+ gPlayerEntity.base.animationState = tmp;
gScreen.lcd.displayControl = (gScreen.lcd.displayControl & 0xbfff) | 0x2000;
gScreen.controls.window0HorizontalDimensions = DISPLAY_WIDTH;
gScreen.controls.window0VerticalDimensions = DISPLAY_HEIGHT;
@@ -140,7 +139,7 @@ void LightRay_Type1(LightRayEntity* this) {
} else {
super->action = 2;
super->timer = 60;
- gRoomControls.camera_target = &gPlayerEntity;
+ gRoomControls.camera_target = &gPlayerEntity.base;
SoundReq(SFX_134);
}
}
@@ -167,12 +166,12 @@ void LightRay_Type2(LightRayEntity* this) {
super->subtimer = 0;
gRoomControls.camera_target = super;
gRoomControls.scrollSpeed = 1;
- if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) {
+ if (super->x.HALF.HI > gPlayerEntity.base.x.HALF.HI) {
tmp = 2;
} else {
tmp = 6;
}
- gPlayerEntity.animationState = tmp;
+ gPlayerEntity.base.animationState = tmp;
gScreen.controls.window0HorizontalDimensions = 0x60;
gScreen.controls.window0VerticalDimensions = 0xa0;
break;
@@ -212,7 +211,7 @@ void LightRay_Type2(LightRayEntity* this) {
case 3:
if (--super->timer == 0) {
super->action = 4;
- gRoomControls.camera_target = &gPlayerEntity;
+ gRoomControls.camera_target = &gPlayerEntity.base;
gRoomControls.scrollSpeed = 2;
}
break;
@@ -237,12 +236,12 @@ void LightRay_Type3(LightRayEntity* this) {
super->subtimer = 0;
gRoomControls.camera_target = super;
gRoomControls.scrollSpeed = 1;
- if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) {
+ if (super->x.HALF.HI > gPlayerEntity.base.x.HALF.HI) {
tmp = 2;
} else {
tmp = 6;
}
- gPlayerEntity.animationState = tmp;
+ gPlayerEntity.base.animationState = tmp;
gScreen.controls.window0HorizontalDimensions = 0x80f0;
gScreen.controls.window0VerticalDimensions = 0xa0;
super->subAction = 0x80;
@@ -293,12 +292,12 @@ void LightRay_Type4(LightRayEntity* this) {
super->subtimer = 128;
gRoomControls.camera_target = super;
gRoomControls.scrollSpeed = 1;
- if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) {
+ if (super->x.HALF.HI > gPlayerEntity.base.x.HALF.HI) {
tmp = 2;
} else {
tmp = 6;
}
- gPlayerEntity.animationState = tmp;
+ gPlayerEntity.base.animationState = tmp;
break;
case 1:
if (super->timer != 0) {
@@ -311,7 +310,7 @@ void LightRay_Type4(LightRayEntity* this) {
} else {
super->action = 2;
super->timer = 60;
- gRoomControls.camera_target = &gPlayerEntity;
+ gRoomControls.camera_target = &gPlayerEntity.base;
SoundReq(SFX_134);
}
}
diff --git a/src/object/lightableSwitch.c b/src/object/lightableSwitch.c
index 9117cfe8..ef7b6fd6 100644
--- a/src/object/lightableSwitch.c
+++ b/src/object/lightableSwitch.c
@@ -4,7 +4,6 @@
*
* @brief Lightable Switch object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "flags.h"
diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c
index d14f20b4..858d2fee 100644
--- a/src/object/lilypadLarge.c
+++ b/src/object/lilypadLarge.c
@@ -4,7 +4,6 @@
*
* @brief Large Lilypad object
*/
-#define NENT_DEPRECATED
#include "object/lilypadLarge.h"
#include "area.h"
#include "functions.h"
@@ -103,19 +102,19 @@ void LilypadLarge_Action1(LilypadLargeEntity* this) {
u32 uVar4;
super->flags |= 0x20;
- if (sub_0806FC80(super, &gPlayerEntity, 0x18) != 0) {
+ if (sub_0806FC80(super, &gPlayerEntity.base, 0x18) != 0) {
gPlayerState.flags |= PL_FLAGS2;
- if (gPlayerEntity.z.WORD == 0) {
+ if (gPlayerEntity.base.z.WORD == 0) {
if (gPlayerState.swim_state != 0) {
- gPlayerEntity.collisionFlags &= 0xfb;
+ gPlayerEntity.base.collisionFlags &= 0xfb;
gPlayerState.swim_state = 0;
}
gPlayerState.lilypad = super;
if (super->collisionLayer == 1) {
- ResetCollisionLayer(&gPlayerEntity);
+ ResetCollisionLayer(&gPlayerEntity.base);
} else {
- sub_08004542(&gPlayerEntity);
+ sub_08004542(&gPlayerEntity.base);
}
if (super->subtimer == 0) {
super->subtimer = 4;
@@ -130,7 +129,7 @@ void LilypadLarge_Action1(LilypadLargeEntity* this) {
}
if (gPlayerState.field_0x1c == 3) {
tmp = gUnk_08120620[gPlayerState.gustJarSpeed - 1];
- switch (gPlayerEntity.animationState & 6) {
+ switch (gPlayerEntity.base.animationState & 6) {
case 4:
this->unk_70 -= tmp;
break;
@@ -153,8 +152,8 @@ void LilypadLarge_Action1(LilypadLargeEntity* this) {
SoundReq(SFX_WATER_WALK);
}
if ((super->contactFlags & 0x7f) == 0x13) {
- sVar10 = gPlayerEntity.x.HALF.HI + gUnk_08126EE4[gPlayerEntity.animationState & 0xe];
- uVar4 = gPlayerEntity.y.HALF.HI + gUnk_08126EE4[gPlayerEntity.animationState | 1];
+ sVar10 = gPlayerEntity.base.x.HALF.HI + gUnk_08126EE4[gPlayerEntity.base.animationState & 0xe];
+ uVar4 = gPlayerEntity.base.y.HALF.HI + gUnk_08126EE4[gPlayerEntity.base.animationState | 1];
super->direction = CalculateDirectionTo(super->x.HALF.HI, super->y.HALF.HI, sVar10, uVar4);
switch (gPlayerState.gustJarSpeed) {
@@ -327,7 +326,7 @@ void LilypadLarge_Action2(LilypadLargeEntity* this) {
};
subActionFuncs[super->subAction](this);
gPlayerState.flags |= PL_FLAGS2;
- sub_08078B48();
+ PausePlayer();
}
void sub_08085A44(LilypadLargeEntity* this) {
@@ -380,26 +379,26 @@ void sub_08085B40(LilypadLargeEntity* this) {
this->unk_78.WORD += 0x100000;
SetAffineInfo(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
}
- gPlayerEntity.y.HALF.HI = (super->y.HALF.HI + super->z.HALF.HI) - this->unk_74;
+ gPlayerEntity.base.y.HALF.HI = (super->y.HALF.HI + super->z.HALF.HI) - this->unk_74;
if (gArea.locationIndex == 27) { // AREA_TEMPLE_OF_DROPLETS
- gPlayerEntity.z.HALF.HI = super->y.HALF.HI - this->unk_74 - 0xd0 - gPlayerEntity.y.HALF.HI;
+ gPlayerEntity.base.z.HALF.HI = super->y.HALF.HI - this->unk_74 - 0xd0 - gPlayerEntity.base.y.HALF.HI;
} else {
- gPlayerEntity.z.HALF.HI = super->y.HALF.HI - this->unk_74 - 0x40 - gPlayerEntity.y.HALF.HI;
+ gPlayerEntity.base.z.HALF.HI = super->y.HALF.HI - this->unk_74 - 0x40 - gPlayerEntity.base.y.HALF.HI;
}
}
} else {
ResetCollisionLayer(super);
if (GetVvvAtEntity(super) == VVV_13) {
- ResetCollisionLayer(&gPlayerEntity);
+ ResetCollisionLayer(&gPlayerEntity.base);
LilypadLarge_Action4(this);
- super->direction = GetFacingDirection(&gPlayerEntity, super);
- LinearMoveDirection(&gPlayerEntity, 0x100, super->direction);
+ super->direction = GetFacingDirection(&gPlayerEntity.base, super);
+ LinearMoveDirection(&gPlayerEntity.base, 0x100, super->direction);
}
}
if (this->unk_82 == 0) {
- if (GravityUpdate(&gPlayerEntity, Q_8_8(32.0)) == 0) {
- ResetCollisionLayer(&gPlayerEntity);
+ if (GravityUpdate(&gPlayerEntity.base, Q_8_8(32.0)) == 0) {
+ ResetCollisionLayer(&gPlayerEntity.base);
sub_08085F1C(this);
super->action = 1;
super->subtimer = 4;
@@ -421,23 +420,23 @@ void sub_08085B40(LilypadLargeEntity* this) {
}
void LilypadLarge_Action3(LilypadLargeEntity* this) {
- if (sub_0806FC80(super, &gPlayerEntity, 0x18) != 0) {
+ if (sub_0806FC80(super, &gPlayerEntity.base, 0x18) != 0) {
LinearMoveUpdate(super);
- gPlayerEntity.speed = super->speed;
- gPlayerEntity.direction = super->direction;
- LinearMoveUpdate(&gPlayerEntity);
+ gPlayerEntity.base.speed = super->speed;
+ gPlayerEntity.base.direction = super->direction;
+ LinearMoveUpdate(&gPlayerEntity.base);
gPlayerState.flags |= PL_FLAGS2;
if (super->collisionLayer == 1) {
- ResetCollisionLayer(&gPlayerEntity);
+ ResetCollisionLayer(&gPlayerEntity.base);
} else {
- sub_08004542(&gPlayerEntity);
+ sub_08004542(&gPlayerEntity.base);
}
}
if (gRoomControls.reload_flags == 0) {
super->flags &= ~ENT_PERSIST;
super->action = 1;
super->updatePriority = super->updatePriorityPrev;
- gRoomControls.camera_target = &gPlayerEntity;
+ gRoomControls.camera_target = &gPlayerEntity.base;
}
}
@@ -462,7 +461,7 @@ void sub_08085D28(LilypadLargeEntity* this) {
(GetVvvRelativeToEntity(super, 0, 0x18) == VVV_17)) {
super->action = 2;
super->subAction = 0;
- sub_08078B48();
+ PausePlayer();
}
}
@@ -501,7 +500,7 @@ void sub_08085D60(LilypadLargeEntity* this) {
if (sub_080806BC((super->x.HALF.HI - gRoomControls.origin_x) + tmpX,
(super->y.HALF.HI - gRoomControls.origin_y) + tmpY, r4, 5) == 0) {
- if (sub_0807BD14(&gPlayerEntity, r4 >> 3) != 0) {
+ if (sub_0807BD14(&gPlayerEntity.base, r4 >> 3) != 0) {
super->direction = r4;
sub_08085E74(this);
return;
@@ -517,7 +516,7 @@ void sub_08085D60(LilypadLargeEntity* this) {
tmpX2 = gUnk_08120638[tmp];
tmpY2 = gUnk_08120638[tmp + 1];
if (GetCollisionDataRelativeTo(super, tmpX2, tmpY2) == COLLISION_DATA_255) {
- if (sub_0807BD14(&gPlayerEntity, r6 >> 3) != 0) {
+ if (sub_0807BD14(&gPlayerEntity.base, r6 >> 3) != 0) {
super->direction = (u8)r6;
sub_08085E74(this);
}
@@ -550,9 +549,9 @@ void sub_08085E74(LilypadLargeEntity* this) {
this->unk_6c = 0;
super->x.HALF.LO = 0;
super->y.HALF.LO = 0;
- gPlayerEntity.x.HALF.LO = 0;
- gPlayerEntity.y.HALF.LO = 0;
- gPlayerEntity.direction = super->direction;
+ gPlayerEntity.base.x.HALF.LO = 0;
+ gPlayerEntity.base.y.HALF.LO = 0;
+ gPlayerEntity.base.direction = super->direction;
gPlayerState.animation = ANIM_DEFAULT;
gRoomControls.camera_target = super;
if (gPlayerState.item != NULL) {
@@ -562,13 +561,13 @@ void sub_08085E74(LilypadLargeEntity* this) {
}
void sub_08085EFC(LilypadLargeEntity* this) {
- this->unk_76 = super->x.HALF.HI - gPlayerEntity.x.HALF.HI;
- this->unk_74 = super->y.HALF.HI - gPlayerEntity.y.HALF.HI;
+ this->unk_76 = super->x.HALF.HI - gPlayerEntity.base.x.HALF.HI;
+ this->unk_74 = super->y.HALF.HI - gPlayerEntity.base.y.HALF.HI;
}
void sub_08085F1C(LilypadLargeEntity* this) {
- gPlayerEntity.x.HALF.HI = super->x.HALF.HI - this->unk_76;
- gPlayerEntity.y.HALF.HI = super->y.HALF.HI - this->unk_74;
+ gPlayerEntity.base.x.HALF.HI = super->x.HALF.HI - this->unk_76;
+ gPlayerEntity.base.y.HALF.HI = super->y.HALF.HI - this->unk_74;
sub_0807A5B8(super->direction);
}
diff --git a/src/object/lilypadLargeFalling.c b/src/object/lilypadLargeFalling.c
index e32b0f88..d0b19b12 100644
--- a/src/object/lilypadLargeFalling.c
+++ b/src/object/lilypadLargeFalling.c
@@ -4,7 +4,6 @@
*
* @brief LilypadLargeFalling object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "functions.h"
#include "object/lilypadLarge.h"
diff --git a/src/object/lilypadSmall.c b/src/object/lilypadSmall.c
index 1d84c392..2d92e4f0 100644
--- a/src/object/lilypadSmall.c
+++ b/src/object/lilypadSmall.c
@@ -4,7 +4,6 @@
*
* @brief Lilypad Small object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
@@ -43,13 +42,13 @@ void LilypadSmall(LilypadSmallEntity* this) {
static bool32 CheckMovePlayer(LilypadSmallEntity* this) {
if (!(gPlayerState.flags & PL_MINISH)) {
return FALSE;
- } else if (EntityInRectRadius(super, &gPlayerEntity, 8, 8) == 0) {
+ } else if (EntityInRectRadius(super, &gPlayerEntity.base, 8, 8) == 0) {
return FALSE;
} else if (!PlayerCanBeMoved()) {
return FALSE;
} else {
gPlayerState.field_0x14 = 1;
- if (gPlayerEntity.z.HALF.HI != 0) {
+ if (gPlayerEntity.base.z.HALF.HI != 0) {
return FALSE;
} else {
return TRUE;
diff --git a/src/object/linkAnimation.c b/src/object/linkAnimation.c
index 8a9d361d..71e1a494 100644
--- a/src/object/linkAnimation.c
+++ b/src/object/linkAnimation.c
@@ -2,126 +2,121 @@
* @file linkAnimation.c
* @ingroup Objects
*
- * @brief Link Animation object
+ * @brief Link Animation object. This is used during "item get" sequences and
+ * replaces the player entity for the duration.
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "message.h"
#include "object.h"
+#include "object/linkAnimation.h"
-typedef struct {
- /*0x00*/ Entity base;
- /*0x68*/ u8 unk_68;
- /*0x69*/ u8 unk_69;
- /*0x6a*/ u8 unk_6a;
- /*0x6b*/ u8 unk_6b;
- /*0x6c*/ u8 unk_6c;
- /*0x6d*/ u8 unk_6d;
- /*0x6e*/ u8 unk_6e;
- /*0x6f*/ u8 unk_6f;
- /*0x70*/ u32 unk_70;
- /*0x74*/ u8 unk_74;
-} LinkAnimationEntity;
+typedef enum {
+ ITEMGET_INIT,
+ ITEMGET_UPDATE,
+ ITEMGET_WAIT,
+} ItemGetState;
void LinkAnimation_Init(LinkAnimationEntity*);
-void LinkAnimation_Action1(LinkAnimationEntity*);
-void LinkAnimation_Action8(LinkAnimationEntity*);
+void LinkAnimation_Default(LinkAnimationEntity*);
+void LinkAnimation_ItemGet(LinkAnimationEntity*);
void LinkAnimation(LinkAnimationEntity* this) {
static void (*const LinkAnimation_Actions[])(LinkAnimationEntity*) = {
- LinkAnimation_Init, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1,
- LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1,
- LinkAnimation_Action8, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1,
- LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1,
- LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1,
- LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1,
- LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1,
- LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1,
+ LinkAnimation_Init, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default,
+ LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default,
+ LinkAnimation_ItemGet, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default,
+ LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default,
+ LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default,
+ LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default,
+ LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default,
+ LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default,
};
LinkAnimation_Actions[super->action](this);
}
void LinkAnimation_Init(LinkAnimationEntity* this) {
- super->action = 8;
- LinkAnimation_Action8(this);
+ super->action = PLAYER_ITEMGET;
+ LinkAnimation_ItemGet(this);
}
-void LinkAnimation_Action1(LinkAnimationEntity* this) {
+void LinkAnimation_Default(LinkAnimationEntity* this) {
ResetPlayerEventPriority();
gPauseMenuOptions.disabled = 0;
DeleteThisEntity();
}
-void LinkAnimation_Action8(LinkAnimationEntity* this) {
+void LinkAnimation_ItemGet(LinkAnimationEntity* this) {
u32 one;
- u32 tmp;
- Entity* parent;
+ u32 sprite;
+ Entity* held_obj;
u8* ptr;
- gPlayerEntity.flags &= ~ENT_COLLIDE;
- gPlayerEntity.spriteSettings.draw = 0;
- super->palette.b.b0 = gPlayerEntity.palette.b.b0;
+ // hide player entity
+ gPlayerEntity.base.flags &= ~ENT_COLLIDE;
+ gPlayerEntity.base.spriteSettings.draw = 0;
+
+ super->palette.b.b0 = gPlayerEntity.base.palette.b.b0;
switch (super->subAction) {
- case 0:
+ case ITEMGET_INIT:
one = 1;
super->subAction = one;
super->spriteSettings.draw = one;
- super->collisionLayer = gPlayerEntity.collisionLayer;
- super->spritePriority.b0 = gPlayerEntity.spritePriority.b0;
-
- super->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
- super->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
+ super->collisionLayer = gPlayerEntity.base.collisionLayer;
+ super->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0;
+ super->spriteRendering.b3 = gPlayerEntity.base.spriteRendering.b3;
+ super->spriteOrientation.flipY = gPlayerEntity.base.spriteOrientation.flipY;
super->spriteSettings.flipX = 0;
super->animationState = 4;
- SetDefaultPriority(super, 6);
- if ((gPlayerState.flags & PL_NO_CAP) != 0) {
- if (sub_080542AC(super->type)) {
- tmp = 0x45e;
+ SetEntityPriority(super, PRIO_PLAYER_EVENT);
+ if (gPlayerState.flags & PL_NO_CAP) {
+ if (IsMinishItem(super->type)) {
+ sprite = ANIM_GET_ITEM_SMALL_NOCAP;
} else {
- tmp = 0x45b;
+ sprite = ANIM_GET_ITEM_BIG_NOCAP;
}
} else {
- if (sub_080542AC(super->type)) {
- tmp = 0x2e0;
+ if (IsMinishItem(super->type)) {
+ sprite = ANIM_GET_ITEM_SMALL;
} else {
- tmp = 0x1b9;
+ sprite = ANIM_GET_ITEM_BIG;
}
}
- super->spriteIndex = (tmp >> 8);
- InitAnimationForceUpdate(super, tmp & 0xff);
+ super->spriteIndex = (sprite >> 8);
+ InitAnimationForceUpdate(super, sprite & 0xff);
break;
- case 1:
+ case ITEMGET_UPDATE:
UpdateAnimationSingleFrame(super);
if (super->frame != 0) {
super->subAction++;
}
break;
- case 2:
+ case ITEMGET_WAIT:
UpdateAnimationSingleFrame(super);
- if ((gMessage.doTextBox & 0x7f) != 0) {
+ if ((gMessage.state & MESSAGE_ACTIVE) != 0) {
return;
}
- if ((super->frame & ANIM_DONE) != 0) {
- super->action = 1;
- gPlayerEntity.flags = this->unk_69;
- gPlayerEntity.spriteSettings.draw = this->unk_68;
- gPlayerEntity.iframes = this->unk_6a;
- gPlayerState.field_0x7 = this->unk_6b;
- gPlayerState.keepFacing = this->unk_6c;
- gPlayerState.field_0xa = this->unk_6d;
- gPlayerState.field_0x27[0] = this->unk_6e;
- gPlayerState.mobility = this->unk_6f;
- gPlayerState.flags = this->unk_70;
- gPlayerState.field_0x8a = this->unk_74;
+ if (super->frame & ANIM_DONE) {
+ super->action = PLAYER_NORMAL;
+ // restore player state
+ gPlayerEntity.base.flags = this->storeFlags;
+ gPlayerEntity.base.spriteSettings.draw = this->storeDrawFlags;
+ gPlayerEntity.base.iframes = this->storeIFrames;
+ gPlayerState.field_0x7 = this->storeField7;
+ gPlayerState.keepFacing = this->storeKeepFacing;
+ gPlayerState.field_0xa = this->storeFieldA;
+ gPlayerState.field_0x27[0] = this->storeField27;
+ gPlayerState.mobility = this->storeMobility;
+ gPlayerState.flags = this->storeStateFlags;
+ gPlayerState.field_0x8a = this->store8A;
}
break;
}
- parent = super->parent;
- if (parent != NULL) {
- PositionEntityOnTop(super, parent);
+ held_obj = super->parent;
+ if (held_obj != NULL) {
+ PositionEntityOnTop(super, held_obj);
ptr = GetSpriteSubEntryOffsetDataPointer((u16)super->spriteIndex, super->frameIndex);
- parent->spriteOffsetX = *ptr;
- parent->spriteOffsetY = ptr[1];
+ held_obj->spriteOffsetX = ptr[0];
+ held_obj->spriteOffsetY = ptr[1];
}
}
diff --git a/src/object/linkEmptyingBottle.c b/src/object/linkEmptyingBottle.c
index 59326cfb..028854ce 100644
--- a/src/object/linkEmptyingBottle.c
+++ b/src/object/linkEmptyingBottle.c
@@ -5,7 +5,6 @@
* @brief Link Emptying Bottle object
* Handles effects of using water, mineral water or a fairy in a bottle in PlayerItemBottle_UseOther.
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "item.h"
#include "object.h"
@@ -41,8 +40,9 @@ void LinkEmptyingBottle_Init(LinkEmptyingBottleEntity* this) {
effect = CreateFx(super, FX_WATER_SPLASH, 0);
super->child = effect;
if (effect != NULL) {
- PositionRelative(&gPlayerEntity, effect, gUnk_08122A18[gPlayerEntity.animationState & 6] << 0x10,
- gUnk_08122A18[gPlayerEntity.animationState | 1] << 0x10);
+ PositionRelative(&gPlayerEntity.base, effect,
+ gUnk_08122A18[gPlayerEntity.base.animationState & 6] << 0x10,
+ gUnk_08122A18[gPlayerEntity.base.animationState | 1] << 0x10);
}
CopyPosition(super->child, super);
sub_08094980(this, SPECIAL_META_TILE_50, SPECIAL_META_TILE_51);
@@ -52,8 +52,9 @@ void LinkEmptyingBottle_Init(LinkEmptyingBottleEntity* this) {
effect = CreateFx(super, FX_GREEN_SPLASH2, 0);
super->child = effect;
if (effect != NULL) {
- PositionRelative(&gPlayerEntity, effect, gUnk_08122A18[gPlayerEntity.animationState & 6] << 0x10,
- gUnk_08122A18[gPlayerEntity.animationState | 1] << 0x10);
+ PositionRelative(&gPlayerEntity.base, effect,
+ gUnk_08122A18[gPlayerEntity.base.animationState & 6] << 0x10,
+ gUnk_08122A18[gPlayerEntity.base.animationState | 1] << 0x10);
}
if (super->type2 == 0) {
CopyPosition(super->child, super);
@@ -66,7 +67,7 @@ void LinkEmptyingBottle_Init(LinkEmptyingBottleEntity* this) {
}
break;
case 2:
- child = CreateGroundItem(&gPlayerEntity, ITEM_FAIRY, 0);
+ child = CreateGroundItem(&gPlayerEntity.base, ITEM_FAIRY, 0);
super->child = child;
if (child != NULL) {
child->timer = 1;
diff --git a/src/object/linkFire.c b/src/object/linkFire.c
index 7a5b4292..1a12c93f 100644
--- a/src/object/linkFire.c
+++ b/src/object/linkFire.c
@@ -4,7 +4,6 @@
*
* @brief Link Fire object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
@@ -60,22 +59,22 @@ void sub_0808DDE8(LinkFireEntity* this) {
gPlayerState.flags &= ~PL_BURNING;
DeleteThisEntity();
}
- player = &gPlayerEntity;
- super->x.HALF.HI = (s8)gUnk_081217B8[gPlayerEntity.animationState >> 1] + player->x.HALF.HI;
- super->y.HALF.HI = gPlayerEntity.y.HALF.HI + -6;
- super->z = gPlayerEntity.z;
- super->collisionLayer = gPlayerEntity.collisionLayer;
- super->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
- super->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
+ player = &gPlayerEntity.base;
+ super->x.HALF.HI = (s8)gUnk_081217B8[gPlayerEntity.base.animationState >> 1] + player->x.HALF.HI;
+ super->y.HALF.HI = gPlayerEntity.base.y.HALF.HI + -6;
+ super->z = gPlayerEntity.base.z;
+ super->collisionLayer = gPlayerEntity.base.collisionLayer;
+ super->spriteRendering.b3 = gPlayerEntity.base.spriteRendering.b3;
+ super->spriteOrientation.flipY = gPlayerEntity.base.spriteOrientation.flipY;
if ((gPlayerState.flags & PL_BURNING) != 0) {
GetNextFrame(super);
} else {
DeleteThisEntity();
}
- if (gPlayerEntity.animationState >> 1 == 2) {
- sub_0806FEBC(&gPlayerEntity, 3, super);
+ if (gPlayerEntity.base.animationState >> 1 == 2) {
+ sub_0806FEBC(&gPlayerEntity.base, 3, super);
super->y.HALF.HI -= 5;
} else {
- sub_0806FEBC(&gPlayerEntity, 0, super);
+ sub_0806FEBC(&gPlayerEntity.base, 0, super);
}
}
diff --git a/src/object/linkHoldingItem.c b/src/object/linkHoldingItem.c
index ae982637..6e5bedd2 100644
--- a/src/object/linkHoldingItem.c
+++ b/src/object/linkHoldingItem.c
@@ -4,7 +4,6 @@
*
* @brief Link Holding Item object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "game.h"
#include "item.h"
@@ -38,7 +37,7 @@ void LinkHoldingItem(LinkHoldingItemEntity* this) {
}
void LinkHoldingItem_Init(LinkHoldingItemEntity* this) {
- SetDefaultPriority(super, 6);
+ SetEntityPriority(super, 6);
super->action = 1;
}
@@ -123,8 +122,8 @@ void LinkHoldingItem_Action2(LinkHoldingItemEntity* this) {
}
void LinkHoldingItem_Action3(LinkHoldingItemEntity* this) {
- u32 tmp;
- if ((super->parent)->action == 8) {
+ u32 bottle_no;
+ if (super->parent->action == PLAYER_ITEMGET) {
return;
}
switch (super->timer) {
@@ -149,9 +148,9 @@ void LinkHoldingItem_Action3(LinkHoldingItemEntity* this) {
ModHealth(160);
break;
case 3:
- tmp = GetBottleContaining(super->type);
- if (tmp != 0) {
- gSave.stats.itemButtons[tmp + 1] = ITEM_BOTTLE_EMPTY;
+ bottle_no = GetBottleContaining(super->type);
+ if (bottle_no != 0) {
+ gSave.stats.bottles[bottle_no - 1] = ITEM_BOTTLE_EMPTY;
} else {
SetInventoryValue(super->type, ITEM_GREEN_SWORD);
}
diff --git a/src/object/litArea.c b/src/object/litArea.c
index 8d39ddf1..53b34d1f 100644
--- a/src/object/litArea.c
+++ b/src/object/litArea.c
@@ -4,7 +4,6 @@
*
* @brief Lit Area object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "flags.h"
#include "functions.h"
diff --git a/src/object/lockedDoor.c b/src/object/lockedDoor.c
index 501b39ed..ae79ebf6 100644
--- a/src/object/lockedDoor.c
+++ b/src/object/lockedDoor.c
@@ -4,7 +4,6 @@
*
* @brief Looked Door object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "common.h"
#include "effects.h"
@@ -286,19 +285,19 @@ u32 sub_08083734(Entity* this, u32 unk0) {
// struct?
switch (unk0) {
case 0:
- if (((LockedDoorEntity*)this)->unk_72 + 0xd - gPlayerEntity.y.HALF.HI < 0)
+ if (((LockedDoorEntity*)this)->unk_72 + 0xd - gPlayerEntity.base.y.HALF.HI < 0)
return 1;
break;
case 1:
- if (gPlayerEntity.x.HALF.HI - (((LockedDoorEntity*)this)->unk_70 - 0xb) < 0)
+ if (gPlayerEntity.base.x.HALF.HI - (((LockedDoorEntity*)this)->unk_70 - 0xb) < 0)
return 1;
break;
case 2:
- if (gPlayerEntity.y.HALF.HI - (((LockedDoorEntity*)this)->unk_72 - 0x8) < 0)
+ if (gPlayerEntity.base.y.HALF.HI - (((LockedDoorEntity*)this)->unk_72 - 0x8) < 0)
return 1;
break;
case 3:
- if (((LockedDoorEntity*)this)->unk_70 + 0xa - gPlayerEntity.x.HALF.HI < 0)
+ if (((LockedDoorEntity*)this)->unk_70 + 0xa - gPlayerEntity.base.x.HALF.HI < 0)
return 1;
break;
}
diff --git a/src/object/macroAcorn.c b/src/object/macroAcorn.c
index 36b421ea..9a65ce44 100644
--- a/src/object/macroAcorn.c
+++ b/src/object/macroAcorn.c
@@ -4,7 +4,6 @@
*
* @brief Macro Acorn object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "map.h"
#include "object.h"
diff --git a/src/object/macroBook.c b/src/object/macroBook.c
index 2e9af52d..69c46ebc 100644
--- a/src/object/macroBook.c
+++ b/src/object/macroBook.c
@@ -4,7 +4,6 @@
*
* @brief Macro Book object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "flags.h"
@@ -127,7 +126,7 @@ void MacroBook_Action3(MacroBookEntity* this) {
SetAffineInfo(super, this->unk80, this->unk80, 0);
} else {
sub_0809AA9C(this, super->child, 0);
- sub_0809AA9C(this, &gPlayerEntity, 1);
+ sub_0809AA9C(this, &gPlayerEntity.base, 1);
if (gPlayerClones[0] != NULL) {
sub_0809AA9C(this, gPlayerClones[0], 1);
}
@@ -202,7 +201,7 @@ void sub_0809AA00(MacroBookEntity* this) {
} else {
sub_0809AA9C(this, super->child, 0);
}
- ent = &gPlayerEntity;
+ ent = &gPlayerEntity.base;
this->playerWithinRect = EntityInRectRadius(super, ent, 0x20, 0x22);
if (this->playerWithinRect != 0) {
sub_0809AA9C(this, ent, 1);
diff --git a/src/object/macroDecorations.c b/src/object/macroDecorations.c
index b36ea3ec..05c0955c 100644
--- a/src/object/macroDecorations.c
+++ b/src/object/macroDecorations.c
@@ -4,7 +4,6 @@
*
* @brief Macro Decoration object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "map.h"
diff --git a/src/object/macroMushroomStalk.c b/src/object/macroMushroomStalk.c
index 92f70fa0..45eb8fe0 100644
--- a/src/object/macroMushroomStalk.c
+++ b/src/object/macroMushroomStalk.c
@@ -4,7 +4,6 @@
*
* @brief Macro Mushroom Stalk object
*/
-#define NENT_DEPRECATED
#include "area.h"
#include "entity.h"
#include "main.h"
diff --git a/src/object/macroPlayer.c b/src/object/macroPlayer.c
index deb5a7c8..a313729b 100644
--- a/src/object/macroPlayer.c
+++ b/src/object/macroPlayer.c
@@ -4,7 +4,6 @@
*
* @brief Macro Player object
*/
-#define NENT_DEPRECATED
#include "area.h"
#include "entity.h"
#include "functions.h"
diff --git a/src/object/macroShoe.c b/src/object/macroShoe.c
index 08560a39..fd321b19 100644
--- a/src/object/macroShoe.c
+++ b/src/object/macroShoe.c
@@ -4,7 +4,6 @@
*
* @brief Macro Shoe object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "tiles.h"
diff --git a/src/object/mask.c b/src/object/mask.c
index 7498ce59..d6624b08 100644
--- a/src/object/mask.c
+++ b/src/object/mask.c
@@ -4,7 +4,6 @@
*
* @brief Mask object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "tiles.h"
@@ -82,21 +81,21 @@ void Mask_Init(MaskEntity* this) {
// Probably related to knocking it down
void Mask_Action1(MaskEntity* this) {
// Check for the first frame of bonking animation
- if (gPlayerEntity.action != PLAYER_BOUNCE) {
+ if (gPlayerEntity.base.action != PLAYER_BOUNCE) {
return;
}
- if (gPlayerEntity.animationState != 0) {
+ if (gPlayerEntity.base.animationState != 0) {
return;
}
// Check if link is close enough to the mask
- if (super->y.HALF.HI + 40 < gPlayerEntity.y.HALF.HI) {
+ if (super->y.HALF.HI + 40 < gPlayerEntity.base.y.HALF.HI) {
return;
}
- if (super->x.HALF.HI - gPlayerEntity.x.HALF.HI >= super->subtimer ||
- super->x.HALF.HI - gPlayerEntity.x.HALF.HI <= -super->subtimer) {
+ if (super->x.HALF.HI - gPlayerEntity.base.x.HALF.HI >= super->subtimer ||
+ super->x.HALF.HI - gPlayerEntity.base.x.HALF.HI <= -super->subtimer) {
return;
}
diff --git a/src/object/mazaalBossObject.c b/src/object/mazaalBossObject.c
index c65e7c02..9fc03361 100644
--- a/src/object/mazaalBossObject.c
+++ b/src/object/mazaalBossObject.c
@@ -4,12 +4,10 @@
*
* @brief Mazaal Boss object
*/
-#define NENT_DEPRECATED
#include "enemy.h"
#include "entity.h"
#include "functions.h"
#include "item.h"
-#include "new_player.h"
#include "object.h"
#include "player.h"
#include "room.h"
@@ -187,7 +185,7 @@ void MazaalBossObject_Action8(MazaalBossObjectEntity* this) {
break;
case 2:
if (--super->timer == 0) {
- gRoomControls.camera_target = &gNewPlayerEntity.base;
+ gRoomControls.camera_target = &gPlayerEntity.base;
gPlayerState.controlMode = CONTROL_1;
DeleteThisEntity();
}
diff --git a/src/object/mazaalObject.c b/src/object/mazaalObject.c
index 68c76041..949e3897 100644
--- a/src/object/mazaalObject.c
+++ b/src/object/mazaalObject.c
@@ -4,7 +4,6 @@
*
* @brief Mazaal Object object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "physics.h"
diff --git a/src/object/metalDoor.c b/src/object/metalDoor.c
index bde2fa06..8343c5b5 100644
--- a/src/object/metalDoor.c
+++ b/src/object/metalDoor.c
@@ -4,7 +4,6 @@
*
* @brief Metal Door object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "effects.h"
#include "entity.h"
diff --git a/src/object/minecart.c b/src/object/minecart.c
index 19ffa398..3d1f362b 100644
--- a/src/object/minecart.c
+++ b/src/object/minecart.c
@@ -4,7 +4,6 @@
*
* @brief Minecart object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "hitbox.h"
#include "object.h"
@@ -86,9 +85,9 @@ void Minecart_Action1(MinecartEntity* this) {
super->action++;
gPlayerState.jump_status = 0x81;
gPlayerState.flags |= PL_ENTER_MINECART;
- gPlayerEntity.zVelocity = Q_16_16(2.0);
- gPlayerEntity.speed = 0x100;
- gPlayerEntity.flags &= ~PL_MINISH;
+ gPlayerEntity.base.zVelocity = Q_16_16(2.0);
+ gPlayerEntity.base.speed = 0x100;
+ gPlayerEntity.base.flags &= ~PL_MINISH;
ResetActiveItems();
DeleteClones();
SoundReq(SFX_PLY_JUMP);
@@ -100,21 +99,21 @@ void Minecart_Action1(MinecartEntity* this) {
}
void Minecart_Action2(MinecartEntity* this) {
- if (EntityInRectRadius(super, &gPlayerEntity, 2, 2) != 0) {
- gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
- gPlayerEntity.y.HALF.HI = super->y.HALF.HI;
- if (gPlayerEntity.z.HALF.HI > -0x10) {
- if (gPlayerEntity.zVelocity >= 0) {
+ if (EntityInRectRadius(super, &gPlayerEntity.base, 2, 2) != 0) {
+ gPlayerEntity.base.x.HALF.HI = super->x.HALF.HI;
+ gPlayerEntity.base.y.HALF.HI = super->y.HALF.HI;
+ if (gPlayerEntity.base.z.HALF.HI > -0x10) {
+ if (gPlayerEntity.base.zVelocity >= 0) {
return;
}
- gPlayerEntity.animationState = super->animationState * 2;
+ gPlayerEntity.base.animationState = super->animationState * 2;
gPlayerState.flags = (gPlayerState.flags ^ PL_ENTER_MINECART) | PL_IN_MINECART;
super->action++;
super->subtimer = 1;
super->flags |= ENT_PERSIST;
super->hitType = 0x97;
- super->collisionFlags = (gPlayerEntity.collisionFlags + 1) | 0x20;
- super->flags2 = gPlayerEntity.flags2;
+ super->collisionFlags = (gPlayerEntity.base.collisionFlags + 1) | 0x20;
+ super->flags2 = gPlayerEntity.base.flags2;
super->hurtType = 0x18;
super->damage = 8;
sub_0801766C(super);
@@ -122,10 +121,10 @@ void Minecart_Action2(MinecartEntity* this) {
SoundReq(SFX_137);
}
} else {
- gPlayerEntity.direction = GetFacingDirection(&gPlayerEntity, super);
+ gPlayerEntity.base.direction = GetFacingDirection(&gPlayerEntity.base, super);
}
- if (gPlayerEntity.zVelocity < 0) {
- gPlayerEntity.spritePriority.b0 = super->spritePriority.b0 - 1;
+ if (gPlayerEntity.base.zVelocity < 0) {
+ gPlayerEntity.base.spritePriority.b0 = super->spritePriority.b0 - 1;
}
}
@@ -140,20 +139,20 @@ void Minecart_Action3(MinecartEntity* this) {
return;
}
- if ((gPlayerEntity.frame & 0xf) == 0) {
+ if ((gPlayerEntity.base.frame & 0xf) == 0) {
COLLISION_OFF(super);
- CopyPosition(super, &gPlayerEntity);
- if ((gPlayerEntity.frame & 0xf0) == 0x10) {
+ CopyPosition(super, &gPlayerEntity.base);
+ if ((gPlayerEntity.base.frame & 0xf0) == 0x10) {
super->spriteOffsetY = 1;
} else {
super->spriteOffsetY = 0;
}
} else {
COLLISION_ON(super);
- gPlayerEntity.speed = 0;
+ gPlayerEntity.base.speed = 0;
LinearMoveUpdate(super);
- CopyPosition(super, &gPlayerEntity);
- gPlayerEntity.spritePriority.b0 = super->spritePriority.b0 - 1;
+ CopyPosition(super, &gPlayerEntity.base);
+ gPlayerEntity.base.spritePriority.b0 = super->spritePriority.b0 - 1;
if (!sub_08091DDC(this)) {
if ((gRoomTransition.frameCount & 0xf) == 0) {
SoundReq(SFX_138);
@@ -181,11 +180,11 @@ void Minecart_Action3(MinecartEntity* this) {
sub_08017744(super);
gPlayerState.jump_status = 0x41;
gPlayerState.flags = (gPlayerState.flags ^ PL_IN_MINECART) | PL_ENTER_MINECART;
- gPlayerEntity.zVelocity = Q_16_16(2.0);
- gPlayerEntity.speed = 0x200;
- gPlayerEntity.animationState = super->animationState * 2;
- gPlayerEntity.direction = super->direction;
- gPlayerEntity.flags |= PL_MINISH;
+ gPlayerEntity.base.zVelocity = Q_16_16(2.0);
+ gPlayerEntity.base.speed = 0x200;
+ gPlayerEntity.base.animationState = super->animationState * 2;
+ gPlayerEntity.base.direction = super->direction;
+ gPlayerEntity.base.flags |= PL_MINISH;
sub_08004168(super);
InitAnimationForceUpdate(super, super->animationState + 0xc);
SoundReq(SFX_PLY_VO4);
@@ -201,14 +200,14 @@ void Minecart_Action3(MinecartEntity* this) {
case VVV_111:
if (vvv == GetVvvAtEntity(super)) {
Minecart_Action4(this);
- gPlayerEntity.animationState = super->animationState << 1;
+ gPlayerEntity.base.animationState = super->animationState << 1;
return;
}
break;
}
}
- gPlayerEntity.animationState = super->animationState << 1;
+ gPlayerEntity.base.animationState = super->animationState << 1;
if (super->animIndex == super->animationState) {
UpdateAnimationSingleFrame(super);
} else {
@@ -220,7 +219,7 @@ void Minecart_Action3(MinecartEntity* this) {
void Minecart_Action4(MinecartEntity* this) {
sub_08004168(super);
- CopyPosition(super, &gPlayerEntity);
+ CopyPosition(super, &gPlayerEntity.base);
switch (GetVvvAtEntity(super)) {
case VVV_103:
if (super->direction == DirectionWest) {
@@ -264,16 +263,16 @@ void Minecart_Action4(MinecartEntity* this) {
}
super->action = 3;
- gPlayerEntity.animationState = super->animationState * 2;
+ gPlayerEntity.base.animationState = super->animationState * 2;
}
void Minecart_Action5(MinecartEntity* this) {
LinearMoveUpdate(super);
- CopyPosition(super, &gPlayerEntity);
+ CopyPosition(super, &gPlayerEntity.base);
if (gRoomControls.reload_flags == 0) {
super->action = 3;
super->speed = 0x700;
- gRoomControls.camera_target = &gPlayerEntity;
+ gRoomControls.camera_target = &gPlayerEntity.base;
}
}
@@ -293,7 +292,7 @@ void Minecart_Action6(MinecartEntity* this) {
SetMetaTile(SPECIAL_META_TILE_34, COORD_TO_TILE(super), super->collisionLayer);
} else {
UpdateAnimationSingleFrame(super);
- gPlayerEntity.spritePriority.b0 = super->spritePriority.b0 - 1;
+ gPlayerEntity.base.spritePriority.b0 = super->spritePriority.b0 - 1;
}
}
@@ -313,7 +312,7 @@ bool32 sub_08091DDC(MinecartEntity* this) {
static const s8 gUnk_081223D0[] = { 0, -8, 8, 0, 0, 8, -8, 0 };
if ((GetCollisionDataRelativeTo(super, gUnk_081223D0[super->animationState * 2],
gUnk_081223D0[super->animationState * 2 + 1]) == COLLISION_DATA_255) &&
- (sub_0807BD14(&gPlayerEntity, super->animationState))) {
+ (sub_0807BD14(&gPlayerEntity.base, super->animationState))) {
super->updatePriority = 6;
super->action = 5;
switch (super->direction) {
@@ -324,7 +323,7 @@ bool32 sub_08091DDC(MinecartEntity* this) {
super->speed = 0xa0;
break;
}
- gPlayerEntity.direction = super->direction;
+ gPlayerEntity.base.direction = super->direction;
gRoomControls.camera_target = super;
return 1;
} else {
diff --git a/src/object/minecartDoor.c b/src/object/minecartDoor.c
index 0f89c5f3..c1ca45b0 100644
--- a/src/object/minecartDoor.c
+++ b/src/object/minecartDoor.c
@@ -4,7 +4,6 @@
*
* @brief Minecart Door object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "tiles.h"
@@ -100,7 +99,7 @@ void MinecartDoor_Action3(MinecartDoorEntity* this) {
return;
}
if ((gPlayerState.flags & PL_IN_MINECART) != 0) {
- if (super->type * 2 - (u32)gPlayerEntity.animationState == 0) {
+ if (super->type * 2 - (u32)gPlayerEntity.base.animationState == 0) {
if (sub_08083734(super, super->type) == 0) {
return;
}
@@ -133,15 +132,15 @@ bool32 sub_08096CEC(MinecartDoorEntity* this) {
return TRUE;
} else {
if ((gPlayerState.flags & PL_IN_MINECART) != 0) {
- Entity* player = &gPlayerEntity;
+ Entity* player = &gPlayerEntity.base;
if ((((super->type << 1) ^ player->animationState) & 2) == 0) {
if ((super->type & 1) != 0) {
- if (sub_08096D68(gPlayerEntity.y.HALF.HI, super->y.HALF.HI, gPlayerEntity.x.HALF.HI,
+ if (sub_08096D68(gPlayerEntity.base.y.HALF.HI, super->y.HALF.HI, gPlayerEntity.base.x.HALF.HI,
super->x.HALF.HI)) {
return TRUE;
}
} else {
- if (sub_08096D68(gPlayerEntity.x.HALF.HI, super->x.HALF.HI, gPlayerEntity.y.HALF.HI,
+ if (sub_08096D68(gPlayerEntity.base.x.HALF.HI, super->x.HALF.HI, gPlayerEntity.base.y.HALF.HI,
super->y.HALF.HI)) {
return TRUE;
}
@@ -163,22 +162,22 @@ bool32 sub_08096D68(s32 param_1, s32 param_2, s32 param_3, s32 param_4) {
bool32 sub_08096D84(MinecartDoorEntity* this) {
switch (super->type) {
case 0:
- if (((super->y.HALF.HI + 10) - (gPlayerEntity.y.HALF.HI)) < 0x65U) {
+ if (((super->y.HALF.HI + 10) - (gPlayerEntity.base.y.HALF.HI)) < 0x65U) {
return TRUE;
}
break;
case 1:
- if (((gPlayerEntity.x.HALF.HI) - (super->x.HALF.HI - 10)) < 0x65U) {
+ if (((gPlayerEntity.base.x.HALF.HI) - (super->x.HALF.HI - 10)) < 0x65U) {
return TRUE;
}
break;
case 2:
- if (((gPlayerEntity.y.HALF.HI) - (super->y.HALF.HI - 10)) < 0x65U) {
+ if (((gPlayerEntity.base.y.HALF.HI) - (super->y.HALF.HI - 10)) < 0x65U) {
return TRUE;
}
break;
case 3:
- if (((super->x.HALF.HI + 10) - (gPlayerEntity.x.HALF.HI)) < 0x65U) {
+ if (((super->x.HALF.HI + 10) - (gPlayerEntity.base.x.HALF.HI)) < 0x65U) {
return TRUE;
}
break;
diff --git a/src/object/mineralWaterSource.c b/src/object/mineralWaterSource.c
index 56667b11..e60006d8 100644
--- a/src/object/mineralWaterSource.c
+++ b/src/object/mineralWaterSource.c
@@ -4,7 +4,6 @@
*
* @brief Mineral Water Source object
*/
-#define NENT_DEPRECATED
#include "object.h"
void MineralWaterSource_Init(Entity*);
diff --git a/src/object/minishEmoticon.c b/src/object/minishEmoticon.c
index 279c66e4..147ca51d 100644
--- a/src/object/minishEmoticon.c
+++ b/src/object/minishEmoticon.c
@@ -4,7 +4,6 @@
*
* @brief Minish Emoticon object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "functions.h"
@@ -38,7 +37,7 @@ void MinishEmoticon_Action1(Entity* this) {
if ((gPlayerState.flags & PL_MINISH) == 0) {
DeleteThisEntity();
}
- playerEnt = &gPlayerEntity;
+ playerEnt = &gPlayerEntity.base;
sub_08079BD8(this);
this->spriteOrientation.flipY = 1;
this->palette.b.b0 = playerEnt->palette.b.b0;
diff --git a/src/object/minishLight.c b/src/object/minishLight.c
index 36569b66..382056ee 100644
--- a/src/object/minishLight.c
+++ b/src/object/minishLight.c
@@ -4,7 +4,6 @@
*
* @brief Minish Light object
*/
-#define NENT_DEPRECATED
#include "entity.h"
void MinishLight_Init(Entity*);
diff --git a/src/object/minishPortalCloseup.c b/src/object/minishPortalCloseup.c
index e683e3bc..e9ded723 100644
--- a/src/object/minishPortalCloseup.c
+++ b/src/object/minishPortalCloseup.c
@@ -4,7 +4,6 @@
*
* @brief Minish Portal Closeup object
*/
-#define NENT_DEPRECATED
#include "area.h"
#include "functions.h"
#include "main.h"
diff --git a/src/object/minishPortalStone.c b/src/object/minishPortalStone.c
index 5dc4bfcf..929f65ac 100644
--- a/src/object/minishPortalStone.c
+++ b/src/object/minishPortalStone.c
@@ -4,7 +4,6 @@
*
* @brief Minish Portal Stone object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "screen.h"
diff --git a/src/object/minishSizedArchway.c b/src/object/minishSizedArchway.c
index e92e6fef..01a81cfc 100644
--- a/src/object/minishSizedArchway.c
+++ b/src/object/minishSizedArchway.c
@@ -4,7 +4,6 @@
*
* @brief Minish Sized Archway object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "game.h"
diff --git a/src/object/minishSizedEntrance.c b/src/object/minishSizedEntrance.c
index d63eba55..cbe61fc8 100644
--- a/src/object/minishSizedEntrance.c
+++ b/src/object/minishSizedEntrance.c
@@ -4,7 +4,6 @@
*
* @brief MinishSizedEntrance object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "game.h"
#include "object.h"
@@ -46,8 +45,9 @@ void MinishSizedEntrance_Action1(Entity* this) {
DeleteThisEntity();
}
}
- if ((gPlayerState.flags & PL_MINISH) && EntityInRectRadius(this, &gPlayerEntity, 4, 4) &&
- (gPlayerEntity.z.HALF.HI == 0) && (((u16)gPlayerState.playerInput.heldInput) & gUnk_0812225C[this->type2])) {
+ if ((gPlayerState.flags & PL_MINISH) && EntityInRectRadius(this, &gPlayerEntity.base, 4, 4) &&
+ (gPlayerEntity.base.z.HALF.HI == 0) &&
+ (((u16)gPlayerState.playerInput.heldInput) & gUnk_0812225C[this->type2])) {
DoExitTransition(GetCurrentRoomProperty(this->timer));
}
}
diff --git a/src/object/minishVillageObject.c b/src/object/minishVillageObject.c
index 8a5c8598..191589cd 100644
--- a/src/object/minishVillageObject.c
+++ b/src/object/minishVillageObject.c
@@ -4,7 +4,6 @@
*
* @brief Minish Village Object object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "screen.h"
@@ -132,7 +131,7 @@ void sub_0808D2CC(void) {
Entity* obj = FindEntity(6, MINISH_VILLAGE_OBJECT, 6, 1, 0);
if (obj != NULL) {
obj->type = 9;
- SetDefaultPriority(obj, 2);
+ SetEntityPriority(obj, 2);
}
}
diff --git a/src/object/moleMittsParticle.c b/src/object/moleMittsParticle.c
index f0fdb838..f83472bc 100644
--- a/src/object/moleMittsParticle.c
+++ b/src/object/moleMittsParticle.c
@@ -4,7 +4,6 @@
*
* @brief Mole Mitts Particle object
*/
-#define NENT_DEPRECATED
#include "area.h"
#include "functions.h"
#include "object.h"
@@ -18,7 +17,7 @@ void MoleMittsParticle(Entity* this) {
MoleMittsParticle_Init,
MoleMittsParticle_Action1,
};
- if (!EntityIsDeleted(this)) {
+ if (!EntityDisabled(this)) {
MoleMittsParticle_Actions[this->action](this);
}
}
@@ -27,7 +26,7 @@ void MoleMittsParticle_Init(Entity* this) {
u32 palette;
this->action = 1;
- this->animationState = gPlayerEntity.animationState >> 1;
+ this->animationState = gPlayerEntity.base.animationState >> 1;
this->spriteRendering.b3 = 2;
this->spritePriority.b0 = 3;
this->spriteOrientation.flipY--;
@@ -63,7 +62,7 @@ void MoleMittsParticle_Init(Entity* this) {
break;
}
}
- SetDefaultPriority(this, 3);
+ SetEntityPriority(this, 3);
InitializeAnimation(this, this->type2 * 4 + this->animationState);
}
@@ -73,7 +72,7 @@ void MoleMittsParticle_Action1(Entity* this) {
DeleteThisEntity();
}
if (this->type2 != 0) {
- this->spritePriority.b0 = gPlayerEntity.spritePriority.b0 + 1 - this->frame;
+ this->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0 + 1 - this->frame;
}
}
diff --git a/src/object/mulldozerSpawnPoint.c b/src/object/mulldozerSpawnPoint.c
index 17a33331..8ba4d3b0 100644
--- a/src/object/mulldozerSpawnPoint.c
+++ b/src/object/mulldozerSpawnPoint.c
@@ -4,7 +4,6 @@
*
* @brief Mulldozer Spawn Point object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "sound.h"
diff --git a/src/object/object1D.c b/src/object/object1D.c
index 4252f9b0..0635d64c 100644
--- a/src/object/object1D.c
+++ b/src/object/object1D.c
@@ -4,7 +4,6 @@
*
* @brief Object1D object
*/
-#define NENT_DEPRECATED
#include "entity.h"
void Object1D_Init(Entity*);
diff --git a/src/object/object1F.c b/src/object/object1F.c
index 8696f43e..444f616a 100644
--- a/src/object/object1F.c
+++ b/src/object/object1F.c
@@ -4,7 +4,6 @@
*
* @brief Object1F object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "effects.h"
#include "entity.h"
@@ -60,7 +59,7 @@ void Object1F_Init(Object1FEntity* this) {
temp = gUnk_08120A18[super->subtimer].unk1;
super->palette.b.b0 = temp;
this->unk6c = gUnk_08120A18[super->subtimer].unk2;
- super->collisionLayer = gPlayerEntity.collisionLayer;
+ super->collisionLayer = gPlayerEntity.base.collisionLayer;
super->speed = 0x100;
InitializeAnimation(super, gUnk_08120A18[super->subtimer].animationState);
}
diff --git a/src/object/object30.c b/src/object/object30.c
index fd565bb9..3f31e5e3 100644
--- a/src/object/object30.c
+++ b/src/object/object30.c
@@ -4,7 +4,6 @@
*
* @brief Object30 object
*/
-#define NENT_DEPRECATED
#include "collision.h"
#include "functions.h"
#include "item.h"
@@ -106,6 +105,6 @@ void sub_0808A968(Object30Entity* this) {
super->spriteSettings.shadow = 0;
super->collisionFlags |= 0x10;
super->hitbox = (Hitbox*)&gUnk_08121C58;
- SetDefaultPriority(super, 2);
+ SetEntityPriority(super, 2);
this->gravity = Q_8_8(40.0);
}
diff --git a/src/object/object37.c b/src/object/object37.c
index 619f8482..35f32e93 100644
--- a/src/object/object37.c
+++ b/src/object/object37.c
@@ -4,7 +4,6 @@
*
* @brief Object37 object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "functions.h"
#include "item.h"
@@ -47,7 +46,7 @@ void Object37_Action1(Object37Entity* this) {
if ((gSave.kinstones.fusionUnmarked[0] != 0) && (this->unk70 != *this->unk78)) {
item = CreateGroundItem(super, ITEM_RUPEE100, 0);
if (item != 0) {
- item->direction = gPlayerEntity.animationState << 2;
+ item->direction = gPlayerEntity.base.animationState << 2;
item->speed = 0x80;
item->zVelocity = Q_16_16(2.0);
}
diff --git a/src/object/object53.c b/src/object/object53.c
index e7716e64..e00e9ef2 100644
--- a/src/object/object53.c
+++ b/src/object/object53.c
@@ -4,7 +4,6 @@
*
* @brief Object53 object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "functions.h"
diff --git a/src/object/object63.c b/src/object/object63.c
index b87c79f6..bbf74160 100644
--- a/src/object/object63.c
+++ b/src/object/object63.c
@@ -4,7 +4,6 @@
*
* @brief Object63 object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "functions.h"
diff --git a/src/object/object70.c b/src/object/object70.c
index efe82743..f9017446 100644
--- a/src/object/object70.c
+++ b/src/object/object70.c
@@ -4,7 +4,6 @@
*
* @brief Object70 object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
@@ -25,9 +24,9 @@ void Object70_Init(Entity* this) {
this->frameIndex = this->type + 0xb;
if (this->type != 0) {
sub_08004168(this);
- gPlayerEntity.spriteOrientation.flipY = 3;
- if ((gPlayerEntity.spritePriority.b0) != 7) {
- this->spritePriority.b0 = gPlayerEntity.spritePriority.b0 + 1;
+ gPlayerEntity.base.spriteOrientation.flipY = 3;
+ if ((gPlayerEntity.base.spritePriority.b0) != 7) {
+ this->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0 + 1;
} else {
this->spritePriority.b0 = 7;
}
@@ -37,23 +36,23 @@ void Object70_Init(Entity* this) {
void Object70_Action1(Entity* this) {
if (this->type == 0) {
- if (gPlayerEntity.z.WORD != 0 || (gPlayerState.dash_state & 0x40) != 0 ||
+ if (gPlayerEntity.base.z.WORD != 0 || (gPlayerState.dash_state & 0x40) != 0 ||
gPlayerState.floor_type != SURFACE_SWAMP ||
- (gPlayerEntity.action != PLAYER_NORMAL && gPlayerEntity.action != PLAYER_ROLL &&
- gPlayerEntity.action != PLAYER_JUMP)) {
- if (gPlayerEntity.z.WORD == 0) {
- CreateFx(&gPlayerEntity, FX_GREEN_SPLASH, 0);
+ (gPlayerEntity.base.action != PLAYER_NORMAL && gPlayerEntity.base.action != PLAYER_ROLL &&
+ gPlayerEntity.base.action != PLAYER_JUMP)) {
+ if (gPlayerEntity.base.z.WORD == 0) {
+ CreateFx(&gPlayerEntity.base, FX_GREEN_SPLASH, 0);
}
- gPlayerEntity.spriteOrientation.flipY = 2;
+ gPlayerEntity.base.spriteOrientation.flipY = 2;
DeleteThisEntity();
}
- this->x = gPlayerEntity.x;
- this->y = gPlayerEntity.y;
+ this->x = gPlayerEntity.base.x;
+ this->y = gPlayerEntity.base.y;
if (gPlayerState.jump_status == 0) {
- gPlayerEntity.spriteOrientation.flipY = 3;
- if (gPlayerEntity.spritePriority.b0 != 7) {
- this->spritePriority.b0 = gPlayerEntity.spritePriority.b0 + 1;
+ gPlayerEntity.base.spriteOrientation.flipY = 3;
+ if (gPlayerEntity.base.spritePriority.b0 != 7) {
+ this->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0 + 1;
} else {
this->spritePriority.b0 = 7;
}
@@ -61,11 +60,11 @@ void Object70_Action1(Entity* this) {
return;
}
- if (gPlayerEntity.action != PLAYER_USEENTRANCE) {
+ if (gPlayerEntity.base.action != PLAYER_USEENTRANCE) {
if (this->collisionLayer == 1) {
- gPlayerEntity.spriteOrientation.flipY = 2;
+ gPlayerEntity.base.spriteOrientation.flipY = 2;
} else {
- gPlayerEntity.spriteOrientation.flipY = 1;
+ gPlayerEntity.base.spriteOrientation.flipY = 1;
}
DeleteThisEntity();
}
diff --git a/src/object/objectA.c b/src/object/objectA.c
index 1eaf8f37..c9d94b74 100644
--- a/src/object/objectA.c
+++ b/src/object/objectA.c
@@ -4,7 +4,6 @@
*
* @brief ObjectA object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "flags.h"
#include "functions.h"
diff --git a/src/object/objectA2.c b/src/object/objectA2.c
index 167bf188..17833e69 100644
--- a/src/object/objectA2.c
+++ b/src/object/objectA2.c
@@ -4,7 +4,6 @@
*
* @brief Object A2 object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "menu.h"
#include "object.h"
@@ -45,7 +44,7 @@ void ObjectA2_Init(Entity* this) {
this->spriteOrientation.flipY = 2;
this->action = 1;
ChangeObjPalette(this, gUnk_08124704[this->type]);
- SetDefaultPriority(this, PRIO_HIGHEST);
+ SetEntityPriority(this, PRIO_HIGHEST);
}
void ObjectA2_Action1(Entity* this) {
diff --git a/src/object/objectA7.c b/src/object/objectA7.c
index a711d644..bf8cc69e 100644
--- a/src/object/objectA7.c
+++ b/src/object/objectA7.c
@@ -4,7 +4,6 @@
*
* @brief Object A7 object
*/
-#define NENT_DEPRECATED
#include "entity.h"
void ObjectA7(Entity* this) {
diff --git a/src/object/objectA8.c b/src/object/objectA8.c
index dca5a903..4de9ccae 100644
--- a/src/object/objectA8.c
+++ b/src/object/objectA8.c
@@ -4,7 +4,6 @@
*
* @brief ObjectA8 object
*/
-#define NENT_DEPRECATED
#include "collision.h"
#include "functions.h"
#include "hitbox.h"
@@ -55,7 +54,7 @@ void ObjectA8(ObjectA8Entity* this) {
case 0x1e:
case 0x1f:
super->action = 5;
- super->child = &gPlayerEntity;
+ super->child = &gPlayerEntity.base;
CreateItemEntity(super->type, 0, 0);
DeleteThisEntity();
}
@@ -83,7 +82,7 @@ void ObjectA8_Init(ObjectA8Entity* this) {
super->gustJarFlags = 1;
this->unk_74 = super->x.HALF.HI;
this->unk_76 = super->y.HALF.HI;
- SetDefaultPriority(super, 3);
+ SetEntityPriority(super, 3);
EnqueueSFX(SFX_136);
}
@@ -131,7 +130,7 @@ void ObjectA8_Action2Subaction2(ObjectA8Entity* this) {
if (sub_0806F3E4(super)) {
super->flags &= ~ENT_COLLIDE;
super->action = 5;
- super->child = &gPlayerEntity;
+ super->child = &gPlayerEntity.base;
GiveItem(super->type, 0);
}
}
@@ -175,7 +174,7 @@ void ObjectA8_Action4(ObjectA8Entity* this) {
} else {
CopyPosition(super->child, super);
super->z.HALF.HI--;
- if (IsColliding(super, &gPlayerEntity)) {
+ if (IsColliding(super, &gPlayerEntity.base)) {
sub_0809FECC(this);
GiveItem(super->type, 0);
}
@@ -239,7 +238,7 @@ bool32 sub_0809FE9C(ObjectA8Entity* this) {
}
void sub_0809FECC(ObjectA8Entity* this) {
- super->child = &gPlayerEntity;
+ super->child = &gPlayerEntity.base;
super->action = 5;
super->subAction = 0;
}
diff --git a/src/object/objectBF.c b/src/object/objectBF.c
index 0c884d18..a66a2b61 100644
--- a/src/object/objectBF.c
+++ b/src/object/objectBF.c
@@ -4,7 +4,6 @@
*
* @brief Object BF object
*/
-#define NENT_DEPRECATED
#include "entity.h"
void ObjectBF(Entity* this) {
diff --git a/src/object/objectBlockingStairs.c b/src/object/objectBlockingStairs.c
index 7472c331..204ba0e1 100644
--- a/src/object/objectBlockingStairs.c
+++ b/src/object/objectBlockingStairs.c
@@ -4,7 +4,6 @@
*
* @brief Object Blocking Stairs object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "effects.h"
#include "entity.h"
@@ -88,7 +87,7 @@ void ObjectBlockingStairs_Action1(ObjectBlockingStairsEntity* this) {
int xDist;
Entity* ent;
- xDist = (int)gPlayerEntity.x.HALF.HI - super->x.HALF.HI;
+ xDist = (int)gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI;
if (this->objFlags) {
if (!CheckFlags(this->objFlags)) {
@@ -118,7 +117,7 @@ void ObjectBlockingStairs_Action1(ObjectBlockingStairsEntity* this) {
case SPECIAL_META_TILE_48:
case SPECIAL_META_TILE_49:
super->action = 3;
- super->direction = Direction8FromAnimationState(gPlayerEntity.animationState);
+ super->direction = Direction8FromAnimationState(gPlayerEntity.base.animationState);
super->speed = 0x80;
super->timer = 64;
RequestPriorityDuration(super, 80);
@@ -127,7 +126,7 @@ void ObjectBlockingStairs_Action1(ObjectBlockingStairsEntity* this) {
return;
}
- if ((gPlayerEntity.animationState & 2) == 0) {
+ if ((gPlayerEntity.base.animationState & 2) == 0) {
return;
}
RegisterCarryEntity(super);
@@ -161,13 +160,13 @@ void ObjectBlockingStairs_Action2(ObjectBlockingStairsEntity* this) {
sub_08093280(this);
} else {
if (gPlayerState.heldObject == 0x12) {
- if ((gPlayerEntity.frame & 2) != 0 && ++super->subtimer > 8) {
+ if ((gPlayerEntity.base.frame & 2) != 0 && ++super->subtimer > 8) {
gPlayerState.queued_action = PLAYER_PULL;
gPlayerState.field_0x38 = 0x40;
gPlayerState.flags |= PL_BUSY;
- gPlayerEntity.x.HALF.LO = 0;
- gPlayerEntity.y.HALF.LO = 0;
- super->direction = (gPlayerEntity.animationState ^ 4) << 2;
+ gPlayerEntity.base.x.HALF.LO = 0;
+ gPlayerEntity.base.y.HALF.LO = 0;
+ super->direction = (gPlayerEntity.base.animationState ^ 4) << 2;
super->timer = 64;
EnqueueSFX(SFX_10F);
sub_08093248(this);
diff --git a/src/object/objectOnPillar.c b/src/object/objectOnPillar.c
index 206b647f..8a9c7913 100644
--- a/src/object/objectOnPillar.c
+++ b/src/object/objectOnPillar.c
@@ -4,7 +4,6 @@
*
* @brief Object on Pillar object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "hitbox.h"
#include "object.h"
@@ -118,17 +117,17 @@ void ObjectOnPillar_SubAction0(ObjectOnPillarEntity* this) {
const s8* ptr;
if (this->unk_72 == 0) {
this->unk_72 = 1;
- ptr = &gUnk_08123274[gPlayerEntity.animationState];
- PositionRelative(super, &gPlayerEntity, ptr[0] << 0x10, ptr[1] << 0x10);
+ ptr = &gUnk_08123274[gPlayerEntity.base.animationState];
+ PositionRelative(super, &gPlayerEntity.base, ptr[0] << 0x10, ptr[1] << 0x10);
}
sub_08097008(this);
if (sub_080896B0()) {
gPlayerState.queued_action = PLAYER_PULL;
gPlayerState.field_0x38 = 0x20;
gPlayerState.flags |= PL_BUSY;
- gPlayerEntity.x.HALF.LO = 0;
- gPlayerEntity.y.HALF.LO = 0;
- super->direction = ((gPlayerEntity.animationState ^ 4) << 2);
+ gPlayerEntity.base.x.HALF.LO = 0;
+ gPlayerEntity.base.y.HALF.LO = 0;
+ super->direction = ((gPlayerEntity.base.animationState ^ 4) << 2);
sub_08097098(this);
}
}
diff --git a/src/object/objectOnSpinyBeetle.c b/src/object/objectOnSpinyBeetle.c
index 8c6beccf..17597f8f 100644
--- a/src/object/objectOnSpinyBeetle.c
+++ b/src/object/objectOnSpinyBeetle.c
@@ -4,7 +4,6 @@
*
* @brief Object on Spiny Beetle object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
@@ -139,7 +138,7 @@ void ObjectOnSpinyBeetle_Action2Subaction0(ObjectOnSpinyBeetleEntity* this) {
super->flags |= ENT_COLLIDE;
super->collisionFlags = 7;
super->hitType = 1;
- super->flags2 = gPlayerEntity.flags2;
+ super->flags2 = gPlayerEntity.base.flags2;
super->spriteOffsetY = 0;
(super->parent)->child = NULL;
super->subAction++;
diff --git a/src/object/octorokBossObject.c b/src/object/octorokBossObject.c
index dd0d49e4..7b1d574b 100644
--- a/src/object/octorokBossObject.c
+++ b/src/object/octorokBossObject.c
@@ -4,7 +4,6 @@
*
* @brief Octorok Boss Object object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "game.h"
#include "object.h"
@@ -318,9 +317,9 @@ void OctorokBossObject_Action1(OctorokBossObjectEntity* this) {
}
break;
case 9:
- sub_08078B48();
+ PausePlayer();
if ((this->unk_78.WORD_U)-- == 0) {
- gRoomControls.camera_target = &gPlayerEntity;
+ gRoomControls.camera_target = &gPlayerEntity.base;
DeleteThisEntity();
}
break;
diff --git a/src/object/palaceArchway.c b/src/object/palaceArchway.c
index f4c237ef..9a6f83dc 100644
--- a/src/object/palaceArchway.c
+++ b/src/object/palaceArchway.c
@@ -4,7 +4,6 @@
*
* @brief Palace Archway object
*/
-#define NENT_DEPRECATED
#include "object.h"
#include "tiles.h"
diff --git a/src/object/paper.c b/src/object/paper.c
index 784fb257..68890eb6 100644
--- a/src/object/paper.c
+++ b/src/object/paper.c
@@ -4,7 +4,6 @@
*
* @brief Paper object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "map.h"
#include "object.h"
@@ -69,7 +68,8 @@ void Paper_Type2(Entity* this) {
void Paper_Action1(Entity* this) {
if (this->type == 0) {
- if ((gPlayerEntity.y.HALF.HI < this->y.HALF.HI) || (gPlayerEntity.y.HALF.HI) > this->y.HALF.HI + 0x18) {
+ if ((gPlayerEntity.base.y.HALF.HI < this->y.HALF.HI) ||
+ (gPlayerEntity.base.y.HALF.HI) > this->y.HALF.HI + 0x18) {
this->spriteRendering.b3 = 1;
} else {
this->spriteRendering.b3 = 2;
diff --git a/src/object/parallaxRoomView.c b/src/object/parallaxRoomView.c
index f72cc80b..49be0837 100644
--- a/src/object/parallaxRoomView.c
+++ b/src/object/parallaxRoomView.c
@@ -4,7 +4,6 @@
*
* @brief Parallax Room View object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "room.h"
@@ -34,7 +33,7 @@ void ParallaxRoomView(ParallaxRoomViewEntity* this) {
}
this->unk_68 = super->x.HALF.HI;
this->unk_6a = super->y.HALF.HI;
- SetDefaultPriority(super, 6);
+ SetEntityPriority(super, 6);
}
if ((super->flags & 0x10) == 0) {
iVar4 = super->x.HALF.HI - gRoomControls.scroll_x;
diff --git a/src/object/picoBloom.c b/src/object/picoBloom.c
index 085295e4..157e344c 100644
--- a/src/object/picoBloom.c
+++ b/src/object/picoBloom.c
@@ -4,7 +4,6 @@
*
* @brief Pico Bloom object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "sound.h"
diff --git a/src/object/pinwheel.c b/src/object/pinwheel.c
index e98c5144..35d161a8 100644
--- a/src/object/pinwheel.c
+++ b/src/object/pinwheel.c
@@ -4,7 +4,6 @@
*
* @brief Pinwheel object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "flags.h"
#include "object.h"
diff --git a/src/object/playerClone.c b/src/object/playerClone.c
index 5a2caf96..99fc8910 100644
--- a/src/object/playerClone.c
+++ b/src/object/playerClone.c
@@ -4,7 +4,6 @@
*
* @brief Player Clone object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "collision.h"
#include "effects.h"
@@ -74,8 +73,8 @@ void PlayerClone_Action1(PlayerCloneEntity* this) {
super->updatePriority = 6;
super->hitbox = (Hitbox*)&PlayerCloneHitbox;
super->subtimer = (super->type + 1) * 15;
- this->unk78 = super->x.HALF.HI - gPlayerEntity.x.HALF.HI;
- this->unk7a = super->y.HALF.HI - gPlayerEntity.y.HALF.HI;
+ this->unk78 = super->x.HALF.HI - gPlayerEntity.base.x.HALF.HI;
+ this->unk7a = super->y.HALF.HI - gPlayerEntity.base.y.HALF.HI;
if ((this->unk78 != 0) && (this->unk7a != 0)) {
((PlayerCloneEntity*)gPlayerClones[super->type])->unk70 = 1;
}
@@ -108,13 +107,13 @@ void PlayerClone_Action2(PlayerCloneEntity* this) {
if (gPlayerState.chargeState.action == 5 && gPlayerClones[super->type] != NULL &&
gPlayerState.framestate != PL_STATE_TALKEZLO && super->health != 0) {
- if (gPlayerEntity.iframes >= 1) {
+ if (gPlayerEntity.base.iframes >= 1) {
gPlayerState.chargeState.action = 1;
} else {
GetVvvAtEntity(super); // TODO why is the return value not used?
sub_08084B1C(this);
- super->x.HALF.HI = gPlayerEntity.x.HALF.HI + this->unk78;
- super->y.HALF.HI = gPlayerEntity.y.HALF.HI + this->unk7a;
+ super->x.HALF.HI = gPlayerEntity.base.x.HALF.HI + this->unk78;
+ super->y.HALF.HI = gPlayerEntity.base.y.HALF.HI + this->unk7a;
sub_08084CAC(this);
sub_080085B0(super);
if ((super->collisions & (COL_NORTH_FULL | COL_SOUTH_FULL | COL_EAST_FULL | COL_WEST_FULL)) !=
@@ -153,22 +152,22 @@ void PlayerClone_Action2(PlayerCloneEntity* this) {
}
void sub_08084B1C(PlayerCloneEntity* this) {
- super->flags = gPlayerEntity.flags;
- super->spriteVramOffset = gPlayerEntity.spriteVramOffset;
- super->frameIndex = gPlayerEntity.frameIndex;
- super->frameSpriteSettings = gPlayerEntity.frameSpriteSettings;
- super->spriteIndex = gPlayerEntity.spriteIndex;
- super->direction = gPlayerEntity.direction;
- super->animationState = gPlayerEntity.animationState;
- super->spriteSettings.flipX = gPlayerEntity.spriteSettings.flipX;
- super->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
- super->spritePriority.b0 = gPlayerEntity.spritePriority.b0;
- super->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
- super->collisionLayer = gPlayerEntity.collisionLayer;
- super->flags2 = gPlayerEntity.flags2;
- super->hitType = gPlayerEntity.hitType;
- super->collisionFlags = gPlayerEntity.collisionFlags;
- super->hurtType = gPlayerEntity.hurtType;
+ super->flags = gPlayerEntity.base.flags;
+ super->spriteVramOffset = gPlayerEntity.base.spriteVramOffset;
+ super->frameIndex = gPlayerEntity.base.frameIndex;
+ super->frameSpriteSettings = gPlayerEntity.base.frameSpriteSettings;
+ super->spriteIndex = gPlayerEntity.base.spriteIndex;
+ super->direction = gPlayerEntity.base.direction;
+ super->animationState = gPlayerEntity.base.animationState;
+ super->spriteSettings.flipX = gPlayerEntity.base.spriteSettings.flipX;
+ super->spriteRendering.b3 = gPlayerEntity.base.spriteRendering.b3;
+ super->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0;
+ super->spriteOrientation.flipY = gPlayerEntity.base.spriteOrientation.flipY;
+ super->collisionLayer = gPlayerEntity.base.collisionLayer;
+ super->flags2 = gPlayerEntity.base.flags2;
+ super->hitType = gPlayerEntity.base.hitType;
+ super->collisionFlags = gPlayerEntity.base.collisionFlags;
+ super->hurtType = gPlayerEntity.base.hurtType;
CopyPosition(super, super->child);
if (gPlayerState.attack_status != 0) {
super->child->damage = gPlayerState.item->damage;
diff --git a/src/object/pot.c b/src/object/pot.c
index dba82127..7617d39b 100644
--- a/src/object/pot.c
+++ b/src/object/pot.c
@@ -4,7 +4,6 @@
*
* @brief Pot object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "flags.h"
#include "functions.h"
@@ -158,7 +157,7 @@ void sub_08082510(PotEntity* this) {
super->hitbox = (Hitbox*)&gUnk_080FD340;
super->collisionFlags = 7;
super->hitType = 1;
- super->flags2 = gPlayerEntity.flags2;
+ super->flags2 = gPlayerEntity.base.flags2;
super->spriteOffsetY = 0;
SetMetaTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
super->subAction++;
@@ -183,7 +182,7 @@ void sub_0808259C(PotEntity* this) {
CreateFx(super, FX_LAVA_SPLASH, 0);
break;
default:
- sub_08082850(this, &gPlayerEntity);
+ sub_08082850(this, &gPlayerEntity.base);
return;
}
diff --git a/src/object/pressurePlate.c b/src/object/pressurePlate.c
index a10818eb..df373091 100644
--- a/src/object/pressurePlate.c
+++ b/src/object/pressurePlate.c
@@ -4,7 +4,6 @@
*
* @brief Pressure Plate object
*/
-#define NENT_DEPRECATED
#include "collision.h"
#include "functions.h"
#include "hitbox.h"
@@ -105,7 +104,7 @@ static u32 sub_08088938(PressurePlateEntity* this) {
x = super->x.HALF.HI - 8;
y = super->y.HALF.HI - 8;
for (i = 0; i < 8; ++i) {
- Entity* e = gRoomVars.entities[i];
+ Entity* e = gRoomVars.puzzleEntities[i];
if (e != NULL) {
if ((u16)(e->x.HALF.HI - x) < 0x11 && ((u16)(e->y.HALF_U.HI - y) < 0x11)) {
e->spriteOffsetY = sSpriteOffsets[this->dir];
@@ -121,7 +120,7 @@ static u32 get_standing_count(PressurePlateEntity* this) {
num = 0;
if (IsCollidingPlayer(super) != 0) {
- gPlayerEntity.spriteOffsetY = sSpriteOffsets[this->dir];
+ gPlayerEntity.base.spriteOffsetY = sSpriteOffsets[this->dir];
num = 1;
}
if ((gPlayerState.flags & PL_CLONING) != 0) {
diff --git a/src/object/pullableLever.c b/src/object/pullableLever.c
index 8304d4ba..c8f9b086 100644
--- a/src/object/pullableLever.c
+++ b/src/object/pullableLever.c
@@ -4,7 +4,6 @@
*
* @brief Pullable Lever object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "hitbox.h"
#include "object.h"
@@ -106,7 +105,7 @@ void PullableLever_HandleAction2(PullableLeverEntity* this) {
void PullableLever_HandleSubAction0(PullableLeverEntity* this) {
u16 y;
u16 x;
- Entity* player = &gPlayerEntity;
+ Entity* player = &gPlayerEntity.base;
if (this->unk_75 == 0) {
if (-player->animationState + super->type2 * 2 == 0) {
@@ -123,7 +122,7 @@ void PullableLever_HandleSubAction0(PullableLeverEntity* this) {
if (player->animationState >> 1 == super->type2) {
if (gPlayerState.framestate == PL_STATE_PULL) {
if (gPlayerState.heldObject & 2) {
- if (gPlayerEntity.frame & 2) {
+ if (gPlayerEntity.base.frame & 2) {
sub_0809153C(this);
if (this->unk_75 == 1) {
this->unk_75 = 2;
@@ -192,15 +191,15 @@ void sub_0809153C(PullableLeverEntity* this) {
s16 diff;
s32 radius;
- Entity* player = &gPlayerEntity;
+ Entity* player = &gPlayerEntity.base;
dir = gUnk_081222C0[super->type2];
if (this->necessaryPullLength <= this->pullLength) {
return;
}
prevX = player->x.HALF.HI;
prevY = player->y.HALF.HI;
- sub_080044AE(&gPlayerEntity, super->speed, dir);
- if ((prevX == gPlayerEntity.x.HALF.HI) && (prevY == gPlayerEntity.y.HALF.HI)) {
+ sub_080044AE(&gPlayerEntity.base, super->speed, dir);
+ if ((prevX == gPlayerEntity.base.x.HALF.HI) && (prevY == gPlayerEntity.base.y.HALF.HI)) {
return;
}
@@ -209,13 +208,13 @@ void sub_0809153C(PullableLeverEntity* this) {
diff = player->y.HALF.HI - prevY;
break;
case 1:
- diff = prevX - gPlayerEntity.x.HALF.HI;
+ diff = prevX - gPlayerEntity.base.x.HALF.HI;
break;
case 2:
- diff = prevY - gPlayerEntity.y.HALF.HI;
+ diff = prevY - gPlayerEntity.base.y.HALF.HI;
break;
case 3:
- diff = gPlayerEntity.x.HALF.HI - prevX;
+ diff = gPlayerEntity.base.x.HALF.HI - prevX;
break;
}
radius = (diff << 0x18);
diff --git a/src/object/pullableMushroom.c b/src/object/pullableMushroom.c
index fc087b4c..9ecd7d42 100644
--- a/src/object/pullableMushroom.c
+++ b/src/object/pullableMushroom.c
@@ -4,7 +4,6 @@
*
* @brief Pullable Mushroom object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "game.h"
#include "hitbox.h"
@@ -271,7 +270,7 @@ void sub_0808AEB0(PullableMushroomEntity* this) {
if ((gPlayerState.playerInput.heldInput & gUnk_081211E4[super->animationState]) != 0) {
GetNextFrame(super);
if (uVar1 < 0x40) {
- sub_080044AE(&gPlayerEntity, 0x40, super->direction);
+ sub_080044AE(&gPlayerEntity.base, 0x40, super->direction);
if (this->unk_7c-- == 0) {
this->unk_7c = 4;
SoundReq(SFX_12F);
@@ -280,29 +279,30 @@ void sub_0808AEB0(PullableMushroomEntity* this) {
super->subtimer = 1;
} else {
- if (((super->subtimer != 0) && (gPlayerEntity.action == PLAYER_NORMAL)) && (gPlayerState.swim_state == 0)) {
+ if (((super->subtimer != 0) && (gPlayerEntity.base.action == PLAYER_NORMAL)) &&
+ (gPlayerState.swim_state == 0)) {
gPlayerState.queued_action = PLAYER_08072C9C;
gPlayerState.field_0x38 = uVar1;
gPlayerState.field_0x39 = super->direction ^ 0x10;
- gPlayerState.field_0x3a = sub_0808B1F0(this, &gPlayerEntity);
+ gPlayerState.field_0x3a = sub_0808B1F0(this, &gPlayerEntity.base);
super->subAction++;
}
}
} else {
super->timer = 1;
this->unk_7c = 1;
- super->animationState = AnimationStateFlip90(gPlayerEntity.animationState >> 1);
+ super->animationState = AnimationStateFlip90(gPlayerEntity.base.animationState >> 1);
super->direction = (super->animationState << 3);
super->flags &= ~0x80;
- super->spriteSettings.flipX = gPlayerEntity.spriteSettings.flipX;
+ super->spriteSettings.flipX = gPlayerEntity.base.spriteSettings.flipX;
InitializeAnimation(super, super->animationState + 5);
if (sub_0808B21C(this, 0)) {
sub_0808B168((PullableMushroomEntity*)super->child, 0);
}
if ((super->animationState & 1) != 0) {
- gPlayerEntity.y.HALF.HI = super->y.HALF.HI;
+ gPlayerEntity.base.y.HALF.HI = super->y.HALF.HI;
} else {
- gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
+ gPlayerEntity.base.x.HALF.HI = super->x.HALF.HI;
}
}
}
@@ -334,9 +334,9 @@ void PullableMushroom_Action3(PullableMushroomEntity* this) {
void sub_0808B05C(PullableMushroomEntity* this) {
if (super->type == 0) {
- super->animationState = AnimationStateFlip90(gPlayerEntity.animationState >> 1);
+ super->animationState = AnimationStateFlip90(gPlayerEntity.base.animationState >> 1);
super->direction = super->animationState << 3;
- super->spriteSettings.flipX = gPlayerEntity.spriteSettings.flipX;
+ super->spriteSettings.flipX = gPlayerEntity.base.spriteSettings.flipX;
super->flags &= ~0x80;
InitializeAnimation(super, super->animationState + 5);
if (sub_0808B21C(this, 1)) {
@@ -357,16 +357,16 @@ void sub_0808B0BC(PullableMushroomEntity* this) {
GetNextFrame(super);
break;
case 1:
- ptr = &gUnk_08126EE4[gPlayerEntity.animationState & 0xe];
- ent.base.x.HALF.HI = ptr[0] + gPlayerEntity.x.HALF.HI;
- ent.base.y.HALF.HI = ptr[1] + gPlayerEntity.y.HALF.HI;
+ ptr = &gUnk_08126EE4[gPlayerEntity.base.animationState & 0xe];
+ ent.base.x.HALF.HI = ptr[0] + gPlayerEntity.base.x.HALF.HI;
+ ent.base.y.HALF.HI = ptr[1] + gPlayerEntity.base.y.HALF.HI;
if (sub_0800419C(&ent.base, super, 7, 7)) {
- if ((gPlayerEntity.action != PLAYER_NORMAL) || (gPlayerState.swim_state != 0))
+ if ((gPlayerEntity.base.action != PLAYER_NORMAL) || (gPlayerState.swim_state != 0))
return;
gPlayerState.queued_action = PLAYER_08072C9C;
gPlayerState.field_0x38 = uVar2;
gPlayerState.field_0x39 = super->direction ^ 0x10;
- gPlayerState.field_0x3a = sub_0808B1F0((PullableMushroomEntity*)super->parent, &gPlayerEntity);
+ gPlayerState.field_0x3a = sub_0808B1F0((PullableMushroomEntity*)super->parent, &gPlayerEntity.base);
} else {
super->speed = 0x40;
if (uVar2 < 0x40) {
@@ -399,13 +399,13 @@ void sub_0808B168(PullableMushroomEntity* this, u32 param_2) {
pEVar6 = pEVar5;
} else {
if ((super->animationState & 1) != 0) {
- pEVar6 = &gPlayerEntity;
+ pEVar6 = &gPlayerEntity.base;
pEVar5 = super->parent;
pcVar5 = (gUnk_081211FC + super->animationState * 2);
pcVar3 = (gUnk_081211F4 + 1 + AnimationStateFlip90(super->animationState) * 2);
} else {
pEVar6 = super->parent;
- pEVar5 = &gPlayerEntity;
+ pEVar5 = &gPlayerEntity.base;
pcVar5 = (gUnk_081211F4 + AnimationStateFlip90(super->animationState) * 2);
pcVar3 = (gUnk_081211FC + 1 + super->animationState * 2);
}
diff --git a/src/object/pushableFurniture.c b/src/object/pushableFurniture.c
index b49fd6ad..914a4501 100644
--- a/src/object/pushableFurniture.c
+++ b/src/object/pushableFurniture.c
@@ -4,30 +4,11 @@
*
* @brief Pushable Furniture object
*/
-#define NENT_DEPRECATED
+#include "object/pushableFurniture.h"
+
#include "functions.h"
-#include "object.h"
#include "tiles.h"
-typedef struct {
- /*0x00*/ Entity base;
- /*0x68*/ u8 unk_68[0x8];
- /*0x70*/ u16 unk_70;
- /*0x72*/ u16 unk_72;
- /*0x74*/ u16 unk_74;
- /*0x76*/ u16 unk_76;
- /*0x78*/ u8 unk_78[0x2];
- /*0x7a*/ u16 unk_7a;
- /*0x7c*/ u16 unk_7c;
- /*0x7e*/ u16 unk_7e;
- /*0x80*/ u8 unk_80;
- /*0x81*/ u8 unk_81;
- /*0x82*/ u8 unk_82;
- /*0x83*/ u8 unk_83;
- /*0x84*/ u8 unk_84[0x2];
- /*0x86*/ u16 unk_86;
-} PushableFurnitureEntity;
-
extern const s16 gUnk_080B4488[];
extern void (*const PushableFurniture_Actions[])(PushableFurnitureEntity*);
@@ -341,9 +322,10 @@ void sub_0808FDE8(PushableFurnitureEntity* this) {
bool32 sub_0808FECC(PushableFurnitureEntity* this) {
bool32 result = TRUE;
- if (!((gPlayerState.flags & PL_MINISH) == 0 && (gPlayerEntity.action == PLAYER_BOUNCE) &&
- (gPlayerEntity.animationState == 0) && (gPlayerEntity.y.HALF.HI - super->y.HALF.HI < 0x14) &&
- (super->x.HALF.HI + 0xc > gPlayerEntity.x.HALF.HI) && (super->x.HALF.HI - 12 < gPlayerEntity.x.HALF.HI))) {
+ if (!((gPlayerState.flags & PL_MINISH) == 0 && (gPlayerEntity.base.action == PLAYER_BOUNCE) &&
+ (gPlayerEntity.base.animationState == 0) && (gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI < 0x14) &&
+ (super->x.HALF.HI + 0xc > gPlayerEntity.base.x.HALF.HI) &&
+ (super->x.HALF.HI - 12 < gPlayerEntity.base.x.HALF.HI))) {
result = FALSE;
}
return result;
diff --git a/src/object/pushableGrave.c b/src/object/pushableGrave.c
index 4145d7cf..b285f93f 100644
--- a/src/object/pushableGrave.c
+++ b/src/object/pushableGrave.c
@@ -4,7 +4,6 @@
*
* @brief Pushable Grave object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "hitbox.h"
#include "object.h"
@@ -120,7 +119,7 @@ void PushableGrave_Action3(PushableGraveEntity* this) {
EnqueueSFX(SFX_SECRET);
sub_080977F4(this);
if (super->type == 0) {
- gRoomControls.camera_target = &gPlayerEntity;
+ gRoomControls.camera_target = &gPlayerEntity.base;
gRoomControls.scrollSpeed = 4;
}
}
diff --git a/src/object/pushableLever.c b/src/object/pushableLever.c
index d32214ce..4d633d69 100644
--- a/src/object/pushableLever.c
+++ b/src/object/pushableLever.c
@@ -4,7 +4,6 @@
*
* @brief Pushable Lever object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "tiles.h"
@@ -56,9 +55,9 @@ void PushableLever_Idle(PushableLeverEntity* this) {
gPlayerState.pushedObject = 0x90;
gPlayerState.queued_action = PLAYER_PUSH;
gPlayerState.flags |= PL_BUSY;
- gPlayerEntity.x.HALF.LO = 0;
- gPlayerEntity.y.HALF.LO = 0;
- gPlayerEntity.direction = gPlayerEntity.animationState << 2;
+ gPlayerEntity.base.x.HALF.LO = 0;
+ gPlayerEntity.base.y.HALF.LO = 0;
+ gPlayerEntity.base.direction = gPlayerEntity.base.animationState << 2;
}
}
}
diff --git a/src/object/pushableRock.c b/src/object/pushableRock.c
index 203f2848..71e5a642 100644
--- a/src/object/pushableRock.c
+++ b/src/object/pushableRock.c
@@ -4,7 +4,6 @@
*
* @brief Pushable Rock object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "tiles.h"
diff --git a/src/object/pushableStatue.c b/src/object/pushableStatue.c
index 7820c979..6ea4e35f 100644
--- a/src/object/pushableStatue.c
+++ b/src/object/pushableStatue.c
@@ -4,7 +4,6 @@
*
* @brief Pushable Statue object
*/
-#define NENT_DEPRECATED
#include "area.h"
#include "functions.h"
#include "hitbox.h"
@@ -107,9 +106,9 @@ void PushableStatue_SubAction0(PushableStatueEntity* this) {
if (this->unk_83 == 0) {
this->unk_83 = 1;
- index = gPlayerEntity.animationState;
+ index = gPlayerEntity.base.animationState;
ptr = &gUnk_08120CB4[index];
- PositionRelative(super, &gPlayerEntity, *(ptr) << 0x10, *(ptr + 1) << 0x10);
+ PositionRelative(super, &gPlayerEntity.base, *(ptr) << 0x10, *(ptr + 1) << 0x10);
}
metaTileType = GetMetaTileType(this->unk_84, super->collisionLayer);
if (metaTileType != SPECIAL_META_TILE_11) {
@@ -134,9 +133,9 @@ void PushableStatue_SubAction0(PushableStatueEntity* this) {
gPlayerState.queued_action = PLAYER_PULL;
gPlayerState.field_0x38 = 0x20;
gPlayerState.flags |= PL_BUSY;
- gPlayerEntity.x.HALF.LO = 0;
- gPlayerEntity.y.HALF.LO = 0;
- super->direction = (gPlayerEntity.animationState ^ 4) << 2;
+ gPlayerEntity.base.x.HALF.LO = 0;
+ gPlayerEntity.base.y.HALF.LO = 0;
+ super->direction = (gPlayerEntity.base.animationState ^ 4) << 2;
sub_08089538(this);
}
}
@@ -175,8 +174,8 @@ void sub_08089454(PushableStatueEntity* this) {
void sub_080894C8(PushableStatueEntity* this) {
u32 index;
for (index = 0; index < 8; index++) {
- if (gRoomVars.entities[index] == NULL) {
- gRoomVars.entities[index] = super;
+ if (gRoomVars.puzzleEntities[index] == NULL) {
+ gRoomVars.puzzleEntities[index] = super;
break;
}
}
@@ -185,8 +184,8 @@ void sub_080894C8(PushableStatueEntity* this) {
void sub_080894FC(PushableStatueEntity* this) {
u32 index;
for (index = 0; index <= 7; index++) {
- if (super == gRoomVars.entities[index]) {
- gRoomVars.entities[index] = NULL;
+ if (super == gRoomVars.puzzleEntities[index]) {
+ gRoomVars.puzzleEntities[index] = NULL;
break;
}
}
@@ -261,13 +260,13 @@ bool32 sub_080896B0(void) {
u32 tmp2;
u32 vvv;
- if (((gPlayerState.heldObject & 0x1f) == 0x12) && ((gPlayerEntity.frame & 1) != 0)) {
- ptr = &gUnk_080B4468[gPlayerEntity.animationState & 6];
- uVar1 = gUnk_080B4488[gPlayerEntity.animationState >> 1];
- uVar4 = COORD_TO_TILE_OFFSET(&gPlayerEntity, -ptr[0], -ptr[1]) - uVar1;
- vvv = GetVvvAtMetaTilePos(uVar4, gPlayerEntity.collisionLayer);
+ if (((gPlayerState.heldObject & 0x1f) == 0x12) && ((gPlayerEntity.base.frame & 1) != 0)) {
+ ptr = &gUnk_080B4468[gPlayerEntity.base.animationState & 6];
+ uVar1 = gUnk_080B4488[gPlayerEntity.base.animationState >> 1];
+ uVar4 = COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr[0], -ptr[1]) - uVar1;
+ vvv = GetVvvAtMetaTilePos(uVar4, gPlayerEntity.base.collisionLayer);
if ((vvv - 0x26 > 1) && (vvv != VVV_41)) {
- mapLayer = GetLayerByIndex(gPlayerEntity.collisionLayer);
+ mapLayer = GetLayerByIndex(gPlayerEntity.base.collisionLayer);
iVar2 = (uVar4 * 0x10000) >> 0x10;
tmp1 = mapLayer->collisionData[iVar2];
tmp2 = mapLayer->collisionData[(iVar2 - uVar1)];
diff --git a/src/object/railtrack.c b/src/object/railtrack.c
index baf07cbc..687448ed 100644
--- a/src/object/railtrack.c
+++ b/src/object/railtrack.c
@@ -4,7 +4,6 @@
*
* @brief Railtrack object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "flags.h"
diff --git a/src/object/rotatingTrapdoor.c b/src/object/rotatingTrapdoor.c
index df523b5d..d9232a74 100644
--- a/src/object/rotatingTrapdoor.c
+++ b/src/object/rotatingTrapdoor.c
@@ -4,7 +4,6 @@
*
* @brief Rotating Trapdoor object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "functions.h"
diff --git a/src/object/rupee.c b/src/object/rupee.c
index fe38b3ad..b729c071 100644
--- a/src/object/rupee.c
+++ b/src/object/rupee.c
@@ -4,7 +4,6 @@
*
* @brief Rupee object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "hitbox.h"
#include "object.h"
diff --git a/src/object/sanctuaryStoneTablet.c b/src/object/sanctuaryStoneTablet.c
index 4a107f5a..31201381 100644
--- a/src/object/sanctuaryStoneTablet.c
+++ b/src/object/sanctuaryStoneTablet.c
@@ -4,7 +4,6 @@
*
* @brief Sanctuary Stone Tablet object
*/
-#define NENT_DEPRECATED
#include "effects.h"
#include "entity.h"
#include "flags.h"
diff --git a/src/object/shrinkingHieroglyphs.c b/src/object/shrinkingHieroglyphs.c
index be8462b5..c490b834 100644
--- a/src/object/shrinkingHieroglyphs.c
+++ b/src/object/shrinkingHieroglyphs.c
@@ -4,7 +4,6 @@
*
* @brief Shrinking Hieroglyphs object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "functions.h"
#include "player.h"
@@ -52,7 +51,7 @@ void ShrinkingHieroglyphs_Init(ShrinkingHieroglyphsEntity* this) {
super->subtimer = 30;
this->objDir.HALF.HI = ShrinkingHieroglyphs_Directions[super->type];
this->unk74 = 0x2000;
- SetDefaultPriority(super, 6);
+ SetEntityPriority(super, 6);
if (super->type == 0) {
this->unk7e = 0x40;
LoadSwapGFX(super, 1, 0);
@@ -70,7 +69,7 @@ void ShrinkingHieroglyphs_Action1(ShrinkingHieroglyphsEntity* this) {
if (super->type == 0) {
UpdateAnimationSingleFrame(super);
if (super->type2 != 0) {
- gPlayerEntity.subtimer = 0;
+ gPlayerEntity.base.subtimer = 0;
super->action++;
InitAnimationForceUpdate(super, 1);
SoundReq(SFX_178);
@@ -110,7 +109,7 @@ void ShrinkingHieroglyphs_Action2(ShrinkingHieroglyphsEntity* this) {
}
void sub_08098130(ShrinkingHieroglyphsEntity* this) {
- CopyPosition(&gPlayerEntity, super);
+ CopyPosition(&gPlayerEntity.base, super);
super->direction = this->objDir.HALF.HI;
super->speed = this->unk7a;
LinearMoveUpdate(super);
diff --git a/src/object/smallIceBlock.c b/src/object/smallIceBlock.c
index 71f82754..6247e59e 100644
--- a/src/object/smallIceBlock.c
+++ b/src/object/smallIceBlock.c
@@ -4,7 +4,6 @@
*
* @brief Small Ice Block object
*/
-#define NENT_DEPRECATED
#include "collision.h"
#include "functions.h"
#include "hitbox.h"
diff --git a/src/object/smoke.c b/src/object/smoke.c
index bffaa8b8..62b4d1ac 100644
--- a/src/object/smoke.c
+++ b/src/object/smoke.c
@@ -4,7 +4,6 @@
*
* @brief Smoke object
*/
-#define NENT_DEPRECATED
#include "object.h"
void Smoke_Type0(Entity*);
diff --git a/src/object/smokeParticle.c b/src/object/smokeParticle.c
index 4322c7d7..892b2e7c 100644
--- a/src/object/smokeParticle.c
+++ b/src/object/smokeParticle.c
@@ -4,7 +4,6 @@
*
* @brief Smoke Particle object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "tiles.h"
diff --git a/src/object/specialChest.c b/src/object/specialChest.c
index fd57c7fc..f2fbc8ae 100644
--- a/src/object/specialChest.c
+++ b/src/object/specialChest.c
@@ -4,7 +4,6 @@
*
* @brief Special Chest object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "flags.h"
#include "player.h"
diff --git a/src/object/specialFx.c b/src/object/specialFx.c
index 36104865..cdd72a0b 100644
--- a/src/object/specialFx.c
+++ b/src/object/specialFx.c
@@ -4,7 +4,6 @@
*
* @brief Special FX object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "functions.h"
#include "object.h"
@@ -153,7 +152,7 @@ void SpecialFx_Init(SpecialFxObject* this) {
super->action = 1;
super->flags &= ~0x80;
super->spriteSettings.draw = 1;
- SetDefaultPriority(super, 6);
+ SetEntityPriority(super, 6);
if (super->collisionLayer == 0) {
ResolveCollisionLayer(super);
}
@@ -309,8 +308,8 @@ void sub_080847E0(SpecialFxObject* this) {
if (gRoomControls.reload_flags == 1) {
DeleteThisEntity();
}
- PositionRelative(&gPlayerEntity, super, 0, -0x30000);
+ PositionRelative(&gPlayerEntity.base, super, 0, -0x30000);
super->z.HALF.HI = -3;
- SortEntityAbove(&gPlayerEntity, super);
+ SortEntityAbove(&gPlayerEntity.base, super);
sub_080845DC(this);
}
diff --git a/src/object/steam.c b/src/object/steam.c
index d3b7a13e..7cef37d1 100644
--- a/src/object/steam.c
+++ b/src/object/steam.c
@@ -4,7 +4,6 @@
*
* @brief Steam object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "player.h"
@@ -44,7 +43,7 @@ void Steam(Entity* _this) {
type = super->type;
ptr = &this->unk_0x68;
if (type != 0) {
- if (gPlayerEntity.x.HALF.HI - gRoomControls.origin_x > (0xf8 << 1)) {
+ if (gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x > (0xf8 << 1)) {
if (*ptr < 0x40) {
(*ptr)++;
}
diff --git a/src/object/stoneTablet.c b/src/object/stoneTablet.c
index b2be185e..1c9edf93 100644
--- a/src/object/stoneTablet.c
+++ b/src/object/stoneTablet.c
@@ -4,7 +4,6 @@
*
* @brief Stone Tablet object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "functions.h"
#include "room.h"
diff --git a/src/object/swordParticle.c b/src/object/swordParticle.c
index 63415fb6..f86879a0 100644
--- a/src/object/swordParticle.c
+++ b/src/object/swordParticle.c
@@ -4,7 +4,6 @@
*
* @brief Sword Particle object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "item.h"
#include "object.h"
@@ -34,8 +33,8 @@ void SwordParticle_Init(SwordParticleEntity* this) {
super->action = 1;
super->flags |= ENT_PERSIST;
super->spritePriority.b0 = 0;
- super->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
- super->animationState = gPlayerEntity.animationState >> 1;
+ super->spriteOrientation.flipY = gPlayerEntity.base.spriteOrientation.flipY;
+ super->animationState = gPlayerEntity.base.animationState >> 1;
super->direction = (((super->animationState + 1) & 3) << 3);
super->subtimer = 6;
super->speed = 0x140;
@@ -122,12 +121,12 @@ void SwordParticle_Action1(SwordParticleEntity* this) {
}
}
- super->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
+ super->spriteRendering.b3 = gPlayerEntity.base.spriteRendering.b3;
ptr2 = &ptr[super->animationState * 2];
- super->x.HALF.HI = ptr2[0] + gPlayerEntity.x.HALF.HI;
- super->y.HALF.HI = ptr[super->animationState * 2 + 1] + gPlayerEntity.y.HALF.HI;
- super->z.HALF.HI = gPlayerEntity.z.HALF.HI;
- super->collisionLayer = gPlayerEntity.collisionLayer;
+ super->x.HALF.HI = ptr2[0] + gPlayerEntity.base.x.HALF.HI;
+ super->y.HALF.HI = ptr[super->animationState * 2 + 1] + gPlayerEntity.base.y.HALF.HI;
+ super->z.HALF.HI = gPlayerEntity.base.z.HALF.HI;
+ super->collisionLayer = gPlayerEntity.base.collisionLayer;
switch (super->animationState) {
default:
super->y.HALF.HI -= this->unk_6c;
@@ -169,7 +168,7 @@ void SwordParticle_Action2(SwordParticleEntity* this) {
sub_08079BD8(super);
super->action++;
super->spriteSettings.draw = 1;
- super->animationState = gPlayerEntity.animationState;
+ super->animationState = gPlayerEntity.base.animationState;
super->spriteVramOffset = 0;
super->palette.b.b0 = 4;
super->spriteIndex = 0xaf;
diff --git a/src/object/swordsmanNewsletter.c b/src/object/swordsmanNewsletter.c
index 732927c9..bc17266a 100644
--- a/src/object/swordsmanNewsletter.c
+++ b/src/object/swordsmanNewsletter.c
@@ -4,7 +4,6 @@
*
* @brief Swordsman Newsletter object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "message.h"
diff --git a/src/object/thoughtBubble.c b/src/object/thoughtBubble.c
index 7ab561c5..10b9de5e 100644
--- a/src/object/thoughtBubble.c
+++ b/src/object/thoughtBubble.c
@@ -4,7 +4,6 @@
*
* @brief Thought Bubble object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "sound.h"
diff --git a/src/object/thunderbolt.c b/src/object/thunderbolt.c
index 697a32e3..543c08c4 100644
--- a/src/object/thunderbolt.c
+++ b/src/object/thunderbolt.c
@@ -4,7 +4,6 @@
*
* @brief Thunderbolt object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
@@ -101,7 +100,7 @@ void sub_08093EF0(ThunderboltEntity* this) {
if ((super->frame & ANIM_DONE) == 0) {
return;
}
- if (super->parent == &gPlayerEntity) {
+ if (super->parent == &gPlayerEntity.base) {
SoundReq(SFX_PLY_VO6);
sub_08079D84();
}
diff --git a/src/object/titleScreenObject.c b/src/object/titleScreenObject.c
index 9144d0e3..dc94e9fc 100644
--- a/src/object/titleScreenObject.c
+++ b/src/object/titleScreenObject.c
@@ -4,7 +4,6 @@
*
* @brief Title Screen object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
diff --git a/src/object/trapdoor.c b/src/object/trapdoor.c
index 2bf94151..809643dd 100644
--- a/src/object/trapdoor.c
+++ b/src/object/trapdoor.c
@@ -4,7 +4,6 @@
*
* @brief Trapdoor object
*/
-#define NENT_DEPRECATED
#include "item.h"
#include "object.h"
@@ -64,7 +63,7 @@ void Trapdoor_Action2(Entity* this) {
}
void Trapdoor_Action3(Entity* this) {
- if (EntityInRectRadius(this, &gPlayerEntity, 0xc, 0xc)) {
+ if (EntityInRectRadius(this, &gPlayerEntity.base, 0xc, 0xc)) {
if (this->subAction == 0) {
sub_08099ECC(this);
RequestPriorityDuration(this, 30);
@@ -80,7 +79,7 @@ void Trapdoor_Action4(Entity* this) {
void sub_08099ECC(Entity* this) {
this->subAction = 1;
- CopyPosition(this, &gPlayerEntity);
+ CopyPosition(this, &gPlayerEntity.base);
gPlayerState.queued_action = PLAYER_FALL;
gPlayerState.field_0x38 = 0;
gPlayerState.flags |= PL_PIT_IS_EXIT;
diff --git a/src/object/treeHidingPortal.c b/src/object/treeHidingPortal.c
index ed45e130..1952ea8d 100644
--- a/src/object/treeHidingPortal.c
+++ b/src/object/treeHidingPortal.c
@@ -4,7 +4,6 @@
*
* @brief Tree Hiding Portal object
*/
-#define NENT_DEPRECATED
#include "effects.h"
#include "entity.h"
#include "flags.h"
@@ -54,7 +53,7 @@ void TreeHidingPortal_Init(TreeHidingPortalEntity* this) {
void TreeHidingPortal_Action1(TreeHidingPortalEntity* this) {
- if (sub_0800419C(super, &gPlayerEntity, 0x30, 0x30)) {
+ if (sub_0800419C(super, &gPlayerEntity.base, 0x30, 0x30)) {
if (CheckGlobalFlag(EZERO_1ST)) {
if (((gRoomTransition.frameCount & 3) == 0)) {
CreateSparkle(super);
@@ -114,11 +113,11 @@ static u32 sub_0809E9A0(void) {
u32 vvv;
const s16* ptr;
- if (gPlayerEntity.action != PLAYER_BOUNCE) {
+ if (gPlayerEntity.base.action != PLAYER_BOUNCE) {
vvv = VVV_0;
} else {
- ptr = &gUnk_080B4468[gPlayerEntity.animationState & 6];
- vvv = GetVvvAtMetaTilePos(COORD_TO_TILE_OFFSET(&gPlayerEntity, -ptr[0], -ptr[1]), 1);
+ ptr = &gUnk_080B4468[gPlayerEntity.base.animationState & 6];
+ vvv = GetVvvAtMetaTilePos(COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr[0], -ptr[1]), 1);
}
return vvv;
diff --git a/src/object/treeThorns.c b/src/object/treeThorns.c
index 63776bee..2b94d0ea 100644
--- a/src/object/treeThorns.c
+++ b/src/object/treeThorns.c
@@ -4,7 +4,6 @@
*
* @brief Three Thorns object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "hitbox.h"
#include "object.h"
diff --git a/src/object/unusedSkull.c b/src/object/unusedSkull.c
index 775218b9..28626dbe 100644
--- a/src/object/unusedSkull.c
+++ b/src/object/unusedSkull.c
@@ -4,7 +4,6 @@
*
* @brief Unused Skull object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "hitbox.h"
#include "object.h"
diff --git a/src/object/vaati1Portal.c b/src/object/vaati1Portal.c
index dfbc8487..78924aff 100644
--- a/src/object/vaati1Portal.c
+++ b/src/object/vaati1Portal.c
@@ -4,7 +4,6 @@
*
* @brief Vaati1 Portal object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "flags.h"
@@ -50,7 +49,7 @@ void Vaati1Portal_Action2(Entity* this) {
if (CheckRoomFlag(1)) {
sub_080A0190(this);
RequestPriorityDuration(this, 30);
- if (EntityInRectRadius(this, &gPlayerEntity, 0x10, 0x10)) {
+ if (EntityInRectRadius(this, &gPlayerEntity.base, 0x10, 0x10)) {
CreateHoleManager(0x37);
}
}
@@ -58,7 +57,7 @@ void Vaati1Portal_Action2(Entity* this) {
void sub_080A0190(Entity* this) {
this->subAction = 1;
- CopyPosition(this, &gPlayerEntity);
+ CopyPosition(this, &gPlayerEntity.base);
gPlayerState.queued_action = PLAYER_FALL;
gPlayerState.field_0x38 = 0;
gPlayerState.flags |= PL_PIT_IS_EXIT;
diff --git a/src/object/vaati2Particle.c b/src/object/vaati2Particle.c
index a9d42284..d39afa96 100644
--- a/src/object/vaati2Particle.c
+++ b/src/object/vaati2Particle.c
@@ -4,7 +4,6 @@
*
* @brief Vaati2 Particle object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "physics.h"
diff --git a/src/object/vaati3Arm.c b/src/object/vaati3Arm.c
index 6ba31113..f18f0851 100644
--- a/src/object/vaati3Arm.c
+++ b/src/object/vaati3Arm.c
@@ -4,7 +4,6 @@
*
* @brief Vaati3 Arm object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "physics.h"
diff --git a/src/object/vaati3Death.c b/src/object/vaati3Death.c
index 04553f75..fd9db473 100644
--- a/src/object/vaati3Death.c
+++ b/src/object/vaati3Death.c
@@ -4,7 +4,6 @@
*
* @brief Vaati3 Death object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "physics.h"
diff --git a/src/object/vaati3PlayerObject.c b/src/object/vaati3PlayerObject.c
index b491cb2a..6420cbab 100644
--- a/src/object/vaati3PlayerObject.c
+++ b/src/object/vaati3PlayerObject.c
@@ -4,7 +4,6 @@
*
* @brief Vaati3 Player object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "physics.h"
#include "player.h"
@@ -17,5 +16,5 @@ void Vaati3PlayerObject(Entity* this) {
#ifndef EU
gRoomControls.camera_target = this;
#endif
- PositionRelative(&gPlayerEntity, this, 0, Q_16_16(-40.0));
+ PositionRelative(&gPlayerEntity.base, this, 0, Q_16_16(-40.0));
}
diff --git a/src/object/warpPoint.c b/src/object/warpPoint.c
index d83bc106..67798907 100644
--- a/src/object/warpPoint.c
+++ b/src/object/warpPoint.c
@@ -4,7 +4,6 @@
*
* @brief Warp Point object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "game.h"
#include "hitbox.h"
@@ -70,9 +69,9 @@ void WarpPoint_Init(WarpPointEntity* this) {
return;
super->action = 4;
super->subtimer = 96;
- gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
- gPlayerEntity.y.HALF.HI = super->y.HALF.HI;
- gPlayerEntity.animationState = 4;
+ gPlayerEntity.base.x.HALF.HI = super->x.HALF.HI;
+ gPlayerEntity.base.y.HALF.HI = super->y.HALF.HI;
+ gPlayerEntity.base.animationState = 4;
EnqueueSFX(SFX_112);
RequestPriorityDuration(super, super->subtimer + 16);
}
@@ -105,10 +104,10 @@ void WarpPoint_Action3(WarpPointEntity* this) {
super->action = 5;
super->subtimer = 96;
PutAwayItems();
- gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
- gPlayerEntity.y.HALF.HI = super->y.HALF.HI;
- gPlayerEntity.animationState = 4;
- gPlayerEntity.flags &= ~ENT_COLLIDE;
+ gPlayerEntity.base.x.HALF.HI = super->x.HALF.HI;
+ gPlayerEntity.base.y.HALF.HI = super->y.HALF.HI;
+ gPlayerEntity.base.animationState = 4;
+ gPlayerEntity.base.flags &= ~ENT_COLLIDE;
RequestPriorityDuration(super, super->subtimer + 16);
SoundReq(SFX_113);
} else {
@@ -121,8 +120,8 @@ void WarpPoint_Action4(WarpPointEntity* this) {
if (!--super->subtimer) {
super->action = 3;
super->timer = 1;
- gPlayerEntity.animationState = 4;
- gPlayerEntity.direction = DirectionSouth;
+ gPlayerEntity.base.animationState = 4;
+ gPlayerEntity.base.direction = DirectionSouth;
return;
}
tmp = 0;
@@ -142,7 +141,7 @@ void WarpPoint_Action4(WarpPointEntity* this) {
break;
case 0:
if (!(super->subtimer & 7)) {
- if (gPlayerEntity.animationState == 4) {
+ if (gPlayerEntity.base.animationState == 4) {
if (super->subtimer > 0x18) {
tmp = 1;
}
@@ -153,8 +152,8 @@ void WarpPoint_Action4(WarpPointEntity* this) {
break;
}
if (tmp) {
- gPlayerEntity.animationState += 2;
- gPlayerEntity.animationState &= 6;
+ gPlayerEntity.base.animationState += 2;
+ gPlayerEntity.base.animationState &= 6;
}
}
@@ -193,13 +192,13 @@ void WarpPoint_Action5(WarpPointEntity* this) {
tmp = 1;
}
} else {
- gPlayerEntity.spriteSettings.draw = 0;
+ gPlayerEntity.base.spriteSettings.draw = 0;
}
break;
}
if (tmp) {
- gPlayerEntity.animationState += 2;
- gPlayerEntity.animationState &= 6;
+ gPlayerEntity.base.animationState += 2;
+ gPlayerEntity.base.animationState &= 6;
}
}
@@ -209,10 +208,10 @@ void sub_0808B73C(WarpPointEntity* this) {
super->palette.b.b0 = super->parent->palette.b.b0;
InitializeAnimation(super, 1);
}
- if (EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x28)) {
+ if (EntityWithinDistance(super, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI, 0x28)) {
super->spriteSettings.draw = 1;
} else {
- if (EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x2e)) {
+ if (EntityWithinDistance(super, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI, 0x2e)) {
super->spriteSettings.draw ^= 1;
} else {
super->spriteSettings.draw = 0;
@@ -222,9 +221,10 @@ void sub_0808B73C(WarpPointEntity* this) {
}
u32 sub_0808B7C8(WarpPointEntity* this) {
- if (!(gPlayerState.flags & PL_MINISH) && gPlayerState.framestate != PL_STATE_DIE && gPlayerEntity.health != 0 &&
- PlayerCanBeMoved() && EntityInRectRadius(super, &gPlayerEntity, 5, 5) && gPlayerEntity.z.HALF.HI == 0) {
- if (super->timer == 0 && gPlayerEntity.action == PLAYER_08072C9C) {
+ if (!(gPlayerState.flags & PL_MINISH) && gPlayerState.framestate != PL_STATE_DIE &&
+ gPlayerEntity.base.health != 0 && PlayerCanBeMoved() && EntityInRectRadius(super, &gPlayerEntity.base, 5, 5) &&
+ gPlayerEntity.base.z.HALF.HI == 0) {
+ if (super->timer == 0 && gPlayerEntity.base.action == PLAYER_08072C9C) {
ResetPlayerAnimationAndAction();
}
return 1;
diff --git a/src/object/waterDropObject.c b/src/object/waterDropObject.c
index d1236267..056afa57 100644
--- a/src/object/waterDropObject.c
+++ b/src/object/waterDropObject.c
@@ -4,7 +4,6 @@
*
* @brief Water Drop object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "functions.h"
diff --git a/src/object/waterElement.c b/src/object/waterElement.c
index 9b4d9902..6f55a27c 100644
--- a/src/object/waterElement.c
+++ b/src/object/waterElement.c
@@ -4,7 +4,6 @@
*
* @brief Water Element object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
diff --git a/src/object/waterfallOpening.c b/src/object/waterfallOpening.c
index bf960414..f9302d35 100644
--- a/src/object/waterfallOpening.c
+++ b/src/object/waterfallOpening.c
@@ -4,7 +4,6 @@
*
* @brief Waterfall Opening object
*/
-#define NENT_DEPRECATED
#include "entity.h"
#include "flags.h"
#include "functions.h"
diff --git a/src/object/well.c b/src/object/well.c
index d6b0e475..95bcf8c9 100644
--- a/src/object/well.c
+++ b/src/object/well.c
@@ -4,7 +4,6 @@
*
* @brief Well object
*/
-#define NENT_DEPRECATED
#include "asm.h"
#include "entity.h"
#include "functions.h"
@@ -41,9 +40,9 @@ void Well_Init(WellEntity* this) {
void Well_Action1(WellEntity* this) {
u32 tileIndex = GetMetaTileType(this->unk_80, LAYER_BOTTOM);
if (tileIndex != SPECIAL_META_TILE_125) {
- sub_08078B48();
- gPlayerEntity.x.WORD = super->x.WORD;
- gPlayerEntity.y.HALF.HI = super->y.HALF.HI + 4;
+ PausePlayer();
+ gPlayerEntity.base.x.WORD = super->x.WORD;
+ gPlayerEntity.base.y.HALF.HI = super->y.HALF.HI + 4;
DeleteThisEntity();
}
}
diff --git a/src/object/whirlwind.c b/src/object/whirlwind.c
index 5febac8c..979a62a3 100644
--- a/src/object/whirlwind.c
+++ b/src/object/whirlwind.c
@@ -4,7 +4,6 @@
*
* @brief Whirlwind object
*/
-#define NENT_DEPRECATED
#include "area.h"
#include "functions.h"
#include "hitbox.h"
@@ -60,24 +59,25 @@ void Whirlwind_Action1(Entity* this) {
if (this->spriteSettings.draw != 0) {
GetNextFrame(this);
if ((((((gPlayerState.flags & PL_MINISH) == 0)) && (gPlayerState.field_0x3c == 0)) &&
- ((gPlayerEntity.action == PLAYER_JUMP || ((gPlayerEntity.flags & ENT_COLLIDE) != 0)))) &&
- ((gPlayerEntity.action != PLAYER_BOUNCE && (sub_0800419C(this, &gPlayerEntity, 0xc, 0xc) != 0)))) {
- if (((gPlayerState.flags & PL_PARACHUTE) == 0) && (gPlayerEntity.action != PLAYER_JUMP)) {
- if ((this->type2 != 1) && (-0x10 < gPlayerEntity.z.HALF.HI)) {
+ ((gPlayerEntity.base.action == PLAYER_JUMP || ((gPlayerEntity.base.flags & ENT_COLLIDE) != 0)))) &&
+ ((gPlayerEntity.base.action != PLAYER_BOUNCE &&
+ (sub_0800419C(this, &gPlayerEntity.base, 0xc, 0xc) != 0)))) {
+ if (((gPlayerState.flags & PL_PARACHUTE) == 0) && (gPlayerEntity.base.action != PLAYER_JUMP)) {
+ if ((this->type2 != 1) && (-0x10 < gPlayerEntity.base.z.HALF.HI)) {
return;
}
- } else if (gPlayerEntity.z.HALF.HI == 0) {
+ } else if (gPlayerEntity.base.z.HALF.HI == 0) {
return;
}
- CopyPosition(this, &gPlayerEntity);
+ CopyPosition(this, &gPlayerEntity.base);
sub_08004542(this);
- sub_08004542(&gPlayerEntity);
- gPlayerEntity.collisionLayer = 1;
- gPlayerEntity.flags |= ENT_COLLIDE;
+ sub_08004542(&gPlayerEntity.base);
+ gPlayerEntity.base.collisionLayer = 1;
+ gPlayerEntity.base.flags |= ENT_COLLIDE;
gPlayerState.queued_action = PLAYER_PARACHUTE;
gPlayerState.field_0x38 = this->type2;
gPlayerState.field_0x39 = 0xff;
- this->spritePriority.b0 = gPlayerEntity.spritePriority.b0 - 1;
+ this->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0 - 1;
this->action++;
PutAwayItems();
SoundReq(SFX_153);
@@ -88,7 +88,7 @@ void Whirlwind_Action1(Entity* this) {
void Whirlwind_Action2(Entity* this) {
UpdateAnimationSingleFrame(this);
- if (sub_0800419C(this, &gPlayerEntity, 0xc, 0xc) == 0) {
+ if (sub_0800419C(this, &gPlayerEntity.base, 0xc, 0xc) == 0) {
ResetCollisionLayer(this);
this->spriteOrientation.flipY = 1;
this->spriteRendering.b3 = 1;
diff --git a/src/object/whiteTriangleEffect.c b/src/object/whiteTriangleEffect.c
index ec70dab3..2d7f24e3 100644
--- a/src/object/whiteTriangleEffect.c
+++ b/src/object/whiteTriangleEffect.c
@@ -4,7 +4,6 @@
*
* @brief White Triangle Effect object
*/
-#define NENT_DEPRECATED
#include "functions.h"
#include "object.h"
#include "screen.h"
diff --git a/src/object/windTribeFlag.c b/src/object/windTribeFlag.c
index 19aa7f63..99b8572f 100644
--- a/src/object/windTribeFlag.c
+++ b/src/object/windTribeFlag.c
@@ -4,7 +4,6 @@
*
* @brief Wind Tribe Flag object
*/
-#define NENT_DEPRECATED
#include "object.h"
void WindTribeFlag(Entity* this) {
diff --git a/src/object/windTribeTeleporter.c b/src/object/windTribeTeleporter.c
index bd94a171..5a238478 100644
--- a/src/object/windTribeTeleporter.c
+++ b/src/object/windTribeTeleporter.c
@@ -4,7 +4,6 @@
*
* @brief Wind Tribe Teleporter object
*/
-#define NENT_DEPRECATED
#include "collision.h"
#include "functions.h"
#include "hitbox.h"
@@ -21,7 +20,7 @@ void WindTribeTeleporter_Action1(WindTribeTeleporterEntity*);
void WindTribeTeleporter_Action2(WindTribeTeleporterEntity*);
void WindTribeTeleporter_Action3(WindTribeTeleporterEntity*);
void sub_080A11E0(WindTribeTeleporterEntity*);
-bool32 sub_080A11C0(WindTribeTeleporterEntity*);
+static bool32 PlayerCollidingTeleporter(WindTribeTeleporterEntity*);
void WindTribeTeleporter(WindTribeTeleporterEntity* this) {
static void (*const WindTribeTeleporter_Actions[])(WindTribeTeleporterEntity*) = {
@@ -39,12 +38,12 @@ void WindTribeTeleporter_Init(WindTribeTeleporterEntity* this) {
super->frameDuration = 8;
super->spritePriority.b0 = 7;
super->hitbox = (Hitbox*)&gHitbox_22;
- SetDefaultPriority(super, 6);
- if (sub_080A11C0(this)) {
- gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
- gPlayerEntity.y.HALF.HI = super->y.HALF.HI;
+ SetEntityPriority(super, 6);
+ if (PlayerCollidingTeleporter(this)) {
+ gPlayerEntity.base.x.HALF.HI = super->x.HALF.HI;
+ gPlayerEntity.base.y.HALF.HI = super->y.HALF.HI;
SetPlayerControl(CONTROL_DISABLED);
- sub_08078B48();
+ PausePlayer();
SetPlayerEventPriority();
SoundReq(SFX_112);
super->action = 3;
@@ -54,12 +53,12 @@ void WindTribeTeleporter_Init(WindTribeTeleporterEntity* this) {
}
void WindTribeTeleporter_Action1(WindTribeTeleporterEntity* this) {
- if (sub_080A11C0(this)) {
+ if (PlayerCollidingTeleporter(this)) {
if (this->unk_68 == 0) {
- gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
- gPlayerEntity.y.HALF.HI = super->y.HALF.HI;
+ gPlayerEntity.base.x.HALF.HI = super->x.HALF.HI;
+ gPlayerEntity.base.y.HALF.HI = super->y.HALF.HI;
SetPlayerControl(CONTROL_DISABLED);
- sub_08078B48();
+ PausePlayer();
SetPlayerEventPriority();
SoundReq(SFX_112);
super->action = 2;
@@ -89,7 +88,7 @@ void WindTribeTeleporter_Action2(WindTribeTeleporterEntity* this) {
SoundReq(SFX_113);
} else {
if ((gRoomTransition.frameCount & 7) == 0) {
- gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6;
+ gPlayerEntity.base.animationState = (gPlayerEntity.base.animationState + 2) & 6;
}
}
break;
@@ -99,7 +98,7 @@ void WindTribeTeleporter_Action2(WindTribeTeleporterEntity* this) {
super->timer = 30;
} else {
if ((gRoomTransition.frameCount & 3) == 0) {
- gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6;
+ gPlayerEntity.base.animationState = (gPlayerEntity.base.animationState + 2) & 6;
}
}
break;
@@ -118,7 +117,7 @@ void WindTribeTeleporter_Action2(WindTribeTeleporterEntity* this) {
#endif
} else {
if ((gRoomTransition.frameCount & 1) == 0) {
- gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6;
+ gPlayerEntity.base.animationState = (gPlayerEntity.base.animationState + 2) & 6;
}
}
break;
@@ -135,7 +134,7 @@ void WindTribeTeleporter_Action3(WindTribeTeleporterEntity* this) {
case 1:
if (--super->timer != 0) {
if ((gRoomTransition.frameCount & 1) == 0) {
- gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6;
+ gPlayerEntity.base.animationState = (gPlayerEntity.base.animationState + 2) & 6;
}
} else {
super->subAction++;
@@ -148,7 +147,7 @@ void WindTribeTeleporter_Action3(WindTribeTeleporterEntity* this) {
super->timer = 30;
} else {
if ((gRoomTransition.frameCount & 3) == 0) {
- gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6;
+ gPlayerEntity.base.animationState = (gPlayerEntity.base.animationState + 2) & 6;
}
}
break;
@@ -157,16 +156,16 @@ void WindTribeTeleporter_Action3(WindTribeTeleporterEntity* this) {
super->subAction++;
} else {
if ((gRoomTransition.frameCount & 7) == 0) {
- gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6;
+ gPlayerEntity.base.animationState = (gPlayerEntity.base.animationState + 2) & 6;
}
}
break;
default:
- if (gPlayerEntity.animationState != 4) {
+ if (gPlayerEntity.base.animationState != 4) {
if ((gRoomTransition.frameCount & 7U) != 0) {
return;
}
- gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6;
+ gPlayerEntity.base.animationState = (gPlayerEntity.base.animationState + 2) & 6;
} else {
super->action = 1;
super->subAction = 0;
@@ -177,8 +176,8 @@ void WindTribeTeleporter_Action3(WindTribeTeleporterEntity* this) {
}
}
-bool32 sub_080A11C0(WindTribeTeleporterEntity* this) {
- if (gPlayerEntity.z.HALF.HI != 0) {
+static bool32 PlayerCollidingTeleporter(WindTribeTeleporterEntity* this) {
+ if (gPlayerEntity.base.z.HALF.HI != 0) {
return FALSE;
} else {
return IsCollidingPlayer(super);
diff --git a/src/object/windcrest.c b/src/object/windcrest.c
index 2ce20d42..ad1b63a3 100644
--- a/src/object/windcrest.c
+++ b/src/object/windcrest.c
@@ -4,7 +4,6 @@
*
* @brief Windcrest object
*/
-#define NENT_DEPRECATED
#include "effects.h"
#include "entity.h"
#include "functions.h"