Use new entity struct for player

This commit is contained in:
octorock
2023-12-30 22:08:56 +01:00
parent 5676cb7890
commit a818f1b704
279 changed files with 3482 additions and 3475 deletions
+14 -14
View File
@@ -82,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;
@@ -95,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;
}
@@ -125,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;
}
}
+7 -7
View File
@@ -75,15 +75,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;
}
}
}
+3 -3
View File
@@ -43,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);
@@ -115,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 {
+3 -3
View File
@@ -275,7 +275,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);
@@ -334,8 +334,8 @@ void Beanstalk_Action1Type9(BeanstalkEntity* this) {
super->y.HALF.HI += 0x28;
this->unk_72 = sub_080B1A0C(super, 0, -0x18);
}
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, -0x18) != 0x4014) {
+3 -3
View File
@@ -58,9 +58,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;
}
}
}
+5 -5
View File
@@ -75,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;
+18 -18
View File
@@ -211,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;
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.state & MESSAGE_ACTIVE) == 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;
@@ -244,8 +244,8 @@ void Bird_Type8(BirdEntity* this) {
PutAwayItems();
gPlayerState.swim_state = 0;
gPlayerState.jump_status = 0;
gPlayerEntity.flags &= ~0x80;
gPlayerEntity.spriteSettings.draw = 0;
gPlayerEntity.base.flags &= ~0x80;
gPlayerEntity.base.spriteSettings.draw = 0;
gPriorityHandler.event_priority = 6;
gPauseMenuOptions.disabled = 1;
}
@@ -254,7 +254,7 @@ void Bird_Type8(BirdEntity* this) {
break;
default:
PausePlayer();
gPlayerEntity.spriteSettings.draw = 0;
gPlayerEntity.base.spriteSettings.draw = 0;
break;
}
LinearMoveUpdate(super);
@@ -262,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;
}
@@ -274,7 +274,7 @@ void Bird_Type8(BirdEntity* this) {
pEVar5->spriteOrientation.flipY = super->spriteOrientation.flipY;
} else {
super->timer--;
CopyPosition(&gPlayerEntity, pEVar5);
CopyPosition(&gPlayerEntity.base, pEVar5);
}
}
@@ -308,13 +308,13 @@ void Bird_Type9(BirdEntity* this) {
super->spriteOrientation.flipY = 1;
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);
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);
@@ -330,8 +330,8 @@ void Bird_Type9(BirdEntity* this) {
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;
@@ -354,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;
+3 -3
View File
@@ -63,10 +63,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 -4
View File
@@ -110,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;
@@ -219,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;
+1 -1
View File
@@ -105,7 +105,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();
}
+1 -1
View File
@@ -60,7 +60,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 -3
View File
@@ -171,7 +171,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) {
@@ -189,7 +189,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 {
@@ -289,7 +289,7 @@ bool32 sub_08081F7C(ButtonEntity* this, u32 r7) {
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);
+1 -1
View File
@@ -150,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 {
+3 -3
View File
@@ -113,14 +113,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;
+1 -1
View File
@@ -134,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);
}
}
+6 -6
View File
@@ -53,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);
SetTile(0x4022, 0xdc, super->collisionLayer);
} else {
if (CheckLocalFlag(super->type2) == 0) {
@@ -79,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();
}
@@ -165,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 (sub_080B1AB4(this->unk_70, this->unk_72, super->collisionLayer) == 0x19) {
@@ -173,7 +173,7 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) {
} else {
gUnk_0200AF00.rActionPlayerState = R_ACTION_NONE;
}
PositionRelative(&gPlayerEntity, super, 0, 0x10000);
PositionRelative(&gPlayerEntity.base, super, 0, 0x10000);
if (GetTileUnderEntity(super) == 0x19) {
RestorePrevTileEntity(0xdc, super->collisionLayer);
sub_08096A78(this);
+10 -10
View File
@@ -184,7 +184,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);
@@ -196,7 +196,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;
@@ -412,7 +412,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)) {
@@ -1051,7 +1051,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);
}
@@ -1152,7 +1152,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;
@@ -1161,16 +1161,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);
+1 -1
View File
@@ -90,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:
+1 -1
View File
@@ -145,7 +145,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) {
+5 -4
View File
@@ -86,7 +86,8 @@ void EvilSpirit_Action1(EvilSpiritEntity* this) {
sub_080045DA(super->parent->x.WORD - super->x.WORD, super->parent->y.WORD - super->y.WORD) ^ 0x80;
} else {
super->speed = 0x600;
dir = sub_080045DA(gPlayerEntity.x.WORD - super->x.WORD, gPlayerEntity.y.WORD - super->y.WORD) ^ 0x80;
dir = sub_080045DA(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;
@@ -94,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;
@@ -112,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;
@@ -183,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;
+9 -9
View File
@@ -55,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);
@@ -78,7 +78,7 @@ 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.state & MESSAGE_ACTIVE) == 0) {
DeleteEntity(super);
@@ -160,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;
@@ -170,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 -17
View File
@@ -5,7 +5,6 @@
* @brief Ezlo Cap Flying object
*/
#include "functions.h"
#include "new_player.h"
#include "object.h"
typedef struct {
@@ -31,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();
}
@@ -41,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;
@@ -65,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;
@@ -103,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 {
@@ -116,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) {
+4 -4
View File
@@ -181,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);
}
}
@@ -245,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) {
@@ -254,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 -3
View File
@@ -114,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);
@@ -135,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 -4
View File
@@ -717,7 +717,7 @@ void FigurineDevice_NoFigurinesLeftMessage(void) {
gMessage.rupees = 5;
}
#ifndef EU
gPlayerEntity.animationState = 6;
gPlayerEntity.base.animationState = 6;
#endif
}
@@ -794,9 +794,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;
}
@@ -806,7 +806,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;
+2 -2
View File
@@ -63,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;
+1 -1
View File
@@ -107,7 +107,7 @@ void FourElements_Action3(FourElementsEntity* this) {
if (super->timer != 0) {
sub_080A0424(this);
if (--super->timer == 0) {
SetEntityPriority(&gPlayerEntity, 0);
SetEntityPriority(&gPlayerEntity.base, 0);
}
} else {
RequestPriorityDuration(NULL, 60);
+1 -1
View File
@@ -386,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);
+6 -5
View File
@@ -309,7 +309,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,16 +338,16 @@ 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 && GetTileTypeByEntity(super) == 0x4017) {
SetTile(0x4026, this->tile, super->collisionLayer);
SetTile(0x403D, this->tile - 64, super->collisionLayer);
SetTile(0x403D, this->tile - 128, 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 (GetTileTypeByEntity(super) != 0x4017) {
SetTile(0x4017, this->tile, super->collisionLayer);
+1 -1
View File
@@ -102,7 +102,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;
+1 -1
View File
@@ -77,7 +77,7 @@ void GleerokParticle_Init(GleerokParticleEntity* this) {
gRoomControls.camera_target = super;
} else {
if (--this->unk78 == -1) {
gRoomControls.camera_target = &gPlayerEntity;
gRoomControls.camera_target = &gPlayerEntity.base;
DeleteThisEntity();
}
}
+6 -5
View File
@@ -92,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);
@@ -130,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);
@@ -177,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 -4
View File
@@ -65,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;
}
}
@@ -541,8 +541,8 @@ void sub_08087424(GreatFairyEntity* this, ScriptExecutionContext* context) {
ResetPlayerAnimationAndAction();
ent = CreateObject(THUNDERBOLT, 0, 0);
if (ent != NULL) {
ent->parent = &gPlayerEntity;
CopyPosition(&gPlayerEntity, ent);
ent->parent = &gPlayerEntity.base;
CopyPosition(&gPlayerEntity.base, ent);
SetEntityPriority(ent, PRIO_MESSAGE);
}
+4 -4
View File
@@ -25,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 -4
View File
@@ -228,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;
@@ -236,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);
}
@@ -463,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;
@@ -482,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;
+1 -1
View File
@@ -182,7 +182,7 @@ void sub_0808692C(HouseDoorExteriorEntity* this) {
static u8 sub_08086954(HouseDoorExteriorEntity* this) {
if (sub_0800445C(super)) {
if (GetAnimationStateInRectRadius(super, 6, 20) >= 0 && gPlayerEntity.animationState == 0 &&
if (GetAnimationStateInRectRadius(super, 6, 20) >= 0 && gPlayerEntity.base.animationState == 0 &&
(u16)gPlayerState.playerInput.heldInput == INPUT_UP && gPlayerState.jump_status == 0) {
super->timer--;
}
+2 -1
View File
@@ -91,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 {
+5 -6
View File
@@ -10,7 +10,6 @@
#include "hitbox.h"
#include "kinstone.h"
#include "message.h"
#include "new_player.h"
typedef struct {
u8 before[0x20];
@@ -92,7 +91,7 @@ void ItemForSale_Action1(ItemForSaleEntity* this) {
PausePlayer();
ResetActiveItems();
gPlayerState.heldObject = 4;
gNewPlayerEntity.unk_74 = super;
gPlayerEntity.unk_74 = super;
gUnk_0200AF00.rActionPlayerState = R_ACTION_DROP;
MessageClose();
}
@@ -104,8 +103,8 @@ void ItemForSale_Action2(ItemForSaleEntity* this) {
void* ptr;
gUnk_0200AF00.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();
@@ -130,7 +129,7 @@ void sub_080819B4(ItemForSaleEntity* this) {
DeleteThisEntity();
}
gPlayerState.heldObject = 0;
gNewPlayerEntity.unk_74 = 0;
gPlayerEntity.unk_74 = 0;
ptr = &gUnk_0200AF00;
gRoomVars.shopItemType = 0;
ptr->rActionInteractObject = R_ACTION_NONE;
@@ -141,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);
+5 -5
View File
@@ -187,7 +187,7 @@ void sub_080810FC(ItemOnGroundEntity* this) {
super->subAction = 0;
COLLISION_ON(super);
super->flags2 = 0x11;
CopyPosition(&gPlayerEntity, super);
CopyPosition(&gPlayerEntity.base, super);
}
}
@@ -295,10 +295,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);
}
@@ -314,7 +314,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);
}
@@ -481,7 +481,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)) {
+8 -7
View File
@@ -169,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);
@@ -392,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;
}
}
@@ -414,7 +414,7 @@ void sub_0809E0D4(KeyStealingTakkuriEntity* this, ScriptExecutionContext* contex
return;
}
} else {
entity = &gPlayerEntity;
entity = &gPlayerEntity.base;
}
context->unk_18++;
sub_0807DEDC(super, context, entity->x.HALF.HI, entity->y.HALF.HI);
@@ -475,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;
}
@@ -504,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) {
@@ -515,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;
+5 -5
View File
@@ -29,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;
@@ -38,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;
@@ -46,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;
}
}
@@ -58,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;
}
+1 -1
View File
@@ -64,7 +64,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 && (GetTileTypeByEntity(this) == 0x4017)) {
SetTile(0x4023, COORD_TO_TILE(this), this->collisionLayer);
RestorePrevTileEntity(COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer);
+2 -2
View File
@@ -278,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;
}
+14 -14
View File
@@ -41,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;
@@ -66,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);
}
}
@@ -115,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;
@@ -139,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);
}
}
@@ -166,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;
@@ -211,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;
@@ -236,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;
@@ -292,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) {
@@ -310,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);
}
}
+32 -32
View File
@@ -100,19 +100,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;
@@ -127,7 +127,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;
@@ -150,8 +150,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) {
@@ -377,26 +377,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 == 0x1b) {
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 (GetTileUnderEntity(super) == 0xd) {
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;
@@ -418,23 +418,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;
}
}
@@ -498,7 +498,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;
@@ -514,7 +514,7 @@ void sub_08085D60(LilypadLargeEntity* this) {
tmpX2 = gUnk_08120638[tmp];
tmpY2 = gUnk_08120638[tmp + 1];
if (sub_080B1AF0(super, tmpX2, tmpY2) == 0xff) {
if (sub_0807BD14(&gPlayerEntity, r6 >> 3) != 0) {
if (sub_0807BD14(&gPlayerEntity.base, r6 >> 3) != 0) {
super->direction = (u8)r6;
sub_08085E74(this);
}
@@ -547,9 +547,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) {
@@ -559,13 +559,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);
}
+2 -2
View File
@@ -42,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;
+10 -10
View File
@@ -52,19 +52,19 @@ void LinkAnimation_ItemGet(LinkAnimationEntity* this) {
u8* ptr;
// hide player entity
gPlayerEntity.flags &= ~ENT_COLLIDE;
gPlayerEntity.spriteSettings.draw = 0;
gPlayerEntity.base.flags &= ~ENT_COLLIDE;
gPlayerEntity.base.spriteSettings.draw = 0;
super->palette.b.b0 = gPlayerEntity.palette.b.b0;
super->palette.b.b0 = gPlayerEntity.base.palette.b.b0;
switch (super->subAction) {
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;
SetEntityPriority(super, PRIO_PLAYER_EVENT);
@@ -98,9 +98,9 @@ void LinkAnimation_ItemGet(LinkAnimationEntity* this) {
if (super->frame & ANIM_DONE) {
super->action = PLAYER_NORMAL;
// restore player state
gPlayerEntity.flags = this->storeFlags;
gPlayerEntity.spriteSettings.draw = this->storeDrawFlags;
gPlayerEntity.iframes = this->storeIFrames;
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;
+7 -5
View File
@@ -39,8 +39,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, 0x4032, 0x4033);
@@ -50,8 +51,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);
@@ -64,7 +66,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 -10
View File
@@ -59,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);
}
}
+4 -4
View File
@@ -283,19 +283,19 @@ u32 sub_08083734(Entity* this, u32 unk0) {
// struct?
switch (unk0) {
case 0:
if (((LockedDoorEntity*)this)->unk_72 + 0xd - gPlayerEntity.y.HALF.HI < 0)
if (((LockedDoorEntity*)this)->unk_72 + 0xd - gPlayerEntity.base.y.HALF.HI < 0)
return 1;
break;
case 1:
if (gPlayerEntity.x.HALF.HI - (((LockedDoorEntity*)this)->unk_70 - 0xb) < 0)
if (gPlayerEntity.base.x.HALF.HI - (((LockedDoorEntity*)this)->unk_70 - 0xb) < 0)
return 1;
break;
case 2:
if (gPlayerEntity.y.HALF.HI - (((LockedDoorEntity*)this)->unk_72 - 0x8) < 0)
if (gPlayerEntity.base.y.HALF.HI - (((LockedDoorEntity*)this)->unk_72 - 0x8) < 0)
return 1;
break;
case 3:
if (((LockedDoorEntity*)this)->unk_70 + 0xa - gPlayerEntity.x.HALF.HI < 0)
if (((LockedDoorEntity*)this)->unk_70 + 0xa - gPlayerEntity.base.x.HALF.HI < 0)
return 1;
break;
}
+2 -2
View File
@@ -125,7 +125,7 @@ void MacroBook_Action3(MacroBookEntity* this) {
SetAffineInfo(super, this->unk80, this->unk80, 0);
} else {
sub_0809AA9C(this, super->child, 0);
sub_0809AA9C(this, &gPlayerEntity, 1);
sub_0809AA9C(this, &gPlayerEntity.base, 1);
if (gPlayerClones[0] != NULL) {
sub_0809AA9C(this, gPlayerClones[0], 1);
}
@@ -182,7 +182,7 @@ void sub_0809AA00(MacroBookEntity* this) {
} else {
sub_0809AA9C(this, super->child, 0);
}
ent = &gPlayerEntity;
ent = &gPlayerEntity.base;
this->playerWithinRect = EntityInRectRadius(super, ent, 0x20, 0x22);
if (this->playerWithinRect != 0) {
sub_0809AA9C(this, ent, 1);
+5 -5
View File
@@ -80,21 +80,21 @@ void Mask_Init(MaskEntity* this) {
// Probably related to knocking it down
void Mask_Action1(MaskEntity* this) {
// Check for the first frame of bonking animation
if (gPlayerEntity.action != PLAYER_BOUNCE) {
if (gPlayerEntity.base.action != PLAYER_BOUNCE) {
return;
}
if (gPlayerEntity.animationState != 0) {
if (gPlayerEntity.base.animationState != 0) {
return;
}
// Check if link is close enough to the mask
if (super->y.HALF.HI + 40 < gPlayerEntity.y.HALF.HI) {
if (super->y.HALF.HI + 40 < gPlayerEntity.base.y.HALF.HI) {
return;
}
if (super->x.HALF.HI - gPlayerEntity.x.HALF.HI >= super->subtimer ||
super->x.HALF.HI - gPlayerEntity.x.HALF.HI <= -super->subtimer) {
if (super->x.HALF.HI - gPlayerEntity.base.x.HALF.HI >= super->subtimer ||
super->x.HALF.HI - gPlayerEntity.base.x.HALF.HI <= -super->subtimer) {
return;
}
+1 -2
View File
@@ -8,7 +8,6 @@
#include "entity.h"
#include "functions.h"
#include "item.h"
#include "new_player.h"
#include "object.h"
#include "player.h"
#include "room.h"
@@ -186,7 +185,7 @@ void MazaalBossObject_Action8(MazaalBossObjectEntity* this) {
break;
case 2:
if (--super->timer == 0) {
gRoomControls.camera_target = &gNewPlayerEntity.base;
gRoomControls.camera_target = &gPlayerEntity.base;
gPlayerState.controlMode = CONTROL_1;
DeleteThisEntity();
}
+34 -34
View File
@@ -84,9 +84,9 @@ void Minecart_Action1(MinecartEntity* this) {
super->action++;
gPlayerState.jump_status = 0x81;
gPlayerState.flags |= PL_ENTER_MINECART;
gPlayerEntity.zVelocity = Q_16_16(2.0);
gPlayerEntity.speed = 0x100;
gPlayerEntity.flags &= ~PL_MINISH;
gPlayerEntity.base.zVelocity = Q_16_16(2.0);
gPlayerEntity.base.speed = 0x100;
gPlayerEntity.base.flags &= ~PL_MINISH;
ResetActiveItems();
DeleteClones();
SoundReq(SFX_PLY_JUMP);
@@ -98,21 +98,21 @@ void Minecart_Action1(MinecartEntity* this) {
}
void Minecart_Action2(MinecartEntity* this) {
if (EntityInRectRadius(super, &gPlayerEntity, 2, 2) != 0) {
gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
gPlayerEntity.y.HALF.HI = super->y.HALF.HI;
if (gPlayerEntity.z.HALF.HI > -0x10) {
if (gPlayerEntity.zVelocity >= 0) {
if (EntityInRectRadius(super, &gPlayerEntity.base, 2, 2) != 0) {
gPlayerEntity.base.x.HALF.HI = super->x.HALF.HI;
gPlayerEntity.base.y.HALF.HI = super->y.HALF.HI;
if (gPlayerEntity.base.z.HALF.HI > -0x10) {
if (gPlayerEntity.base.zVelocity >= 0) {
return;
}
gPlayerEntity.animationState = super->animationState << 1;
gPlayerEntity.base.animationState = super->animationState << 1;
gPlayerState.flags = (gPlayerState.flags ^ PL_ENTER_MINECART) | PL_IN_MINECART;
super->action++;
super->subtimer = 1;
super->flags |= ENT_PERSIST;
super->hitType = 0x97;
super->collisionFlags = (gPlayerEntity.collisionFlags + 1) | 0x20;
super->flags2 = gPlayerEntity.flags2;
super->collisionFlags = (gPlayerEntity.base.collisionFlags + 1) | 0x20;
super->flags2 = gPlayerEntity.base.flags2;
super->hurtType = 0x18;
super->damage = 8;
sub_0801766C(super);
@@ -120,10 +120,10 @@ void Minecart_Action2(MinecartEntity* this) {
SoundReq(SFX_137);
}
} else {
gPlayerEntity.direction = GetFacingDirection(&gPlayerEntity, super);
gPlayerEntity.base.direction = GetFacingDirection(&gPlayerEntity.base, super);
}
if (gPlayerEntity.zVelocity < 0) {
gPlayerEntity.spritePriority.b0 = super->spritePriority.b0 - 1;
if (gPlayerEntity.base.zVelocity < 0) {
gPlayerEntity.base.spritePriority.b0 = super->spritePriority.b0 - 1;
}
}
@@ -139,20 +139,20 @@ void Minecart_Action3(MinecartEntity* this) {
return;
}
if ((gPlayerEntity.frame & 0xf) == 0) {
if ((gPlayerEntity.base.frame & 0xf) == 0) {
COLLISION_OFF(super);
CopyPosition(super, &gPlayerEntity);
if ((gPlayerEntity.frame & 0xf0) == 0x10) {
CopyPosition(super, &gPlayerEntity.base);
if ((gPlayerEntity.base.frame & 0xf0) == 0x10) {
super->spriteOffsetY = 1;
} else {
super->spriteOffsetY = 0;
}
} else {
COLLISION_ON(super);
gPlayerEntity.speed = 0;
gPlayerEntity.base.speed = 0;
LinearMoveUpdate(super);
CopyPosition(super, &gPlayerEntity);
gPlayerEntity.spritePriority.b0 = super->spritePriority.b0 - 1;
CopyPosition(super, &gPlayerEntity.base);
gPlayerEntity.base.spritePriority.b0 = super->spritePriority.b0 - 1;
if (!sub_08091DDC(this)) {
if ((gRoomTransition.frameCount & 0xf) == 0) {
SoundReq(SFX_138);
@@ -181,11 +181,11 @@ void Minecart_Action3(MinecartEntity* this) {
sub_08017744(super);
gPlayerState.jump_status = 0x41;
gPlayerState.flags = (gPlayerState.flags ^ PL_IN_MINECART) | PL_ENTER_MINECART;
gPlayerEntity.zVelocity = Q_16_16(2.0);
gPlayerEntity.speed = 0x200;
gPlayerEntity.animationState = super->animationState << 1;
gPlayerEntity.direction = super->direction;
gPlayerEntity.flags |= PL_MINISH;
gPlayerEntity.base.zVelocity = Q_16_16(2.0);
gPlayerEntity.base.speed = 0x200;
gPlayerEntity.base.animationState = super->animationState << 1;
gPlayerEntity.base.direction = super->direction;
gPlayerEntity.base.flags |= PL_MINISH;
sub_08004168(super);
InitAnimationForceUpdate(super, super->animationState + 0xc);
SoundReq(SFX_PLY_VO4);
@@ -201,14 +201,14 @@ void Minecart_Action3(MinecartEntity* this) {
case 0x6f:
if (uVar3 == GetTileUnderEntity(super)) {
Minecart_Action4(this);
gPlayerEntity.animationState = super->animationState << 1;
gPlayerEntity.base.animationState = super->animationState << 1;
return;
}
break;
}
}
gPlayerEntity.animationState = super->animationState << 1;
gPlayerEntity.base.animationState = super->animationState << 1;
if (super->animIndex == super->animationState) {
UpdateAnimationSingleFrame(super);
} else {
@@ -220,7 +220,7 @@ void Minecart_Action3(MinecartEntity* this) {
void Minecart_Action4(MinecartEntity* this) {
sub_08004168(super);
CopyPosition(super, &gPlayerEntity);
CopyPosition(super, &gPlayerEntity.base);
switch (GetTileUnderEntity(super)) {
case 0x67:
if (super->direction == DirectionWest) {
@@ -264,16 +264,16 @@ void Minecart_Action4(MinecartEntity* this) {
}
super->action = 3;
gPlayerEntity.animationState = super->animationState << 1;
gPlayerEntity.base.animationState = super->animationState << 1;
}
void Minecart_Action5(MinecartEntity* this) {
LinearMoveUpdate(super);
CopyPosition(super, &gPlayerEntity);
CopyPosition(super, &gPlayerEntity.base);
if (gRoomControls.reload_flags == 0) {
super->action = 3;
super->speed = 0x700;
gRoomControls.camera_target = &gPlayerEntity;
gRoomControls.camera_target = &gPlayerEntity.base;
}
}
@@ -293,7 +293,7 @@ void Minecart_Action6(MinecartEntity* this) {
SetTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
} else {
UpdateAnimationSingleFrame(super);
gPlayerEntity.spritePriority.b0 = super->spritePriority.b0 - 1;
gPlayerEntity.base.spritePriority.b0 = super->spritePriority.b0 - 1;
}
}
@@ -313,7 +313,7 @@ bool32 sub_08091DDC(MinecartEntity* this) {
static const s8 gUnk_081223D0[] = { 0, -8, 8, 0, 0, 8, -8, 0 };
if ((sub_080B1AF0(super, gUnk_081223D0[super->animationState * 2], gUnk_081223D0[super->animationState * 2 + 1]) ==
0xff) &&
(sub_0807BD14(&gPlayerEntity, super->animationState))) {
(sub_0807BD14(&gPlayerEntity.base, super->animationState))) {
super->updatePriority = 6;
super->action = 5;
switch (super->direction) {
@@ -324,7 +324,7 @@ bool32 sub_08091DDC(MinecartEntity* this) {
super->speed = 0xa0;
break;
}
gPlayerEntity.direction = super->direction;
gPlayerEntity.base.direction = super->direction;
gRoomControls.camera_target = super;
return 1;
} else {
+8 -8
View File
@@ -98,7 +98,7 @@ void MinecartDoor_Action3(MinecartDoorEntity* this) {
return;
}
if ((gPlayerState.flags & PL_IN_MINECART) != 0) {
if (super->type * 2 - (u32)gPlayerEntity.animationState == 0) {
if (super->type * 2 - (u32)gPlayerEntity.base.animationState == 0) {
if (sub_08083734(super, super->type) == 0) {
return;
}
@@ -131,15 +131,15 @@ bool32 sub_08096CEC(MinecartDoorEntity* this) {
return TRUE;
} else {
if ((gPlayerState.flags & PL_IN_MINECART) != 0) {
Entity* player = &gPlayerEntity;
Entity* player = &gPlayerEntity.base;
if ((((super->type << 1) ^ player->animationState) & 2) == 0) {
if ((super->type & 1) != 0) {
if (sub_08096D68(gPlayerEntity.y.HALF.HI, super->y.HALF.HI, gPlayerEntity.x.HALF.HI,
if (sub_08096D68(gPlayerEntity.base.y.HALF.HI, super->y.HALF.HI, gPlayerEntity.base.x.HALF.HI,
super->x.HALF.HI)) {
return TRUE;
}
} else {
if (sub_08096D68(gPlayerEntity.x.HALF.HI, super->x.HALF.HI, gPlayerEntity.y.HALF.HI,
if (sub_08096D68(gPlayerEntity.base.x.HALF.HI, super->x.HALF.HI, gPlayerEntity.base.y.HALF.HI,
super->y.HALF.HI)) {
return TRUE;
}
@@ -161,22 +161,22 @@ bool32 sub_08096D68(s32 param_1, s32 param_2, s32 param_3, s32 param_4) {
bool32 sub_08096D84(MinecartDoorEntity* this) {
switch (super->type) {
case 0:
if (((super->y.HALF.HI + 10) - (gPlayerEntity.y.HALF.HI)) < 0x65U) {
if (((super->y.HALF.HI + 10) - (gPlayerEntity.base.y.HALF.HI)) < 0x65U) {
return TRUE;
}
break;
case 1:
if (((gPlayerEntity.x.HALF.HI) - (super->x.HALF.HI - 10)) < 0x65U) {
if (((gPlayerEntity.base.x.HALF.HI) - (super->x.HALF.HI - 10)) < 0x65U) {
return TRUE;
}
break;
case 2:
if (((gPlayerEntity.y.HALF.HI) - (super->y.HALF.HI - 10)) < 0x65U) {
if (((gPlayerEntity.base.y.HALF.HI) - (super->y.HALF.HI - 10)) < 0x65U) {
return TRUE;
}
break;
case 3:
if (((super->x.HALF.HI + 10) - (gPlayerEntity.x.HALF.HI)) < 0x65U) {
if (((super->x.HALF.HI + 10) - (gPlayerEntity.base.x.HALF.HI)) < 0x65U) {
return TRUE;
}
break;
+1 -1
View File
@@ -37,7 +37,7 @@ void MinishEmoticon_Action1(Entity* this) {
if ((gPlayerState.flags & PL_MINISH) == 0) {
DeleteThisEntity();
}
playerEnt = &gPlayerEntity;
playerEnt = &gPlayerEntity.base;
sub_08079BD8(this);
this->spriteOrientation.flipY = 1;
this->palette.b.b0 = playerEnt->palette.b.b0;
+3 -2
View File
@@ -45,8 +45,9 @@ void MinishSizedEntrance_Action1(Entity* this) {
DeleteThisEntity();
}
}
if ((gPlayerState.flags & PL_MINISH) && EntityInRectRadius(this, &gPlayerEntity, 4, 4) &&
(gPlayerEntity.z.HALF.HI == 0) && (((u16)gPlayerState.playerInput.heldInput) & gUnk_0812225C[this->type2])) {
if ((gPlayerState.flags & PL_MINISH) && EntityInRectRadius(this, &gPlayerEntity.base, 4, 4) &&
(gPlayerEntity.base.z.HALF.HI == 0) &&
(((u16)gPlayerState.playerInput.heldInput) & gUnk_0812225C[this->type2])) {
DoExitTransition(GetCurrentRoomProperty(this->timer));
}
}
+2 -2
View File
@@ -26,7 +26,7 @@ void MoleMittsParticle_Init(Entity* this) {
u32 palette;
this->action = 1;
this->animationState = gPlayerEntity.animationState >> 1;
this->animationState = gPlayerEntity.base.animationState >> 1;
this->spriteRendering.b3 = 2;
this->spritePriority.b0 = 3;
this->spriteOrientation.flipY--;
@@ -72,7 +72,7 @@ void MoleMittsParticle_Action1(Entity* this) {
DeleteThisEntity();
}
if (this->type2 != 0) {
this->spritePriority.b0 = gPlayerEntity.spritePriority.b0 + 1 - this->frame;
this->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0 + 1 - this->frame;
}
}
+1 -1
View File
@@ -58,7 +58,7 @@ void Object1F_Init(Object1FEntity* this) {
temp = gUnk_08120A18[super->subtimer].unk1;
super->palette.b.b0 = temp;
this->unk6c = gUnk_08120A18[super->subtimer].unk2;
super->collisionLayer = gPlayerEntity.collisionLayer;
super->collisionLayer = gPlayerEntity.base.collisionLayer;
super->speed = 0x100;
InitializeAnimation(super, gUnk_08120A18[super->subtimer].animationState);
}
+1 -1
View File
@@ -46,7 +46,7 @@ void Object37_Action1(Object37Entity* this) {
if ((gSave.kinstones.fusionUnmarked[0] != 0) && (this->unk70 != *this->unk78)) {
item = CreateGroundItem(super, ITEM_RUPEE100, 0);
if (item != 0) {
item->direction = gPlayerEntity.animationState << 2;
item->direction = gPlayerEntity.base.animationState << 2;
item->speed = 0x80;
item->zVelocity = Q_16_16(2.0);
}
+17 -17
View File
@@ -24,9 +24,9 @@ void Object70_Init(Entity* this) {
this->frameIndex = this->type + 0xb;
if (this->type != 0) {
sub_08004168(this);
gPlayerEntity.spriteOrientation.flipY = 3;
if ((gPlayerEntity.spritePriority.b0) != 7) {
this->spritePriority.b0 = gPlayerEntity.spritePriority.b0 + 1;
gPlayerEntity.base.spriteOrientation.flipY = 3;
if ((gPlayerEntity.base.spritePriority.b0) != 7) {
this->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0 + 1;
} else {
this->spritePriority.b0 = 7;
}
@@ -36,23 +36,23 @@ void Object70_Init(Entity* this) {
void Object70_Action1(Entity* this) {
if (this->type == 0) {
if (gPlayerEntity.z.WORD != 0 || (gPlayerState.dash_state & 0x40) != 0 ||
if (gPlayerEntity.base.z.WORD != 0 || (gPlayerState.dash_state & 0x40) != 0 ||
gPlayerState.floor_type != SURFACE_SWAMP ||
(gPlayerEntity.action != PLAYER_NORMAL && gPlayerEntity.action != PLAYER_ROLL &&
gPlayerEntity.action != PLAYER_JUMP)) {
if (gPlayerEntity.z.WORD == 0) {
CreateFx(&gPlayerEntity, FX_GREEN_SPLASH, 0);
(gPlayerEntity.base.action != PLAYER_NORMAL && gPlayerEntity.base.action != PLAYER_ROLL &&
gPlayerEntity.base.action != PLAYER_JUMP)) {
if (gPlayerEntity.base.z.WORD == 0) {
CreateFx(&gPlayerEntity.base, FX_GREEN_SPLASH, 0);
}
gPlayerEntity.spriteOrientation.flipY = 2;
gPlayerEntity.base.spriteOrientation.flipY = 2;
DeleteThisEntity();
}
this->x = gPlayerEntity.x;
this->y = gPlayerEntity.y;
this->x = gPlayerEntity.base.x;
this->y = gPlayerEntity.base.y;
if (gPlayerState.jump_status == 0) {
gPlayerEntity.spriteOrientation.flipY = 3;
if (gPlayerEntity.spritePriority.b0 != 7) {
this->spritePriority.b0 = gPlayerEntity.spritePriority.b0 + 1;
gPlayerEntity.base.spriteOrientation.flipY = 3;
if (gPlayerEntity.base.spritePriority.b0 != 7) {
this->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0 + 1;
} else {
this->spritePriority.b0 = 7;
}
@@ -60,11 +60,11 @@ void Object70_Action1(Entity* this) {
return;
}
if (gPlayerEntity.action != PLAYER_USEENTRANCE) {
if (gPlayerEntity.base.action != PLAYER_USEENTRANCE) {
if (this->collisionLayer == 1) {
gPlayerEntity.spriteOrientation.flipY = 2;
gPlayerEntity.base.spriteOrientation.flipY = 2;
} else {
gPlayerEntity.spriteOrientation.flipY = 1;
gPlayerEntity.base.spriteOrientation.flipY = 1;
}
DeleteThisEntity();
}
+4 -4
View File
@@ -54,7 +54,7 @@ void ObjectA8(ObjectA8Entity* this) {
case 0x1e:
case 0x1f:
super->action = 5;
super->child = &gPlayerEntity;
super->child = &gPlayerEntity.base;
CreateItemEntity(super->type, 0, 0);
DeleteThisEntity();
}
@@ -130,7 +130,7 @@ void ObjectA8_Action2Subaction2(ObjectA8Entity* this) {
if (sub_0806F3E4(super)) {
super->flags &= ~ENT_COLLIDE;
super->action = 5;
super->child = &gPlayerEntity;
super->child = &gPlayerEntity.base;
GiveItem(super->type, 0);
}
}
@@ -174,7 +174,7 @@ void ObjectA8_Action4(ObjectA8Entity* this) {
} else {
CopyPosition(super->child, super);
super->z.HALF.HI--;
if (IsColliding(super, &gPlayerEntity)) {
if (IsColliding(super, &gPlayerEntity.base)) {
sub_0809FECC(this);
GiveItem(super->type, 0);
}
@@ -238,7 +238,7 @@ bool32 sub_0809FE9C(ObjectA8Entity* this) {
}
void sub_0809FECC(ObjectA8Entity* this) {
super->child = &gPlayerEntity;
super->child = &gPlayerEntity.base;
super->action = 5;
super->subAction = 0;
}
+7 -7
View File
@@ -86,7 +86,7 @@ void ObjectBlockingStairs_Action1(ObjectBlockingStairsEntity* this) {
int xDist;
Entity* ent;
xDist = (int)gPlayerEntity.x.HALF.HI - super->x.HALF.HI;
xDist = (int)gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI;
if (this->objFlags) {
if (!CheckFlags(this->objFlags)) {
@@ -116,7 +116,7 @@ void ObjectBlockingStairs_Action1(ObjectBlockingStairsEntity* this) {
case 0x4030:
case 0x4031:
super->action = 3;
super->direction = Direction8FromAnimationState(gPlayerEntity.animationState);
super->direction = Direction8FromAnimationState(gPlayerEntity.base.animationState);
super->speed = 0x80;
super->timer = 64;
RequestPriorityDuration(super, 80);
@@ -125,7 +125,7 @@ void ObjectBlockingStairs_Action1(ObjectBlockingStairsEntity* this) {
return;
}
if ((gPlayerEntity.animationState & 2) == 0) {
if ((gPlayerEntity.base.animationState & 2) == 0) {
return;
}
RegisterCarryEntity(super);
@@ -159,13 +159,13 @@ void ObjectBlockingStairs_Action2(ObjectBlockingStairsEntity* this) {
sub_08093280(this);
} else {
if (gPlayerState.heldObject == 0x12) {
if ((gPlayerEntity.frame & 2) != 0 && ++super->subtimer > 8) {
if ((gPlayerEntity.base.frame & 2) != 0 && ++super->subtimer > 8) {
gPlayerState.queued_action = PLAYER_PULL;
gPlayerState.field_0x38 = 0x40;
gPlayerState.flags |= PL_BUSY;
gPlayerEntity.x.HALF.LO = 0;
gPlayerEntity.y.HALF.LO = 0;
super->direction = (gPlayerEntity.animationState ^ 4) << 2;
gPlayerEntity.base.x.HALF.LO = 0;
gPlayerEntity.base.y.HALF.LO = 0;
super->direction = (gPlayerEntity.base.animationState ^ 4) << 2;
super->timer = 64;
EnqueueSFX(SFX_10F);
sub_08093248(this);
+5 -5
View File
@@ -121,17 +121,17 @@ void ObjectOnPillar_SubAction0(ObjectOnPillarEntity* this) {
const s8* ptr;
if (this->unk_72 == 0) {
this->unk_72 = 1;
ptr = &gUnk_08123274[gPlayerEntity.animationState];
PositionRelative(super, &gPlayerEntity, ptr[0] << 0x10, ptr[1] << 0x10);
ptr = &gUnk_08123274[gPlayerEntity.base.animationState];
PositionRelative(super, &gPlayerEntity.base, ptr[0] << 0x10, ptr[1] << 0x10);
}
sub_08097008(this);
if (sub_080896B0()) {
gPlayerState.queued_action = PLAYER_PULL;
gPlayerState.field_0x38 = 0x20;
gPlayerState.flags |= PL_BUSY;
gPlayerEntity.x.HALF.LO = 0;
gPlayerEntity.y.HALF.LO = 0;
super->direction = ((gPlayerEntity.animationState ^ 4) << 2);
gPlayerEntity.base.x.HALF.LO = 0;
gPlayerEntity.base.y.HALF.LO = 0;
super->direction = ((gPlayerEntity.base.animationState ^ 4) << 2);
sub_08097098(this);
}
}
+1 -1
View File
@@ -138,7 +138,7 @@ void ObjectOnSpinyBeetle_Action2Subaction0(ObjectOnSpinyBeetleEntity* this) {
super->flags |= ENT_COLLIDE;
super->collisionFlags = 7;
super->hitType = 1;
super->flags2 = gPlayerEntity.flags2;
super->flags2 = gPlayerEntity.base.flags2;
super->spriteOffsetY = 0;
(super->parent)->child = NULL;
super->subAction++;
+1 -1
View File
@@ -317,7 +317,7 @@ void OctorokBossObject_Action1(OctorokBossObjectEntity* this) {
case 9:
PausePlayer();
if ((this->unk_78.WORD_U)-- == 0) {
gRoomControls.camera_target = &gPlayerEntity;
gRoomControls.camera_target = &gPlayerEntity.base;
DeleteThisEntity();
}
break;
+2 -1
View File
@@ -66,7 +66,8 @@ void Paper_Type2(Entity* this) {
void Paper_Action1(Entity* this) {
if (this->type == 0) {
if ((gPlayerEntity.y.HALF.HI < this->y.HALF.HI) || (gPlayerEntity.y.HALF.HI) > this->y.HALF.HI + 0x18) {
if ((gPlayerEntity.base.y.HALF.HI < this->y.HALF.HI) ||
(gPlayerEntity.base.y.HALF.HI) > this->y.HALF.HI + 0x18) {
this->spriteRendering.b3 = 1;
} else {
this->spriteRendering.b3 = 2;
+21 -21
View File
@@ -72,8 +72,8 @@ void PlayerClone_Action1(PlayerCloneEntity* this) {
super->updatePriority = 6;
super->hitbox = (Hitbox*)&PlayerCloneHitbox;
super->subtimer = (super->type + 1) * 15;
this->unk78 = super->x.HALF.HI - gPlayerEntity.x.HALF.HI;
this->unk7a = super->y.HALF.HI - gPlayerEntity.y.HALF.HI;
this->unk78 = super->x.HALF.HI - gPlayerEntity.base.x.HALF.HI;
this->unk7a = super->y.HALF.HI - gPlayerEntity.base.y.HALF.HI;
if ((this->unk78 != 0) && (this->unk7a != 0)) {
((PlayerCloneEntity*)gPlayerClones[super->type])->unk70 = 1;
}
@@ -106,13 +106,13 @@ void PlayerClone_Action2(PlayerCloneEntity* this) {
if (gPlayerState.chargeState.action == 5 && gPlayerClones[super->type] != NULL &&
gPlayerState.framestate != PL_STATE_TALKEZLO && super->health != 0) {
if (gPlayerEntity.iframes >= 1) {
if (gPlayerEntity.base.iframes >= 1) {
gPlayerState.chargeState.action = 1;
} else {
GetTileUnderEntity(super);
sub_08084B1C(this);
super->x.HALF.HI = gPlayerEntity.x.HALF.HI + this->unk78;
super->y.HALF.HI = gPlayerEntity.y.HALF.HI + this->unk7a;
super->x.HALF.HI = gPlayerEntity.base.x.HALF.HI + this->unk78;
super->y.HALF.HI = gPlayerEntity.base.y.HALF.HI + this->unk7a;
sub_08084CAC(this);
sub_080085B0(super);
if ((super->collisions & (COL_NORTH_FULL | COL_SOUTH_FULL | COL_EAST_FULL | COL_WEST_FULL)) !=
@@ -151,22 +151,22 @@ void PlayerClone_Action2(PlayerCloneEntity* this) {
}
void sub_08084B1C(PlayerCloneEntity* this) {
super->flags = gPlayerEntity.flags;
super->spriteVramOffset = gPlayerEntity.spriteVramOffset;
super->frameIndex = gPlayerEntity.frameIndex;
super->frameSpriteSettings = gPlayerEntity.frameSpriteSettings;
super->spriteIndex = gPlayerEntity.spriteIndex;
super->direction = gPlayerEntity.direction;
super->animationState = gPlayerEntity.animationState;
super->spriteSettings.flipX = gPlayerEntity.spriteSettings.flipX;
super->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
super->spritePriority.b0 = gPlayerEntity.spritePriority.b0;
super->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
super->collisionLayer = gPlayerEntity.collisionLayer;
super->flags2 = gPlayerEntity.flags2;
super->hitType = gPlayerEntity.hitType;
super->collisionFlags = gPlayerEntity.collisionFlags;
super->hurtType = gPlayerEntity.hurtType;
super->flags = gPlayerEntity.base.flags;
super->spriteVramOffset = gPlayerEntity.base.spriteVramOffset;
super->frameIndex = gPlayerEntity.base.frameIndex;
super->frameSpriteSettings = gPlayerEntity.base.frameSpriteSettings;
super->spriteIndex = gPlayerEntity.base.spriteIndex;
super->direction = gPlayerEntity.base.direction;
super->animationState = gPlayerEntity.base.animationState;
super->spriteSettings.flipX = gPlayerEntity.base.spriteSettings.flipX;
super->spriteRendering.b3 = gPlayerEntity.base.spriteRendering.b3;
super->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0;
super->spriteOrientation.flipY = gPlayerEntity.base.spriteOrientation.flipY;
super->collisionLayer = gPlayerEntity.base.collisionLayer;
super->flags2 = gPlayerEntity.base.flags2;
super->hitType = gPlayerEntity.base.hitType;
super->collisionFlags = gPlayerEntity.base.collisionFlags;
super->hurtType = gPlayerEntity.base.hurtType;
CopyPosition(super, super->child);
if (gPlayerState.attack_status != 0) {
super->child->damage = gPlayerState.item->damage;
+2 -2
View File
@@ -156,7 +156,7 @@ void sub_08082510(PotEntity* this) {
super->hitbox = (Hitbox*)&gUnk_080FD340;
super->collisionFlags = 7;
super->hitType = 1;
super->flags2 = gPlayerEntity.flags2;
super->flags2 = gPlayerEntity.base.flags2;
super->spriteOffsetY = 0;
SetTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
super->subAction++;
@@ -181,7 +181,7 @@ void sub_0808259C(PotEntity* this) {
CreateFx(super, FX_LAVA_SPLASH, 0);
break;
default:
sub_08082850(this, &gPlayerEntity);
sub_08082850(this, &gPlayerEntity.base);
return;
}
+1 -1
View File
@@ -120,7 +120,7 @@ static u32 get_standing_count(PressurePlateEntity* this) {
num = 0;
if (IsCollidingPlayer(super) != 0) {
gPlayerEntity.spriteOffsetY = sSpriteOffsets[this->dir];
gPlayerEntity.base.spriteOffsetY = sSpriteOffsets[this->dir];
num = 1;
}
if ((gPlayerState.flags & PL_CLONING) != 0) {
+8 -8
View File
@@ -105,7 +105,7 @@ void PullableLever_HandleAction2(PullableLeverEntity* this) {
void PullableLever_HandleSubAction0(PullableLeverEntity* this) {
u16 y;
u16 x;
Entity* player = &gPlayerEntity;
Entity* player = &gPlayerEntity.base;
if (this->unk_75 == 0) {
if (-player->animationState + super->type2 * 2 == 0) {
@@ -122,7 +122,7 @@ void PullableLever_HandleSubAction0(PullableLeverEntity* this) {
if (player->animationState >> 1 == super->type2) {
if (gPlayerState.framestate == PL_STATE_PULL) {
if (gPlayerState.heldObject & 2) {
if (gPlayerEntity.frame & 2) {
if (gPlayerEntity.base.frame & 2) {
sub_0809153C(this);
if (this->unk_75 == 1) {
this->unk_75 = 2;
@@ -191,15 +191,15 @@ void sub_0809153C(PullableLeverEntity* this) {
s16 diff;
s32 radius;
Entity* player = &gPlayerEntity;
Entity* player = &gPlayerEntity.base;
dir = gUnk_081222C0[super->type2];
if (this->necessaryPullLength <= this->pullLength) {
return;
}
prevX = player->x.HALF.HI;
prevY = player->y.HALF.HI;
sub_080044AE(&gPlayerEntity, super->speed, dir);
if ((prevX == gPlayerEntity.x.HALF.HI) && (prevY == gPlayerEntity.y.HALF.HI)) {
sub_080044AE(&gPlayerEntity.base, super->speed, dir);
if ((prevX == gPlayerEntity.base.x.HALF.HI) && (prevY == gPlayerEntity.base.y.HALF.HI)) {
return;
}
@@ -208,13 +208,13 @@ void sub_0809153C(PullableLeverEntity* this) {
diff = player->y.HALF.HI - prevY;
break;
case 1:
diff = prevX - gPlayerEntity.x.HALF.HI;
diff = prevX - gPlayerEntity.base.x.HALF.HI;
break;
case 2:
diff = prevY - gPlayerEntity.y.HALF.HI;
diff = prevY - gPlayerEntity.base.y.HALF.HI;
break;
case 3:
diff = gPlayerEntity.x.HALF.HI - prevX;
diff = gPlayerEntity.base.x.HALF.HI - prevX;
break;
}
radius = (diff << 0x18);
+17 -16
View File
@@ -269,7 +269,7 @@ void sub_0808AEB0(PullableMushroomEntity* this) {
if ((gPlayerState.playerInput.heldInput & gUnk_081211E4[super->animationState]) != 0) {
GetNextFrame(super);
if (uVar1 < 0x40) {
sub_080044AE(&gPlayerEntity, 0x40, super->direction);
sub_080044AE(&gPlayerEntity.base, 0x40, super->direction);
if (this->unk_7c-- == 0) {
this->unk_7c = 4;
SoundReq(SFX_12F);
@@ -278,29 +278,30 @@ void sub_0808AEB0(PullableMushroomEntity* this) {
super->subtimer = 1;
} else {
if (((super->subtimer != 0) && (gPlayerEntity.action == PLAYER_NORMAL)) && (gPlayerState.swim_state == 0)) {
if (((super->subtimer != 0) && (gPlayerEntity.base.action == PLAYER_NORMAL)) &&
(gPlayerState.swim_state == 0)) {
gPlayerState.queued_action = PLAYER_08072C9C;
gPlayerState.field_0x38 = uVar1;
gPlayerState.field_0x39 = super->direction ^ 0x10;
gPlayerState.field_0x3a = sub_0808B1F0(this, &gPlayerEntity);
gPlayerState.field_0x3a = sub_0808B1F0(this, &gPlayerEntity.base);
super->subAction++;
}
}
} else {
super->timer = 1;
this->unk_7c = 1;
super->animationState = AnimationStateFlip90(gPlayerEntity.animationState >> 1);
super->animationState = AnimationStateFlip90(gPlayerEntity.base.animationState >> 1);
super->direction = (super->animationState << 3);
super->flags &= ~0x80;
super->spriteSettings.flipX = gPlayerEntity.spriteSettings.flipX;
super->spriteSettings.flipX = gPlayerEntity.base.spriteSettings.flipX;
InitializeAnimation(super, super->animationState + 5);
if (sub_0808B21C(this, 0)) {
sub_0808B168((PullableMushroomEntity*)super->child, 0);
}
if ((super->animationState & 1) != 0) {
gPlayerEntity.y.HALF.HI = super->y.HALF.HI;
gPlayerEntity.base.y.HALF.HI = super->y.HALF.HI;
} else {
gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
gPlayerEntity.base.x.HALF.HI = super->x.HALF.HI;
}
}
}
@@ -332,9 +333,9 @@ void PullableMushroom_Action3(PullableMushroomEntity* this) {
void sub_0808B05C(PullableMushroomEntity* this) {
if (super->type == 0) {
super->animationState = AnimationStateFlip90(gPlayerEntity.animationState >> 1);
super->animationState = AnimationStateFlip90(gPlayerEntity.base.animationState >> 1);
super->direction = super->animationState << 3;
super->spriteSettings.flipX = gPlayerEntity.spriteSettings.flipX;
super->spriteSettings.flipX = gPlayerEntity.base.spriteSettings.flipX;
super->flags &= ~0x80;
InitializeAnimation(super, super->animationState + 5);
if (sub_0808B21C(this, 1)) {
@@ -355,16 +356,16 @@ void sub_0808B0BC(PullableMushroomEntity* this) {
GetNextFrame(super);
break;
case 1:
ptr = &gUnk_08126EE4[gPlayerEntity.animationState & 0xe];
ent.base.x.HALF.HI = ptr[0] + gPlayerEntity.x.HALF.HI;
ent.base.y.HALF.HI = ptr[1] + gPlayerEntity.y.HALF.HI;
ptr = &gUnk_08126EE4[gPlayerEntity.base.animationState & 0xe];
ent.base.x.HALF.HI = ptr[0] + gPlayerEntity.base.x.HALF.HI;
ent.base.y.HALF.HI = ptr[1] + gPlayerEntity.base.y.HALF.HI;
if (sub_0800419C(&ent.base, super, 7, 7)) {
if ((gPlayerEntity.action != PLAYER_NORMAL) || (gPlayerState.swim_state != 0))
if ((gPlayerEntity.base.action != PLAYER_NORMAL) || (gPlayerState.swim_state != 0))
return;
gPlayerState.queued_action = PLAYER_08072C9C;
gPlayerState.field_0x38 = uVar2;
gPlayerState.field_0x39 = super->direction ^ 0x10;
gPlayerState.field_0x3a = sub_0808B1F0((PullableMushroomEntity*)super->parent, &gPlayerEntity);
gPlayerState.field_0x3a = sub_0808B1F0((PullableMushroomEntity*)super->parent, &gPlayerEntity.base);
} else {
super->speed = 0x40;
if (uVar2 < 0x40) {
@@ -397,13 +398,13 @@ void sub_0808B168(PullableMushroomEntity* this, u32 param_2) {
pEVar6 = pEVar5;
} else {
if ((super->animationState & 1) != 0) {
pEVar6 = &gPlayerEntity;
pEVar6 = &gPlayerEntity.base;
pEVar5 = super->parent;
pcVar5 = (gUnk_081211FC + super->animationState * 2);
pcVar3 = (gUnk_081211F4 + 1 + AnimationStateFlip90(super->animationState) * 2);
} else {
pEVar6 = super->parent;
pEVar5 = &gPlayerEntity;
pEVar5 = &gPlayerEntity.base;
pcVar5 = (gUnk_081211F4 + AnimationStateFlip90(super->animationState) * 2);
pcVar3 = (gUnk_081211FC + 1 + super->animationState * 2);
}
+6 -23
View File
@@ -4,27 +4,9 @@
*
* @brief Pushable Furniture object
*/
#include "functions.h"
#include "object.h"
#include "object/pushableFurniture.h"
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unk_68[0x8];
/*0x70*/ u16 unk_70;
/*0x72*/ u16 unk_72;
/*0x74*/ u16 unk_74;
/*0x76*/ u16 unk_76;
/*0x78*/ u8 unk_78[0x2];
/*0x7a*/ u16 unk_7a;
/*0x7c*/ u16 unk_7c;
/*0x7e*/ u16 unk_7e;
/*0x80*/ u8 unk_80;
/*0x81*/ u8 unk_81;
/*0x82*/ u8 unk_82;
/*0x83*/ u8 unk_83;
/*0x84*/ u8 unk_84[0x2];
/*0x86*/ u16 unk_86;
} PushableFurnitureEntity;
#include "functions.h"
extern const s16 gUnk_080B4488[];
@@ -339,9 +321,10 @@ void sub_0808FDE8(PushableFurnitureEntity* this) {
bool32 sub_0808FECC(PushableFurnitureEntity* this) {
bool32 result = TRUE;
if (!((gPlayerState.flags & PL_MINISH) == 0 && (gPlayerEntity.action == PLAYER_BOUNCE) &&
(gPlayerEntity.animationState == 0) && (gPlayerEntity.y.HALF.HI - super->y.HALF.HI < 0x14) &&
(super->x.HALF.HI + 0xc > gPlayerEntity.x.HALF.HI) && (super->x.HALF.HI - 12 < gPlayerEntity.x.HALF.HI))) {
if (!((gPlayerState.flags & PL_MINISH) == 0 && (gPlayerEntity.base.action == PLAYER_BOUNCE) &&
(gPlayerEntity.base.animationState == 0) && (gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI < 0x14) &&
(super->x.HALF.HI + 0xc > gPlayerEntity.base.x.HALF.HI) &&
(super->x.HALF.HI - 12 < gPlayerEntity.base.x.HALF.HI))) {
result = FALSE;
}
return result;
+1 -1
View File
@@ -118,7 +118,7 @@ void PushableGrave_Action3(PushableGraveEntity* this) {
EnqueueSFX(SFX_SECRET);
sub_080977F4(this);
if (super->type == 0) {
gRoomControls.camera_target = &gPlayerEntity;
gRoomControls.camera_target = &gPlayerEntity.base;
gRoomControls.scrollSpeed = 4;
}
}
+3 -3
View File
@@ -57,9 +57,9 @@ void PushableLever_Idle(PushableLeverEntity* this) {
gPlayerState.pushedObject = 0x90;
gPlayerState.queued_action = PLAYER_PUSH;
gPlayerState.flags |= PL_BUSY;
gPlayerEntity.x.HALF.LO = 0;
gPlayerEntity.y.HALF.LO = 0;
gPlayerEntity.direction = gPlayerEntity.animationState << 2;
gPlayerEntity.base.x.HALF.LO = 0;
gPlayerEntity.base.y.HALF.LO = 0;
gPlayerEntity.base.direction = gPlayerEntity.base.animationState << 2;
}
}
}
+11 -11
View File
@@ -104,9 +104,9 @@ void PushableStatue_SubAction0(PushableStatueEntity* this) {
if (this->unk_83 == 0) {
this->unk_83 = 1;
index = gPlayerEntity.animationState;
index = gPlayerEntity.base.animationState;
ptr = &gUnk_08120CB4[index];
PositionRelative(super, &gPlayerEntity, *(ptr) << 0x10, *(ptr + 1) << 0x10);
PositionRelative(super, &gPlayerEntity.base, *(ptr) << 0x10, *(ptr + 1) << 0x10);
}
tileType = GetTileType(this->unk_84, super->collisionLayer);
if (tileType != 0x400b) {
@@ -131,9 +131,9 @@ void PushableStatue_SubAction0(PushableStatueEntity* this) {
gPlayerState.queued_action = PLAYER_PULL;
gPlayerState.field_0x38 = 0x20;
gPlayerState.flags |= PL_BUSY;
gPlayerEntity.x.HALF.LO = 0;
gPlayerEntity.y.HALF.LO = 0;
super->direction = (gPlayerEntity.animationState ^ 4) << 2;
gPlayerEntity.base.x.HALF.LO = 0;
gPlayerEntity.base.y.HALF.LO = 0;
super->direction = (gPlayerEntity.base.animationState ^ 4) << 2;
sub_08089538(this);
}
}
@@ -258,13 +258,13 @@ bool32 sub_080896B0(void) {
u32 tmp2;
u32 val;
if (((gPlayerState.heldObject & 0x1f) == 0x12) && ((gPlayerEntity.frame & 1) != 0)) {
ptr = &gUnk_080B4468[gPlayerEntity.animationState & 6];
uVar1 = gUnk_080B4488[gPlayerEntity.animationState >> 1];
uVar4 = COORD_TO_TILE_OFFSET(&gPlayerEntity, -ptr[0], -ptr[1]) - uVar1;
val = sub_080B1AE0(uVar4, gPlayerEntity.collisionLayer);
if (((gPlayerState.heldObject & 0x1f) == 0x12) && ((gPlayerEntity.base.frame & 1) != 0)) {
ptr = &gUnk_080B4468[gPlayerEntity.base.animationState & 6];
uVar1 = gUnk_080B4488[gPlayerEntity.base.animationState >> 1];
uVar4 = COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr[0], -ptr[1]) - uVar1;
val = sub_080B1AE0(uVar4, gPlayerEntity.base.collisionLayer);
if ((val - 0x26 > 1) && (val != 0x29)) {
layer = GetLayerByIndex(gPlayerEntity.collisionLayer);
layer = GetLayerByIndex(gPlayerEntity.base.collisionLayer);
iVar2 = (uVar4 * 0x10000) >> 0x10;
tmp1 = layer->collisionData[iVar2];
tmp2 = layer->collisionData[(iVar2 - uVar1)];
+2 -2
View File
@@ -69,7 +69,7 @@ void ShrinkingHieroglyphs_Action1(ShrinkingHieroglyphsEntity* this) {
if (super->type == 0) {
UpdateAnimationSingleFrame(super);
if (super->type2 != 0) {
gPlayerEntity.subtimer = 0;
gPlayerEntity.base.subtimer = 0;
super->action++;
InitAnimationForceUpdate(super, 1);
SoundReq(SFX_178);
@@ -109,7 +109,7 @@ void ShrinkingHieroglyphs_Action2(ShrinkingHieroglyphsEntity* this) {
}
void sub_08098130(ShrinkingHieroglyphsEntity* this) {
CopyPosition(&gPlayerEntity, super);
CopyPosition(&gPlayerEntity.base, super);
super->direction = this->objDir.HALF.HI;
super->speed = this->unk7a;
LinearMoveUpdate(super);
+2 -2
View File
@@ -307,8 +307,8 @@ void sub_080847E0(SpecialFxObject* this) {
if (gRoomControls.reload_flags == 1) {
DeleteThisEntity();
}
PositionRelative(&gPlayerEntity, super, 0, -0x30000);
PositionRelative(&gPlayerEntity.base, super, 0, -0x30000);
super->z.HALF.HI = -3;
SortEntityAbove(&gPlayerEntity, super);
SortEntityAbove(&gPlayerEntity.base, super);
sub_080845DC(this);
}
+1 -1
View File
@@ -43,7 +43,7 @@ void Steam(Entity* _this) {
type = super->type;
ptr = &this->unk_0x68;
if (type != 0) {
if (gPlayerEntity.x.HALF.HI - gRoomControls.origin_x > (0xf8 << 1)) {
if (gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x > (0xf8 << 1)) {
if (*ptr < 0x40) {
(*ptr)++;
}
+8 -8
View File
@@ -33,8 +33,8 @@ void SwordParticle_Init(SwordParticleEntity* this) {
super->action = 1;
super->flags |= ENT_PERSIST;
super->spritePriority.b0 = 0;
super->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
super->animationState = gPlayerEntity.animationState >> 1;
super->spriteOrientation.flipY = gPlayerEntity.base.spriteOrientation.flipY;
super->animationState = gPlayerEntity.base.animationState >> 1;
super->direction = (((super->animationState + 1) & 3) << 3);
super->subtimer = 6;
super->speed = 0x140;
@@ -121,12 +121,12 @@ void SwordParticle_Action1(SwordParticleEntity* this) {
}
}
super->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
super->spriteRendering.b3 = gPlayerEntity.base.spriteRendering.b3;
ptr2 = &ptr[super->animationState * 2];
super->x.HALF.HI = ptr2[0] + gPlayerEntity.x.HALF.HI;
super->y.HALF.HI = ptr[super->animationState * 2 + 1] + gPlayerEntity.y.HALF.HI;
super->z.HALF.HI = gPlayerEntity.z.HALF.HI;
super->collisionLayer = gPlayerEntity.collisionLayer;
super->x.HALF.HI = ptr2[0] + gPlayerEntity.base.x.HALF.HI;
super->y.HALF.HI = ptr[super->animationState * 2 + 1] + gPlayerEntity.base.y.HALF.HI;
super->z.HALF.HI = gPlayerEntity.base.z.HALF.HI;
super->collisionLayer = gPlayerEntity.base.collisionLayer;
switch (super->animationState) {
default:
super->y.HALF.HI -= this->unk_6c;
@@ -168,7 +168,7 @@ void SwordParticle_Action2(SwordParticleEntity* this) {
sub_08079BD8(super);
super->action++;
super->spriteSettings.draw = 1;
super->animationState = gPlayerEntity.animationState;
super->animationState = gPlayerEntity.base.animationState;
super->spriteVramOffset = 0;
super->palette.b.b0 = 4;
super->spriteIndex = 0xaf;
+1 -1
View File
@@ -100,7 +100,7 @@ void sub_08093EF0(ThunderboltEntity* this) {
if ((super->frame & ANIM_DONE) == 0) {
return;
}
if (super->parent == &gPlayerEntity) {
if (super->parent == &gPlayerEntity.base) {
SoundReq(SFX_PLY_VO6);
sub_08079D84();
}
+2 -2
View File
@@ -63,7 +63,7 @@ void Trapdoor_Action2(Entity* this) {
}
void Trapdoor_Action3(Entity* this) {
if (EntityInRectRadius(this, &gPlayerEntity, 0xc, 0xc)) {
if (EntityInRectRadius(this, &gPlayerEntity.base, 0xc, 0xc)) {
if (this->subAction == 0) {
sub_08099ECC(this);
RequestPriorityDuration(this, 30);
@@ -79,7 +79,7 @@ void Trapdoor_Action4(Entity* this) {
void sub_08099ECC(Entity* this) {
this->subAction = 1;
CopyPosition(this, &gPlayerEntity);
CopyPosition(this, &gPlayerEntity.base);
gPlayerState.queued_action = PLAYER_FALL;
gPlayerState.field_0x38 = 0;
gPlayerState.flags |= PL_PIT_IS_EXIT;
+4 -4
View File
@@ -52,7 +52,7 @@ void TreeHidingPortal_Init(TreeHidingPortalEntity* this) {
void TreeHidingPortal_Action1(TreeHidingPortalEntity* this) {
if (sub_0800419C(super, &gPlayerEntity, 0x30, 0x30)) {
if (sub_0800419C(super, &gPlayerEntity.base, 0x30, 0x30)) {
if (CheckGlobalFlag(EZERO_1ST)) {
if (((gRoomTransition.frameCount & 3) == 0)) {
CreateSparkle(super);
@@ -112,11 +112,11 @@ static u32 sub_0809E9A0(void) {
u32 rv;
const s16* ptr;
if (gPlayerEntity.action != PLAYER_BOUNCE) {
if (gPlayerEntity.base.action != PLAYER_BOUNCE) {
rv = 0;
} else {
ptr = &gUnk_080B4468[gPlayerEntity.animationState & 6];
rv = sub_080B1AE0(COORD_TO_TILE_OFFSET(&gPlayerEntity, -ptr[0], -ptr[1]), 1);
ptr = &gUnk_080B4468[gPlayerEntity.base.animationState & 6];
rv = sub_080B1AE0(COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr[0], -ptr[1]), 1);
}
return rv;
+2 -2
View File
@@ -49,7 +49,7 @@ void Vaati1Portal_Action2(Entity* this) {
if (CheckRoomFlag(1)) {
sub_080A0190(this);
RequestPriorityDuration(this, 30);
if (EntityInRectRadius(this, &gPlayerEntity, 0x10, 0x10)) {
if (EntityInRectRadius(this, &gPlayerEntity.base, 0x10, 0x10)) {
CreateHoleManager(0x37);
}
}
@@ -57,7 +57,7 @@ void Vaati1Portal_Action2(Entity* this) {
void sub_080A0190(Entity* this) {
this->subAction = 1;
CopyPosition(this, &gPlayerEntity);
CopyPosition(this, &gPlayerEntity.base);
gPlayerState.queued_action = PLAYER_FALL;
gPlayerState.field_0x38 = 0;
gPlayerState.flags |= PL_PIT_IS_EXIT;
+1 -1
View File
@@ -16,5 +16,5 @@ void Vaati3PlayerObject(Entity* this) {
#ifndef EU
gRoomControls.camera_target = this;
#endif
PositionRelative(&gPlayerEntity, this, 0, Q_16_16(-40.0));
PositionRelative(&gPlayerEntity.base, this, 0, Q_16_16(-40.0));
}
+21 -20
View File
@@ -69,9 +69,9 @@ void WarpPoint_Init(WarpPointEntity* this) {
return;
super->action = 4;
super->subtimer = 96;
gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
gPlayerEntity.y.HALF.HI = super->y.HALF.HI;
gPlayerEntity.animationState = 4;
gPlayerEntity.base.x.HALF.HI = super->x.HALF.HI;
gPlayerEntity.base.y.HALF.HI = super->y.HALF.HI;
gPlayerEntity.base.animationState = 4;
EnqueueSFX(SFX_112);
RequestPriorityDuration(super, super->subtimer + 16);
}
@@ -104,10 +104,10 @@ void WarpPoint_Action3(WarpPointEntity* this) {
super->action = 5;
super->subtimer = 96;
PutAwayItems();
gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
gPlayerEntity.y.HALF.HI = super->y.HALF.HI;
gPlayerEntity.animationState = 4;
gPlayerEntity.flags &= ~ENT_COLLIDE;
gPlayerEntity.base.x.HALF.HI = super->x.HALF.HI;
gPlayerEntity.base.y.HALF.HI = super->y.HALF.HI;
gPlayerEntity.base.animationState = 4;
gPlayerEntity.base.flags &= ~ENT_COLLIDE;
RequestPriorityDuration(super, super->subtimer + 16);
SoundReq(SFX_113);
} else {
@@ -120,8 +120,8 @@ void WarpPoint_Action4(WarpPointEntity* this) {
if (!--super->subtimer) {
super->action = 3;
super->timer = 1;
gPlayerEntity.animationState = 4;
gPlayerEntity.direction = DirectionSouth;
gPlayerEntity.base.animationState = 4;
gPlayerEntity.base.direction = DirectionSouth;
return;
}
tmp = 0;
@@ -141,7 +141,7 @@ void WarpPoint_Action4(WarpPointEntity* this) {
break;
case 0:
if (!(super->subtimer & 7)) {
if (gPlayerEntity.animationState == 4) {
if (gPlayerEntity.base.animationState == 4) {
if (super->subtimer > 0x18) {
tmp = 1;
}
@@ -152,8 +152,8 @@ void WarpPoint_Action4(WarpPointEntity* this) {
break;
}
if (tmp) {
gPlayerEntity.animationState += 2;
gPlayerEntity.animationState &= 6;
gPlayerEntity.base.animationState += 2;
gPlayerEntity.base.animationState &= 6;
}
}
@@ -192,13 +192,13 @@ void WarpPoint_Action5(WarpPointEntity* this) {
tmp = 1;
}
} else {
gPlayerEntity.spriteSettings.draw = 0;
gPlayerEntity.base.spriteSettings.draw = 0;
}
break;
}
if (tmp) {
gPlayerEntity.animationState += 2;
gPlayerEntity.animationState &= 6;
gPlayerEntity.base.animationState += 2;
gPlayerEntity.base.animationState &= 6;
}
}
@@ -208,10 +208,10 @@ void sub_0808B73C(WarpPointEntity* this) {
super->palette.b.b0 = super->parent->palette.b.b0;
InitializeAnimation(super, 1);
}
if (EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x28)) {
if (EntityWithinDistance(super, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI, 0x28)) {
super->spriteSettings.draw = 1;
} else {
if (EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x2e)) {
if (EntityWithinDistance(super, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI, 0x2e)) {
super->spriteSettings.draw ^= 1;
} else {
super->spriteSettings.draw = 0;
@@ -221,9 +221,10 @@ void sub_0808B73C(WarpPointEntity* this) {
}
u32 sub_0808B7C8(WarpPointEntity* this) {
if (!(gPlayerState.flags & PL_MINISH) && gPlayerState.framestate != PL_STATE_DIE && gPlayerEntity.health != 0 &&
PlayerCanBeMoved() && EntityInRectRadius(super, &gPlayerEntity, 5, 5) && gPlayerEntity.z.HALF.HI == 0) {
if (super->timer == 0 && gPlayerEntity.action == PLAYER_08072C9C) {
if (!(gPlayerState.flags & PL_MINISH) && gPlayerState.framestate != PL_STATE_DIE &&
gPlayerEntity.base.health != 0 && PlayerCanBeMoved() && EntityInRectRadius(super, &gPlayerEntity.base, 5, 5) &&
gPlayerEntity.base.z.HALF.HI == 0) {
if (super->timer == 0 && gPlayerEntity.base.action == PLAYER_08072C9C) {
ResetPlayerAnimationAndAction();
}
return 1;
+2 -2
View File
@@ -40,8 +40,8 @@ void Well_Action1(WellEntity* this) {
u32 tileIndex = GetTileType(this->unk_80, 1);
if (tileIndex != 0x407D) {
PausePlayer();
gPlayerEntity.x.WORD = super->x.WORD;
gPlayerEntity.y.HALF.HI = super->y.HALF.HI + 4;
gPlayerEntity.base.x.WORD = super->x.WORD;
gPlayerEntity.base.y.HALF.HI = super->y.HALF.HI + 4;
DeleteThisEntity();
}
}
+12 -11
View File
@@ -59,24 +59,25 @@ void Whirlwind_Action1(Entity* this) {
if (this->spriteSettings.draw != 0) {
GetNextFrame(this);
if ((((((gPlayerState.flags & PL_MINISH) == 0)) && (gPlayerState.field_0x3c == 0)) &&
((gPlayerEntity.action == PLAYER_JUMP || ((gPlayerEntity.flags & ENT_COLLIDE) != 0)))) &&
((gPlayerEntity.action != PLAYER_BOUNCE && (sub_0800419C(this, &gPlayerEntity, 0xc, 0xc) != 0)))) {
if (((gPlayerState.flags & PL_PARACHUTE) == 0) && (gPlayerEntity.action != PLAYER_JUMP)) {
if ((this->type2 != 1) && (-0x10 < gPlayerEntity.z.HALF.HI)) {
((gPlayerEntity.base.action == PLAYER_JUMP || ((gPlayerEntity.base.flags & ENT_COLLIDE) != 0)))) &&
((gPlayerEntity.base.action != PLAYER_BOUNCE &&
(sub_0800419C(this, &gPlayerEntity.base, 0xc, 0xc) != 0)))) {
if (((gPlayerState.flags & PL_PARACHUTE) == 0) && (gPlayerEntity.base.action != PLAYER_JUMP)) {
if ((this->type2 != 1) && (-0x10 < gPlayerEntity.base.z.HALF.HI)) {
return;
}
} else if (gPlayerEntity.z.HALF.HI == 0) {
} else if (gPlayerEntity.base.z.HALF.HI == 0) {
return;
}
CopyPosition(this, &gPlayerEntity);
CopyPosition(this, &gPlayerEntity.base);
sub_08004542(this);
sub_08004542(&gPlayerEntity);
gPlayerEntity.collisionLayer = 1;
gPlayerEntity.flags |= ENT_COLLIDE;
sub_08004542(&gPlayerEntity.base);
gPlayerEntity.base.collisionLayer = 1;
gPlayerEntity.base.flags |= ENT_COLLIDE;
gPlayerState.queued_action = PLAYER_PARACHUTE;
gPlayerState.field_0x38 = this->type2;
gPlayerState.field_0x39 = 0xff;
this->spritePriority.b0 = gPlayerEntity.spritePriority.b0 - 1;
this->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0 - 1;
this->action++;
PutAwayItems();
SoundReq(SFX_153);
@@ -87,7 +88,7 @@ void Whirlwind_Action1(Entity* this) {
void Whirlwind_Action2(Entity* this) {
UpdateAnimationSingleFrame(this);
if (sub_0800419C(this, &gPlayerEntity, 0xc, 0xc) == 0) {
if (sub_0800419C(this, &gPlayerEntity.base, 0xc, 0xc) == 0) {
ResetCollisionLayer(this);
this->spriteOrientation.flipY = 1;
this->spriteRendering.b3 = 1;
+13 -13
View File
@@ -40,8 +40,8 @@ void WindTribeTeleporter_Init(WindTribeTeleporterEntity* this) {
super->hitbox = (Hitbox*)&gHitbox_22;
SetEntityPriority(super, 6);
if (PlayerCollidingTeleporter(this)) {
gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
gPlayerEntity.y.HALF.HI = super->y.HALF.HI;
gPlayerEntity.base.x.HALF.HI = super->x.HALF.HI;
gPlayerEntity.base.y.HALF.HI = super->y.HALF.HI;
SetPlayerControl(CONTROL_DISABLED);
PausePlayer();
SetPlayerEventPriority();
@@ -55,8 +55,8 @@ void WindTribeTeleporter_Init(WindTribeTeleporterEntity* this) {
void WindTribeTeleporter_Action1(WindTribeTeleporterEntity* this) {
if (PlayerCollidingTeleporter(this)) {
if (this->unk_68 == 0) {
gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
gPlayerEntity.y.HALF.HI = super->y.HALF.HI;
gPlayerEntity.base.x.HALF.HI = super->x.HALF.HI;
gPlayerEntity.base.y.HALF.HI = super->y.HALF.HI;
SetPlayerControl(CONTROL_DISABLED);
PausePlayer();
SetPlayerEventPriority();
@@ -88,7 +88,7 @@ void WindTribeTeleporter_Action2(WindTribeTeleporterEntity* this) {
SoundReq(SFX_113);
} else {
if ((gRoomTransition.frameCount & 7) == 0) {
gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6;
gPlayerEntity.base.animationState = (gPlayerEntity.base.animationState + 2) & 6;
}
}
break;
@@ -98,7 +98,7 @@ void WindTribeTeleporter_Action2(WindTribeTeleporterEntity* this) {
super->timer = 30;
} else {
if ((gRoomTransition.frameCount & 3) == 0) {
gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6;
gPlayerEntity.base.animationState = (gPlayerEntity.base.animationState + 2) & 6;
}
}
break;
@@ -117,7 +117,7 @@ void WindTribeTeleporter_Action2(WindTribeTeleporterEntity* this) {
#endif
} else {
if ((gRoomTransition.frameCount & 1) == 0) {
gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6;
gPlayerEntity.base.animationState = (gPlayerEntity.base.animationState + 2) & 6;
}
}
break;
@@ -134,7 +134,7 @@ void WindTribeTeleporter_Action3(WindTribeTeleporterEntity* this) {
case 1:
if (--super->timer != 0) {
if ((gRoomTransition.frameCount & 1) == 0) {
gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6;
gPlayerEntity.base.animationState = (gPlayerEntity.base.animationState + 2) & 6;
}
} else {
super->subAction++;
@@ -147,7 +147,7 @@ void WindTribeTeleporter_Action3(WindTribeTeleporterEntity* this) {
super->timer = 30;
} else {
if ((gRoomTransition.frameCount & 3) == 0) {
gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6;
gPlayerEntity.base.animationState = (gPlayerEntity.base.animationState + 2) & 6;
}
}
break;
@@ -156,16 +156,16 @@ void WindTribeTeleporter_Action3(WindTribeTeleporterEntity* this) {
super->subAction++;
} else {
if ((gRoomTransition.frameCount & 7) == 0) {
gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6;
gPlayerEntity.base.animationState = (gPlayerEntity.base.animationState + 2) & 6;
}
}
break;
default:
if (gPlayerEntity.animationState != 4) {
if (gPlayerEntity.base.animationState != 4) {
if ((gRoomTransition.frameCount & 7U) != 0) {
return;
}
gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6;
gPlayerEntity.base.animationState = (gPlayerEntity.base.animationState + 2) & 6;
} else {
super->action = 1;
super->subAction = 0;
@@ -177,7 +177,7 @@ void WindTribeTeleporter_Action3(WindTribeTeleporterEntity* this) {
}
static bool32 PlayerCollidingTeleporter(WindTribeTeleporterEntity* this) {
if (gPlayerEntity.z.HALF.HI != 0) {
if (gPlayerEntity.base.z.HALF.HI != 0) {
return FALSE;
} else {
return IsCollidingPlayer(super);