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
+4 -4
View File
@@ -60,8 +60,8 @@ void sub_080300C4(void) {
void sub_080300E8(void) {
if (gRoomTransition.armos_data.field_0xae != 0xff) {
const u16* ptr = &gRoomTransition.armos_data.data[gRoomTransition.armos_data.field_0xae * 2];
gPlayerEntity.x.HALF.HI = ptr[0];
gPlayerEntity.y.HALF.HI = ptr[1] + 0xc;
gPlayerEntity.base.x.HALF.HI = ptr[0];
gPlayerEntity.base.y.HALF.HI = ptr[1] + 0xc;
gRoomTransition.armos_data.field_0xae = 0xff;
}
}
@@ -92,7 +92,7 @@ void sub_080301BC(ArmosEntity* this) {
}
void sub_080301D4(ArmosEntity* this) {
if ((super->action == 1) && (super->contactedEntity == &gPlayerEntity)) {
if ((super->action == 1) && (super->contactedEntity == &gPlayerEntity.base)) {
super->iframes = -0x1e;
}
if ((super->health != 0) && (super->health != this->unk_81)) {
@@ -429,7 +429,7 @@ bool32 sub_0803086C(ArmosEntity* this) {
if (GetTileType(pos, super->collisionLayer) == 0x4049) {
if (CheckPlayerInRegion(centerX, centerY, 2, 0xc) != 0) {
if (CheckPlayerInRegion(centerX, centerY - 4, 2, 4) != 0) {
gPlayerEntity.spritePriority.b0 = 3;
gPlayerEntity.base.spritePriority.b0 = 3;
DoExitTransition(this->unk_7c);
gRoomTransition.armos_data.field_0xae = this->unk_80;
return TRUE;
+6 -6
View File
@@ -44,7 +44,7 @@ void Beetle_OnCollision(BeetleEntity* this) {
super->subtimer = 0;
COLLISION_OFF(super);
super->spritePriority.b0 = 3;
CopyPositionAndSpriteOffset(&gPlayerEntity, super);
CopyPositionAndSpriteOffset(&gPlayerEntity.base, super);
super->z.HALF.HI = -1;
this->unk_87 = 1;
InitializeAnimation(super, 6);
@@ -159,7 +159,7 @@ void sub_08021984(BeetleEntity* this) {
void sub_08021A10(BeetleEntity* this) {
GetNextFrame(super);
if (EntityInRectRadius(super, &gPlayerEntity, 120, 80) && sub_08021D00(this) == 0) {
if (EntityInRectRadius(super, &gPlayerEntity.base, 120, 80) && sub_08021D00(this) == 0) {
if (--super->timer == 0) {
super->action = 3;
super->timer = (Random() & 0x3f) + 30;
@@ -250,17 +250,17 @@ void sub_08021B64(BeetleEntity* this) {
super->action = 6;
super->zVelocity = Q_16_16(1.0);
this->unk_87 = 0;
if (gPlayerEntity.direction != 0xff) {
super->direction = DirectionSouth ^ gPlayerEntity.direction;
if (gPlayerEntity.base.direction != 0xff) {
super->direction = DirectionSouth ^ gPlayerEntity.base.direction;
} else {
super->direction = (gPlayerEntity.animationState << 2) ^ DirectionSouth;
super->direction = (gPlayerEntity.base.animationState << 2) ^ DirectionSouth;
}
InitializeAnimation(super, 5);
} else {
gPlayerState.mobility |= 0x80;
gPlayerState.speed_modifier -= 0x50;
gPlayerState.attachedBeetleCount++;
CopyPositionAndSpriteOffset(&gPlayerEntity, super);
CopyPositionAndSpriteOffset(&gPlayerEntity.base, super);
super->x.HALF.HI += gUnk_080CB5E4[(super->subtimer++ & 0xe) >> 1];
super->z.HALF.HI--;
GetNextFrame(super);
+4 -4
View File
@@ -44,7 +44,7 @@ void Bobomb_OnCollision(BobombEntity* this) {
case 1:
if (this->unk_82) {
super->knockbackDuration = 0;
gPlayerEntity.knockbackDuration = 4;
gPlayerEntity.base.knockbackDuration = 4;
}
return;
case 0xe:
@@ -114,7 +114,7 @@ void sub_0802C83C(BobombEntity* this) {
if (this->unk_82) {
if (--super->timer == 0) {
super->action = 3;
switch (gPlayerEntity.animationState & 6) {
switch (gPlayerEntity.base.animationState & 6) {
case 2:
super->x.HALF.HI -= 6;
break;
@@ -218,7 +218,7 @@ void sub_0802CA10(BobombEntity* this) {
}
} else {
this->unk_83 = 2;
super->direction = (((gPlayerEntity.animationState) << 2) | IdleSouth) & (DIR_DIAGONAL | DirectionWest);
super->direction = (((gPlayerEntity.base.animationState) << 2) | IdleSouth) & (DIR_DIAGONAL | DirectionWest);
sub_0802CC18(this);
GetNextFrame(super);
}
@@ -242,7 +242,7 @@ void sub_0802CA94(BobombEntity* this) {
super->speed = 0;
this->unk_83 = 0;
this->unk_81 = 0;
super->direction = ((gPlayerEntity.animationState << 2) | IdleSouth) & (DirectionWest | DIR_DIAGONAL);
super->direction = ((gPlayerEntity.base.animationState << 2) | IdleSouth) & (DirectionWest | DIR_DIAGONAL);
InitializeAnimation(super, (super->direction >> 4) | IdleWest);
}
+1 -1
View File
@@ -213,7 +213,7 @@ void sub_0802AAC0(BombPeahatEntity* this) {
#ifdef EU
} else if (entity->timer == 0) {
if (sub_080B1B44(COORD_TO_TILE(super), 1) == 0) {
if (EntityInRectRadius(super, &gPlayerEntity, 0x10, 0x10) && entity->subtimer <= 0x50) {
if (EntityInRectRadius(super, &gPlayerEntity.base, 0x10, 0x10) && entity->subtimer <= 0x50) {
this->unk_81 = 0;
}
} else if (entity->subtimer <= 0x13) {
+1 -1
View File
@@ -311,7 +311,7 @@ void BusinessScrub_Action5(BusinessScrubEntity* this) {
}
void BusinessScrub_Action6(BusinessScrubEntity* this) {
if (gPlayerEntity.action == PLAYER_ITEMGET) {
if (gPlayerEntity.base.action == PLAYER_ITEMGET) {
if (this->unk_81 == 0) {
SetPlayerControl(1);
this->unk_81 = 1;
+17 -17
View File
@@ -464,7 +464,7 @@ void sub_08026090(ChuchuBossEntity* this) {
} else {
PausePlayer();
if (super->timer-- == 0) {
gRoomControls.camera_target = &gPlayerEntity;
gRoomControls.camera_target = &gPlayerEntity.base;
DeleteThisEntity();
}
}
@@ -540,7 +540,7 @@ void sub_08026110(ChuchuBossEntity* this) {
void sub_0802626C(ChuchuBossEntity* this) {
gPauseMenuOptions.disabled = 1;
gUnk_080CC20C[this->unk_84->unk_03](this);
if (gPlayerEntity.action != PLAYER_ROOMTRANSITION && gPlayerEntity.action != PLAYER_ROOM_EXIT) {
if (gPlayerEntity.base.action != PLAYER_ROOMTRANSITION && gPlayerEntity.base.action != PLAYER_ROOM_EXIT) {
PausePlayer();
}
}
@@ -558,7 +558,7 @@ void sub_080262A8(ChuchuBossEntity* this) {
this->unk_7c = 0;
this->unk_7d = 0x1e;
this->unk_84->unk_03 = 3;
gPlayerEntity.animationState = 0;
gPlayerEntity.base.animationState = 0;
gRoomControls.camera_target = super;
gRoomControls.scrollSpeed = 1;
SetTile(0x4022, 0x2c8, 1);
@@ -566,7 +566,7 @@ void sub_080262A8(ChuchuBossEntity* this) {
}
void sub_08026328(ChuchuBossEntity* this) {
if (gPlayerEntity.action != PLAYER_ROOMTRANSITION) {
if (gPlayerEntity.base.action != PLAYER_ROOMTRANSITION) {
this->unk_7d = 0x78;
this->unk_84->unk_03++;
sub_08078AC0(10, 0, 0);
@@ -576,20 +576,20 @@ void sub_08026328(ChuchuBossEntity* this) {
void sub_08026358(ChuchuBossEntity* this) {
u32 bVar1;
if (gPlayerEntity.action != PLAYER_ROOM_EXIT) {
if (gPlayerEntity.base.action != PLAYER_ROOM_EXIT) {
bVar1 = --this->unk_7d;
if (bVar1 == 0) {
this->unk_7c = 0;
this->unk_7d = 0x1e;
this->unk_84->unk_03++;
gPlayerEntity.animationState = 0;
gPlayerEntity.base.animationState = 0;
gRoomControls.camera_target = super;
gRoomControls.scrollSpeed = 1;
} else if (bVar1 < 0x61) {
if (bVar1 < 0x5c) {
gPlayerEntity.animationState = 4;
gPlayerEntity.base.animationState = 4;
} else {
gPlayerEntity.animationState = 2;
gPlayerEntity.base.animationState = 2;
}
}
}
@@ -655,7 +655,7 @@ void sub_080264D4(ChuchuBossEntity* this) {
void sub_0802650C(ChuchuBossEntity* this) {
if (((ChuchuBossEntity*)super->child)->unk_81 == 0) {
this->unk_84->unk_03++;
gRoomControls.camera_target = &gPlayerEntity;
gRoomControls.camera_target = &gPlayerEntity.base;
}
sub_08027870(this);
}
@@ -681,7 +681,7 @@ void sub_08026580(ChuchuBossEntity* this) {
super->speed = 0;
super->subAction = 2;
this->unk_7c = 0x3c;
super->direction = GetFacingDirection(super, &gPlayerEntity);
super->direction = GetFacingDirection(super, &gPlayerEntity.base);
if (this->unk_84->unk_04 == 2) {
this->unk_80 = 0x48;
this->unk_81 += 16;
@@ -731,7 +731,7 @@ void sub_08026634(ChuchuBossEntity* this) {
super->speed = 0x180;
} else {
if ((gRoomTransition.frameCount & 0x7f) == 0) {
super->direction = GetFacingDirection(super, &gPlayerEntity);
super->direction = GetFacingDirection(super, &gPlayerEntity.base);
}
if (this->unk_84->unk_04 == 2) {
super->speed = 0x100;
@@ -793,7 +793,7 @@ void sub_08026808(ChuchuBossEntity* this) {
if (pEVar4->unk_78.HALF_U.HI > 0xb0) {
pEVar4->unk_78.HALF_U.HI -= 8;
} else {
super->direction = GetFacingDirection(super, &gPlayerEntity);
super->direction = GetFacingDirection(super, &gPlayerEntity.base);
super->subAction = 4;
pEVar4->unk_78.HALF_U.HI = 0xa0;
pEVar5->unk_78.HALF_U.HI = 0xa0;
@@ -1201,9 +1201,9 @@ void sub_08027064(ChuchuBossEntity* this) {
SoundReq(SFX_PLY_JUMP);
}
if (this->unk_84->unk_03 != 0) {
if (super->y.HALF.HI != gPlayerEntity.y.HALF.HI) {
if (super->y.HALF.HI != gPlayerEntity.base.y.HALF.HI) {
if ((gRoomTransition.frameCount & 0xf) == 0) {
if (super->y.HALF.HI > gPlayerEntity.y.HALF.HI) {
if (super->y.HALF.HI > gPlayerEntity.base.y.HALF.HI) {
this->unk_84->unk_0c = 0;
} else {
this->unk_84->unk_0c = 0x10;
@@ -1243,7 +1243,7 @@ void sub_08027064(ChuchuBossEntity* this) {
*(char*)((int)pEVar10 + 0x84) = 1;
uVar2 = 0;
if (this->unk_84->unk_03 > 1) {
if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) {
if (super->x.HALF.HI > gPlayerEntity.base.x.HALF.HI) {
uVar2 = 24;
} else {
uVar2 = 8;
@@ -1785,8 +1785,8 @@ void sub_08027BBC(ChuchuBossEntity* this) {
*(u8*)((int)pEVar6 + 0x85) = 1;
}
super->animationState = super->direction >> 2;
if (super->y.HALF.HI != gPlayerEntity.y.HALF.HI) {
if (super->y.HALF.HI > gPlayerEntity.y.HALF.HI) {
if (super->y.HALF.HI != gPlayerEntity.base.y.HALF.HI) {
if (super->y.HALF.HI > gPlayerEntity.base.y.HALF.HI) {
this->unk_84->unk_0c = 0;
} else {
this->unk_84->unk_0c = 0x10;
+3 -3
View File
@@ -173,7 +173,7 @@ void sub_08038F20(CuccoAggrEntity* this) {
}
void sub_08038F44(CuccoAggrEntity* this) {
super->direction = GetFacingDirection(&gPlayerEntity, super);
super->direction = GetFacingDirection(&gPlayerEntity.base, super);
sub_080390F8(this);
ProcessMovement0(super);
sub_080044EC(super, 0x1800);
@@ -193,7 +193,7 @@ void sub_08038FA0(CuccoAggrEntity* this) {
if (this->unk_78) {
if ((this->unk_78-- & 0x7) == 0) {
sub_08004596(super, GetFacingDirection(super, &gPlayerEntity));
sub_08004596(super, GetFacingDirection(super, &gPlayerEntity.base));
}
sub_080390F8(this);
@@ -278,7 +278,7 @@ void sub_08039120(CuccoAggrEntity* this) {
void sub_08039140(CuccoAggrEntity* this) {
super->action = 6;
super->timer = Random();
super->direction = GetFacingDirection(super, &gPlayerEntity);
super->direction = GetFacingDirection(super, &gPlayerEntity.base);
super->z.HALF.HI = -4;
this->unk_78 = 0xb4;
sub_080390F8(this);
+2 -2
View File
@@ -137,12 +137,12 @@ u32 sub_08022B20(Entity* this) {
if (!sub_08049DF4(2))
return 0;
return EntityInRectRadius(this, &gPlayerEntity, 36, 36);
return EntityInRectRadius(this, &gPlayerEntity.base, 36, 36);
}
void sub_08022B44(Entity* this) {
this->zVelocity = Q_16_16(0.75);
this->direction = GetFacingDirection(this, &gPlayerEntity);
this->direction = GetFacingDirection(this, &gPlayerEntity.base);
if (this->direction & (0x3 | DIR_DIAGONAL | DirectionEast))
this->spriteSettings.flipX = (this->direction >> 4) ^ 1;
+9 -8
View File
@@ -202,7 +202,7 @@ void sub_08044310(DustEntity* this) {
uVar7 = 0xff;
tmp = 0xff;
switch (gPlayerEntity.animationState / 2 & 3) {
switch (gPlayerEntity.base.animationState / 2 & 3) {
case 0:
for (i = 0; i < this->unk_74; i++) {
if ((((Hitbox3D*)&super->hitbox[i])[1].unknown[2] == 0) &&
@@ -276,15 +276,15 @@ void sub_08044498(DustEntity* this) {
u32 tmp;
u32 xdiff, ydiff;
uVar4 = COORD_TO_TILE(&gPlayerEntity);
uVar4 = COORD_TO_TILE(&gPlayerEntity.base);
tmp = (gPlayerState.playerInput.newInput & 0xf00);
if (tmp != this->unk_75 || uVar4 != this->unk_76) {
this->unk_75 = tmp;
this->unk_76 = uVar4;
pbVar2 = HEAP->items;
uVar4 = HEAP->unk_0;
xdiff = gPlayerEntity.x.HALF.HI - super->x.HALF.HI;
ydiff = gPlayerEntity.y.HALF.HI - super->y.HALF.HI;
xdiff = gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI;
ydiff = gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI;
for (i = 0; i < uVar4; i++) {
if (xdiff - pbVar2[i].unk_0 < 0x10 && ydiff - pbVar2[i].unk_1 < 0x10) {
@@ -292,7 +292,7 @@ void sub_08044498(DustEntity* this) {
if (pEVar1 == NULL) {
return;
}
CopyPosition(&gPlayerEntity, pEVar1);
CopyPosition(&gPlayerEntity.base, pEVar1);
return;
}
}
@@ -307,9 +307,10 @@ void sub_08044550(DustEntity* this) {
if (super->speed < 0x100) {
super->speed += 0x10;
}
ptr = &gUnk_08126EE4[gPlayerEntity.animationState & 0xe];
super->direction = CalculateDirectionTo(super->x.HALF.HI, super->y.HALF.HI, gPlayerEntity.x.HALF.HI + ptr[0],
gPlayerEntity.y.HALF.HI + ptr[1]);
ptr = &gUnk_08126EE4[gPlayerEntity.base.animationState & 0xe];
super->direction =
CalculateDirectionTo(super->x.HALF.HI, super->y.HALF.HI, gPlayerEntity.base.x.HALF.HI + ptr[0],
gPlayerEntity.base.y.HALF.HI + ptr[1]);
LinearMoveUpdate(super);
} else {
sub_080445C0(this);
+3 -3
View File
@@ -160,7 +160,7 @@ void Enemy50_OnGrabbed(Enemy50Entity* this) {
void Enemy50_SubAction0(Enemy50Entity* this) {
super->subAction = 1;
super->gustJarTolerance = 0x3c;
InitializeAnimation(super, (gPlayerEntity.animationState >> 2) + 5);
InitializeAnimation(super, (gPlayerEntity.base.animationState >> 2) + 5);
}
void Enemy50_SubAction1(Enemy50Entity* this) {
@@ -302,7 +302,7 @@ void Enemy50_Action9(Enemy50Entity* this) {
if (sub_0807953C()) {
this->unk_78 += 8;
}
if (gPlayerEntity.health == 0) {
if (gPlayerEntity.base.health == 0) {
this->unk_78 = 0xe0;
}
this->unk_78++;
@@ -312,7 +312,7 @@ void Enemy50_Action9(Enemy50Entity* this) {
super->iframes = -0xc;
super->knockbackDuration = 0x14;
super->knockbackSpeed = 0x180;
super->knockbackDirection = gPlayerEntity.animationState << 2 ^ 0x10;
super->knockbackDirection = gPlayerEntity.base.animationState << 2 ^ 0x10;
sub_08041128(this);
sub_0803F6EC(this);
} else {
+15 -15
View File
@@ -348,7 +348,7 @@ void Enemy64_Action4(Enemy64Entity* this) {
void Enemy64_Action4_SubAction0(Enemy64Entity* this) {
SoundReq(SFX_BOSS_DIE);
if (PlayerCanBeMoved() && gPlayerEntity.z.HALF.HI == 0) {
if (PlayerCanBeMoved() && gPlayerEntity.base.z.HALF.HI == 0) {
SetPlayerControl(CONTROL_2);
super->subAction = 2;
super->timer = 30;
@@ -359,7 +359,7 @@ void Enemy64_Action4_SubAction0(Enemy64Entity* this) {
}
void Enemy64_Action4_SubAction1(Enemy64Entity* this) {
if (PlayerCanBeMoved() && gPlayerEntity.z.HALF.HI == 0) {
if (PlayerCanBeMoved() && gPlayerEntity.base.z.HALF.HI == 0) {
SetPlayerControl(CONTROL_2);
super->subAction = 2;
super->timer = 1;
@@ -416,7 +416,7 @@ void Enemy64_Action4_SubAction5(Enemy64Entity* this) {
entity = entity->child;
entity->flags &= ~0x80;
entity->spriteSettings.draw = 0;
entity = &gPlayerEntity;
entity = &gPlayerEntity.base;
entity->x.HALF.HI = gRoomControls.origin_x + 0xa8;
entity->y.HALF.HI = gRoomControls.origin_y + 0x80;
entity->animationState = 0;
@@ -459,9 +459,9 @@ void Enemy64_Action4_SubAction7(Enemy64Entity* this) {
void sub_08049944(Enemy64Entity* this) {
this->unk_7c = (this->unk_7c << 1 & 0x7f) | (this->unk_7c & 0x80);
if (EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x20)) {
if (EntityWithinDistance(super, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI, 0x20)) {
gPlayerState.field_0x14 = 1;
if (gPlayerEntity.z.HALF.HI == 0) {
if (gPlayerEntity.base.z.HALF.HI == 0) {
gPlayerState.flags |= PL_FLAGS2;
this->unk_7c |= 1;
}
@@ -478,22 +478,22 @@ void sub_08049998(Enemy64Entity* this, u32 param_2) {
tmpY = super->y.HALF.HI;
LinearMoveAngle(super, super->speed, super->direction);
if (((this->unk_7c & 1) != 0) && PlayerCanBeMoved()) {
gPlayerEntity.x.HALF.HI = (super->x.HALF.HI - tmpX) + gPlayerEntity.x.HALF.HI;
gPlayerEntity.y.HALF.HI = (super->y.HALF.HI - tmpY) + gPlayerEntity.y.HALF.HI;
gPlayerEntity.base.x.HALF.HI = (super->x.HALF.HI - tmpX) + gPlayerEntity.base.x.HALF.HI;
gPlayerEntity.base.y.HALF.HI = (super->y.HALF.HI - tmpY) + gPlayerEntity.base.y.HALF.HI;
}
}
void sub_080499F0(Enemy64Entity* this) {
u32 tmp;
if ((((super->action != 0) && (gPlayerEntity.z.HALF.HI == 0)) && (PlayerCanBeMoved())) &&
if ((((super->action != 0) && (gPlayerEntity.base.z.HALF.HI == 0)) && (PlayerCanBeMoved())) &&
((this->unk_7c & 1) == 0)) {
if (EntityWithinDistance(&gPlayerEntity, super->x.HALF.HI, super->y.HALF.HI, 0x24) &&
if (EntityWithinDistance(&gPlayerEntity.base, super->x.HALF.HI, super->y.HALF.HI, 0x24) &&
((this->unk_7c & 2) == 0)) {
tmp = sub_080045DA((s32)gPlayerEntity.x.HALF.HI - super->x.HALF.HI,
(s32)gPlayerEntity.y.HALF.HI - super->y.HALF.HI);
gPlayerEntity.x.WORD = super->x.WORD + gSineTable[tmp] * 0x2400;
gPlayerEntity.y.WORD = super->y.WORD + gSineTable[tmp + 0x40] * -0x2400;
tmp = sub_080045DA((s32)gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI,
(s32)gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI);
gPlayerEntity.base.x.WORD = super->x.WORD + gSineTable[tmp] * 0x2400;
gPlayerEntity.base.y.WORD = super->y.WORD + gSineTable[tmp + 0x40] * -0x2400;
}
this->unk_7c = 0;
}
@@ -532,7 +532,7 @@ void sub_08049B20(Enemy64Entity* this) {
tmpY = super->y.HALF.HI;
LinearMoveAngle(super, super->speed, super->direction);
if (((this->unk_7c & 1) != 0) && PlayerCanBeMoved()) {
gPlayerEntity.x.HALF.HI = (super->x.HALF.HI - tmpX) + gPlayerEntity.x.HALF.HI;
gPlayerEntity.y.HALF.HI = (super->y.HALF.HI - tmpY) + gPlayerEntity.y.HALF.HI;
gPlayerEntity.base.x.HALF.HI = (super->x.HALF.HI - tmpX) + gPlayerEntity.base.x.HALF.HI;
gPlayerEntity.base.y.HALF.HI = (super->y.HALF.HI - tmpY) + gPlayerEntity.base.y.HALF.HI;
}
}
+1 -1
View File
@@ -80,7 +80,7 @@ void sub_0802C334(FallingBoulderEntity* this) {
u16 tmp;
if (this->unk_7c == 0) {
u32 tmp = gRoomControls.origin_y;
entity = &gPlayerEntity;
entity = &gPlayerEntity.base;
if (entity == NULL)
return;
if (entity->y.HALF.HI - tmp <= 0x38) {
+1 -1
View File
@@ -220,7 +220,7 @@ void FlyingPot_Action3(FlyingPotEntity* this) {
if (super->z.HALF.HI <= -6) {
super->action = FLYING_POT_ACTION_4;
super->timer = 10;
super->direction = GetFacingDirection(super, &gPlayerEntity);
super->direction = GetFacingDirection(super, &gPlayerEntity.base);
}
}
+7 -7
View File
@@ -137,7 +137,7 @@ void sub_08039DD8(FlyingSkullEntity* this) {
RegisterCarryEntity(super);
} else {
if ((gPlayerState.flags & PL_MINISH) == 0) {
Entity* player = &gPlayerEntity;
Entity* player = &gPlayerEntity.base;
if (EntityWithinDistance(super, player->x.HALF.HI, player->y.HALF.HI, 0x30)) {
if (super->type == 1) {
super->action = 3;
@@ -165,15 +165,15 @@ void sub_08039EE4(FlyingSkullEntity* this) {
COLLISION_OFF(super);
super->collisions = COL_NONE;
super->hitbox = (Hitbox*)&gUnk_080FD340;
gPlayerEntity.animationState;
this->unk_0x76 = gPlayerEntity.animationState;
gPlayerEntity.base.animationState;
this->unk_0x76 = gPlayerEntity.base.animationState;
SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
}
void sub_08039F4C(FlyingSkullEntity* this) {
if (gPlayerEntity.animationState != this->unk_0x76) {
super->frameIndex = AnimationStateIdle(gPlayerEntity.animationState - this->unk_0x76 + super->frameIndex);
this->unk_0x76 = gPlayerEntity.animationState;
if (gPlayerEntity.base.animationState != this->unk_0x76) {
super->frameIndex = AnimationStateIdle(gPlayerEntity.base.animationState - this->unk_0x76 + super->frameIndex);
this->unk_0x76 = gPlayerEntity.base.animationState;
}
}
@@ -210,7 +210,7 @@ void sub_0803A048(FlyingSkullEntity* this) {
if (super->z.HALF.HI <= -6) {
super->action = 5;
super->timer = 10;
super->direction = GetFacingDirection(super, &gPlayerEntity);
super->direction = GetFacingDirection(super, &gPlayerEntity.base);
}
}
+12 -12
View File
@@ -121,7 +121,7 @@ void Ghini_OnGrabbed(GhiniEntity* this) {
void Ghini_SubAction0(GhiniEntity* this) {
super->subAction = 1;
super->gustJarTolerance = 0x3c;
InitializeAnimation(super, (gPlayerEntity.animationState >> 2) + 5);
InitializeAnimation(super, (gPlayerEntity.base.animationState >> 2) + 5);
}
void Ghini_SubAction1(GhiniEntity* this) {
@@ -259,7 +259,7 @@ void Ghini_Action9(GhiniEntity* this) {
if (sub_0807953C() != 0) {
this->unk_78 += 0xc;
}
if (gPlayerEntity.health == 0) {
if (gPlayerEntity.base.health == 0) {
this->unk_78 = 0xe0;
}
if (++this->unk_78 >= 0xe0) {
@@ -268,7 +268,7 @@ void Ghini_Action9(GhiniEntity* this) {
super->iframes = -0xc;
super->knockbackDuration = 0x14;
super->knockbackSpeed = 0x180;
super->knockbackDirection = gPlayerEntity.animationState << 2 ^ 0x10;
super->knockbackDirection = gPlayerEntity.base.animationState << 2 ^ 0x10;
sub_0803F51C(this);
sub_0803F6EC(this);
} else {
@@ -363,18 +363,18 @@ void sub_0803F694(GhiniEntity* this) {
void sub_0803F6C0(GhiniEntity* this) {
super->frame &= ~1;
gPlayerEntity.iframes = 0xc;
gPlayerEntity.base.iframes = 0xc;
ModHealth(-4);
SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6);
SoundReqClipped(&gPlayerEntity.base, SFX_PLY_VO6);
}
void sub_0803F6EC(GhiniEntity* this) {
if (gPlayerEntity.health != 0) {
gPlayerEntity.flags |= ENT_COLLIDE;
gPlayerEntity.zVelocity = Q_16_16(1.5);
gPlayerEntity.z.HALF.HI = -2;
gPlayerEntity.direction = gPlayerEntity.animationState << 2;
gPlayerEntity.iframes = -0x3c;
if (gPlayerEntity.base.health != 0) {
gPlayerEntity.base.flags |= ENT_COLLIDE;
gPlayerEntity.base.zVelocity = Q_16_16(1.5);
gPlayerEntity.base.z.HALF.HI = -2;
gPlayerEntity.base.direction = gPlayerEntity.base.animationState << 2;
gPlayerEntity.base.iframes = -0x3c;
gPlayerState.jump_status = 0x41;
}
gPlayerState.flags &= ~PL_CAPTURED;
@@ -384,7 +384,7 @@ void sub_0803F738(GhiniEntity* this) {
ResetActiveItems();
gPlayerState.mobility |= 0x80;
gPlayerState.field_0xa |= 0x80;
sub_0806FA90(&gPlayerEntity, super, 0, 1);
sub_0806FA90(&gPlayerEntity.base, super, 0, 1);
super->spriteOffsetY -= 2;
}
+8 -8
View File
@@ -166,7 +166,7 @@ void sub_080376D0(GibdoEntity* this) {
ResetActiveItems();
gPlayerState.mobility |= 0x80;
gPlayerState.field_0xa |= 0x80;
CopyPositionAndSpriteOffset(&gPlayerEntity, super);
CopyPositionAndSpriteOffset(&gPlayerEntity.base, super);
UpdateAnimationSingleFrame(super);
if ((super->frame & 1) != 0) {
if (--this->field_0x7c == 0) {
@@ -352,19 +352,19 @@ void sub_08037A58(GibdoEntity* this) {
void sub_08037ACC(GibdoEntity* this) {
gPlayerState.flags &= ~PL_DISABLE_ITEMS;
COLLISION_ON(&gPlayerEntity);
gPlayerEntity.iframes = 30;
gPlayerEntity.knockbackDirection = DirectionFromAnimationState(super->animationState);
gPlayerEntity.knockbackDuration = 4;
gPlayerEntity.knockbackSpeed = 0x180;
COLLISION_ON(&gPlayerEntity.base);
gPlayerEntity.base.iframes = 30;
gPlayerEntity.base.knockbackDirection = DirectionFromAnimationState(super->animationState);
gPlayerEntity.base.knockbackDuration = 4;
gPlayerEntity.base.knockbackSpeed = 0x180;
}
// Damage player maybe?
void sub_08037B10(GibdoEntity* this) {
u32 health;
gPlayerEntity.iframes = 0xc;
gPlayerEntity.base.iframes = 0xc;
health = ModHealth(-8);
SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6);
SoundReqClipped(&gPlayerEntity.base, SFX_PLY_VO6);
if (health == 0) {
sub_08037A58(this);
this->field_0x76 = 240;
+21 -21
View File
@@ -170,7 +170,7 @@ void Gleerok_OnDeath(GleerokEntity* this) {
this->unk_74--;
gScreen.controls.alphaBlend = this->unk_74 | (this->unk_75 << 8);
if (gScreen.controls.alphaBlend == 0x1000) {
sub_0807AABC(&gPlayerEntity);
sub_0807AABC(&gPlayerEntity.base);
DeleteThisEntity();
}
}
@@ -189,7 +189,7 @@ void Gleerok_OnDeath(GleerokEntity* this) {
case 0:
gPlayerState.field_0x14 = 1;
if (sub_0806FC80(super, &gPlayerEntity, super->frame & 0x3f)) {
if (sub_0806FC80(super, &gPlayerEntity.base, super->frame & 0x3f)) {
gPlayerState.spriteOffsetY = -6;
}
@@ -215,10 +215,10 @@ void sub_0802D170(GleerokEntity* this) {
this->unk_84->filler2[0].unk0.HALF.HI = 0x10;
if (sub_0802EB08(this->unk_84, 0x40, 2) == 0 && sub_0802EA88(this->unk_84) == 0) {
super->action = 2;
gPlayerEntity.x.HALF.HI = gRoomControls.origin_x + 0x98;
gPlayerEntity.y.HALF.HI = gRoomControls.origin_y + 0xd8;
gPlayerEntity.animationState = 0;
RestorePrevTileEntity(COORD_TO_TILE(&gPlayerEntity), 2);
gPlayerEntity.base.x.HALF.HI = gRoomControls.origin_x + 0x98;
gPlayerEntity.base.y.HALF.HI = gRoomControls.origin_y + 0xd8;
gPlayerEntity.base.animationState = 0;
RestorePrevTileEntity(COORD_TO_TILE(&gPlayerEntity.base), 2);
gRoomControls.camera_target = super;
SetFade(FADE_BLACK_WHITE | FADE_INSTANT, 8);
}
@@ -318,7 +318,7 @@ void sub_0802D3B8(GleerokEntity* this) {
if (CheckGlobalFlag(LV2_CLEAR)) {
gScreen.lcd.displayControl &= 0xfdff;
sub_0807AABC(&gPlayerEntity);
sub_0807AABC(&gPlayerEntity.base);
DeleteThisEntity();
}
@@ -436,7 +436,7 @@ void sub_0802D674(GleerokEntity* this) {
u32 val;
gPauseMenuOptions.disabled = 1;
if (gPlayerEntity.z.WORD != 0)
if (gPlayerEntity.base.z.WORD != 0)
return;
if (this->unk_7c.WORD == 0x96) {
SoundReq(SFX_BOSS_HIT);
@@ -450,13 +450,13 @@ void sub_0802D674(GleerokEntity* this) {
SoundReq(SFX_BOSS_HIT);
} else if (val <= 0x3c) {
if (val == 0x3c) {
CreateSpeechBubbleExclamationMark(&gPlayerEntity, 0xc, -0x18);
CreateSpeechBubbleExclamationMark(&gPlayerEntity.base, 0xc, -0x18);
}
gPlayerEntity.animationState = 0;
gPlayerEntity.base.animationState = 0;
} else if (val <= 0x59) {
gPlayerEntity.animationState = 2;
gPlayerEntity.base.animationState = 2;
} else if (val <= 0x77) {
gPlayerEntity.animationState = 6;
gPlayerEntity.base.animationState = 6;
}
}
@@ -520,7 +520,7 @@ void sub_0802D7B4(GleerokEntity* this) {
super->action = 1;
super->subAction = 0;
this->unk_84->ent2->timer = 24;
gRoomControls.camera_target = &gPlayerEntity;
gRoomControls.camera_target = &gPlayerEntity.base;
#ifndef EU
gPlayerState.controlMode = CONTROL_1;
#endif
@@ -577,7 +577,7 @@ void sub_0802D86C(GleerokEntity* this) {
if (((GleerokEntity*)(super->parent))->unk_80 == 0)
return;
if (!EntityInRectRadius(super, &gPlayerEntity, 8, 8))
if (!EntityInRectRadius(super, &gPlayerEntity.base, 8, 8))
return;
gPlayerState.field_0x14 = 1;
@@ -710,7 +710,7 @@ void sub_0802D86C(GleerokEntity* this) {
void sub_0802DB84(GleerokEntity* this) {
u32 timer;
super->direction = GetFacingDirection(super, &gPlayerEntity);
super->direction = GetFacingDirection(super, &gPlayerEntity.base);
if (this->unk_84->filler[0].unk0.HALF.HI == super->direction) {
super->subAction = 1;
this->unk_78 = 0;
@@ -744,7 +744,7 @@ void sub_0802DB84(GleerokEntity* this) {
}
void sub_0802DC1C(GleerokEntity* this) {
u32 diff = GetFacingDirection(super, &gPlayerEntity);
u32 diff = GetFacingDirection(super, &gPlayerEntity.base);
diff = (this->unk_84->filler[0].unk0.HALF.HI - diff) & 0x1f;
if (diff > 0x10) {
@@ -788,7 +788,7 @@ void sub_0802DC1C(GleerokEntity* this) {
void sub_0802DCE0(GleerokEntity* this) {
if (this->unk_84->ent2->timer != 12) {
super->direction = GetFacingDirection(super, &gPlayerEntity);
super->direction = GetFacingDirection(super, &gPlayerEntity.base);
if (this->unk_84->filler[5].unk0.HALF.HI == super->direction) {
this->unk_84->ent2->timer = 12;
this->unk_82 = 4;
@@ -1009,7 +1009,7 @@ void sub_0802E0B8(GleerokEntity* this) {
val = super->frame & 0x3f;
if (val) {
if (sub_0806FC80(super, &gPlayerEntity, val)) {
if (sub_0806FC80(super, &gPlayerEntity.base, val)) {
gPlayerState.field_0x14 = 1;
gPlayerState.spriteOffsetY = -6;
}
@@ -1059,7 +1059,7 @@ void sub_0802E1D0(GleerokEntity* this) {
GetNextFrame(super);
}
if (super->frame & 0x3f) {
if (sub_0806FC80(super, &gPlayerEntity, super->frame & 0x3f)) {
if (sub_0806FC80(super, &gPlayerEntity.base, super->frame & 0x3f)) {
gPlayerState.field_0x14 = 1;
gPlayerState.spriteOffsetY = -6;
}
@@ -1133,7 +1133,7 @@ void sub_0802E300(GleerokEntity* this) {
this->unk_79 &= ~0x80;
heap = this->unk_84;
dir = GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)) << 3;
dir = GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)) << 3;
index = 0;
ptr2 = &this->unk_80;
tmp = 0;
@@ -1403,7 +1403,7 @@ void sub_0802E9B0(GleerokEntity* this) {
s32 uVar4;
Gleerok_HeapStruct* heap;
iVar2 = sub_080041DC(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI) >> 4;
iVar2 = sub_080041DC(super, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI) >> 4;
if (iVar2 < 0x60) {
iVar2 = 10;
} else {
+2 -2
View File
@@ -159,13 +159,13 @@ void GyorgChild_Action2(GyorgChildEntity* this) {
switch (super->animationState >> 1) {
case 0:
case 2:
super->x.HALF.HI = gPlayerEntity.x.HALF.HI + this->attackOffsetX;
super->x.HALF.HI = gPlayerEntity.base.x.HALF.HI + this->attackOffsetX;
super->y.HALF.HI = gRoomControls.scroll_y + this->attackOffsetY;
break;
case 1:
default:
super->x.HALF.HI = gRoomControls.scroll_x + this->attackOffsetX;
super->y.HALF.HI = gPlayerEntity.y.HALF.HI + this->attackOffsetY;
super->y.HALF.HI = gPlayerEntity.base.y.HALF.HI + this->attackOffsetY;
break;
}
if (super->type2 == 0) {
+5 -5
View File
@@ -93,8 +93,8 @@ void GyorgFemale_Setup(GyorgFemaleEntity* this) {
MemClear(&gMapDataTopSpecial, 0x8000);
sub_0804660C(this, 0);
sub_080464C0(this);
gPlayerEntity.collisionLayer = 2;
UpdateSpriteForCollisionLayer(&gPlayerEntity);
gPlayerEntity.base.collisionLayer = 2;
UpdateSpriteForCollisionLayer(&gPlayerEntity.base);
#ifndef EU
RegisterTransitionManager(this, sub_08046498, 0);
#else
@@ -272,8 +272,8 @@ void sub_08046518(void) {
void sub_080465C8(void) {
s32 x, y;
x = (gPlayerEntity.x.HALF.HI - gRoomControls.origin_x) >> 3;
y = (gPlayerEntity.y.HALF.HI - gRoomControls.origin_y) >> 3;
x = (gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x) >> 3;
y = (gPlayerEntity.base.y.HALF.HI - gRoomControls.origin_y) >> 3;
if (gMapDataBottomSpecial[(y << 7) + x]) {
gPlayerState.field_0x14 = 1;
}
@@ -435,7 +435,7 @@ void GyorgFemale_ProcessEyeHit(GyorgFemaleEntity* this) {
#ifndef EU
if (((GyorgHeap*)super->myHeap)->unk_3c != 0xFF) {
#endif
tmp = &gPlayerEntity;
tmp = &gPlayerEntity.base;
tmp->knockbackDirection = ((GyorgHeap*)super->myHeap)->unk_3c;
tmp->iframes = 0xF4;
tmp->knockbackDuration = 0xA;
+2 -2
View File
@@ -83,9 +83,9 @@ void GyorgFemaleEye_OnCollision(GyorgFemaleEyeEntity* this) {
#endif
(*(((GyorgHeap**)&parent->base.myHeap)))->unk_18[super->type] = super->contactedEntity;
(*(((GyorgHeap**)&parent->base.myHeap)))->reflectFxPos.HALF.x =
(gPlayerEntity.x.HALF.HI + super->x.HALF.HI) / 2;
(gPlayerEntity.base.x.HALF.HI + super->x.HALF.HI) / 2;
(*(((GyorgHeap**)&parent->base.myHeap)))->reflectFxPos.HALF.y =
(gPlayerEntity.y.HALF.HI + super->y.HALF.HI) / 2;
(gPlayerEntity.base.y.HALF.HI + super->y.HALF.HI) / 2;
(*(((GyorgHeap**)&parent->base.myHeap)))->unk_3c = (super->knockbackDirection ^= 0x10);
#ifndef EU
break;
+2 -2
View File
@@ -58,11 +58,11 @@ void GyorgFemaleMouth(Entity* this) {
GetNextFrame(this);
}
if (tmp & 2) {
if (this->y.HALF.HI < gPlayerEntity.y.HALF.HI) {
if (this->y.HALF.HI < gPlayerEntity.base.y.HALF.HI) {
tmp++;
}
} else {
if (this->x.HALF.HI < gPlayerEntity.x.HALF.HI) {
if (this->x.HALF.HI < gPlayerEntity.base.x.HALF.HI) {
tmp++;
}
}
+26 -25
View File
@@ -111,8 +111,8 @@ void GyorgMale(GyorgMaleEntity* this) {
if (super->spriteSettings.draw == 1 && (super->y.HALF.HI - gRoomControls.scroll_y + 0x30) > 0x100u) {
super->spriteSettings.draw = 0;
}
this->unk_84 = gPlayerEntity.x.HALF.HI;
this->unk_86 = gPlayerEntity.y.HALF.HI;
this->unk_84 = gPlayerEntity.base.x.HALF.HI;
this->unk_86 = gPlayerEntity.base.y.HALF.HI;
}
void sub_08046898(GyorgMaleEntity* this) {
@@ -793,7 +793,7 @@ void sub_080477F0(GyorgMaleEntity* this) {
}
super->direction = sub_080045DA(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI);
sub_08047E48(this);
if (!EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x80)) {
if (!EntityWithinDistance(super, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI, 0x80)) {
super->action = 2;
super->subAction = 0;
super->spriteOrientation.flipY = 2;
@@ -858,7 +858,7 @@ void sub_08047978(GyorgMaleEntity* this) {
tmp->parent = super;
}
}
if (!EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x80)) {
if (!EntityWithinDistance(super, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI, 0x80)) {
super->action = 2;
super->subAction = 0;
super->spriteOrientation.flipY = 2;
@@ -1016,10 +1016,10 @@ void sub_08047D88(GyorgMaleEntity* this) {
return;
if (super->animIndex == 1)
return;
if (!EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x20))
if (!EntityWithinDistance(super, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI, 0x20))
return;
gPlayerState.field_0x14 = 1;
if (gPlayerEntity.z.HALF.HI != 0)
if (gPlayerEntity.base.z.HALF.HI != 0)
return;
this->unk_7c |= 1;
}
@@ -1033,8 +1033,8 @@ void sub_08047DF0(GyorgMaleEntity* this, u32 unk1) {
LinearMoveAngle(super, super->speed, super->direction);
if (this->unk_7c & 1) {
if (PlayerCanBeMoved()) {
gPlayerEntity.x.HALF.HI += super->x.HALF.HI - oldX;
gPlayerEntity.y.HALF.HI += super->y.HALF.HI - oldY;
gPlayerEntity.base.x.HALF.HI += super->x.HALF.HI - oldX;
gPlayerEntity.base.y.HALF.HI += super->y.HALF.HI - oldY;
}
}
}
@@ -1051,8 +1051,8 @@ void sub_08047E58(GyorgMaleEntity* this) {
LinearMoveAngle(super, super->speed, super->direction);
if (this->unk_7c & 1) {
if (PlayerCanBeMoved()) {
gPlayerEntity.x.HALF.HI += super->x.HALF.HI - oldX;
gPlayerEntity.y.HALF.HI += super->y.HALF.HI - oldY;
gPlayerEntity.base.x.HALF.HI += super->x.HALF.HI - oldX;
gPlayerEntity.base.y.HALF.HI += super->y.HALF.HI - oldY;
}
}
}
@@ -1066,11 +1066,12 @@ void sub_08047EA4(GyorgMaleEntity* this, u32 unk1) {
return;
if (this->unk_7c & 1) {
tmp2 = sub_08047F68(this) << 8;
dir = sub_080045DA(gPlayerEntity.x.HALF.HI - super->x.HALF.HI, gPlayerEntity.y.HALF.HI - super->y.HALF.HI);
dir = sub_080045DA(gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI,
gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI);
tmp = dir - (tmp / 256);
tmp &= 0xFF;
gPlayerEntity.x.WORD += (gSineTable[tmp] - gSineTable[dir]) * tmp2;
gPlayerEntity.y.WORD -= (gSineTable[tmp + 0x40] - gSineTable[dir + 0x40]) * tmp2;
gPlayerEntity.base.x.WORD += (gSineTable[tmp] - gSineTable[dir]) * tmp2;
gPlayerEntity.base.y.WORD -= (gSineTable[tmp + 0x40] - gSineTable[dir + 0x40]) * tmp2;
}
this->unk_7a = this->unk_78;
}
@@ -1081,8 +1082,8 @@ const u16 gUnk_080D1C04[0x20] = { 0, 1, 4, 9, 16, 25, 36, 49, 64, 8
u32 sub_08047F68(GyorgMaleEntity* this) {
s32 diffX, diffY;
s32 distSquared, approx;
diffX = gPlayerEntity.x.HALF.HI - super->x.HALF.HI;
diffY = gPlayerEntity.y.HALF.HI - super->y.HALF.HI;
diffX = gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI;
diffY = gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI;
distSquared = (diffX * diffX) + (diffY * diffY);
if (distSquared == 0x400)
return 0x20;
@@ -1121,15 +1122,15 @@ void sub_08048004(GyorgMaleEntity* this) {
return;
if (super->animIndex == 0) {
COLLISION_OFF(super);
if (gPlayerEntity.z.HALF.HI != 0)
if (gPlayerEntity.base.z.HALF.HI != 0)
return;
if (!PlayerCanBeMoved())
return;
if (this->unk_7c & 1) {
u32 b = super->spriteRendering.b3;
if (b == 3) {
s32 posX = ((gPlayerEntity.x.HALF.HI - gRoomControls.origin_x) >> 3);
s32 posY = ((gPlayerEntity.y.HALF.HI - gRoomControls.origin_y) >> 3);
s32 posX = ((gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x) >> 3);
s32 posY = ((gPlayerEntity.base.y.HALF.HI - gRoomControls.origin_y) >> 3);
u16* tmp = (u16*)&gMapDataBottomSpecial;
if (tmp[(posY << 7) + posX]) {
if (!(this->unk_7c & 2)) {
@@ -1137,8 +1138,8 @@ void sub_08048004(GyorgMaleEntity* this) {
}
if ((this->unk_7c & 0x80))
return;
gPlayerEntity.x.HALF.HI = this->unk_84;
gPlayerEntity.y.HALF.HI = this->unk_86;
gPlayerEntity.base.x.HALF.HI = this->unk_84;
gPlayerEntity.base.y.HALF.HI = this->unk_86;
return;
}
}
@@ -1146,12 +1147,12 @@ void sub_08048004(GyorgMaleEntity* this) {
} else {
u32 b = super->spriteRendering.b3;
if (b != 3) {
if (EntityWithinDistance(&gPlayerEntity, super->x.HALF.HI, super->y.HALF.HI, 0x24)) {
if (EntityWithinDistance(&gPlayerEntity.base, super->x.HALF.HI, super->y.HALF.HI, 0x24)) {
if (!(this->unk_7c & 2)) {
u32 tmp = sub_080045DA(gPlayerEntity.x.HALF.HI - super->x.HALF.HI,
gPlayerEntity.y.HALF.HI - super->y.HALF.HI);
gPlayerEntity.x.WORD = super->x.WORD + (gSineTable[tmp] * 9216);
gPlayerEntity.y.WORD = super->y.WORD - (gSineTable[tmp + 0x40] * 9216);
u32 tmp = sub_080045DA(gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI,
gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI);
gPlayerEntity.base.x.WORD = super->x.WORD + (gSineTable[tmp] * 9216);
gPlayerEntity.base.y.WORD = super->y.WORD - (gSineTable[tmp + 0x40] * 9216);
}
}
}
+1 -1
View File
@@ -83,7 +83,7 @@ void sub_0802BC74(HelmasaurEntity* this) {
sub_0802C1C0(this);
super->subAction = 1;
super->gustJarTolerance = 60;
super->animationState = AnimationStateFlip90(gPlayerEntity.animationState >> 1);
super->animationState = AnimationStateFlip90(gPlayerEntity.base.animationState >> 1);
InitializeAnimation(super, super->animationState);
}
+2 -2
View File
@@ -139,7 +139,7 @@ void Keese_Sleep(KeeseEntity* this) {
if (super->timer != 0) {
super->timer--;
} else {
if (EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70))
if (EntityWithinDistance(super, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI, 0x70))
Keese_StartFly(this);
}
}
@@ -165,7 +165,7 @@ void sub_08021F24(KeeseEntity* this) {
super->timer = gKeeseRestDurations[Random() & 0xF];
InitializeAnimation(super, KeeseAnimation_Rest);
} else if ((this->sleepTimer == 0) &&
!(EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70))) {
!(EntityWithinDistance(super, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI, 0x70))) {
super->action = KEESE_ACTION_SLEEP;
super->timer = 30;
InitializeAnimation(super, KeeseAnimation_Rest);
+4 -4
View File
@@ -250,8 +250,8 @@ void Lakitu_Cloudless(LakituEntity* this) {
}
bool32 sub_0803CA4C(LakituEntity* this) {
if (EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x28) == 0) {
if (EntityInRectRadius(super, &gPlayerEntity, 0x70, 0x50)) {
if (EntityWithinDistance(super, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI, 0x28) == 0) {
if (EntityInRectRadius(super, &gPlayerEntity.base, 0x70, 0x50)) {
return TRUE;
}
}
@@ -260,7 +260,7 @@ bool32 sub_0803CA4C(LakituEntity* this) {
}
void sub_0803CA84(LakituEntity* this, u32 unkParameter) {
u32 altAnimState = GetFacingDirection(super, &gPlayerEntity);
u32 altAnimState = GetFacingDirection(super, &gPlayerEntity.base);
if (((altAnimState - 3) & 7) > 2 || ((super->animationState - (altAnimState >> 3)) & 3) > 1) {
altAnimState = DirectionRoundUp(altAnimState) >> 3;
@@ -304,7 +304,7 @@ void sub_0803CB34(LakituEntity* this) {
super->action = LIGHTNING_THROW;
super->hitType = 0xa6;
this->unk_78 = GetFacingDirection(super, &gPlayerEntity);
this->unk_78 = GetFacingDirection(super, &gPlayerEntity.base);
InitAnimationForceUpdate(super, super->animationState + 8);
}
+1 -1
View File
@@ -68,7 +68,7 @@ void sub_0803CD40(LakituCloudEntity* this) {
ModHealth(-2);
SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6);
SoundReqClipped(&gPlayerEntity.base, SFX_PLY_VO6);
sub_08079D84();
sub_0803CE3C(this);
+12 -12
View File
@@ -53,7 +53,7 @@ void LikeLike_OnCollision(LikeLikeEntity* this) {
super->timer = 95;
super->subtimer = tmp;
super->flags2 &= 0xfc;
this->prevSpritePriority = gPlayerEntity.spritePriority.b1;
this->prevSpritePriority = gPlayerEntity.base.spritePriority.b1;
}
}
}
@@ -198,12 +198,12 @@ void sub_0802805C(LikeLikeEntity* this) {
} else {
ResetActiveItems();
gPlayerState.mobility |= 0x80;
PositionRelative(super, &gPlayerEntity, 0, Q_16_16(1.0));
PositionRelative(super, &gPlayerEntity.base, 0, Q_16_16(1.0));
tmp = GetSpriteSubEntryOffsetDataPointer((u16)super->spriteIndex, super->frameIndex);
gPlayerEntity.spriteOffsetX = tmp[0];
gPlayerEntity.spriteOffsetY = tmp[1];
gPlayerEntity.spritePriority.b1 = 0;
gPlayerEntity.base.spriteOffsetX = tmp[0];
gPlayerEntity.base.spriteOffsetY = tmp[1];
gPlayerEntity.base.spritePriority.b1 = 0;
if (--super->timer == 0) {
sub_080281A0(this);
@@ -225,14 +225,14 @@ void LikeLike_ReleasePlayer(LikeLikeEntity* this) {
gPlayerState.jump_status = 0x41;
gPlayerState.field_0xa = 0;
gPlayerState.flags &= ~PL_CAPTURED;
gPlayerEntity.flags |= ENT_COLLIDE;
gPlayerEntity.zVelocity = Q_16_16(1.5);
gPlayerEntity.iframes = -60;
gPlayerEntity.base.flags |= ENT_COLLIDE;
gPlayerEntity.base.zVelocity = Q_16_16(1.5);
gPlayerEntity.base.iframes = -60;
tmp = 0;
gPlayerEntity.direction = Direction8FromAnimationState(gPlayerEntity.animationState);
gPlayerEntity.spritePriority.b1 = this->prevSpritePriority;
gPlayerEntity.z.HALF.HI = gPlayerEntity.spriteOffsetY;
gPlayerEntity.spriteOffsetY = tmp;
gPlayerEntity.base.direction = Direction8FromAnimationState(gPlayerEntity.base.animationState);
gPlayerEntity.base.spritePriority.b1 = this->prevSpritePriority;
gPlayerEntity.base.z.HALF.HI = gPlayerEntity.base.spriteOffsetY;
gPlayerEntity.base.spriteOffsetY = tmp;
super->action = 4;
super->timer = 80;
super->subtimer = tmp;
+24 -24
View File
@@ -424,7 +424,7 @@ void sub_0803A660(MazaalBraceletEntity* this) {
} else {
super->action = 7;
super->timer = 0;
uVar2 = GetFacingDirection(super, &gPlayerEntity);
uVar2 = GetFacingDirection(super, &gPlayerEntity.base);
super->direction = (u8)uVar2;
super->speed = 0x280;
return;
@@ -615,11 +615,11 @@ void sub_0803AA00(MazaalBraceletEntity* this) {
sub_08004596(super, direction);
}
LinearMoveUpdate(super);
if ((super->direction == direction) || (super->y.HALF.HI >= gPlayerEntity.y.HALF.HI)) {
if ((super->direction == direction) || (super->y.HALF.HI >= gPlayerEntity.base.y.HALF.HI)) {
super->action = 0x13;
super->spriteSettings.draw = 0;
super->direction = direction;
this->unk_80.HWORD = gPlayerEntity.x.HALF.HI;
this->unk_80.HWORD = gPlayerEntity.base.x.HALF.HI;
InitAnimationForceUpdate(super->child, 4);
}
}
@@ -1184,7 +1184,7 @@ void sub_0803B5C0(MazaalBraceletEntity* this) {
u32 direction;
u32 temp;
direction = GetFacingDirection(super, &gPlayerEntity);
direction = GetFacingDirection(super, &gPlayerEntity.base);
if (direction < 10) {
direction = 10;
}
@@ -1202,8 +1202,8 @@ void sub_0803B5C0(MazaalBraceletEntity* this) {
}
u32 sub_0803B610(MazaalBraceletEntity* this) {
return EntityWithinDistance(super, gPlayerEntity.x.HALF.HI + gUnk_080CFD19[super->type],
gPlayerEntity.y.HALF.HI - 0xc, 8);
return EntityWithinDistance(super, gPlayerEntity.base.x.HALF.HI + gUnk_080CFD19[super->type],
gPlayerEntity.base.y.HALF.HI - 0xc, 8);
}
// sub_0803B698 was the tail of super function
@@ -1211,9 +1211,9 @@ void sub_0803B63C(MazaalBraceletEntity* this) {
int y;
int x;
x = gPlayerEntity.x.HALF.HI;
x = gPlayerEntity.base.x.HALF.HI;
x += gUnk_080CFD19[super->type];
y = gPlayerEntity.y.HALF.HI - 0xc;
y = gPlayerEntity.base.y.HALF.HI - 0xc;
if (super->timer++ > 180) {
super->direction = CalculateDirectionTo(super->x.HALF.HI, super->y.HALF.HI, x, y);
} else {
@@ -1270,29 +1270,29 @@ void sub_0803B798(void) {
~(PL_CAPTURED | PL_FLAGS10000 | PL_GYORG_FIGHT | PL_ROLLING | PL_MOLDWORM_CAPTURED | PL_IN_HOLE |
PL_MOLDWORM_RELEASED | PL_CLONING | PL_USE_LANTERN | PL_PARACHUTE | PL_CONVEYOR_PUSHED | PL_ENTER_MINECART |
PL_SWORD_THRUST | PL_USE_OCARINA | PL_CLIMBING | PL_FLAGS40000000 | PL_FLAGS80000000);
gPlayerEntity.flags |= ENT_COLLIDE;
gPlayerEntity.zVelocity = Q_16_16(1.5);
gPlayerEntity.z.HALF.HI = -10;
gPlayerEntity.direction = 0x10;
gPlayerEntity.animationState = 4;
gPlayerEntity.spritePriority.b1 = 1;
gPlayerEntity.spriteOffsetY = 0;
gPlayerEntity.speed = 0x140;
gPlayerEntity.iframes = -0x1e;
gPlayerEntity.base.flags |= ENT_COLLIDE;
gPlayerEntity.base.zVelocity = Q_16_16(1.5);
gPlayerEntity.base.z.HALF.HI = -10;
gPlayerEntity.base.direction = 0x10;
gPlayerEntity.base.animationState = 4;
gPlayerEntity.base.spritePriority.b1 = 1;
gPlayerEntity.base.spriteOffsetY = 0;
gPlayerEntity.base.speed = 0x140;
gPlayerEntity.base.iframes = -0x1e;
}
void sub_0803B804(MazaalBraceletEntity* this) {
gPlayerEntity.iframes = 30;
gPlayerEntity.base.iframes = 30;
ModHealth(-4);
SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6);
SoundReqClipped(&gPlayerEntity.base, SFX_PLY_VO6);
}
void sub_0803B824(MazaalBraceletEntity* this) {
ResetActiveItems();
gPlayerState.mobility |= 0x80;
sub_0806FA90(super, &gPlayerEntity, gUnk_080CFD1D[super->type], 1);
gPlayerEntity.spriteOffsetY = -6;
gPlayerEntity.spritePriority.b1 = 0;
sub_0806FA90(super, &gPlayerEntity.base, gUnk_080CFD1D[super->type], 1);
gPlayerEntity.base.spriteOffsetY = -6;
gPlayerEntity.base.spritePriority.b1 = 0;
}
u32 sub_0803B870(MazaalBraceletEntity* this) {
@@ -1303,8 +1303,8 @@ u32 sub_0803B870(MazaalBraceletEntity* this) {
super->action = 0x18;
super->timer = 68;
super->spriteSettings.draw = 0;
gPlayerEntity.flags &= ~ENT_COLLIDE;
gPlayerEntity.iframes = -0x10;
gPlayerEntity.base.flags &= ~ENT_COLLIDE;
gPlayerEntity.base.iframes = -0x10;
sub_0803B824(this);
entity->hitType = 0x13;
InitAnimationForceUpdate(entity, 7);
+4 -4
View File
@@ -246,7 +246,7 @@ void sub_08033FFC(MazaalHeadEntity* this) {
break;
default:
if (((this->unk_74)->base.flags & ENT_COLLIDE) != 0) {
gRoomControls.camera_target = &gPlayerEntity;
gRoomControls.camera_target = &gPlayerEntity.base;
sub_08034420(this);
gPlayerState.controlMode = CONTROL_1;
ResetPlayerAnimationAndAction();
@@ -567,12 +567,12 @@ void sub_0803473C(MazaalHeadEntity* this) {
if (0x28 < (this->unk_74)->base.action) {
return;
}
playerX = gPlayerEntity.x.HALF.HI - 0x60;
playerX = gPlayerEntity.base.x.HALF.HI - 0x60;
} else {
if (0x28 < (this->unk_78)->base.action) {
return;
}
playerX = gPlayerEntity.x.HALF.HI + 0x60;
playerX = gPlayerEntity.base.x.HALF.HI + 0x60;
}
roomX = gRoomControls.origin_x;
if (playerX - 4 > super->x.HALF.HI) {
@@ -593,7 +593,7 @@ void sub_0803473C(MazaalHeadEntity* this) {
}
void sub_080347B4(MazaalHeadEntity* this) {
u32 playerX = gPlayerEntity.x.HALF.HI;
u32 playerX = gPlayerEntity.base.x.HALF.HI;
u32 roomX = gRoomControls.origin_x;
if (playerX - 4 > super->x.HALF.HI) {
if (roomX + 0xe0 < super->x.HALF.HI) {
+20 -20
View File
@@ -111,12 +111,12 @@ void Moldworm_OnCollision(MoldwormEntity* this) {
}
if (super->health == 0 && this->unk_7f == 0 && super->action == 7) {
CopyPosition(super, &gPlayerEntity);
gPlayerEntity.flags |= ENT_COLLIDE;
gPlayerEntity.spriteSettings.draw = 1;
gPlayerEntity.zVelocity = Q_16_16(1.5);
gPlayerEntity.direction = 0xff;
gPlayerEntity.iframes = -0x14;
CopyPosition(super, &gPlayerEntity.base);
gPlayerEntity.base.flags |= ENT_COLLIDE;
gPlayerEntity.base.spriteSettings.draw = 1;
gPlayerEntity.base.zVelocity = Q_16_16(1.5);
gPlayerEntity.base.direction = 0xff;
gPlayerEntity.base.iframes = -0x14;
gPlayerState.jump_status = 0x41;
gPlayerState.flags &= ~PL_MOLDWORM_CAPTURED;
}
@@ -183,9 +183,9 @@ void sub_08023288(MoldwormEntity* this) {
u32 i;
for (i = 0; i < 0x10; i++) {
u32 x = gPlayerEntity.x.HALF.HI + gUnk_080CBC70[idx + 0];
u32 y = gPlayerEntity.y.HALF.HI + gUnk_080CBC70[idx + 1];
if (sub_08023A38(GetTileTypeByPos(x, y, gPlayerEntity.collisionLayer))) {
u32 x = gPlayerEntity.base.x.HALF.HI + gUnk_080CBC70[idx + 0];
u32 y = gPlayerEntity.base.y.HALF.HI + gUnk_080CBC70[idx + 1];
if (sub_08023A38(GetTileTypeByPos(x, y, gPlayerEntity.base.collisionLayer))) {
sub_08023990(this, x, y);
return;
}
@@ -282,7 +282,7 @@ void sub_080234D8(MoldwormEntity* this) {
}
void sub_0802351C(MoldwormEntity* this) {
if ((super->timer != 0) && ((super->type2 == 1) || (gPlayerEntity.frameIndex == 0xff))) {
if ((super->timer != 0) && ((super->type2 == 1) || (gPlayerEntity.base.frameIndex == 0xff))) {
super->timer = 0;
super->child->action = 3;
super->child->subtimer = this->unk_80;
@@ -292,10 +292,10 @@ void sub_0802351C(MoldwormEntity* this) {
if (this->unk_7f == 0) {
if (super->type2 == 0) {
gPlayerEntity.animationState = super->animationState & 7;
gPlayerEntity.base.animationState = super->animationState & 7;
gPlayerState.flags |= PL_MOLDWORM_CAPTURED;
PositionRelative(super, &gPlayerEntity, 0, Q_16_16(gUnk_080CBC90[super->animationState & 7]));
gPlayerEntity.spriteOffsetY = -gUnk_080CBC90[super->animationState & 7];
PositionRelative(super, &gPlayerEntity.base, 0, Q_16_16(gUnk_080CBC90[super->animationState & 7]));
gPlayerEntity.base.spriteOffsetY = -gUnk_080CBC90[super->animationState & 7];
}
} else {
super->action = 4;
@@ -429,13 +429,13 @@ void sub_08023894(MoldwormEntity* this) {
InitializeAnimation(super, super->animationState);
if (super->parent->type2 == 0) {
gPlayerState.flags |= PL_MOLDWORM_RELEASED;
gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
gPlayerEntity.y.HALF.HI = super->y.HALF.HI;
gPlayerEntity.direction = DirectionRoundUp(GetFacingDirection(this->unk_74, super));
gPlayerEntity.animationState = gPlayerEntity.direction >> 2;
gPlayerEntity.iframes = 12;
gPlayerEntity.base.x.HALF.HI = super->x.HALF.HI;
gPlayerEntity.base.y.HALF.HI = super->y.HALF.HI;
gPlayerEntity.base.direction = DirectionRoundUp(GetFacingDirection(this->unk_74, super));
gPlayerEntity.base.animationState = gPlayerEntity.base.direction >> 2;
gPlayerEntity.base.iframes = 12;
ModHealth(-0x10);
SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6);
SoundReqClipped(&gPlayerEntity.base, SFX_PLY_VO6);
}
}
}
@@ -482,7 +482,7 @@ void sub_08023990(MoldwormEntity* this, u32 param_2, u32 param_3) {
super->spritePriority.b0 = 7;
super->x.HALF.HI = param_2;
super->y.HALF.HI = param_3;
super->collisionLayer = gPlayerEntity.collisionLayer;
super->collisionLayer = gPlayerEntity.base.collisionLayer;
UpdateSpriteForCollisionLayer(super);
InitializeAnimation(super, 0x16);
+32 -31
View File
@@ -228,7 +228,7 @@ void OctorokBoss_Hit_SubAction2(OctorokBossEntity* this) {
} else {
super->subAction = 3;
this->timer = 150;
gRoomControls.camera_target = &gPlayerEntity;
gRoomControls.camera_target = &gPlayerEntity.base;
}
}
@@ -389,9 +389,9 @@ void OctorokBoss_Init(OctorokBossEntity* this) {
super->action = INTRO;
super->subAction = 0;
this->timer = 0x3c;
gPlayerEntity.spriteSettings.draw = 0;
gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
gPlayerEntity.y.HALF.HI = super->y.HALF.HI - 0xa0;
gPlayerEntity.base.spriteSettings.draw = 0;
gPlayerEntity.base.x.HALF.HI = super->x.HALF.HI;
gPlayerEntity.base.y.HALF.HI = super->y.HALF.HI - 0xa0;
gRoomControls.camera_target = super;
break;
case LEG_BR:
@@ -476,8 +476,8 @@ void OctorokBoss_Intro_SubAction2(OctorokBossEntity* this) {
if (this->timer-- == 0) {
super->subAction = 3;
this->timer = 60;
gPlayerEntity.spriteSettings.draw |= 1;
gRoomControls.camera_target = &gPlayerEntity;
gPlayerEntity.base.spriteSettings.draw |= 1;
gRoomControls.camera_target = &gPlayerEntity.base;
gRoomControls.scrollSpeed = 1;
}
}
@@ -486,8 +486,8 @@ void OctorokBoss_Intro_SubAction3(OctorokBossEntity* this) {
// Move the camera to the player
if (this->timer-- == 0) {
// Move the player inside the arena
gPlayerEntity.direction = 0x10;
gPlayerEntity.animationState = 4;
gPlayerEntity.base.direction = 0x10;
gPlayerEntity.base.animationState = 4;
sub_08078AC0(0x1e, 0, 0);
this->timer = 60;
super->subAction = 4;
@@ -499,22 +499,22 @@ void OctorokBoss_Intro_SubAction4(OctorokBossEntity* this) {
super->subAction = 5;
this->timer = 45;
// Make the player look towards the exit
gPlayerEntity.animationState = 0;
gPlayerEntity.base.animationState = 0;
} else {
// Spawn exclamation bubble at a certain time
if (this->timer == 0x1e) {
CreateSpeechBubbleExclamationMark(&gPlayerEntity, 0xc, -0x18);
CreateSpeechBubbleExclamationMark(&gPlayerEntity.base, 0xc, -0x18);
}
}
}
void OctorokBoss_Intro_SubAction5(OctorokBossEntity* this) {
if (gPlayerEntity.animationState == 4) {
if (gPlayerEntity.base.animationState == 4) {
if (this->timer++ > 0x1e) {
// Play boss theme, enable control and switch to main action
super->action = ACTION1;
super->subAction = 0;
gRoomControls.scrollSpeed = gPlayerEntity.animationState;
gRoomControls.scrollSpeed = gPlayerEntity.base.animationState;
OctorokBoss_SetAttackTimer(this);
gPauseMenuOptions.disabled = 0;
SoundReq(BGM_BOSS_THEME);
@@ -522,7 +522,7 @@ void OctorokBoss_Intro_SubAction5(OctorokBossEntity* this) {
} else {
if (this->timer-- == 0) {
// Player looks back towards Octorok
gPlayerEntity.animationState = 4;
gPlayerEntity.base.animationState = 4;
}
}
}
@@ -689,7 +689,7 @@ void OctorokBoss_Action1_AimTowardsPlayer(OctorokBossEntity* this) {
s32 tmp1;
s32 tmp2;
tmp1 = (u8)(sub_080045DA(gPlayerEntity.x.WORD - super->x.WORD, gPlayerEntity.y.WORD - super->y.WORD) -
tmp1 = (u8)(sub_080045DA(gPlayerEntity.base.x.WORD - super->x.WORD, gPlayerEntity.base.y.WORD - super->y.WORD) -
(((u8)(-this->angle.HALF.HI) ^ 0x80)));
if (IS_FROZEN(this) == FALSE) {
tmp2 = 8;
@@ -792,13 +792,13 @@ void OctorokBoss_Action1_Attack(OctorokBossEntity* this) {
sub_08036FE4(this);
if (this->unk_80 != 0) {
gPlayerEntity.spriteSettings.draw = 0;
gPlayerEntity.flags &= ~ENT_COLLIDE;
gPlayerEntity.collisionLayer = 2;
gPlayerEntity.base.spriteSettings.draw = 0;
gPlayerEntity.base.flags &= ~ENT_COLLIDE;
gPlayerEntity.base.collisionLayer = 2;
PausePlayer();
PutAwayItems();
gPlayerEntity.parent = super;
sub_08036914(&gPlayerEntity, (u8) - (this->angle.HALF.HI + 0x80), 0x3800);
gPlayerEntity.base.parent = super;
sub_08036914(&gPlayerEntity.base, (u8) - (this->angle.HALF.HI + 0x80), 0x3800);
}
}
@@ -897,17 +897,18 @@ void OctorokBoss_ExecuteAttackVacuum(OctorokBossEntity* this) {
s32 tmp;
if (this->unk_80 == 0) {
super->direction = sub_080045DA(gPlayerEntity.x.WORD - super->x.WORD, gPlayerEntity.y.WORD - super->y.WORD);
super->direction =
sub_080045DA(gPlayerEntity.base.x.WORD - super->x.WORD, gPlayerEntity.base.y.WORD - super->y.WORD);
tmp = ((u8) - (this->angle.HALF.HI + 0x80)) - super->direction;
if (tmp < 0) {
tmp = -tmp;
}
if (tmp < 0x10) {
if (sub_0806FC80(super, &gPlayerEntity, 0xf0) != 0) {
if (sub_0806FC80(super, &gPlayerEntity.base, 0xf0) != 0) {
if ((gPlayerState.flags & PL_FROZEN) == 0) {
if ((gPlayerEntity.flags & PL_MINISH) != 0) {
LinearMoveAngle(&gPlayerEntity, 0x280, -this->angle.HALF.HI);
if (sub_0806FC80(super, &gPlayerEntity, 0x48) != 0) {
if ((gPlayerEntity.base.flags & PL_MINISH) != 0) {
LinearMoveAngle(&gPlayerEntity.base, 0x280, -this->angle.HALF.HI);
if (sub_0806FC80(super, &gPlayerEntity.base, 0x48) != 0) {
this->unk_80 = 1;
this->timer = 2;
this->heap->targetAngle =
@@ -938,9 +939,9 @@ void OctorokBoss_ExecuteAttackVacuum(OctorokBossEntity* this) {
this->unk_80 = 0;
this->angularSpeed.HWORD = 0x100;
this->heap->mouthObject->timer++;
gPlayerEntity.spriteSettings.draw = 1;
gPlayerEntity.flags &= ~ENT_COLLIDE;
gPlayerEntity.collisionLayer = 1;
gPlayerEntity.base.spriteSettings.draw = 1;
gPlayerEntity.base.flags &= ~ENT_COLLIDE;
gPlayerEntity.base.collisionLayer = 1;
sub_080792BC(0x400, (u32)(-(this->angle.HALF.HI + 0x80) * 0x1000000) >> 0x1b, 0x30);
OctorokBoss_SetAttackTimer(this);
SoundReq(SFX_EF);
@@ -955,7 +956,7 @@ void OctorokBoss_ExecuteAttackVacuum(OctorokBossEntity* this) {
} else {
this->timer--;
if ((gPlayerState.flags == PL_FROZEN) && (this->timer == 0x3c)) {
tmp = sub_080045DA(gPlayerEntity.x.WORD - super->x.WORD, gPlayerEntity.y.WORD - super->y.WORD);
tmp = sub_080045DA(gPlayerEntity.base.x.WORD - super->x.WORD, gPlayerEntity.base.y.WORD - super->y.WORD);
if ((u8)((tmp - ((u8) - this->angle.HALF.HI ^ 0x80))) > 0x80) {
this->heap->targetAngle = this->angle.HALF.HI + 0x30;
} else {
@@ -1083,9 +1084,9 @@ void OctorokBoss_Burning_SubAction2(OctorokBossEntity* this) {
void sub_080368D8(OctorokBossEntity* this) {
if (this->unk_80 != 0) {
gPlayerEntity.spriteSettings.draw = 1;
gPlayerEntity.flags |= ENT_COLLIDE;
gPlayerEntity.collisionLayer = 1;
gPlayerEntity.base.spriteSettings.draw = 1;
gPlayerEntity.base.flags |= ENT_COLLIDE;
gPlayerEntity.base.collisionLayer = 1;
}
this->unk_76 = 0xa0;
this->unk_74 = 0xa0;
+3 -3
View File
@@ -102,7 +102,7 @@ static void sub_08037D54(Entity* this) {
this->animationState |= 0xff;
sub_08037E14(this);
} else {
u32 dir = GetFacingDirection(this, &gPlayerEntity);
u32 dir = GetFacingDirection(this, &gPlayerEntity.base);
this->direction = (dir + 4) & 0x18;
this->animationState = this->direction >> 3;
InitializeAnimation(this, this->animationState + 4);
@@ -116,7 +116,7 @@ void sub_08037E14(Entity* this) {
const s8* ptr;
s32 x, y;
this->timer = 8;
dir = (GetFacingDirection(this, &gPlayerEntity) + 4) & 0x18;
dir = (GetFacingDirection(this, &gPlayerEntity.base) + 4) & 0x18;
layer = (u8*)GetLayerByIndex(this->collisionLayer)->collisionData;
ptr = gUnk_080CF498 + (dir >> 2);
x = this->x.HALF.HI + *ptr;
@@ -135,7 +135,7 @@ void sub_08037E14(Entity* this) {
}
bool32 sub_08037E90(Entity* this) {
u32 dir = sub_0804A044(this, &gPlayerEntity, 8);
u32 dir = sub_0804A044(this, &gPlayerEntity.base, 8);
if (dir != 0xff) {
this->action = 2;
this->timer = 3;
+15 -15
View File
@@ -126,7 +126,7 @@ void sub_08024060(PestoEntity* this) {
if (super->hitType != 0x6e) {
COLLISION_OFF(super);
super->hitType = 0x6e;
super->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
super->spriteRendering.b3 = gPlayerEntity.base.spriteRendering.b3;
}
GetNextFrame(super);
@@ -199,7 +199,7 @@ void sub_080241C0(PestoEntity* this) {
switch (this->unk_80) {
case 0:
if (PlayerInRange(super, 3, (gPlayerState.hurtBlinkSpeed != 0) ? 0xa0 : 0x40) && sub_08049FDC(super, 3) &&
gPlayerEntity.action != PLAYER_USEENTRANCE) {
gPlayerEntity.base.action != PLAYER_USEENTRANCE) {
this->unk_80++;
super->speed = 0;
sub_08024A14(this, 3, 10);
@@ -408,8 +408,8 @@ void sub_080244E8(PestoEntity* this) {
this->unk_84 = 0;
super->flags2 &= 0xfc;
sub_080249DC(this);
this->unk_85 = gPlayerEntity.spritePriority.b1;
gPlayerEntity.flags &= ~ENT_COLLIDE;
this->unk_85 = gPlayerEntity.base.spritePriority.b1;
gPlayerEntity.base.flags &= ~ENT_COLLIDE;
gPlayerState.flags |= PL_DISABLE_ITEMS;
gPlayerState.field_0xa |= 0x80;
if (gPlayerState.swim_state != 0) {
@@ -526,7 +526,7 @@ void sub_080244E8(PestoEntity* this) {
}
break;
case 7:
if (gPlayerEntity.z.HALF.HI == 0) {
if (gPlayerEntity.base.z.HALF.HI == 0) {
this->unk_80 = 0;
super->speed = 0x80;
sub_08024B38(this);
@@ -843,7 +843,7 @@ void sub_08024E4C(PestoEntity* this) {
super->subtimer = 8;
sub_08024A14(this, 0, 8);
} else {
Entity* player = &gPlayerEntity;
Entity* player = &gPlayerEntity.base;
ResetActiveItems();
gPlayerState.flags |= PL_DISABLE_ITEMS;
gPlayerState.field_0xa |= 0x80;
@@ -868,15 +868,15 @@ void sub_08024E4C(PestoEntity* this) {
void sub_08024F50(PestoEntity* this) {
gPlayerState.field_0xa = 0;
gPlayerState.flags &= ~PL_DISABLE_ITEMS;
CopyPosition(super, &gPlayerEntity);
gPlayerEntity.action = PLAYER_NORMAL;
COLLISION_ON(&gPlayerEntity);
gPlayerEntity.iframes = -0x3c;
gPlayerEntity.direction = gPlayerEntity.animationState << 2;
gPlayerEntity.speed = 0;
gPlayerEntity.spritePriority.b1 = this->unk_85;
gPlayerEntity.z.HALF.HI = gPlayerEntity.spriteOffsetY;
gPlayerEntity.spriteOffsetY = 0;
CopyPosition(super, &gPlayerEntity.base);
gPlayerEntity.base.action = PLAYER_NORMAL;
COLLISION_ON(&gPlayerEntity.base);
gPlayerEntity.base.iframes = -0x3c;
gPlayerEntity.base.direction = gPlayerEntity.base.animationState << 2;
gPlayerEntity.base.speed = 0;
gPlayerEntity.base.spritePriority.b1 = this->unk_85;
gPlayerEntity.base.z.HALF.HI = gPlayerEntity.base.spriteOffsetY;
gPlayerEntity.base.spriteOffsetY = 0;
super->flags2 |= 3;
this->unk_83 = 0xc0;
this->unk_80 += 2;
+3 -3
View File
@@ -152,17 +152,17 @@ void sub_08020874(RollobiteEntity* this) {
void sub_0802088C(RollobiteEntity* this) {
super->subAction = 1;
COLLISION_OFF(super);
this->unk_85 = gPlayerEntity.animationState;
this->unk_85 = gPlayerEntity.base.animationState;
super->spritePriority.b1 = 0;
}
void sub_080208B4(RollobiteEntity* this) {
s8 uVar1 = (this->unk_85 - gPlayerEntity.animationState) / 2;
s8 uVar1 = (this->unk_85 - gPlayerEntity.base.animationState) / 2;
if (uVar1) {
super->animationState = (super->animationState + uVar1) & 3;
InitializeAnimation(super, super->animationState + 0x10);
}
this->unk_85 = gPlayerEntity.animationState;
this->unk_85 = gPlayerEntity.base.animationState;
}
void sub_080208F0(RollobiteEntity* this) {
+4 -4
View File
@@ -86,8 +86,8 @@ void sub_0803827C(RopeGoldenEntity* this) {
if (super->subtimer != 0) {
super->subtimer--;
} else {
if ((sub_0804A044(super, &gPlayerEntity, 0x8) != 0xff) ||
(EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x24) != 0)) {
if ((sub_0804A044(super, &gPlayerEntity.base, 0x8) != 0xff) ||
(EntityWithinDistance(super, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI, 0x24) != 0)) {
sub_080383E4(this);
return;
}
@@ -157,7 +157,7 @@ void sub_080383AC(RopeGoldenEntity* this) {
super->action = 1;
super->timer = 8;
super->speed = 0x100;
super->direction = DirectionRoundUp(GetFacingDirection(super, &gPlayerEntity));
super->direction = DirectionRoundUp(GetFacingDirection(super, &gPlayerEntity.base));
v = super->direction >> 3;
if (v != super->animationState) {
super->animationState = v;
@@ -170,7 +170,7 @@ void sub_080383E4(RopeGoldenEntity* this) {
super->action = 2;
super->timer = 8;
super->speed = 0x280;
v = DirectionRoundUp(GetFacingDirection(super, &gPlayerEntity));
v = DirectionRoundUp(GetFacingDirection(super, &gPlayerEntity.base));
super->direction = v;
this->unk_78 = v;
super->animationState = super->direction >> 3;
+15 -15
View File
@@ -76,7 +76,7 @@ void RupeeLike_OnCollision(RupeeLikeEntity* this) {
super->subtimer = 0;
this->unk_83 = 0x41;
super->flags2 &= 0xfc;
this->unk_80 = gPlayerEntity.spritePriority.b1;
this->unk_80 = gPlayerEntity.base.spritePriority.b1;
EnqueueSFX(SFX_PLACE_OBJ);
} else {
if (super->confusedTime != 0) {
@@ -131,7 +131,7 @@ void sub_08029474(RupeeLikeEntity* this) {
if (super->frame & ANIM_DONE) {
super->action = 3;
super->timer = 8;
bVar1 = GetFacingDirection(super, &gPlayerEntity);
bVar1 = GetFacingDirection(super, &gPlayerEntity.base);
super->direction = bVar1;
super->animationState = (bVar1 << 0x18) >> 0x1c;
InitializeAnimation(super, super->animationState);
@@ -148,7 +148,7 @@ void sub_080294D4(RupeeLikeEntity* this) {
if (sub_08049FDC(super, 1) != 0) {
if (--super->timer == 0) {
super->timer = 8;
sub_08004596(super, GetFacingDirection(super, &gPlayerEntity));
sub_08004596(super, GetFacingDirection(super, &gPlayerEntity.base));
sub_0802969C(this);
}
ProcessMovement0(super);
@@ -177,11 +177,11 @@ void sub_0802953C(RupeeLikeEntity* this) {
} else {
ResetActiveItems();
gPlayerState.mobility |= 0x80;
PositionRelative(super, &gPlayerEntity, 0, Q_16_16(1.0));
PositionRelative(super, &gPlayerEntity.base, 0, Q_16_16(1.0));
pbVar3 = GetSpriteSubEntryOffsetDataPointer((u16)super->spriteIndex, super->frameIndex);
gPlayerEntity.spriteOffsetX = pbVar3[0];
gPlayerEntity.spriteOffsetY = pbVar3[1] - 1;
gPlayerEntity.spritePriority.b1 = 0;
gPlayerEntity.base.spriteOffsetX = pbVar3[0];
gPlayerEntity.base.spriteOffsetY = pbVar3[1] - 1;
gPlayerEntity.base.spritePriority.b1 = 0;
if (--this->unk_83 == 0) {
this->unk_83 = 0x41;
if (gSave.stats.rupees != 0) {
@@ -245,14 +245,14 @@ void sub_080296C8(RupeeLikeEntity* this) {
void sub_080296D8(RupeeLikeEntity* this) {
gPlayerState.jump_status = 0x41;
gPlayerState.flags &= ~PL_CAPTURED;
gPlayerEntity.flags |= ENT_COLLIDE;
gPlayerEntity.zVelocity = Q_16_16(1.5);
gPlayerEntity.iframes = 0xa6;
gPlayerEntity.z.HALF.HI = -2;
gPlayerEntity.direction = gPlayerEntity.animationState << 2;
gPlayerEntity.spritePriority.b1 = this->unk_80;
gPlayerEntity.spriteOffsetY = 0;
gPlayerEntity.speed = 0x140;
gPlayerEntity.base.flags |= ENT_COLLIDE;
gPlayerEntity.base.zVelocity = Q_16_16(1.5);
gPlayerEntity.base.iframes = 0xa6;
gPlayerEntity.base.z.HALF.HI = -2;
gPlayerEntity.base.direction = gPlayerEntity.base.animationState << 2;
gPlayerEntity.base.spritePriority.b1 = this->unk_80;
gPlayerEntity.base.spriteOffsetY = 0;
gPlayerEntity.base.speed = 0x140;
super->action = 5;
super->subtimer = 60;
super->flags2 |= 3;
+4 -4
View File
@@ -134,19 +134,19 @@ void sub_08033958(SpinyBeetleEntity* this) {
case 0:
if (this->unk_78 == 0)
return;
if (super->y.HALF.HI - gPlayerEntity.y.HALF.HI > 0x30)
if (super->y.HALF.HI - gPlayerEntity.base.y.HALF.HI > 0x30)
return;
break;
case 0x10:
if (gPlayerEntity.y.HALF.HI - super->y.HALF.HI > 0x30)
if (gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI > 0x30)
return;
break;
case 8:
if (gPlayerEntity.x.HALF.HI - super->x.HALF.HI > 0x30)
if (gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI > 0x30)
return;
break;
case 0x18:
if (super->x.HALF.HI - gPlayerEntity.x.HALF.HI > 0x30)
if (super->x.HALF.HI - gPlayerEntity.base.x.HALF.HI > 0x30)
return;
break;
}
+2 -2
View File
@@ -170,7 +170,7 @@ void Stalfos_Init(StalfosEntity* this) {
} else {
super->action = 4;
super->direction = 0xff;
super->animationState = (((GetFacingDirection(super, &gPlayerEntity) + 4) & 0x18) >> 3);
super->animationState = (((GetFacingDirection(super, &gPlayerEntity.base) + 4) & 0x18) >> 3);
sub_0803981C(this);
}
}
@@ -347,7 +347,7 @@ u32 sub_080398C0(StalfosEntity* this) {
u32 rand = Random();
if ((super->type == 0) && sub_08049FDC(super, 1) &&
(EntityWithinDistance(super, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI, 0x58) != 0)) {
return GetFacingDirection(super, &gPlayerEntity);
return GetFacingDirection(super, &gPlayerEntity.base);
} else {
if ((sub_08049FA0(super) == 0) && ((rand & 7) != 0)) {
return sub_08049EE4(super);
+5 -6
View File
@@ -1,13 +1,12 @@
#define ENT_DEPRECATED
#include "entity.h"
void sub_080451CC(Entity* this, Entity* other) {
void sub_080451CC(GenericEntity* this, GenericEntity* other) {
u8* pThis;
u8* pOther;
other->flags = this->flags & ~ENT_DID_INIT;
other->x.WORD = this->x.WORD;
other->y.WORD = this->y.WORD;
other->z.WORD = this->z.WORD;
other->base.flags = this->base.flags & ~ENT_DID_INIT;
other->base.x.WORD = this->base.x.WORD;
other->base.y.WORD = this->base.y.WORD;
other->base.z.WORD = this->base.z.WORD;
pThis = (u8*)&this->field_0x68;
pOther = (u8*)&other->field_0x68;
+4 -4
View File
@@ -83,11 +83,11 @@ static bool32 ShouldSpawnTreeItem(TreeItemEntity* this) {
s32 expectedStateX, expectedStateY;
s32 playerState;
if (gPlayerEntity.action != PLAYER_BOUNCE) {
if (gPlayerEntity.base.action != PLAYER_BOUNCE) {
return FALSE;
}
diff = gPlayerEntity.x.HALF.HI - super->x.HALF.HI;
diff = gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI;
expectedStateX = 6;
if (diff & 0x8000) {
expectedStateX = 2;
@@ -98,7 +98,7 @@ static bool32 ShouldSpawnTreeItem(TreeItemEntity* this) {
return FALSE;
}
diff = gPlayerEntity.y.HALF.HI - super->y.HALF.HI;
diff = gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI;
expectedStateY = 0;
if (diff & 0x8000) {
expectedStateY = 4;
@@ -109,7 +109,7 @@ static bool32 ShouldSpawnTreeItem(TreeItemEntity* this) {
return FALSE;
}
playerState = gPlayerEntity.animationState;
playerState = gPlayerEntity.base.animationState;
if ((playerState == 0 && expectedStateY == 0) || (playerState == 4 && expectedStateY == 4) ||
(playerState == 6 && expectedStateX == 6) || (playerState == 2 && expectedStateX == 2)) {
return TRUE;
+3 -3
View File
@@ -555,8 +555,8 @@ static void sub_08042C34(VaatiArmEntity* this) {
super->subAction = 1;
random = Random() & 6;
temp = &gUnk_080D12F8[random];
x = gPlayerEntity.x.HALF.HI + *temp;
y = gPlayerEntity.y.HALF.HI + *(temp + 1);
x = gPlayerEntity.base.x.HALF.HI + *temp;
y = gPlayerEntity.base.y.HALF.HI + *(temp + 1);
if ((gRoomControls.origin_x + 0x20) > x) {
x = gRoomControls.origin_x + 0x20;
}
@@ -693,7 +693,7 @@ static void sub_08042EF4(VaatiArmEntity* this) {
UpdateAnimationSingleFrame(super);
if (!sub_08043C98(this)) {
if (--super->timer == 0) {
if (EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x50)) {
if (EntityWithinDistance(super, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI, 0x50)) {
super->subAction = 6;
super->timer = 40;
} else {
+2 -2
View File
@@ -183,7 +183,7 @@ void VaatiEyesMacroFunction0Type2(VaatiEyesMacroEntity* this) {
super->animationState = 0xff;
}
CopyPositionAndSpriteOffset(super->parent, super);
uVar2 = (GetFacingDirection(super, &gPlayerEntity) + 1) & 0x1e;
uVar2 = (GetFacingDirection(super, &gPlayerEntity.base) + 1) & 0x1e;
temp = (xy*)&gUnk_080CDE70[uVar2];
if (temp->x != super->frameIndex) {
if (temp->y != super->frameIndex) {
@@ -237,7 +237,7 @@ void sub_0802EFB8(VaatiEyesMacroEntity* this) {
if ((rand >> 0x10 & 3) != 0) {
uVar1 = rand & 0x18;
} else {
uVar3 = GetFacingDirection(&gPlayerEntity, super);
uVar3 = GetFacingDirection(&gPlayerEntity.base, super);
uVar1 = (uVar3 + 4) & 0x18;
}
iVar4 = sub_080B1B44(TILE(super->x.HALF.HI, super->y.HALF.HI) + gUnk_080B4488[((uVar1) >> 3)], 1);
+11 -11
View File
@@ -73,9 +73,9 @@ void VaatiProjectile_OnCollision(VaatiProjectileEntity* this) {
super->action = 5;
COLLISION_OFF(super);
super->spritePriority.b1 = 0;
gPlayerEntity.flags &= ~ENT_COLLIDE;
gPlayerEntity.spriteOrientation.flipY = super->spriteOrientation.flipY;
gPlayerEntity.spriteRendering.b3 = super->spriteRendering.b3;
gPlayerEntity.base.flags &= ~ENT_COLLIDE;
gPlayerEntity.base.spriteOrientation.flipY = super->spriteOrientation.flipY;
gPlayerEntity.base.spriteRendering.b3 = super->spriteRendering.b3;
sub_0803E444(this);
#ifndef EU
SetPlayerControl(2);
@@ -85,8 +85,8 @@ void VaatiProjectile_OnCollision(VaatiProjectileEntity* this) {
}
} else {
gPlayerState.flags &= ~PL_DISABLE_ITEMS;
entity = &gPlayerEntity;
entity->flags = gPlayerEntity.flags | ENT_COLLIDE;
entity = &gPlayerEntity.base;
entity->flags = gPlayerEntity.base.flags | ENT_COLLIDE;
}
#endif
}
@@ -174,7 +174,7 @@ void VaatiProjectileFunction0Action3(VaatiProjectileEntity* this) {
void VaatiProjectileFunction0Action4(VaatiProjectileEntity* this) {
if (--super->timer == 0) {
super->action = 1;
super->direction = GetFacingDirection(super, &gPlayerEntity);
super->direction = GetFacingDirection(super, &gPlayerEntity.base);
}
GetNextFrame(super);
}
@@ -221,8 +221,8 @@ void VaatiProjectileFunction0Action8(VaatiProjectileEntity* this) {
}
void VaatiProjectileFunction0Action9(VaatiProjectileEntity* this) {
super->x.HALF.HI = gPlayerEntity.x.HALF.HI;
super->y.HALF.HI = gPlayerEntity.y.HALF.HI;
super->x.HALF.HI = gPlayerEntity.base.x.HALF.HI;
super->y.HALF.HI = gPlayerEntity.base.y.HALF.HI;
if (super->z.HALF.HI < -8) {
if (super->animIndex != 2) {
super->timer = 0;
@@ -239,7 +239,7 @@ void sub_0803E444(VaatiProjectileEntity* this) {
gPlayerState.mobility |= 0x80;
gPlayerState.field_0xa |= 0x80;
sub_0806FA90(super, super->contactedEntity, 0, -2);
gPlayerEntity.spriteOffsetY += 0xe;
gPlayerEntity.base.spriteOffsetY += 0xe;
}
void sub_0803E480(VaatiProjectileEntity* this) {
@@ -284,7 +284,7 @@ void sub_0803E4D8(VaatiProjectileEntity* this) {
u32 tile;
tile = TILE(super->x.HALF.HI, super->y.HALF.HI + 8);
if (sub_080B1B44(tile, gPlayerEntity.collisionLayer) != 0xff) {
SetTile(0x4074, tile, gPlayerEntity.collisionLayer);
if (sub_080B1B44(tile, gPlayerEntity.base.collisionLayer) != 0xff) {
SetTile(0x4074, tile, gPlayerEntity.base.collisionLayer);
}
}
+7 -7
View File
@@ -281,8 +281,8 @@ void VaatiRebornEnemyType0Action2(VaatiRebornEnemyEntity* this) {
if ((super->frame & ANIM_DONE) != 0) {
super->spriteSettings.draw = 1;
if (4 < this->unk_81) {
super->x.HALF.HI = gPlayerEntity.x.HALF.HI;
super->y.HALF.HI = gPlayerEntity.y.HALF.HI - 0x18;
super->x.HALF.HI = gPlayerEntity.base.x.HALF.HI;
super->y.HALF.HI = gPlayerEntity.base.y.HALF.HI - 0x18;
}
if (--this->unk_77 == 0) {
super->action = 1;
@@ -364,7 +364,7 @@ void VaatiRebornEnemyType0Action4(VaatiRebornEnemyEntity* this) {
if ((super->frame & 0x10) != 0) {
super->frame &= 0xef;
if (this->unk_84 == 0xff) {
index = Direction8RoundUp(GetFacingDirection(super, &gPlayerEntity));
index = Direction8RoundUp(GetFacingDirection(super, &gPlayerEntity.base));
this->unk_84 = gUnk_080D04C0[index >> 2];
super->subtimer = 0;
}
@@ -410,7 +410,7 @@ void VaatiRebornEnemyType0Action5(VaatiRebornEnemyEntity* this) {
if (!((this->unk_86 < 2) || (3 < this->unk_87)) && (Random() & 0x10) != 0) {
this->unk_87++;
super->subtimer = (Random() & 0x3f) + 64;
uVar3 = GetFacingDirection(super, &gPlayerEntity);
uVar3 = GetFacingDirection(super, &gPlayerEntity.base);
super->direction = (uVar3 & 0x10) | DirectionEast;
} else {
this->unk_74++;
@@ -903,15 +903,15 @@ u32 sub_0803E028(VaatiRebornEnemyEntity* this) {
return ret;
}
tmp = gRoomControls.origin_x + 0x58;
if (tmp > gPlayerEntity.x.HALF.HI) {
if (tmp > gPlayerEntity.base.x.HALF.HI) {
return ret;
}
tmp = gRoomControls.origin_y + 0x58;
if (tmp > gPlayerEntity.x.HALF.HI) {
if (tmp > gPlayerEntity.base.x.HALF.HI) {
return ret;
}
tmp = gRoomControls.origin_y + 0xf8;
if (tmp >= gPlayerEntity.x.HALF.HI) {
if (tmp >= gPlayerEntity.base.x.HALF.HI) {
this->unk_81 += 5;
ret = 1;
}
+1 -1
View File
@@ -676,7 +676,7 @@ void VaatiTransfiguredType2Action1(VaatiTransfiguredEntity* this) {
CopyPosition(super->parent, super);
switch (super->type2) {
case 2:
uVar3 = GetFacingDirection(super, &gPlayerEntity);
uVar3 = GetFacingDirection(super, &gPlayerEntity.base);
t = &gUnk_080D0B18[uVar3];
super->x.HALF.HI += t->x;
super->y.HALF.HI += t->y;
+13 -13
View File
@@ -5,9 +5,9 @@
* @brief Vaati Wrath enemy
*/
#include "enemy/vaatiWrath.h"
#include "functions.h"
#include "message.h"
#include "new_player.h"
#include "object.h"
#include "save.h"
#include "screen.h"
@@ -217,7 +217,7 @@ void VaatiWrathType0Action1(VaatiWrathEntity* this) {
super->subAction = 6;
super->timer = 30;
gRoomTransition.field_0x38 |= 1;
gRoomControls.camera_target = &gPlayerEntity;
gRoomControls.camera_target = &gPlayerEntity.base;
gPlayerState.controlMode = CONTROL_1;
break;
default:
@@ -421,7 +421,7 @@ void VaatiWrathType0Action9(VaatiWrathEntity* this) {
sub_08042214(this);
} else {
if (--super->timer == 0) {
if ((gPlayerEntity.x.HALF.HI - super->x.HALF.HI) + 0x40u < 0x81) {
if ((gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI) + 0x40u < 0x81) {
super->action = 10;
this->unk_7b = 0;
((VaatiWrathHeapStruct*)super->myHeap)->eyes[0]->timer = 1;
@@ -588,7 +588,7 @@ void sub_08041BE8(VaatiWrathEntity* this) {
DeleteEntity(entity);
((VaatiWrathHeapStruct*)super->myHeap)->object5b = NULL;
gRoomControls.camera_target = &gPlayerEntity;
gRoomControls.camera_target = &gPlayerEntity.base;
#endif
entity = ((VaatiWrathHeapStruct*)super->myHeap)->eyes[0];
entity->myHeap = NULL;
@@ -834,13 +834,13 @@ u32 sub_0804207C(VaatiWrathEntity* this) {
if (((arm != NULL) && (arm->action >= 5)) && EntityWithinDistance(arm, x, y, 0x30)) {
return CalculateDirectionTo(arm->x.HALF.HI, arm->y.HALF.HI, x, y);
} else {
if (gPlayerEntity.y.HALF.HI < 0x40) {
if (gPlayerEntity.base.y.HALF.HI < 0x40) {
tmp = gRoomControls.origin_y + 0x18;
} else {
tmp = gPlayerEntity.y.HALF.HI - 0x28;
tmp = gPlayerEntity.base.y.HALF.HI - 0x28;
}
return CalculateDirectionTo(super->x.HALF.HI, super->y.HALF.HI, gPlayerEntity.x.HALF.HI, tmp);
return CalculateDirectionTo(super->x.HALF.HI, super->y.HALF.HI, gPlayerEntity.base.x.HALF.HI, tmp);
}
}
}
@@ -860,12 +860,12 @@ void sub_0804212C(VaatiWrathEntity* this) {
}
arm = NULL;
y = super->y.HALF.HI - 0x44;
if (gPlayerEntity.y.HALF.HI - y < 0x61u) {
if (gPlayerEntity.base.y.HALF.HI - y < 0x61u) {
x = super->x.HALF.HI - 0x38;
if (gPlayerEntity.x.HALF.HI - x < 0x39u) {
if (gPlayerEntity.base.x.HALF.HI - x < 0x39u) {
arm = ((VaatiWrathHeapStruct*)super->myHeap)->arms[1];
} else {
if ((gPlayerEntity.x.HALF.HI - super->x.HALF.HI) < 0x39u) {
if ((gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI) < 0x39u) {
arm = ((VaatiWrathHeapStruct*)super->myHeap)->arms[0];
}
}
@@ -1005,8 +1005,8 @@ void VaatiWrathType0PreAction(VaatiWrathEntity* this) {
case PL_STATE_IDLE:
case PL_STATE_WALK:
if (gPlayerState.item == NULL) {
if (gNewPlayerEntity.unk_7a == 0) {
if ((gPlayerEntity.z.HALF.HI & 0x8000U) == 0 || (gPlayerState.field_0xa != 0)) {
if (gPlayerEntity.unk_7a == 0) {
if ((gPlayerEntity.base.z.HALF.HI & 0x8000U) == 0 || (gPlayerState.field_0xa != 0)) {
CreateEzloHint(TEXT_INDEX(TEXT_EZLO, 0x70), 0);
gRoomTransition.field_0x38 |= 2;
}
@@ -1054,7 +1054,7 @@ void VaatiWrathType2(VaatiWrathEntity* this) {
sub_0806FA90(((VaatiWrathHeapStruct*)super->myHeap)->type0, super, 0, -1);
super->spriteOffsetY++;
if (super->animIndex == 0x12) {
uVar1 = GetFacingDirection(super, &gPlayerEntity);
uVar1 = GetFacingDirection(super, &gPlayerEntity.base);
super->x.HALF.HI = gUnk_080D0EB0[uVar1] + super->x.HALF.HI;
}
}
+9 -9
View File
@@ -42,9 +42,9 @@ void WallMaster_OnCollision(WallMasterEntity* this) {
if (super->hitType != 0x75 && ((super->contactFlags & 0x7f) == 0 || (super->contactFlags & 0x7f) == 0x1e)) {
super->action = 5;
COLLISION_OFF(super);
this->unk_7e = gPlayerEntity.x.HALF.HI;
this->unk_80 = gPlayerEntity.y.HALF.HI;
this->unk_82 = gPlayerEntity.z.HALF.HI;
this->unk_7e = gPlayerEntity.base.x.HALF.HI;
this->unk_80 = gPlayerEntity.base.y.HALF.HI;
this->unk_82 = gPlayerEntity.base.z.HALF.HI;
if (super->action != 3) {
InitializeAnimation(super, 1);
}
@@ -150,12 +150,12 @@ void sub_0802A69C(WallMasterEntity* this) {
sub_0802A7D0(this);
gPlayerState.field_0xa |= 0x80;
gPlayerState.mobility |= 0x80;
gPlayerEntity.x.HALF.HI = this->unk_7e;
gPlayerEntity.y.HALF.HI = this->unk_80;
gPlayerEntity.z.HALF.HI = this->unk_82;
gPlayerEntity.base.x.HALF.HI = this->unk_7e;
gPlayerEntity.base.y.HALF.HI = this->unk_80;
gPlayerEntity.base.z.HALF.HI = this->unk_82;
if (gPlayerEntity.z.HALF.HI != super->z.HALF.HI) {
if (gPlayerEntity.z.HALF.HI < super->z.HALF.HI) {
if (gPlayerEntity.base.z.HALF.HI != super->z.HALF.HI) {
if (gPlayerEntity.base.z.HALF.HI < super->z.HALF.HI) {
super->z.HALF.HI--;
} else {
super->z.HALF.HI++;
@@ -171,7 +171,7 @@ void sub_0802A69C(WallMasterEntity* this) {
} else if (super->frame & 0x1) {
super->frame = flags;
super->spriteOffsetY = 3;
gPlayerEntity.spriteSettings.draw = 0;
gPlayerEntity.base.spriteSettings.draw = 0;
}
}
+4 -4
View File
@@ -49,7 +49,7 @@ void WallMaster2_OnCollision(WallMaster2Entity* this) {
super->action = 3;
COLLISION_OFF(super);
InitializeAnimation(super, 1);
gPlayerEntity.flags &= ~ENT_COLLIDE;
gPlayerEntity.base.flags &= ~ENT_COLLIDE;
break;
}
if (super->confusedTime != 0) {
@@ -133,8 +133,8 @@ void sub_0802CE68(WallMaster2Entity* this) {
gPlayerState.field_0xa |= 0x80;
gPlayerState.mobility |= 0x80;
gPlayerState.flags |= PL_DISABLE_ITEMS;
if (!EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 4)) {
super->direction = GetFacingDirection(super, &gPlayerEntity);
if (!EntityWithinDistance(super, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI, 4)) {
super->direction = GetFacingDirection(super, &gPlayerEntity.base);
LinearMoveUpdate(super);
}
sub_0802CFD8(this);
@@ -145,7 +145,7 @@ void sub_0802CE68(WallMaster2Entity* this) {
super->timer = 30;
} else if (super->frame & 1) {
super->frame = frames;
gPlayerEntity.spriteSettings.draw = 0;
gPlayerEntity.base.spriteSettings.draw = 0;
}
}
+2 -2
View File
@@ -76,8 +76,8 @@ void sub_0802A334(Entity* this) {
}
void sub_0802A39C(Entity* this) {
u32 x = (gPlayerEntity.x.HALF.HI - gRoomControls.scroll_x + gScreen.bg1.xOffset) >> 3;
u32 y = (gPlayerEntity.y.HALF.HI - gRoomControls.scroll_y + gScreen.bg1.yOffset - 10) >> 3;
u32 x = (gPlayerEntity.base.x.HALF.HI - gRoomControls.scroll_x + gScreen.bg1.xOffset) >> 3;
u32 y = (gPlayerEntity.base.y.HALF.HI - gRoomControls.scroll_y + gScreen.bg1.yOffset - 10) >> 3;
if (gBG3Buffer[(x & 0x1fU) + (y & 0x1fU) * 0x20 + 0x400]) {
COLLISION_OFF(this);
} else {
+1 -1
View File
@@ -95,7 +95,7 @@ void WizzrobeFire_Action2(WizzrobeEntity* this) {
super->child->spriteSettings.draw = 0;
break;
case 6:
if (EntityInRectRadius(super, &gPlayerEntity, 0xa0, 0xa0) && CheckOnScreen(super)) {
if (EntityInRectRadius(super, &gPlayerEntity.base, 0xa0, 0xa0) && CheckOnScreen(super)) {
Entity* projectile = CreateProjectileWithParent(super, FIRE_PROJECTILE, 1);
if (projectile != NULL) {
projectile->direction = super->direction & 0x18;
+1 -1
View File
@@ -102,7 +102,7 @@ void WizzrobeIce_Action2(WizzrobeEntity* this) {
super->child->spriteSettings.draw = 0;
break;
case 0xa:
if (EntityInRectRadius(super, &gPlayerEntity, 0xa0, 0xa0) && CheckOnScreen(super)) {
if (EntityInRectRadius(super, &gPlayerEntity.base, 0xa0, 0xa0) && CheckOnScreen(super)) {
Entity* projectile = CreateProjectileWithParent(super, ICE_PROJECTILE, 1);
if (projectile != NULL) {
projectile->direction = super->direction & 0x18;
+1 -1
View File
@@ -118,7 +118,7 @@ void WizzrobeWind_Action2(WizzrobeEntity* this) {
super->parent->spriteSettings.draw = 0;
break;
case 8:
if (EntityInRectRadius(super, &gPlayerEntity, 0xa0, 0xa0) && CheckOnScreen(super)) {
if (EntityInRectRadius(super, &gPlayerEntity.base, 0xa0, 0xa0) && CheckOnScreen(super)) {
Entity* projectile = CreateProjectileWithParent(super, WIND_PROJECTILE, 1);
if (projectile != NULL) {
projectile->direction = super->direction & 0x18;