gustjar player fields

This commit is contained in:
theo3
2024-01-01 13:02:57 -08:00
parent 5324928f44
commit f5c6178ed4
34 changed files with 146 additions and 128 deletions
+2 -2
View File
@@ -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)) {
+1 -1
View File
@@ -264,7 +264,7 @@ void ChuchuBossStartParticle_Type9(ChuchuBossStartParticleEntity* this) {
DeleteThisEntity();
}
if (gPlayerState.field_0x1c != 1) {
if (gPlayerState.gustJarState != 1) {
DeleteThisEntity();
}
} else {
+3 -2
View File
@@ -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;
+1 -1
View File
@@ -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();
}
}
+3 -3
View File
@@ -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;
+3 -3
View File
@@ -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;
+1 -1
View File
@@ -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 {
+2 -2
View File
@@ -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)) {
+3 -3
View File
@@ -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;
+1 -1
View File
@@ -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;
+3 -3
View File
@@ -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);
}
}
+6 -5
View File
@@ -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);