summaryrefslogtreecommitdiff
path: root/src/object
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2024-01-01 13:02:57 -0800
committertheo3 <arisstephenson2@gmail.com>2024-01-01 13:07:43 -0800
commitf5c6178ed4830769f65fbc74b18e3403eda05f86 (patch)
tree9ada8fe01cc0e308e32e385f9b6965971010cda0 /src/object
parent5324928f44a85e9867b960ca9a0a68931f5f3bbd (diff)
gustjar player fields
Diffstat (limited to 'src/object')
-rw-r--r--src/object/bush.c4
-rw-r--r--src/object/chuchuBossStartParticle.c2
-rw-r--r--src/object/evilSpirit.c5
-rw-r--r--src/object/gustJarParticle.c2
-rw-r--r--src/object/itemForSale.c6
-rw-r--r--src/object/lilypadLarge.c6
-rw-r--r--src/object/minecart.c2
-rw-r--r--src/object/objectA8.c4
-rw-r--r--src/object/objectOnSpinyBeetle.c6
-rw-r--r--src/object/octorokBossObject.c2
-rw-r--r--src/object/pot.c6
-rw-r--r--src/object/pullableMushroom.c11
12 files changed, 29 insertions, 27 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/evilSpirit.c b/src/object/evilSpirit.c
index a2943a52..2ab38f90 100644
--- a/src/object/evilSpirit.c
+++ b/src/object/evilSpirit.c
@@ -86,8 +86,9 @@ void EvilSpirit_Action1(EvilSpiritEntity* this) {
CalcOffsetAngle(super->parent->x.WORD - super->x.WORD, super->parent->y.WORD - super->y.WORD) ^ 0x80;
} else {
super->speed = 0x600;
- dir = CalcOffsetAngle(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;
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/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/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 bc77267c..075c858f 100644
--- a/src/object/octorokBossObject.c
+++ b/src/object/octorokBossObject.c
@@ -182,7 +182,7 @@ void OctorokBossObject_Action1(OctorokBossObjectEntity* this) {
}
case 1:
super->direction = CalcOffsetAngle(this->helper->tailObjects[super->timer]->x.WORD - super->x.WORD,
- this->helper->tailObjects[super->timer]->y.WORD - super->y.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;
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);