summaryrefslogtreecommitdiff
path: root/src/object
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2024-01-01 12:12:05 -0800
committertheo3 <arisstephenson2@gmail.com>2024-01-01 12:12:05 -0800
commit5324928f44a85e9867b960ca9a0a68931f5f3bbd (patch)
tree4239b4025202ff504ab29b0228616c4ff38aa358 /src/object
parent983412cc77d81692ad9431c0bd55f8d24e5554f8 (diff)
npc5 document
Diffstat (limited to 'src/object')
-rw-r--r--src/object/cutsceneMiscObject.c2
-rw-r--r--src/object/evilSpirit.c6
-rw-r--r--src/object/fileScreenObjects.c6
-rw-r--r--src/object/keyStealingTakkuri.c2
-rw-r--r--src/object/objectA2.c2
-rw-r--r--src/object/octorokBossObject.c4
-rw-r--r--src/object/specialFx.c2
7 files changed, 12 insertions, 12 deletions
diff --git a/src/object/cutsceneMiscObject.c b/src/object/cutsceneMiscObject.c
index c2320d91..fa787b35 100644
--- a/src/object/cutsceneMiscObject.c
+++ b/src/object/cutsceneMiscObject.c
@@ -710,7 +710,7 @@ void sub_0809567C(CutsceneMiscObjectEntity* this) {
super->action = 3;
super->subAction = 1;
super->speed = 0x400;
- super->direction = sub_080045DA(super->x.WORD - ((s16)this->px << 16), super->y.WORD - ((s16)this->py << 16));
+ super->direction = CalcOffsetAngle(super->x.WORD - ((s16)this->px << 16), super->y.WORD - ((s16)this->py << 16));
}
void CutsceneMiscObject_Type15(CutsceneMiscObjectEntity* this) {
diff --git a/src/object/evilSpirit.c b/src/object/evilSpirit.c
index 43dc00ab..a2943a52 100644
--- a/src/object/evilSpirit.c
+++ b/src/object/evilSpirit.c
@@ -83,10 +83,10 @@ void EvilSpirit_Action1(EvilSpiritEntity* this) {
this->unk7a = this->unk7c;
super->speed = 0x300;
super->direction =
- sub_080045DA(super->parent->x.WORD - super->x.WORD, super->parent->y.WORD - super->y.WORD) ^ 0x80;
+ CalcOffsetAngle(super->parent->x.WORD - super->x.WORD, super->parent->y.WORD - super->y.WORD) ^ 0x80;
} else {
super->speed = 0x600;
- dir = sub_080045DA(gPlayerEntity.base.x.WORD - super->x.WORD, gPlayerEntity.base.y.WORD - super->y.WORD) ^
+ dir = CalcOffsetAngle(gPlayerEntity.base.x.WORD - super->x.WORD, gPlayerEntity.base.y.WORD - super->y.WORD) ^
0x80;
if (dir != super->direction) {
if ((u8)(dir - super->direction) > 0x80) {
@@ -178,7 +178,7 @@ void EvilSpirit_Action3(EvilSpiritEntity* this) {
short iVar4;
int iVar6;
- super->direction = sub_080045DA(this->x - super->x.WORD, this->y - super->y.WORD);
+ super->direction = CalcOffsetAngle(this->x - super->x.WORD, this->y - super->y.WORD);
if ((super->contactFlags & 0x7f) == 0x13) {
super->speed = 0x100;
super->gustJarTolerance--;
diff --git a/src/object/fileScreenObjects.c b/src/object/fileScreenObjects.c
index b474fdd6..19842f23 100644
--- a/src/object/fileScreenObjects.c
+++ b/src/object/fileScreenObjects.c
@@ -20,7 +20,7 @@ typedef struct {
/*0x70*/ u8 unk_70;
} FileScreenObjectsEntity;
-extern u32 sub_080041EC(s32, s32);
+extern u32 CalcDistance(s32, s32);
static bool32 sub_0808E950(void);
static void sub_0808EABC(FileScreenObjectsEntity*);
@@ -550,14 +550,14 @@ static u32 sub_0808EF6C(FileScreenObjectsEntity* this) {
return 0;
}
- var4 = var7 = sub_080041EC(var0, var2);
+ var4 = var7 = CalcDistance(var0, var2);
var4 += 128;
var7 = var4 + var7 * 16;
if (this->unk_6c < var7) {
var7 = this->unk_6c;
}
super->speed = var7;
- super->direction = sub_080045DA(var0, var2) >> 3;
+ super->direction = CalcOffsetAngle(var0, var2) >> 3;
LinearMoveUpdate(super);
return 1;
}
diff --git a/src/object/keyStealingTakkuri.c b/src/object/keyStealingTakkuri.c
index 2f67e69f..2fceaa87 100644
--- a/src/object/keyStealingTakkuri.c
+++ b/src/object/keyStealingTakkuri.c
@@ -433,7 +433,7 @@ void sub_0809E0D4(KeyStealingTakkuriEntity* this, ScriptExecutionContext* contex
varY2 = varY;
if (--context->unk_19 == 0) {
context->unk_19 = 8;
- super->direction = sub_080045DA(varX2 - super->x.HALF.HI, varY2 - super->y.HALF.HI);
+ super->direction = CalcOffsetAngle(varX2 - super->x.HALF.HI, varY2 - super->y.HALF.HI);
}
varX3 = super->x.HALF.HI - varX2;
varY3 = super->y.HALF.HI - varY2;
diff --git a/src/object/objectA2.c b/src/object/objectA2.c
index 0617ce3e..9e82aeb3 100644
--- a/src/object/objectA2.c
+++ b/src/object/objectA2.c
@@ -117,5 +117,5 @@ void sub_0809F448(Entity* this) {
break;
}
this->speed = (tmp > 0 ? tmp : -tmp) / (tmp2->unk_1 << 8);
- this->direction = sub_080045DA(tmp, 0) >> 3;
+ this->direction = CalcOffsetAngle(tmp, 0) >> 3;
}
diff --git a/src/object/octorokBossObject.c b/src/object/octorokBossObject.c
index ddab7bce..bc77267c 100644
--- a/src/object/octorokBossObject.c
+++ b/src/object/octorokBossObject.c
@@ -181,7 +181,7 @@ void OctorokBossObject_Action1(OctorokBossObjectEntity* this) {
return;
}
case 1:
- super->direction = sub_080045DA(this->helper->tailObjects[super->timer]->x.WORD - super->x.WORD,
+ super->direction = CalcOffsetAngle(this->helper->tailObjects[super->timer]->x.WORD - super->x.WORD,
this->helper->tailObjects[super->timer]->y.WORD - super->y.WORD);
LinearMoveAngle(super, super->speed, super->direction);
if (EntityInRectRadius(super, this->helper->tailObjects[super->timer], 2, 2) == 0) {
@@ -207,7 +207,7 @@ void OctorokBossObject_Action1(OctorokBossObjectEntity* this) {
case 2:
if (super->parent->type2 == 3) {
Entity* object = ((OctorokBossObjectEntity*)super->parent)->helper->mouthObject;
- super->direction = sub_080045DA(object->x.WORD - super->x.WORD, object->y.WORD - super->y.WORD);
+ super->direction = CalcOffsetAngle(object->x.WORD - super->x.WORD, object->y.WORD - super->y.WORD);
LinearMoveAngle(super, 0x280, super->direction);
if (sub_0806FC80(super, super->parent, 0x48) == 0) {
return;
diff --git a/src/object/specialFx.c b/src/object/specialFx.c
index bfe1a5e5..622aa059 100644
--- a/src/object/specialFx.c
+++ b/src/object/specialFx.c
@@ -199,7 +199,7 @@ void sub_080845DC(SpecialFxObject* this) {
void sub_080845F8(SpecialFxObject* this) {
if (((8 - (super->x.HALF.HI & 0xF)) | (8 - (super->y.HALF.HI & 0xF))) != 0) {
- super->direction = sub_080045DA((8 - (super->x.HALF.HI & 0xF)), (8 - (super->y.HALF.HI & 0xF))) >> 3;
+ super->direction = CalcOffsetAngle((8 - (super->x.HALF.HI & 0xF)), (8 - (super->y.HALF.HI & 0xF))) >> 3;
LinearMoveUpdate(super);
}
sub_08084630(this);