summaryrefslogtreecommitdiff
path: root/src/npc
diff options
context:
space:
mode:
authorTal Hayon <talhayon1@gmail.com>2022-01-23 17:24:55 +0200
committerTal Hayon <talhayon1@gmail.com>2022-01-23 17:24:55 +0200
commit70e2ef587740bfa159528bc0b160bb89869ad925 (patch)
tree766b21f8ce110a96d673e52e8cd7ac05072e5495 /src/npc
parenta1ae3b229bf3767349849e3da29fe4fd2043eda3 (diff)
parent85aaada18f7eace3284937c4da8db05f047d316b (diff)
Merge remote-tracking branch 'upstream/master' into coord
Diffstat (limited to 'src/npc')
-rw-r--r--src/npc/bigGoron.c2
-rw-r--r--src/npc/bladeBrothers.c2
-rw-r--r--src/npc/castorWildsStatue.c4
-rw-r--r--src/npc/cuccoChick.c2
-rw-r--r--src/npc/drLeft.c2
-rw-r--r--src/npc/ezlo.c2
-rw-r--r--src/npc/goron.c12
-rw-r--r--src/npc/gregal.c4
-rw-r--r--src/npc/kid.c2
-rw-r--r--src/npc/malon.c4
-rw-r--r--src/npc/melari.c2
-rw-r--r--src/npc/npc4E.c4
-rw-r--r--src/npc/pita.c2
-rw-r--r--src/npc/postman.c2
-rw-r--r--src/npc/rem.c4
-rw-r--r--src/npc/townMinish.c4
-rw-r--r--src/npc/townsperson.c2
-rw-r--r--src/npc/vaatiReborn.c6
-rw-r--r--src/npc/wheaton.c2
-rw-r--r--src/npc/zelda.c6
20 files changed, 35 insertions, 35 deletions
diff --git a/src/npc/bigGoron.c b/src/npc/bigGoron.c
index 7bb9f3e3..0245c49c 100644
--- a/src/npc/bigGoron.c
+++ b/src/npc/bigGoron.c
@@ -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);
}
}
diff --git a/src/npc/bladeBrothers.c b/src/npc/bladeBrothers.c
index 0b7de9f5..5d2ddca1 100644
--- a/src/npc/bladeBrothers.c
+++ b/src/npc/bladeBrothers.c
@@ -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);
}
}
diff --git a/src/npc/castorWildsStatue.c b/src/npc/castorWildsStatue.c
index f3614564..2c388a08 100644
--- a/src/npc/castorWildsStatue.c
+++ b/src/npc/castorWildsStatue.c
@@ -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) {
diff --git a/src/npc/cuccoChick.c b/src/npc/cuccoChick.c
index 0ccc0d17..46b564ad 100644
--- a/src/npc/cuccoChick.c
+++ b/src/npc/cuccoChick.c
@@ -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);
}
}
}
diff --git a/src/npc/drLeft.c b/src/npc/drLeft.c
index a4942f0f..65eabde0 100644
--- a/src/npc/drLeft.c
+++ b/src/npc/drLeft.c
@@ -22,7 +22,7 @@ void DrLeft(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->frameIndex = 0;
- ResolveEntityBelow(this, this);
+ SortEntityBelow(this, this);
}
}
}
diff --git a/src/npc/ezlo.c b/src/npc/ezlo.c
index 77a69331..872a99c6 100644
--- a/src/npc/ezlo.c
+++ b/src/npc/ezlo.c
@@ -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));
}
}
diff --git a/src/npc/goron.c b/src/npc/goron.c
index 22a217ca..baada241 100644
--- a/src/npc/goron.c
+++ b/src/npc/goron.c
@@ -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);
}
}
}
diff --git a/src/npc/gregal.c b/src/npc/gregal.c
index f7038e95..5769c8ac 100644
--- a/src/npc/gregal.c
+++ b/src/npc/gregal.c
@@ -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);
diff --git a/src/npc/kid.c b/src/npc/kid.c
index 7e08592c..02910850 100644
--- a/src/npc/kid.c
+++ b/src/npc/kid.c
@@ -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;
diff --git a/src/npc/malon.c b/src/npc/malon.c
index deb17fe7..cff3828f 100644
--- a/src/npc/malon.c
+++ b/src/npc/malon.c
@@ -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;
}
}
diff --git a/src/npc/melari.c b/src/npc/melari.c
index f2d408b2..7b28d0e2 100644
--- a/src/npc/melari.c
+++ b/src/npc/melari.c
@@ -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));
}
}
}
diff --git a/src/npc/npc4E.c b/src/npc/npc4E.c
index 2d59b83e..b842076f 100644
--- a/src/npc/npc4E.c
+++ b/src/npc/npc4E.c
@@ -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);
}
}
diff --git a/src/npc/pita.c b/src/npc/pita.c
index b5a2e065..1f1f2308 100644
--- a/src/npc/pita.c
+++ b/src/npc/pita.c
@@ -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);
}
diff --git a/src/npc/postman.c b/src/npc/postman.c
index 48e7aa9e..3629950c 100644
--- a/src/npc/postman.c
+++ b/src/npc/postman.c
@@ -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);
diff --git a/src/npc/rem.c b/src/npc/rem.c
index b846ab31..84fca459 100644
--- a/src/npc/rem.c
+++ b/src/npc/rem.c
@@ -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);
}
}
diff --git a/src/npc/townMinish.c b/src/npc/townMinish.c
index 50045270..04638c22 100644
--- a/src/npc/townMinish.c
+++ b/src/npc/townMinish.c
@@ -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);
}
}
diff --git a/src/npc/townsperson.c b/src/npc/townsperson.c
index 17cd48e5..edb1b694 100644
--- a/src/npc/townsperson.c
+++ b/src/npc/townsperson.c
@@ -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);
}
}
diff --git a/src/npc/vaatiReborn.c b/src/npc/vaatiReborn.c
index 3ed28ca8..fb59284e 100644
--- a/src/npc/vaatiReborn.c
+++ b/src/npc/vaatiReborn.c
@@ -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);
}
diff --git a/src/npc/wheaton.c b/src/npc/wheaton.c
index 3182eda3..e7c5e69b 100644
--- a/src/npc/wheaton.c
+++ b/src/npc/wheaton.c
@@ -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);
diff --git a/src/npc/zelda.c b/src/npc/zelda.c
index b0ac945f..f0bc5b77 100644
--- a/src/npc/zelda.c
+++ b/src/npc/zelda.c
@@ -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++;