mirror of
https://github.com/zeldaret/tmc
synced 2026-08-17 13:30:12 -04:00
Merge branch 'master' into tilemap-docs
This commit is contained in:
@@ -40,7 +40,7 @@ void BarrelSpiderweb_Init(Entity* this) {
|
||||
this->hitType = 1;
|
||||
this->collisionFlags = 7;
|
||||
this->hurtType = 0x48;
|
||||
this->flags2 = 4;
|
||||
this->collisionMask = 4;
|
||||
this->hitbox = (Hitbox*)&gHitbox_0;
|
||||
this->frameIndex = 2;
|
||||
this->collisionLayer = gPlayerEntity.base.collisionLayer;
|
||||
@@ -64,7 +64,7 @@ void sub_0808BBE0(Entity* this) {
|
||||
ptr = &gUnk_0812144C[diff * 2];
|
||||
SetAffineInfo(this, ptr[0], ptr[1], 0);
|
||||
} else {
|
||||
this->contactFlags &= ~0x80;
|
||||
this->contactFlags &= ~CONTACT_NOW;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ void BarrelSpiderweb_Action1(Entity* this) {
|
||||
tmp = -0x170;
|
||||
this->y.HALF.HI = gRoomControls.origin_y - ((this->parent)->zVelocity + tmp);
|
||||
sub_0808BBE0(this);
|
||||
if (this->contactFlags == 0x93) {
|
||||
if (this->contactFlags == (CONTACT_NOW | 0x13)) {
|
||||
this->timer--;
|
||||
this->spriteSettings.draw = 1;
|
||||
if (this->timer == 0) {
|
||||
@@ -114,7 +114,7 @@ void BarrelSpiderweb_Action2(Entity* this) {
|
||||
this->subtimer -= 8;
|
||||
SetAffineInfo(this, 0x200 - this->subtimer, 0x200 - this->subtimer, 0);
|
||||
}
|
||||
if (this->contactFlags == 0x93) {
|
||||
if (this->contactFlags == (CONTACT_NOW | 0x13)) {
|
||||
this->direction = GetFacingDirection(this, &gPlayerEntity.base);
|
||||
LinearMoveUpdate(this);
|
||||
if (EntityWithinDistance(this, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI - 6, 0x1c)) {
|
||||
|
||||
@@ -49,7 +49,7 @@ void BigIceBlock_Init(BigIceBlockEntity* this) {
|
||||
super->collisionFlags = 7;
|
||||
super->hurtType = 0x48;
|
||||
super->hitType = 1;
|
||||
super->flags2 = 0x80;
|
||||
super->collisionMask = 0x80;
|
||||
super->hitbox = (Hitbox*)&gUnk_080FD190;
|
||||
sub_08099910(this);
|
||||
InitializeAnimation(super, super->type);
|
||||
|
||||
+1
-1
@@ -131,7 +131,7 @@ void Bird_Type1_Action1_Subaction0(BirdEntity* this) {
|
||||
void Bird_Type1_Action1_Subaction1(BirdEntity* this) {
|
||||
Entity* fx;
|
||||
|
||||
if (sub_080044EC(super, 0x1800) < 2) {
|
||||
if (BounceUpdate(super, Q_8_8(24.0)) < BOUNCE_AIRBORNE) {
|
||||
super->type = 2;
|
||||
super->action = 1;
|
||||
super->z.WORD = 0;
|
||||
|
||||
+1
-1
@@ -138,7 +138,7 @@ void Book_Action2(BookEntity* this) {
|
||||
void Book_Action3(BookEntity* this) {
|
||||
Entity* fx;
|
||||
|
||||
if (sub_080044EC(super, 0x2800) != 1) {
|
||||
if (BounceUpdate(super, Q_8_8(40.0)) != BOUNCE_INIT_NEXT) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -51,7 +51,7 @@ void Bush_Init(BushEntity* this) {
|
||||
if (super->type == 3) {
|
||||
Bush_Action2SubAction5(this);
|
||||
}
|
||||
sub_08004168(super);
|
||||
SnapToTile(super);
|
||||
if (super->type == 4) {
|
||||
Bush_Action2SubAction5(this);
|
||||
}
|
||||
@@ -65,7 +65,7 @@ void Bush_Init(BushEntity* this) {
|
||||
super->health = 1;
|
||||
super->collisionFlags = 7;
|
||||
super->hitType = 0x6e;
|
||||
super->flags2 = 4;
|
||||
super->collisionMask = 4;
|
||||
super->hitbox = (Hitbox*)&gUnk_081205B4;
|
||||
this->unk_72 = 0;
|
||||
this->unk_70 = GetMetaTileIndex(COORD_TO_TILE(super), super->collisionLayer);
|
||||
@@ -74,7 +74,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();
|
||||
}
|
||||
@@ -109,7 +109,7 @@ void Bush_Action2SubAction2(BushEntity* this) {
|
||||
super->spriteOffsetX = 0;
|
||||
SetMetaTileByIndex(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)) {
|
||||
|
||||
@@ -264,7 +264,7 @@ void ChuchuBossStartParticle_Type9(ChuchuBossStartParticleEntity* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
if (gPlayerState.field_0x1c != 1) {
|
||||
if (gPlayerState.gustJarState != 1) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -11,7 +11,7 @@ void CrackingGround(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->timer = 20;
|
||||
sub_08004168(this);
|
||||
SnapToTile(this);
|
||||
} else {
|
||||
if (this->timer-- == 0) {
|
||||
sub_0807B7D8(0x35, COORD_TO_TILE(this), this->collisionLayer);
|
||||
|
||||
@@ -326,7 +326,7 @@ void sub_080969A4(CrenelBeanSproutEntity* this) {
|
||||
void sub_08096A78(CrenelBeanSproutEntity* this) {
|
||||
SetGlobalFlag(WATERBEAN_PUT);
|
||||
InitAnimationForceUpdate(super, (super->type >> 1) + 8);
|
||||
sub_08004168(super);
|
||||
SnapToTile(super);
|
||||
super->y.HALF.HI += 4;
|
||||
super->action = 3;
|
||||
SetMetaTile(SPECIAL_META_TILE_59, COORD_TO_TILE(super), super->collisionLayer);
|
||||
|
||||
@@ -551,7 +551,7 @@ void CutsceneMiscObject_Type11(CutsceneMiscObjectEntity* this) {
|
||||
InitAnimationForceUpdate(super, 0);
|
||||
}
|
||||
if (super->subAction != 0) {
|
||||
if ((u32)sub_080044EC(super, 0x1800) <= 1) {
|
||||
if ((u32)BounceUpdate(super, Q_8_8(24.0)) <= BOUNCE_INIT_NEXT) {
|
||||
super->subAction = 0;
|
||||
SetAffineInfo(super, 0x100, 0x100, 0xC000);
|
||||
} else {
|
||||
|
||||
@@ -78,7 +78,7 @@ void DirtParticle_Init(DirtParticleEntity* this) {
|
||||
super->health = 1;
|
||||
super->collisionFlags = 7;
|
||||
super->hitType = 0xaa;
|
||||
super->flags2 = 0x0e;
|
||||
super->collisionMask = 0x0e;
|
||||
super->hitbox = (Hitbox*)&gUnk_08120A8C;
|
||||
super->gustJarFlags = 0;
|
||||
case 2:
|
||||
@@ -101,7 +101,7 @@ void DirtParticle_Init(DirtParticleEntity* this) {
|
||||
|
||||
void DirtParticle_Action1(DirtParticleEntity* this) {
|
||||
DirtParticleEntity* entity;
|
||||
if ((super->contactFlags & 0x80) == 0) {
|
||||
if ((super->contactFlags & CONTACT_NOW) == 0) {
|
||||
return;
|
||||
}
|
||||
switch (super->contactFlags & 0x7f) {
|
||||
@@ -128,7 +128,7 @@ void DirtParticle_Action3(DirtParticleEntity* this) {
|
||||
sub_08087B9C,
|
||||
sub_08087B9C,
|
||||
};
|
||||
if ((super->contactFlags & 0x80) != 0) {
|
||||
if ((super->contactFlags & CONTACT_NOW) != 0) {
|
||||
gUnk_08120A80[super->subAction](this);
|
||||
} else {
|
||||
super->action = 1;
|
||||
|
||||
@@ -55,7 +55,7 @@ void EvilSpirit_Init(EvilSpiritEntity* this) {
|
||||
COLLISION_ON(super);
|
||||
super->collisionFlags = 7;
|
||||
super->hitType = 1;
|
||||
super->flags2 = 4;
|
||||
super->collisionMask = 4;
|
||||
for (index = 0; index < 4; index++) {
|
||||
evilSpiritEnt = CreateObjectWithParent(super, EVIL_SPIRIT, index + 1, 0);
|
||||
super->child = evilSpiritEnt;
|
||||
|
||||
@@ -37,7 +37,7 @@ void EyeSwitch_Init(EyeSwitchEntity* this) {
|
||||
super->collisionFlags = 7;
|
||||
super->hurtType = 0x48;
|
||||
super->hitType = 1;
|
||||
super->flags2 = 2;
|
||||
super->collisionMask = 2;
|
||||
super->hitbox = (Hitbox*)&gHitbox_1;
|
||||
if (CheckFlags(this->eyeSwitchFlags)) {
|
||||
super->action = 3;
|
||||
@@ -50,7 +50,7 @@ void EyeSwitch_Init(EyeSwitchEntity* this) {
|
||||
}
|
||||
|
||||
void EyeSwitch_Action1(EyeSwitchEntity* this) {
|
||||
if ((super->contactFlags == 0x95 || super->contactFlags == 0x8e) &&
|
||||
if ((super->contactFlags == (CONTACT_NOW | 0x15) || super->contactFlags == (CONTACT_NOW | 0xe)) &&
|
||||
(DirectionRoundUp(super->contactedEntity->direction) >> 3 == (super->animationState & 3))) {
|
||||
super->action = 2;
|
||||
COLLISION_OFF(super);
|
||||
|
||||
+3
-3
@@ -40,7 +40,7 @@ void Fairy(FairyEntity* this) {
|
||||
Fairy_Init, Fairy_Action1, Fairy_Action2, Fairy_Action3, Fairy_Action4,
|
||||
};
|
||||
|
||||
if (((super->contactFlags & 0x80) != 0)) {
|
||||
if (((super->contactFlags & CONTACT_NOW) != 0)) {
|
||||
switch (super->contactFlags & 0x7f) {
|
||||
case 0x14:
|
||||
super->action = 3;
|
||||
@@ -103,7 +103,7 @@ void Fairy_Init(FairyEntity* this) {
|
||||
super->collisionFlags = 0x17;
|
||||
super->hurtType = 0x49;
|
||||
super->hitType = 7;
|
||||
super->flags2 = 0x17;
|
||||
super->collisionMask = 0x17;
|
||||
super->health = 0xff;
|
||||
super->hitbox = (Hitbox*)&gUnk_080FD1A8;
|
||||
super->gustJarFlags = 1;
|
||||
@@ -253,6 +253,6 @@ void sub_0808DB2C(FairyEntity* this) {
|
||||
super->action = 2;
|
||||
super->subAction = 0;
|
||||
super->flags |= ENT_COLLIDE;
|
||||
super->flags2 = 1;
|
||||
super->collisionMask = 1;
|
||||
CopyPosition(&gPlayerEntity.base, super);
|
||||
}
|
||||
|
||||
@@ -260,9 +260,9 @@ void FigurineDevice_Action4(FigurineDeviceEntity* this) {
|
||||
tmp = 1;
|
||||
}
|
||||
#ifdef JP
|
||||
switch (gInput.unk4) {
|
||||
switch (gInput.menuScrollKeys) {
|
||||
#else
|
||||
switch (gInput.unk4 & 0xfffffeff) {
|
||||
switch (gInput.menuScrollKeys & ~R_BUTTON) {
|
||||
#endif
|
||||
case DPAD_UP:
|
||||
FigurineDevice_ChangeShellAmount(this, tmp);
|
||||
@@ -275,7 +275,7 @@ void FigurineDevice_Action4(FigurineDeviceEntity* this) {
|
||||
sub_080882A8(this);
|
||||
}
|
||||
#else
|
||||
switch (gInput.unk4) {
|
||||
switch (gInput.menuScrollKeys) {
|
||||
case DPAD_UP:
|
||||
FigurineDevice_ChangeShellAmount(this, 1);
|
||||
break;
|
||||
|
||||
@@ -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,7 +550,7 @@ 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) {
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ void Flame_Init(FlameEntity* this) {
|
||||
break;
|
||||
case 2:
|
||||
super->timer = 15;
|
||||
sub_08004168(super);
|
||||
SnapToTile(super);
|
||||
break;
|
||||
case 3:
|
||||
CopyPosition(super->parent, super);
|
||||
|
||||
@@ -152,7 +152,7 @@ void GleerokParticle_Init(GleerokParticleEntity* this) {
|
||||
super->collisionFlags = 7;
|
||||
super->hurtType = 0x48;
|
||||
super->hitType = 0x7a;
|
||||
super->flags2 = 1;
|
||||
super->collisionMask = 1;
|
||||
}
|
||||
break;
|
||||
case 0x80:
|
||||
|
||||
@@ -124,7 +124,7 @@ void GraveyardKey_Action2(Entity* this, const struct_gUnk_08123FB0* param_2) {
|
||||
u8 type;
|
||||
|
||||
LinearMoveUpdate(this);
|
||||
if (sub_080044EC(this, param_2->unk14) < 2) {
|
||||
if (BounceUpdate(this, param_2->unk14) < BOUNCE_AIRBORNE) {
|
||||
if (this->timer) {
|
||||
this->timer--;
|
||||
this->zVelocity = param_2->unk14 << 3;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ void HittableLever_Init(HittableLeverEntity* this) {
|
||||
super->flags |= ENT_COLLIDE;
|
||||
super->collisionFlags = 7;
|
||||
super->hitType = 0x8f;
|
||||
super->flags2 = 0xa;
|
||||
super->collisionMask = 0xa;
|
||||
super->hitbox = (Hitbox*)&HittableLever_Hitbox;
|
||||
if (super->type == 0) {
|
||||
if (CheckFlags(this->hitFlag)) {
|
||||
@@ -47,7 +47,7 @@ void HittableLever_Init(HittableLeverEntity* this) {
|
||||
}
|
||||
|
||||
void HittableLever_Idle(HittableLeverEntity* this) {
|
||||
if (((super->contactFlags & 0x80) != 0) && (this->wasHit == 0)) {
|
||||
if (((super->contactFlags & CONTACT_NOW) != 0) && (this->wasHit == 0)) {
|
||||
this->wasHit = 1;
|
||||
super->type ^= 1;
|
||||
super->iframes = -0x18;
|
||||
|
||||
@@ -91,7 +91,7 @@ void ItemForSale_Action1(ItemForSaleEntity* this) {
|
||||
PausePlayer();
|
||||
ResetActiveItems();
|
||||
gPlayerState.heldObject = 4;
|
||||
gPlayerEntity.unk_74 = super;
|
||||
gPlayerEntity.carriedEntity = super;
|
||||
gHUD.rActionPlayerState = R_ACTION_DROP;
|
||||
MessageClose();
|
||||
}
|
||||
@@ -104,7 +104,7 @@ void ItemForSale_Action2(ItemForSaleEntity* this) {
|
||||
|
||||
gHUD.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();
|
||||
@@ -120,7 +120,7 @@ void ItemForSale_Action2(ItemForSaleEntity* this) {
|
||||
void sub_080819B4(ItemForSaleEntity* this) {
|
||||
Entity* parent;
|
||||
u8* puVar2;
|
||||
HUD* ptr;
|
||||
HUD* hud;
|
||||
|
||||
if (gRoomVars.shopItemType == 0) {
|
||||
if (super->parent != NULL) {
|
||||
@@ -129,11 +129,11 @@ void sub_080819B4(ItemForSaleEntity* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
gPlayerState.heldObject = 0;
|
||||
gPlayerEntity.unk_74 = 0;
|
||||
ptr = &gHUD;
|
||||
gPlayerEntity.carriedEntity = 0;
|
||||
hud = &gHUD;
|
||||
gRoomVars.shopItemType = 0;
|
||||
ptr->rActionInteractObject = R_ACTION_NONE;
|
||||
ptr->rActionPlayerState = R_ACTION_NONE;
|
||||
hud->rActionInteractObject = R_ACTION_NONE;
|
||||
hud->rActionPlayerState = R_ACTION_NONE;
|
||||
gRoomVars.shopItemType2 = 0;
|
||||
super->x.HALF.HI = this->unk_80 + gRoomControls.origin_x;
|
||||
super->y.HALF.HI = this->unk_82 + gRoomControls.origin_y;
|
||||
|
||||
@@ -64,7 +64,7 @@ void ItemOnGround(ItemOnGroundEntity* this) {
|
||||
static void (*const ItemOnGround_Actions[])(ItemOnGroundEntity*) = {
|
||||
ItemOnGround_Init, ItemOnGround_Action1, ItemOnGround_Action2, ItemOnGround_Action3, ItemOnGround_Action4,
|
||||
};
|
||||
if (super->contactFlags & 0x80) {
|
||||
if (super->contactFlags & CONTACT_NOW) {
|
||||
switch (super->contactFlags & 0x7F) {
|
||||
case 20:
|
||||
super->action = 3;
|
||||
@@ -131,10 +131,10 @@ void ItemOnGround_Init(ItemOnGroundEntity* this) {
|
||||
case ITEM_BOMBS5:
|
||||
case ITEM_ARROWS5:
|
||||
case ITEM_HEART:
|
||||
super->flags2 = 0x17;
|
||||
super->collisionMask = 0x17;
|
||||
break;
|
||||
default:
|
||||
super->flags2 = 0x11;
|
||||
super->collisionMask = 0x11;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ void sub_080810FC(ItemOnGroundEntity* this) {
|
||||
super->action = 2;
|
||||
super->subAction = 0;
|
||||
COLLISION_ON(super);
|
||||
super->flags2 = 0x11;
|
||||
super->collisionMask = 0x11;
|
||||
CopyPosition(&gPlayerEntity.base, super);
|
||||
}
|
||||
}
|
||||
@@ -438,7 +438,7 @@ u32 sub_080814C0(ItemOnGroundEntity* this) {
|
||||
|
||||
void sub_08081500(ItemOnGroundEntity* this) {
|
||||
if (this->unk_68 == 0) {
|
||||
u32 var0 = sub_080044EC(super, 0x2800);
|
||||
u32 var0 = BounceUpdate(super, Q_8_8(40.0));
|
||||
if (var0 == 0) {
|
||||
this->unk_68 = 1;
|
||||
} else {
|
||||
|
||||
@@ -40,7 +40,7 @@ void JarPortal_Init(JarPortalEntity* this) {
|
||||
super->hitType = 1;
|
||||
super->collisionFlags = 0x47;
|
||||
super->hurtType = 0x44;
|
||||
super->flags2 = 0x80;
|
||||
super->collisionMask = 0x80;
|
||||
this->unk_68 = 0;
|
||||
if (CheckLocalFlag(super->type)) {
|
||||
if (this->unk_7c != 0) {
|
||||
@@ -171,7 +171,7 @@ void JarPortal_Action4(JarPortalEntity* this) {
|
||||
}
|
||||
|
||||
u32 sub_0808C128(JarPortalEntity* this) {
|
||||
return super->contactFlags == 157;
|
||||
return super->contactFlags == (CONTACT_NOW | 0x1d);
|
||||
}
|
||||
|
||||
void sub_0808C13C(JarPortalEntity* this) {
|
||||
|
||||
@@ -163,7 +163,7 @@ void KeyStealingTakkuri_Type5_Init(KeyStealingTakkuriEntity* this) {
|
||||
|
||||
void KeyStealingTakkuri_Type5_Action1(KeyStealingTakkuriEntity* this) {
|
||||
LinearMoveUpdate(super);
|
||||
if (sub_080044EC(super, 0x2000) < 2) {
|
||||
if (BounceUpdate(super, Q_8_8(32.0)) < BOUNCE_AIRBORNE) {
|
||||
if (super->timer != 0) {
|
||||
super->timer--;
|
||||
super->zVelocity = Q_16_16(1.0);
|
||||
|
||||
@@ -112,7 +112,7 @@ void LavaPlatform_Type1Init(LavaPlatformEntity* this) {
|
||||
super->spritePriority.b0 = 7;
|
||||
super->hurtType = 0x48;
|
||||
super->collisionFlags = 7;
|
||||
super->flags2 = 0x81;
|
||||
super->collisionMask = 0x81;
|
||||
super->hitbox = (Hitbox*)&gUnk_080FD280;
|
||||
sub_0809264C(this);
|
||||
}
|
||||
@@ -131,7 +131,7 @@ void LavaPlatform_Type1Action1(LavaPlatformEntity* this) {
|
||||
}
|
||||
|
||||
void LavaPlatform_Type1Action2(LavaPlatformEntity* this) {
|
||||
if (super->contactFlags == 0x9d) {
|
||||
if (super->contactFlags == (CONTACT_NOW | 0x1d)) {
|
||||
sub_08092620(this);
|
||||
} else {
|
||||
if (LavaPlatform_IsPlayerOnPlatform(this)) {
|
||||
@@ -223,7 +223,7 @@ void LavaPlatform_Type1Action6(LavaPlatformEntity* this) {
|
||||
}
|
||||
|
||||
void LavaPlatform_Type1Action7(LavaPlatformEntity* this) {
|
||||
if (super->contactFlags == 0x9d) {
|
||||
if (super->contactFlags == (CONTACT_NOW | 0x1d)) {
|
||||
sub_08092620(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ void LightableSwitch_Type0_Init(LightableSwitchEntity* this) {
|
||||
super->collisionFlags = 7;
|
||||
super->hurtType = 0x48;
|
||||
super->hitType = 0x28;
|
||||
super->flags2 = 10;
|
||||
super->collisionMask = 10;
|
||||
super->hitbox = (Hitbox*)&gHitbox_0;
|
||||
sub_0809EAD8(this);
|
||||
UpdateSpriteForCollisionLayer(super);
|
||||
@@ -68,7 +68,7 @@ void LightableSwitch_Type0_Init(LightableSwitchEntity* this) {
|
||||
|
||||
void LightableSwitch_Type0_Action1(LightableSwitchEntity* this) {
|
||||
|
||||
if ((super->contactFlags & 0x80) != 0) {
|
||||
if ((super->contactFlags & CONTACT_NOW) != 0) {
|
||||
if (CheckFlags(this->unk_86) != 0) {
|
||||
ClearFlag(this->unk_86);
|
||||
} else {
|
||||
@@ -137,7 +137,7 @@ void LightableSwitch_Type1_Init(LightableSwitchEntity* this) {
|
||||
super->collisionFlags = 7;
|
||||
super->hurtType = 0x48;
|
||||
super->hitType = 0x28;
|
||||
super->flags2 = 10;
|
||||
super->collisionMask = 10;
|
||||
super->hitbox = (Hitbox*)&gHitbox_0;
|
||||
sub_0809EAD8(this);
|
||||
UpdateSpriteForCollisionLayer(super);
|
||||
@@ -148,7 +148,7 @@ void LightableSwitch_Type1_Init(LightableSwitchEntity* this) {
|
||||
}
|
||||
|
||||
void LightableSwitch_Type1_Action1(LightableSwitchEntity* this) {
|
||||
if ((super->contactFlags & 0x80) != 0) {
|
||||
if ((super->contactFlags & CONTACT_NOW) != 0) {
|
||||
super->action = 2;
|
||||
super->timer = 16;
|
||||
super->frameIndex = 2;
|
||||
|
||||
@@ -78,7 +78,7 @@ void LilypadLarge_Init(LilypadLargeEntity* this) {
|
||||
super->flags |= ENT_COLLIDE;
|
||||
super->collisionFlags = 7;
|
||||
super->hitType = 1;
|
||||
super->flags2 = 4;
|
||||
super->collisionMask = 4;
|
||||
this->unk_78.WORD = 0x1000000;
|
||||
this->unk_7c.HALF_U.HI = 0x1000;
|
||||
this->unk_85 = 0;
|
||||
@@ -127,8 +127,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;
|
||||
@@ -156,7 +156,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
@@ -130,7 +130,7 @@ void Mask_Action2(MaskEntity* this) {
|
||||
|
||||
CreateRandomItemDrop(super, 3);
|
||||
} else {
|
||||
sub_080044EC(super, this->unk_78);
|
||||
BounceUpdate(super, this->unk_78);
|
||||
|
||||
if (super->z.HALF.HI == 0) {
|
||||
super->timer++;
|
||||
|
||||
@@ -55,7 +55,7 @@ void Minecart_Init(MinecartEntity* this) {
|
||||
super->hitType = 1;
|
||||
super->collisionFlags = 0x47;
|
||||
super->hurtType = 0x44;
|
||||
super->flags2 = 0x80;
|
||||
super->collisionMask = 0x80;
|
||||
super->direction = DirectionFromAnimationState(super->animationState);
|
||||
super->speed = 0x700;
|
||||
super->spritePriority.b1 = 3;
|
||||
@@ -71,7 +71,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 {
|
||||
@@ -113,7 +113,7 @@ void Minecart_Action2(MinecartEntity* this) {
|
||||
super->flags |= ENT_PERSIST;
|
||||
super->hitType = 0x97;
|
||||
super->collisionFlags = (gPlayerEntity.base.collisionFlags + 1) | 0x20;
|
||||
super->flags2 = gPlayerEntity.base.flags2;
|
||||
super->collisionMask = gPlayerEntity.base.collisionMask;
|
||||
super->hurtType = 0x18;
|
||||
super->damage = 8;
|
||||
sub_0801766C(super);
|
||||
@@ -175,7 +175,7 @@ void Minecart_Action3(MinecartEntity* this) {
|
||||
super->hitType = 1;
|
||||
super->collisionFlags = 0x47;
|
||||
super->hurtType = 0x44;
|
||||
super->flags2 = 0x80;
|
||||
super->collisionMask = 0x80;
|
||||
super->action = 6;
|
||||
sub_08017744(super);
|
||||
gPlayerState.jump_status = 0x41;
|
||||
@@ -185,7 +185,7 @@ void Minecart_Action3(MinecartEntity* this) {
|
||||
gPlayerEntity.base.animationState = super->animationState * 2;
|
||||
gPlayerEntity.base.direction = super->direction;
|
||||
gPlayerEntity.base.flags |= PL_MINISH;
|
||||
sub_08004168(super);
|
||||
SnapToTile(super);
|
||||
InitAnimationForceUpdate(super, super->animationState + 0xc);
|
||||
SoundReq(SFX_PLY_VO4);
|
||||
SoundReq(SFX_139);
|
||||
@@ -218,7 +218,7 @@ void Minecart_Action3(MinecartEntity* this) {
|
||||
}
|
||||
|
||||
void Minecart_Action4(MinecartEntity* this) {
|
||||
sub_08004168(super);
|
||||
SnapToTile(super);
|
||||
CopyPosition(super, &gPlayerEntity.base);
|
||||
switch (GetVvvAtEntity(super)) {
|
||||
case VVV_103:
|
||||
|
||||
@@ -46,7 +46,7 @@ void MineralWaterSource_Init(Entity* this) {
|
||||
|
||||
this->collisionFlags = 7;
|
||||
this->hitType = 145;
|
||||
this->flags2 = 2;
|
||||
this->collisionMask = 2;
|
||||
|
||||
this->action = 1;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
#include "entity.h"
|
||||
#include "sound.h"
|
||||
#include "enemy.h"
|
||||
|
||||
void MulldozerSpawnPoint_Init(Entity*);
|
||||
void MulldozerSpawnPoint_Action1(Entity*);
|
||||
@@ -37,6 +38,6 @@ void MulldozerSpawnPoint_Action1(Entity* this) {
|
||||
parent = this->parent;
|
||||
parent->flags = this->timer;
|
||||
parent->spriteSettings.draw = this->subtimer;
|
||||
((GenericEntity*)parent)->field_0x6c.HALF.HI &= 0xef;
|
||||
((Enemy*)parent)->enemyFlags &= ~EM_FLAG_SUPPORT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ void Object53_Init(Entity* this) {
|
||||
this->spriteRendering.b3 = 2;
|
||||
this->zVelocity = Q_16_16(2.625);
|
||||
InitializeAnimation(this, gUnk_08122288[this->type].animationState);
|
||||
sub_08004168(this);
|
||||
SnapToTile(this);
|
||||
}
|
||||
|
||||
void Object53_Action1(Entity* this) {
|
||||
|
||||
@@ -23,7 +23,7 @@ void Object70_Init(Entity* this) {
|
||||
this->spriteSettings.draw = 1;
|
||||
this->frameIndex = this->type + 0xb;
|
||||
if (this->type != 0) {
|
||||
sub_08004168(this);
|
||||
SnapToTile(this);
|
||||
gPlayerEntity.base.spriteOrientation.flipY = 3;
|
||||
if ((gPlayerEntity.base.spritePriority.b0) != 7) {
|
||||
this->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0 + 1;
|
||||
|
||||
@@ -51,7 +51,7 @@ void ObjectA2_Action1(Entity* this) {
|
||||
LinearMoveUpdate(this);
|
||||
#ifndef EU
|
||||
if (gSaveHeader->language < 2) {
|
||||
if (sub_080044EC(this, 0x2000) < 2) {
|
||||
if (BounceUpdate(this, Q_8_8(32.0)) < BOUNCE_AIRBORNE) {
|
||||
this->z.WORD = 0;
|
||||
this->action = 2;
|
||||
InitializeAnimation(this, 1);
|
||||
@@ -61,15 +61,15 @@ void ObjectA2_Action1(Entity* this) {
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
switch (sub_080044EC(this, 0x2000)) {
|
||||
switch (BounceUpdate(this, Q_8_8(32.0))) {
|
||||
default:
|
||||
this->timer++;
|
||||
break;
|
||||
case 0:
|
||||
case BOUNCE_DONE_ALL:
|
||||
this->action = 2;
|
||||
InitializeAnimation(this, 1);
|
||||
// fall through
|
||||
case 1:
|
||||
case BOUNCE_INIT_NEXT:
|
||||
this->timer = 0;
|
||||
sub_0809F448(this);
|
||||
SoundReq(SFX_186);
|
||||
|
||||
@@ -39,7 +39,7 @@ void ObjectA8(ObjectA8Entity* this) {
|
||||
ObjectA8_Init, ObjectA8_Action1, ObjectA8_Action2, ObjectA8_Action3,
|
||||
ObjectA8_Action4, ObjectA8_Action5, ObjectA8_Action6,
|
||||
};
|
||||
if ((super->contactFlags & 0x80) != 0) {
|
||||
if ((super->contactFlags & CONTACT_NOW) != 0) {
|
||||
switch (super->contactFlags & 0x7f) {
|
||||
case 0:
|
||||
case 1:
|
||||
@@ -77,7 +77,7 @@ void ObjectA8_Init(ObjectA8Entity* this) {
|
||||
super->collisionFlags = 0x17;
|
||||
super->hurtType = 0x48;
|
||||
super->hitType = 7;
|
||||
super->flags2 = 0x17;
|
||||
super->collisionMask = 0x17;
|
||||
super->hitbox = (Hitbox*)&gUnk_080FD1A8;
|
||||
super->gustJarFlags = 1;
|
||||
this->unk_74 = super->x.HALF.HI;
|
||||
@@ -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)) {
|
||||
|
||||
@@ -54,7 +54,7 @@ void ObjectOnSpinyBeetle_Init(ObjectOnSpinyBeetleEntity* this) {
|
||||
super->spriteRendering.b3 = 2;
|
||||
super->subtimer = 0;
|
||||
super->hitType = 0x6e;
|
||||
super->flags2 = 0x86;
|
||||
super->collisionMask = 0x86;
|
||||
super->carryFlags = 0;
|
||||
if (super->type != 0) {
|
||||
super->gustJarFlags = 2;
|
||||
@@ -72,7 +72,7 @@ void ObjectOnSpinyBeetle_Action1(ObjectOnSpinyBeetleEntity* this) {
|
||||
sub_080989C0(this);
|
||||
return;
|
||||
}
|
||||
if ((super->contactFlags & 0x80) != 0) {
|
||||
if ((super->contactFlags & CONTACT_NOW) != 0) {
|
||||
switch (super->contactFlags & 0x3f) {
|
||||
case 0x13:
|
||||
super->action = 3;
|
||||
@@ -138,7 +138,7 @@ void ObjectOnSpinyBeetle_Action2Subaction0(ObjectOnSpinyBeetleEntity* this) {
|
||||
super->flags |= ENT_COLLIDE;
|
||||
super->collisionFlags = 7;
|
||||
super->hitType = 1;
|
||||
super->flags2 = gPlayerEntity.base.flags2;
|
||||
super->collisionMask = gPlayerEntity.base.collisionMask;
|
||||
super->spriteOffsetY = 0;
|
||||
(super->parent)->child = NULL;
|
||||
super->subAction++;
|
||||
@@ -152,7 +152,7 @@ void ObjectOnSpinyBeetle_Action2Subaction2(ObjectOnSpinyBeetleEntity* this) {
|
||||
}
|
||||
|
||||
void ObjectOnSpinyBeetle_Action2Subaction3(ObjectOnSpinyBeetleEntity* this) {
|
||||
switch (sub_080043E8(super)) {
|
||||
switch (GetTileHazardType(super)) {
|
||||
case 2:
|
||||
CreateFx(super, FX_WATER_SPLASH, 0);
|
||||
break;
|
||||
@@ -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;
|
||||
|
||||
@@ -110,7 +110,7 @@ void PlayerClone_Action2(PlayerCloneEntity* this) {
|
||||
if (gPlayerEntity.base.iframes >= 1) {
|
||||
gPlayerState.chargeState.action = 1;
|
||||
} else {
|
||||
GetVvvAtEntity(super); // TODO why is the return value not used?
|
||||
GetVvvAtEntity(super); // TODO why is the return value not used? // leftover from debugging?
|
||||
sub_08084B1C(this);
|
||||
super->x.HALF.HI = gPlayerEntity.base.x.HALF.HI + this->unk78;
|
||||
super->y.HALF.HI = gPlayerEntity.base.y.HALF.HI + this->unk7a;
|
||||
@@ -164,7 +164,7 @@ void sub_08084B1C(PlayerCloneEntity* this) {
|
||||
super->spritePriority.b0 = gPlayerEntity.base.spritePriority.b0;
|
||||
super->spriteOrientation.flipY = gPlayerEntity.base.spriteOrientation.flipY;
|
||||
super->collisionLayer = gPlayerEntity.base.collisionLayer;
|
||||
super->flags2 = gPlayerEntity.base.flags2;
|
||||
super->collisionMask = gPlayerEntity.base.collisionMask;
|
||||
super->hitType = gPlayerEntity.base.hitType;
|
||||
super->collisionFlags = gPlayerEntity.base.collisionFlags;
|
||||
super->hurtType = gPlayerEntity.base.hurtType;
|
||||
|
||||
+17
-17
@@ -26,7 +26,7 @@ typedef struct {
|
||||
} PotEntity;
|
||||
|
||||
void Pot_Action5(PotEntity*);
|
||||
static void sub_08082850(PotEntity*, Entity*);
|
||||
static void BreakPot(PotEntity*, Entity*);
|
||||
void sub_08082608(PotEntity* this);
|
||||
void Pot_Init(PotEntity* this);
|
||||
void Pot_Action1(PotEntity* this);
|
||||
@@ -49,7 +49,7 @@ void sub_0808270C(PotEntity* this);
|
||||
void sub_080826FC(PotEntity* this);
|
||||
|
||||
extern void RegisterCarryEntity(Entity*);
|
||||
extern void sub_08016A6C(Entity*);
|
||||
extern void CheckOnLayerTransition(Entity*);
|
||||
|
||||
void Pot(PotEntity* this) {
|
||||
static void (*const Pot_Actions[])(PotEntity*) = {
|
||||
@@ -73,7 +73,7 @@ void Pot_Init(PotEntity* this) {
|
||||
super->health = 1;
|
||||
super->collisionFlags = 7;
|
||||
super->hitType = 0x6E;
|
||||
super->flags2 = 0x84;
|
||||
super->collisionMask = 0x84;
|
||||
super->gustJarFlags = 0x12;
|
||||
if (super->collisionLayer == 0) {
|
||||
ResolveCollisionLayer(super);
|
||||
@@ -135,7 +135,7 @@ void Pot_Action1(PotEntity* this) {
|
||||
gPlayerState.lastSwordMove = SWORD_MOVE_BREAK_POT;
|
||||
SetMetaTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
|
||||
}
|
||||
sub_08082850(this, NULL);
|
||||
BreakPot(this, NULL);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@@ -157,7 +157,7 @@ void sub_08082510(PotEntity* this) {
|
||||
super->hitbox = (Hitbox*)&gUnk_080FD340;
|
||||
super->collisionFlags = 7;
|
||||
super->hitType = 1;
|
||||
super->flags2 = gPlayerEntity.base.flags2;
|
||||
super->collisionMask = gPlayerEntity.base.collisionMask;
|
||||
super->spriteOffsetY = 0;
|
||||
SetMetaTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
|
||||
super->subAction++;
|
||||
@@ -171,7 +171,7 @@ void sub_08082588(PotEntity* this) {
|
||||
}
|
||||
|
||||
void sub_0808259C(PotEntity* this) {
|
||||
switch (sub_080043E8(super)) {
|
||||
switch (GetTileHazardType(super)) {
|
||||
case 2:
|
||||
CreateFx(super, FX_WATER_SPLASH, 0);
|
||||
break;
|
||||
@@ -182,7 +182,7 @@ void sub_0808259C(PotEntity* this) {
|
||||
CreateFx(super, FX_LAVA_SPLASH, 0);
|
||||
break;
|
||||
default:
|
||||
sub_08082850(this, &gPlayerEntity.base);
|
||||
BreakPot(this, &gPlayerEntity.base);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ void Pot_Action4(PotEntity* this) {
|
||||
sub_0800445C(super);
|
||||
if (super->timer-- != 0) {
|
||||
LinearMoveUpdate(super);
|
||||
sub_08016A6C(super);
|
||||
CheckOnLayerTransition(super);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ void Pot_Action4(PotEntity* this) {
|
||||
switch (tileType) {
|
||||
case 0x71:
|
||||
case 0x72:
|
||||
sub_08082850(this, NULL);
|
||||
BreakPot(this, NULL);
|
||||
break;
|
||||
default:
|
||||
SetMetaTile(SPECIAL_META_TILE_0, COORD_TO_TILE(super), super->collisionLayer);
|
||||
@@ -251,7 +251,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;
|
||||
SetMetaTile(SPECIAL_META_TILE_0, COORD_TO_TILE(super), super->collisionLayer);
|
||||
@@ -268,16 +268,16 @@ void sub_08082778(PotEntity* this) {
|
||||
SetMetaTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
|
||||
}
|
||||
|
||||
if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (super->contactFlags & 0x7F) != 0x13) {
|
||||
sub_08082850(this, NULL);
|
||||
if ((gPlayerState.gustJarState & 0xF) != 0x1 || (super->contactFlags & 0x7F) != 0x13) {
|
||||
BreakPot(this, NULL);
|
||||
} else {
|
||||
sub_0806F3E4(super);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080827F8(PotEntity* this) {
|
||||
if (gPlayerState.field_0x1c == 0) {
|
||||
sub_08082850(this, NULL);
|
||||
if (gPlayerState.gustJarState == 0) {
|
||||
BreakPot(this, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ void nullsub_512(PotEntity* this) {
|
||||
}
|
||||
|
||||
void sub_08082818(PotEntity* this) {
|
||||
sub_08082850(this, NULL);
|
||||
BreakPot(this, NULL);
|
||||
}
|
||||
|
||||
void Pot_Action5(PotEntity* this) {
|
||||
@@ -294,11 +294,11 @@ void Pot_Action5(PotEntity* this) {
|
||||
}
|
||||
|
||||
if (GravityUpdate(super, Q_8_8(32.0)) == 0) {
|
||||
sub_08082850(this, NULL);
|
||||
BreakPot(this, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_08082850(PotEntity* this, Entity* parent) {
|
||||
static void BreakPot(PotEntity* this, Entity* parent) {
|
||||
u32 parameter = sub_0808288C(super, super->type, this->unk_7d, super->type2);
|
||||
Entity* fxEntity = CreateFx(super, FX_POT_SHATTER, parameter);
|
||||
if (fxEntity) {
|
||||
|
||||
@@ -64,9 +64,9 @@ void PullableMushroom_Init(PullableMushroomEntity* this) {
|
||||
super->health = 1;
|
||||
super->collisionFlags = 7;
|
||||
super->hitType = 0x6e;
|
||||
super->flags2 = 0x0e;
|
||||
super->collisionMask = 0x0e;
|
||||
super->gustJarFlags = 1;
|
||||
super->flags |= 0x80;
|
||||
COLLISION_ON(super);
|
||||
super->spriteOffsetY = 4;
|
||||
break;
|
||||
case 1:
|
||||
@@ -77,7 +77,7 @@ void PullableMushroom_Init(PullableMushroomEntity* this) {
|
||||
super->health = 1;
|
||||
super->collisionFlags = 7;
|
||||
super->hitType = 0x6e;
|
||||
super->flags2 = 4;
|
||||
super->collisionMask = 4;
|
||||
super->gustJarFlags = 1;
|
||||
super->action = 3;
|
||||
}
|
||||
@@ -117,13 +117,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;
|
||||
@@ -293,7 +294,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)) {
|
||||
@@ -321,7 +322,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);
|
||||
@@ -337,7 +338,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);
|
||||
|
||||
@@ -108,13 +108,13 @@ void PushableStatue_SubAction0(PushableStatueEntity* this) {
|
||||
this->unk_83 = 1;
|
||||
index = gPlayerEntity.base.animationState;
|
||||
ptr = &gUnk_08120CB4[index];
|
||||
PositionRelative(super, &gPlayerEntity.base, *(ptr) << 0x10, *(ptr + 1) << 0x10);
|
||||
PositionRelative(super, &gPlayerEntity.base, Q_16_16(ptr[0]), Q_16_16(ptr[1]));
|
||||
}
|
||||
metaTileType = GetMetaTileType(this->unk_84, super->collisionLayer);
|
||||
if (metaTileType != SPECIAL_META_TILE_11) {
|
||||
switch (sub_0808968C(metaTileType)) {
|
||||
case 1:
|
||||
super->direction = (((metaTileType - 0xc) & 3) << 3);
|
||||
super->direction = DirectionFromAnimationState((metaTileType - 0xc) & 3);
|
||||
sub_08089538(this);
|
||||
break;
|
||||
case 0:
|
||||
@@ -135,7 +135,7 @@ void PushableStatue_SubAction0(PushableStatueEntity* this) {
|
||||
gPlayerState.flags |= PL_BUSY;
|
||||
gPlayerEntity.base.x.HALF.LO = 0;
|
||||
gPlayerEntity.base.y.HALF.LO = 0;
|
||||
super->direction = (gPlayerEntity.base.animationState ^ 4) << 2;
|
||||
super->direction = Direction8FromAnimationState(AnimationStateFlip180(gPlayerEntity.base.animationState));
|
||||
sub_08089538(this);
|
||||
}
|
||||
}
|
||||
@@ -183,7 +183,7 @@ void sub_080894C8(PushableStatueEntity* this) {
|
||||
|
||||
void sub_080894FC(PushableStatueEntity* this) {
|
||||
u32 index;
|
||||
for (index = 0; index <= 7; index++) {
|
||||
for (index = 0; index < 8; index++) {
|
||||
if (super == gRoomVars.puzzleEntities[index]) {
|
||||
gRoomVars.puzzleEntities[index] = NULL;
|
||||
break;
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ void Rupee_Action_1(Entity* this) {
|
||||
if (this->child->next == NULL) {
|
||||
this->action = 2;
|
||||
} else {
|
||||
if (sub_080044EC(this, 10240) == 0) {
|
||||
if (BounceUpdate(this, Q_8_8(40.0)) == BOUNCE_DONE_ALL) {
|
||||
this->action = 2;
|
||||
}
|
||||
ProcessMovement0(this);
|
||||
|
||||
@@ -37,14 +37,14 @@ void SanctuaryStoneTablet_Init(SanctuaryStoneTabletEntity* this) {
|
||||
super->collisionFlags = 7;
|
||||
super->hurtType = 0x48;
|
||||
super->hitType = 1;
|
||||
super->flags2 = 2;
|
||||
super->collisionMask = 2;
|
||||
super->hitbox = (Hitbox*)&gHitbox_0;
|
||||
}
|
||||
|
||||
void SanctuaryStoneTablet_Action1(SanctuaryStoneTabletEntity* this) {
|
||||
Entity* fxEnt;
|
||||
|
||||
if (super->contactFlags == 0xa1) {
|
||||
if (super->contactFlags == (CONTACT_NOW | 0x21)) {
|
||||
fxEnt = CreateFx(super, FX_MAGIC_STORM, 0);
|
||||
if (fxEnt != NULL) {
|
||||
fxEnt->spritePriority.b0 = 3;
|
||||
|
||||
@@ -61,7 +61,7 @@ void SmallIceBlock_Init(SmallIceBlockEntity* this) {
|
||||
super->collisionFlags = 7;
|
||||
super->hurtType = 0x48;
|
||||
super->hitType = 1;
|
||||
super->flags2 = 0x80;
|
||||
super->collisionMask = 0x80;
|
||||
super->hitbox = (Hitbox*)&gUnk_080FD408;
|
||||
sub_08099468(this);
|
||||
InitializeAnimation(super, super->type);
|
||||
@@ -169,7 +169,7 @@ void SmallIceBlock_Action4(SmallIceBlockEntity* this) {
|
||||
x = ((rand >> 0x10) % 9) - 4;
|
||||
y = rand & 0xf;
|
||||
obj->spritePriority.b0 = 3;
|
||||
PositionRelative(super, obj, x * 0x10000, -y * 0x10000);
|
||||
PositionRelative(super, obj, Q_16_16(x), Q_16_16(-y));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -282,7 +282,7 @@ bool32 sub_0809963C(SmallIceBlockEntity* this) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (super->contactFlags == 0x87) {
|
||||
if (super->contactFlags == (CONTACT_NOW | 0x7)) {
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
@@ -37,7 +37,7 @@ void SmokeParticle_Init(Entity* this) {
|
||||
this->hitType = 0xa9;
|
||||
this->hurtType = 0x16;
|
||||
this->hitbox = (Hitbox*)gUnk_08120A54[0];
|
||||
this->flags2 = 0x8b;
|
||||
this->collisionMask = 0x8b;
|
||||
sub_080878CC(this);
|
||||
InitializeAnimation(this, 1);
|
||||
sub_0801766C(this);
|
||||
@@ -75,14 +75,14 @@ void sub_080878CC(Entity* this) {
|
||||
switch (GetMetaTileType(metaTilePos, layer)) {
|
||||
case 0x368:
|
||||
case 0x367:
|
||||
sub_08008796(this, 3, x + itX, y + itY);
|
||||
DoTileInteraction(this, 3, x + itX, y + itY);
|
||||
break;
|
||||
default:
|
||||
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos, layer);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
sub_08008796(this, 3, x + itX, y + itY);
|
||||
DoTileInteraction(this, 3, x + itX, y + itY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void TreeThorns(Entity* this) {
|
||||
this->collisionFlags = 7;
|
||||
this->hurtType = 0x48;
|
||||
this->hitType = 0x7a;
|
||||
this->flags2 = 1;
|
||||
this->collisionMask = 1;
|
||||
this->hitbox = (Hitbox*)&gHitbox_1;
|
||||
tilePos = COORD_TO_TILE(this);
|
||||
SetMetaTile(SPECIAL_META_TILE_102, tilePos - 1, *layer);
|
||||
|
||||
@@ -37,7 +37,7 @@ void UnusedSkull_Init(UnusedSkullEntity* this) {
|
||||
super->collisionFlags = 7;
|
||||
super->hitType = 1;
|
||||
super->hurtType = 0x47;
|
||||
super->flags2 = 2;
|
||||
super->collisionMask = 2;
|
||||
super->hitbox = (Hitbox*)&gHitbox_4;
|
||||
SetMetaTile(SPECIAL_META_TILE_80, COORD_TO_TILE(super), super->collisionLayer);
|
||||
if (super->type == 1 || CheckFlags(this->unk_86)) {
|
||||
@@ -50,7 +50,7 @@ void UnusedSkull_Init(UnusedSkullEntity* this) {
|
||||
}
|
||||
|
||||
void UnusedSkull_Action1(UnusedSkullEntity* this) {
|
||||
if (super->contactFlags == 0x9c) {
|
||||
if (super->contactFlags == (CONTACT_NOW | 0x1c)) {
|
||||
super->action = 2;
|
||||
super->flags &= ~0x80;
|
||||
CreateFx(super, FX_ICE, 0);
|
||||
|
||||
@@ -33,7 +33,7 @@ void Whirlwind_Init(Entity* this) {
|
||||
this->hitType = 1;
|
||||
this->collisionFlags = 0x47;
|
||||
this->hurtType = 0x44;
|
||||
this->flags2 = 0x80;
|
||||
this->collisionMask = 0x80;
|
||||
this->spriteOrientation.flipY = 1;
|
||||
this->spriteRendering.b3 = 1;
|
||||
this->animationState = this->type;
|
||||
@@ -58,7 +58,7 @@ void Whirlwind_Action1(Entity* this) {
|
||||
}
|
||||
if (this->spriteSettings.draw != 0) {
|
||||
GetNextFrame(this);
|
||||
if ((((((gPlayerState.flags & PL_MINISH) == 0)) && (gPlayerState.field_0x3c == 0)) &&
|
||||
if ((((((gPlayerState.flags & PL_MINISH) == 0)) && (gPlayerState.killed == 0)) &&
|
||||
((gPlayerEntity.base.action == PLAYER_JUMP || ((gPlayerEntity.base.flags & ENT_COLLIDE) != 0)))) &&
|
||||
((gPlayerEntity.base.action != PLAYER_BOUNCE &&
|
||||
(sub_0800419C(this, &gPlayerEntity.base, 0xc, 0xc) != 0)))) {
|
||||
|
||||
Reference in New Issue
Block a user