Merge remote-tracking branch 'upstream/master' into coord

This commit is contained in:
Tal Hayon
2022-01-23 17:24:55 +02:00
149 changed files with 693 additions and 827 deletions
+1 -1
View File
@@ -250,7 +250,7 @@ u32 CreateItemDrop(Entity* arg0, u32 itemID, u32 itemParameter) {
} else if (arg0->id == 0x1e) {
itemEntity->direction = arg0->animationState << 3 | 0x80;
itemEntity->speed = 0xc0;
itemEntity->zVelocity = 0x18000;
itemEntity->zVelocity = Q_16_16(1.5);
}
}
CopyPosition(arg0, itemEntity);
+6 -6
View File
@@ -177,7 +177,7 @@ NONMATCH("asm/non_matching/arm_proxy/sub_08017744.inc", void sub_08017744(Entity
}
END_NONMATCH
bool32 sub_080177A0(Entity* this, Entity* that) {
bool32 IsColliding(Entity* this, Entity* that) {
u32 this_d;
u32 depth;
@@ -206,9 +206,9 @@ bool32 sub_080177A0(Entity* this, Entity* that) {
return FALSE;
}
bool32 sub_08017850(Entity* this) {
bool32 IsCollidingPlayer(Entity* this) {
if (sub_08079F8C())
return sub_080177A0(this, &gPlayerEntity);
return IsColliding(this, &gPlayerEntity);
return FALSE;
}
@@ -290,7 +290,7 @@ void sub_080179EC(Entity* a1, Entity* a2) {
u32 rand = Random();
Entity* e = CreateFx(a2, p[rand & 3], 0);
if (e != NULL) {
PositionRelative(a2, e, a2->hitbox->offset_x << 16, a2->hitbox->offset_y << 16);
PositionRelative(a2, e, Q_16_16(a2->hitbox->offset_x), Q_16_16(a2->hitbox->offset_y));
e->spritePriority.b0 = 2;
e->spriteOffsetX = (a1->x.HALF.HI + a1->hitbox->offset_x - (a2->x.HALF.HI + a2->hitbox->offset_x)) >> 1;
e->spriteOffsetY = (a1->y.HALF.HI + a1->hitbox->offset_y - (a2->y.HALF.HI + a2->hitbox->offset_y)) >> 1;
@@ -541,9 +541,9 @@ s32 sub_08017F40(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
gPlayerState.jump_status = 0;
if (tgt->kind == ENEMY && (tgt->id == GHINI || tgt->id == ENEMY_50)) {
org->z.HALF.HI = 0;
PositionRelative(org, tgt, 0, 0x10000);
PositionRelative(org, tgt, 0, Q_16_16(1.0));
} else {
PositionRelative(tgt, org, 0, 0x10000);
PositionRelative(tgt, org, 0, Q_16_16(1.0));
}
COLLISION_OFF(org);
org->spriteRendering.b3 = tgt->spriteRendering.b3;
+20 -20
View File
@@ -108,7 +108,7 @@ u32 sub_0806F3E4(Entity* ent) {
p = &gUnk_08126EE4[gPlayerEntity.animationState & 0xE];
tmp_ent.x.HALF.HI = p[0] + gPlayerEntity.x.HALF.HI;
tmp_ent.y.HALF.HI = p[1] + gPlayerEntity.y.HALF.HI;
sub_0806F5BC(ent, ent->field_0x46, GetFacingDirection(ent, &tmp_ent));
LinearMoveDirection(ent, ent->field_0x46, GetFacingDirection(ent, &tmp_ent));
if (sub_0800419C(&tmp_ent, ent, 4, 4)) {
u32 state = ent->field_0x1c & 0xF;
if (state == 2) {
@@ -179,7 +179,7 @@ u32 sub_0806F5B0(u32 idx) {
return gUnk_08114F58[idx];
}
void sub_0806F5BC(Entity* ent, u32 a, u32 b) {
void LinearMoveDirection(Entity* ent, u32 a, u32 b) {
if ((b & 0x80) == 0) {
u32 m1 = b;
@@ -188,15 +188,15 @@ void sub_0806F5BC(Entity* ent, u32 a, u32 b) {
}
}
void sub_0806F62C(Entity* ent, u32 a, u32 b) {
void LinearMoveAngle(Entity* ent, u32 a, u32 b) {
ent->x.WORD += FixedDiv(FixedMul(gSineTable[(u8)b], a), 256) << 8;
ent->y.WORD -= FixedDiv(FixedMul(gSineTable[(u8)b + 64], a), 256) << 8;
}
void LinearMoveUpdate(Entity* ent) {
if ((ent->direction & 0x80) == 0) {
ent->x.WORD += FixedDiv(FixedMul(gSineTable[ent->direction * 8], ent->speed), 256) << 8;
ent->y.WORD -= FixedDiv(FixedMul(gSineTable[ent->direction * 8 + 64], ent->speed), 256) << 8;
ent->x.WORD += FixedDiv(FixedMul(gSineTable[ent->direction * 8], ent->speed), (1 << 8)) << 8;
ent->y.WORD -= FixedDiv(FixedMul(gSineTable[ent->direction * 8 + 64], ent->speed), (1 << 8)) << 8;
}
}
@@ -323,13 +323,13 @@ s16 FixedDiv(s16 r0, s16 r1) {
return (r0 * 256) / r1;
}
void CopyPosition(Entity* param_1, Entity* param_2) {
PositionRelative(param_1, param_2, 0, 0);
void CopyPosition(Entity* source, Entity* target) {
PositionRelative(source, target, 0, 0);
}
void PositionEntityOnTop(Entity* ent, Entity* ent2) {
PositionRelative(ent, ent2, 0, 0);
ResolveEntityOnTop(ent, ent2);
void PositionEntityOnTop(Entity* source, Entity* target) {
PositionRelative(source, target, 0, 0);
SortEntityAbove(source, target);
}
void PositionRelative(Entity* source, Entity* target, s32 offsetX, s32 offsetY) {
@@ -347,23 +347,23 @@ void PositionRelative(Entity* source, Entity* target, s32 offsetX, s32 offsetY)
UpdateSpriteForCollisionLayer(target);
}
void CopyPositionAndSpriteOffset(Entity* param_1, Entity* param_2) {
param_2->spriteOffsetX = param_1->spriteOffsetX;
param_2->spriteOffsetY = param_1->spriteOffsetY;
PositionRelative(param_1, param_2, 0, 0);
void CopyPositionAndSpriteOffset(Entity* source, Entity* target) {
target->spriteOffsetX = source->spriteOffsetX;
target->spriteOffsetY = source->spriteOffsetY;
PositionRelative(source, target, 0, 0);
}
void sub_0806FA90(Entity* param_1, Entity* param_2, s32 offsetX, s32 offsetY) {
param_2->spriteOffsetX = param_1->spriteOffsetX;
param_2->spriteOffsetY = param_1->spriteOffsetY;
PositionRelative(param_1, param_2, offsetX * 64 * 32 * 32, offsetY * 64 * 32 * 32);
void sub_0806FA90(Entity* source, Entity* target, s32 offsetX, s32 offsetY) {
target->spriteOffsetX = source->spriteOffsetX;
target->spriteOffsetY = source->spriteOffsetY;
PositionRelative(source, target, Q_16_16(offsetX), Q_16_16(offsetY));
}
void ResolveEntityOnTop(Entity* param_1, Entity* param_2) {
void SortEntityAbove(Entity* param_1, Entity* param_2) {
param_2->spritePriority.b0 = gEntityOnTopArray[param_1->spritePriority.b0];
}
void ResolveEntityBelow(Entity* param_1, Entity* param_2) {
void SortEntityBelow(Entity* param_1, Entity* param_2) {
param_2->spritePriority.b0 = gEntityBelowArray[param_1->spritePriority.b0];
}
+5 -5
View File
@@ -104,7 +104,7 @@ void sub_080318DC(Entity* this) {
void sub_08031A60(Entity* this) {
if (this->iframes > 0)
GravityUpdate(this, 0x1800);
GravityUpdate(this, Q_8_8(24.0));
sub_08001324(this);
}
@@ -315,7 +315,7 @@ void sub_08031E90(Entity* this) {
void sub_08031EA8(Entity* this) {
this->action = 1;
this->spritePriority.b1 = 1;
this->zVelocity = 0x40000;
this->zVelocity = Q_16_16(4.0);
this->z.HALF.HI = (4 - this->type2) * 0xe;
this->field_0x78.HALF.HI = Random();
InitializeAnimation(this, 4);
@@ -325,7 +325,7 @@ void sub_08031EE8(Entity* this) {
int draw;
this->z.WORD -= this->zVelocity;
this->zVelocity -= 0x1800;
this->zVelocity -= Q_16_16(3.0 / 32.0);
if (this->z.HALF.HI < 1) {
draw = this->spriteSettings.draw;
@@ -442,7 +442,7 @@ void sub_08032160(Entity* this) {
this->spriteSettings.flipX = 0;
}
this->speed = 0xf0;
this->zVelocity = 0x12000;
this->zVelocity = Q_16_16(1.125);
this->spritePriority.b1 = 1;
InitializeAnimation(this, 12);
}
@@ -477,7 +477,7 @@ void sub_08032204(Entity* this) {
}
void sub_08032248(Entity* this) {
if (GravityUpdate(this, 0x1800) == 0) {
if (GravityUpdate(this, Q_8_8(24.0)) == 0) {
if (this->frame & 0x80) {
((Entity*)this->field_0x7c.WORD)->actionDelay--;
+3 -3
View File
@@ -109,7 +109,7 @@ void sub_080218CC(Entity* this) {
this->spriteSettings.draw = 1;
this->direction = ((sub_08049F84(this, 1) ^ 0x10) + gUnk_080CB5DC[Random() & 7]) & 0x1f;
this->speed = 0x100;
this->zVelocity = 0x12000;
this->zVelocity = Q_16_16(1.125);
}
GetNextFrame(this);
@@ -242,7 +242,7 @@ void sub_08021B64(Entity* this) {
if (iVar4 == 0) {
this->action = 6;
this->zVelocity = 0x10000;
this->zVelocity = Q_16_16(1.0);
((u8*)&this->field_0x86)[1] = 0;
if (gPlayerEntity.direction != 0xff) {
this->direction = 0x10 ^ gPlayerEntity.direction;
@@ -303,7 +303,7 @@ u32 sub_08021D00(Entity* this) {
} else {
this->action = 4;
this->actionDelay = 1;
this->zVelocity = 0x18000;
this->zVelocity = Q_16_16(1.5);
InitializeAnimation(this, 4);
ret = 1;
}
+3 -3
View File
@@ -61,7 +61,7 @@ void sub_0802C688(Entity* this) {
this->action = 3;
this->hitType = 0x6e;
this->field_0xf = 1;
this->zVelocity = 0x18000;
this->zVelocity = Q_16_16(1.5);
this->speed = 0;
this->field_0x80.HALF.HI = 1;
InitializeAnimation(this, this->direction >> 4 | 6);
@@ -79,7 +79,7 @@ void sub_0802C7AC(Entity* this) {
if (this->field_0x82.HALF.LO != 2) {
this->speed = this->field_0x82.HALF.LO ? 0x200 : 0x80;
}
this->zVelocity = 0x18000;
this->zVelocity = Q_16_16(1.5);
this->field_0x82.HALF.HI = 0;
this->field_0x80.HALF.HI = 0;
} else {
@@ -232,7 +232,7 @@ void sub_0802CA94(Entity* this) {
COLLISION_OFF(this);
this->field_0xf = 1;
this->spritePriority.b1 = 1;
this->zVelocity = 0x18000;
this->zVelocity = Q_16_16(1.5);
this->speed = 0;
this->field_0x82.HALF.HI = 0;
this->field_0x80.HALF.HI = 0;
+1 -1
View File
@@ -381,7 +381,7 @@ void sub_0802ADDC(Entity* this) {
void sub_0802AE24(Entity* this) {
this->action = 1;
this->actionDelay = 0xf0;
this->zVelocity = 0x8000;
this->zVelocity = Q_16_16(0.5);
this->hitbox = (Hitbox*)&gUnk_080CD174;
this->field_0x3c = 3;
this->field_0x16 = 0;
+1 -1
View File
@@ -722,7 +722,7 @@ u32 sub_0801FBD0(Entity* this) {
void Chuchu_JumpAtPlayer(Entity* this) {
this->speed = 0x180;
this->zVelocity = 0x20000;
this->zVelocity = Q_16_16(2.0);
this->direction = sub_08049F84(this, 1);
InitializeAnimation(this, 3);
}
+3 -3
View File
@@ -52,7 +52,7 @@ void sub_08022988(Entity* this) {
return;
this->frameIndex = 1;
this->zVelocity = 0x10000;
this->zVelocity = Q_16_16(1.0);
EnqueueSFX(0xd6);
}
@@ -78,7 +78,7 @@ void sub_080229F8(Entity* this) {
this->speed = 0xc0;
sub_08022B44(this);
} else {
this->zVelocity = 0x10000;
this->zVelocity = Q_16_16(1.0);
EnqueueSFX(0xd6);
}
}
@@ -141,7 +141,7 @@ u32 sub_08022B20(Entity* this) {
}
void sub_08022B44(Entity* this) {
this->zVelocity = 0xc000;
this->zVelocity = Q_16_16(0.75);
this->direction = GetFacingDirection(this, &gPlayerEntity);
if (this->direction & 0xf)
+16
View File
@@ -0,0 +1,16 @@
#include "entity.h"
void (*const gUnk_080D2ABC[])(Entity*);
extern void sub_08029270(Entity* this);
void Enemy66(Entity* this) {
if (gUnk_080D2ABC[this->field_0xf]) {
gUnk_080D2ABC[this->field_0xf](this);
} else {
DeleteThisEntity();
}
}
void (*const gUnk_080D2ABC[103])(Entity*) = {
[22] = sub_08029270,
};
+2 -2
View File
@@ -37,7 +37,7 @@ void sub_0802C254(Entity* this) {
void sub_0802C258(Entity* this) {
sub_0804A720(this);
this->zVelocity = 0x20000;
this->zVelocity = Q_16_16(2.0);
this->actionDelay = 2;
this->field_0x7a.HWORD = Random() & 0x70;
switch (this->type) {
@@ -195,7 +195,7 @@ void sub_0802C4B0(Entity* this) {
}
rand = Random() & 7;
this->zVelocity = 0x20000;
this->zVelocity = Q_16_16(2.0);
if (rand & 4) {
if (rand & 3) {
*(u32*)&this->cutsceneBeh = gUnk_080CD58C[offset | 1];
+1 -1
View File
@@ -102,7 +102,7 @@ u32 sub_0804A024(Entity*, u32, u32);
void sub_08045524(Entity* this) {
u32 tmp, tmp1, tmp2;
this->zVelocity = 0x1c000;
this->zVelocity = Q_16_16(1.75);
tmp = sub_0804A024(this, 1, 8);
if (tmp != 0xff && (Random() & 3) == 0) {
this->actionDelay = Random() & 3;
+1 -1
View File
@@ -46,7 +46,7 @@ void sub_08039BF8(FlyingSkullEntity* this) {
if (super->bitfield == 0x9d) {
super->action = 7;
COLLISION_OFF(super);
super->zVelocity = 0x2A000;
super->zVelocity = Q_16_16(2.625);
super->spritePriority.b1 = 1;
SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
} else if (super->z.HALF.HI) {
+1 -1
View File
@@ -605,7 +605,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE
super->parent->subAction = 4;
super->parent->type2 = 0;
((GleerokEntity*)super->parent)->unk_7b = 0;
SoundReq(SFX_10C);
SoundReq(SFX_BUTTON_PRESS);
}
} else {
if (super->actionDelay != this->unk_84->filler[1]) {
+2 -2
View File
@@ -1033,7 +1033,7 @@ void sub_08047DF0(GyorgMaleEntity* this, u32 unk1) {
sub_08047EA4(this, unk1);
oldX = super->x.HALF.HI;
oldY = super->y.HALF.HI;
sub_0806F62C(super, super->speed, super->direction);
LinearMoveAngle(super, super->speed, super->direction);
if (this->unk_7c & 1) {
if (sub_08079F8C()) {
gPlayerEntity.x.HALF.HI += super->x.HALF.HI - oldX;
@@ -1051,7 +1051,7 @@ void sub_08047E58(GyorgMaleEntity* this) {
u32 oldX, oldY;
oldX = super->x.HALF.HI;
oldY = super->y.HALF.HI;
sub_0806F62C(super, super->speed, super->direction);
LinearMoveAngle(super, super->speed, super->direction);
if (this->unk_7c & 1) {
if (sub_08079F8C()) {
gPlayerEntity.x.HALF.HI += super->x.HALF.HI - oldX;
+6 -6
View File
@@ -95,7 +95,7 @@ void sub_0802BCA8(Entity* this) {
this->action = 7;
this->actionDelay = 0x5a;
this->zVelocity = 0x18000;
this->zVelocity = Q_16_16(1.5);
this->hitType = 0x19;
this->field_0x3a = this->field_0x3a & 0xfb;
this->field_0x1c = 0x12;
@@ -222,7 +222,7 @@ void sub_0802BEBC(Entity* this) {
this->direction ^= 0x10;
sub_080AEFE0(this);
this->direction ^= 0x10;
if (!sub_080044EC(this, 0x2000)) {
if (!sub_080044EC(this, Q_16_16(0.125))) {
sub_0802C1C0(this);
}
}
@@ -234,7 +234,7 @@ void sub_0802BEEC(Entity* this) {
this->direction = this->animationState << 3;
InitializeAnimation(this, this->animationState + 4);
}
} else if (!GravityUpdate(this, 0x1c00)) {
} else if (!GravityUpdate(this, Q_16_16(0.109375))) {
this->action = 8;
this->actionDelay = 30;
this->speed = 0x120;
@@ -356,7 +356,7 @@ void sub_0802C18C(Entity* this) {
if ((this->field_0x78.HALF.LO & 7) == 0) {
Entity* ent = CreateObject(SPECIAL_FX, 0x11, 0x40);
if (ent) {
PositionRelative(this, ent, 0, 0x10000);
PositionRelative(this, ent, 0, Q_16_16(1.0));
}
}
}
@@ -374,8 +374,8 @@ void sub_0802C1CC(Entity* this) {
void sub_0802C218(Entity* this) {
this->action = 6;
this->speed = 0xe0;
this->zVelocity = 0x18000;
this->speed = Q_8_8(0.875);
this->zVelocity = Q_16_16(1.5);
}
// clang-format off
+1 -1
View File
@@ -229,7 +229,7 @@ void sub_08032794(Entity* this) {
target = CreateFx(this, FX_DASH, 0x40);
if (target != NULL) {
temp = &gUnk_080CE810[this->animationState * 2];
PositionRelative(this, target, temp[0] << 0x10, temp[1] << 0x10);
PositionRelative(this, target, Q_16_16(temp[0]), Q_16_16(temp[1]));
}
}
+12 -10
View File
@@ -59,7 +59,7 @@ void Lakitu_DoAction(Entity* this) {
void sub_0803C784(Entity* this) {
if ((this->bitfield & 0x7f) == 0x1d) {
this->zVelocity = 0x20000;
this->zVelocity = Q_16_16(2.0);
sub_0803CBAC(this);
} else {
@@ -316,7 +316,7 @@ void Lakitu_SpawnLightning(Entity* this) {
lightning->direction = this->field_0x78.HALF.LO;
PositionRelative(this, lightning, offset->x << 16, offset->y << 16);
PositionRelative(this, lightning, Q_16_16(offset->x), Q_16_16(offset->y));
EnqueueSFX(0x193);
}
@@ -346,6 +346,8 @@ void sub_0803CC08(Entity* this) {
Entity* cloud;
Entity* fx;
const s32 diff = Q_8_8(3.0 / 128.0);
cloud = this->child;
if (cloud == NULL) {
return;
@@ -365,26 +367,26 @@ void sub_0803CC08(Entity* this) {
fx = CreateFx(this, FX_DEATH, 0);
if (fx != NULL) {
fx->x.HALF.HI += 6;
fx->y.HALF.HI += 6;
fx->x.HALF.HI += diff;
fx->y.HALF.HI += diff;
}
fx = CreateFx(this, FX_DEATH, 0);
if (fx != NULL) {
fx->x.HALF.HI -= 6;
fx->y.HALF.HI += 6;
fx->x.HALF.HI -= diff;
fx->y.HALF.HI += diff;
}
fx = CreateFx(this, FX_DEATH, 0);
if (fx != NULL) {
fx->x.HALF.HI += 6;
fx->y.HALF.HI -= 6;
fx->x.HALF.HI += diff;
fx->y.HALF.HI -= diff;
}
fx = CreateFx(this, FX_DEATH, 0);
if (fx != NULL) {
fx->x.HALF.HI -= 6;
fx->y.HALF.HI -= 6;
fx->x.HALF.HI -= diff;
fx->y.HALF.HI -= diff;
}
this->child = NULL;
+2 -2
View File
@@ -193,7 +193,7 @@ void sub_0802805C(Entity* this) {
} else {
ResetPlayer();
gPlayerState.mobility |= 0x80;
PositionRelative(this, &gPlayerEntity, 0, 0x10000);
PositionRelative(this, &gPlayerEntity, 0, Q_16_16(1.0));
tmp = GetSpriteSubEntryOffsetDataPointer((u16)this->spriteIndex, this->frameIndex);
gPlayerEntity.spriteOffsetX = tmp[0];
@@ -215,7 +215,7 @@ NONMATCH("asm/non_matching/likeLike/sub_0802810C.inc", void sub_0802810C(Entity*
gPlayerState.field_0xa = 0;
gPlayerState.flags &= 0xffffffef;
gPlayerEntity.flags |= 0x80;
gPlayerEntity.zVelocity = 0x18000;
gPlayerEntity.zVelocity = Q_16_16(1.5);
gPlayerEntity.iframes = -60;
gPlayerEntity.direction = gPlayerEntity.animationState << 2;
gPlayerEntity.spritePriority.b1 = this->field_0x82.HALF.HI;
+8 -8
View File
@@ -189,7 +189,7 @@ void sub_0803A274(Entity* this) {
pEVar1 = CreateObject(OBJECT_7E, 1, 0);
pEVar1->parent = this;
pEVar1->child = this->child;
PositionRelative(this->parent, this, 0x100000, 0x200000);
PositionRelative(this->parent, this, Q_16_16(16.0), Q_16_16(32.0));
} else {
pEVar1 = CreateEnemy(MAZAAL_HAND, 1);
pEVar1->parent = this;
@@ -201,7 +201,7 @@ void sub_0803A274(Entity* this) {
pEVar1->parent = this;
pEVar1->child = this->child;
this->spriteSettings.flipX = 1;
PositionRelative(this->parent, this, -0x100000, 0x200000);
PositionRelative(this->parent, this, Q_16_16(-16.0), Q_16_16(32.0));
}
if (gRoomTransition.field_0x38 != 0) {
this->action = 3;
@@ -917,7 +917,7 @@ void sub_0803B100(Entity* this) {
Entity* temp;
this->action = 0x29;
this->zVelocity = 0x14000;
this->zVelocity = Q_16_16(1.25);
if (this->type == 0) {
this->hitbox = &gUnk_080FD364;
} else {
@@ -974,7 +974,7 @@ void sub_0803B1B8(Entity* this) {
if (temp != (Entity*)0x0) {
temp->actionDelay = 0;
temp->direction = 0x90;
PositionRelative(this, temp, this->hitbox->offset_x << 0x10, this->hitbox->offset_y << 0x10);
PositionRelative(this, temp, Q_16_16(this->hitbox->offset_x), Q_16_16(this->hitbox->offset_y));
}
temp = *(Entity**)&this->field_0x74;
temp->field_0x74.HALF.LO = 0x40;
@@ -1086,7 +1086,7 @@ void sub_0803B480(Entity* this) {
Entity* target;
if (((this->field_0x7c.HALF.HI & 0x1f) == 0) && (target = CreateObject(SMOKE, 1, 0), target != (Entity*)0x0)) {
PositionRelative(this, target, gUnk_080CFD08[this->type] << 0x10, 0);
PositionRelative(this, target, Q_16_16(gUnk_080CFD08[this->type]), 0);
}
if (--this->field_0x7c.HALF.HI == 0) {
sub_0803B6A4(this);
@@ -1115,8 +1115,8 @@ u32 sub_0803B4E4(Entity* this) {
}
void sub_0803B538(Entity* this) {
PositionRelative(this, this->child, 0, -0x10000);
PositionRelative(this, *(Entity**)&this->field_0x74, 0, -0x20000);
PositionRelative(this, this->child, 0, Q_16_16(-1.0));
PositionRelative(this, *(Entity**)&this->field_0x74, 0, Q_16_16(-2.0));
}
void sub_0803B55C(Entity* this) {
@@ -1231,7 +1231,7 @@ void sub_0803B798(void) {
gPlayerState.field_0xa = 0;
gPlayerState.flags &= ~(0xffff0000 | PL_CAPTURED);
gPlayerEntity.flags |= 0x80;
gPlayerEntity.zVelocity = 0x18000;
gPlayerEntity.zVelocity = Q_16_16(1.5);
gPlayerEntity.z.HALF.HI = -10;
gPlayerEntity.direction = 0x10;
gPlayerEntity.animationState = 4;
+2 -2
View File
@@ -741,7 +741,7 @@ void sub_08034A84(Entity* this) {
}
void sub_08034AC4(Entity* this) {
PositionRelative(this->parent, this, 0, 0x10000);
PositionRelative(this->parent, this, 0, Q_16_16(1.0));
gUnk_080CED74[this->action](this);
}
@@ -782,7 +782,7 @@ void sub_08034B38(Entity* this) {
target->direction = this->actionDelay + 0x58;
}
ptr = &gUnk_080CED84[target->type * 2];
PositionRelative(this, target, *(ptr++) << 0x10, *ptr << 0x10);
PositionRelative(this, target, Q_16_16(*(ptr++)), Q_16_16(*ptr));
}
}
}
+1 -1
View File
@@ -57,7 +57,7 @@ void sub_08045654(Entity* this) {
void sub_08045678(Entity* this) {
this->zVelocity = 0x1c000;
this->zVelocity = Q_16_16(1.75);
if (this->actionDelay != 0) {
this->actionDelay--;
} else {
+2 -2
View File
@@ -87,7 +87,7 @@ void sub_080230E4(Entity* this) {
CopyPosition(this, &gPlayerEntity);
gPlayerEntity.flags = gPlayerEntity.flags | 0x80;
gPlayerEntity.spriteSettings.draw = 1;
gPlayerEntity.zVelocity = 0x18000;
gPlayerEntity.zVelocity = Q_16_16(1.5);
gPlayerEntity.direction = 0xff;
gPlayerEntity.iframes = -0x14;
gPlayerState.jump_status = 0x41;
@@ -270,7 +270,7 @@ void sub_0802351C(Entity* this) {
if (this->type2 == 0) {
gPlayerEntity.animationState = this->animationState & 7;
gPlayerState.flags |= PL_MOLDWORM_CAPTURED;
PositionRelative(this, &gPlayerEntity, 0, gUnk_080CBC90[this->animationState & 7] << 0x10);
PositionRelative(this, &gPlayerEntity, 0, Q_16_16(gUnk_080CBC90[this->animationState & 7]));
gPlayerEntity.spriteOffsetY = -gUnk_080CBC90[this->animationState & 7];
}
} else {
+5 -5
View File
@@ -617,7 +617,7 @@ void OctorokBoss_Action1(Entity* this) {
this->field_0x74.HWORD += 4;
}
}
ResolveEntityBelow(this->parent, this);
SortEntityBelow(this->parent, this);
if (((GET_HELPER(this)->field_0x2 != 0) || (this->parent->action == INTRO)) ||
(1 < (u8)(this->parent->subAction - 3))) {
if ((s8)this->field_0xf < 0) {
@@ -649,9 +649,9 @@ void OctorokBoss_Action1(Entity* this) {
if ((GET_HELPER(this)->tailCount - 2) < this->type2) {
DeleteThisEntity();
}
ResolveEntityOnTop(this->parent, this);
SortEntityAbove(this->parent, this);
if (GET_HELPER(this)->tailCount - 2 == this->type2) {
ResolveEntityOnTop(this->parent, this);
SortEntityAbove(this->parent, this);
radius = 0x10000 / this->parent->field_0x74.HWORD;
radius = radius << 0xd >> 0x8;
angle = -this->parent->field_0x7a.HALF.HI;
@@ -693,7 +693,7 @@ void OctorokBoss_Action1(Entity* this) {
if (this->health == 1) {
this->health = 0;
} else {
ResolveEntityBelow(this->parent, this);
SortEntityBelow(this->parent, this);
if ((this->parent->subAction != 4) && (this->health != 1)) {
if (GET_TIMER(this) > 0x1c) {
GET_TIMER(this)--;
@@ -939,7 +939,7 @@ void OctorokBoss_ExecuteAttackVacuum(Entity* this) {
if (sub_0806FC80(this, &gPlayerEntity, 0xf0) != 0) {
if ((gPlayerState.flags & PL_FROZEN) == 0) {
if ((gPlayerEntity.flags & PL_MINISH) != 0) {
sub_0806F62C(&gPlayerEntity, 0x280, -GET_ANGLE_HI(this));
LinearMoveAngle(&gPlayerEntity, 0x280, -GET_ANGLE_HI(this));
if (sub_0806FC80(this, &gPlayerEntity, 0x48) != 0) {
this->field_0x80.HALF.LO = 1;
GET_TIMER(this) = 2;
+2 -2
View File
@@ -265,7 +265,7 @@ void Peahat_RepairPropeller(Entity* this) {
return;
this->action = 9;
this->zVelocity = 0x18000;
this->zVelocity = Q_16_16(1.5);
this->direction = Random() & 0x1f;
sub_0804AA1C(this);
this->animationState = PeahatAnimation_RepairPropeller;
@@ -291,7 +291,7 @@ void Peahat_Hop(Entity* this) {
if (--this->actionDelay == 0) {
if (this->frame & 0x80) {
this->action = 9;
this->zVelocity = 0x18000;
this->zVelocity = Q_16_16(1.5);
this->animationState = PeahatAnimation_NewPropeller;
InitializeAnimation(this, this->animationState);
} else {
+1 -1
View File
@@ -811,7 +811,7 @@ void sub_08024E4C(Entity* this) {
gPlayerState.field_0x38 = 0x14;
gPlayerState.field_0x39 = 1;
*(u8*)&gPlayerState.field_0x3a = 0;
PositionRelative(this, player, 0, 0x10000);
PositionRelative(this, player, 0, Q_16_16(1.0));
player->spriteOffsetY = 0x1a;
player->animationState = 4;
player->spritePriority.b1 = 0;
+9 -9
View File
@@ -198,7 +198,7 @@ void sub_080252E0(Entity* this) {
this->action = 3;
this->actionDelay = 0x1e;
this->field_0xf = 0;
this->zVelocity = 0x18000;
this->zVelocity = Q_16_16(1.5);
InitializeAnimation(this, 1);
}
}
@@ -210,8 +210,8 @@ void sub_0802538C(Entity* this) {
if (this->frame == 0) {
GetNextFrame(this);
} else {
GravityUpdate(this, 0x2000);
if (this->zVelocity < 0x2000) {
GravityUpdate(this, Q_16_16(0.125));
if (this->zVelocity < Q_16_16(0.125)) {
this->action = 4;
InitializeAnimation(this, 2);
}
@@ -240,7 +240,7 @@ void sub_0802541C(Entity* this) {
if (this->frame & 0x80) {
this->action = 3;
this->field_0xf = 1;
this->zVelocity = 0x20000;
this->zVelocity = Q_16_16(2);
InitializeAnimation(this, 1);
}
}
@@ -257,7 +257,7 @@ void sub_0802544C(Entity* this) {
}
void sub_0802547C(Entity* this) {
GravityUpdate(this, 0x2000);
GravityUpdate(this, Q_16_16(0.125));
GetNextFrame(this);
if ((this->actionDelay & 7) == 0) {
sub_08025BD4(this);
@@ -269,7 +269,7 @@ void sub_0802547C(Entity* this) {
}
void sub_080254B4(Entity* this) {
GravityUpdate(this, 0x2000);
GravityUpdate(this, Q_16_16(0.125));
if (this->frame & 0x80) {
if (this->z.HALF.HI == 0) {
if (this->cutsceneBeh.HWORD == 0) {
@@ -553,7 +553,7 @@ void sub_08025B18(Entity* this) {
ent = CreateObject(OBJECT_21, 2, 0);
if (ent) {
PositionRelative(this, ent, offset[0] * 0x10000, offset[1] * 0x10000);
PositionRelative(this, ent, Q_16_16(offset[0]), Q_16_16(offset[1]));
ent->x.HALF.HI &= -0x10;
ent->x.HALF.HI += 8;
ent->y.HALF.HI &= -0x10;
@@ -567,8 +567,8 @@ void sub_08025BD4(Entity* this) {
if (this->field_0x82.HALF.LO && (this->frame & 1) == 0) {
Entity* ent = CreateObject(OBJECT_21, 0, 0);
if (ent) {
PositionRelative(this, ent, gUnk_080CC0BA[this->animationState * 2 + 0] * 0x10000,
gUnk_080CC0BA[this->animationState * 2 + 1] * 0x10000);
PositionRelative(this, ent, Q_16_16(gUnk_080CC0BA[this->animationState * 2 + 0]),
Q_16_16(gUnk_080CC0BA[this->animationState * 2 + 1]));
ent->z.HALF.HI = -10;
}
}
+3 -3
View File
@@ -37,7 +37,7 @@ void Rollobite_OnTick(Entity* this) {
void sub_08020668(Entity* this) {
if (this->hitType == 34 && this->health != 0xff) {
this->action = 4;
this->zVelocity = 0x20000;
this->zVelocity = Q_16_16(2.0);
this->direction = 0xff;
this->health = 0xff;
this->hitType = 35;
@@ -107,7 +107,7 @@ void sub_080207A8(Entity* this) {
this->spritePriority.b0 = 4;
this->field_0x3a &= 0xfb;
this->direction ^= 0x10;
this->zVelocity = 0x18000;
this->zVelocity = Q_16_16(1.5);
this->speed = 0x80;
InitializeAnimation(this, this->animationState + 0x10);
}
@@ -267,7 +267,7 @@ bool32 Rollobite_TryToHoleUp(Entity* this) {
this->x.HALF.HI += 8;
this->y.HALF.HI &= 0xfff0;
this->y.HALF.HI += 13;
this->zVelocity = 0x20000;
this->zVelocity = Q_16_16(2.0);
InitializeAnimation(this, this->animationState + 0x14);
SetTile(0x4034, tile, this->collisionLayer);
return TRUE;
+2 -2
View File
@@ -171,7 +171,7 @@ void sub_0802953C(Entity* this) {
} else {
ResetPlayer();
gPlayerState.mobility |= 0x80;
PositionRelative(this, &gPlayerEntity, 0, 0x10000);
PositionRelative(this, &gPlayerEntity, 0, Q_16_16(1.0));
pbVar3 = GetSpriteSubEntryOffsetDataPointer((u16)this->spriteIndex, this->frameIndex);
gPlayerEntity.spriteOffsetX = pbVar3[0];
gPlayerEntity.spriteOffsetY = pbVar3[1] - 1;
@@ -240,7 +240,7 @@ void sub_080296D8(Entity* this) {
gPlayerState.jump_status = 0x41;
gPlayerState.flags &= ~PL_CAPTURED;
gPlayerEntity.flags |= 0x80;
gPlayerEntity.zVelocity = 0x18000;
gPlayerEntity.zVelocity = Q_16_16(1.5);
gPlayerEntity.iframes = 0xa6;
gPlayerEntity.z.HALF.HI = -2;
gPlayerEntity.direction = gPlayerEntity.animationState << 2;
+2 -2
View File
@@ -124,7 +124,7 @@ void sub_08023CE0(Entity* this) {
EnqueueSFX(0x12d);
InitializeAnimation(this, 4);
}
} else if (!GravityUpdate(this, 0x1800)) {
} else if (!GravityUpdate(this, Q_8_8(24))) {
this->action = 3;
this->spriteSettings.draw = 1;
EnqueueSFX(0x84);
@@ -169,7 +169,7 @@ void sub_08023E54(Entity* this) {
ent = CreateEnemy(SLUGGULA, 2);
if (ent) {
const s8* ptr = &gUnk_080CBDF7[this->animationState * 2];
PositionRelative(this, ent, ptr[0] << 0x10, ptr[1] << 0x10);
PositionRelative(this, ent, Q_16_16(ptr[0]), Q_16_16(ptr[1]));
}
}
}
+2 -2
View File
@@ -54,7 +54,7 @@ void sub_0802B628(Entity* this) {
case 0x1d:
if (this->action < 6) {
this->action = 6;
this->zVelocity = 0x18000;
this->zVelocity = Q_16_16(1.5);
this->speed = 0xc0;
this->direction = this->knockbackDirection;
this->knockbackDuration = 0;
@@ -171,7 +171,7 @@ void sub_0802B8E0(Entity* this) {
}
} else {
this->action = 8;
this->zVelocity = 0x10000;
this->zVelocity = Q_16_16(1.0);
this->speed = 0x60;
this->hitType = 99;
InitializeAnimation(this, this->animationState);
+5 -5
View File
@@ -93,7 +93,7 @@ void sub_080225A0(Entity* this) {
}
void sub_080225BC(Entity* this) {
GravityUpdate(this, 0x1800);
GravityUpdate(this, Q_8_8(24.0));
if (this->frame & 1) {
sub_0804A7D4(this);
} else {
@@ -132,7 +132,7 @@ void sub_08022654(Entity* this) {
InitializeAnimation(this, 0);
/* fallthrough */
case 1:
if (GravityUpdate(this, 0x1800))
if (GravityUpdate(this, Q_8_8(24.0)))
return;
this->subAction = 2;
@@ -163,7 +163,7 @@ void sub_080226EC(Entity* this) {
if (sub_080228F0(this)) {
this->action = 6;
this->zVelocity = 0x12000;
this->zVelocity = Q_16_16(1.125);
this->speed = 0x140;
this->direction = GetFacingDirection(this, gUnk_020000B0);
this->hitType = 0x5a;
@@ -211,7 +211,7 @@ void sub_080227AC(Entity* this) {
}
void sub_0802281C(Entity* this) {
GravityUpdate(this, 0x1800);
GravityUpdate(this, Q_8_8(24.0));
GetNextFrame(this);
if (this->frame & 0x80) {
this->action = 2;
@@ -225,7 +225,7 @@ void sub_08022854(Entity* this) {
GetNextFrame(this);
if (this->frame & 1) {
sub_080AEFE0(this);
if (GravityUpdate(this, 0x1800) == 0) {
if (GravityUpdate(this, Q_8_8(24.0)) == 0) {
this->action = 7;
this->hitType = 0x5c;
InitializeAnimation(this, 5);
+2 -2
View File
@@ -89,7 +89,7 @@ void sub_08037Fe0(Entity* this) {
this->action = 2;
this->actionDelay = 6;
this->field_0xf = 0;
this->zVelocity = 0x38000;
this->zVelocity = Q_16_16(3.5);
sub_08038168(this);
InitializeAnimation(this, 2);
}
@@ -145,7 +145,7 @@ void sub_08038110(Entity* this) {
if (this->field_0x80.HALF.LO < 5) {
this->action = 2;
this->actionDelay = 8;
this->zVelocity = 0x38000;
this->zVelocity = Q_16_16(3.5);
sub_08038168(this);
InitializeAnimation(this, 2);
} else {
+2 -2
View File
@@ -951,7 +951,7 @@ void sub_08043490(Entity* this) {
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4];
if (entity->z.HALF.HI < -4) {
entity->zVelocity = 0x18000;
entity->zVelocity = Q_16_16(1.5);
this->subAction = 2;
this->field_0x7c.BYTES.byte2 = 0;
((VaatiArm_HeapStruct*)this->myHeap)->parent->subAction = 2;
@@ -976,7 +976,7 @@ void sub_08043520(Entity* this) {
Entity* entity;
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4];
GravityUpdate(entity, 0x1a00);
GravityUpdate(entity, Q_8_8(26.0));
if ((entity->zVelocity < 0) && (-6 < entity->z.HALF.HI)) {
entity->z.HALF.HI = -6;
this->subAction = 3;
+5 -5
View File
@@ -71,7 +71,7 @@ void sub_0804468C(Entity* this) {
this->field_0x82.HALF.HI = 0;
this->spriteSettings.draw = 0;
off = &gUnk_080D1620[this->field_0x78.HALF.HI & 3];
PositionRelative(this->parent, this, off->h << 0x10, (off->v - 0x10) * 0x10000);
PositionRelative(this->parent, this, Q_16_16(off->h), Q_16_16(off->v - 0x10));
this->z.HALF.HI = this->parent->z.HALF.HI;
InitAnimationForceUpdate(this, 0);
break;
@@ -397,7 +397,7 @@ void sub_08044B04(Entity* this) {
this->field_0x74.HALF.LO = 1;
this->actionDelay = 80;
COLLISION_OFF(this);
PositionRelative(vaati, this, 0, -0x100000);
PositionRelative(vaati, this, 0, Q_16_16(-16.0));
if (this->field_0xf)
this->spriteSettings.draw = 0;
break;
@@ -463,7 +463,7 @@ void sub_08044DEC(Entity* this) {
this->speed = 0x300;
off = this->parent->field_0x80.HALF.LO - 1;
this->direction = gUnk_080D1628[off][this->field_0x78.HALF.HI];
PositionRelative(this->parent, this, 0, -0x100000);
PositionRelative(this->parent, this, 0, Q_16_16(-16.0));
}
void sub_08044E74(Entity* this, u32 state) {
@@ -475,7 +475,7 @@ void sub_08044E74(Entity* this, u32 state) {
this->action = 2;
this->direction += 0x18;
this->direction &= 0x1f;
PositionRelative(this->parent, this, 0, -0x100000);
PositionRelative(this->parent, this, 0, Q_16_16(-16.0));
this->speed = 12288;
LinearMoveUpdate(this);
this->direction += 0x8;
@@ -509,5 +509,5 @@ void sub_08044E74(Entity* this, u32 state) {
}
this->actionDelay = 1;
this->field_0x78.HALF.LO = 0;
this->speed = 1280;
this->speed = Q_8_8(5);
}
+2 -2
View File
@@ -121,7 +121,7 @@ void VaatiProjectileFunction0Action0(Entity* this) {
this->spriteOrientation.flipY = this->parent->spriteOrientation.flipY;
this->spriteRendering.b3 = this->parent->spriteRendering.b3;
this->spritePriority.b1 = 0;
PositionRelative(this->parent, this, 0, -0x10000);
PositionRelative(this->parent, this, 0, Q_16_16(-1.0));
InitializeAnimation(this, 1);
}
}
@@ -207,7 +207,7 @@ void VaatiProjectileFunction0Action8(Entity* this) {
if (this->parent->next == NULL) {
DeleteThisEntity();
}
PositionRelative(this->parent, this, 0, -0x10000);
PositionRelative(this->parent, this, 0, Q_16_16(-1.0));
GetNextFrame(this);
}
+8 -8
View File
@@ -135,7 +135,7 @@ void VaatiRebornEnemyType0Action0(Entity* this) {
entity->parent = this;
entity->spriteSettings.flipX = i;
ptr = &gUnk_080D04A8[i];
PositionRelative(this, entity, ptr->x << 0x10, ptr->y << 0x10);
PositionRelative(this, entity, Q_16_16(ptr->x), Q_16_16(ptr->y));
}
InitAnimationForceUpdate(this, 0);
}
@@ -292,7 +292,7 @@ void VaatiRebornEnemyType0Action3(Entity* this) {
break;
case 0xff:
if (this->z.HALF.HI != -4) {
this->z.WORD -= 0x2000;
this->z.WORD -= Q_16_16(0.125);
}
if (this->actionDelay == 2) {
this->field_0x74.HALF.LO = 0xfe;
@@ -442,7 +442,7 @@ void VaatiRebornEnemyType0Action6(Entity* this) {
SoundReq(SFX_150);
target = CreateProjectileWithParent(this, 0x18, 0);
if (target != NULL) {
PositionRelative(this, target, 0, -0x100000);
PositionRelative(this, target, 0, Q_16_16(-16.0));
target->parent = this;
}
} else if (this->actionDelay == 0x40) {
@@ -500,7 +500,7 @@ void VaatiRebornEnemyType1Action0(Entity* this) {
this->field_0x74.HALF.HI = 1;
this->actionDelay = 0;
this->spriteOffsetY = -1;
PositionRelative(this->parent, this, 0, 0x10000);
PositionRelative(this->parent, this, 0, Q_16_16(1.0));
enemy = CreateEnemy(VAATI_REBORN_ENEMY, 2);
enemy->parent = this;
enemy->child = this->parent;
@@ -546,7 +546,7 @@ void VaatiRebornEnemyType1Action1(Entity* this) {
}
this->spriteSettings.draw = parent->spriteSettings.draw;
this->spriteOffsetX = parent->spriteOffsetX;
PositionRelative(this->parent, this, 0, 0x10000);
PositionRelative(this->parent, this, 0, Q_16_16(1.0));
UpdateAnimationSingleFrame(this);
}
@@ -559,7 +559,7 @@ void VaatiRebornEnemyType2Action0(Entity* this) {
this->field_0x74.HALF.HI = 0;
this->spriteOffsetY = -2;
this->direction = 0xff;
PositionRelative(source, this, 0, 0x20000);
PositionRelative(source, this, 0, Q_16_16(2.0));
InitAnimationForceUpdate(this, 2);
}
@@ -595,7 +595,7 @@ void VaatiRebornEnemyType2Action1(Entity* this) {
}
this->spriteSettings.draw = parent->spriteSettings.draw;
this->spriteOffsetX = parent->spriteOffsetX;
PositionRelative(parent->parent, this, 0, 0x20000);
PositionRelative(parent->parent, this, 0, Q_16_16(2.0));
UpdateAnimationSingleFrame(this);
}
@@ -637,7 +637,7 @@ void sub_0803DC0C(Entity* this) {
tmp = &gUnk_080D04C8[this->actionDelay];
this->spriteSettings.draw = parent->spriteSettings.draw;
this->spriteOffsetX = parent->spriteOffsetX;
PositionRelative(parent, this, tmp->x << 0x10, (tmp->y + 1) * 0x10000);
PositionRelative(parent, this, Q_16_16(tmp->x), Q_16_16(tmp->y + 1));
UpdateAnimationSingleFrame(this);
}
+4 -4
View File
@@ -314,7 +314,7 @@ void VaatiTransfiguredType0Action3(Entity* this) {
if (this->actionDelay != 0) {
if (--this->actionDelay == 0) {
COLLISION_OFF(this);
this->zVelocity = 0x38000;
this->zVelocity = Q_16_16(3.5);
this->field_0xf = 0x10;
}
break;
@@ -380,12 +380,12 @@ void VaatiTransfiguredType0Action4(Entity* this) {
this->field_0x74.HALF.LO = 0;
this->actionDelay = 0x80;
this->field_0xf = 0;
this->zVelocity = 0x24000;
this->zVelocity = Q_16_16(2.25);
SoundReq(SFX_12B);
}
break;
case 1:
if (GravityUpdate(this, 0x2800) != 0)
if (GravityUpdate(this, Q_8_8(40)) != 0)
break;
this->field_0x80.HALF.LO += 1;
switch (this->cutsceneBeh.HALF.LO) {
@@ -1062,7 +1062,7 @@ void sub_080409B0(Entity* this) {
this->field_0x80.HALF.HI = 3;
COLLISION_OFF(this);
this->hitType = 0x36;
this->zVelocity = 0x18000;
this->zVelocity = Q_16_16(1.5);
SoundReq(SFX_164);
}
}
+2 -2
View File
@@ -215,7 +215,7 @@ void VaatiTransfiguredEyeFunction0Action4(Entity* this) {
void sub_08045A00(Entity* this) {
const struct xy* t = &gUnk_080D18B4[this->type2];
PositionRelative(this->parent, this, t->x << 0x10, (t->y + 3) * 0x10000);
PositionRelative(this->parent, this, Q_16_16(t->x), Q_16_16(t->y + 3));
}
void sub_08045A28(Entity* this) {
@@ -291,7 +291,7 @@ void sub_08045A28(Entity* this) {
break;
}
} else {
PositionRelative(this->parent, this, 0, -0x10000);
PositionRelative(this->parent, this, 0, Q_16_16(-1.0));
switch (this->field_0x82.HALF.HI) {
case 0:
switch (this->frame & 0x70) {
+1 -1
View File
@@ -453,7 +453,7 @@ void VaatiWrathType0ActionA(Entity* this) {
this->subAction = 0;
this->direction = 0;
this->speed = 0x100;
this->zVelocity = 0x12000;
this->zVelocity = Q_16_16(1.125);
ChangeObjPalette(this, 0x16b);
InitAnimationForceUpdate(this, 5);
type1 = ((VaatiWrathHeapStruct*)this->myHeap)->type1;
+1 -1
View File
@@ -148,7 +148,7 @@ void VaatiWrathEyeAction6(Entity* this) {
if (pEVar3 != NULL) {
pEVar3->parent = this;
this->child = pEVar3;
PositionRelative(this, pEVar3, 0, 0xc0000);
PositionRelative(this, pEVar3, 0, Q_16_16(12.0));
}
}
}
+1 -1
View File
@@ -26,7 +26,7 @@ void sub_0802A250(Entity* this) {
this->action = 1;
this->actionDelay = 0;
this->zVelocity = -0x30000;
this->zVelocity = Q_16_16(-3.0);
this->speed = gUnk_080CD03C[Random() & 3];
this->direction = gUnk_080CD040[Random() & 3] + 0x18;
this->collisionLayer = 2;
+1 -1
View File
@@ -68,7 +68,7 @@ void sub_08076758(ItemBehavior* this, u32 arg1) {
if ((gPlayerEntity.zVelocity < 1) && ((gPlayerState.jump_status & 0x10) == 0)) {
this->stateID = 2;
gPlayerEntity.field_0x7a.HWORD = 2;
gPlayerEntity.zVelocity = 0x20000;
gPlayerEntity.zVelocity = Q_16_16(2.0);
gPlayerState.jump_status |= 0x10;
gPlayerState.animation = 0x288;
SoundReq(SFX_172);
+1 -1
View File
@@ -275,7 +275,7 @@ void sub_0806D4C0(Entity* this, u32 param) {
if (npc != NULL) {
npc->parent = this;
CopyPosition(this, npc);
ResolveEntityOnTop(this, npc);
SortEntityAbove(this, npc);
SetDefaultPriority(npc, PRIO_MESSAGE);
}
}
+1 -1
View File
@@ -167,7 +167,7 @@ static void sub_08068BEC(Entity* this, u32 unused) {
target = CreateFx(this, FX_WHITE_SPLASH, 0);
if (target) {
target->spritePriority.b0 = 1;
PositionRelative(this, target, 0, -0x100000);
PositionRelative(this, target, 0, Q_16_16(-16.0));
SoundReq(SFX_FA);
}
}
+2 -2
View File
@@ -134,7 +134,7 @@ void sub_080675D4(Entity* this) {
ent->collisionLayer = this->collisionLayer;
ent->spriteOrientation.flipY = this->spriteOrientation.flipY;
ent->spriteRendering.b3 = this->spriteRendering.b3;
ResolveEntityOnTop(this, ent);
SortEntityAbove(this, ent);
}
};
gUnk = gUnk_08110E8A;
@@ -147,7 +147,7 @@ void sub_080675D4(Entity* this) {
ent->collisionLayer = this->collisionLayer;
ent->spriteOrientation.flipY = this->spriteOrientation.flipY;
ent->spriteRendering.b3 = this->spriteRendering.b3;
ResolveEntityOnTop(this, ent);
SortEntityAbove(this, ent);
}
};
if (this->subAction > 2) {
+1 -1
View File
@@ -75,7 +75,7 @@ void CuccoChick_Fusion(Entity* this) {
this->frameIndex = 1;
} else {
if (GravityUpdate(this, 0x3000) == 0) {
this->zVelocity = 0x10000;
this->zVelocity = Q_16_16(1.0);
}
}
}
+1 -1
View File
@@ -22,7 +22,7 @@ void DrLeft(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->frameIndex = 0;
ResolveEntityBelow(this, this);
SortEntityBelow(this, this);
}
}
}
+1 -1
View File
@@ -54,7 +54,7 @@ void sub_0806D96C(Entity* this) {
Entity* fx = CreateFx(this, FX_STEAM_EFC, 0);
if (fx != NULL) {
fx->spritePriority.b0 = 1;
PositionRelative(this, fx, 0, 0xFFE80000);
PositionRelative(this, fx, 0, Q_16_16(-24.0));
}
}
+6 -6
View File
@@ -70,11 +70,11 @@ void sub_080693D0(Entity* this) {
if (this->frame == 1) {
this->frame = 0;
sub_08069428(this, 0xFFF80000, createFx65);
sub_08069428(this, Q_16_16(-8.0), createFx65);
}
if (this->frame == 2) {
this->frame = 0;
sub_08069428(this, 0x80 << 12, createFx65);
sub_08069428(this, Q_16_16(8.0), createFx65);
}
}
}
@@ -82,14 +82,14 @@ void sub_080693D0(Entity* this) {
void sub_08069428(Entity* this, s32 offsetX, bool32 createFx65) {
Entity* fx = CreateFx(this, FX_ROCK, 0);
if (fx) {
PositionRelative(this, fx, offsetX, 0xFFF00000);
ResolveEntityOnTop(this, fx);
PositionRelative(this, fx, offsetX, Q_16_16(-16.0));
SortEntityAbove(this, fx);
}
if (createFx65 != 0) {
fx = CreateFx(this, FX_REFLECT4, 0);
if (fx) {
PositionRelative(this, fx, offsetX, 0xFFF00000);
ResolveEntityOnTop(this, fx);
PositionRelative(this, fx, offsetX, Q_16_16(-16.0));
SortEntityAbove(this, fx);
}
}
}
+2 -2
View File
@@ -22,13 +22,13 @@ void sub_0806CAF4(Entity* this) {
if (npc != NULL) {
npc->parent = this;
CopyPosition(this, npc);
ResolveEntityBelow(this, npc);
SortEntityBelow(this, npc);
}
npc = CreateNPC(0x4a, 2, 0);
if (npc != NULL) {
npc->parent = this;
CopyPosition(this, npc);
ResolveEntityOnTop(this, npc);
SortEntityAbove(this, npc);
}
sub_0807DD64(this);
sub_08078778(this);
+1 -1
View File
@@ -243,7 +243,7 @@ void sub_080626E0(Entity* this, ScriptExecutionContext* context) {
uVar4 = Random();
this->direction = (this->direction + uVar4 % 0xb) - 5;
}
sub_0806F62C(this, (s32)this->speed, (u32)this->direction);
LinearMoveAngle(this, (s32)this->speed, (u32)this->direction);
if ((u32)((this->x.HALF.HI - context->x.HALF.HI) * 0x100 + ((s32)((u32)(u16)this->speed << 0x10) >> 0x11)) <=
(u32)(s32)this->speed) {
this->x.HALF.HI = context->x.HALF.HI;
+2 -2
View File
@@ -58,12 +58,12 @@ void sub_08065914(Entity* this) {
target = FindEntityByID(7, 0x1F, 7);
if (target != NULL) {
PositionRelative(this, target, 0x180000, -0x10000);
PositionRelative(this, target, Q_16_16(24.0), Q_16_16(-1.0));
target->parent = this;
}
target = FindEntityByID(7, 0x20, 7);
if (target != NULL) {
PositionRelative(this, target, 0x280000, 0);
PositionRelative(this, target, Q_16_16(40.0), 0);
target->parent = this;
}
}
+1 -1
View File
@@ -86,7 +86,7 @@ void sub_08068780(Entity* this) {
}
ent = CreateFx(this, FX_STARS2, 0x20);
if (ent != NULL) {
PositionRelative(this, ent, 0x180000, -0xa0000);
PositionRelative(this, ent, Q_16_16(24.0), Q_16_16(-10.0));
}
}
}
+2 -2
View File
@@ -140,12 +140,12 @@ void sub_0806DB84(Entity* this, ScriptExecutionContext* context) {
this->hitbox = (Hitbox*)&gUnk_08114154;
ent = CreateObject(OBJECT_3E, 4, 0);
if (ent != NULL) {
PositionRelative(this, ent, -0x80000, 0);
PositionRelative(this, ent, Q_16_16(-8.0), 0);
*(ScriptExecutionContext**)&ent->cutsceneBeh = StartCutscene(ent, &script_Object3ELeftStoneOpening);
}
ent = CreateObject(OBJECT_3E, 5, 0);
if (ent != NULL) {
PositionRelative(this, ent, 0x80000, 0);
PositionRelative(this, ent, Q_16_16(8.0), 0);
*(ScriptExecutionContext**)&ent->cutsceneBeh = StartCutscene(ent, &script_Object3ERightStoneOpening);
}
}
+1 -1
View File
@@ -12,7 +12,7 @@ void Pita(Entity* this) {
if (this->action == 0) {
this->action += 1;
SetDefaultPriority(this, PRIO_MESSAGE);
ResolveEntityOnTop(this, this);
SortEntityAbove(this, this);
this->hitbox = &gUnk_0810C428;
sub_0807DD64(this);
}
+1 -1
View File
@@ -143,7 +143,7 @@ void sub_08060528(Entity* this) {
if (0 < (s16)this->field_0x6a.HWORD) {
if ((s16)this->field_0x6a.HWORD > 0x12b) {
this->field_0x6a.HWORD = 0;
this->zVelocity = 0x20000;
this->zVelocity = Q_16_16(2.0);
this->field_0x6c.HALF.HI = 1;
sub_080788E0(this);
EnqueueSFX(0x7c);
+2 -2
View File
@@ -235,7 +235,7 @@ void sub_0806A914(Entity* this) {
Entity* npc = CreateNPC(0x37, 1, 0);
if (npc != NULL) {
CopyPosition(this, npc);
ResolveEntityOnTop(this, npc);
SortEntityAbove(this, npc);
}
}
@@ -279,7 +279,7 @@ void sub_0806A9E8(Entity* this) {
Entity* npc = CreateNPC(0x37, 4, 0);
if (npc != NULL) {
CopyPosition(this, npc);
ResolveEntityBelow(this, npc);
SortEntityBelow(this, npc);
}
}
+2 -2
View File
@@ -216,7 +216,7 @@ void sub_0806AF60(Entity* this, ScriptExecutionContext* context) {
}
void sub_0806AF70(Entity* this, ScriptExecutionContext* context) {
this->zVelocity = 0x24000;
this->zVelocity = Q_16_16(2.25);
}
void sub_0806AF78(Entity* this, ScriptExecutionContext* context) {
@@ -229,7 +229,7 @@ void sub_0806AF78(Entity* this, ScriptExecutionContext* context) {
void sub_0806AFA0(Entity* this) {
if (sub_0806ED78(this)) {
sub_0806F62C(this, -this->speed, this->direction);
LinearMoveAngle(this, -this->speed, this->direction);
}
}
+1 -1
View File
@@ -220,7 +220,7 @@ void sub_08061F94(Entity* this) {
ent = CreateFx(this, FX_BIG_EXPLOSION, 0);
if (ent != NULL) {
ResolveEntityOnTop(this, ent);
SortEntityAbove(this, ent);
}
}
+3 -3
View File
@@ -44,7 +44,7 @@ void VaatiRebornAction0(Entity* this) {
entity = CreateNPC(VAATI_REBORN, 1, 0);
entity->parent = this;
entity->spriteOffsetY = -1;
PositionRelative(this, entity, 0, 0x10000);
PositionRelative(this, entity, 0, Q_16_16(1.0));
InitAnimationForceUpdate(this, 0);
break;
case 1:
@@ -115,7 +115,7 @@ void VaatiRebornAction1(Entity* this) {
if (entity == NULL) {
DeleteThisEntity();
}
PositionRelative(entity, this, 0, 0x210000);
PositionRelative(entity, this, 0, Q_16_16(33.0));
UpdateAnimationSingleFrame(this);
break;
case 2:
@@ -194,7 +194,7 @@ void sub_0806B96C(Entity* this) {
}
ptr = &gUnk_08112F80[this->type2];
this->spriteSettings.draw = entity->spriteSettings.draw;
PositionRelative(entity, this, ptr->x << 0x10, (ptr->y + 0x21) << 0x10);
PositionRelative(entity, this, Q_16_16(ptr->x), Q_16_16(ptr->y + 0x21));
UpdateAnimationSingleFrame(this);
}
+1 -1
View File
@@ -7,7 +7,7 @@ void Wheaton(Entity* this) {
this->action++;
SetDefaultPriority(this, PRIO_MESSAGE);
ResolveEntityOnTop(this, this);
SortEntityAbove(this, this);
this->hitbox = &gUnk_0810C3C0;
this->spriteOffsetY = 0xfe;
sub_0807DD64(this);
+3 -3
View File
@@ -127,13 +127,13 @@ void sub_08066E80(Entity* this, ScriptExecutionContext* context) {
UpdateAnimationSingleFrame(this);
if (this->frame & 1) {
context->unk_18++;
this->zVelocity = 0x20000;
this->zVelocity = Q_16_16(2.0);
this->frame &= 0xFE;
SoundReq(SFX_PLY_JUMP);
}
break;
case 2:
sub_0806F62C(this, 0x100, 0x80);
LinearMoveAngle(this, 0x100, 0x80);
GravityUpdate(this, 0x2000);
if (!(this->frame & 1)) {
UpdateAnimationSingleFrame(this);
@@ -143,7 +143,7 @@ void sub_08066E80(Entity* this, ScriptExecutionContext* context) {
}
break;
case 3:
sub_0806F62C(this, 0x100, 0x80);
LinearMoveAngle(this, 0x100, 0x80);
UpdateAnimationSingleFrame(this);
if (GravityUpdate(this, 0x2000) == 0) {
context->unk_18++;
+1 -1
View File
@@ -24,7 +24,7 @@ void sub_0809CC74(Entity* this) {
ent = CreateObject(BAKER_OVEN, 1, i);
if (ent) {
ent->parent = this;
PositionRelative(this, ent, (((i + 1) / 2) * 0x100000) - 0x80000, -0xe0000);
PositionRelative(this, ent, 16 * Q_16_16((i + 1) / 2) - Q_16_16(8.0), Q_16_16(-14.0));
}
}
sub_0809CDF0(this);
+3 -3
View File
@@ -65,7 +65,7 @@ void sub_08098DC4(Entity* this) {
sub_08004542(this);
sub_08004542(&gPlayerEntity);
gPlayerEntity.collisionLayer = 1;
ResolveEntityOnTop(this, &gPlayerEntity);
SortEntityAbove(this, &gPlayerEntity);
gPlayerState.queued_action = PLAYER_PARACHUTE;
gPlayerState.field_0x34[4] = 1;
gPlayerState.field_0x34[5] = this->type2;
@@ -101,12 +101,12 @@ void sub_08098E88(Entity* this) {
ent1 = CreateObject(BIG_VORTEX, 1, 0);
if (ent1 != NULL) {
PositionRelative(this, ent1, 0, -0x10000);
PositionRelative(this, ent1, 0, Q_16_16(-1.0));
ent1->spriteOffsetY = 8;
}
ent2 = CreateObject(BIG_VORTEX, 2, 0);
if (ent2 != NULL) {
PositionRelative(this, ent2, 0, -0x20000);
PositionRelative(this, ent2, 0, Q_16_16(-2.0));
ent2->spriteOffsetY = 0x10;
}
}
+8 -8
View File
@@ -24,9 +24,9 @@ void sub_0809CF54(Entity* this) {
this->spriteSettings.draw = TRUE;
this->actionDelay = 0x31;
this->field_0xf = 1;
this->zVelocity = -0x18000;
this->z.WORD = -0x38C000;
this->field_0x68.HWORD = -0x800;
this->zVelocity = Q_16_16(-1.5);
this->z.WORD = Q_16_16(-56.75);
this->field_0x68.HWORD = Q_16_16(-0.03125);
this->speed = 0x280;
this->direction = 8;
this->collisionLayer = 2;
@@ -37,8 +37,8 @@ void sub_0809CF54(Entity* this) {
target = CreateObject(BIRD, 1, 0);
if (target != NULL) {
target->parent = this;
PositionRelative(this, target, 0, 0x80000);
ResolveEntityOnTop(this, target);
PositionRelative(this, target, 0, Q_16_16(8.0));
SortEntityAbove(this, target);
}
}
@@ -77,7 +77,7 @@ void sub_0809D084(Entity* this) {
if (this->parent != NULL) {
temp = this->parent->field_0xf;
if (temp != 0) {
PositionRelative(this->parent, this, 0, 0x80000);
PositionRelative(this->parent, this, 0, Q_16_16(8.0));
} else {
this->subAction++;
this->zVelocity = temp;
@@ -97,7 +97,7 @@ void sub_0809D0AC(Entity* this) {
SoundReq(SFX_SECRET);
fx = CreateFx(this, FX_DASH, 0);
if (fx != NULL) {
ResolveEntityBelow(this, fx);
SortEntityBelow(this, fx);
}
}
}
@@ -116,7 +116,7 @@ void sub_0809D10C(Entity* this) {
void sub_0809D130(Entity* this) {
if ((gPlayerState.flags & PL_MINISH) != 0) {
sub_0800445C(this);
} else if (sub_08017850(this) != 0) {
} else if (IsCollidingPlayer(this) != 0) {
CreateItemEntity(0x17, 0, 0);
gSave.windcrests |= 0x10000000;
DeleteThisEntity();
+2 -2
View File
@@ -134,14 +134,14 @@ void sub_0809B56C(Entity* this) {
fx = CreateFx(this, FX_DEATH, 0);
if (fx) {
ResolveEntityOnTop(this, fx);
SortEntityAbove(this, fx);
}
}
void sub_0809B5B4(Entity* this) {
if (gPlayerState.flags & PL_MINISH) {
sub_0800445C(this);
} else if (sub_08017850(this)) {
} else if (IsCollidingPlayer(this)) {
CreateItemEntity(this->type + 0x39, 0, 0);
DeleteThisEntity();
}
+2 -2
View File
@@ -90,7 +90,7 @@ void sub_08081C30(Entity* this) {
this->action = 2;
ClearFlag(this->field_0x86.HWORD);
SetTileType(0x77, this->field_0x74.HWORD, this->collisionLayer);
SoundReq(SFX_10C);
SoundReq(SFX_BUTTON_PRESS);
}
}
@@ -251,7 +251,7 @@ u32 sub_08081F7C(Entity* this, u32 r7) {
SetFlag(this->field_0x86.HWORD);
SetTileType(r7, this->field_0x74.HWORD, this->collisionLayer);
sub_08081F24(this);
SoundReq(SFX_10C);
SoundReq(SFX_BUTTON_PRESS);
if (this->field_0x70.HALF_U.LO != 0xFFFF)
SetTile(this->field_0x70.HALF_U.LO, this->field_0x74.HWORD, this->collisionLayer);
return 0;
+2 -2
View File
@@ -256,7 +256,7 @@ void sub_0808EB74(Entity* this) {
this->x.WORD = entity->x.WORD;
this->y.WORD = entity->y.WORD;
this->spriteRendering.b3 = entity->spriteRendering.b3;
ResolveEntityBelow(entity, this);
SortEntityBelow(entity, this);
} else {
this->x.HALF.HI = 0xF000;
this->y.HALF.HI = 0xF000;
@@ -306,7 +306,7 @@ void sub_0808EBB8(Entity* this) {
default:
entity = sub_0808EC80(var0);
if (entity) {
ResolveEntityBelow(entity, this);
SortEntityBelow(entity, this);
this->spriteRendering.b3 = entity->spriteRendering.b3;
x = entity->x.HALF.HI;
y = entity->y.HALF.HI;
+2 -2
View File
@@ -220,7 +220,7 @@ static void FurnitureInit(FurnitureEntity* this) {
case SMITH_FORGE:
e = CreateObject(FURNITURE, FORGE_HELPER, 0);
if (e != NULL) {
PositionRelative(super, e, 0x100000, 0x100000);
PositionRelative(super, e, Q_16_16(16.0), Q_16_16(16.0));
e->frameIndex = 1;
e->updatePriority = PRIO_MESSAGE;
}
@@ -451,7 +451,7 @@ static void sub_08090E4C(FurnitureEntity* this) {
void sub_08090E64(FurnitureEntity* this) {
Entity* e = CreateObject(OBJECT_2A, 0, 0);
if (e != NULL) {
PositionRelative(super, e, (s16)((u16)-2 + super->type2) * 0x10000, 0);
PositionRelative(super, e, Q_16_16((s16)((u16)-2 + super->type2)), 0);
e->z.HALF.HI -= 16;
e->collisionLayer = 2;
UpdateSpriteForCollisionLayer(e);
+7 -7
View File
@@ -92,8 +92,8 @@ void GreatFairy_DormantUpdate(Entity* this) {
case 289:
ripple = GreatFairy_CreateForm(this, RIPPLE, 0);
if (ripple) {
PositionRelative(this, ripple, (s32)GreatFairy_RippleOffsets[this->actionDelay] * 65536,
(s32)GreatFairy_RippleOffsets[this->actionDelay + 1] * 65536);
PositionRelative(this, ripple, Q_16_16(GreatFairy_RippleOffsets[this->actionDelay]),
Q_16_16(GreatFairy_RippleOffsets[this->actionDelay + 1]));
this->actionDelay += 2;
break;
}
@@ -105,7 +105,7 @@ void GreatFairy_CreateBigRipple(Entity* this) {
ripple = GreatFairy_CreateForm(this, BIGRIPPLE, 0);
if (ripple != NULL) {
PositionRelative(this, ripple, 0, 0x80000);
PositionRelative(this, ripple, 0, Q_16_16(8.0));
this->action = 3;
}
}
@@ -137,7 +137,7 @@ void GreatFairy_MiniUpdate(Entity* this) {
} else {
target = GreatFairy_CreateForm(this, WINGS, 0);
if (target != NULL) {
PositionRelative(this, target, 0, -0x140000);
PositionRelative(this, target, 0, Q_16_16(-20.0));
this->action = 5;
this->actionDelay = 120;
this->field_0xf = 0;
@@ -153,7 +153,7 @@ void GreatFairy_FinalUpdate(Entity* this) {
--this->actionDelay;
} else {
if ((this->field_0xf == 0) && (target = GreatFairy_CreateForm(this, FORM9, 0), target != NULL)) {
PositionRelative(this, target, 0, -0x4C0000);
PositionRelative(this, target, 0, Q_16_16(-76.0));
target->parent = this;
this->field_0xf = 1;
}
@@ -236,7 +236,7 @@ void GreatFairy_MiniRisingUpdate(Entity* this) {
} else {
if (((this->z.HALF.HI == -10) && (this->field_0xf == 0)) &&
(target = GreatFairy_CreateForm(this, DROPLET, 0), target != NULL)) {
PositionRelative(this, target, 0, 0x40000);
PositionRelative(this, target, 0, Q_16_16(4.0));
this->field_0xf = 1;
}
}
@@ -350,7 +350,7 @@ void GreatFairy_BigRippleUpdate(Entity* this) {
} else {
target = GreatFairy_CreateForm(this, MINI, 0);
if (target != NULL) {
PositionRelative(this, target, 0, -0x80000);
PositionRelative(this, target, 0, Q_16_16(-8.0));
gRoomVars.animFlags |= 2;
DeleteEntity(this);
}
+1 -1
View File
@@ -59,7 +59,7 @@ static void sub_0808E714(Entity* this) {
static void sub_0808E764(Entity* this) {
sub_08080CB4(this);
if (!(gPlayerState.flags & PL_MINISH) && sub_08017850(this)) {
if (!(gPlayerState.flags & PL_MINISH) && IsCollidingPlayer(this)) {
SetFlag(this->cutsceneBeh.HWORD);
CreateItemEntity(0x62, 0, 0);
DeleteThisEntity();
+7 -7
View File
@@ -18,7 +18,7 @@ void sub_080813BC(Entity*);
void sub_080810FC(Entity*);
bool32 CheckShouldPlayItemGetCutscene(Entity*);
extern u32 sub_080177A0(Entity*, Entity*);
extern u32 IsColliding(Entity*, Entity*);
extern void GiveItem(u32, u32);
extern void (*const gUnk_0811E7D4[])(Entity*);
@@ -149,7 +149,7 @@ void sub_080810A8(Entity* this) {
}
if (this->zVelocity == 0) {
this->zVelocity = 0x1E000;
this->zVelocity = Q_16_16(1.875);
}
if (this->collisionLayer == 2) {
@@ -269,10 +269,10 @@ void sub_080812A8(Entity* this) {
void sub_080812E8(Entity* this) {
PlayerState* playerState = &gPlayerState;
#ifdef EU
if ((playerState->swim_state & 0x80) && sub_080177A0(this, &gPlayerEntity)) {
if ((playerState->swim_state & 0x80) && IsColliding(this, &gPlayerEntity)) {
#else
if ((playerState->swim_state & 0x80) && (playerState->flags & PL_MINISH) == 0 &&
sub_080177A0(this, &gPlayerEntity)) {
IsColliding(this, &gPlayerEntity)) {
#endif
sub_080810FC(this);
}
@@ -289,7 +289,7 @@ void sub_08081328(Entity* this) {
CopyPosition(other, this);
this->z.HALF.HI--;
other = &gPlayerEntity;
if (sub_080177A0(this, other)) {
if (IsColliding(this, other)) {
sub_080810FC(this);
}
}
@@ -412,7 +412,7 @@ void sub_0808153C(Entity* this) {
if (this->field_0x68.HALF.LO == 0) {
if (!GravityUpdate(this, 0x1000) && !sub_0800442E(this)) {
this->field_0x68.HALF.LO = 1;
this->zVelocity = 0x1E000;
this->zVelocity = Q_16_16(1.875);
sub_0808148C(this->type);
UpdateSpriteForCollisionLayer(this);
}
@@ -432,7 +432,7 @@ void sub_08081598(Entity* this) {
COLLISION_OFF(this);
this->action = 4;
this->actionDelay = 14;
this->zVelocity = 0x20000;
this->zVelocity = Q_16_16(2.0);
this->spriteSettings.draw = 1;
this->spritePriority.b1 = 2;
this->spritePriority.b0 = 3;
+5 -5
View File
@@ -60,7 +60,7 @@ void sub_0808BF58(Entity* this) {
GravityUpdate(this, 0x2000);
switch (this->subAction) {
case 0:
if (this->zVelocity <= 98303) {
if (this->zVelocity < Q_16_16(1.5)) {
++this->subAction;
InitAnimationForceUpdate(this, 2);
}
@@ -69,7 +69,7 @@ void sub_0808BF58(Entity* this) {
UpdateAnimationSingleFrame(this);
if (!this->z.HALF.HI) {
++this->subAction;
this->zVelocity = 0x8000;
this->zVelocity = Q_16_16(0.5);
}
break;
case 2:
@@ -128,7 +128,7 @@ void sub_0808C0AC(Entity* this) {
GravityUpdate(this, 0x2000);
switch (this->subAction) {
case 0:
if (this->zVelocity <= 98303) {
if (this->zVelocity < Q_16_16(1.5)) {
this->subAction = 1;
InitAnimationForceUpdate(this, 3);
}
@@ -137,7 +137,7 @@ void sub_0808C0AC(Entity* this) {
UpdateAnimationSingleFrame(this);
if (!this->z.HALF.HI) {
++this->subAction;
this->zVelocity = 0x8000;
this->zVelocity = Q_16_16(0.5);
}
break;
case 2:
@@ -157,7 +157,7 @@ u32 sub_0808C128(Entity* this) {
void sub_0808C13C(Entity* this) {
this->subAction = 0;
this->zVelocity = 163840;
this->zVelocity = Q_16_16(2.5);
}
void sub_0808C148(Entity* this, u32 a2) {
+1 -1
View File
@@ -163,7 +163,7 @@ void sub_08085B40(LilypadLargeEntity* this) {
ResetCollisionLayer(&gPlayerEntity);
sub_08085CDC(this);
super->direction = GetFacingDirection(&gPlayerEntity, super);
sub_0806F5BC(&gPlayerEntity, 0x100, super->direction);
LinearMoveDirection(&gPlayerEntity, 0x100, super->direction);
}
}
+1 -1
View File
@@ -39,7 +39,7 @@ void sub_080929A4(Entity* this) {
}
this->action = 1;
this->zVelocity = 0x18000;
this->zVelocity = Q_16_16(1.5);
this->field_0x78.HWORD = ((Random() & 7) << 10) | 0x2000;
+3 -3
View File
@@ -45,7 +45,7 @@ void sub_080916EC(Entity* this) {
void sub_080917DC(Entity* this) {
if ((this->bitfield & 0x7f) == 0x1d) {
this->zVelocity = 0x2a000;
this->zVelocity = Q_16_16(2.625);
this->action = 7;
InitAnimationForceUpdate(this, this->type2 + 4 + this->animationState);
SoundReq(SFX_13B);
@@ -65,7 +65,7 @@ void sub_080917DC(Entity* this) {
this->action++;
gPlayerState.jump_status = 0x81;
gPlayerState.flags |= PL_ENTER_MINECART;
gPlayerEntity.zVelocity = 0x20000;
gPlayerEntity.zVelocity = Q_16_16(2.0);
gPlayerEntity.speed = 0x100;
gPlayerEntity.flags &= ~PL_MINISH;
ResetPlayer();
@@ -160,7 +160,7 @@ void sub_080919AC(Entity* this) {
sub_08017744(this);
gPlayerState.jump_status = 0x41;
gPlayerState.flags = (gPlayerState.flags ^ PL_IN_MINECART) | PL_ENTER_MINECART;
gPlayerEntity.zVelocity = 0x20000;
gPlayerEntity.zVelocity = Q_16_16(2.0);
gPlayerEntity.speed = 0x200;
gPlayerEntity.animationState = this->animationState << 1;
gPlayerEntity.direction = this->direction;
+2 -2
View File
@@ -178,14 +178,14 @@ void sub_0808F3DC(Entity* this) {
// TODO: This block of code might supposed to be a switch statement.
if (this->type != 8) {
if (this->type == 7) {
ResolveEntityBelow(this->child, this);
SortEntityBelow(this->child, this);
return;
}
} else {
this->hitType = this->child->hitType;
this->child->hitType = 0x7E;
}
ResolveEntityOnTop(this->child, this);
SortEntityAbove(this->child, this);
} else {
if (*(u32*)&this->parent->field_0x74 == 0) {
if (this->type == 8) {
+31 -31
View File
@@ -237,7 +237,7 @@ void sub_08094C88(Object6AEntity* this) {
case 0x41:
case 0x42:
case 0x43:
ResolveEntityBelow(super, super);
SortEntityBelow(super, super);
}
}
@@ -250,8 +250,8 @@ void sub_08094C88(Object6AEntity* this) {
void sub_08094CDC(Object6AEntity* this) {
Entity* e = CreateObject(0x6a, 3, 0x62);
if (e != NULL) {
e->x.HALF.HI = gRoomControls.origin_x + 224;
e->y.HALF.HI = gRoomControls.origin_y + 600;
e->x.HALF.HI = gRoomControls.origin_x + Q_8_8(7.0 / 8.0);
e->y.HALF.HI = gRoomControls.origin_y + Q_8_8(2.345);
SoundReq(324);
}
}
@@ -266,8 +266,8 @@ void sub_08094D10(Object6AEntity* this) {
void sub_08094D34(Object6AEntity* this) {
Entity* e = CreateObject(0x6a, 0x15, 0xd);
if (e != NULL) {
e->x.HALF.HI = gRoomControls.origin_x + 256;
e->y.HALF.HI = gRoomControls.origin_y + 600;
e->x.HALF.HI = gRoomControls.origin_x + Q_8_8(1.0);
e->y.HALF.HI = gRoomControls.origin_y + Q_8_8(2.345);
SoundReq(324);
}
}
@@ -299,8 +299,8 @@ void sub_08094D94(Object6AEntity* this) {
void sub_08094DD8(Object6AEntity* this) {
Entity* e = CreateObject(0x6a, 0x4, 0);
if (e != NULL) {
e->x.HALF.HI = gRoomControls.origin_x + 240;
e->y.HALF.HI = gRoomControls.origin_y + 600;
e->x.HALF.HI = gRoomControls.origin_x + Q_8_8(15.0 / 16.0);
e->y.HALF.HI = gRoomControls.origin_y + Q_8_8(2.345);
SoundReq(324);
}
}
@@ -338,7 +338,7 @@ void sub_08094E30(Object6AEntity* this) {
break;
case 1:
super->z.WORD -= super->zVelocity;
super->zVelocity -= 0x2000;
super->zVelocity -= Q_8_8(32.0);
if (super->z.WORD > 0) {
super->action++;
super->z.WORD = 0;
@@ -355,7 +355,7 @@ void sub_08094E30(Object6AEntity* this) {
break;
case 3:
super->z.WORD -= super->zVelocity;
super->zVelocity -= 0x2000;
super->zVelocity -= Q_8_8(32.0);
if (!CheckOnScreen(super)) {
DeleteThisEntity();
}
@@ -473,7 +473,7 @@ void sub_08095120(Object6AEntity* this) {
if (super->action == 0) {
super->action = 1;
SetDefaultPriority(super, 3);
ResolveEntityBelow(super, super);
SortEntityBelow(super, super);
sub_0807DD64(super);
InitAnimationForceUpdate(super, 2);
}
@@ -493,7 +493,7 @@ void sub_08095188(Object6AEntity* this) {
if (super->action == 0) {
super->action = 1;
SetDefaultPriority(super, 3);
ResolveEntityBelow(super, super);
SortEntityBelow(super, super);
sub_0807DD64(super);
InitAnimationForceUpdate(super, 0);
}
@@ -535,7 +535,7 @@ void sub_08095244(Object6AEntity* this) {
Entity* e = CreateObject(OBJECT_6A, 0xA, 0);
if (e != NULL) {
e->parent = super;
PositionRelative(super, e, 0x100000, -0x100000);
PositionRelative(super, e, Q_16_16(16.0), -Q_16_16(16.0));
((Object6AEntity*)e)->ctx = StartCutscene(e, &script_Object6ASwordInChest);
}
}
@@ -583,7 +583,7 @@ void sub_08095330(Object6AEntity* this) {
e->parent = super;
CopyPosition(super, e);
e->z.HALF.HI = -16;
ResolveEntityOnTop(e, e);
SortEntityAbove(e, e);
}
}
@@ -597,7 +597,7 @@ void sub_08095364(Object6AEntity* this) {
e->subAction = 1;
e->z.HALF.HI = -16;
e->direction = 7;
e->zVelocity = 0x30000;
e->zVelocity = Q_16_16(3.0);
e->speed = 128;
InitAnimationForceUpdate(e, 1);
}
@@ -609,7 +609,7 @@ void sub_080953A4(Object6AEntity* this) {
super->z.HALF.HI = -16;
SetDefaultPriority(super, 2);
super->spriteRendering.b3 = gUnk_08114F30[super->spriteRendering.b3];
ResolveEntityOnTop(super, super);
SortEntityAbove(super, super);
sub_0807DD64(super);
}
ExecuteScriptForEntity(super, 0);
@@ -625,7 +625,7 @@ void sub_080953A4(Object6AEntity* this) {
void sub_08095420(Object6AEntity* this, ScriptExecutionContext* ctx) {
Entity* e = CreateObject(OBJECT_6A, 0xC, 0);
if (e != NULL) {
PositionRelative(super, e, 0, -0x100000);
PositionRelative(super, e, 0, Q_16_16(-16));
((Object6AEntity*)e)->ctx = StartCutscene(e, (u16*)ctx->intVariable);
}
}
@@ -637,7 +637,7 @@ void sub_0809545C(Object6AEntity* this, ScriptExecutionContext* ctx) {
Entity* p = CreateObject(OBJECT_6A, 0xD, 0);
Entity* e;
if (p != NULL) {
PositionRelative(super, p, 0, -0x100000);
PositionRelative(super, p, 0, Q_16_16(-16));
((Object6AEntity*)p)->ctx = StartCutscene(p, (u16*)ctx->intVariable);
e = CreateObject(OBJECT_6A, 2, 0);
if (e != NULL) {
@@ -692,7 +692,7 @@ void sub_080954DC(Object6AEntity* this) {
super->y.HALF.HI += this->py;
break;
case 3:
sub_0806F62C(super, super->speed, super->direction);
LinearMoveAngle(super, super->speed, super->direction);
break;
}
this->off += 4;
@@ -764,7 +764,7 @@ void sub_08095754(Object6AEntity* this) {
if (e != NULL) {
e->parent = super;
CopyPosition(super, e);
ResolveEntityBelow(super, e);
SortEntityBelow(super, e);
}
}
@@ -784,7 +784,7 @@ void sub_080957B4(Object6AEntity* this) {
if (e != NULL) {
e->parent = super;
CopyPosition(super, e);
ResolveEntityBelow(super, e);
SortEntityBelow(super, e);
}
}
@@ -804,7 +804,7 @@ void sub_08095810(Object6AEntity* this) {
if (e != NULL) {
e->parent = super;
CopyPosition(super, e);
ResolveEntityOnTop(super, e);
SortEntityAbove(super, e);
((Object6AEntity*)e)->ctx = StartCutscene(e, &script_ZeldaMagic);
}
}
@@ -1084,12 +1084,12 @@ void sub_08095DBC(Object6AEntity* this) {
super->spriteSettings.draw = 1;
InitializeAnimation(super, 75);
super->spriteRendering.b3 = gUnk_08114F30[super->spriteRendering.b3];
ResolveEntityOnTop(super, super);
SortEntityAbove(super, super);
}
if ((super->type2 & 0x80) == 0 && gActiveScriptInfo.syncFlags & 0x20000) {
super->type2 = -1;
super->zVelocity = 0x40000;
super->speed = 0xC000;
super->zVelocity = Q_16_16(4.0);
super->speed = Q_8_8(192);
}
GravityUpdate(super, super->speed);
GetNextFrame(super);
@@ -1128,7 +1128,7 @@ NONMATCH("asm/non_matching/object6A/sub_08095EAC.inc",
x = a - (Random() & b);
y = a - (Random() & b);
PositionRelative(super, e, x << 16, y << 16);
PositionRelative(super, e, Q_16_16(x), Q_16_16(y));
super->zVelocity = vel;
super->speed = speed;
}
@@ -1220,7 +1220,7 @@ void sub_080960C4(Object6AEntity* this, ScriptExecutionContext* ctx) {
e->parent = super;
CopyPosition(super, e);
e->spriteRendering.b3 = gUnk_08114F34[super->spriteRendering.b3];
ResolveEntityBelow(super, e);
SortEntityBelow(super, e);
((Object6AEntity*)e)->ctx = StartCutscene(e, (u16*)ctx->intVariable);
}
e = CreateObject(OBJECT_6A, 0x24, 0x4A);
@@ -1228,7 +1228,7 @@ void sub_080960C4(Object6AEntity* this, ScriptExecutionContext* ctx) {
e->parent = super;
CopyPosition(super, e);
e->spriteRendering.b3 = gUnk_08114F30[super->spriteRendering.b3];
ResolveEntityOnTop(super, e);
SortEntityAbove(super, e);
e->collisionLayer = 2;
((Object6AEntity*)e)->ctx = StartCutscene(e, (u16*)ctx->intVariable);
}
@@ -1241,7 +1241,7 @@ void sub_08096168(Object6AEntity* this) {
InitializeAnimation(super, 75);
}
GetNextFrame(super);
sub_0806F62C(super, super->speed, super->direction);
LinearMoveAngle(super, super->speed, super->direction);
if (!CheckOnScreen(super))
DeleteThisEntity();
}
@@ -1267,21 +1267,21 @@ void sub_08096208(Object6AEntity* this, u32 x) {
s8* p = &gUnk_08122B2E[x * 2];
Entity* e = CreateObject(OBJECT_6A, 0x26, 0);
if (e != NULL) {
PositionRelative(super, e, p[0] << 16, p[1] << 16);
PositionRelative(super, e, Q_16_16(p[0]), Q_16_16(p[1]));
}
}
void sub_0809623C(Object6AEntity* this) {
Entity* e = CreateObject(OBJECT_6A, 0x27, 0);
if (e != NULL) {
PositionRelative(super, e, 0, -0x100000);
PositionRelative(super, e, 0, Q_16_16(-16.0));
}
}
void sub_08096260(Object6AEntity* this) {
Entity* e = CreateObject(OBJECT_6A, 0x28, 0);
if (e != NULL) {
PositionRelative(super, e, 0, -0x100000);
PositionRelative(super, e, 0, Q_16_16(-16.0));
}
}
+1 -1
View File
@@ -17,7 +17,7 @@ void Object7E(Entity* this) {
this->spriteSettings.flipX = TRUE;
}
}
PositionRelative(this->parent, this, 0, 0x80000);
PositionRelative(this->parent, this, 0, Q_16_16(8.0));
this->z.HALF.HI = 0;
if (this->type != 0) {
this->spriteSettings.draw = this->child->spriteSettings.draw;
+5 -3
View File
@@ -25,14 +25,16 @@ void ObjectA2(Entity* this) {
GetNextFrame(this);
}
#define fp(n) ((n) << 8)
void sub_0809F318(Entity* this) {
InitializeAnimation(this, 0);
if (Random() & 0x10) {
this->spriteSettings.flipX = 1;
}
this->x.HALF.HI = 0x28;
this->y.HALF.HI = 0x48;
this->z.HALF.HI = 0xFFB0;
this->x.HALF.HI = Q_8_8(0.16);
this->y.HALF.HI = Q_8_8(0.285);
this->z.HALF.HI = Q_8_8(-0.315);
this->spriteOrientation.flipY = 2;
this->action = 1;
ChangeObjPalette(this, gUnk_08124704[this->type]);
+1 -1
View File
@@ -47,7 +47,7 @@ void sub_080A0624(Entity* this) {
void sub_080A0640(Entity* this) {
if (this->type == 0) {
PositionRelative(*(((Entity**)this->parent->myHeap) + 4), this, 0, 0x80000);
PositionRelative(*(((Entity**)this->parent->myHeap) + 4), this, 0, Q_16_16(8.0));
} else {
CopyPosition(this->parent, this);
}
+1 -1
View File
@@ -10,5 +10,5 @@ void ObjectB5(Entity* this) {
#ifndef EU
gRoomControls.camera_target = this;
#endif
PositionRelative(&gPlayerEntity, this, 0, -0x280000);
PositionRelative(&gPlayerEntity, this, 0, Q_16_16(-40.0));
}
+14 -13
View File
@@ -76,14 +76,14 @@ void OctorokBossObject_Init(Entity* this) {
}
this->speed = 0xf0 - (Random() & 0x3f);
sub_0806F62C(this, ((s16)this->speed >> 1) << 8, (u32)this->direction);
sub_0806F62C(this, ((s16)this->speed >> 1) << 8, (u32)this->direction);
LinearMoveAngle(this, ((s16)this->speed >> 1) << 8, (u32)this->direction);
LinearMoveAngle(this, ((s16)this->speed >> 1) << 8, (u32)this->direction);
InitializeAnimation(this, 5);
SoundReq(SFX_14C);
break;
case 3:
this->direction = -(this->parent->field_0x7a.HALF.HI + -0x80);
sub_0806F62C(this, 0x4800, (u32)this->direction);
LinearMoveAngle(this, 0x4800, (u32)this->direction);
if ((Random() & 1) != 0) {
this->direction = (Random() & 0x3f) + this->direction;
} else {
@@ -92,7 +92,7 @@ void OctorokBossObject_Init(Entity* this) {
InitializeAnimation(this, 6);
break;
case 6:
sub_0806F62C(this, (0x30 - (Random() & 0x2f)) * 0x100, Random() & 0xff);
LinearMoveAngle(this, (0x30 - (Random() & 0x2f)) * 0x100, Random() & 0xff);
if ((Random() & 1) != 0) {
this->direction = (Random() & 0x3f) + this->direction;
} else {
@@ -109,10 +109,10 @@ void OctorokBossObject_Init(Entity* this) {
this->field_0x76.HWORD = 0x400;
this->field_0x74.HWORD = 0x400;
this->field_0x7a.HWORD = 0;
sub_0806F62C(this,
((-(u32)this->parent->field_0x7a.HALF.HI << 0x18) >> 0x18) +
(u32)gUnk_0812388C[(u32)this->type2 * 2 + 1],
(u32)gUnk_0812388C[(u32)this->type2 * 2]);
LinearMoveAngle(this,
((-(u32)this->parent->field_0x7a.HALF.HI << 0x18) >> 0x18) +
(u32)gUnk_0812388C[(u32)this->type2 * 2 + 1],
(u32)gUnk_0812388C[(u32)this->type2 * 2]);
sub_0805EC9C(this, this->field_0x76.HWORD, this->field_0x74.HWORD, this->field_0x7a.HWORD);
InitializeAnimation(this, 7);
break;
@@ -170,7 +170,7 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc",
case 1:
this->direction = sub_080045DA(GET_HELPER(this)->tailObjects[this->actionDelay]->x.WORD - this->x.WORD,
GET_HELPER(this)->tailObjects[this->actionDelay]->y.WORD - this->y.WORD);
sub_0806F62C(this, this->speed, this->direction);
LinearMoveAngle(this, this->speed, this->direction);
if (EntityInRectRadius(this, GET_HELPER(this)->tailObjects[this->actionDelay], 2, 2) == 0) {
return;
}
@@ -195,7 +195,7 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc",
if (this->parent->type2 == 3) {
Entity* object = GET_HELPER(this->parent)->mouthObject;
this->direction = sub_080045DA(object->x.WORD - this->x.WORD, object->y.WORD - this->y.WORD);
sub_0806F62C(this, 0x280, this->direction);
LinearMoveAngle(this, 0x280, this->direction);
if (sub_0806FC80(this, this->parent, 0x48) == 0) {
return;
}
@@ -204,7 +204,7 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc",
break;
case 3:
case 6:
sub_0806F62C(this, 0x80, this->direction);
LinearMoveAngle(this, 0x80, this->direction);
if (this->frame != 0) {
DeleteThisEntity();
}
@@ -247,8 +247,9 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc",
*(int*)&this->field_0x78 -= 1;
}
CopyPosition(this->parent, this);
sub_0806F62C(this, (u32)gUnk_0812388C[(u32)this->type2 * 2 + 1],
((u8) - this->parent->field_0x7a.HALF.HI & 0xff) + (u32)gUnk_0812388C[(u32)this->type2 * 2]);
LinearMoveAngle(this, (u32)gUnk_0812388C[(u32)this->type2 * 2 + 1],
((u8) - this->parent->field_0x7a.HALF.HI & 0xff) +
(u32)gUnk_0812388C[(u32)this->type2 * 2]);
return;
case 7:
if (this->actionDelay == 0) {
+1 -1
View File
@@ -67,7 +67,7 @@ void sub_08082310(Entity* this) {
case 0x1D:
SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
this->action = 5;
this->zVelocity = 0x2A000;
this->zVelocity = Q_16_16(2.625);
this->spriteOffsetY = 0;
this->spriteSettings.shadow = 1;
this->spritePriority.b1 = 3;
+185
View File
@@ -0,0 +1,185 @@
#define NENT_DEPRECATED
#include "object.h"
#include "functions.h"
u32 IsColliding(Entity*, Entity*);
typedef struct {
Entity base;
/*0x68*/ union SplitHWord field_0x68;
/*0x6a*/ union SplitHWord field_0x6a;
/*0x6c*/ union SplitHWord field_0x6c;
/*0x6e*/ union SplitHWord field_0x6e;
/*0x70*/ u16 canToggle;
/*0x72*/ u8 dir;
/*0x73*/ u8 filler73[0x86 - 0x73];
/*0x86*/ u16 flag;
} PressurePlateEntity;
typedef void(PressurePlateAction)(PressurePlateEntity*);
PressurePlateAction sub_08088840;
PressurePlateAction sub_0808886C;
PressurePlateAction sub_080888F4;
extern Hitbox gUnk_080FD1D4;
static u32 sub_08088938(PressurePlateEntity*);
static u32 get_standing_count(PressurePlateEntity*);
static const u8 sSpriteOffsets[];
void PressurePlate(PressurePlateEntity* this) {
static PressurePlateAction* const sActions[] = {
sub_08088840,
sub_0808886C,
sub_080888F4,
};
if (super->field_0xf) {
if (--super->field_0xf == 0) {
this->dir = super->animationState;
InitializeAnimation(super, super->animationState);
}
}
sActions[super->action](this);
}
void sub_08088840(PressurePlateEntity* this) {
super->action = 1;
super->spriteSettings.draw = 1;
super->spritePriority.b0 = 7;
super->hitbox = &gUnk_080FD1D4;
this->dir = super->animationState;
}
void sub_0808886C(PressurePlateEntity* this) {
u8 weight;
weight = sub_08088938(this) + get_standing_count(this);
if (super->type + 2 <= weight) {
super->action = 2;
super->field_0xf = 0;
super->animationState = 4;
super->z.HALF.HI = 0;
InitializeAnimation(super, 4);
SetFlag(this->flag);
EnqueueSFX(SFX_PRESSURE_PLATE);
} else {
if (weight > super->animationState) {
if (super->type + 1 == weight) {
super->field_0xf = 4;
InitializeAnimation(super, weight + 1);
} else {
InitializeAnimation(super, weight);
}
EnqueueSFX(SFX_BUTTON_PRESS);
} else if (weight < super->animationState) {
InitializeAnimation(super, weight);
}
super->animationState = weight;
}
}
void sub_080888F4(PressurePlateEntity* this) {
u8 weight;
if (this->canToggle) {
weight = sub_08088938(this) + get_standing_count(this);
if (super->type + 2 > weight) {
super->action = 1;
super->animationState = weight;
ClearFlag(this->flag);
InitializeAnimation(super, weight);
}
}
}
static u32 NONMATCH("asm/non_matching/pressurePlate/sub_08088938.inc", sub_08088938(PressurePlateEntity* this)) {
u16 x, y;
s32 num;
u8* tmp;
u32 i;
num = 0;
x = super->x.HALF.HI - 8;
y = super->y.HALF.HI - 8;
tmp = &this->dir;
for (i = 0; i < 8; ++i) {
Entity* e = gRoomVars.field_0x8c[8 + i];
if (e != NULL) {
if ((u16)(e->x.HALF.HI - x) < 0x11 && ((u16)(e->y.HALF_U.HI - y) < 0x11)) {
e->spriteOffsetY = sSpriteOffsets[*tmp];
num++;
}
}
}
return num;
}
END_NONMATCH
static u32 get_standing_count(PressurePlateEntity* this) {
u32 num;
num = 0;
if (IsCollidingPlayer(super) != 0) {
gPlayerEntity.spriteOffsetY = sSpriteOffsets[this->dir];
num = 1;
}
if ((gPlayerState.flags & PL_CLONING) != 0) {
if (IsColliding(super, gPlayerClones[0]) != 0) {
gPlayerClones[0]->spriteOffsetY = sSpriteOffsets[this->dir];
num++;
}
if (IsColliding(super, gPlayerClones[1]) != 0) {
gPlayerClones[1]->spriteOffsetY = sSpriteOffsets[this->dir];
num++;
}
if (IsColliding(super, gPlayerClones[2]) != 0) {
gPlayerClones[2]->spriteOffsetY = sSpriteOffsets[this->dir];
num++;
}
}
return num;
}
static const u8 sSpriteOffsets[] = {
-4, -3, -2, -1, 0,
};
static const Frame gSpriteAnimations_PressurePlate_0 = {
.index = 0,
.duration = 0xFF,
.frameSettings = { .b = { .endOfAnimation = 1 } },
};
static const Frame gSpriteAnimations_PressurePlate_1 = {
.index = 1,
.duration = 0xFF,
.frameSettings = { .b = { .endOfAnimation = 1 } },
};
static const Frame gSpriteAnimations_PressurePlate_2 = {
.index = 2,
.duration = 0xFF,
.frameSettings = { .b = { .endOfAnimation = 1 } },
};
static const Frame gSpriteAnimations_PressurePlate_3 = {
.index = 3,
.duration = 0xFF,
.frameSettings = { .b = { .endOfAnimation = 1 } },
};
static const Frame gSpriteAnimations_PressurePlate_4 = {
.index = 4,
.duration = 0xFF,
.frameSettings = { .b = { .endOfAnimation = 1 } },
};
const Frame* const gSpriteAnimations_PressurePlate[] = {
&gSpriteAnimations_PressurePlate_0, &gSpriteAnimations_PressurePlate_1, &gSpriteAnimations_PressurePlate_2,
&gSpriteAnimations_PressurePlate_3, &gSpriteAnimations_PressurePlate_4,
};
+1 -1
View File
@@ -51,7 +51,7 @@ void sub_08086A6C(Entity* ent) {
u32 uVar1;
uVar1 = Random();
ent->zVelocity = 163840;
ent->zVelocity = Q_16_16(2.5);
ent->direction = DirectionNormalize(uVar1 >> 16);
ent->speed = uVar1 & 480;
}
+26 -27
View File
@@ -22,26 +22,26 @@
#include "screen.h"
#include "main.h"
#define GRAVITY_RATE 0x2000
#define GRAVITY_RATE Q_8_8(32)
#define SLOPE_SPEED_MODIFIER 0x50
#define WALK_SPEED 0x140
#define ROLL_SPEED 0x200
#define SHIELDING_SPEED 0xC0
#define GUST_JAR_SPEED 0x80
#define SWORD_CHARGE_SPEED 0xE0
#define BURNING_SPEED 0x300
#define WALK_SPEED Q_8_8(1.25)
#define ROLL_SPEED Q_8_8(2.0)
#define GUST_JAR_SPEED Q_8_8(0.5)
#define SHIELDING_SPEED Q_8_8(0.75)
#define SWORD_CHARGE_SPEED Q_8_8(0.875)
#define BURNING_SPEED Q_8_8(3)
#define JUMP_SPEED_FWD 0x100
#define JUMP_SPEED_FWD Q_8_8(1)
/* Jumping out of a hole */
#define JUMP_SPEED_HOLE_FWD 0x78
#define JUMP_SPEED_HOLE_Z 0x1a000
#define JUMP_SPEED_HOLE_FWD Q_8_8(0.46875)
#define JUMP_SPEED_HOLE_Z Q_16_16(1.625)
/* Bouncing off a wall */
#define BOUNCE_SPEED_FWD 0x100
#define BOUNCE_SPEED_Z 0x20000
#define BOUNCE_SPEED_FWD Q_8_8(1.0)
#define BOUNCE_SPEED_Z Q_16_16(2.0)
#define PULL_SPEED 0x80
#define PUSH_SPEED 0x80
#define PULL_SPEED Q_8_8(0.5)
#define PUSH_SPEED Q_8_8(0.5)
#define PIT_DAMAGE 0x2
@@ -321,7 +321,6 @@ extern u8 gUnk_080082DC[];
extern u16 script_BedInLinksRoom;
extern u16 script_BedAtSimons;
extern Entity* gPlayerClones[];
extern ScriptExecutionContext gPlayerScriptExecutionContext;
NONMATCH("asm/non_matching/playerItemPacciCane/CheckPlayerInactive.inc", u32 CheckPlayerInactive(void)) {
@@ -724,7 +723,7 @@ static NONMATCH("asm/non_matching/player/PlayerBounceUpdate.inc", void PlayerBou
}
if (--this->actionDelay != 0xFF) {
this->zVelocity = 0x10000;
this->zVelocity = Q_16_16(1.0);
return;
}
@@ -1118,7 +1117,7 @@ static void PortalStandUpdate(Entity* this) {
if (--this->actionDelay == 0xff) {
this->direction = gPlayerState.field_0xd;
this->animationState = Direction8ToAnimationState(this->direction);
this->zVelocity = 0x20000;
this->zVelocity = Q_16_16(2.0);
this->speed = JUMP_SPEED_FWD;
this->action = PLAYER_MINISH;
this->subAction = 7;
@@ -1531,7 +1530,7 @@ static void sub_08071D04(Entity* this) {
gPlayerState.field_0x3c[0] = 0;
this->direction = 0xff;
this->speed = 0;
this->zVelocity = 0x18000;
this->zVelocity = Q_16_16(1.5);
gPlayerState.jump_status = 1;
gPlayerState.swim_state = 0;
return;
@@ -1849,7 +1848,7 @@ static void PlayerLavaInit(Entity* this) {
COLLISION_OFF(this);
if ((gPlayerState.flags & PL_MINISH) == 0) {
this->subAction = 1;
this->zVelocity = 0x28000;
this->zVelocity = Q_16_16(2.5);
ent = CreateObject(OBJECT_42, 0x80, 0);
if (ent != NULL) {
ent->child = this;
@@ -2224,7 +2223,7 @@ static void sub_08072B5C(Entity* this) {
COLLISION_ON(this);
this->spritePriority.b0 = 4;
this->speed = 0x40;
this->zVelocity = 0x39000;
this->zVelocity = Q_16_16(3.5625);
this->z.WORD--;
gPlayerState.jump_status = 0x41;
sub_0806F854(this, 0, -12);
@@ -2240,7 +2239,7 @@ static void sub_08072B5C(Entity* this) {
temp -= 4;
temp <<= 12;
this->zVelocity = temp;
this->speed = 0x100;
this->speed = Q_8_8(1.0);
gPlayerState.animation = 0x810;
SoundReq(SFX_PLY_JUMP);
}
@@ -2679,7 +2678,7 @@ static void PlayerParachute(Entity* this) {
static void sub_08073468(Entity* this) {
gPlayerState.animation = 1792;
gPlayerState.jump_status = 0;
this->zVelocity = -0x10000;
this->zVelocity = Q_16_16(-1.0);
this->subAction++;
this->field_0x7c.WORD = 480;
this->direction = Direction8FromAnimationState(this->animationState);
@@ -2695,7 +2694,7 @@ static void sub_08073468(Entity* this) {
static void sub_080734D4(Entity* this) {
GravityUpdate(this, -(GRAVITY_RATE / 2));
if (this->zVelocity > 0 || gPlayerState.field_0x38 == 1) {
this->zVelocity = 0x49000;
this->zVelocity = Q_16_16(4.5625);
this->subAction++;
}
}
@@ -2872,7 +2871,7 @@ static void sub_0807380C(Entity* this) {
if (--this->actionDelay == 0) {
this->subAction = 7;
this->actionDelay = 60;
this->zVelocity = 0x20000;
this->zVelocity = Q_16_16(2.0);
}
}
UpdateAnimationSingleFrame(this);
@@ -2965,7 +2964,7 @@ static void sub_080739EC(Entity* this) {
}
if ((gPlayerState.jump_status & 0xC0) == 0) {
if ((gPlayerState.jump_status & 0x20) && this->zVelocity == 0) {
this->zVelocity = 0x28000;
this->zVelocity = Q_16_16(2.5);
this->actionDelay = 10;
this->direction = 0xff;
gPlayerState.jump_status += 2;
@@ -3176,7 +3175,7 @@ static void sub_08073F04(Entity* this) {
this->spritePriority.b1 = 2;
this->spriteSettings.draw = 0;
this->subAction++;
this->zVelocity = 0x28000;
this->zVelocity = Q_16_16(2.5);
this->speed = 0x100;
gPlayerState.flags &= ~PL_MINISH;
ResetPlayer();
@@ -3240,7 +3239,7 @@ static void sub_08074060(Entity* this) {
this->spriteSettings.shadow = 1;
this->field_0xf = 0;
this->subAction++;
this->zVelocity = 0x20000;
this->zVelocity = Q_16_16(2.0);
gPlayerState.animation = 2060;
sub_0805EC60(this);
} else {
+2 -2
View File
@@ -75,7 +75,7 @@ void BoneProjectile_Action3(Entity* this) {
void BoneProjectile_Action4(Entity* this) {
GetNextFrame(this);
LinearMoveUpdate(this);
if (GravityUpdate(this, 0x1800) == 0) {
if (GravityUpdate(this, Q_8_8(24.0)) == 0) {
DeleteEntity(this);
}
}
@@ -83,7 +83,7 @@ void BoneProjectile_Action4(Entity* this) {
void sub_080A82D8(Entity* this) {
this->action = 4;
COLLISION_OFF(this);
this->zVelocity = 0x10000;
this->zVelocity = Q_16_16(1.0);
this->direction ^= 0x10;
this->speed = 0x80;
}
+2 -2
View File
@@ -5,7 +5,7 @@ extern void CreateItemOnGround(Entity*);
extern s32 sub_080AF090(Entity*);
extern void sub_080043A8(Entity*);
extern void CreateChestSpawner(Entity*);
extern u32 sub_080177A0(Entity*, Entity*);
extern u32 IsColliding(Entity*, Entity*);
extern void (*const CannonballProjectile_Functions[])(Entity*);
extern void (*const CannonballProjectile_Actions[])(Entity*);
@@ -79,7 +79,7 @@ bool32 sub_080AB634(Entity* this) {
Entity** entities = ((Entity**)&this->parent->zVelocity);
u32 i;
for (i = 0; i <= 3; ++i) {
if (entities[i] != NULL && (sub_080177A0(this, entities[i]) != 0)) {
if (entities[i] != NULL && (IsColliding(this, entities[i]) != 0)) {
if (entities[i]->action < 3) {
entities[i]->action = 3;
entities[i]->actionDelay = 0x1e;
+2 -2
View File
@@ -5,7 +5,7 @@
extern s32 sub_080AF090(Entity*);
extern s32 IsProjectileOffScreen(Entity*);
extern void sub_08016AD2(Entity*);
extern u32 sub_080177A0(Entity*, Entity*);
extern u32 IsColliding(Entity*, Entity*);
extern void (*const DekuSeedProjectile_Functions[])(Entity*);
extern void (*const DekuSeedProjectile_Actions[])(Entity*);
@@ -70,7 +70,7 @@ void DekuSeedProjectile_Action1(Entity* this) {
}
if (this->field_0xf != 0) {
parent = this->parent;
if ((parent->next != NULL) && (sub_080177A0(this, parent) != 0)) {
if ((parent->next != NULL) && (IsColliding(this, parent) != 0)) {
this->iframes = 0x10;
this->knockbackDirection = -this->direction;
this->bitfield = 0x80;
+5 -5
View File
@@ -48,7 +48,7 @@ void DirtBallProjectile_Init(Entity* this) {
this->action = 1;
this->subAction = 0;
this->spriteSettings.shadow = 1;
this->zVelocity = 0x8000;
this->zVelocity = Q_16_16(0.5);
this->hitbox = (Hitbox*)&gUnk_08129764;
this->field_0x3c |= 0x10;
switch (this->type) {
@@ -76,13 +76,13 @@ void DirtBallProjectile_Action1(Entity* this) {
if (parent->next == NULL) {
this->action = 2;
}
PositionRelative(parent, this, 0, -0x10000);
PositionRelative(parent, this, 0, Q_16_16(-1.0));
switch (this->type) {
case 0:
this->z.HALF.HI += 0x10;
this->z.HALF.HI += Q_8_8(1.0 / 16.0);
break;
case 1:
this->z.HALF.HI += 0xe;
this->z.HALF.HI += Q_8_8(1.0 / 16.0 - 1.0 / 128.0);
sub_08078954(this->child);
CopyPosition(this, this->child);
if ((0xf < (u8)(this->actionDelay++ + 1)) && (entity = this->child, entity->actionDelay == 0)) {
@@ -96,7 +96,7 @@ void DirtBallProjectile_Action1(Entity* this) {
}
break;
case 2:
this->z.HALF.HI += 0xe;
this->z.HALF.HI += Q_8_8(1.0 / 16.0 - 1.0 / 128.0);
if (EntityInRectRadius(this, &gPlayerEntity, 0xe, 0xe) != 0) {
this->action = 2;
parent->field_0x82.HALF.HI = 0xc0;
+2 -2
View File
@@ -32,10 +32,10 @@ void GleerokProjectile_Init(Entity* this) {
s32 iVar2;
this->action = 1;
this->zVelocity = -0x10000;
this->zVelocity = Q_16_16(-1.0);
if (this->type != 3) {
CopyPosition(this->parent, this);
sub_0806F5BC(this, 0x1000, this->direction);
LinearMoveDirection(this, 0x1000, this->direction);
this->z.WORD = this->parent->y.WORD - this->child->y.WORD;
this->y.WORD -= this->z.WORD;
InitializeAnimation(this, 0x51);
+2 -2
View File
@@ -60,8 +60,8 @@ void GyorgMaleEnergyProjectile_Action1(Entity* this) {
DeleteThisEntity();
}
animationState = this->parent->animationState;
PositionRelative(this->parent, this, gSineTable[animationState] * 0x2800,
gSineTable[animationState + 0x40] * -0x2800);
PositionRelative(this->parent, this, gSineTable[animationState] * Q_16_16(5.0 / 32.0),
gSineTable[animationState + 0x40] * Q_16_16(-5.0 / 32.0));
GetNextFrame(this);
if (--this->actionDelay == 0) {
this->action = 2;
+2 -2
View File
@@ -57,8 +57,8 @@ void LakituCloudProjectile_Init(Entity* this) {
}
void LakituCloudProjectile_Action1(Entity* this) {
PositionRelative(this->parent, this, 0, -0x10000);
this->z.HALF.HI = 0xfffe;
PositionRelative(this->parent, this, 0, Q_16_16(-1.0));
this->z.HALF.HI = -2;
UpdateAnimationSingleFrame(this);
}
+5 -5
View File
@@ -77,7 +77,7 @@ void MandiblesProjectile_Init(Entity* this) {
this->animationState = 0xff;
this->field_0x82.HALF.LO = 0;
this->spritePriority.b0 = 4;
ResolveEntityBelow(this, this->parent);
SortEntityBelow(this, this->parent);
sub_080AA270(this);
}
@@ -125,9 +125,9 @@ void MandiblesProjectile_Action3(Entity* this) {
} else {
tmp = GetSpriteSubEntryOffsetDataPointer((u16)entity->spriteIndex, entity->frameIndex);
if ((entity->animationState & 4) != 0) {
PositionRelative(entity, this, -tmp[0] * 0x10000, tmp[1] << 0x10);
PositionRelative(entity, this, Q_16_16(-tmp[0]), Q_16_16(tmp[1]));
} else {
PositionRelative(entity, this, tmp[0] << 0x10, tmp[1] << 0x10);
PositionRelative(entity, this, Q_16_16(tmp[0]), Q_16_16(tmp[1]));
}
}
if (entity->field_0x43 == 0) {
@@ -212,9 +212,9 @@ void sub_080AA1D8(Entity* this) {
if ((parent->frameIndex & 0x20) == 0) {
tmp = GetSpriteSubEntryOffsetDataPointer((u16)parent->spriteIndex, parent->frameIndex);
if ((parent->animationState & 4) != 0) {
PositionRelative(parent, this, -tmp[0] * 0x10000, tmp[1] << 0x10);
PositionRelative(parent, this, Q_16_16(-tmp[0]), Q_16_16(tmp[1]));
} else {
PositionRelative(parent, this, tmp[0] << 0x10, tmp[1] << 0x10);
PositionRelative(parent, this, Q_16_16(tmp[0]), Q_16_16(tmp[1]));
}
if (parent->field_0x43 != 0) {
if ((this->flags & ENT_COLLIDE) != 0) {
+7 -7
View File
@@ -33,7 +33,7 @@ void OctorokBossProjectile_Init(Entity* this) {
switch (this->type) {
case 0:
sub_0806F62C(this, 0x4800, this->direction);
LinearMoveAngle(this, 0x4800, this->direction);
this->speed = 0x200;
this->actionDelay = 0;
this->field_0xf = this->direction;
@@ -44,11 +44,11 @@ void OctorokBossProjectile_Init(Entity* this) {
this->spriteRendering.b3 = 3;
this->spritePriority.b0 = 6;
this->speed = (Random() & 0x1ff) + 0x200;
this->zVelocity = (Random() & 0x1fff) + 0x18000;
this->zVelocity = (Random() & 0x1fff) + Q_16_16(1.5);
uVar1 = (((u8)Random() & 7) - 4);
this->direction -= uVar1;
*(u32*)&this->field_0x78 = 600;
sub_0806F62C(this, this->speed, this->direction);
LinearMoveAngle(this, this->speed, this->direction);
InitializeAnimation(this, 4);
break;
case 2:
@@ -59,7 +59,7 @@ void OctorokBossProjectile_Init(Entity* this) {
}
this->speed = 0x200;
this->actionDelay = 0x30;
sub_0806F62C(this, 0x5000, this->direction);
LinearMoveAngle(this, 0x5000, this->direction);
InitializeAnimation(this, 5);
break;
case 3:
@@ -113,7 +113,7 @@ void OctorokBossProjectile_Action1(Entity* this) {
}
UpdateAnimationSingleFrame(this);
this->field_0x78.HWORD--;
sub_0806F62C(this, this->speed, this->direction);
LinearMoveAngle(this, this->speed, this->direction);
sub_080AE58C(this, this->direction >> 3, 0);
if ((this->collisions & 0xee00) != 0) {
this->direction = -this->direction;
@@ -153,7 +153,7 @@ void OctorokBossProjectile_Action1(Entity* this) {
if (GravityUpdate(this, 0x1800) != 0) {
sub_080AE58C(this, this->direction >> 3, 0);
if (this->collisions == 0) {
sub_0806F62C(this, (s32)this->speed, (u32)this->direction);
LinearMoveAngle(this, (s32)this->speed, (u32)this->direction);
} else {
OctorokBossProjectile_Action2(this);
}
@@ -176,7 +176,7 @@ void OctorokBossProjectile_Action1(Entity* this) {
case 2:
GetNextFrame(this);
if (--this->actionDelay != 0xff) {
sub_0806F62C(this, this->speed, this->direction);
LinearMoveAngle(this, this->speed, this->direction);
return;
}
if (this->child != NULL) {
+2 -2
View File
@@ -31,7 +31,7 @@ void sub_080A8064(Entity* this) {
void RockProjectile_Init(Entity* this) {
this->action = 1;
this->actionDelay = 0x30;
this->zVelocity = 0xa000;
this->zVelocity = Q_16_16(0.625);
InitializeAnimation(this, 0);
}
@@ -86,7 +86,7 @@ void sub_080A8178(Entity* this) {
this->action = 2;
COLLISION_OFF(this);
this->speed = 0x40;
this->zVelocity = 0x14000;
this->zVelocity = Q_16_16(1.25);
}
void (*const RockProjectile_Functions[])(Entity*) = {
+2 -2
View File
@@ -32,7 +32,7 @@ void sub_080A9A34(Entity* this) {
if (this->bitfield == 0x9d) {
this->action = 3;
COLLISION_OFF(this);
this->zVelocity = 0x2a000;
this->zVelocity = Q_16_16(2.625);
this->spritePriority.b1 = 1;
}
}
@@ -76,7 +76,7 @@ void StalfosProjectile_Init(Entity* this) {
break;
case 2:
this->action = 3;
this->zVelocity = 0x2a000;
this->zVelocity = Q_16_16(2.625);
this->spritePriority.b1 = 1;
break;
default:
+4 -4
View File
@@ -31,9 +31,9 @@ void sub_080AAC44(Entity* this) {
this->action = 2;
COLLISION_OFF(this);
if (this->type == 0) {
ResolveEntityOnTop(&gPlayerEntity, this);
SortEntityAbove(&gPlayerEntity, this);
} else {
ResolveEntityOnTop(this->parent, this);
SortEntityAbove(this->parent, this);
}
ResetPlayer();
gPlayerState.mobility |= 0x80;
@@ -114,7 +114,7 @@ void V1DarkMagicProjectile_Init(Entity* this) {
} else {
this->action = 3;
this->hitType = 0x2c;
ResolveEntityOnTop(this->parent, this);
SortEntityAbove(this->parent, this);
}
if (this->type == 0) {
this->actionDelay = 0;
@@ -136,7 +136,7 @@ void V1DarkMagicProjectile_Init(Entity* this) {
entity->parent = this;
}
} else {
ResolveEntityOnTop(this->parent, this);
SortEntityAbove(this->parent, this);
COLLISION_OFF(this);
CopyPosition(this->parent, this);
}

Some files were not shown because too many files have changed in this diff Show More