summaryrefslogtreecommitdiff
path: root/src/object
diff options
context:
space:
mode:
authorTheo <65437533+notyourav@users.noreply.github.com>2024-01-01 13:10:06 -0800
committerGitHub <noreply@github.com>2024-01-01 13:10:06 -0800
commit6fb8b41a8e003d0a4997740f4178aeb0c3f24ead (patch)
tree9ada8fe01cc0e308e32e385f9b6965971010cda0 /src/object
parent983412cc77d81692ad9431c0bd55f8d24e5554f8 (diff)
parentf5c6178ed4830769f65fbc74b18e3403eda05f86 (diff)
Merge pull request #686 from notyourav/followtest
document unused zelda follower and gust jar states
Diffstat (limited to 'src/object')
-rw-r--r--src/object/bush.c4
-rw-r--r--src/object/chuchuBossStartParticle.c2
-rw-r--r--src/object/cutsceneMiscObject.c2
-rw-r--r--src/object/evilSpirit.c9
-rw-r--r--src/object/fileScreenObjects.c6
-rw-r--r--src/object/gustJarParticle.c2
-rw-r--r--src/object/itemForSale.c6
-rw-r--r--src/object/keyStealingTakkuri.c2
-rw-r--r--src/object/lilypadLarge.c6
-rw-r--r--src/object/minecart.c2
-rw-r--r--src/object/objectA2.c2
-rw-r--r--src/object/objectA8.c4
-rw-r--r--src/object/objectOnSpinyBeetle.c6
-rw-r--r--src/object/octorokBossObject.c6
-rw-r--r--src/object/pot.c6
-rw-r--r--src/object/pullableMushroom.c11
-rw-r--r--src/object/specialFx.c2
17 files changed, 40 insertions, 38 deletions
diff --git a/src/object/bush.c b/src/object/bush.c
index d0fbc49e..895e6747 100644
--- a/src/object/bush.c
+++ b/src/object/bush.c
@@ -73,7 +73,7 @@ void Bush_Init(BushEntity* this) {
}
void Bush_Action1(BushEntity* this) {
- if (((gPlayerState.field_0x1c & 0xf) != 1) || ((super->contactFlags & 0x7f) != 0x13)) {
+ if (((gPlayerState.gustJarState & 0xf) != 1) || ((super->contactFlags & 0x7f) != 0x13)) {
RestorePrevTileEntity(COORD_TO_TILE(super), super->collisionLayer);
DeleteThisEntity();
}
@@ -108,7 +108,7 @@ void Bush_Action2SubAction2(BushEntity* this) {
super->spriteOffsetX = 0;
sub_0807B9B8(this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
}
- if (((gPlayerState.field_0x1c & 0xf) != 1) || ((super->contactFlags & 0x7f) != 0x13)) {
+ if (((gPlayerState.gustJarState & 0xf) != 1) || ((super->contactFlags & 0x7f) != 0x13)) {
Bush_Action2SubAction5(this);
}
if (sub_0806F3E4(super) && ((super->gustJarFlags & 0xf) == 1)) {
diff --git a/src/object/chuchuBossStartParticle.c b/src/object/chuchuBossStartParticle.c
index ddd7032a..286c414c 100644
--- a/src/object/chuchuBossStartParticle.c
+++ b/src/object/chuchuBossStartParticle.c
@@ -264,7 +264,7 @@ void ChuchuBossStartParticle_Type9(ChuchuBossStartParticleEntity* this) {
DeleteThisEntity();
}
- if (gPlayerState.field_0x1c != 1) {
+ if (gPlayerState.gustJarState != 1) {
DeleteThisEntity();
}
} else {
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..2ab38f90 100644
--- a/src/object/evilSpirit.c
+++ b/src/object/evilSpirit.c
@@ -83,11 +83,12 @@ 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) ^
- 0x80;
+ 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) {
super->direction += 3;
@@ -178,7 +179,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/gustJarParticle.c b/src/object/gustJarParticle.c
index afbc0aa1..0da0d398 100644
--- a/src/object/gustJarParticle.c
+++ b/src/object/gustJarParticle.c
@@ -44,7 +44,7 @@ void GustJarParticle_Action1(Entity* this) {
if (sub_0806F3E4(this)) {
DeleteThisEntity();
- } else if ((gPlayerState.field_0x1c & 0xf) != 1) {
+ } else if ((gPlayerState.gustJarState & 0xf) != 1) {
DeleteThisEntity();
}
}
diff --git a/src/object/itemForSale.c b/src/object/itemForSale.c
index 0b99381d..60cfe8f2 100644
--- a/src/object/itemForSale.c
+++ b/src/object/itemForSale.c
@@ -91,7 +91,7 @@ void ItemForSale_Action1(ItemForSaleEntity* this) {
PausePlayer();
ResetActiveItems();
gPlayerState.heldObject = 4;
- gPlayerEntity.unk_74 = super;
+ gPlayerEntity.carriedEntity = super;
gUnk_0200AF00.rActionPlayerState = R_ACTION_DROP;
MessageClose();
}
@@ -104,7 +104,7 @@ void ItemForSale_Action2(ItemForSaleEntity* this) {
gUnk_0200AF00.rActionPlayerState = R_ACTION_DROP;
super->spriteSettings.draw = gPlayerEntity.base.spriteSettings.draw;
- if ((gPlayerState.heldObject == 0) || (super != gPlayerEntity.unk_74)) {
+ if ((gPlayerState.heldObject == 0) || (super != gPlayerEntity.carriedEntity)) {
sub_080819B4(this);
} else {
ptr = sub_080784E4();
@@ -129,7 +129,7 @@ void sub_080819B4(ItemForSaleEntity* this) {
DeleteThisEntity();
}
gPlayerState.heldObject = 0;
- gPlayerEntity.unk_74 = 0;
+ gPlayerEntity.carriedEntity = 0;
ptr = &gUnk_0200AF00;
gRoomVars.shopItemType = 0;
ptr->rActionInteractObject = R_ACTION_NONE;
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/lilypadLarge.c b/src/object/lilypadLarge.c
index d90c1610..b34360a2 100644
--- a/src/object/lilypadLarge.c
+++ b/src/object/lilypadLarge.c
@@ -125,8 +125,8 @@ void LilypadLarge_Action1(LilypadLargeEntity* this) {
this->unk_70 = 0;
this->unk_6c = 0;
}
- if (gPlayerState.field_0x1c == 3) {
- tmp = gUnk_08120620[gPlayerState.gustJarSpeed - 1];
+ if (gPlayerState.gustJarState == PL_JAR_3) {
+ tmp = gUnk_08120620[gPlayerState.gustJarCharge - 1];
switch (gPlayerEntity.base.animationState & 6) {
case 4:
this->unk_70 -= tmp;
@@ -154,7 +154,7 @@ void LilypadLarge_Action1(LilypadLargeEntity* this) {
uVar4 = gPlayerEntity.base.y.HALF.HI + gUnk_08126EE4[gPlayerEntity.base.animationState | 1];
super->direction = CalculateDirectionTo(super->x.HALF.HI, super->y.HALF.HI, sVar10, uVar4);
- switch (gPlayerState.gustJarSpeed) {
+ switch (gPlayerState.gustJarCharge) {
case 3:
tmp = 0x400;
break;
diff --git a/src/object/minecart.c b/src/object/minecart.c
index 30594d6d..58138b3b 100644
--- a/src/object/minecart.c
+++ b/src/object/minecart.c
@@ -70,7 +70,7 @@ void Minecart_Action1(MinecartEntity* this) {
SoundReq(SFX_13B);
} else {
if (sub_0800445C(super) != 0) {
- if (!((gPlayerState.flags & (PL_MINISH | PL_ROLLING)) || gPlayerState.field_0x1c ||
+ if (!((gPlayerState.flags & (PL_MINISH | PL_ROLLING)) || gPlayerState.gustJarState ||
gPlayerState.heldObject || gPlayerState.jump_status)) {
super->timer++;
} else {
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/objectA8.c b/src/object/objectA8.c
index 4f602fd0..c5e95687 100644
--- a/src/object/objectA8.c
+++ b/src/object/objectA8.c
@@ -116,7 +116,7 @@ void ObjectA8_Action2Subaction0(ObjectA8Entity* this) {
}
void ObjectA8_Action2Subaction1(ObjectA8Entity* this) {
- if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->contactFlags & 0x7f) != 0x13) {
+ if ((gPlayerState.gustJarState & 0xf) != 1 || (super->contactFlags & 0x7f) != 0x13) {
super->action = 3;
} else {
sub_0806F4E8(super);
@@ -124,7 +124,7 @@ void ObjectA8_Action2Subaction1(ObjectA8Entity* this) {
}
void ObjectA8_Action2Subaction2(ObjectA8Entity* this) {
- if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->contactFlags & 0x7f) != 0x13) {
+ if ((gPlayerState.gustJarState & 0xf) != 1 || (super->contactFlags & 0x7f) != 0x13) {
super->action = 3;
} else {
if (sub_0806F3E4(super)) {
diff --git a/src/object/objectOnSpinyBeetle.c b/src/object/objectOnSpinyBeetle.c
index fda7b417..52c575ca 100644
--- a/src/object/objectOnSpinyBeetle.c
+++ b/src/object/objectOnSpinyBeetle.c
@@ -204,7 +204,7 @@ void ObjectOnSpinyBeetle_Action3Subaction0(ObjectOnSpinyBeetleEntity* this) {
}
void ObjectOnSpinyBeetle_Action3Subaction1(ObjectOnSpinyBeetleEntity* this) {
- if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->contactFlags & 0x7f) != 0x13) {
+ if ((gPlayerState.gustJarState & 0xf) != 1 || (super->contactFlags & 0x7f) != 0x13) {
super->spriteOffsetX = 0;
super->action = 1;
} else {
@@ -219,7 +219,7 @@ void ObjectOnSpinyBeetle_Action3Subaction2(ObjectOnSpinyBeetleEntity* this) {
super->spriteOffsetY = -2;
(super->parent)->child = NULL;
}
- if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->contactFlags & 0x7f) != 0x13) {
+ if ((gPlayerState.gustJarState & 0xf) != 1 || (super->contactFlags & 0x7f) != 0x13) {
sub_080989C0(this);
} else {
if ((sub_0806F3E4(super) != 0) && (super->type == 0)) {
@@ -229,7 +229,7 @@ void ObjectOnSpinyBeetle_Action3Subaction2(ObjectOnSpinyBeetleEntity* this) {
}
void ObjectOnSpinyBeetle_Action3Subaction3(ObjectOnSpinyBeetleEntity* this) {
- if (gPlayerState.field_0x1c == 0) {
+ if (gPlayerState.gustJarState == 0) {
sub_080989C0(this);
} else {
(this->base).flags &= ~ENT_COLLIDE;
diff --git a/src/object/octorokBossObject.c b/src/object/octorokBossObject.c
index ddab7bce..075c858f 100644
--- a/src/object/octorokBossObject.c
+++ b/src/object/octorokBossObject.c
@@ -181,8 +181,8 @@ void OctorokBossObject_Action1(OctorokBossObjectEntity* this) {
return;
}
case 1:
- super->direction = sub_080045DA(this->helper->tailObjects[super->timer]->x.WORD - super->x.WORD,
- this->helper->tailObjects[super->timer]->y.WORD - super->y.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) {
return;
@@ -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/pot.c b/src/object/pot.c
index 444c14bb..150705f2 100644
--- a/src/object/pot.c
+++ b/src/object/pot.c
@@ -250,7 +250,7 @@ void sub_080826FC(PotEntity* this) {
}
void sub_0808270C(PotEntity* this) {
- if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (super->contactFlags & 0x7F) != 0x13) {
+ if ((gPlayerState.gustJarState & 0xF) != 0x1 || (super->contactFlags & 0x7F) != 0x13) {
super->spriteOffsetX = 0;
super->action = 1;
SetBottomTile(0x4000, COORD_TO_TILE(super), super->collisionLayer);
@@ -267,7 +267,7 @@ void sub_08082778(PotEntity* this) {
SetBottomTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
}
- if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (super->contactFlags & 0x7F) != 0x13) {
+ if ((gPlayerState.gustJarState & 0xF) != 0x1 || (super->contactFlags & 0x7F) != 0x13) {
BreakPot(this, NULL);
} else {
sub_0806F3E4(super);
@@ -275,7 +275,7 @@ void sub_08082778(PotEntity* this) {
}
void sub_080827F8(PotEntity* this) {
- if (gPlayerState.field_0x1c == 0) {
+ if (gPlayerState.gustJarState == 0) {
BreakPot(this, NULL);
}
}
diff --git a/src/object/pullableMushroom.c b/src/object/pullableMushroom.c
index de90f11d..17333ae3 100644
--- a/src/object/pullableMushroom.c
+++ b/src/object/pullableMushroom.c
@@ -65,7 +65,7 @@ void PullableMushroom_Init(PullableMushroomEntity* this) {
super->hitType = 0x6e;
super->collisionMask = 0x0e;
super->gustJarFlags = 1;
- super->flags |= 0x80;
+ COLLISION_ON(super);
super->spriteOffsetY = 4;
break;
case 1:
@@ -116,13 +116,14 @@ void PullableMushroom_Action1_Type0(PullableMushroomEntity* this) {
}
void PullableMushroom_Action1_Type1(PullableMushroomEntity* this) {
- if (*(u16*)&super->parent->action == 0x201) {
+ if (super->parent->action == 1 && super->parent->subAction == 2) {
super->parent->child = NULL;
DeleteThisEntity();
} else if (super->parent->action == 2) {
sub_0808B168(this, 0);
}
}
+
void sub_0808ABC4(PullableMushroomEntity* this) {
static const s8 gUnk_081211CC[] = { 0, -128, 0, -6, 0, 0, 5, -4, 0, 0, 0, 0, 0, -128, -5, -4 };
u32 tmp;
@@ -292,7 +293,7 @@ void sub_0808AEB0(PullableMushroomEntity* this) {
this->unk_7c = 1;
super->animationState = AnimationStateFlip90(gPlayerEntity.base.animationState >> 1);
super->direction = (super->animationState << 3);
- super->flags &= ~0x80;
+ COLLISION_OFF(super);
super->spriteSettings.flipX = gPlayerEntity.base.spriteSettings.flipX;
InitializeAnimation(super, super->animationState + 5);
if (sub_0808B21C(this, 0)) {
@@ -320,7 +321,7 @@ void PullableMushroom_Action3(PullableMushroomEntity* this) {
};
funcs[super->subAction](this);
- if ((((gPlayerState.field_0x1c & 0xf) != 1) || ((super->contactFlags & 0x7f) != 0x13)) && (super->type == 1)) {
+ if ((((gPlayerState.gustJarState & 0xf) != 1) || ((super->contactFlags & 0x7f) != 0x13)) && (super->type == 1)) {
(super->parent)->action = 1;
(super->parent)->subAction = 1;
super->direction = DirectionTurnAround(super->parent->direction);
@@ -336,7 +337,7 @@ void sub_0808B05C(PullableMushroomEntity* this) {
super->animationState = AnimationStateFlip90(gPlayerEntity.base.animationState >> 1);
super->direction = super->animationState << 3;
super->spriteSettings.flipX = gPlayerEntity.base.spriteSettings.flipX;
- super->flags &= ~0x80;
+ COLLISION_OFF(super);
InitializeAnimation(super, super->animationState + 5);
if (sub_0808B21C(this, 1)) {
sub_0808B168((PullableMushroomEntity*)super->child, 1);
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);