From 2cd62531cc512bf33e1d7957d443ccc90141226d Mon Sep 17 00:00:00 2001 From: Elliptic Ellipsis Date: Sat, 26 Mar 2022 00:29:39 +0000 Subject: [PATCH] Some more actionDelays --- src/enemy/lakitu.c | 26 +++++++++--------- src/enemy/leever.c | 2 +- src/enemy/likeLike.c | 8 +++--- src/enemy/madderpillar.c | 6 ++-- src/enemy/mazaalBracelet.c | 36 ++++++++++++------------ src/enemy/mazaalHead.c | 12 ++++---- src/enemy/moldworm.c | 4 +-- src/enemy/mulldozer.c | 23 ++++++++-------- src/enemy/octorokGolden.c | 2 +- src/enemy/peahat.c | 44 ++++++++++++++---------------- src/enemy/pesto.c | 42 ++++++++++++++-------------- src/enemy/rope.c | 8 +++--- src/enemy/ropeGolden.c | 10 +++---- src/enemy/rupeeLike.c | 4 +-- src/enemy/scissorsBeetle.c | 4 +-- src/enemy/slime.c | 4 +-- src/enemy/sluggula.c | 4 +-- src/manager/armosInteriorManager.c | 4 +-- 18 files changed, 120 insertions(+), 123 deletions(-) diff --git a/src/enemy/lakitu.c b/src/enemy/lakitu.c index 7b1cfda5..e27643cd 100644 --- a/src/enemy/lakitu.c +++ b/src/enemy/lakitu.c @@ -145,7 +145,7 @@ void Lakitu_Hide(Entity* this) { sub_0803CA84(this, 0); if (sub_0803CA4C(this)) { - this->action = 2; + this->action = END_HIDE; this->spriteSettings.draw = 1; } } @@ -155,7 +155,7 @@ void Lakitu_EndHide(Entity* this) { if (this->frame & ANIM_DONE) { this->action = IDLE; - this->timer = 0x3c; + this->timer = 60; this->hitType = 0x42; @@ -182,7 +182,7 @@ void Lakitu_BeginHide(Entity* this) { UpdateAnimationSingleFrame(this); if (this->frame & ANIM_DONE) { - this->action = 1; + this->action = HIDDEN; this->spriteSettings.draw = 0; InitAnimationForceUpdate(this, this->animationState); @@ -202,11 +202,11 @@ void Lakitu_Lightning(Entity* this) { this->hitType = 0x42; if ((Random() & 1) && !this->field_0x78.HALF.HI) { - this->timer = 0xf; + this->timer = 15; this->field_0x78.HALF.HI = TRUE; } else { - this->timer = 0x1e; + this->timer = 30; this->field_0x78.HALF.HI = FALSE; @@ -225,7 +225,7 @@ void Lakitu_LightningDelay(Entity* this) { sub_0803CB34(this); } else { this->action = IDLE; - this->timer = 0xb4; + this->timer = 180; InitAnimationForceUpdate(this, this->animationState + 4); } @@ -245,11 +245,11 @@ void Lakitu_Cloudless(Entity* this) { bool32 sub_0803CA4C(Entity* this) { if (EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x28) == 0) { if (EntityInRectRadius(this, &gPlayerEntity, 0x70, 0x50)) { - return 1; + return TRUE; } } - return 0; + return FALSE; } void sub_0803CA84(Entity* this, u32 unkParameter) { @@ -268,7 +268,7 @@ void sub_0803CA84(Entity* this, u32 unkParameter) { } void sub_0803CAD0(Entity* this) { - if (EntityWithinDistance(this, this->field_0x74.HWORD, this->field_0x76.HWORD, 1) == 0) { + if (!EntityWithinDistance(this, this->field_0x74.HWORD, this->field_0x76.HWORD, 1)) { this->direction = CalculateDirectionTo(this->x.HALF.HI, this->y.HALF.HI, this->field_0x74.HWORD, this->field_0x76.HWORD); @@ -277,21 +277,21 @@ void sub_0803CAD0(Entity* this) { } bool32 sub_0803CB04(Entity* this) { - bool32 returnValue; + bool32 ret; u8 delay; delay = --this->timer; if (delay != 0) { - returnValue = 0; + ret = FALSE; } else { sub_0803CB34(this); this->field_0x78.HALF.HI = delay; InitAnimationForceUpdate(this->child, this->animationState + 4); - returnValue = 1; + ret = TRUE; } - return returnValue; + return ret; } void sub_0803CB34(Entity* this) { diff --git a/src/enemy/leever.c b/src/enemy/leever.c index fd041835..87f8dc9a 100644 --- a/src/enemy/leever.c +++ b/src/enemy/leever.c @@ -115,7 +115,7 @@ void Leever_DigDown(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 1; - this->timer = 0xf0; + this->timer = 240; this->spriteSettings.draw = FALSE; } } diff --git a/src/enemy/likeLike.c b/src/enemy/likeLike.c index 1ddbaeb5..5946c606 100644 --- a/src/enemy/likeLike.c +++ b/src/enemy/likeLike.c @@ -40,9 +40,9 @@ void LikeLike_OnCollision(Entity* this) { sub_0802810C(this); } else if (this->contactFlags & 0x80) { u8 tmp = this->contactFlags & ~0x80; - if (!tmp) { + if (tmp == 0) { this->action = 7; - this->timer = 0x5f; + this->timer = 95; this->subtimer = tmp; this->flags2 &= 0xfc; this->field_0x82.HALF.HI = gPlayerEntity.spritePriority.b1; @@ -51,7 +51,7 @@ void LikeLike_OnCollision(Entity* this) { } if (this->health == 0) { - this->timer = 0x20; + this->timer = 32; } if (this->confusedTime) { @@ -221,7 +221,7 @@ NONMATCH("asm/non_matching/likeLike/sub_0802810C.inc", void sub_0802810C(Entity* gPlayerEntity.z.HALF.HI = gPlayerEntity.spriteOffsetY; gPlayerEntity.spriteOffsetY = 0; this->action = 4; - this->timer = 0x50; + this->timer = 80; this->subtimer = 0; this->flags2 |= 2; if (this->iframes == 0) { diff --git a/src/enemy/madderpillar.c b/src/enemy/madderpillar.c index 65da7b2a..c10c9a1b 100644 --- a/src/enemy/madderpillar.c +++ b/src/enemy/madderpillar.c @@ -265,11 +265,11 @@ void sub_08029CF0(Entity* this) { void sub_08029D08(Entity* this) { this->action = 3; - this->timer = 0x47; + this->timer = 71; } void sub_08029D14(Entity* this) { - if (this->timer) { + if (this->timer != 0) { if (--this->timer == 0) { InitializeAnimation(this, this->animationState + 0xc); ChangeObjPalette(this, 0x7f); @@ -279,7 +279,7 @@ void sub_08029D14(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 4; - this->timer = 0x78; + this->timer = 120; this->hitType = 0x6c; this->hitbox = (Hitbox*)&gUnk_080FD298; EnqueueSFX(SFX_6B); diff --git a/src/enemy/mazaalBracelet.c b/src/enemy/mazaalBracelet.c index 04b242c3..72fe64b1 100644 --- a/src/enemy/mazaalBracelet.c +++ b/src/enemy/mazaalBracelet.c @@ -250,7 +250,7 @@ void sub_0803A364(Entity* this) { this->type2 = 0; uVar1 = 6; this->subAction = uVar1; - this->timer = 0x1e; + this->timer = 30; break; case 6: this->timer--; @@ -275,7 +275,7 @@ void sub_0803A364(Entity* this) { } uVar1 = 9; this->subAction = uVar1; - this->timer = 0x1e; + this->timer = 30; break; case 9: this->timer--; @@ -300,7 +300,7 @@ void sub_0803A364(Entity* this) { if (this->type2 != 0) { uVar1 = 0xc; this->subAction = uVar1; - this->timer = 0x1e; + this->timer = 30; } else { this->type2 = 1; this->subAction = 6; @@ -508,7 +508,7 @@ void sub_0803A8B8(Entity* this) { u32 index; this->action = 0x10; - this->timer = 0x1e; + this->timer = 30; this->direction = 0; this->speed = 0x80; @@ -621,7 +621,7 @@ void sub_0803AB10(Entity* this) { sub_0803B55C(this); if ((this->child->frame & ANIM_DONE) != 0) { this->action = 0x15; - this->timer = 0xf; + this->timer = 15; } } @@ -684,12 +684,12 @@ void sub_0803AC60(Entity* this) { if (sub_0803B4E4(this) != 0) { this->action = 0x19; this->subAction = 0; - this->timer = 0x1e; + this->timer = 30; } else { LinearMoveUpdate(this); } } else { - this->timer = this->timer - 1; + this->timer--; } sub_0803B824(this); } @@ -712,7 +712,7 @@ void sub_0803ACC0(Entity* this) { uVar2 = this->z.HALF.HI += 4; if (-1 < (uVar2 * 0x10000)) { this->z.HALF.HI = 0; - this->timer = 0xc; + this->timer = 12; this->subAction = 3; InitScreenShake(8, 0); SoundReq(SFX_158); @@ -735,8 +735,8 @@ void sub_0803ACC0(Entity* this) { if (-1 < (uVar2 * 0x10000)) { this->z.HALF.HI = 0; this->action = 0x1a; - this->timer = 0x3c; - InitScreenShake(0x1e, 0); + this->timer = 60; + InitScreenShake(30, 0); SoundReq(SFX_158); sub_0803B804(this); return; @@ -770,7 +770,7 @@ void sub_0803ADF4(Entity* this) { GetNextFrame(this); if ((this->frame & ANIM_DONE) != 0) { this->action = 0x1c; - this->timer = 0x1e; + this->timer = 30; this->spriteSettings.draw = 0; } } @@ -829,7 +829,7 @@ void sub_0803AF7C(Entity* this) { sub_0803B55C(this); if ((this->child->frame & ANIM_DONE) != 0) { this->action = 0x21; - this->timer = 0xf; + this->timer = 15; } } @@ -857,7 +857,7 @@ void sub_0803AFE0(Entity* this) { this->z.HALF.HI += 4; } else { this->action = 0x24; - this->timer = 0xf0; + this->timer = 240; *(u8*)&this->cutsceneBeh = 3; this->z.HALF.HI = 0; InitScreenShake(0xa0, 0); @@ -869,7 +869,7 @@ void sub_0803B01C(Entity* this) { if (--this->timer == 0) { this->action = 0x25; } else { - if ((0x46 < this->timer) && ((this->timer & 0xf) == 0)) { + if ((this->timer > 70) && ((this->timer & 0xF) == 0)) { sub_0803B724(this); } } @@ -978,7 +978,7 @@ void sub_0803B1B8(Entity* this) { temp->field_0x80.HALF.LO |= (this->type == 0) ? 4 : 8; if ((temp->field_0x80.HALF.LO & 0xc) == 0xc) { temp->action = 0xb; - temp->timer = 0x78; + temp->timer = 120; temp->zVelocity = 0; (*(Entity**)&temp->field_0x74)->field_0x7c.HALF_U.HI = 0x708; (*(Entity**)&temp->field_0x78)->field_0x7c.HALF_U.HI = 0x708; @@ -1021,7 +1021,7 @@ void sub_0803B338(Entity* this) { this->z.HALF.HI--; } else { this->action = 0x2f; - this->timer = 0xf; + this->timer = 15; } } @@ -1172,7 +1172,7 @@ void sub_0803B63C(Entity* this) { x = gPlayerEntity.x.HALF.HI; x += gUnk_080CFD19[this->type]; y = gPlayerEntity.y.HALF.HI - 0xc; - if (this->timer++ >= 0xb5) { + if (this->timer++ > 180) { this->direction = CalculateDirectionTo(this->x.HALF.HI, this->y.HALF.HI, x, y); } else { sub_08004596(this, CalculateDirectionTo(this->x.HALF.HI, this->y.HALF.HI, x, y)); @@ -1257,7 +1257,7 @@ u32 sub_0803B870(Entity* this) { entity = this->child; if ((entity->contactFlags & 0x80) != 0 && (gPlayerState.flags & PL_CAPTURED)) { this->action = 0x18; - this->timer = 0x44; + this->timer = 68; this->spriteSettings.draw = 0; gPlayerEntity.flags &= ~ENT_COLLIDE; gPlayerEntity.iframes = -0x10; diff --git a/src/enemy/mazaalHead.c b/src/enemy/mazaalHead.c index 374b3b53..0f5d1c47 100644 --- a/src/enemy/mazaalHead.c +++ b/src/enemy/mazaalHead.c @@ -143,7 +143,7 @@ void sub_08033F3C(Entity* this) { if (gRoomTransition.field_0x39 == 0) { this->action = 0xd; this->subAction = 0; - this->timer = 0xfc; + this->timer = 252; COLLISION_OFF(this); } else { pEVar2 = CreateEnemy(MAZAAL_BRACELET, 0); @@ -170,7 +170,7 @@ void sub_08033FFC(Entity* this) { break; case 1: this->subAction = 2; - this->timer = 0x1e; + this->timer = 30; entity = *(Entity**)&(*(Entity**)&this->field_0x74)->field_0x74; entity->subAction = 1; entity = *(Entity**)&(*(Entity**)&this->field_0x78)->field_0x74; @@ -206,7 +206,7 @@ void sub_08033FFC(Entity* this) { case 7: temp = ++this->timer >> 1; gScreen.controls.alphaBlend = (temp) | (0x10 - (temp)) * 0x100; - if (0x1f < (this->timer & 0xff)) { + if (this->timer > 31) { this->subAction = 8; entity = *(Entity**)&this->field_0x74; entity->subAction = 3; @@ -354,7 +354,7 @@ void sub_0803438C(Entity* this) { this->health = 0; } else { this->timer--; - if (this->timer > 0xc0) { + if (this->timer > 192) { this->spriteOffsetX = gUnk_080CED06[this->timer & 3]; } else { if ((this->timer & 0x1f) == 0) { @@ -747,7 +747,7 @@ void sub_08034AC4(Entity* this) { void sub_08034AEC(Entity* this) { this->action = 1; - this->timer = 0x1e; + this->timer = 30; InitializeAnimation(this, this->type + 1); SoundReq(SFX_151); } @@ -761,7 +761,7 @@ void sub_08034B0C(Entity* this) { return; } this->action = 2; - this->timer = 0x50; + this->timer = 80; } } diff --git a/src/enemy/moldworm.c b/src/enemy/moldworm.c index d9d9c6ae..b4a8fccf 100644 --- a/src/enemy/moldworm.c +++ b/src/enemy/moldworm.c @@ -137,7 +137,7 @@ void sub_080231BC(Entity* this) { ent->child = NULL; sub_0804A720(this); this->action = 6; - this->timer = 0x1e; + this->timer = 30; this->parent = this; this->field_0x78.HWORD = 0x1e; this->palette.b.b0 = 5; @@ -172,7 +172,7 @@ void sub_08023330(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 4; - this->timer = 0x19; + this->timer = 25; COLLISION_ON(this); this->field_0x78.HWORD = 600; this->direction = Random() & 0x1c; diff --git a/src/enemy/mulldozer.c b/src/enemy/mulldozer.c index 89e0a002..ff883619 100644 --- a/src/enemy/mulldozer.c +++ b/src/enemy/mulldozer.c @@ -63,11 +63,11 @@ void sub_08032CAC(MulldozerEntity* this) { case 2: case 3: super->action = 6; - super->timer = (super->type != 0) ? 0x5a : 200; + super->timer = (super->type != 0) ? 90 : 200; super->subtimer = 2; this->unk_80 = 3; super->direction = super->knockbackDirection; - super->direction += ((Random() & 0x40) != 0) ? 4 : 0x1c; + super->direction += ((Random() & 0x40) != 0) ? 4 : 0x1C; super->direction &= 0x1f; super->speed = 0; break; @@ -211,7 +211,7 @@ void sub_08032F64(MulldozerEntity* this) { void sub_08032F90(MulldozerEntity* this) { if (super->type == 0) { - if (super->timer == 0x10) { + if (super->timer == 16) { this->unk_80 = 2; } if (--super->subtimer == 0) { @@ -284,14 +284,14 @@ void sub_08033100(MulldozerEntity* this) { super->action = 3; if (super->type == 0) { this->unk_80 = 1; - super->timer = 0x30; + super->timer = 48; super->subtimer = 8; super->speed = 0; super->direction = (sub_08049F84(super, 1) + 2) & 0x1c; } else { this->unk_80 = 2; sub_080331B4(this); - super->timer += 0x10; + super->timer += 16; super->subtimer = 4; super->speed = 0x160; } @@ -307,9 +307,9 @@ void sub_08033174(MulldozerEntity* this) { this->unk_82 = 0; this->unk_83 = 0; if (super->type == 0) { - super->timer = (Random() & 0x18) + 0x18; + super->timer = (Random() & 0x18) + 24; } else { - super->timer = 0xc; + super->timer = 12; } super->speed = 0xa0; sub_08032F24(this); @@ -317,15 +317,16 @@ void sub_08033174(MulldozerEntity* this) { void sub_080331B4(MulldozerEntity* this) { u32 rand = Random() & 0xf0; - u8 timer = 0x1e; + u8 timer = 30; + if ((rand & 0x80) != 0) { - timer = 0x3c; + timer = 60; } else { if ((rand & 0x40) != 0) { - timer = 0x2d; + timer = 45; } if ((rand & 0x20) != 0) { - timer = 0x4b; + timer = 75; } } super->timer = timer; diff --git a/src/enemy/octorokGolden.c b/src/enemy/octorokGolden.c index e2f7e6cd..bf810cda 100644 --- a/src/enemy/octorokGolden.c +++ b/src/enemy/octorokGolden.c @@ -108,7 +108,7 @@ void sub_08037E14(Entity* this) { u8* layer; const s8* ptr; s32 x, y; - this->timer = 0x8; + this->timer = 8; dir = (GetFacingDirection(this, &gPlayerEntity) + 4) & 0x18; layer = (u8*)GetLayerByIndex(this->collisionLayer)->collisionData; ptr = gUnk_080CF498 + (dir >> 2); diff --git a/src/enemy/peahat.c b/src/enemy/peahat.c index d99cd598..7b5ead2a 100644 --- a/src/enemy/peahat.c +++ b/src/enemy/peahat.c @@ -196,7 +196,7 @@ void Peahat_ChargeTarget(Entity* this) { if (--this->timer == 0) { sub_080205F8(this); } - if (60 < this->timer) { + if (this->timer > 60) { if (this->timer & 1) this->speed += 4; @@ -255,33 +255,31 @@ void Peahat_Stunned(Entity* this) { } void Peahat_RepairPropeller(Entity* this) { - if (this->subtimer) - if (--this->subtimer == 0) - Create0x68FX(this, FX_STARS); + if ((this->subtimer != 0) && (--this->subtimer == 0)) { + Create0x68FX(this, FX_STARS); + } - if (!sub_0800442E(this) && --this->timer) - return; - - this->action = 9; - this->zVelocity = Q_16_16(1.5); - this->direction = Random() & 0x1f; - sub_0804AA1C(this); - this->animationState = PeahatAnimation_RepairPropeller; - InitializeAnimation(this, this->animationState); + if (sub_0800442E(this) || (--this->timer == 0)) { + this->action = 9; + this->zVelocity = Q_16_16(1.5); + this->direction = Random() & 0x1f; + sub_0804AA1C(this); + this->animationState = PeahatAnimation_RepairPropeller; + InitializeAnimation(this, this->animationState); + } } void Peahat_Recover(Entity* this) { - if (this->subtimer) - if (--this->subtimer == 0) - Create0x68FX(this, FX_STARS); + if ((this->subtimer != 0) && (--this->subtimer == 0)) { + Create0x68FX(this, FX_STARS); + } - if (!sub_0800442E(this) && --this->timer) - return; - - this->action = 8; - this->timer = 240; - this->direction = Random() & 0x1f; - sub_0804AA1C(this); + if (sub_0800442E(this) || (--this->timer == 0)) { + this->action = 8; + this->timer = 240; + this->direction = Random() & 0x1f; + sub_0804AA1C(this); + } } void Peahat_Hop(Entity* this) { diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c index 05920fac..cd90c578 100644 --- a/src/enemy/pesto.c +++ b/src/enemy/pesto.c @@ -236,7 +236,7 @@ void sub_080242A0(Entity* this) { if (sub_08049F1C(this, gUnk_020000B0, 0x20) && sub_08049FDC(this, 3)) { this->action = 4; this->field_0x80.HALF.LO = 0; - this->timer = 0x10; + this->timer = 16; this->speed = 0; } } @@ -258,7 +258,7 @@ void sub_0802433C(Entity* this) { this->action = 5; this->field_0x80.HALF.LO = 0; this->speed = 0x140; - this->timer = 0xc0; + this->timer = 192; this->subtimer = 8; } else { if (--this->subtimer == 0) @@ -275,16 +275,16 @@ void sub_080243B8(Entity* this) { if (sub_08024C48(this, TRUE)) { if (this->child == NULL || this->child->next == NULL) { this->field_0x80.HALF.LO = 2; - this->timer = 0x20; + this->timer = 32; this->speed = 0x80; this->field_0x82.HALF.HI = 0x80; } else if (sub_08049F1C(this, gUnk_020000B0, 0xe)) { this->field_0x80.HALF.LO++; - this->timer = 0x1e; + this->timer = 30; this->speed = 0x100; this->field_0x82.HALF.HI = 0x80; this->child->action = 2; - } else if (--this->timer) { + } else if (--this->timer != 0) { if (--this->subtimer == 0) { sub_08024A14(this, 2, (this->timer >> 6) + 1); } @@ -298,7 +298,7 @@ void sub_080243B8(Entity* this) { case 1: if (--this->timer == 0) { this->field_0x80.HALF.LO++; - this->timer = 0x20; + this->timer = 32; this->speed = 0x80; } break; @@ -315,15 +315,15 @@ void sub_080243B8(Entity* this) { this->timer = 4; break; case 1: - this->timer = 0x14; + this->timer = 20; break; default: - this->timer = 0x30; + this->timer = 48; break; } sub_08024A14(this, 2, 8); } else { - this->timer = 0x40; + this->timer = 64; sub_08024A14(this, 0, 8); } } @@ -342,7 +342,7 @@ void sub_080244E8(Entity* this) { this->subtimer = 0; this->speed = 0; } else { - this->timer = 0x30; + this->timer = 48; this->subtimer = 4; } break; @@ -386,7 +386,7 @@ void sub_080244E8(Entity* this) { tmp = this->field_0x82.HALF.HI & 0x80; if (tmp == 0) { this->field_0x80.HALF.LO++; - this->timer = 0xc; + this->timer = 12; this->direction = 0x10; this->speed = tmp; this->cutsceneBeh.HALF.LO = 0; @@ -405,8 +405,8 @@ void sub_080244E8(Entity* this) { if (EntityInRectRadius(this, this->child, 6, 6)) { Entity* ent; - this->field_0x80.HALF.LO += 1; - this->timer = 0xc; + this->field_0x80.HALF.LO++; + this->timer = 12; this->field_0x82.HALF.HI &= ~0x80; CopyPosition(this->child, this); this->z.HALF.HI -= 0xe; @@ -427,7 +427,7 @@ void sub_080244E8(Entity* this) { Entity* ent; this->field_0x80.HALF.LO += 1; - this->timer = 0xc; + this->timer = 12; this->field_0x82.HALF.HI &= ~0x80; ent = this->child; SetTile((u16)ent->field_0x70.HALF.LO, COORD_TO_TILE(ent), ent->collisionLayer); @@ -481,7 +481,7 @@ void sub_080244E8(Entity* this) { break; case 1 ... 2: this->field_0x80.HALF.LO += 1; - this->timer = 0xc0; + this->timer = 192; this->subtimer = 8; this->speed = 0x80; sub_080249DC(this); @@ -498,11 +498,11 @@ void sub_080244E8(Entity* this) { this->field_0x82.HALF.HI = 0xc0; this->field_0x80.HALF.LO = 0; this->speed = 0x40; - this->timer = 0x40; + this->timer = 64; this->subtimer = 8; sub_08024A14(this, 0, 8); } else { - this->timer = 0x40; + this->timer = 64; this->subtimer = 8; } } else if (--this->subtimer == 0) { @@ -709,7 +709,7 @@ void sub_08024C7C(Entity* this) { void sub_08024C94(Entity* this) { this->action = 2; this->field_0x80.HALF.LO = 0; - this->timer = 0x40; + this->timer = 64; this->subtimer = 0; this->speed = 0xc0; this->field_0x82.HALF.HI = 0x80; @@ -745,7 +745,7 @@ void sub_08024D00(Entity* this) { case 0: if (--this->timer == 0) { this->field_0x80.HALF.LO++; - this->timer = (Random() & 0xf) + 0x20; + this->timer = (Random() & 0xf) + 32; this->direction += this->field_0x80.HALF.HI ? 4 : 0x1c; this->direction &= 0x1f; @@ -757,7 +757,7 @@ void sub_08024D00(Entity* this) { case 1: if (--this->timer == 0) { this->field_0x80.HALF.LO = 0; - this->timer = (Random() & 0x1f) + 0x20; + this->timer = (Random() & 0x1f) + 32; } else { if (--this->subtimer == 0) { this->direction += this->field_0x80.HALF.HI ? 1 : 0x1f; @@ -800,7 +800,7 @@ void sub_08024E4C(Entity* this) { sub_08024F50(this); this->field_0x80.HALF.LO = 0; this->speed = 0x40; - this->timer = 0x40; + this->timer = 64; this->subtimer = 8; sub_08024A14(this, 0, 8); } else { diff --git a/src/enemy/rope.c b/src/enemy/rope.c index 88a6e1db..1f618453 100644 --- a/src/enemy/rope.c +++ b/src/enemy/rope.c @@ -137,7 +137,7 @@ void sub_080314FC(Entity* this) { u = sub_0804A044(this, gUnk_020000B0, 0xc); if (u != 0xff) { this->action = 3; - this->timer = 0x1e; + this->timer = 30; this->field_0x7a.HWORD = this->speed = 0x1a0; this->direction = u; this->animationState = this->direction >> 3; @@ -156,7 +156,7 @@ void sub_080314FC(Entity* this) { } } } - if (!(--this->timer)) { + if (--this->timer == 0) { sub_08031600(this); } sub_0803163C(this); @@ -164,7 +164,7 @@ void sub_080314FC(Entity* this) { } void sub_080315BC(Entity* this) { - if (this->timer) { + if (this->timer != 0) { this->timer--; UpdateAnimationVariableFrames(this, 2); } else { @@ -182,7 +182,7 @@ void sub_080315BC(Entity* this) { void sub_08031600(Entity* this) { u32 r; this->action = 2; - this->timer = (Random() & 0x30) + 0x3c; + this->timer = (Random() & 0x30) + 60; this->speed = 0x80; this->field_0x7a.HWORD = 0x80; r = Random() & 0x18; diff --git a/src/enemy/ropeGolden.c b/src/enemy/ropeGolden.c index e79f3ecc..025eaae1 100644 --- a/src/enemy/ropeGolden.c +++ b/src/enemy/ropeGolden.c @@ -81,17 +81,17 @@ void sub_0803827C(Entity* this) { } } UpdateAnimationVariableFrames(this, 0x2); - if (ProcessMovement0(this) == 0) { + if (!ProcessMovement0(this)) { sub_080383AC(this); } else { - if (!(--this->timer)) { + if (--this->timer == 0) { sub_080383AC(this); } } } void sub_080382EC(Entity* this) { - if (!(--this->timer)) { + if (--this->timer == 0) { this->action = 3; } } @@ -101,7 +101,7 @@ ASM_FUNC("asm/non_matching/ropeGolden/sub_08038304.inc", void sub_08038304(Entit void sub_080383AC(Entity* this) { u32 v; this->action = 1; - this->timer = 0x8; + this->timer = 8; this->speed = 0x100; this->direction = DirectionRoundUp(GetFacingDirection(this, &gPlayerEntity)); v = this->direction >> 3; @@ -114,7 +114,7 @@ void sub_080383AC(Entity* this) { void sub_080383E4(Entity* this) { u32 v; this->action = 2; - this->timer = 0x8; + this->timer = 8; this->speed = 0x280; v = DirectionRoundUp(GetFacingDirection(this, &gPlayerEntity)); this->direction = v; diff --git a/src/enemy/rupeeLike.c b/src/enemy/rupeeLike.c index 3209e1c4..ab1d8442 100644 --- a/src/enemy/rupeeLike.c +++ b/src/enemy/rupeeLike.c @@ -64,7 +64,7 @@ void RupeeLike_OnCollision(Entity* this) { InitializeAnimation(this->child, 4); } this->action = 4; - this->timer = 0x3c; + this->timer = 60; this->subtimer = 0; this->field_0x82.HALF.HI = 0x41; this->flags2 &= 0xfc; @@ -274,7 +274,7 @@ void sub_08029770(Entity* this) { void sub_080297F0(Entity* this) { u32 temp; this->action = 1; - this->timer = 0x78; + this->timer = 120; COLLISION_ON(this); this->spriteSettings.draw = TRUE; this->hitType = 0x8e; diff --git a/src/enemy/scissorsBeetle.c b/src/enemy/scissorsBeetle.c index 34ebb195..d70a1277 100644 --- a/src/enemy/scissorsBeetle.c +++ b/src/enemy/scissorsBeetle.c @@ -93,7 +93,7 @@ void sub_080389E8(ScissorsBeetleEntity* this) { } else if (super->timer) { super->timer--; } else if (super->collisions != COL_NONE) { - super->timer = 0xc; + super->timer = 12; if ((child->animationState & 1) == 0) { child->animationState += Random() & 0x20 ? 1 : 7; child->animationState &= 7; @@ -145,7 +145,7 @@ void sub_08038B08(ScissorsBeetleEntity* this) { if (super->frame & ANIM_DONE) { super->action = 4; this->unk_82 = 3; - super->timer = 0x32; + super->timer = 50; super->subtimer = 2; super->direction = ((super->animationState << 2) + 0x10) & 0x1f; super->speed = 0x80; diff --git a/src/enemy/slime.c b/src/enemy/slime.c index 506820cc..494d0459 100644 --- a/src/enemy/slime.c +++ b/src/enemy/slime.c @@ -66,7 +66,7 @@ void sub_08044FC8(Entity* this) { void sub_08044FF8(Entity* this) { this->action = 2; - this->timer = (Random() & 31) + 30; + this->timer = (Random() & 0x1F) + 30; this->cutsceneBeh.HALF.LO = this->health; } @@ -76,7 +76,7 @@ void sub_08045018(Entity* this) { this->action = 3; this->timer = 1; if (0 < this->speed) { - this->timer = FixedDiv(4096, this->speed) >> 8; + this->timer = FixedDiv(0x1000, this->speed) >> 8; } if (sub_08049FA0(this) == 0 && (Random() & 3)) { this->direction = (sub_08049EE4(this) + 0xfc + (Random() & 8)) & 24; diff --git a/src/enemy/sluggula.c b/src/enemy/sluggula.c index 84adb554..a5bf26bb 100644 --- a/src/enemy/sluggula.c +++ b/src/enemy/sluggula.c @@ -63,7 +63,7 @@ void Sluggula_OnGrabbed(Entity* this) { void sub_08023C5C(Entity* this) { sub_0804A720(this); this->action = 1; - this->timer = (Random() & 0x30) + 0xb4; + this->timer = (Random() & 0x30) + 180; this->direction = DirectionRound(Random()); this->animationState = this->direction >> 3; InitializeAnimation(this, this->animationState); @@ -77,7 +77,7 @@ void sub_08023C8C(Entity* this) { if (this->frame != 1) { this->timer = 8; } else { - this->timer = (Random() & 0x30) + 0xb4; + this->timer = (Random() & 0x30) + 180; sub_08023E9C(this); this->animationState = this->direction >> 3; InitializeAnimation(this, this->animationState); diff --git a/src/manager/armosInteriorManager.c b/src/manager/armosInteriorManager.c index e10fa958..98587f46 100644 --- a/src/manager/armosInteriorManager.c +++ b/src/manager/armosInteriorManager.c @@ -53,11 +53,9 @@ void ArmosInteriorManager_Action1(ArmosInteriorManager* this) { void ArmosInteriorManager_Action2(ArmosInteriorManager* this) { static const u8 gUnk_08108D20[] = { 0x6F, 0x70, 0x71, 0x72, 0x71, 0x70 }; - u8 bVar1; - int iVar2; if (--super->timer == 0) { - super->timer = 0x14; + super->timer = 20; if (++super->subtimer > 5) { super->subtimer = 0;