mirror of
https://github.com/zeldaret/tmc
synced 2026-07-08 22:44:46 -04:00
Merge branch 'master' into tilemap-docs
This commit is contained in:
+14
-15
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Angry Statue object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "asm.h"
|
||||
#include "entity.h"
|
||||
#include "hitbox.h"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Archway object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "game.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief BackgroundCloud object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "object.h"
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Barrel Inside object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Bed Cover object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Bell object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "object.h"
|
||||
|
||||
void Bell_Init(Entity* this);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Bench object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "asm.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Big Ice Block object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "hitbox.h"
|
||||
#include "item.h"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
+27
-28
@@ -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) {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Block Pushed object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "area.h"
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
|
||||
+3
-4
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Bollard object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "asm.h"
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
|
||||
+7
-8
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
+2
-3
@@ -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;
|
||||
|
||||
+3
-4
@@ -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);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Cabin Furniture object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "asm.h"
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Carlov Object object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Chuchu Boss Cutscene object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "menu.h"
|
||||
#include "object.h"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Chuchu Boss Particle object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
|
||||
void ChuchuBossParticle_Init(Entity*);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Chuchu Boss Start Particle object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
|
||||
|
||||
+2
-3
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Cracking Ground object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
*
|
||||
* @brief Cucco Minigame object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "enemy.h"
|
||||
#include "entity.h"
|
||||
#include "fileselect.h"
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Cutscene Orchestrator object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "hitbox.h"
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Elements Background object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "screen.h"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Enemy Item object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief EyeSwitch object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "hitbox.h"
|
||||
|
||||
+11
-12
@@ -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);
|
||||
|
||||
+16
-18
@@ -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) {
|
||||
|
||||
+5
-6
@@ -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);
|
||||
}
|
||||
|
||||
+3
-4
@@ -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;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Fan Wind object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "collision.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief File Screen Objects object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "fileselect.h"
|
||||
#include "functions.h"
|
||||
#include "main.h"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Fireball Chain object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Fireplace object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Flame object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Floating Block object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "object.h"
|
||||
|
||||
void FloatingBlock(Entity* this) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Frozen Flower object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "object.h"
|
||||
|
||||
void FrozenFlower_Init(Entity*);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Frozen Water Element object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Giant Book Ladder object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "manager.h"
|
||||
#include "map.h"
|
||||
#include "object.h"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Giant Leaf object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "map.h"
|
||||
#include "object.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Giant Rock object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
|
||||
void GiantRock(Entity* this) {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Giant Rock 2 object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "asm.h"
|
||||
#include "entity.h"
|
||||
#include "room.h"
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief HeartContainer object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "collision.h"
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Hidden Ladder Down object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "asm.h"
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Hit Switch object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "physics.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Hittable Lever object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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.
|
||||
|
||||
+11
-19
@@ -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);
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Jail Bars object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Japanese Subtitle object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "menu.h"
|
||||
#include "object.h"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Jar Portal object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "area.h"
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Kinstone Fusion Particle object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "kinstone.h"
|
||||
#include "object.h"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Lamp object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
|
||||
void Lamp_Init(Entity* this);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief LampParticle object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "item.h"
|
||||
#include "player.h"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Light Door object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "screen.h"
|
||||
|
||||
+14
-15
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Lightable Switch object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "asm.h"
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
|
||||
+34
-35
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief LilypadLargeFalling object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "object/lilypadLarge.h"
|
||||
|
||||
@@ -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;
|
||||
|
||||
+65
-70
@@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
+10
-11
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user