diff --git a/src/beanstalkSubtask.c b/src/beanstalkSubtask.c index b4992d01..f9e54925 100644 --- a/src/beanstalkSubtask.c +++ b/src/beanstalkSubtask.c @@ -578,7 +578,6 @@ void LoadBgAnimations(u16* param_1) { while (param_1[0] != 0xffff) { animation->currentFrame = gUnk_080B7278[param_1[0]]; animation->timer = GetBgAnimationTimer(&animation->currentFrame->unk_4); - ; animation++; param_1++; } diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c index a8d90996..b39be6e5 100644 --- a/src/enemy/acroBandits.c +++ b/src/enemy/acroBandits.c @@ -165,9 +165,10 @@ void AcroBandit_Type0Action0(Entity* this) { void AcroBandit_Type0Action1(Entity* this) { u32 rand; - s32 x, y; + s32 x; + s32 y; - if (this->timer) { + if (this->timer != 0) { this->timer--; } else { if (sub_08049FDC(this, 1)) { @@ -302,12 +303,12 @@ void AcroBandit_Type0Action6(Entity* this) { } void AcroBandit_Type0Action7(Entity* this) { - if ((this->timer & 0xf) == 0) { - if (this->timer == 0x50) { + if ((this->timer & 0xF) == 0) { + if (this->timer == 80) { DeleteEntity(this); } else { this->action = 1; - this->timer = 0xb4; + this->timer = 180; } } } @@ -315,7 +316,7 @@ void AcroBandit_Type0Action7(Entity* this) { void AcroBandit_Type0Action8(Entity* this) { if (this->frame & ANIM_DONE) { this->action = 1; - this->timer = 0xb4; + this->timer = 180; this->spriteSettings.draw = 0; } else { GetNextFrame(this); diff --git a/src/enemy/armos.c b/src/enemy/armos.c index a2be046f..709f0630 100644 --- a/src/enemy/armos.c +++ b/src/enemy/armos.c @@ -199,7 +199,7 @@ void sub_08030338(ArmosEntity* this) { return; } super->action = 6; - super->timer = 0x1a; + super->timer = 26; super->speed = 0x300; super->direction = 0x10; return; @@ -367,7 +367,7 @@ void sub_080306C4(ArmosEntity* this) { if (sub_08049FDC(super, 1) && this->unk_7a != 0) { - super->timer = 0x18; + super->timer = 24; uVar3 = sub_0800132C(super, gUnk_020000B0); if (uVar3 != 0xff) { var = 0; @@ -390,7 +390,7 @@ void sub_080306C4(ArmosEntity* this) { } } else { super->action = 4; - super->timer = 0x78; + super->timer = 120; super->speed = 0xa0; } } diff --git a/src/enemy/ballChainSoldier.c b/src/enemy/ballChainSoldier.c index cd5e1600..d2227940 100644 --- a/src/enemy/ballChainSoldier.c +++ b/src/enemy/ballChainSoldier.c @@ -133,7 +133,7 @@ void sub_0803E6E0(BallChainSoldierEntity* this) { if ((s8)this->unk_7e <= 0) { this->unk_7e = 0; super->action = 6; - super->timer = 0x1e; + super->timer = 30; InitAnimationForceUpdate(super, super->animationState + 0x20); } } @@ -162,7 +162,7 @@ void sub_0803E75C(BallChainSoldierEntity* this) { this->unk_7e += 5; } else { super->action = 8; - super->timer = 0x1e; + super->timer = 30; InitScreenShake(8, 0); } } @@ -178,7 +178,7 @@ void sub_0803E7CC(BallChainSoldierEntity* this) { this->unk_7e -= 2; if (this->unk_7e <= 0xa) { super->action = 0xa; - super->timer = 0x5a; + super->timer = 90; super->direction = DirectionFromAnimationState(super->animationState); this->unk_7c = 0; this->unk_7f = 0xfe; @@ -189,7 +189,7 @@ void sub_0803E7CC(BallChainSoldierEntity* this) { } void sub_0803E818(BallChainSoldierEntity* this) { - if (super->timer) { + if (super->timer != 0) { if (--super->timer == 0) { COLLISION_ON(super->child); sub_0803E94C(this, 0); diff --git a/src/enemy/beetle.c b/src/enemy/beetle.c index ee952124..63ef0959 100644 --- a/src/enemy/beetle.c +++ b/src/enemy/beetle.c @@ -34,7 +34,7 @@ void Beetle_OnCollision(Entity* this) { Beetle_OnTick(this); } else { this->action = 5; - this->timer = 0xb4; + this->timer = 180; this->subtimer = 0; COLLISION_OFF(this); this->spritePriority.b0 = 3; @@ -166,7 +166,7 @@ void sub_08021A64(Entity* this) { if (!sub_08021D00(this)) { if (--this->timer == 0) { this->action = 2; - this->timer = (Random() & 0x1f) + 0x1e; + this->timer = (Random() & 0x1F) + 30; InitializeAnimation(this, 0); } @@ -190,14 +190,14 @@ void sub_08021A64(Entity* this) { void sub_08021AD8(Entity* this) { GetNextFrame(this); if (this->frame & 1) { - if (this->timer) { + if (this->timer != 0) { u32 tmp; this->timer = 0; tmp = sub_08049F84(this, 1); if (tmp == 0xff) { this->action = 2; - this->timer = '\b'; + this->timer = 8; InitializeAnimation(this, 0); return; } @@ -223,7 +223,8 @@ void sub_08021B64(Entity* this) { this->z.WORD = 0; InitializeAnimation(this, 2); } else { - int iVar4 = 1; + s32 iVar4 = 1; + if (gPlayerState.framestate != PL_STATE_JUMP && gPlayerState.framestate != PL_STATE_CAPE) { if (sub_0807953C()) iVar4 = this->type * 3 + 8; diff --git a/src/enemy/bobomb.c b/src/enemy/bobomb.c index 5bc0c6c8..732b07b6 100644 --- a/src/enemy/bobomb.c +++ b/src/enemy/bobomb.c @@ -145,7 +145,7 @@ void Bobomb_OnDeath(Entity* this) { void sub_0802C8D8(Entity* this) { this->action = 1; - this->timer = 0x3c; + this->timer = 60; this->subtimer = 0; this->direction = (Random() & 0x18) | 4; this->carryFlags = 0; @@ -271,7 +271,7 @@ void sub_0802CB68(Entity* this) { this->speed = 0x200; InitializeAnimation(this, (this->direction >> 4) | 2); } else { - this->timer = 0x3c; + this->timer = 60; this->speed = 0x80; InitializeAnimation(this, this->direction >> 4); } diff --git a/src/enemy/bombPeahat.c b/src/enemy/bombPeahat.c index a0febe5c..8583b78d 100644 --- a/src/enemy/bombPeahat.c +++ b/src/enemy/bombPeahat.c @@ -126,11 +126,11 @@ void sub_0802A9A8(Entity* this) { if (this->subtimer) { this->subtimer--; } else { - if (this->timer) { + if (this->timer != 0) { if (--this->timer == 0) { this->action = 2; this->subAction = 0; - this->timer = 0x40; + this->timer = 64; sub_0802ACDC(this, 8); } } else { @@ -147,7 +147,7 @@ void sub_0802A9A8(Entity* this) { this->direction = 0x18; } this->y.HALF.HI = gRoomControls.scroll_y + 0x40; - this->timer = 0x80; + this->timer = 128; sub_0802ADDC(this); } sub_0802AC40(this); @@ -160,7 +160,7 @@ void sub_0802AA40(Entity* this) { sub_0802ACDC(this, 8); this->field_0x7a.HALF.HI++; } - if (this->timer) { + if (this->timer != 0) { this->timer--; } else { Entity* ent = this->child; @@ -178,7 +178,7 @@ void sub_0802AA40(Entity* this) { this->speed = 0x180; this->field_0x7a.HALF.HI = 0; ent->field_0x80.HALF.LO = 1; - ent->timer = 0x96; + ent->timer = 150; } } } @@ -215,7 +215,7 @@ void sub_0802AAC0(Entity* this) { #endif } else { this->action = 4; - this->timer = 0xc0; + this->timer = 192; this->subtimer = 4; this->field_0x80.HALF.LO ^= 1; #ifndef EU @@ -236,8 +236,8 @@ void sub_0802AB40(Entity* this) { this->speed = 0; InitializeAnimation(this, this->type + 1); } else { - this->timer = 0xc0; - this->subtimer = 0x4; + this->timer = 192; + this->subtimer = 4; this->field_0x80.HALF.LO ^= 1; } } else if (--this->subtimer == 0) { @@ -289,7 +289,7 @@ void sub_0802AC08(Entity* this) { if (this->frame & ANIM_DONE) { this->action = 2; this->subAction = 0; - this->timer = 0x40; + this->timer = 64; this->speed = 0xc0; sub_0802ACDC(this, 8); sub_0802ADDC(this); @@ -373,7 +373,7 @@ void sub_0802AD54(Entity* this) { if (this->field_0x80.HALF.HI) { if (this->child == NULL || this->child->next == NULL) { this->action = 4; - this->timer = 0xc0; + this->timer = 192; this->subtimer = 4; this->field_0x80.HALF.LO ^= 1; } @@ -399,7 +399,7 @@ void sub_0802ADDC(Entity* this) { void sub_0802AE24(Entity* this) { this->action = 1; - this->timer = 0xf0; + this->timer = 240; this->zVelocity = Q_16_16(0.5); this->hitbox = (Hitbox*)&gUnk_080CD174; this->collisionFlags = 3; @@ -564,9 +564,9 @@ void sub_0802B048(Entity* this) { action = this->action; if (action != 4 && this->field_0x80.HALF.LO) { - if (this->timer) { + if (this->timer != 0) { if (--this->timer == 0) { - this->subtimer = 0x50; + this->subtimer = 80; this->field_0x82.HWORD = 0; this->spriteRendering.b0 = 3; SetAffineInfo(this, 0x100, 0x100, 0); @@ -580,7 +580,7 @@ void sub_0802B048(Entity* this) { sub_0805EC60(this); this->action = 4; this->hitbox = (Hitbox*)&gUnk_080CD17C; - this->timer = 0xf; + this->timer = 15; this->spriteSettings.draw = 0; COLLISION_ON(this); this->field_0x7a.HALF.HI = 0; @@ -605,7 +605,7 @@ void sub_0802B048(Entity* this) { void sub_0802B1A0(Entity* this) { this->action = 1; this->timer = 0; - this->subtimer = 0x4f; + this->subtimer = 79; this->field_0x80.HALF.HI = 1; InitializeAnimation(this, 0); } @@ -614,7 +614,7 @@ void sub_0802B1A0(Entity* this) { void sub_0802B1BC(Entity* this) { Entity* ent; - if (this->timer) { + if (this->timer != 0) { this->timer--; } @@ -643,7 +643,7 @@ void sub_0802B1BC(Entity* this) { void sub_0802B1BC(Entity* this) { Entity* ent; - if (this->timer) { + if (this->timer != 0) { this->timer--; } diff --git a/src/enemy/bowMoblin.c b/src/enemy/bowMoblin.c index 88017722..831477de 100644 --- a/src/enemy/bowMoblin.c +++ b/src/enemy/bowMoblin.c @@ -32,7 +32,7 @@ void sub_0803C6DC(BowMoblinEntity*); void sub_0803C714(BowMoblinEntity*); void sub_0803C634(BowMoblinEntity*); u32 sub_0803C6F8(BowMoblinEntity*); -u32 sub_0803C568(BowMoblinEntity*); +bool32 sub_0803C568(BowMoblinEntity*); void sub_0803C664(BowMoblinEntity*); void (*const BowMoblin_Functions[])(Entity*); @@ -82,9 +82,9 @@ void sub_0803C1E0(BowMoblinEntity* this) { this->unk_0x7a = 0; this->unk_0x82 = 1; - if (super->timer) { + if (super->timer != 0) { super->animationState = super->type2 << 1; - super->timer = 0x1e; + super->timer = 30; super->speed = 0x80; super->direction = super->type2 << 3; sub_0803C690(this); @@ -111,7 +111,7 @@ void sub_0803C234(BowMoblinEntity* this) { sub_0803C4B0(this); } - } else if (sub_0803C6F8(this)) { + } else if (sub_0803C6F8(this) != 0) { sub_0800417E(super, super->collisions); super->animationState = ((super->direction + 4) & 0x18) >> 2; this->unk_0x83++; @@ -124,7 +124,6 @@ void sub_0803C234(BowMoblinEntity* this) { } void sub_0803C2DC(BowMoblinEntity* this) { - u32 res; u32 timer = --super->timer; if (timer == 0) { super->action = 3; @@ -132,11 +131,11 @@ void sub_0803C2DC(BowMoblinEntity* this) { this->unk_0x80 = timer; super->animationState = 0x10; sub_0803C4B0(this); - } else if (res = sub_0803C568(this), res) { + } else if (sub_0803C568(this)) { this->unk_0x7b |= 0x1; } - if (super->subtimer > 0xb) { + if (super->subtimer > 11) { if (this->unk_0x7b != 0) { sub_0803C5F0(this); } @@ -166,7 +165,7 @@ void sub_0803C344(BowMoblinEntity* this) { super->action = 2; super->speed = 0; tmp = Random() & 0x7; - super->timer = (tmp << 1) + tmp + 0x40; + super->timer = 3 * tmp + 64; break; } case 4: { @@ -180,7 +179,7 @@ void sub_0803C344(BowMoblinEntity* this) { this->unk_0x82 = 1; super->speed = 0x80; tmp = (Random() & 0x7); - super->timer = (tmp << 1) + tmp + 0x22; + super->timer = 3 * tmp + 34; break; } } @@ -213,6 +212,7 @@ void sub_0803C400(BowMoblinEntity* this) { } } else { Entity* projectile; + switch (++super->timer) { case 1: super->direction = super->animationState << 2; @@ -225,7 +225,7 @@ void sub_0803C400(BowMoblinEntity* this) { break; case 24: super->timer = 0; - super->subtimer = 0x20; + super->subtimer = 32; break; } @@ -252,13 +252,13 @@ void sub_0803C4B0(BowMoblinEntity* this) { dir += gUnk_080CFFAC[Random() & 0xf]; } else { dir += gUnk_080CFFAC[Random() & 0x7]; - super->timer += 0x10; + super->timer += 16; this->unk_0x83--; } dir = (super->direction = (dir + 4) & 0x18) >> 2; } } else { - super->timer = 0xc; + super->timer = 12; super->speed = super->subtimer; dir = super->direction >> 2; } @@ -268,13 +268,13 @@ void sub_0803C4B0(BowMoblinEntity* this) { } } -u32 sub_0803C568(BowMoblinEntity* this) { +bool32 sub_0803C568(BowMoblinEntity* this) { if (this->unk_0x81 == 0) { Entity* ent = sub_08049DF4(1); if (ent != NULL) { if (this->unk_0x82 == 2) { if (sub_0806FC80(super, ent, 0x30)) { - return 1; + return TRUE; } } @@ -282,13 +282,13 @@ u32 sub_0803C568(BowMoblinEntity* this) { u32 direction = (GetFacingDirection(super, ent) + 4) & 0x18; direction = direction >> 2; if (direction == super->animationState) { - return 1; + return TRUE; } } } } - return 0; + return FALSE; } void sub_0803C5C4(BowMoblinEntity* this) { @@ -319,13 +319,13 @@ void sub_0803C634(BowMoblinEntity* this) { super->direction = super->animationState << 2; this->unk_0x83 = 0; sub_0803C664(this); - super->timer <<= 1; + super->timer *= 2; this->unk_0x82 = 4; } void sub_0803C664(BowMoblinEntity* this) { super->action = 3; - super->timer = 0x20; + super->timer = 32; super->subtimer = 0; this->unk_0x80 = 0; this->unk_0x7b = 0; @@ -402,7 +402,7 @@ void (*const gUnk_080CFF90[])(BowMoblinEntity*) = { }; const s8 gUnk_080CFFA4[8] = { - 0x18, 0x20, 0x30, 0x40, 0x60, 0x6c, 0x78, 0x91, + 24, 32, 48, 64, 96, 108, 120, 145, }; const s8 gUnk_080CFFAC[16] = { diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c index c11dbce6..9084508b 100644 --- a/src/enemy/businessScrub.c +++ b/src/enemy/businessScrub.c @@ -58,7 +58,7 @@ void BusinessScrub_OnCollision(Entity* this) { if (this->hitType == 1 && (this->contactFlags & 0x7f) == 0x42) { this->action = 3; this->subAction = 0; - this->timer = 0x28; + this->timer = 40; COLLISION_OFF(this); sub_080290E0(this, 4); pEVar1 = CreateFx(this, FX_BUSH, 0); @@ -82,7 +82,7 @@ void sub_08028994(Entity* this) { sub_08028E9C(this); if ((*(u8*)this->field_0x7c.WORD & 1) || CheckFlags(this->field_0x86.HWORD)) { this->action = 4; - this->timer = 0x78; + this->timer = 120; this->spritePriority.b1 = 1; sub_0802925C(this); sub_080290E0(this, 0); @@ -96,7 +96,7 @@ void sub_08028994(Entity* this) { } void sub_08028A48(Entity* this) { - if (this->timer) { + if (this->timer != 0) { this->timer--; } else if (sub_08028F98(this, 0)) { sub_08029078(this); @@ -114,8 +114,8 @@ void sub_08028A74(Entity* this) { unk = 1; if (this->frame & ANIM_DONE) { this->subAction = 1; - this->timer = 0x3c; - this->subtimer = 0x10; + this->timer = 60; + this->subtimer = 16; sub_08028FDC(this); sub_080290E0(this, 1); } @@ -124,7 +124,7 @@ void sub_08028A74(Entity* this) { unk = 1; if (--this->timer == 0) { this->subAction = 2; - this->timer = 0x20; + this->timer = 32; this->subtimer = 0; sub_08028FDC(this); sub_080290E0(this, 2); @@ -132,7 +132,7 @@ void sub_08028A74(Entity* this) { if (sub_08028FDC(this)) { sub_080290E0(this, 1); } - this->subtimer = 0x10; + this->subtimer = 16; } break; case 2: @@ -152,7 +152,7 @@ void sub_08028A74(Entity* this) { unk = 2; if (this->frame & ANIM_DONE) { this->subAction = 4; - this->timer = 0x50; + this->timer = 80; sub_080290E0(this, 1); } break; @@ -161,13 +161,13 @@ void sub_08028A74(Entity* this) { if (--this->timer == 0) { if (sub_08028F98(this, 0)) { this->subAction = 1; - this->timer = 0x3c; - this->subtimer = 0x10; + this->timer = 60; + this->subtimer = 16; sub_08028FDC(this); } else { sub_08028FFC(this); this->subAction = 0; - this->timer = 0x50; + this->timer = 80; this->subtimer = 0; } return; @@ -178,7 +178,7 @@ void sub_08028A74(Entity* this) { if (!sub_08028F98(this, unk)) { sub_08028FFC(this); this->subAction = 0; - this->timer = 0x50; + this->timer = 80; this->subtimer = 0; } } @@ -203,7 +203,7 @@ void sub_08028BC4(Entity* this) { if (this->frame & ANIM_DONE) { this->action = 4; this->subAction = 0; - this->timer = 0x1e; + this->timer = 30; this->subtimer = 5; sub_080290E0(this, 0); iVar1 = Create0x68FX(this, FX_STARS); @@ -227,7 +227,7 @@ void sub_08028F0C(Entity*); void sub_08028C84(Entity* this) { if (--this->timer == 0) { - this->timer = 0x30; + this->timer = 48; if (this->subtimer) { if (--this->subtimer == 0) { sub_0804AA1C(this); @@ -292,7 +292,7 @@ void sub_08028CE8(Entity* this) { sub_0800445C(this); this->action = 4; - this->timer = 0x30; + this->timer = 48; sub_080290E0(this, 0); } @@ -370,7 +370,7 @@ void sub_08028F0C(Entity* this) { this->direction = (GetAnimationState(this) << 3); sub_080290E0(this, 3); this->field_0x80.HALF.LO = 1; - this->timer = 0x20; + this->timer = 32; this->subtimer = 0; if (sub_08029198(offer)) { dialog = offer->field_0x6; @@ -452,12 +452,13 @@ void sub_080290E0(Entity* this, u32 param_2) { void sub_080290FC(Entity* this) { if (this->timer != 0) { - if (--this->timer < 0x10 && (this->timer & 1) == 0) { - s32 sVar3 = (this->direction & 0x10) ? -1 : 1; - if ((this->direction & 8)) { - this->x.HALF.HI += (this->timer & 8) ? -sVar3 : sVar3; + this->timer--; + if ((this->timer < 16) && ((this->timer & 1) == 0)) { + s32 sVar3 = ((this->direction & 0x10) != 0) ? -1 : 1; + if ((this->direction & 8) != 0) { + this->x.HALF.HI += ((this->timer & 8) != 0) ? -sVar3 : sVar3; } else { - this->y.HALF.HI += (this->timer & 8) ? sVar3 : -sVar3; + this->y.HALF.HI += ((this->timer & 8) != 0) ? sVar3 : -sVar3; } } } diff --git a/src/enemy/businessScrubPrologue.c b/src/enemy/businessScrubPrologue.c index 52c2f05c..ba7349e9 100644 --- a/src/enemy/businessScrubPrologue.c +++ b/src/enemy/businessScrubPrologue.c @@ -44,7 +44,7 @@ void BusinessScrubPrologue_OnCollision(BusinessScrubPrologueEntity* this) { if ((super->contactFlags & 0x7f) == 0x42) { super->action = 4; super->subAction = 0; - super->timer = 0x28; + super->timer = 40; super->flags &= ~ENT_COLLIDE; sub_08046030(this, 4); ent = CreateFx(super, FX_BUSH, 0); @@ -69,7 +69,7 @@ void sub_08045C3C(BusinessScrubPrologueEntity* this) { super->animationState = 0; super->direction = 0x10; super->action = 5; - super->timer = 0x78; + super->timer = 120; super->spritePriority.b1 = 1; super->spriteSettings.draw = 1; sub_08046030(this, 0); @@ -80,7 +80,7 @@ void sub_08045C3C(BusinessScrubPrologueEntity* this) { void sub_08045CA4(BusinessScrubPrologueEntity* this) { super->spriteSettings.draw = 0; - if (super->timer) { + if (super->timer != 0) { super->timer--; } else if (sub_08045F54(this, 0)) { sub_08045FF0(this); @@ -102,8 +102,8 @@ void sub_08045CE0(BusinessScrubPrologueEntity* this) { r6 = 1; if (super->frame & ANIM_DONE) { super->subAction = 1; - super->timer = 0x3c; - super->subtimer = 0x10; + super->timer = 60; + super->subtimer = 16; sub_08045F98(this); sub_08046030(this, 1); } @@ -112,7 +112,7 @@ void sub_08045CE0(BusinessScrubPrologueEntity* this) { r6 = 1; if (--super->timer == 0) { super->subAction = 2; - super->timer = 0x20; + super->timer = 32; super->subtimer = 0; sub_08045F98(this); sub_08046030(this, 2); @@ -135,7 +135,7 @@ void sub_08045CE0(BusinessScrubPrologueEntity* this) { r6 = 2; if (super->frame & ANIM_DONE) { super->subAction = 4; - super->timer = 0x50; + super->timer = 80; sub_08046030(this, 1); } break; @@ -144,12 +144,12 @@ void sub_08045CE0(BusinessScrubPrologueEntity* this) { if (--super->timer == 0) { if (sub_08045F54(this, 0)) { super->subAction = 1; - super->timer = 0x3c; - super->subtimer = 0x10; + super->timer = 60; + super->subtimer = 16; sub_08045F98(this); } else { sub_08045FA0(this); - super->timer = 0x50; + super->timer = 80; super->subtimer = 0; } } @@ -210,7 +210,7 @@ void sub_08045ED4(BusinessScrubPrologueEntity* this) { void sub_08045EDC(BusinessScrubPrologueEntity* this) { if (super->subAction == 0) { super->subAction++; - super->timer = 0x20; + super->timer = 32; super->subtimer = 0; sub_08045F98(this); sub_08046030(this, 2); @@ -283,8 +283,8 @@ void sub_08046030(BusinessScrubPrologueEntity* this, u32 arg2) { } void sub_0804604C(BusinessScrubPrologueEntity* this) { - if (super->timer) { - if (--super->timer <= 0xf) { + if (super->timer != 0) { + if (--super->timer <= 15) { super->spriteOffsetY = gUnk_080D1A3E[super->timer]; } } diff --git a/src/enemy/chaser.c b/src/enemy/chaser.c index 63e4cd3c..895c13f1 100644 --- a/src/enemy/chaser.c +++ b/src/enemy/chaser.c @@ -30,7 +30,7 @@ void sub_0802B530(Entity* this) { } void sub_0802B540(Entity* this) { - if (this->timer) { + if (this->timer != 0) { this->timer--; } else { u32 direction = sub_0804A024(this, 1, 0xc); diff --git a/src/enemy/chuchu.c b/src/enemy/chuchu.c index 960312f8..82de5555 100644 --- a/src/enemy/chuchu.c +++ b/src/enemy/chuchu.c @@ -174,7 +174,7 @@ void sub_0801F0C8(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 3; - this->timer = (Random() & 3) + 0xc; + this->timer = (Random() & 3) + 12; this->subtimer = Random(); this->direction = sub_08049F84(this, 1); COLLISION_ON(this); @@ -198,7 +198,7 @@ void sub_0801F12C(Entity* this) { this->action = 4; Chuchu_JumpAtPlayer(this); } else if (PlayerInRange(this, 1, 0x48)) { - this->timer = (Random() & 3) + 0xc; + this->timer = (Random() & 3) + 12; } else { sub_0801F328(this); } @@ -253,7 +253,7 @@ void sub_0801F270(Entity* this) { if (sub_0801FBD0(this)) return; - if (--this->timer) + if (--this->timer != 0) return; if (this->field_0x80.HALF.HI == 0) { @@ -298,7 +298,7 @@ void sub_0801F340(Entity* this) { void sub_0801F360(Entity* this) { this->action = 7; - this->timer = (Random() & 0x38) + 0xb4; + this->timer = (Random() & 0x38) + 180; this->subtimer = Random(); this->direction = sub_08049F84(this, 1); this->spritePriority.b1 = 2; diff --git a/src/enemy/cloudPiranha.c b/src/enemy/cloudPiranha.c index ea8178e7..d9ae589f 100644 --- a/src/enemy/cloudPiranha.c +++ b/src/enemy/cloudPiranha.c @@ -90,7 +90,7 @@ void CloudPiranha_Init(CloudPiranhaEntity* this) { super->animationState = super->direction >> 2; super->flags |= ENT_COLLIDE; super->timer = 0; - super->subtimer = 0x20; + super->subtimer = 32; this->unk_82 = 0; this->unk_80 = Random() & 1; this->unk_81 = 0; @@ -103,7 +103,7 @@ void CloudPiranha_Action1(CloudPiranhaEntity* this) { sub_080387F0(this); if (--super->subtimer == 0) { super->timer = 0; - super->subtimer = 0x20; + super->subtimer = 32; if (sub_08049FA0(super)) { u32 tmp = super->animationState; if (this->unk_80 != 0) { @@ -120,7 +120,7 @@ void CloudPiranha_Action1(CloudPiranhaEntity* this) { InitializeAnimation(super, (u32)super->animationState); } else if ((super->timer == 0) && sub_0803872C(this, 0x80)) { super->action = 2; - super->subtimer = 0x10; + super->subtimer = 16; super->speed = 0x40; super->animationState = sub_0806FCAC(super, super->child); super->direction = super->animationState << 2; @@ -133,14 +133,14 @@ void sub_080385CC(CloudPiranhaEntity* this) { sub_080387F0(this); if (sub_0803872C(this, 0x60)) { super->action = 3; - super->subtimer = 0xc; + super->subtimer = 12; super->speed = 0x80; super->animationState = sub_0806FCAC(super, super->child); super->direction = super->animationState << 2; InitializeAnimation(super, super->animationState); } else { if (--super->subtimer == 0) { - super->subtimer = 0x10; + super->subtimer = 16; if (super->child != NULL) { super->animationState = sub_0806FCAC(super, super->child); } else { @@ -160,7 +160,7 @@ void CloudPiranha_Action3(CloudPiranhaEntity* this) { sub_08038754(this); } else { if (--super->subtimer == 0) { - super->subtimer = 0xa; + super->subtimer = 10; if (this->unk_81 == 0) { tmp = super->speed += 0x40; if (0x2000000 < (tmp * 0x10000)) { @@ -182,7 +182,7 @@ void CloudPiranha_Action4(CloudPiranhaEntity* this) { super->action = 1; super->hitType = 0x72; super->timer = 1; - super->subtimer = 0x80; + super->subtimer = 128; super->speed = 0x80; super->spritePriority.b1 = 2; EnqueueSFX(SFX_124); diff --git a/src/enemy/crow.c b/src/enemy/crow.c index 55954cae..bd2fb325 100644 --- a/src/enemy/crow.c +++ b/src/enemy/crow.c @@ -42,7 +42,7 @@ void Crow_OnCollision(CrowEntity* this) { if (super->contactFlags & 0x80) { if ((super->contactFlags & 0x3f) == 0) { COLLISION_OFF(super); - super->subtimer = 0x10; + super->subtimer = 16; if (DirectionIsHorizontal(DirectionRoundUp(super->direction)) == 0) { if (DirectionIsVertical(super->direction)) { super->direction += 2; @@ -125,7 +125,7 @@ void sub_0803298C(CrowEntity* this) { super->action = 2; this->unk_84 = 0; - super->timer = 0x10; + super->timer = 16; this->unk_81 = 2; sub_08032AF4(this); } @@ -168,7 +168,7 @@ void sub_08032A48(CrowEntity* this) { void sub_08032AB0(CrowEntity* this) { u32 dir; - if (--super->timer) + if (--super->timer != 0) return; this->unk_80 = super->direction; @@ -200,13 +200,13 @@ void sub_08032B38(CrowEntity* this) { u32 temp; switch (this->unk_84) { case 0: - if (super->timer & 1) { + if ((super->timer & 1) != 0) { super->z.HALF.HI--; } if (--super->timer == 0) { this->unk_84 = 1; - super->timer = 0x18; + super->timer = 24; COLLISION_ON(super); this->unk_81 = 2; sub_08032AF4(this); diff --git a/src/enemy/cuccoAggr.c b/src/enemy/cuccoAggr.c index 88cab003..99c4a6d8 100644 --- a/src/enemy/cuccoAggr.c +++ b/src/enemy/cuccoAggr.c @@ -103,7 +103,7 @@ void sub_08038DC0(CuccoAggrEntity* this) { void sub_08038DD8(CuccoAggrEntity* this) { super->subAction = 1; - super->timer = 0x10; + super->timer = 16; super->subtimer = gUnk_080CF7BC[super->type]; COLLISION_OFF(super); super->spritePriority.b1 = 0; @@ -126,7 +126,7 @@ void sub_08038E18(CuccoAggrEntity* this) { } if (--super->timer == 0) { - super->timer = 0x10; + super->timer = 16; super->spriteSettings.flipX ^= (Random() & 1); CuccoAggr_CreateFx(this); } diff --git a/src/enemy/doorMimic.c b/src/enemy/doorMimic.c index 9061ddb3..b7745c4a 100644 --- a/src/enemy/doorMimic.c +++ b/src/enemy/doorMimic.c @@ -60,11 +60,11 @@ void sub_0802209C(Entity* this) { if (this->timer == 0) { if (CheckPlayerProximity(this->field_0x78.HWORD, this->field_0x7a.HWORD, 0x10, 0x10)) { this->action = 2; - this->timer = 0x12; + this->timer = 18; InitializeAnimation(this, this->type2 + 4); } } else { - this->timer = this->timer - 1; + this->timer--; } } @@ -80,7 +80,7 @@ void sub_080220F0(Entity* this) { u32 i; this->action = 4; - this->timer = 0x78; + this->timer = 120; this->damage = 0; off = gUnk_080CB76C[this->type2]; for (i = 0; i < 6; i++, off++) { @@ -109,7 +109,7 @@ void sub_08022198(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 1; - this->timer = 0x5a; + this->timer = 90; } } diff --git a/src/enemy/enemy4D.c b/src/enemy/enemy4D.c index 0fc6ab78..7e0ee931 100644 --- a/src/enemy/enemy4D.c +++ b/src/enemy/enemy4D.c @@ -184,7 +184,7 @@ void Enemy4D_Action5(Enemy4DEntity* this) { if ((tmp * 0x1000000) < 1) { this->unk_7e = 0; super->action = 6; - super->timer = 0x0f; + super->timer = 15; InitAnimationForceUpdate(super, super->animationState + 0x20); } } @@ -218,7 +218,7 @@ void Enemy4D_Action7(Enemy4DEntity* this) { this->unk_7e += 5; } else { super->action = 8; - super->timer = 0x1e; + super->timer = 30; InitScreenShake(8, 0); } } @@ -235,7 +235,7 @@ void Enemy4D_Action9(Enemy4DEntity* this) { tmp = this->unk_7e = this->unk_7e - 2; if (tmp < 0xb) { super->action = 0xa; - super->timer = 0x3c; + super->timer = 60; super->direction = super->animationState << 3; this->unk_7c = 0; this->unk_7f = 0xfe; diff --git a/src/enemy/enemy50.c b/src/enemy/enemy50.c index ac08bf32..3a3968c3 100644 --- a/src/enemy/enemy50.c +++ b/src/enemy/enemy50.c @@ -111,7 +111,7 @@ void sub_08040B9C(Enemy50Entity* this) { super->flags |= 0x80; super->health = 0xff; super->action = 0xa; - super->timer = 0x3c; + super->timer = 60; } this->unk_7a = super->health; } @@ -210,7 +210,7 @@ void Enemy50_Init(Enemy50Entity* this) { void Enemy50_Action1(Enemy50Entity* this) { if (sub_080411E8(this)) { super->action = 2; - super->timer = 0x0f; + super->timer = 15; } } @@ -276,7 +276,7 @@ void Enemy50_Action6(Enemy50Entity* this) { ProcessMovement1(super); } else { super->action = 7; - super->timer = 0x1e; + super->timer = 30; } } } diff --git a/src/enemy/enemy64.c b/src/enemy/enemy64.c index bbcecf30..1c675710 100644 --- a/src/enemy/enemy64.c +++ b/src/enemy/enemy64.c @@ -85,7 +85,7 @@ void Enemy64_Init(Enemy64Entity* this) { super->child = tail; super->action = 1; super->subAction = 0; - super->timer = 0x3c; + super->timer = 60; super->direction = 0xc0; super->animationState = 0xc0; super->speed = 0x300; @@ -193,7 +193,7 @@ void Enemy64_Action2_SubAction2(Enemy64Entity* this) { gRoomControls.origin_y + 0x80), ((((uVar3 + 2) & 0x1c) - (super->direction >> 3)) & 0xf) == 8)) { super->subAction = 4; - super->timer = 0x3c; + super->timer = 60; super->subtimer = 7; } sub_08049944(this); @@ -210,7 +210,7 @@ void Enemy64_Action2_SubAction3(Enemy64Entity* this) { if (super->timer == 0) { if ((uVar2 >> 0x18 & 0x1f) == 0) { super->subAction = 4; - super->timer = 0x5a; + super->timer = 90; } } else { if (sub_08049A8C(this)) { @@ -234,9 +234,9 @@ void Enemy64_Action2_SubAction4(Enemy64Entity* this) { super->speed += 0x40; } else { super->subAction = 3; - super->timer = 0xa; + super->timer = 10; } - } else if (super->timer == 0x50) { + } else if (super->timer == 80) { Entity* enemy = CreateEnemy(GYORG_MALE_EYE, Random() & 3); if (enemy != NULL) { enemy->parent = super; @@ -277,7 +277,7 @@ void Enemy64_Action3_SubAction0(Enemy64Entity* this) { void Enemy64_Action3_SubAction1(Enemy64Entity* this) { if (EntityWithinDistance(super, gRoomControls.origin_x + 0xa8, gRoomControls.origin_y + 0x80, 0x28)) { super->subAction = 2; - super->timer = 0x2d; + super->timer = 45; this->unk_74 = gUnk_080D29B8[Random() & 7] << 0x18 >> 0x18; this->unk_76 = super->direction << 8; } @@ -290,7 +290,7 @@ void Enemy64_Action3_SubAction2(Enemy64Entity* this) { sub_08049998(this, ((0x100 - super->direction) & 0xff) << 8); if (--super->timer == 0) { super->subAction = 3; - super->timer = 0x1e; + super->timer = 30; } } @@ -312,7 +312,7 @@ void Enemy64_Action4_SubAction0(Enemy64Entity* this) { if (PlayerCanBeMoved() && gPlayerEntity.z.HALF.HI == 0) { SetPlayerControl(CONTROL_2); super->subAction = 2; - super->timer = 0x1e; + super->timer = 30; } else { super->subAction = 1; } @@ -331,7 +331,7 @@ void Enemy64_Action4_SubAction1(Enemy64Entity* this) { void Enemy64_Action4_SubAction2(Enemy64Entity* this) { if (--super->timer == 0) { super->subAction = 3; - super->timer = 0xb4; + super->timer = 180; super->speed = 0x100; super->direction -= 0x40; } @@ -341,7 +341,7 @@ void Enemy64_Action4_SubAction2(Enemy64Entity* this) { void Enemy64_Action4_SubAction3(Enemy64Entity* this) { sub_08049AB0(this); if (--super->timer == 0) { - super->timer = 0x1e; + super->timer = 30; super->subAction = 4; super->speed = 0x400; super->direction = super->animationState; @@ -389,7 +389,7 @@ void Enemy64_Action4_SubAction5(Enemy64Entity* this) { void Enemy64_Action4_SubAction6(Enemy64Entity* this) { if (gFadeControl.active == 0) { super->subAction = 7; - super->timer = 0xa0; + super->timer = 160; SoundReq(SFX_SECRET); SetFlag(0x7c); SetPlayerControl(CONTROL_1); @@ -399,19 +399,19 @@ void Enemy64_Action4_SubAction6(Enemy64Entity* this) { void Enemy64_Action4_SubAction7(Enemy64Entity* this) { if (--super->timer == 0) { DeleteThisEntity(); - } else if (super->timer == 0x10) { + } else if (super->timer == 16) { sub_0807B7D8(0x36, 0xca, 1); SetTile(0x4081, 0xca, 2); SoundReq(SFX_HEART_GET); - } else if (super->timer == 0x18) { + } else if (super->timer == 24) { sub_0807B7D8(0x36, 0x8a, 1); SetTile(0x4081, 0x8a, 2); SoundReq(SFX_HEART_GET); - } else if (super->timer == 0x20) { + } else if (super->timer == 32) { sub_0807B7D8(0x36, 0x4a, 1); SetTile(0x4081, 0x4a, 2); SoundReq(SFX_HEART_GET); - } else if (super->timer == 0x28) { + } else if (super->timer == 40) { sub_0807B7D8(0x36, 10, 1); SetTile(0x4081, 10, 2); SoundReq(SFX_HEART_GET); @@ -461,7 +461,7 @@ void sub_080499F0(Enemy64Entity* this) { } bool32 sub_08049A8C(Enemy64Entity* this) { - if (--super->timer == 0 && (Random() & 0xf) != 0) { + if ((--super->timer == 0) && ((Random() & 0xf) != 0)) { return TRUE; } else { return FALSE; diff --git a/src/enemy/eyegore.c b/src/enemy/eyegore.c index c852c589..a3e189ba 100644 --- a/src/enemy/eyegore.c +++ b/src/enemy/eyegore.c @@ -174,7 +174,7 @@ void Eyegore_Action2(EyegoreEntity* this) { } else { if (sub_08049FDC(super, 1)) { super->action = 3; - super->timer = 0x3c; + super->timer = 60; super->direction = (CalculateDirectionTo(super->x.HALF.HI + super->hitbox->offset_x, super->y.HALF.HI + super->hitbox->offset_y, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI) + @@ -469,7 +469,7 @@ void sub_08031250(EyegoreEntity* this) { void sub_08031320(EyegoreEntity* this) { super->action = 2; super->flags &= ~ENT_COLLIDE; - super->timer = 0x1e; + super->timer = 30; super->hitbox = (Hitbox*)&gUnk_080FD308; InitializeAnimation(super, 10); } diff --git a/src/enemy/fireballGuy.c b/src/enemy/fireballGuy.c index 3639fc3e..6ae9ba74 100644 --- a/src/enemy/fireballGuy.c +++ b/src/enemy/fireballGuy.c @@ -121,7 +121,7 @@ void sub_08045524(Entity* this) { this->timer = Random() & 3; this->direction = DirectionRound(tmp); } else { - if (this->timer) { + if (this->timer != 0) { this->timer--; return; } diff --git a/src/enemy/flyingSkull.c b/src/enemy/flyingSkull.c index d41e8f09..fd2e63c8 100644 --- a/src/enemy/flyingSkull.c +++ b/src/enemy/flyingSkull.c @@ -136,7 +136,7 @@ void sub_08039DD8(FlyingSkullEntity* this) { if (EntityWithinDistance(super, ent->x.HALF.HI, ent->y.HALF.HI, 0x30)) { if (super->type == 1) { super->action = 3; - super->timer = 0x1e; + super->timer = 30; } else { ent = CreateEnemy(STALFOS, super->type - 2); if (ent != NULL) { diff --git a/src/enemy/ghini.c b/src/enemy/ghini.c index 80d63819..a620a5fe 100644 --- a/src/enemy/ghini.c +++ b/src/enemy/ghini.c @@ -172,18 +172,16 @@ void Ghini_Action1(GhiniEntity* this) { void Ghini_Action2(GhiniEntity* this) { if (sub_0803F5A8(this) == 0) { sub_0803F50C(this); - } else { - if (--super->timer == 0) { - super->action = 3; - super->timer = 0x1e; - if (sub_08049DF4(1) != NULL) { - super->direction = GetFacingDirection(super, gUnk_020000B0); - } else { - super->direction = Random() & 0x1f; - } - super->animationState = super->direction >> 4; - InitializeAnimation(super, super->animationState + 1); + } else if (--super->timer == 0) { + super->action = 3; + super->timer = 30; + if (sub_08049DF4(1) != NULL) { + super->direction = GetFacingDirection(super, gUnk_020000B0); + } else { + super->direction = Random() & 0x1f; } + super->animationState = super->direction >> 4; + InitializeAnimation(super, super->animationState + 1); } } @@ -223,20 +221,18 @@ void Ghini_Action6(GhiniEntity* this) { if (sub_0803F5A8(this) == 0) { sub_0803F51C(this); - } else { - if (sub_08049DF4(1) != NULL) { - tmp = super->timer + 1; - super->timer = tmp; - if ((tmp & gUnk_080D0970[tmp * 0x1000000 >> 0x1e]) == 0) { - sub_08004596(super, GetFacingDirection(super, gUnk_020000B0)); - } - sub_0803F66C(this); - ProcessMovement1(super); - GetNextFrame(super); - } else { - super->action = 7; - super->timer = 0x1e; + } else if (sub_08049DF4(1) != NULL) { + tmp = super->timer + 1; + super->timer = tmp; + if ((tmp & gUnk_080D0970[tmp * 0x1000000 >> 0x1e]) == 0) { + sub_08004596(super, GetFacingDirection(super, gUnk_020000B0)); } + sub_0803F66C(this); + ProcessMovement1(super); + GetNextFrame(super); + } else { + super->action = 7; + super->timer = 30; } } @@ -331,13 +327,11 @@ bool32 sub_0803F5A8(GhiniEntity* this) { bool32 sub_0803F5D4(GhiniEntity* this) { if (this->unk_7c != 0) { this->unk_7c--; - } else { - if ((sub_08049FDC(super, 1)) && - ((sub_0806FD54(super) || - ((0xf < (s16)gArea.lightLevel && (EntityInRectRadius(super, gUnk_020000B0, 0x70, 0x48))))))) { - sub_0803F630(this); - return TRUE; - } + } else if ((sub_08049FDC(super, 1)) && + ((sub_0806FD54(super) || + ((0xf < (s16)gArea.lightLevel && (EntityInRectRadius(super, gUnk_020000B0, 0x70, 0x48))))))) { + sub_0803F630(this); + return TRUE; } return FALSE; } diff --git a/src/enemy/gibdo.c b/src/enemy/gibdo.c index ac59891c..030e9b25 100644 --- a/src/enemy/gibdo.c +++ b/src/enemy/gibdo.c @@ -20,8 +20,7 @@ typedef struct { u16 field_0x78; u16 field_0x7a; u8 field_0x7c; - u8 field_0x7d; - u8 filler2[2]; + u8 filler2[3]; Entity* field_0x80; Entity* field_0x84; } GibdoEntity; @@ -32,11 +31,11 @@ void sub_08037B10(GibdoEntity*); void sub_0803797C(GibdoEntity*); void sub_080379BC(GibdoEntity*); void Gibdo_MoveObjectsToStalfos(GibdoEntity*, Entity*); -u32 sub_08037810(GibdoEntity*); +bool32 sub_08037810(GibdoEntity*); void sub_080377B0(GibdoEntity*); -u32 sub_080378B0(GibdoEntity*); -u32 sub_08037914(GibdoEntity*); -u32 sub_080379EC(GibdoEntity*); +bool32 sub_080378B0(GibdoEntity*); +bool32 sub_08037914(GibdoEntity*); +bool32 sub_080379EC(GibdoEntity*); void sub_08037A58(GibdoEntity*); void sub_08037ACC(GibdoEntity*); void Gibdo_CreateObjects(GibdoEntity*); @@ -56,13 +55,12 @@ void Gibdo_OnTick(GibdoEntity* this) { } void Gibdo_OnCollision(GibdoEntity* this) { - u8 x; if (super->contactFlags == 0x87) { if (super->action == 0x6) { sub_08037ACC(this); } super->action = 0x8; - super->timer = 0x3c; + super->timer = 60; COLLISION_OFF(super); Gibdo_CreateObjects(this); } else { @@ -71,12 +69,14 @@ void Gibdo_OnCollision(GibdoEntity* this) { sub_08037A14(this); } else { if ((u8)(super->action - 1) < 2) { + u8 dir; + super->action = 1; - x = DirectionRoundUp(DirectionTurnAround(super->knockbackDirection)); - super->direction = x; - super->animationState = x >> 3; + dir = DirectionRoundUp(DirectionTurnAround(super->knockbackDirection)); + super->direction = dir; + super->animationState = dir >> 3; InitAnimationForceUpdate(super, super->animationState); - if (sub_08037810(this) != 0) { + if (sub_08037810(this)) { super->timer = 4; } } @@ -103,24 +103,22 @@ void sub_08037558(GibdoEntity* this) { } void sub_08037580(GibdoEntity* this) { - if (sub_08037810(this) == 0) { - if (!(--this->field_0x74)) { + if (!sub_08037810(this)) { + if (--this->field_0x74 == 0) { sub_080377B0(this); } } } void sub_080375A4(GibdoEntity* this) { - if (sub_080378B0(this) == 0) { - if (sub_08037810(this) == 0) { - if (!(--this->field_0x74)) { - sub_08037794(this); - } else { - UpdateAnimationSingleFrame(super); - if (ProcessMovement0(super) == 0) { - if (!(--super->subtimer)) { - sub_080379BC(this); - } + if (!sub_080378B0(this) && !sub_08037810(this)) { + if (--this->field_0x74 == 0) { + sub_08037794(this); + } else { + UpdateAnimationSingleFrame(super); + if (!ProcessMovement0(super)) { + if (--super->subtimer == 0) { + sub_080379BC(this); } } } @@ -128,32 +126,26 @@ void sub_080375A4(GibdoEntity* this) { } void sub_080375F8(GibdoEntity* this) { - if (sub_080378B0(this) == 0) { - if (!(--super->timer)) { - super->action = 4; - super->timer = 0x18; - InitAnimationForceUpdate(super, super->animationState + 4); - } + if (!sub_080378B0(this) && (--super->timer == 0)) { + super->action = 4; + super->timer = 24; + InitAnimationForceUpdate(super, super->animationState + 4); } } void sub_08037624(GibdoEntity* this) { - if (sub_080378B0(this) == 0) { - if (sub_08037914(this) == 0) { - if (!(--this->field_0x74)) { - sub_08037794(this); - } else { - UpdateAnimationSingleFrame(super); - UpdateAnimationSingleFrame(super); - if (ProcessMovement0(super) == 0) { - if (!(--super->subtimer)) { - sub_080379BC(this); - } - } else { - if (!(--super->timer)) { - sub_0803797C(this); - } + if (!sub_080378B0(this) && !sub_08037914(this)) { + if (--this->field_0x74 == 0) { + sub_08037794(this); + } else { + UpdateAnimationSingleFrame(super); + UpdateAnimationSingleFrame(super); + if (!ProcessMovement0(super)) { + if (--super->subtimer == 0) { + sub_080379BC(this); } + } else if (--super->timer == 0) { + sub_0803797C(this); } } } @@ -162,7 +154,7 @@ void sub_08037624(GibdoEntity* this) { void sub_08037690(GibdoEntity* this) { UpdateAnimationSingleFrame(super); if ((super->frame & ANIM_DONE) != 0) { - this->field_0x77 = 0x14; + this->field_0x77 = 20; sub_08037794(this); } else { if ((super->frame & 1) != 0) { @@ -173,14 +165,13 @@ void sub_08037690(GibdoEntity* this) { } void sub_080376D0(GibdoEntity* this) { - u8* x; - if (sub_080379EC(this) == 0) { + if (!sub_080379EC(this)) { ResetPlayerItem(); gPlayerState.mobility = gPlayerState.mobility | 0x80; gPlayerState.field_0xa = gPlayerState.field_0xa | 0x80; CopyPositionAndSpriteOffset(&gPlayerEntity, super); UpdateAnimationSingleFrame(super); - if ((super->frame & 0x1) != 0) { + if ((super->frame & 1) != 0) { if (--this->field_0x7c == 0) { sub_08037A58(this); } else { @@ -200,12 +191,12 @@ void sub_0803773C(GibdoEntity* this) { // Turn into Stalfos void sub_0803775C(GibdoEntity* this) { - Entity* x; - if (!(--super->timer)) { - x = CreateEnemy(STALFOS, 0); - if (x != 0) { - sub_0804A4E4(super, x); - Gibdo_MoveObjectsToStalfos(this, x); + Entity* stalfos; + if (--super->timer == 0) { + stalfos = CreateEnemy(STALFOS, 0); + if (stalfos != NULL) { + sub_0804A4E4(super, stalfos); + Gibdo_MoveObjectsToStalfos(this, stalfos); } DeleteEntity(super); } @@ -213,99 +204,99 @@ void sub_0803775C(GibdoEntity* this) { void sub_08037794(GibdoEntity* this) { super->action = 1; - this->field_0x74 = 0x1e; + this->field_0x74 = 30; super->hitType = 0x26; InitAnimationForceUpdate(super, super->animationState); } void sub_080377B0(GibdoEntity* this) { - u32 r1; - u32 r2; + u32 rand1; + u32 rand2; + super->action = 2; super->subtimer = 8; - r1 = Random(); - this->field_0x74 = (r1 & 0x38) + 0x78; + rand1 = Random(); + this->field_0x74 = (rand1 & 0x38) + 120; super->speed = 0x40; - r2 = Random(); - if (!sub_08049FA0(super) && (r2 & 3)) { + rand2 = Random(); + if (!sub_08049FA0(super) && ((rand2 & 3) != 0)) { super->direction = DirectionRoundUp(sub_08049EE4(super)); } else { - super->direction = DirectionRound(r2); + super->direction = DirectionRound(rand2); } super->animationState = super->direction / 8; InitAnimationForceUpdate(super, super->animationState + 4); } -u32 sub_08037810(GibdoEntity* this) { - u32 x; - u32 y; +bool32 sub_08037810(GibdoEntity* this) { + u32 dir; + if (this->field_0x76 == 0) { - if (sub_08049FDC(super, 1) != 0) { - if (EntityWithinDistance(super, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI, 0x40) != 0) { - x = GetFacingDirection(super, gUnk_020000B0); - if (((x - super->direction + 6) & 0x1f) <= 0xc) { - super->action = 3; - super->timer = 0x18; - super->subtimer = 0x8; - super->speed = 0xc0; - super->direction = DirectionRoundUp(GetFacingDirection(super, gUnk_020000B0)); - super->animationState = super->direction >> 3; - this->field_0x74 = 300; - this->field_0x78 = gUnk_020000B0->x.HALF.HI; - this->field_0x7a = gUnk_020000B0->y.HALF.HI; - InitAnimationForceUpdate(super, super->animationState); - return 1; - } + if (sub_08049FDC(super, 1) && + EntityWithinDistance(super, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI, 0x40)) { + dir = GetFacingDirection(super, gUnk_020000B0); + if (((dir - super->direction + 6) & 0x1f) <= 0xc) { + super->action = 3; + super->timer = 24; + super->subtimer = 8; + super->speed = 0xc0; + super->direction = DirectionRoundUp(GetFacingDirection(super, gUnk_020000B0)); + super->animationState = super->direction >> 3; + this->field_0x74 = 300; + this->field_0x78 = gUnk_020000B0->x.HALF.HI; + this->field_0x7a = gUnk_020000B0->y.HALF.HI; + InitAnimationForceUpdate(super, super->animationState); + return TRUE; } } } else { this->field_0x76--; } - return 0; + return FALSE; } -u32 sub_080378B0(GibdoEntity* this) { +bool32 sub_080378B0(GibdoEntity* this) { if (this->field_0x77 == 0) { - if (sub_08049DF4(1) != 0) { + if (sub_08049DF4(1) != NULL) { if (sub_0804A044(super, gUnk_020000B0, 0xa) == super->direction) - if (EntityWithinDistance(super, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI, 0x18) != 0) { + if (EntityWithinDistance(super, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI, 0x18)) { super->action = 5; super->speed = 0x100; InitAnimationForceUpdate(super, super->animationState + 8); - return 1; + return TRUE; } } } else { this->field_0x77--; } - return 0; + return FALSE; } -u32 sub_08037914(GibdoEntity* this) { - if (sub_08049FDC(super, 1) != 0) { - if (EntityWithinDistance(gUnk_020000B0, this->field_0x78, this->field_0x7a, 0x28) == 0) { +bool32 sub_08037914(GibdoEntity* this) { + if (sub_08049FDC(super, 1)) { + if (!EntityWithinDistance(gUnk_020000B0, this->field_0x78, this->field_0x7a, 0x28)) { this->field_0x78 = gUnk_020000B0->x.HALF_U.HI; this->field_0x7a = gUnk_020000B0->y.HALF_U.HI; sub_0803797C(this); - return 0; + return FALSE; } - if (EntityWithinDistance(super, this->field_0x78, this->field_0x7a, 0x8) == 0) { - return 0; + if (!EntityWithinDistance(super, this->field_0x78, this->field_0x7a, 0x8)) { + return FALSE; } - this->field_0x76 = 0x3c; + this->field_0x76 = 60; } sub_08037794(this); - return 1; + return TRUE; } void sub_0803797C(GibdoEntity* this) { u32 m; - super->timer = 0x18; + + super->timer = 24; super->subtimer = 8; m = super->direction = (CalculateDirectionTo(super->x.HALF.HI, super->y.HALF.HI, this->field_0x78, this->field_0x7a) + 4) & 0x18; - ; - m = m / 8; + m >>= 3; if (m != super->animationState) { super->animationState = m; InitAnimationForceUpdate(super, m + 4); @@ -313,29 +304,30 @@ void sub_0803797C(GibdoEntity* this) { } void sub_080379BC(GibdoEntity* this) { - u32 r; - super->timer = 0x18; - super->subtimer = 0x8; - r = Random(); - super->animationState = ((super->animationState + (r & 2)) - 1) & 3; + u32 rand; + + super->timer = 24; + super->subtimer = 8; + rand = Random(); + super->animationState = ((super->animationState + (rand & 2)) - 1) & 3; super->direction = DirectionFromAnimationState(super->animationState); InitAnimationForceUpdate(super, super->animationState + 4); } -u32 sub_080379EC(GibdoEntity* this) { +bool32 sub_080379EC(GibdoEntity* this) { if (sub_0807953C() != 0) { - if (!(--super->timer)) { + if (--super->timer == 0) { sub_08037A58(this); - return 1; + return TRUE; } } - return 0; + return FALSE; } void sub_08037A14(GibdoEntity* this) { super->action = 6; - super->timer = 0x18; - super->spritePriority.b0 = (super->spritePriority.b0 & (super->timer - 0x20)); + super->timer = 24; + super->spritePriority.b0 &= super->timer - 32; super->spritePriority.b0 |= 3; super->flags2 &= 0xfe; this->field_0x7c = 5; @@ -357,14 +349,14 @@ void sub_08037A58(GibdoEntity* this) { super->knockbackDirection = DirectionFromAnimationState(super->animationState) ^ 0x10; super->knockbackDuration = 8; super->knockbackSpeed = 0x180; - this->field_0x76 = 0x3c; + this->field_0x76 = 60; InitAnimationForceUpdate(super, super->animationState + 0x10); } void sub_08037ACC(GibdoEntity* this) { gPlayerState.flags &= ~PL_DISABLE_ITEMS; COLLISION_ON(&gPlayerEntity); - gPlayerEntity.iframes = 0x1e; + gPlayerEntity.iframes = 30; gPlayerEntity.knockbackDirection = DirectionFromAnimationState(super->animationState); gPlayerEntity.knockbackDuration = 4; gPlayerEntity.knockbackSpeed = 0x180; @@ -372,63 +364,67 @@ void sub_08037ACC(GibdoEntity* this) { // Damage player maybe? void sub_08037B10(GibdoEntity* this) { - u32 h; + u32 health; gPlayerEntity.iframes = 0xc; - h = ModHealth(-8); + health = ModHealth(-8); SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6); - if (h == 0) { + if (health == 0) { sub_08037A58(this); - this->field_0x76 = 0xf0; + this->field_0x76 = 240; } } void Gibdo_CreateObjects(GibdoEntity* this) { - Entity* E; - E = CreateObject(OBJECT_2A, 3, 0); - if (E != 0) { - E->type2 = super->timer; - E->spritePriority.b0 = 3; - E->spriteOffsetX = 0; - E->spriteOffsetY = 0xfc; - E->parent = super; + Entity* object; + + object = CreateObject(OBJECT_2A, 3, 0); + if (object != NULL) { + object->type2 = super->timer; + object->spritePriority.b0 = 3; + object->spriteOffsetX = 0; + object->spriteOffsetY = 0xfc; + object->parent = super; } - this->field_0x80 = E; - E = CreateObject(OBJECT_2A, 3, 0); - if (E != 0) { - E->type2 = super->timer; - E->spritePriority.b0 = 3; - E->spriteOffsetX = 0xfd; - E->spriteOffsetY = 0xf8; - E->parent = super; + this->field_0x80 = object; + + object = CreateObject(OBJECT_2A, 3, 0); + if (object != NULL) { + object->type2 = super->timer; + object->spritePriority.b0 = 3; + object->spriteOffsetX = 0xfd; + object->spriteOffsetY = 0xf8; + object->parent = super; } - this->field_0x84 = E; - E = CreateObject(OBJECT_2A, 3, 0); - if (E != 0) { - E->type2 = super->timer; - E->spritePriority.b0 = 3; - E->spriteOffsetX = 0x5; - E->spriteOffsetY = 0xf5; - E->parent = super; + this->field_0x84 = object; + + object = CreateObject(OBJECT_2A, 3, 0); + if (object != NULL) { + object->type2 = super->timer; + object->spritePriority.b0 = 3; + object->spriteOffsetX = 0x5; + object->spriteOffsetY = 0xf5; + object->parent = super; } - super->child = E; + super->child = object; } void Gibdo_MoveObjectsToStalfos(GibdoEntity* this, Entity* that) { Entity* ent = this->field_0x80; + if (ent != NULL) { - ent->timer = 0xf; + ent->timer = 15; ent->parent = that; } ent = this->field_0x84; if (ent != NULL) { - ent->timer = 0xf; + ent->timer = 15; ent->parent = that; } ent = super->child; if (ent != NULL) { - ent->timer = 0xf; + ent->timer = 15; ent->parent = that; } } diff --git a/src/enemy/gleerok.c b/src/enemy/gleerok.c index f1870745..1b8cdc30 100644 --- a/src/enemy/gleerok.c +++ b/src/enemy/gleerok.c @@ -80,15 +80,15 @@ void Gleerok_OnDeath(GleerokEntity* this) { if (super->type2 == 0) { super->type2 = 1; super->timer = 0; - super->subtimer = 0x3c; + super->subtimer = 60; this->unk_74 = 0x10; this->unk_75 = 0; gScreen.controls.alphaBlend = this->unk_74; gScreen.controls.layerFXControl = 0x1442; SoundReq(SFX_EVAPORATE); } else { - ++super->timer; - if ((super->timer & 0xf) == 0) { + super->timer++; + if ((super->timer & 0xF) == 0) { this->unk_75++; this->unk_74--; gScreen.controls.alphaBlend = this->unk_74 | (this->unk_75 << 8); @@ -148,7 +148,7 @@ void sub_0802D170(GleerokEntity* this) { } else { super->action = 3; this->unk_80 = 0; - ((Entity*)this->unk_84)->parent->timer = 0x18; + ((Entity*)this->unk_84)->parent->timer = 24; this->unk_84->filler[0x19] = 0; } } @@ -161,7 +161,7 @@ void sub_0802D218(GleerokEntity* this) { super->timer = 0; super->subtimer = 0; this->unk_7c.HALF_U.LO = 0xb4; - ((Entity*)(this->unk_84))->parent->timer = 0xc; + ((Entity*)(this->unk_84))->parent->timer = 12; CreateObjectWithParent(super, 0x67, 0x2, this->unk_7c.HALF_U.LO); } @@ -403,7 +403,7 @@ void sub_0802D6F0(GleerokEntity* this) { if (--this->unk_7c.WORD == -1) { super->subAction = 2; this->unk_7c.WORD = 0x5a; - InitScreenShake(0x96, 0); + InitScreenShake(150, 0); } } @@ -434,7 +434,7 @@ void sub_0802D714(GleerokEntity* this) { ((GleerokEntity*)(super->child))->unk_84 = heap; } - heap->ent2->timer = 0x18; + heap->ent2->timer = 24; } void sub_0802D77C(GleerokEntity* this) { @@ -449,7 +449,7 @@ void sub_0802D77C(GleerokEntity* this) { super->subtimer = 0; super->timer = 0; super->subAction = 4; - this->unk_84->ent2->timer = 0xc; + this->unk_84->ent2->timer = 12; } void sub_0802D7B4(GleerokEntity* this) { @@ -459,7 +459,7 @@ void sub_0802D7B4(GleerokEntity* this) { super->timer = 0; super->action = 1; super->subAction = 0; - this->unk_84->ent2->timer = 0x18; + this->unk_84->ent2->timer = 24; gRoomControls.camera_target = &gPlayerEntity; #ifndef EU gPlayerState.controlMode = CONTROL_1; @@ -730,10 +730,10 @@ void sub_0802DC1C(GleerokEntity* this) { } void sub_0802DCE0(GleerokEntity* this) { - if (this->unk_84->ent2->timer != 0xc) { + if (this->unk_84->ent2->timer != 12) { super->direction = GetFacingDirection(super, &gPlayerEntity); if (this->unk_84->filler[0x15] == super->direction) { - this->unk_84->ent2->timer = 0xc; + this->unk_84->ent2->timer = 12; this->unk_82 = 4; super->subtimer = 0; } else { @@ -870,7 +870,7 @@ void sub_0802DDD8(GleerokEntity* this) { super->timer &= 0xfe; } - this->unk_84->ent2->timer = 0xc; + this->unk_84->ent2->timer = 12; } else { super->subAction = 0; this->unk_84->ent2->timer = 0; @@ -903,7 +903,7 @@ void sub_0802DFC0(GleerokEntity* this) { if (this->unk_7b) { COLLISION_ON(super); super->type2 = 1; - this->unk_84->ent2->timer = 0x18; + this->unk_84->ent2->timer = 24; SoundReq(SFX_BOSS_HIT); } } @@ -1018,7 +1018,7 @@ void sub_0802E1D0(GleerokEntity* this) { if (i == 5) { if (!(this->unk_79 & 0x80)) { this->unk_7c.HALF_U.LO = 0xF0; - InitScreenShake(0xF0, 0); + InitScreenShake(240, 0); } else { for (this->unk_7c.HALF_U.LO = 0; this->unk_7c.HALF_U.LO < 4; this->unk_7c.HALF_U.LO++) { CreateObjectWithParent(super, OBJECT_67, 1, this->unk_7c.HALF_U.LO); @@ -1028,7 +1028,7 @@ void sub_0802E1D0(GleerokEntity* this) { this->unk_7c.HALF_U.LO = 0xB; gScreen.controls.alphaBlend = this->unk_74 | (this->unk_75 << 8); gScreen.controls.layerFXControl = 0x240; - InitScreenShake(0x1e, 0); + InitScreenShake(30, 0); } super->type2 = 5; } @@ -1100,7 +1100,7 @@ void sub_0802E300(GleerokEntity* this) { ((GleerokEntity*)super->child)->unk_84 = heap; } - heap->ent2->timer = 0x18; + heap->ent2->timer = 24; } else { if ((gRoomTransition.frameCount & 0xf) == 0) { CreateProjectileWithParent(super, GLEEROK_PROJECTILE, 0x3); @@ -1202,7 +1202,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802E518.inc", void sub_0802E518(GleerokE heap->entities[index]->y.WORD -= result << 8; } - if (heap->ent2->timer == 0x18) { + if (heap->ent2->timer == 24) { r7 = (heap->filler[0x15] >> 3) << 2; if (heap->filler[0x2d] > 0xc) { r7 += 3; diff --git a/src/enemy/gyorgChild.c b/src/enemy/gyorgChild.c index 348e7aca..54423715 100644 --- a/src/enemy/gyorgChild.c +++ b/src/enemy/gyorgChild.c @@ -77,8 +77,7 @@ void GyorgChild_OnGrabbed_Action3(GyorgChildEntity* this) { void GyorgChild_Action0(GyorgChildEntity* this) { static const s8 gUnk_080D1EA0[] = { - 0x50, 0x1, 0x40, 0x1, 0x30, 0x1, 0x20, 0x1, 0x10, 0x1, 0, - 0, 0x10, -0x1, 0x20, -0x1, 0x30, -0x1, 0x40, -0x1, 0x50, -0x1, + 80, 1, 64, 1, 48, 1, 32, 1, 16, 1, 0, 0, 16, -1, 32, -1, 48, -1, 64, -1, 80, -1, }; super->gustJarFlags = 1; super->spriteOrientation.flipY = 3; diff --git a/src/enemy/gyorgFemale.c b/src/enemy/gyorgFemale.c index a5948446..6198b88b 100644 --- a/src/enemy/gyorgFemale.c +++ b/src/enemy/gyorgFemale.c @@ -84,7 +84,7 @@ void GyorgFemale_Setup(GyorgFemaleEntity* this) { super->collisionLayer = 2; this->eyesVulnerable = 0; this->unk_79 = 0; - this->childrenSpawnTimer = 0x3C; + this->childrenSpawnTimer = 60; MemClear(&gMapDataBottomSpecial, 0x8000); MemClear(&gMapDataTopSpecial, 0x8000); sub_0804660C(this, 0); @@ -116,13 +116,13 @@ void GyorgFemale_Action1(GyorgFemaleEntity* this) { this->eyeTimer = 0; this->eyesHitFrame = 0; this->eyesHit = 0; - this->childrenSpawnTimer = 0x3c; + this->childrenSpawnTimer = 60; this->unk_80 = 0; return; } if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x40) { super->action = 3; - this->childrenSpawnTimer = 0x3c; + this->childrenSpawnTimer = 60; super->timer = 0; this->eyeTimer = 0; this->eyesHitFrame = 0; @@ -132,7 +132,7 @@ void GyorgFemale_Action1(GyorgFemaleEntity* this) { } if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x100) { if (--this->childrenSpawnTimer == 0) { - this->childrenSpawnTimer = 0x168; + this->childrenSpawnTimer = 360; GyorgFemale_SpawnChildren(this, TRUE); } } @@ -160,12 +160,12 @@ void GyorgFemale_Action2(GyorgFemaleEntity* this) { } } if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x80 && --this->childrenSpawnTimer == 0) { - this->childrenSpawnTimer = 0x168; + this->childrenSpawnTimer = 360; GyorgFemale_SpawnChildren(this, 0); } if ((((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x38) == 0) { super->action = 1; - this->childrenSpawnTimer = 0x3c; + this->childrenSpawnTimer = 60; #ifndef EU this->eyesVulnerable = 0; #endif @@ -176,7 +176,7 @@ void GyorgFemale_Action2(GyorgFemaleEntity* this) { void GyorgFemale_Action3(GyorgFemaleEntity* this) { sub_080465C8(); if (--this->childrenSpawnTimer == 0) { - this->childrenSpawnTimer = 0x168; + this->childrenSpawnTimer = 360; GyorgFemale_SpawnChildren(this, 1); } GyorgFemale_ProcessEyeHit(this); @@ -203,7 +203,7 @@ void GyorgFemale_Action3(GyorgFemaleEntity* this) { #ifdef EU this->eyesVulnerable = 0; #endif - this->childrenSpawnTimer = 0x3c; + this->childrenSpawnTimer = 60; #ifndef EU this->eyesVulnerable = 0; #endif diff --git a/src/enemy/gyorgMale.c b/src/enemy/gyorgMale.c index a0c05067..731404a8 100644 --- a/src/enemy/gyorgMale.c +++ b/src/enemy/gyorgMale.c @@ -392,7 +392,7 @@ void sub_08046E68(GyorgMaleEntity* this) { sub_08047EA4(this, ((0x100 - super->direction) & 0xFF) << 8); } else { super->subAction = 4; - super->timer = 0x3F; + super->timer = 63; super->subtimer = 1; super->direction = (gUnk_080D1B70[Random() & 1] + tmp) & 0xC0; sub_08047D88(this); @@ -404,13 +404,13 @@ const u16 gUnk_080D1B74[0x10] = { 0x20, 0x40, 0x60, 0x80, 0xA0, 0xC0, 0xE0, 0x1 void sub_08046EF4(GyorgMaleEntity* this) { if (--super->timer == 0) { - super->timer = 0x7F; + super->timer = 127; super->direction ^= 0x80; } super->speed = gUnk_080D1B74[(super->timer >> 3) & 0xF]; if (--super->subtimer == 0) { Entity* tmp; - super->subtimer = (Random() & 0x38) + 0x78; + super->subtimer = (Random() & 0x38) + 120; tmp = CreateProjectile(GYORG_MALE_ENERGY_PROJECTILE); if (tmp) { tmp->collisionLayer = 2; @@ -926,7 +926,7 @@ void sub_08047B84(GyorgMaleEntity* this) { void sub_08047BA4(GyorgMaleEntity* this) { super->subAction = 1; - super->timer = 0x78; + super->timer = 120; super->subtimer = 0; if (gRoomControls.origin_x + 0x200 < super->x.HALF.HI) { this->unk_76 = 0x78; @@ -968,17 +968,17 @@ void sub_08047BF0(GyorgMaleEntity* this) { } } else { super->timer--; - if (super->timer == 0x5A) { + if (super->timer == 90) { tmp = super->child; tmp->spriteSettings.draw = 0; CreateFx(tmp, FX_GIANT_EXPLOSION4, 0); } else { - if (super->timer == 0x3C) { + if (super->timer == 60) { tmp = super->child->child; tmp->spriteSettings.draw = 0; CreateFx(tmp, FX_GIANT_EXPLOSION4, 0); } else { - if (super->timer == 0x1E) { + if (super->timer == 30) { tmp = super->child->child->child; tmp->spriteSettings.draw = 0; CreateFx(tmp, FX_GIANT_EXPLOSION4, 0); diff --git a/src/enemy/gyorgMaleEye.c b/src/enemy/gyorgMaleEye.c index b4bd94a7..51ecacd4 100644 --- a/src/enemy/gyorgMaleEye.c +++ b/src/enemy/gyorgMaleEye.c @@ -53,7 +53,7 @@ void GyorgMaleEye_OnCollision(GyorgMaleEyeEntity* this) { } else { entity->health = 0; SoundReq(SFX_BOSS_DIE); - InitScreenShake(0x28, 0); + InitScreenShake(40, 0); } if (super->iframes > 0) { entity->iframes = super->iframes; @@ -82,7 +82,7 @@ void GyorgMaleEye_Action1(GyorgMaleEyeEntity* this) { if ((super->frame & ANIM_DONE) != 0) { super->action = 2; super->flags |= 0x80; - super->timer = 0x2d; + super->timer = 45; } } diff --git a/src/enemy/helmasaur.c b/src/enemy/helmasaur.c index dd279482..0e689c45 100644 --- a/src/enemy/helmasaur.c +++ b/src/enemy/helmasaur.c @@ -170,7 +170,7 @@ void sub_0802BDE0(Entity* this) { this->field_0x78.HALF.HI = 0xff; } else { this->action = 1; - this->timer = (Random() & 0xf) + 0xf; + this->timer = (Random() & 0xf) + 15; this->field_0x78.HALF.HI = this->direction; } } @@ -179,7 +179,7 @@ void sub_0802BE18(Entity* this) { UpdateAnimationVariableFrames(this, 2); if (--this->timer == 0) { this->action = 4; - this->timer = 0x1e; + this->timer = 30; this->speed = 0x300; } else { sub_0802C18C(this); @@ -224,8 +224,8 @@ void sub_0802BEBC(Entity* this) { } void sub_0802BEEC(Entity* this) { - if (this->timer) { - if ((--this->timer & 0x1f) == 0) { + if (this->timer != 0) { + if ((--this->timer & 0x1F) == 0) { this->animationState ^= 2; this->direction = this->animationState << 3; InitializeAnimation(this, this->animationState + 4); diff --git a/src/enemy/keaton.c b/src/enemy/keaton.c index c0506f39..d1cbd490 100644 --- a/src/enemy/keaton.c +++ b/src/enemy/keaton.c @@ -23,11 +23,11 @@ static void (*const Keaton_Functions[])(Entity*) = { Keaton_OnTick, Keaton_OnCollision, GenericKnockback, GenericDeath, GenericConfused, Keaton_OnGrabbed, }; -u32 sub_080325E8(Entity* this); +bool32 sub_080325E8(Entity* this); void sub_08032650(Entity* this); void sub_0803269C(Entity* this, u32 direction); void sub_080326FC(Entity* this); -u32 sub_0803271C(Entity* this); +bool32 sub_0803271C(Entity* this); void sub_08032740(Entity* this); void sub_0803275C(Entity* this); void sub_08032784(Entity* this); @@ -52,7 +52,7 @@ void Keaton_OnCollision(Entity* this) { if (this->action != 3 && this->action != 4) { this->action = 3; - this->timer = 0xC; + this->timer = 12; this->direction = DirectionTurnAround(DirectionRoundUp(this->knockbackDirection)); InitAnimationForceUpdate(this, this->direction >> 3); } else if (this->contactFlags == 0xCC) { @@ -78,22 +78,20 @@ void sub_08032468(Entity* this) { } void sub_0803248C(Entity* this) { - if (sub_080325E8(this) == 0) { - if (sub_0803271C(this) == 0) { - this->timer--; - if (this->timer == 0) { - sub_08032650(this); - } - if (ProcessMovement0(this) == 0) { - this->timer = 1; - } - UpdateAnimationSingleFrame(this); + if (!sub_080325E8(this) && !sub_0803271C(this)) { + this->timer--; + if (this->timer == 0) { + sub_08032650(this); } + if (!ProcessMovement0(this)) { + this->timer = 1; + } + UpdateAnimationSingleFrame(this); } } void sub_080324CC(Entity* this) { - if (sub_080325E8(this) == 0) { + if (!sub_080325E8(this)) { UpdateAnimationSingleFrame(this); if (this->frame & ANIM_DONE) { sub_080326FC(this); @@ -106,7 +104,7 @@ void sub_080324FC(Entity* this) { if (this->timer != 0) { this->timer--; if (this->timer == 0) { - this->subtimer = 0x1E; + this->subtimer = 30; this->animationState = this->direction / 8; InitAnimationForceUpdate(this, this->animationState + 4); } else { @@ -149,32 +147,30 @@ void sub_08032574(Entity* this) { void sub_080325C4(Entity* this) { this->timer--; - if ((this->timer == 0) && (sub_080325E8(this) == 0)) { + if ((this->timer == 0) && !sub_080325E8(this)) { sub_08032784(this); } } u32 sub_080325E8(Entity* this) { - if (((sub_08049FA0(this) != 0) && (sub_08049FDC(this, 1) != 0)) && - (EntityInRectRadius(this, gUnk_020000B0, 0x68, 0x40) != 0)) { + if ((sub_08049FA0(this) && sub_08049FDC(this, 1)) && (EntityInRectRadius(this, gUnk_020000B0, 0x68, 0x40) != 0)) { if (((GetFacingDirection(this, gUnk_020000B0) - (DirectionRound(this->frame)) + 2) & 0x1F) < 5) { this->action = 3; - this->timer = 0xC; + this->timer = 12; this->direction = DirectionRound(this->frame); - return 1; + return TRUE; } } - return 0; + return FALSE; } void sub_08032650(Entity* this) { static const u8 gUnk_080CE7E0[] = { 60, 60, 90, 90, 90, 90, 120, 120, 120, 120, 120, 120, 120, 120, 150, 150 }; - u32 uVar3; + u32 rand = Random(); - uVar3 = Random(); - this->timer = gUnk_080CE7E0[uVar3 & 0xf]; - if (!((sub_08049FA0(this) == 0) && ((uVar3 >> 8 & 1) == 0))) { - this->direction = DirectionRound(uVar3 >> 0x10); + this->timer = gUnk_080CE7E0[rand & 0xF]; + if (!((sub_08049FA0(this) == 0) && ((rand >> 8 & 1) == 0))) { + this->direction = DirectionRound(rand >> 0x10); } else { this->direction = DirectionRoundUp(sub_08049EE4(this)); } @@ -205,13 +201,14 @@ void sub_080326FC(Entity* this) { this->field_0x74.HWORD = gUnk_080CE7F0[Random() & 0xF]; } -u32 sub_0803271C(Entity* this) { +bool32 sub_0803271C(Entity* this) { this->field_0x74.HWORD--; if (this->field_0x74.HWORD == 0) { sub_08032784(this); - return 1; + return TRUE; + } else { + return FALSE; } - return 0; } void sub_08032740(Entity* this) { @@ -223,7 +220,7 @@ void sub_08032740(Entity* this) { void sub_0803275C(Entity* this) { this->action = 5; - this->timer = 0x2D; + this->timer = 45; this->speed = 0x80; InitAnimationForceUpdate(this, this->animationState); sub_0803269C(this, this->direction); diff --git a/src/enemy/keese.c b/src/enemy/keese.c index a493142b..0a6b0d1f 100644 --- a/src/enemy/keese.c +++ b/src/enemy/keese.c @@ -5,165 +5,178 @@ * @brief Keese enemy */ +#define NENT_DEPRECATED #include "enemy.h" #include "physics.h" #include "player.h" -extern void GenericKnockback2(Entity*); -extern void Keese_StartFly(Entity*); -extern void sub_08021F24(Entity*); +typedef struct { + /* 0x00 */ Entity base; + /* 0x68 */ u8 filler[0x10]; + /* 0x78 */ u16 flyTimer; + /* 0x7a */ u16 sleepTimer; +} KeeseEntity; -extern void (*const Keese_Functions[])(Entity*); -extern void (*const gKeeseActions[])(Entity*); -extern void (*const gUnk_080CB6C4[])(Entity*); +typedef enum { + /* 0 */ KeeseAnimation_Fly, + /* 1 */ KeeseAnimation_Rest +} KeeseAnimations; -extern const s8 gKeeseSpriteOffsets[]; -extern const u16 gKeeseFlyDurations[]; -extern const u8 gKeeseRestDurations[]; +typedef enum { + /* 0 */ KEESE_ACTION_INITIALIZE, + /* 1 */ KEESE_ACTION_FLY, + /* 2 */ KEESE_ACTION_REST, + /* 3 */ KEESE_ACTION_SLEEP +} KeeseActions; -enum { - KeeseAnimation_Fly, - KeeseAnimation_Rest, +void Keese_OnTick(Entity*); +void Keese_OnCollision(Entity*); +void Keese_OnGrabbed(Entity*); + +void Keese_Initialize(KeeseEntity*); +void Keese_Fly(KeeseEntity*); +void Keese_Rest(KeeseEntity*); +void Keese_Sleep(KeeseEntity*); + +void Keese_StartFly(KeeseEntity*); +void sub_08021F24(KeeseEntity*); + +void sub_08021DCC(KeeseEntity*); +void sub_08021DD4(KeeseEntity*); +void sub_08021DDC(KeeseEntity*); + +void (*const Keese_Functions[])(Entity*) = { + Keese_OnTick, Keese_OnCollision, GenericKnockback2, GenericDeath, GenericConfused, Keese_OnGrabbed, }; -void Keese(Entity* this) { - Keese_Functions[GetNextFunction(this)](this); +void Keese(Entity* thisx) { + + Keese_Functions[GetNextFunction(thisx)](thisx); } -void Keese_OnTick(Entity* this) { - gKeeseActions[this->action](this); +void Keese_OnTick(Entity* thisx) { + static void (*const gKeeseActions[])(KeeseEntity*) = { + Keese_Initialize, + Keese_Fly, + Keese_Rest, + Keese_Sleep, + }; + KeeseEntity* this = (KeeseEntity*)thisx; + + gKeeseActions[super->action](this); } -void Keese_OnCollision(Entity* this) { - EnemyFunctionHandlerAfterCollision(this, Keese_Functions); +void Keese_OnCollision(Entity* thisx) { + EnemyFunctionHandlerAfterCollision(thisx, Keese_Functions); } -void Keese_OnGrabbed(Entity* this) { - if (sub_0806F520(this)) { - gUnk_080CB6C4[this->subAction](this); +void Keese_OnGrabbed(Entity* thisx) { + static void (*const gUnk_080CB6C4[])(KeeseEntity*) = { + sub_08021DCC, + sub_08021DD4, + sub_08021DDC, + }; + KeeseEntity* this = (KeeseEntity*)thisx; + + if (sub_0806F520(super)) { + gUnk_080CB6C4[super->subAction](this); } } -void sub_08021DCC(Entity* this) { - this->subAction = 2; +void sub_08021DCC(KeeseEntity* this) { + super->subAction = 2; } -void sub_08021DD4(Entity* this) { - sub_0806F4E8(this); +void sub_08021DD4(KeeseEntity* this) { + sub_0806F4E8(super); } -void sub_08021DDC(Entity* this) { - if (sub_0806F3E4(this)) { - GenericDeath(this); +void sub_08021DDC(KeeseEntity* this) { + if (sub_0806F3E4(super)) { + GenericDeath(super); } } -void Keese_Initialize(Entity* this) { - sub_0804A720(this); - if (this->type != 0) { - this->spritePriority.b1 = 1; - this->z.HALF.HI = -0x10; +void Keese_Initialize(KeeseEntity* this) { + sub_0804A720(super); + if (super->type != 0) { + super->spritePriority.b1 = 1; + super->z.HALF.HI = -0x10; } - this->direction = Random() & 0x1f; - this->gustJarFlags = 1; - this->spritePriority.b0 = 3; - this->collisionLayer = 3; - UpdateSpriteForCollisionLayer(this); + super->direction = Random() & 0x1F; + super->gustJarFlags = 1; + super->spritePriority.b0 = 3; + super->collisionLayer = 3; + UpdateSpriteForCollisionLayer(super); Keese_StartFly(this); } -void Keese_Fly(Entity* this) { - if (this->field_0x78.HWORD != 0) { - this->field_0x78.HWORD--; +void Keese_Fly(KeeseEntity* this) { + static const s8 gKeeseSpriteOffsets[] = { + 1, -2, -5, -2, 1, 0, + }; + + if (this->flyTimer != 0) { + this->flyTimer--; } - if (this->field_0x7a.HWORD != 0) { - this->field_0x7a.HWORD--; + if (this->sleepTimer != 0) { + this->sleepTimer--; } - GetNextFrame(this); - if (this->frame & ANIM_DONE) { + GetNextFrame(super); + if (super->frame & ANIM_DONE) { sub_08021F24(this); } else { - ProcessMovement1(this); + ProcessMovement1(super); } - this->spriteOffsetY = gKeeseSpriteOffsets[this->frame]; + super->spriteOffsetY = gKeeseSpriteOffsets[super->frame]; } -void Keese_Rest(Entity* this) { - if (--this->timer == 0) { +void Keese_Rest(KeeseEntity* this) { + if (--super->timer == 0) { Keese_StartFly(this); } } -void Keese_Sleep(Entity* this) { - if (this->timer != 0) { - this->timer--; +void Keese_Sleep(KeeseEntity* this) { + if (super->timer != 0) { + super->timer--; } else { - if (EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70)) + if (EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70)) Keese_StartFly(this); } } -void Keese_StartFly(Entity* this) { - this->action = 1; - this->field_0x78.HWORD = gKeeseFlyDurations[Random() & 0xf]; - this->field_0x7a.HWORD = 60; - InitializeAnimation(this, KeeseAnimation_Fly); +void Keese_StartFly(KeeseEntity* this) { + static const u16 gKeeseFlyDurations[] = { + 180, 180, 300, 300, 300, 300, 300, 300, 480, 480, 480, 480, 480, 480, 720, 720, + }; + + super->action = KEESE_ACTION_FLY; + this->flyTimer = gKeeseFlyDurations[Random() & 0xF]; + this->sleepTimer = 60; + InitializeAnimation(super, KeeseAnimation_Fly); } -void sub_08021F24(Entity* this) { - if (this->field_0x78.HWORD == 0) { - this->action = 2; - this->timer = gKeeseRestDurations[Random() & 0xf]; - InitializeAnimation(this, KeeseAnimation_Rest); - } else if (!this->field_0x7a.HWORD && - !(EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70))) { - this->action = 3; - this->timer = 30; - InitializeAnimation(this, KeeseAnimation_Rest); +void sub_08021F24(KeeseEntity* this) { + static const u8 gKeeseRestDurations[] = { + 30, 30, 45, 45, 45, 45, 45, 45, 60, 60, 60, 60, 60, 60, 75, 75, + }; + + if (this->flyTimer == 0) { + super->action = KEESE_ACTION_REST; + super->timer = gKeeseRestDurations[Random() & 0xF]; + InitializeAnimation(super, KeeseAnimation_Rest); + } else if ((this->sleepTimer == 0) && + !(EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70))) { + super->action = KEESE_ACTION_SLEEP; + super->timer = 30; + InitializeAnimation(super, KeeseAnimation_Rest); } else { - if (sub_08049FA0(this) != 0) { - this->direction = Random() & 0x1f; + if (sub_08049FA0(super)) { + super->direction = Random() & 0x1f; } else { - this->direction = sub_08049EE4(this); + super->direction = sub_08049EE4(super); } - InitializeAnimation(this, KeeseAnimation_Fly); + InitializeAnimation(super, KeeseAnimation_Fly); } } - -// clang-format off -void (*const Keese_Functions[])(Entity*) = { - Keese_OnTick, - Keese_OnCollision, - GenericKnockback2, - GenericDeath, - GenericConfused, - Keese_OnGrabbed, -}; - -void (*const gKeeseActions[])(Entity*) = { - Keese_Initialize, - Keese_Fly, - Keese_Rest, - Keese_Sleep, -}; - -void (*const gUnk_080CB6C4[])(Entity*) = { - sub_08021DCC, - sub_08021DD4, - sub_08021DDC, -}; - -const s8 gKeeseSpriteOffsets[] = { - 1, -2, -5, -2, 1, 0, -}; - -const u16 gKeeseFlyDurations[] = { - 180, 180, 300, 300, 300, 300, 300, 300, - 480, 480, 480, 480, 480, 480, 720, 720, -}; - -const u8 gKeeseRestDurations[] = { - 30, 30, 45, 45, 45, 45, 45, 45, - 60, 60, 60, 60, 60, 60, 75, 75, -}; -// clang-format on 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..9fb8e750 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) { @@ -231,7 +231,7 @@ NONMATCH("asm/non_matching/likeLike/sub_0802810C.inc", void sub_0802810C(Entity* END_NONMATCH void sub_080281A0(Entity* this) { - this->subtimer = 0x19; + this->subtimer = 25; if (sub_080281E0(ITEM_MIRROR_SHIELD)) { this->field_0x80.HALF.LO = ITEM_MIRROR_SHIELD; MessageFromTarget(TEXT_INDEX(TEXT_ITEM_GET, 0x78)); diff --git a/src/enemy/madderpillar.c b/src/enemy/madderpillar.c index 65da7b2a..46f0d2ef 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); @@ -471,7 +471,7 @@ void sub_0802A0F8(Entity* this) { } else { this->parent->flags &= ~ENT_COLLIDE; this->parent->health = 0; - this->parent->subtimer = 0x69; + this->parent->subtimer = 105; } } diff --git a/src/enemy/mazaalBracelet.c b/src/enemy/mazaalBracelet.c index 04b242c3..e6cf088c 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,10 +857,10 @@ 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); + InitScreenShake(160, 0); SoundReq(SFX_158); } } @@ -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; @@ -1306,7 +1306,7 @@ void sub_0803B978(Entity* this) { case 1: this->subAction = 2; this->timer = 2; - this->subtimer = 0x1e; + this->subtimer = 30; this->field_0x74.HALF.LO = 0; SoundReq(SFX_1A9); case 2: diff --git a/src/enemy/mazaalHead.c b/src/enemy/mazaalHead.c index 374b3b53..39b500a7 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; @@ -325,7 +325,7 @@ void sub_080342C8(Entity* this) { this->field_0x7c.HALF.HI = 0x708; this->field_0x7c.BYTES.byte1 = 0; this->field_0x80.HALF.HI = 0; - InitScreenShake(0x1e, 0); + InitScreenShake(30, 0); SoundReq(SFX_1A1); } } @@ -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/mazaalMacro.c b/src/enemy/mazaalMacro.c index c672248d..14b71fc7 100644 --- a/src/enemy/mazaalMacro.c +++ b/src/enemy/mazaalMacro.c @@ -202,7 +202,7 @@ void sub_08034F70(Entity* this) { void sub_08034FA0(Entity* this) { if (0 < this->iframes) { this->child->iframes = this->iframes; - InitScreenShake(0xc, 1); + InitScreenShake(12, 1); } switch (this->type2) { case 0: diff --git a/src/enemy/miniSlime.c b/src/enemy/miniSlime.c index 490f4eed..6352e5ee 100644 --- a/src/enemy/miniSlime.c +++ b/src/enemy/miniSlime.c @@ -88,7 +88,7 @@ void sub_080452FC(Entity* this) { this->action = 3; this->timer = 1; if (0 < this->speed) - this->timer = FixedDiv(0x1000, this->speed) >> 0x8; + this->timer = FixedDiv(0x1000, this->speed) >> 8; if (sub_08049FA0(this) == 0 && (Random() & 3)) { cVar2 = sub_08049EE4(this); 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..17c9a495 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) { @@ -234,7 +234,7 @@ void sub_08032F90(MulldozerEntity* this) { void sub_08033000(MulldozerEntity* this) { if (--super->subtimer == 0) { - super->subtimer = 0x10; + super->subtimer = 16; if ((this->unk_82 & 0x80) != 0) { super->direction = (super->direction + 0x18) & 0x1c; this->unk_82 &= 0x7f; @@ -270,7 +270,7 @@ void sub_080330C0(MulldozerEntity* this) { super->action = 2; this->unk_80 = 0; if (super->type == 0) { - super->timer = (Random() & 0x38) + 0x18; + super->timer = (Random() & 0x38) + 24; } else { super->timer = 6; } @@ -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/octorokBoss.c b/src/enemy/octorokBoss.c index f5ffe6d0..0ecc6cd4 100644 --- a/src/enemy/octorokBoss.c +++ b/src/enemy/octorokBoss.c @@ -141,13 +141,13 @@ void OctorokBoss_Hit_SubAction0(OctorokBossEntity* this) { } else { if (IS_FROZEN(this) == FALSE) { super->type2 = 0; - this->timer = 0x3c; + this->timer = 60; } else { if (this->heap->tailCount > 3) { this->heap->tailCount--; } this->heap->tailObjects[0]->currentAttack = 0; - this->timer = 0x78; + this->timer = 120; } super->subAction = 1; } @@ -228,7 +228,7 @@ void OctorokBoss_Hit_SubAction2(OctorokBossEntity* this) { this->heap->tailObjects[0]->currentAttack++; } else { super->subAction = 3; - this->timer = 0x96; + this->timer = 150; gRoomControls.camera_target = &gPlayerEntity; } } @@ -258,7 +258,7 @@ void OctorokBoss_Hit_SubAction4(OctorokBossEntity* this) { void OctorokBoss_Hit_SubAction5(OctorokBossEntity* this) { super->subAction = 6; - this->timer = 0x78; + this->timer = 120; this->unk_80 = 0; this->angularSpeed.HALF.LO = 0; } @@ -343,7 +343,7 @@ void OctorokBoss_Intro_SubAction0(OctorokBossEntity* this) { void OctorokBoss_Intro_SubAction1(OctorokBossEntity* this) { // Rotate Octorok to player if (this->angle.HALF.HI == 0x80) { - this->timer = 0x3c; + this->timer = 60; super->subAction = 2; this->heap->unk_0 = 0; // Octorok scream @@ -358,7 +358,7 @@ void OctorokBoss_Intro_SubAction2(OctorokBossEntity* this) { // Wait for scream end if (this->timer-- == 0) { super->subAction = 3; - this->timer = 0x3c; + this->timer = 60; gPlayerEntity.spriteSettings.draw |= 1; gRoomControls.camera_target = &gPlayerEntity; gRoomControls.unk5 = 1; @@ -372,7 +372,7 @@ void OctorokBoss_Intro_SubAction3(OctorokBossEntity* this) { gPlayerEntity.direction = 0x10; gPlayerEntity.animationState = 4; sub_08078AC0(0x1e, 0, 0); - this->timer = 0x3c; + this->timer = 60; super->subAction = 4; } } @@ -380,7 +380,7 @@ void OctorokBoss_Intro_SubAction3(OctorokBossEntity* this) { void OctorokBoss_Intro_SubAction4(OctorokBossEntity* this) { if (this->timer-- == 0) { super->subAction = 5; - this->timer = 0x2d; + this->timer = 45; // Make the player look towards the exit gPlayerEntity.animationState = 0; } else { @@ -652,9 +652,9 @@ void OctorokBoss_Action1_ChargeAttack(OctorokBossEntity* this) { super->knockbackDuration = 0x20; super->knockbackSpeed = 0x200; super->knockbackDirection = super->direction ^ 0x10; - this->heap->fallingStonesTimer += 0x3c; + this->heap->fallingStonesTimer += 60; OctorokBoss_SetAttackTimer(this); - InitScreenShake(0x3c, 0); + InitScreenShake(60, 0); SoundReq(SFX_158); SoundReq(SFX_14C); } @@ -692,7 +692,7 @@ void OctorokBoss_Action1_Attack_Type2_0(OctorokBossEntity* this) { this->angularSpeed.HWORD = 0x100; super->type2 = 1; if (IS_FROZEN(this) == FALSE) { - this->timer = 0x16; + this->timer = 22; } else { this->timer = 0; } @@ -708,14 +708,14 @@ void OctorokBoss_Action1_Attack_Type2_1(OctorokBossEntity* this) { if (this->currentAttack == ATTACK_VACUUM) { super->type2 = 3; if (IS_FROZEN(this)) { - this->timer = 0x3c; + this->timer = 60; } else { - this->timer = 0x78; + this->timer = 120; } this->heap->targetAngle = this->angle.HALF.HI; } else { super->type2 = 2; - this->timer = 0x2d; + this->timer = 45; } SoundReq(SFX_155); } @@ -731,7 +731,7 @@ void OctorokBoss_Action1_Attack_Type2_2(OctorokBossEntity* this) { super->type2 = 3; this->unk_74 = this->unk_76; if (this->currentAttack != ATTACK_SMOKE) { - this->timer = 0x3c; + this->timer = 60; } else { this->timer = 0; CreateObjectWithParent(super, OCTOROK_BOSS_OBJECT, 4, 0); @@ -813,7 +813,7 @@ void OctorokBoss_ExecuteAttackVacuum(OctorokBossEntity* this) { if (this->unk_80 == 1) { this->unk_80 = 2; super->type2 = 2; - this->timer = 0x2d; + this->timer = 45; this->angularSpeed.HWORD = 0x100; this->heap->field_0x2 = 0; return; @@ -864,7 +864,7 @@ void OctorokBoss_ExecuteAttackSmoke(OctorokBossEntity* this) { if (this->timer == 0xff) { super->type2 = 0; OctorokBoss_SetAttackTimer(this); - this->timer = 0x78; + this->timer = 120; } else { this->timer++; ChangeLightLevel(-1); @@ -915,7 +915,7 @@ void OctorokBoss_Burning_SubAction0(OctorokBossEntity* this) { super->speed = 0x200; super->collisions = COL_NONE; super->direction = (u8)(-this->angle.HALF.HI ^ 0x80U) >> 3; - this->timer = 0x78; + this->timer = 120; this->angularSpeed.HWORD = 0x180; this->heap->unk_0 = 4; sub_080368D8(this); @@ -936,8 +936,8 @@ void OctorokBoss_Burning_SubAction1(OctorokBossEntity* this) { super->knockbackDuration = 0x18; super->knockbackSpeed = 0x200; super->knockbackDirection = super->direction ^ 0x10; - this->heap->fallingStonesTimer += 0x1e; - InitScreenShake(0x1e, 0); + this->heap->fallingStonesTimer += 30; + InitScreenShake(30, 0); SoundReq(SFX_158); SoundReq(SFX_14C); } @@ -1162,7 +1162,7 @@ void OctorokBoss_StartRegularAttack(OctorokBossEntity* this) { if (((Random() & 3) == 0) || ((s16)gRoomVars.lightLevel != 0x100)) { super->subAction = ACTION1_SUBACTION2; super->speed = 0x200; - this->timer = 0x3c; + this->timer = 60; super->collisions = COL_NONE; this->heap->unk_0 = 4; SoundReq(SFX_159); @@ -1217,7 +1217,7 @@ void sub_08036F60(OctorokBossEntity* this) { super->timer = 1; } else { if (this->unk_76 > 0xa4) { - super->timer = 0xff; + super->timer = 255; } } } diff --git a/src/enemy/octorokGolden.c b/src/enemy/octorokGolden.c index e2f7e6cd..8cf3dff4 100644 --- a/src/enemy/octorokGolden.c +++ b/src/enemy/octorokGolden.c @@ -91,7 +91,7 @@ static void sub_08037D54(Entity* this) { } else if (this->frame & ANIM_DONE) { if (--this->timer == 0) { this->action = 1; - this->subtimer = 0x3c; + this->subtimer = 60; this->animationState |= 0xff; sub_08037E14(this); } else { @@ -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..ee374b41 100644 --- a/src/enemy/pesto.c +++ b/src/enemy/pesto.c @@ -159,7 +159,7 @@ void sub_080240B8(Entity* this) { this->field_0x86.HALF.LO = 0; this->field_0x86.HALF.HI = 0; this->timer = 0; - this->subtimer = 0x20; + this->subtimer = 32; this->collisionFlags |= 0x10; this->gustJarFlags = 2; this->direction = direction; @@ -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,13 +757,13 @@ 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; this->direction &= 0x1f; - this->subtimer = 0x10; + this->subtimer = 16; sub_080249DC(this); } } @@ -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/puffstool.c b/src/enemy/puffstool.c index ae2d6bbe..1311fcd7 100644 --- a/src/enemy/puffstool.c +++ b/src/enemy/puffstool.c @@ -69,7 +69,7 @@ void Puffstool_OnCollide(Entity* this) { ChangeObjPalette(this, 0x7c); } this->action = 7; - this->timer = 0x3c; + this->timer = 60; if (0 < this->zVelocity) { this->zVelocity = 0; } @@ -196,7 +196,7 @@ void sub_080252E0(Entity* this) { if (this->x.HALF.HI == (u16)this->field_0x7c.HALF.LO && this->y.HALF.HI == (u16)this->field_0x7c.HALF.HI) { this->action = 3; - this->timer = 0x1e; + this->timer = 30; this->subtimer = 0; this->zVelocity = Q_16_16(1.5); InitializeAnimation(this, 1); @@ -227,7 +227,7 @@ void sub_080253D4(Entity* this) { InitializeAnimation(this, 3); } else { this->action = 6; - this->timer = 0x1e; + this->timer = 30; InitializeAnimation(this, 3); sub_08025A54(this); sub_08025AE8(this); @@ -295,7 +295,7 @@ void sub_08025514(Entity* this) { this->field_0x80.HALF.HI = 120; } else if (3 < this->timer) { this->action = 10; - this->timer = 0x20; + this->timer = 32; } } @@ -378,7 +378,7 @@ void sub_0802563C(Entity* this) { void sub_080256B4(Entity* this) { this->action = 1; this->timer = (Random() & 3) + 4; - this->subtimer = 0x1e; + this->subtimer = 30; this->direction = (this->direction + 7 + ((s32)Random() % 7) * 4) & 0x1c; this->field_0x78.HWORD = gUnk_080CC000[Random() & 0xf]; this->field_0x7a.HALF.LO = ((s32)Random() % 0x18) << 1; diff --git a/src/enemy/rope.c b/src/enemy/rope.c index 88a6e1db..098d4b89 100644 --- a/src/enemy/rope.c +++ b/src/enemy/rope.c @@ -45,7 +45,7 @@ void Rope_OnTick(Entity* this) { void Rope_OnCollision(Entity* this) { if (this->action == 3) { - this->subtimer = 0x1e; + this->subtimer = 30; this->field_0x78.HALF.LO = 0x3c; sub_08031600(this); } @@ -114,7 +114,7 @@ void sub_08031480(Entity* this) { } else { if (GravityUpdate(this, Q_8_8(24.0)) == 0) { this->action = 2; - this->subtimer = 0xf; + this->subtimer = 15; this->spriteSettings.draw = 1; UpdateSpriteForCollisionLayer(this); EnqueueSFX(SFX_WATER_SPLASH); @@ -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..c9e4833f 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; @@ -246,7 +246,7 @@ void sub_080296D8(Entity* this) { gPlayerEntity.spriteOffsetY = 0; gPlayerEntity.speed = 0x140; this->action = 5; - this->subtimer = 0x3c; + this->subtimer = 60; this->flags2 |= 3; if ((s8)this->iframes == 0) { this->iframes = 0xf4; @@ -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..46a39494 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; @@ -112,18 +112,18 @@ void sub_08038A70(ScissorsBeetleEntity* this) { super->action = 3; this->unk_82 = 4; super->speed = 0x80; - super->subtimer = 0x20; + super->subtimer = 32; child->action = 3; ((ScissorsBeetleEntity*)child)->unk_82 = 2; child->animationState = 0xff; sub_08038C84(this, 0); sub_08038C2C((ScissorsBeetleEntity*)child); - child->subtimer = 0x20; + child->subtimer = 32; child->parent = NULL; child->child = super; } else if (--super->subtimer == 0) { u32 dir; - super->subtimer = 0x10; + super->subtimer = 16; super->direction = sub_08049F84(super, 0); dir = (super->direction + 4) & 0x1c; child->animationState = dir >> 2; @@ -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/enemy/smallPesto.c b/src/enemy/smallPesto.c index e75173f2..490da140 100644 --- a/src/enemy/smallPesto.c +++ b/src/enemy/smallPesto.c @@ -87,7 +87,7 @@ void sub_08031704(Entity* this) { void sub_08031714(Entity* this) { sub_080317B4(this); if (--this->subtimer == 0) { - this->subtimer = (Random() & 0xf) + 0x10; + this->subtimer = (Random() & 0xf) + 16; if (sub_08049FA0(this) == 0 && (this->subtimer & 1) != 0) { this->direction = sub_08049EE4(this); } else { @@ -135,7 +135,7 @@ void sub_080317F8(Entity* this) { this->hitbox = (Hitbox*)&gUnk_080CE560; sub_080317E0(this); this->timer = 0; - this->subtimer = 0x20; + this->subtimer = 32; } void sub_08031840(Entity* this) { diff --git a/src/enemy/spark.c b/src/enemy/spark.c index 8eaeac39..26ea7c79 100644 --- a/src/enemy/spark.c +++ b/src/enemy/spark.c @@ -46,7 +46,7 @@ void sub_0802B33C(Entity* this) { sub_0804A720(this); this->action = 1; this->direction = this->type2; - this->subtimer = 0x78; + this->subtimer = 120; InitializeAnimation(this, 0); } @@ -58,13 +58,13 @@ void sub_0802B35C(Entity* this) { is_head = this->type == 0; if (this->collisions == COL_NONE) { if (--this->subtimer == 0) { - this->subtimer = 0x78; + this->subtimer = 120; this->direction += is_head ? 0x08 : 0x18; this->direction = DirectionRound(this->direction); } } else { - this->subtimer = 0x78; + this->subtimer = 120; switch (DirectionRound(this->direction)) { case DirectionNorth: if ((this->collisions & COL_NORTH_ANY) != COL_NONE) { diff --git a/src/enemy/spearMoblin.c b/src/enemy/spearMoblin.c index 1c4a1971..a44ef967 100644 --- a/src/enemy/spearMoblin.c +++ b/src/enemy/spearMoblin.c @@ -87,7 +87,7 @@ void sub_08028314(Entity* this) { if (this->timer) { this->animationState = this->type2 << 1; - this->timer = 0x1e; + this->timer = 30; this->speed = 0x80; this->direction = this->animationState << 2; sub_080287E0(this); @@ -173,7 +173,7 @@ void sub_08028488(Entity* this) { case 2: this->action = 2; this->speed = 0; - this->timer = (Random() & 7) * 3 + 0x40; + this->timer = (Random() & 7) * 3 + 64; break; case 4: this->direction = (this->direction + 0x10) & 0x18; @@ -256,13 +256,13 @@ NONMATCH("asm/non_matching/spearMoblin/sub_08028604.inc", void sub_08028604(Enti uVar1 = gUnk_080CC7C0[Random() & 0xf]; } else { uVar1 = gUnk_080CC7C0[Random() & 7]; - this->timer = this->timer + 0x10; + this->timer = this->timer + 16; this->field_0x82.HALF.HI--; } this->direction = iVar3 + uVar1 + (4U & 0x18); } } else { - this->timer = 0xc; + this->timer = 12; this->speed = 0; } @@ -316,7 +316,7 @@ void sub_08028784(Entity* this) { void sub_080287B4(Entity* this) { this->action = 3; - this->timer = 0x20; + this->timer = 32; this->subtimer = 0; this->field_0x80.HALF.LO = 0; this->field_0x7a.HALF.HI = 0; diff --git a/src/enemy/spikedBeetle.c b/src/enemy/spikedBeetle.c index 2e4884ce..36deab65 100644 --- a/src/enemy/spikedBeetle.c +++ b/src/enemy/spikedBeetle.c @@ -86,13 +86,13 @@ void sub_0802B744(Entity* this) { GetNextFrame(this); if (sub_08049FDC(this, 1) && (direction = sub_0804A024(this, 1, 0xc), direction != 0xff)) { this->action = 3; - this->timer = 0x1e; + this->timer = 30; this->direction = DirectionRound(direction); InitializeAnimation(this, 8); } else { if (--this->timer == 0) { this->action = 2; - this->timer = 0x1e; + this->timer = 30; } else { if (!ProcessMovement0(this)) { this->timer = 1; @@ -121,7 +121,7 @@ void sub_0802B7FC(Entity* this) { GetNextFrame(this); if (--this->timer == 0) { this->action = 4; - this->timer = 0x78; + this->timer = 120; this->speed = 0x1c0; } } @@ -145,7 +145,7 @@ void sub_0802B820(Entity* this) { void sub_0802B880(Entity* this) { if (--this->timer == 0) { this->action = 2; - this->timer = 0x3c; + this->timer = 60; this->animationState = DirectionToAnimationState(this->direction); InitializeAnimation(this, this->animationState); } @@ -156,7 +156,7 @@ void sub_0802B8B0(Entity* this) { switch (sub_080044EC(this, 0x1800)) { case 0: this->action = 7; - this->timer = 0x96; + this->timer = 150; /* fallthrough */ case 1: EnqueueSFX(SFX_12B); @@ -204,7 +204,7 @@ void sub_0802B960(Entity* this) { void sub_0802B9B4(Entity* this) { this->action = 5; - this->timer = 0x3c; + this->timer = 60; this->animationState = (this->direction >> 3) & 3; InitializeAnimation(this, this->animationState + 4); } diff --git a/src/enemy/spinyBeetle.c b/src/enemy/spinyBeetle.c index d1a3e8ca..54de6f62 100644 --- a/src/enemy/spinyBeetle.c +++ b/src/enemy/spinyBeetle.c @@ -51,8 +51,8 @@ void SpinyBeetle_OnCollision(SpinyBeetleEntity* this) { if ((super->contactFlags & 0x3f) == 0x14 && super->action != 5) { super->action = 3; - super->timer = 0x5a; - super->subtimer = 0x10; + super->timer = 90; + super->subtimer = 16; super->spritePriority.b1 = 1; super->direction = DirectionRoundUp(sub_08049F84(super, 1)); sub_08033D78(this); @@ -175,8 +175,8 @@ void sub_08033A7C(SpinyBeetleEntity* this) { return; super->action = 3; - super->timer = 0x78; - super->subtimer = 0x20; + super->timer = 120; + super->subtimer = 32; super->spritePriority.b1 = 1; InitializeAnimation(super, 3); } @@ -197,7 +197,7 @@ void sub_08033ACC(SpinyBeetleEntity* this) { if (--super->timer == 0) { super->action = 4; - super->timer = 0x78; + super->timer = 120; super->x.WORD = (super->x.WORD & 0xfff00000) | 0x80000; super->y.WORD = (super->y.WORD & 0xfff00000) | 0xC0000; this->unk_7c = super->x.WORD; @@ -270,7 +270,7 @@ void sub_08033C94(SpinyBeetleEntity* this) { if (--super->timer) return; this->unk_79 = 2; - super->timer = 0x78; + super->timer = 120; super->spriteOffsetY = 0; super->direction = sub_08049F84(super, 1) + 0x14; @@ -294,7 +294,7 @@ void sub_08033C94(SpinyBeetleEntity* this) { if (--super->timer) return; - super->timer = (Random() & 0x1f) + 0x20; + super->timer = (Random() & 0x1f) + 32; super->direction = sub_08049F84(super, 1) + 0x14; switch (Random() & 3) { case 1: @@ -361,7 +361,7 @@ void sub_08033E1C(SpinyBeetleEntity* this) { super->y.WORD = (super->y.WORD & 0xfff00000) | 0xC0000; super->hitType = 0x19; super->spritePriority.b1 = 1; - super->timer = 0x30; + super->timer = 48; super->subtimer = 0; super->speed = 0x100; super->child = NULL; diff --git a/src/enemy/spinyChuchu.c b/src/enemy/spinyChuchu.c index 9cb2653d..157a9bef 100644 --- a/src/enemy/spinyChuchu.c +++ b/src/enemy/spinyChuchu.c @@ -35,7 +35,7 @@ void SpinyChuchu_OnCollision(Entity* this) { case 2: case 3: this->action = 2; - this->subtimer = 0x3c; + this->subtimer = 60; this->hitType = 0x5c; this->hitbox = (Hitbox*)&gHitbox_23; InitializeAnimation(this, 0); @@ -106,7 +106,7 @@ void sub_080225EC(Entity* this) { InitializeAnimation(this, 0); } else { this->action = 1; - this->subtimer = 0x3c; + this->subtimer = 60; this->spriteSettings.draw = 3; this->spriteRendering.b3 = 1; this->spriteOrientation.flipY = 1; diff --git a/src/enemy/stalfos.c b/src/enemy/stalfos.c index 457d7c59..eb87e265 100644 --- a/src/enemy/stalfos.c +++ b/src/enemy/stalfos.c @@ -176,7 +176,7 @@ void Stalfos_Init(StalfosEntity* this) { void Stalfos_Action1(StalfosEntity* this) { if (GravityUpdate(super, Q_8_8(24.0)) == 0 && sub_08039758(this) == 0 && --this->unk_78 == 0) { super->action = 2; - super->timer = 0xa; + super->timer = 10; sub_08039858(this); } } @@ -215,20 +215,19 @@ void Stalfos_Action5(StalfosEntity* this) { GravityUpdate(super, Q_8_8(24.0)); if (super->zVelocity < 0) { super->action = 6; - super->timer = 0x0f; + super->timer = 15; } } void Stalfos_Action6(StalfosEntity* this) { - u16 tmp; - if (super->timer != 0) { super->timer--; } else { - tmp = super->z.HALF.HI += 4; + u16 tmp = super->z.HALF.HI += 4; + if (-1 < (tmp * 0x10000)) { super->action = 7; - super->timer = 0xa; + super->timer = 10; super->z.HALF.HI = 0; this->unk_7a = 0x78; this->unk_7c = 0x3c; @@ -303,7 +302,7 @@ bool32 sub_08039758(StalfosEntity* this) { } else { if (EntityWithinDistance(super, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI, 0x48)) { super->action = 8; - super->timer = 0x3c; + super->timer = 60; super->direction = GetFacingDirection(super, gUnk_020000B0); InitAnimationForceUpdate(super, super->animationState + 0xc); return TRUE; diff --git a/src/enemy/takkuri.c b/src/enemy/takkuri.c index 41de753b..28a75426 100644 --- a/src/enemy/takkuri.c +++ b/src/enemy/takkuri.c @@ -137,7 +137,7 @@ void sub_0803BD08(TakkuriEntity* this) { if (gUnk_020000B0->y.HALF.HI > super->y.HALF.HI + 8) { super->action = 2; this->unk_0x84 = 0; - super->timer = 0x10; + super->timer = 16; this->unk_0x81 = 2; sub_0803BF2C(this); } @@ -183,7 +183,7 @@ void sub_0803BDD8(TakkuriEntity* this) { COLLISION_ON(super); super->action = 2; this->unk_0x84 = 1; - super->timer = 0x18; + super->timer = 24; this->unk_0x82 = 0x12c; super->speed = 0x12c + 0x94; this->unk_0x81 = 4; @@ -199,7 +199,7 @@ void sub_0803BE7C(TakkuriEntity* this) { super->action = 1; super->spriteSettings.draw = 1; COLLISION_OFF(super); - super->timer = 0x8; + super->timer = 8; super->subtimer = 1; super->direction = sub_08049F84(super, 1); this->unk_0x80 = 0; @@ -246,7 +246,7 @@ void sub_0803BF70(TakkuriEntity* this) { } if (--super->timer == 0) { this->unk_0x84 = 1; - super->timer = 0x18; + super->timer = 24; COLLISION_ON(super); this->unk_0x81 = 2; sub_0803BF2C(this); diff --git a/src/enemy/tektite.c b/src/enemy/tektite.c index 0f490883..04b9769c 100644 --- a/src/enemy/tektite.c +++ b/src/enemy/tektite.c @@ -59,7 +59,7 @@ void Tektite_OnCollision(Entity* this) { this->action = 1; this->subAction = 0; if (this->type != 0) { - this->timer = 0xc0; + this->timer = 192; } else { this->timer = gUnk_080CDEF8[Random() & 3]; } @@ -98,7 +98,7 @@ void sub_0802F210(Entity* this) { this->action = 1; this->subAction = 0; this->timer = gUnk_080CDEF8[Random() & 3]; - this->timer = (Random() & 0x1f) + this->timer; + this->timer += (Random() & 0x1f); this->subtimer = 0; *(u8*)&this->field_0x7c = 0; @@ -120,14 +120,14 @@ void sub_0802F284(Entity* this) { } else if (this->subtimer != 0) { if (this->frame & ANIM_DONE) { this->action = 2; - this->timer = 0x10; + this->timer = 16; this->subtimer = this->type; this->zVelocity = this->field_0x82.HWORD << 4; sub_0802F45C(this); InitializeAnimation(this, 2); } } else if (this->frame & ANIM_DONE) { - this->subtimer = 0x40; + this->subtimer = 64; InitializeAnimation(this, 1); } } @@ -149,7 +149,7 @@ void sub_0802F300(Entity* this) { } if (rand == 0) { - this->timer = 0xc0; + this->timer = 192; } else { this->timer = gUnk_080CDEF8[rand & 3] + rand; } @@ -163,7 +163,7 @@ void sub_0802F300(Entity* this) { } if (--this->timer == 0) { - this->timer = 0x10; + this->timer = 16; if (this->subtimer != 0) { this->subtimer--; sub_0802F45C(this); @@ -191,7 +191,7 @@ void sub_0802F3F4(Entity* this) { if (this->frame & ANIM_DONE) { if ((*(u8*)&this->field_0x7c.HALF.LO < 2) && ((this->type % 2) != 0)) { this->action = 2; - this->timer = 0x10; + this->timer = 16; this->subtimer = this->type; this->zVelocity = this->field_0x82.HWORD << 4; (*(u8*)&this->field_0x7c.HALF.LO)++; diff --git a/src/enemy/tektiteGolden.c b/src/enemy/tektiteGolden.c index 1ea22b88..beaffd3f 100644 --- a/src/enemy/tektiteGolden.c +++ b/src/enemy/tektiteGolden.c @@ -50,7 +50,7 @@ void TektiteGolden_OnCollision(Entity* this) { if (this->contactFlags == 0x94) { this->action = 1; this->subAction = 0; - this->timer = 0x14; + this->timer = 20; this->subtimer = 0; this->field_0x80.HALF.LO = 0; if (this->z.HALF.HI != 0) { @@ -92,7 +92,7 @@ void sub_08037FA0(Entity* this) { sub_0804A720(this); this->action = 1; this->subAction = 0; - this->timer = (Random() & 0x1f) + 0x20; + this->timer = (Random() & 0x1f) + 32; this->subtimer = 0; this->field_0x80.HALF.LO = 0; InitializeAnimation(this, 0); @@ -112,7 +112,7 @@ void sub_08037Fe0(Entity* this) { InitializeAnimation(this, 2); } } else if (this->frame & ANIM_DONE) { - this->subtimer = 0x40; + this->subtimer = 64; InitializeAnimation(this, 1); } } @@ -129,7 +129,7 @@ void sub_08038048(Entity* this) { if (sub_080044EC(this, 0x3000) == 1) { this->action = 3; this->subAction = 0; - this->timer = 0x14; + this->timer = 20; InitializeAnimation(this, 3); return; } else if (this->collisions != COL_NONE) { @@ -139,7 +139,7 @@ void sub_08038048(Entity* this) { } if (--this->timer == 0) { - this->timer = rand + 0x10; + this->timer = rand + 16; sub_08038168(this); } @@ -169,7 +169,7 @@ void sub_08038110(Entity* this) { } else { this->action = 1; this->field_0x80.HALF.LO = 0; - this->timer = 0xc0; + this->timer = 192; InitializeAnimation(this, 0); } } diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c index 912e48cc..264cf441 100644 --- a/src/enemy/vaatiArm.c +++ b/src/enemy/vaatiArm.c @@ -269,7 +269,7 @@ static void sub_08042654(Entity* this) { if ((((VaatiArm_HeapStruct*)this->myHeap)->s1[4].unk0c += 2) < 0x1c) break; this->subAction = 5; - this->timer = 0x5a; + this->timer = 90; ((VaatiArm_HeapStruct*)this->myHeap)->entities[0]->flags |= ENT_COLLIDE; ((VaatiArm_HeapStruct*)this->myHeap)->entities[0]->spritePriority.b0 = 4; ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->flags |= ENT_COLLIDE; @@ -338,7 +338,7 @@ static void sub_080428AC(Entity* this) { pVVar3->unk00.HWORD += pVVar3->unk08; } else { this->subAction = 2; - this->timer = 0x1e; + this->timer = 30; } sub_08043BF0(this); } @@ -383,7 +383,7 @@ static void sub_08042970(Entity* this) { pVVar3->unk00.HWORD += pVVar3->unk08; } else { this->subAction = 5; - this->timer = 0x3c; + this->timer = 60; uVar2 = 0; do { ((VaatiArm_HeapStruct*)this->myHeap)->entities[uVar2]->hitType = 0x39; @@ -451,7 +451,7 @@ static void sub_08042A88(Entity* this) { pVVar4->unk04.HWORD = 0; pVVar4->unk08 = gUnk_080D12CA[this->type2]; this->subAction = 2; - this->timer = 0x1e; + this->timer = 30; } } @@ -506,7 +506,7 @@ static void sub_08042B20(Entity* this) { if (--this->timer == 0) { this->action = 5; this->subAction = 0; - this->timer = 0x1e; + this->timer = 30; this->hitType = 0x39; ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x39; } @@ -529,7 +529,7 @@ static void sub_08042C34(Entity* this) { VaatiArm_HeapStruct1* ptr; if (--this->timer == 0) { - this->timer = 0x3c; + this->timer = 60; this->subtimer = 3; this->subAction = 1; random = Random() & 6; @@ -615,7 +615,7 @@ static void sub_08042D6C(Entity* this) { ((VaatiArm_HeapStruct*)this->myHeap)->s1[0].unk08 = gUnk_080D1300[this->type2]; ((VaatiArm_HeapStruct*)this->myHeap)->s1[0].unk0a = 0xc0; this->subAction = 3; - this->timer = 0x1e; + this->timer = 30; this->hitType = 0x39; this->field_0x7c.BYTES.byte3 = 0x2d; InitAnimationForceUpdate(this, 0); @@ -640,7 +640,7 @@ static void sub_08042E30(Entity* this) { pVVar9 = &((VaatiArm_HeapStruct*)this->myHeap)->s1[0]; if (--this->timer == 0) { this->subAction = 4; - this->timer = (Random() & 0x38) + 0x28; + this->timer = (Random() & 0x38) + 40; this->speed = 0x200; this->direction = pVVar9->unk00.HALF.HI >> 3; uVar6 = CalculateDirectionTo(this->x.HALF.HI, this->y.HALF.HI, gRoomControls.origin_x + 0x110, @@ -674,7 +674,7 @@ static void sub_08042EF4(Entity* this) { if (--this->timer == 0) { if (EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x50)) { this->subAction = 6; - this->timer = 0x28; + this->timer = 40; } else { this->subAction = 5; InitAnimationForceUpdate(this, 0xf); @@ -719,10 +719,10 @@ static void sub_08042FD8(Entity* this) { if (this->frame & ANIM_DONE) { if (--this->subtimer == 0) { this->subAction = 8; - this->timer = 0x3c; + this->timer = 60; } else { this->subAction = 3; - this->timer = 0x3c; + this->timer = 60; InitAnimationForceUpdate(this, 0); } } @@ -767,10 +767,10 @@ static void sub_080430D0(Entity* this) { if (ptr[0].unk04.HALF.HI < 0x18) { if (--this->subtimer == 0) { this->subAction = 8; - this->timer = 0x3c; + this->timer = 60; } else { this->subAction = 3; - this->timer = 0x3c; + this->timer = 60; ptr[0].unk0a = -0xc0; InitAnimationForceUpdate(this, 0); } @@ -813,7 +813,7 @@ static void sub_08043130(Entity* this) { } if (this->spriteSettings.draw == 0) { this->subAction = 9; - this->timer = 0x3c; + this->timer = 60; sub_0804AA1C(this); } } @@ -1007,7 +1007,7 @@ static void sub_08043580(Entity* this) { } if ((this->spriteSettings.draw & 3) == 0) { this->subAction = 5; - this->timer = 0x3c; + this->timer = 60; entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]; entity->collisionFlags = entity->collisionFlags | 0x10; entity->hitType = 0x39; @@ -1050,7 +1050,7 @@ static void sub_08043698(Entity* this) { u32 i; this->subAction = 1; - this->timer = 0x3c; + this->timer = 60; for (i = 0; i < 5; i++) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; entity->flags = entity->flags & ~ENT_COLLIDE; @@ -1059,7 +1059,7 @@ static void sub_08043698(Entity* this) { static inline void deleteThing(Entity* this, const u32 index) { if (--this->timer == 0) { - this->timer = 0x14; + this->timer = 20; this->subAction = index + 1; if (index == 1) { this->spriteSettings.draw = 0; diff --git a/src/enemy/vaatiProjectile.c b/src/enemy/vaatiProjectile.c index 252b7fb2..893b0cb8 100644 --- a/src/enemy/vaatiProjectile.c +++ b/src/enemy/vaatiProjectile.c @@ -156,7 +156,7 @@ void VaatiProjectileFunction0Action3(Entity* this) { if (this->child->frame & ANIM_DONE) { if (--this->z.HALF.HI <= -0x18) { this->action = 4; - this->timer = (Random() & 0xf) + 0xf; + this->timer = (Random() & 0xf) + 15; InitializeAnimation(this->child, 1); } GetNextFrame(this); @@ -180,7 +180,7 @@ void VaatiProjectileFunction0Action5(Entity* this) { return; } this->action = 6; - this->timer = 0x14; + this->timer = 20; } } diff --git a/src/enemy/vaatiRebornEnemy.c b/src/enemy/vaatiRebornEnemy.c index 019963cf..b6a257eb 100644 --- a/src/enemy/vaatiRebornEnemy.c +++ b/src/enemy/vaatiRebornEnemy.c @@ -148,7 +148,7 @@ void VaatiRebornEnemyType0Action1(Entity* this) { if (this->field_0x74.HALF.HI != 0) { this->action = 2; this->field_0x74.HALF.LO = 0; - this->timer = 0x10; + this->timer = 16; this->direction = 0xff; } else { if ((this->field_0x86.HALF.LO != 0) || (this->field_0x80.HALF.LO != 0)) { @@ -164,7 +164,7 @@ void VaatiRebornEnemyType0Action1(Entity* this) { this->action = 3; this->field_0x74.HALF.HI = this->field_0x74.HALF.LO & 0x80; this->field_0x74.HALF.LO = 0; - this->timer = 0xc0; + this->timer = 192; this->direction = 0xff; this->spriteSettings.draw = 1; InitAnimationForceUpdate(this, 0); @@ -175,7 +175,7 @@ void VaatiRebornEnemyType0Action1(Entity* this) { switch (sub_0803DEE0(this)) { case 0: this->action = 4; - this->timer = 0xa0; + this->timer = 160; this->direction = 0xff; this->cutsceneBeh.HALF.LO = 0xff; InitAnimationForceUpdate(this, 1); @@ -189,12 +189,12 @@ void VaatiRebornEnemyType0Action1(Entity* this) { case 3: this->action = 5; this->field_0x74.HALF.LO = 0; - this->subtimer = 0x20; + this->subtimer = 32; this->direction = 0xff; break; case 2: this->field_0x74.HALF.LO = 0; - this->timer = 0x20; + this->timer = 32; if ((this->field_0x86.HALF.LO != 0) || (this->field_0x80.HALF.LO != 0)) { this->direction = ((Random() & 0x80) >> 3) | 8; } else { @@ -229,7 +229,7 @@ void VaatiRebornEnemyType0Action2(Entity* this) { case 0: if (--this->timer == 0) { this->field_0x74.HALF.LO++; - this->timer = 0x20; + this->timer = 32; InitAnimationForceUpdate(this, 3); SoundReq(SFX_19B); } @@ -238,7 +238,7 @@ void VaatiRebornEnemyType0Action2(Entity* this) { if ((this->frame & ANIM_DONE) != 0) { this->field_0x74.HALF.LO = 2; this->spriteSettings.draw = 0; - this->timer = 0x10; + this->timer = 16; } break; case 2: @@ -254,7 +254,7 @@ void VaatiRebornEnemyType0Action2(Entity* this) { this->y.HALF.HI = gRoomControls.origin_y + ptr->HALF.y + 0x10; } this->spriteSettings.draw = 1; - this->timer = 0x20; + this->timer = 32; InitAnimationForceUpdate(this, 4); SoundReq(SFX_F5); } @@ -271,7 +271,7 @@ void VaatiRebornEnemyType0Action2(Entity* this) { this->timer = 1; } else { this->field_0x74.HALF.LO = 0; - this->timer = 0x10; + this->timer = 16; } InitAnimationForceUpdate(this, 0); } @@ -384,7 +384,7 @@ void VaatiRebornEnemyType0Action5(Entity* this) { case 1: if ((this->frame & 0x10) != 0) { this->field_0x74.HALF.LO = 2; - this->subtimer = (Random() & 0x3f) + 0x40; + this->subtimer = (Random() & 0x3f) + 64; SoundReq(SFX_SUMMON); } break; @@ -392,13 +392,13 @@ void VaatiRebornEnemyType0Action5(Entity* this) { if (--this->subtimer == 0) { if (!((this->field_0x86.HALF.LO < 2) || (3 < this->field_0x86.HALF.HI)) && (Random() & 0x10) != 0) { this->field_0x86.HALF.HI++; - this->subtimer = (Random() & 0x3f) + 0x40; + this->subtimer = (Random() & 0x3f) + 64; uVar3 = GetFacingDirection(this, &gPlayerEntity); this->direction = (uVar3 & 0x10) | 8; } else { this->field_0x74.HALF.LO++; this->field_0x86.HALF.HI = 0; - this->subtimer = 0x30; + this->subtimer = 48; InitAnimationForceUpdate(this, 0); } } @@ -432,7 +432,7 @@ void VaatiRebornEnemyType0Action6(Entity* this) { case 0: if (this->timer != 0) { this->field_0x74.HALF.LO = 1; - this->timer = 0x70; + this->timer = 112; } break; case 1: @@ -654,7 +654,7 @@ void VaatiRebornEnemyType1PreAction(Entity* this) { COLLISION_OFF(this); parent->action = 7; parent->flags &= ~ENT_COLLIDE; - parent->timer = 0x80; + parent->timer = 128; parent->spriteOffsetX = 0; parent->direction = -1; this->timer = 0; @@ -667,9 +667,9 @@ void VaatiRebornEnemyType1PreAction(Entity* this) { } if (0 < this->iframes) { SoundReq(SFX_BOSS_HIT); - InitScreenShake(0xc, 1); + InitScreenShake(12, 1); if (this->timer == 0) - this->timer = 0x48; + this->timer = 72; } } if (this->timer != 0) { diff --git a/src/enemy/vaatiTransfigured.c b/src/enemy/vaatiTransfigured.c index c9b59664..23c820bf 100644 --- a/src/enemy/vaatiTransfigured.c +++ b/src/enemy/vaatiTransfigured.c @@ -188,7 +188,7 @@ void VaatiTransfiguredType0Action1(Entity* this) { if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; this->speed = 0x180; - this->timer = 0x14; + this->timer = 20; } break; case 1: @@ -203,7 +203,7 @@ void VaatiTransfiguredType0Action1(Entity* this) { this->field_0x80.HALF.LO += 1; this->speed = 0; if (this->animationState < 2) { - this->timer = (Random() & 0x7f) + 0x40; + this->timer = (Random() & 0x7f) + 64; } else { this->timer = 8; } @@ -269,10 +269,10 @@ void VaatiTransfiguredType0Action3(Entity* this) { if (uVar4 != 1) break; this->field_0x80.HALF.LO = 1; - this->timer = 0xc0; + this->timer = 192; COLLISION_ON(this); SoundReq(SFX_14C); - InitScreenShake(0x14, 4); + InitScreenShake(20, 4); break; case 1: if (--this->timer == 0) { @@ -293,7 +293,7 @@ void VaatiTransfiguredType0Action3(Entity* this) { this->animationState++; if (this->animationState > 2) { this->action = 7; - this->timer = 0xe0; + this->timer = 224; DeleteClones(); SoundReq(SFX_BOSS_HIT); return; @@ -304,10 +304,10 @@ void VaatiTransfiguredType0Action3(Entity* this) { this->child->field_0x74.HALF.LO = 0x10; if (this->timer) { this->field_0x80.HALF.LO = 3; - this->timer = 0x40; + this->timer = 64; } else { this->field_0x80.HALF.LO = 4; - this->timer = 0x50; + this->timer = 80; } break; case 3: @@ -315,19 +315,19 @@ void VaatiTransfiguredType0Action3(Entity* this) { if (--this->timer == 0) { COLLISION_OFF(this); this->zVelocity = Q_16_16(3.5); - this->subtimer = 0x10; + this->subtimer = 16; } break; } if (GravityUpdate(this, Q_8_8(40.0)) == 0) { this->field_0x80.HALF.LO = 5; - this->timer = 0x10; + this->timer = 16; COLLISION_ON(this); this->health = 0xff; this->field_0x86.HALF.LO = 0; sub_080408EC(this); SoundReq(SFX_14C); - InitScreenShake(0x1e, 4); + InitScreenShake(30, 4); } else { if (this->subtimer != 0) { if (--this->subtimer == 0) { @@ -343,7 +343,7 @@ void VaatiTransfiguredType0Action3(Entity* this) { case 4: if (--this->timer == 0) { this->field_0x80.HALF.LO = 5; - this->timer = 0x10; + this->timer = 16; this->field_0x86.HALF.LO = 0; sub_080408EC(this); } else { @@ -378,7 +378,7 @@ void VaatiTransfiguredType0Action4(Entity* this) { if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; this->field_0x74.HALF.LO = 0; - this->timer = 0x80; + this->timer = 128; this->subtimer = 0; this->zVelocity = Q_16_16(2.25); SoundReq(SFX_12B); @@ -405,7 +405,7 @@ void VaatiTransfiguredType0Action4(Entity* this) { this->subtimer = 1; } SoundReq(SFX_14C); - InitScreenShake(0x1e, 4); + InitScreenShake(30, 4); break; case 2: if (--this->timer == 0) { @@ -416,7 +416,7 @@ void VaatiTransfiguredType0Action4(Entity* this) { CreateProjectileWithParent(this, V2_PROJECTILE, this->subtimer); } if (((this->subtimer != 0) && (1 < this->animationState)) && (this->timer < 6)) { - this->timer = 0x80; + this->timer = 128; this->subtimer = 0; } } @@ -445,9 +445,9 @@ void VaatiTransfiguredType0Action5(Entity* this) { case 0: if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; - this->timer = 0x40; + this->timer = 64; if (1 < this->animationState) { - this->timer = 0x80; + this->timer = 128; this->subtimer = 1; } } @@ -462,7 +462,7 @@ void VaatiTransfiguredType0Action5(Entity* this) { CreateProjectileWithParent(this, V2_PROJECTILE, this->subtimer); } if (this->timer < 6) { - this->timer = 0x40; + this->timer = 64; this->subtimer = 0; } } else { @@ -498,7 +498,7 @@ void VaatiTransfiguredType0Action6(Entity* this) { case 0: if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; - this->timer = 0x80; + this->timer = 128; if (1 < this->animationState) { this->subtimer = 1; } @@ -514,7 +514,7 @@ void VaatiTransfiguredType0Action6(Entity* this) { CreateProjectileWithParent(this, V2_PROJECTILE, this->subtimer); } if (this->timer < 6) { - this->timer = 0x80; + this->timer = 128; this->subtimer = 0; } } else { @@ -634,7 +634,7 @@ void VaatiTransfiguredType2Action0(Entity* this) { sub_08040648(this, 2, 2); this->action = 1; this->timer = 0; - this->subtimer = (Random() & 0x7f) + 0x17; + this->subtimer = (Random() & 0x7f) + 23; this->field_0x74.HALF.LO = 0; InitAnimationForceUpdate(this, 0); } @@ -667,7 +667,7 @@ void VaatiTransfiguredType2Action1(Entity* this) { switch (this->field_0x74.HALF.LO) { case 0: if (--this->subtimer == 0) { - this->subtimer = (Random() & 0x7f) + 0x27; + this->subtimer = (Random() & 0x7f) + 39; if ((this->subtimer & 1) != 0) { this->field_0x74.HALF.LO = 1; InitAnimationForceUpdate(this, 8); @@ -677,19 +677,19 @@ void VaatiTransfiguredType2Action1(Entity* this) { case 1: if ((this->frame & ANIM_DONE) != 0) { this->field_0x74.HALF.LO = 0; - this->subtimer = (Random() & 0x7f) + 0x17; + this->subtimer = (Random() & 0x7f) + 23; InitAnimationForceUpdate(this, 0); } break; case 0x10: InitAnimationForceUpdate(this, 7); this->field_0x74.HALF.LO = 0x11; - this->subtimer = 0x50; + this->subtimer = 80; break; case 0x11: if (--this->subtimer == 0) { this->field_0x74.HALF.LO = 1; - this->subtimer = 0x30; + this->subtimer = 48; InitAnimationForceUpdate(this, 8); } } @@ -1075,7 +1075,7 @@ void sub_080409B0(Entity* this) { } } else { if (((this->contactFlags & 0x80) != 0) && (0 < this->iframes)) { - InitScreenShake(0xc, 1); + InitScreenShake(12, 1); SoundReq(SFX_BOSS_HIT); } if ((this->contactFlags == 0x8a) && (gPlayerState.chargeState.action == 5)) { diff --git a/src/enemy/vaatiTransfiguredEye.c b/src/enemy/vaatiTransfiguredEye.c index 04980820..2f6a632e 100644 --- a/src/enemy/vaatiTransfiguredEye.c +++ b/src/enemy/vaatiTransfiguredEye.c @@ -188,7 +188,7 @@ void VaatiTransfiguredEyeFunction0Action4(Entity* this) { sub_08045A28(this); if (this->subtimer == 0) { if ((this->frame & ANIM_DONE) != 0) { - this->subtimer = 0x20; + this->subtimer = 32; } } else { parent = this->parent; diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c index 65c9aaf5..af1851c0 100644 --- a/src/enemy/vaatiWrath.c +++ b/src/enemy/vaatiWrath.c @@ -134,7 +134,7 @@ void VaatiWrathType0Action0(Entity* this) { this->subAction = 1; } else { this->action = 2; - this->timer = 0x3c; + this->timer = 60; } this->x.HALF.HI = gRoomTransition.hurtType; this->y.HALF.HI = gRoomTransition.field_0x42; @@ -185,7 +185,7 @@ void VaatiWrathType0Action1(Entity* this) { return; } this->subAction = 3; - this->timer = 0x3c; + this->timer = 60; } break; case 3: @@ -215,7 +215,7 @@ void VaatiWrathType0Action1(Entity* this) { case 5: sub_08042004(this); this->subAction = 6; - this->timer = 0x1e; + this->timer = 30; gRoomTransition.field_0x38 |= 1; gRoomControls.camera_target = &gPlayerEntity; gPlayerState.controlMode = CONTROL_1; @@ -226,7 +226,7 @@ void VaatiWrathType0Action1(Entity* this) { return; } this->action = 2; - this->timer = 0x3c; + this->timer = 60; break; } } @@ -333,13 +333,13 @@ void VaatiWrathType0Action5(Entity* this) { ((VaatiWrathHeapStruct*)this->myHeap)->object5b = object; gRoomControls.camera_target = object; this->action = 6; - this->timer = 0x1e; + this->timer = 30; ((VaatiWrathHeapStruct*)this->myHeap)->type1->subAction = 1; InitializeAnimation(((VaatiWrathHeapStruct*)this->myHeap)->type1, 0xe); } } else { this->action = 2; - this->timer = 0x3c; + this->timer = 60; } } } @@ -403,7 +403,7 @@ void VaatiWrathType0Action8(Entity* this) { } if (--this->timer == 0) { this->action = 9; - this->timer = 0x3c; + this->timer = 60; } else { if (this->timer < 0x1e) { this->speed -= 0xc; @@ -431,7 +431,7 @@ void VaatiWrathType0Action9(Entity* this) { ((VaatiWrathHeapStruct*)this->myHeap)->eyes[3]->timer = 1; } else { this->action = 7; - this->timer = 0x1e; + this->timer = 30; this->field_0x78.HALF.HI = 0; } } @@ -475,10 +475,10 @@ void VaatiWrathType0ActionB(Entity* this) { GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2); if (GravityUpdate(this, Q_8_8(32.0)) == 0) { this->subAction = 1; - this->timer = 0xf0; + this->timer = 240; this->health = 8; this->hitType = 0x38; - InitScreenShake(0x14, 0); + InitScreenShake(20, 0); InitAnimationForceUpdate(this, 6); InitializeAnimation(((VaatiWrathHeapStruct*)this->myHeap)->type2, 0x16); } @@ -488,7 +488,7 @@ void VaatiWrathType0ActionB(Entity* this) { GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2); if (--this->timer == 0) { this->subAction = 2; - this->timer = 0x3c; + this->timer = 60; this->hitType = 0x39; this->health = 0xff; } @@ -622,7 +622,7 @@ void sub_08041CD0(Entity* this) { this->timer--; } else { this->subAction = 2; - this->timer = 0x3c; + this->timer = 60; MessageFromTarget(TEXT_INDEX(TEXT_VAATI2, 0x51)); } } else { @@ -645,7 +645,7 @@ void sub_08041D14(Entity* this) { pEVar1 = CreateObject(OBJECT_B6, 1, 0); pEVar1->parent = this; this->subAction = 3; - this->timer = 0x96; + this->timer = 150; this->subtimer = 0; this->spriteSettings.draw = 0; SoundReq(SFX_1C4); @@ -685,7 +685,7 @@ void sub_08041E20(Entity* this) { GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2); if (gFadeControl.active == 0) { this->subAction = 5; - this->timer = 0x5a; + this->timer = 90; } } diff --git a/src/enemy/vaatiWrathEye.c b/src/enemy/vaatiWrathEye.c index c5d0a044..3bc64342 100644 --- a/src/enemy/vaatiWrathEye.c +++ b/src/enemy/vaatiWrathEye.c @@ -92,7 +92,7 @@ void VaatiWrathEyeAction3(Entity* this) { this->z.HALF.HI = this->parent->z.HALF.HI; if ((this->x.HALF.HI == x) && (this->y.HALF.HI == y)) { this->action = 4; - this->timer = 0x3c; + this->timer = 60; } } } @@ -118,7 +118,7 @@ void VaatiWrathEyeAction5(Entity* this) { if (this->parent->health >= 0x15) { this->timer = 120; } else { - this->timer = 0x3c; + this->timer = 60; } this->child = NULL; InitializeAnimation(this, 5); @@ -160,7 +160,7 @@ void VaatiWrathEyeAction7(Entity* this) { GetNextFrame(this); if (this->subtimer != 0) { this->action = 8; - this->timer = 0x3c; + this->timer = 60; COLLISION_OFF(this); this->spriteSettings.draw = 0; CreateFx(this, FX_REFLECT2, 0x40); @@ -177,7 +177,7 @@ void VaatiWrathEyeAction7(Entity* this) { void VaatiWrathEyeAction8(Entity* this) { if (this->parent->action == 0xb) { - this->timer = 0x3c; + this->timer = 60; } else { if (--this->timer == 0) { this->action = 9; diff --git a/src/enemy/wallMaster.c b/src/enemy/wallMaster.c index 709f2939..18a1238c 100644 --- a/src/enemy/wallMaster.c +++ b/src/enemy/wallMaster.c @@ -74,7 +74,7 @@ void sub_0802A534(Entity* this) { Entity* ent = sub_08049DF4(1); if (ent != NULL) { this->action = 2; - this->timer = 0x5a; + this->timer = 90; COLLISION_ON(this); this->spriteSettings.draw = 3; this->x.HALF.HI = ent->x.HALF.HI; @@ -115,7 +115,7 @@ void sub_0802A610(Entity* this) { flags = this->frame & ANIM_DONE; if (flags) { this->action = 4; - this->timer = 0x1e; + this->timer = 30; } else if (this->frame & 1) { this->frame = flags; this->hitType = 0x75; @@ -157,7 +157,7 @@ void sub_0802A69C(Entity* this) { flags = this->frame & ANIM_DONE; if (flags) { this->action = 6; - this->timer = 0x1e; + this->timer = 30; } else if (this->frame & 0x1) { this->frame = flags; this->spriteOffsetY = 3; diff --git a/src/enemy/wisp.c b/src/enemy/wisp.c index 95404192..e978415e 100644 --- a/src/enemy/wisp.c +++ b/src/enemy/wisp.c @@ -73,7 +73,7 @@ void Wisp_OnCollision(Entity* this) { ent = CreateFx(this, FX_DEATH, 0); if (ent != NULL) { this->child = ent; - this->timer = 0xe; + this->timer = 14; CopyPosition(this, ent); } DeleteThisEntity(); diff --git a/src/enemy/wizzrobeFire.c b/src/enemy/wizzrobeFire.c index 714f3866..ef83c4f8 100644 --- a/src/enemy/wizzrobeFire.c +++ b/src/enemy/wizzrobeFire.c @@ -40,8 +40,8 @@ void WizzrobeFire_Init(WizzrobeEntity* this) { super->action = 1; this->timer2 = 0xff; this->timer1 = 0x28; - super->timer = 0x28; - super->subtimer = 0x60; + super->timer = 40; + super->subtimer = 96; sub_0802F888(this); projectile = CreateProjectileWithParent(super, FIRE_PROJECTILE, 0); if (projectile != NULL) { @@ -64,8 +64,8 @@ void WizzrobeFire_Action1(WizzrobeEntity* this) { break; case 0: if (--super->timer == 0) { - this->timer2 += 1; - super->timer = 0x0e; + this->timer2++; + super->timer = 14; super->flags |= 0x80; } break; @@ -73,7 +73,7 @@ void WizzrobeFire_Action1(WizzrobeEntity* this) { if (--super->timer == 0) { super->action = 2; this->timer2 = 0; - super->timer = 0x20; + super->timer = 32; tmp = super->direction >> 3; child = super->child; child->timer = 1; @@ -92,8 +92,8 @@ void WizzrobeFire_Action2(WizzrobeEntity* this) { case 0: switch (--super->timer) { case 0: - this->timer2 += 1; - super->timer = 0x38; + this->timer2++; + super->timer = 56; super->subtimer = 0; super->child->spriteSettings.draw = 0; break; @@ -111,7 +111,7 @@ void WizzrobeFire_Action2(WizzrobeEntity* this) { if (--super->timer == 0) { this->timer2++; this->timer1 = 0x28; - super->timer = 0x28; + super->timer = 40; super->subtimer = 0; super->flags &= 0x7f; SetTile(this->tileIndex, this->tilePosition, super->collisionLayer); @@ -123,7 +123,7 @@ void WizzrobeFire_Action2(WizzrobeEntity* this) { case 2: if (--super->timer == 0) { this->timer2++; - super->timer = (Random() & 0x3f) + 0x1c; + super->timer = (Random() & 0x3f) + 28; super->spriteSettings.draw = 0; } break; @@ -132,7 +132,7 @@ void WizzrobeFire_Action2(WizzrobeEntity* this) { super->action = 1; this->timer2 = 0; this->timer1 = 0x28; - super->timer = 0x28; + super->timer = 40; EnqueueSFX(SFX_156); sub_0802F8E4(this); InitializeAnimation(super, super->direction >> 3); diff --git a/src/enemy/wizzrobeIce.c b/src/enemy/wizzrobeIce.c index 78397f59..aade807b 100644 --- a/src/enemy/wizzrobeIce.c +++ b/src/enemy/wizzrobeIce.c @@ -49,8 +49,8 @@ void WizzrobeIce_Init(WizzrobeEntity* this) { super->action = 1; this->timer2 = 0xff; this->timer1 = 0x28; - super->timer = 0x28; - super->subtimer = 0x60; + super->timer = 40; + super->subtimer = 96; sub_0802F888(this); projectile = CreateProjectileWithParent(super, ICE_PROJECTILE, 0); if (projectile != NULL) { @@ -73,7 +73,7 @@ void WizzrobeIce_Action1(WizzrobeEntity* this) { case 0: if (--super->timer == 0) { this->timer2++; - super->timer = 0xc; + super->timer = 12; super->flags |= 0x80; } @@ -82,7 +82,7 @@ void WizzrobeIce_Action1(WizzrobeEntity* this) { if (--super->timer == 0) { super->action = 2; this->timer2 = 0; - super->timer = 0x20; + super->timer = 32; tmp = super->direction >> 3; child = super->child; child->timer = 1; @@ -100,7 +100,7 @@ void WizzrobeIce_Action2(WizzrobeEntity* this) { switch (--super->timer) { case 0: this->timer2 += 1; - super->timer = 0x38; + super->timer = 56; super->subtimer = 0; super->child->spriteSettings.draw = 0; break; @@ -118,7 +118,7 @@ void WizzrobeIce_Action2(WizzrobeEntity* this) { if (--super->timer == 0) { this->timer2++; this->timer1 = 0x28; - super->timer = 0x28; + super->timer = 40; super->subtimer = 0; super->flags &= 0x7f; SetTile(this->tileIndex, this->tilePosition, super->collisionLayer); @@ -129,7 +129,7 @@ void WizzrobeIce_Action2(WizzrobeEntity* this) { case 2: if (--super->timer == 0) { this->timer2++; - super->timer = (Random() & 0x3f) + 0x18; + super->timer = (Random() & 0x3f) + 24; super->spriteSettings.draw = 0; } break; @@ -138,7 +138,7 @@ void WizzrobeIce_Action2(WizzrobeEntity* this) { super->action = 1; this->timer2 = 0; this->timer1 = 0x28; - super->timer = 0x28; + super->timer = 40; EnqueueSFX(SFX_156); sub_0802F8E4(this); InitializeAnimation(super, super->direction >> 3); diff --git a/src/enemy/wizzrobeWind.c b/src/enemy/wizzrobeWind.c index 79fe7f9a..8c157cde 100644 --- a/src/enemy/wizzrobeWind.c +++ b/src/enemy/wizzrobeWind.c @@ -65,8 +65,8 @@ void WizzrobeWind_Init(WizzrobeEntity* this) { super->action = 1; this->timer2 = 0xff; this->timer1 = 0x28; - super->timer = 0x28; - super->subtimer = 0x60; + super->timer = 40; + super->subtimer = 96; sub_0802F888(this); } projectile = CreateProjectileWithParent(super, WIND_PROJECTILE, 0); @@ -90,7 +90,7 @@ void WizzrobeWind_Action1(WizzrobeEntity* this) { case 0: if (--super->timer == 0) { this->timer2++; - super->timer = 0x10; + super->timer = 16; super->flags |= 0x80; } break; @@ -98,7 +98,7 @@ void WizzrobeWind_Action1(WizzrobeEntity* this) { if (--super->timer == 0) { super->action = 2; this->timer2 = 0; - super->timer = 0x28; + super->timer = 40; tmp = super->direction >> 3; parent = super->parent; parent->timer = 1; @@ -116,7 +116,7 @@ void WizzrobeWind_Action2(WizzrobeEntity* this) { switch (--super->timer) { case 0: this->timer2++; - super->timer = 0x38; + super->timer = 56; super->subtimer = 0; super->parent->spriteSettings.draw = 0; break; @@ -134,7 +134,7 @@ void WizzrobeWind_Action2(WizzrobeEntity* this) { if (--super->timer == 0) { this->timer2++; this->timer1 = 0x28; - super->timer = 0x28; + super->timer = 40; super->subtimer = 0; super->flags &= 0x7f; EnqueueSFX(SFX_156); @@ -145,7 +145,7 @@ void WizzrobeWind_Action2(WizzrobeEntity* this) { case 2: if (--super->timer == 0) { this->timer2++; - super->timer = (Random() & 0x3f) + 0x20; + super->timer = (Random() & 0x3f) + 32; super->spriteSettings.draw = 0; } break; @@ -154,7 +154,7 @@ void WizzrobeWind_Action2(WizzrobeEntity* this) { super->action = 1; this->timer2 = 0; this->timer1 = 0x28; - super->timer = 0x28; + super->timer = 40; EnqueueSFX(SFX_156); sub_0802F8E4(this); InitializeAnimation(super, super->direction >> 3); @@ -174,14 +174,14 @@ void WizzrobeWind_Action3(WizzrobeEntity* this) { switch (this->timer2) { case 0: this->timer2 = 1; - super->timer = 0x40; + super->timer = 64; break; case 1: if (--super->timer != 0) { return; } this->timer2++; - super->timer = 0x28; + super->timer = 40; parent->timer = 1; parent->spriteSettings.draw = 1; InitializeAnimation(super, super->animationState >> 1 | 4); @@ -189,7 +189,7 @@ void WizzrobeWind_Action3(WizzrobeEntity* this) { case 2: if (--super->timer == 0) { this->timer2++; - super->timer = (Random() & 0x1f) + 0x30; + super->timer = (Random() & 0x1f) + 48; parent->spriteSettings.draw = 0; InitializeAnimation(super, super->animationState >> 1); } else if (super->timer == 8) { diff --git a/src/enemyUtils.c b/src/enemyUtils.c index 1c2c8484..ae4f3462 100644 --- a/src/enemyUtils.c +++ b/src/enemyUtils.c @@ -130,7 +130,7 @@ void CreateDeathFx(GenericEntity* parent, u32 parentId, u32 fixedItem) { sub_08049CF4(&(parent->base)); gSave.unk50 += 1; parent->base.gustJarState |= 2; - parent->base.timer = 0xff; + parent->base.timer = 255; SetDefaultPriority(&(parent->base), 3); deathFx2 = (DeathFxObject*)CreateObject(DEATH_FX, parent->base.id, 0); if (deathFx2 != NULL) { diff --git a/src/fileselect.c b/src/fileselect.c index aacb57f0..38c66ddc 100644 --- a/src/fileselect.c +++ b/src/fileselect.c @@ -632,7 +632,7 @@ void sub_08050C54(void) { if (column_idx == 0) { SoundReq(SONG_VOL_FADE_OUT); } - gMenu.transitionTimer = 0xf; + gMenu.transitionTimer = 15; SetMenuType(1); SoundReq(SFX_TEXTBOX_SELECT); break; @@ -753,7 +753,7 @@ void sub_08050EB8(void) { gMapDataBottomSpecial.unk4 = save->msg_speed; gMapDataBottomSpecial.unk5 = save->brightness; gMenu.column_idx = 0; - gMenu.transitionTimer = 0xff; + gMenu.transitionTimer = 255; SetMenuType(1); } @@ -836,7 +836,7 @@ END_NONMATCH void sub_08050FFC(void) { switch (HandleSave(0)) { case SAVE_ERROR: - gMenu.transitionTimer = 0x1e; + gMenu.transitionTimer = 30; sub_0805194C(gMapDataBottomSpecial.unk6); CreateDialogBox(9, 0); case SAVE_OK: @@ -908,7 +908,7 @@ void sub_080513C0(void) { case -1: sub_0805194C(gMapDataBottomSpecial.unk6); CreateDialogBox(6, 0); - gMenu.transitionTimer = 0x1e; + gMenu.transitionTimer = 30; gMenu.overlayType = 2; break; } @@ -1121,7 +1121,7 @@ void sub_08051738(void) { gGenericMenu.unk10.a[i] = val; } if (uVar3 == 0) { - gMenu.transitionTimer = 0x3c; + gMenu.transitionTimer = 60; CreateDialogBox(1, 0); SetMenuType(3); } else { @@ -1197,7 +1197,7 @@ void sub_08051874(void) { case -1: sub_0805194C(gMapDataBottomSpecial.unk7); CreateDialogBox(3, 0); - gMenu.transitionTimer = 0x1e; + gMenu.transitionTimer = 30; SetMenuType(3); break; } diff --git a/src/game.c b/src/game.c index d68ffc85..94bf542c 100644 --- a/src/game.c +++ b/src/game.c @@ -830,7 +830,7 @@ static void GameOver_TextMove(void) { static void GameOver_Update(void) { switch (gMenu.menuType) { case 0x0: - gMenu.transitionTimer = 0x1e; + gMenu.transitionTimer = 30; gMenu.field_0x3 = 0; SetMenuType(1); SetPopupState(1, 0); @@ -1792,7 +1792,7 @@ void CutsceneMain_Init(void) { void sub_080535AC(void) { gMenu.overlayType = 1; - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; gUI.field_0x6 = 1; gUpdateVisibleTiles = 1; gScreen.lcd.displayControl &= 0xfeff; @@ -1873,7 +1873,7 @@ void sub_0805373C(void) { void sub_08053758(void) { gMenu.overlayType = 1; - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; gMenu.field_0xa = 0x1e; *((u8*)&gMenu + 0x10) = 0; // TODO gUI.field_0x6 = 1; @@ -1987,7 +1987,7 @@ void sub_080539F4(void) { if (gFadeControl.active == 0) { DispReset(1); gMenu.overlayType++; - gMenu.transitionTimer = 0x3c; + gMenu.transitionTimer = 60; } } @@ -2082,7 +2082,7 @@ void sub_08053C04(void) { void sub_08053C20(void) { gMenu.overlayType = 1; - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; gUpdateVisibleTiles = 1; sub_08051FF0(); sub_0805B4D0(4); @@ -2140,7 +2140,7 @@ void sub_08053D34(void) { } } if (gFadeControl.active == 0) { - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; gMenu.overlayType++; } } @@ -2164,7 +2164,7 @@ void sub_08053DB4(void) { LoadRoomEntityList(*(EntityData**)ptr); LoadRoomEntityList((EntityData*)GetRoomProperty(ptr[4], ptr[5], 1)); LoadRoomEntityList((EntityData*)GetRoomProperty(ptr[4], ptr[5], 2)); - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; gMenu.overlayType++; SetFadeInverted(0x10); } @@ -2184,7 +2184,7 @@ void sub_08053E74(void) { const EntityData** ptr = gUnk_080FCFB8; gMenu.field_0xc = (u8*)ptr; LoadRoomEntityList((EntityData*)ptr[0]); - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; gMenu.field_0xa = 0x3c; gMenu.overlayType++; gScreen.lcd.displayControl &= 0xfeff; @@ -2221,7 +2221,7 @@ void sub_08053F20(void) { gRoomControls.scroll_x = (s8)ptr[10] + gRoomControls.scroll_x; gRoomControls.scroll_y = (s8)ptr[0xb] + gRoomControls.scroll_y; LoadRoomEntityList(*(EntityData**)ptr); - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; gMenu.field_0xa = 0x3c; gMenu.overlayType++; SetFadeInverted(8); diff --git a/src/manager/angryStatueManager.c b/src/manager/angryStatueManager.c index 3cbb2b74..691a8e3a 100644 --- a/src/manager/angryStatueManager.c +++ b/src/manager/angryStatueManager.c @@ -45,14 +45,14 @@ void AngryStatueManager_Init(AngryStatueManager* this) { objectData += 3; } super->action = 1; - super->subtimer = 0x3c; + super->subtimer = 60; this->field_0x36 = 0; } } void AngryStatueManager_Action1(AngryStatueManager* this) { if (--super->subtimer == 0) { - super->subtimer = 0xb4; + super->subtimer = 180; } if (this->field_0x36 == 0xf) { super->action = 2; 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; diff --git a/src/manager/bombableWallManager.c b/src/manager/bombableWallManager.c index 2259411d..52d018bd 100644 --- a/src/manager/bombableWallManager.c +++ b/src/manager/bombableWallManager.c @@ -49,7 +49,7 @@ void BombableWallManager_Init(BombableWallManager* this) { void BombableWallManager_Action1(BombableWallManager* this) { if (sub_080B1AE0(this->tile, this->field_0x35) != 0x2e) { super->action = 2; - super->timer = 0x5a; + super->timer = 90; sub_0805C02C(this); SetLocalFlag(this->field_0x3e); } diff --git a/src/manager/bridgeManager.c b/src/manager/bridgeManager.c index cb37521e..17e91f91 100644 --- a/src/manager/bridgeManager.c +++ b/src/manager/bridgeManager.c @@ -40,7 +40,7 @@ void BridgeManager_Init(BridgeManager* this) { this->unk_2c = gUnk_08108034[tmp]; this->unk_2e = gUnk_08108034[tmp + 1]; this->unk_32 = ((super->type2 >> 2) & 0xF) + 1; - super->timer = 0x1C; + super->timer = 28; super->subtimer = 0; super->action = (super->type2 & 0x80) ? 2 : 1; if (super->action != 2 || !CheckFlags(this->flags)) diff --git a/src/manager/cameraTargetManager.c b/src/manager/cameraTargetManager.c index 909068ba..22347855 100644 --- a/src/manager/cameraTargetManager.c +++ b/src/manager/cameraTargetManager.c @@ -42,7 +42,7 @@ void CameraTargetManager_Action1(CameraTargetManager* this) { super->action = 2; super->timer = this->field_0x35; if (super->timer == 0) { - super->timer = 0x1e; + super->timer = 30; } super->parent = gRoomControls.camera_target; object = CreateObject(OBJECT_69, 0, 0); @@ -51,7 +51,7 @@ void CameraTargetManager_Action1(CameraTargetManager* this) { object->y.HALF.HI = this->field_0x3a + gRoomControls.origin_y; super->child = object; gRoomControls.camera_target = object; - RequestPriorityDuration(object, 0x1e); + RequestPriorityDuration(object, 30); } } } diff --git a/src/manager/enterRoomTextboxManager.c b/src/manager/enterRoomTextboxManager.c index d1a92097..0dcf7c9b 100644 --- a/src/manager/enterRoomTextboxManager.c +++ b/src/manager/enterRoomTextboxManager.c @@ -38,8 +38,8 @@ void sub_0805E140(EnterRoomTextboxManager* this) { super->flags |= ENT_PERSIST; super->action = 1; this->unk_20 = gRoomControls.room; - super->timer = 0x78; - super->subtimer = 0x3c; + super->timer = 120; + super->subtimer = 60; SetDefaultPriority((Entity*)this, PRIO_HIGHEST); sub_0805E1F8(gUnk_08108DE8[gArea.locationIndex], AreaIsDungeon()); } diff --git a/src/manager/floatingPlatformManager.c b/src/manager/floatingPlatformManager.c index f46f5e66..9f42b50e 100644 --- a/src/manager/floatingPlatformManager.c +++ b/src/manager/floatingPlatformManager.c @@ -32,7 +32,7 @@ void FloatingPlatformManager_Init(FloatingPlatformManager* this) { while (*(u8*)entityData != 0xff) { entity = LoadRoomEntity(entityData++); entity->parent = (Entity*)this; - entity->timer = 0xff; + entity->timer = 255; } } diff --git a/src/manager/hyruleTownBellManager.c b/src/manager/hyruleTownBellManager.c index b271053b..b7348c75 100644 --- a/src/manager/hyruleTownBellManager.c +++ b/src/manager/hyruleTownBellManager.c @@ -19,7 +19,7 @@ void HyruleTownBellManager_Main(HyruleTownBellManager* this) { if (super->action == 0) { if (x < 0x20 && y < 0x20 && gPlayerEntity.z.HALF.HI < -0x18 && gPlayerState.framestate == PL_STATE_CAPE) { super->action++; - super->timer = 0x5a; + super->timer = 90; SoundReq(SFX_10A); } } else { diff --git a/src/manager/lightLevelSetManager.c b/src/manager/lightLevelSetManager.c index 8bb54507..c5b9f02d 100644 --- a/src/manager/lightLevelSetManager.c +++ b/src/manager/lightLevelSetManager.c @@ -32,7 +32,7 @@ void LightLevelSetManager_Main(Manager* this) { void LightLevelSetManager_Type0(LightLevelSetManager* this) { if (super->action == 0) { super->action = 1; - super->subtimer = 0x1e; + super->subtimer = 30; if (CheckFlags(this->field_0x3e) != 0) { sub_0805BE94(this); } @@ -47,7 +47,7 @@ void LightLevelSetManager_Type1(LightLevelSetManager* this) { switch (super->action) { case 0: super->action = 1; - super->subtimer = 0x1e; + super->subtimer = 30; if (CheckFlags(this->field_0x3e) != 0) { sub_0805BE70(this, 0x75); super->action = 2; @@ -55,14 +55,14 @@ void LightLevelSetManager_Type1(LightLevelSetManager* this) { break; case 1: if (CheckFlags(this->field_0x3e) != 0 && --super->subtimer == 0) { - super->subtimer = 0x1e; + super->subtimer = 30; sub_0805BEC4(this); sub_0805BE70(this, 0x76); } break; case 2: if (CheckFlags(this->field_0x3e) == 0 && --super->subtimer == 0) { - super->subtimer = 0x1e; + super->subtimer = 30; sub_0805BE70(this, 0x75); } break; diff --git a/src/manager/lightManager.c b/src/manager/lightManager.c index 89617f3e..9aa3df2c 100644 --- a/src/manager/lightManager.c +++ b/src/manager/lightManager.c @@ -62,7 +62,7 @@ void LightManager_Main(LightManager* this) { sub_0801E154(uVar3); this->unk20 = 0; } else if ((gRoomTransition.frameCount & 3) == 0) { - super->subtimer += 0x10; + super->subtimer += 16; sVar1 = gSineTable[super->subtimer]; this->unk20 = sVar1 >> 7; sub_0801E154(uVar3 + this->unk20); diff --git a/src/manager/miscManager.c b/src/manager/miscManager.c index 147dfb06..5d52ad2d 100644 --- a/src/manager/miscManager.c +++ b/src/manager/miscManager.c @@ -155,7 +155,7 @@ void MiscManager_Type1(MiscManager* this) { if (CheckFlags(this->unk_3e)) { super->action = 2; super->timer = 120; - RequestPriorityDuration((Entity*)this, 0xF0); + RequestPriorityDuration((Entity*)this, 240); sub_08059064(this); } break; @@ -245,8 +245,8 @@ void MiscManager_Type5(MiscManager* this) { break; case 1: if (CheckFlags(this->unk_3e)) { - RequestPriorityDuration((Entity*)this, 0x4b); - super->timer = 0x2d; + RequestPriorityDuration((Entity*)this, 75); + super->timer = 45; super->action++; } } diff --git a/src/manager/rainfallManager.c b/src/manager/rainfallManager.c index 2826a2c9..787bafde 100644 --- a/src/manager/rainfallManager.c +++ b/src/manager/rainfallManager.c @@ -33,7 +33,7 @@ void RainfallManager_Action1(RainfallManager* this) { if (--super->timer == 0) { Entity* waterDrop; - super->timer = 0xf; + super->timer = 15; waterDrop = CreateEnemy(WATER_DROP, 0); if (waterDrop != NULL) { waterDrop->x.HALF.HI = gRoomControls.scroll_x + 0x78 + gUnk_08108C6C[Random() & 7]; diff --git a/src/manager/rollingBarrelManager.c b/src/manager/rollingBarrelManager.c index 580734d9..9e2c161f 100644 --- a/src/manager/rollingBarrelManager.c +++ b/src/manager/rollingBarrelManager.c @@ -78,7 +78,7 @@ void sub_080588F8(RollingBarrelManager* this) { case 0xa0: case 0xf0: this->unk_28 = this->unk_24.HALF.HI; - super->subtimer = 0x2D; + super->subtimer = 45; SoundReq(SFX_BARREL_ROLL_STOP); } } diff --git a/src/manager/secretManager.c b/src/manager/secretManager.c index f5b1f281..4a9ba020 100644 --- a/src/manager/secretManager.c +++ b/src/manager/secretManager.c @@ -49,7 +49,7 @@ void SecretManager_Type0_Init(SecretManager* this) { } super->action = 1; if (super->timer == 0) { - super->timer = 0x1e; + super->timer = 30; } SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT); } @@ -91,7 +91,7 @@ void SecretManager_Type1_Init(SecretManager* this) { CheckFlags(this->field_0x3e); super->action = 1; if (super->timer == 0) { - super->timer = 0x1e; + super->timer = 30; } super->subtimer = super->timer; SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT); diff --git a/src/manager/templeOfDropletsManager.c b/src/manager/templeOfDropletsManager.c index 38e0aac4..8377d455 100644 --- a/src/manager/templeOfDropletsManager.c +++ b/src/manager/templeOfDropletsManager.c @@ -406,7 +406,7 @@ void sub_0805A89C(TempleOfDropletsManager* this) { super->action = 1; super->flags |= ENT_PERSIST; super->timer = 8; - super->subtimer = 0x10; + super->subtimer = 16; this->unk_21 = 0; this->unk_22 = 0; this->unk_20 = gRoomControls.room; @@ -498,7 +498,7 @@ void sub_0805AA58(TempleOfDropletsManager* this) { LoadPalettes(gUnk_085A97A0[this->unk_21].unk_00, 5, 1); } if (--super->subtimer == 0) { - super->subtimer = 0x10; + super->subtimer = 16; this->unk_22 += 1; this->unk_22 &= 0xF; gScreen.controls.alphaBlend = gUnk_081085B8[this->unk_22]; diff --git a/src/manager/tileChangeObserveManager.c b/src/manager/tileChangeObserveManager.c index 5e5e805d..f2ada610 100644 --- a/src/manager/tileChangeObserveManager.c +++ b/src/manager/tileChangeObserveManager.c @@ -40,7 +40,7 @@ void TileChangeObserveManager_Init(TileChangeObserveManager* this) { void TileChangeObserveManager_Action1(TileChangeObserveManager* this) { if (this->initialTile != this->observedTile[0]) { super->action++; - super->timer = 0xf; + super->timer = 15; } } diff --git a/src/manager/tilePuzzleManager.c b/src/manager/tilePuzzleManager.c index 575c350e..a229878f 100644 --- a/src/manager/tilePuzzleManager.c +++ b/src/manager/tilePuzzleManager.c @@ -45,7 +45,7 @@ void TilePuzzleManager_Main(TilePuzzleManager* this) { if (--super->timer == 0) { super->action = SUCCEEDED; // set up delay for setting the flag/playing the success sfx - super->timer = 0x40; + super->timer = 64; } break; } diff --git a/src/manager/vaati3InsideArmManager.c b/src/manager/vaati3InsideArmManager.c index abd3e474..9b47589c 100644 --- a/src/manager/vaati3InsideArmManager.c +++ b/src/manager/vaati3InsideArmManager.c @@ -47,11 +47,11 @@ void sub_0805DBF0(Vaati3InsideArmManager* this) { sub_0805DC70(); } else { if (this->field_0x20 == 0x78) { - InitScreenShake(0x78, 2); + InitScreenShake(120, 2); } else if (this->field_0x20 == 0xd2) { - InitScreenShake(0x5a, 1); + InitScreenShake(90, 1); } else if (this->field_0x20 == 0x12c) { - InitScreenShake(0x5a, 0); + InitScreenShake(90, 0); } if (this->field_0x20 < 0x78) { diff --git a/src/manager/vaati3StartManager.c b/src/manager/vaati3StartManager.c index c0d4124e..9a5f5290 100644 --- a/src/manager/vaati3StartManager.c +++ b/src/manager/vaati3StartManager.c @@ -69,7 +69,7 @@ void Vaati3StartManager_Type0_Action1(Vaati3StartManager* this) { if (distX * distX + distY * distY < 0x901) { super->action = 2; super->subAction = 0; - super->timer = 0x78; + super->timer = 120; SetPlayerControl(2); sub_08078B48(); object = CreateObject(OBJECT_64, 0, 0); @@ -94,7 +94,7 @@ void Vaati3StartManager_Type0_Action2(Vaati3StartManager* this) { } else { if (--super->timer == 0) { super->action = 3; - super->timer = 0x1e; + super->timer = 30; MessageFromTarget(TEXT_INDEX(TEXT_VAATI2, 0x4f)); } } diff --git a/src/manager/vaatiAppearingManager.c b/src/manager/vaatiAppearingManager.c index 5db57799..6fc89add 100644 --- a/src/manager/vaatiAppearingManager.c +++ b/src/manager/vaatiAppearingManager.c @@ -83,7 +83,7 @@ void VaatiAppearingManager_Action1(VaatiAppearingManager* this) { case 1: if (--this->field_0x20 == 0x10) { super->subAction = 2; - super->timer = 0x2d; + super->timer = 45; } break; case 2: @@ -94,7 +94,7 @@ void VaatiAppearingManager_Action1(VaatiAppearingManager* this) { case 3: if (--this->field_0x20 == 0) { super->subAction = 4; - super->timer = 0x3c; + super->timer = 60; } break; default: @@ -110,14 +110,14 @@ void VaatiAppearingManager_Action2(VaatiAppearingManager* this) { switch (super->subAction) { case 0: super->subAction = 1; - super->timer = 0x2d; + super->timer = 45; this->field_0x20 = 1; gScreen.lcd.displayControl |= DISPCNT_BG3_ON; break; case 1: if (--super->timer == 0) { super->subAction = 2; - super->timer = 0x14; + super->timer = 20; } break; case 2: diff --git a/src/menu/kinstone_menu.c b/src/menu/kinstone_menu.c index c9815810..814c1b39 100644 --- a/src/menu/kinstone_menu.c +++ b/src/menu/kinstone_menu.c @@ -255,7 +255,7 @@ void KinstoneMenu_Type3_Overlay1(void) { SetMenuType(4); } else { gMenu.overlayType = 2; - gMenu.transitionTimer = 0x14; + gMenu.transitionTimer = 20; gScreen.lcd.displayControl |= 0x2000; gScreen.controls.window0HorizontalDimensions = 0x6887; gScreen.controls.window0VerticalDimensions = 0x405f; @@ -313,7 +313,7 @@ void KinstoneMenu_Type5_Overlay0(void) { SoundReq(SFX_TASK_COMPLETE); MessageAtHeight(TEXT_INDEX(TEXT_WINDCRESTS, 0x2), 0xe); gMenu.overlayType = 1; - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; } void KinstoneMenu_Type5_Overlay1(void) { @@ -331,7 +331,7 @@ void KinstoneMenu_Type5_Overlay2(void) { } else { gMenu.column_idx = 6; gMenu.overlayType = 3; - gMenu.transitionTimer = 0x4f; + gMenu.transitionTimer = 79; CreateObject(OBJECT_B3, 1, 0); SoundReq(SFX_1CA); } diff --git a/src/npc/bigGoron.c b/src/npc/bigGoron.c index d7c41850..cd3e1cae 100644 --- a/src/npc/bigGoron.c +++ b/src/npc/bigGoron.c @@ -182,7 +182,7 @@ void sub_0806D1D0(Entity* this) { this->spritePriority.b0 = 7; this->spriteSettings.draw = 3; this->frameIndex = 0; - this->timer = 0x1e; + this->timer = 30; SetDefaultPriority(this, PRIO_MESSAGE); } @@ -190,7 +190,7 @@ void sub_0806D1D0(Entity* this) { case 0: default: if (--this->timer == 0) { - this->timer = (Random() & 0x7f) + 0x30; + this->timer = (Random() & 0x7f) + 48; this->subtimer = 8; this->frameIndex = 1; } diff --git a/src/npc/bladeBrothers.c b/src/npc/bladeBrothers.c index eb73c163..c9f597c0 100644 --- a/src/npc/bladeBrothers.c +++ b/src/npc/bladeBrothers.c @@ -75,7 +75,7 @@ void sub_08068A4C(Entity* this) { uVar1 = 2; } else { if (this->subtimer == 0) { - this->subtimer = 0x10; + this->subtimer = 16; } else { this->subtimer--; uVar1 = (u32)this->animIndex; diff --git a/src/npc/carlov.c b/src/npc/carlov.c index 6267b19b..dd29130f 100644 --- a/src/npc/carlov.c +++ b/src/npc/carlov.c @@ -13,7 +13,7 @@ void Carlov(Entity* this) { if ((this->frame & 0x10) != 0) { this->frame = this->frame & 0xef; EnqueueSFX(SFX_PLACE_OBJ); - InitScreenShake(0x10, 0); + InitScreenShake(16, 0); } if ((this->frame & 0x20) != 0) { this->frame = this->frame & 0xdf; diff --git a/src/npc/castorWildsStatue.c b/src/npc/castorWildsStatue.c index 2b631ec0..351d174a 100644 --- a/src/npc/castorWildsStatue.c +++ b/src/npc/castorWildsStatue.c @@ -109,7 +109,7 @@ void sub_08067534(Entity* this) { } } EnqueueSFX(SFX_14C); - InitScreenShake(0x28, 4); + InitScreenShake(40, 4); } void sub_0806757C(Entity* this) { diff --git a/src/npc/cat.c b/src/npc/cat.c index 541721c8..92154bbb 100644 --- a/src/npc/cat.c +++ b/src/npc/cat.c @@ -229,7 +229,7 @@ void sub_08067A0C(Entity* this) { if (this->frame & ANIM_DONE) { if (sub_08067D20(this) != 0) { sub_08067B80(this, 5); - this->timer = this->timer + 0x14; + this->timer += 20; } else { sub_08067C24(this); } @@ -303,7 +303,7 @@ void sub_08067B70(Entity* this) { void sub_08067B80(Entity* this, u32 param) { this->action = 5; - this->timer = 0x14; + this->timer = 20; this->field_0x74.HALF.LO = (Random() & 0x7f) + 0x1e; InitAnimationForceUpdate(this, param); sub_08067DDC(this); diff --git a/src/npc/cow.c b/src/npc/cow.c index d867d0ed..99f5514a 100644 --- a/src/npc/cow.c +++ b/src/npc/cow.c @@ -91,7 +91,7 @@ void sub_08069068(Entity* ent) { ent->animationState = anim; ent->direction = anim <<= 3; - ent->subtimer = (Random() & 0x3F) + 0x3C; + ent->subtimer = (Random() & 0x3F) + 60; InitAnimationForceUpdate(ent, ent->animationState + 4); } diff --git a/src/npc/cucco.c b/src/npc/cucco.c index 8a7110d8..173b183a 100644 --- a/src/npc/cucco.c +++ b/src/npc/cucco.c @@ -25,7 +25,7 @@ void Cucco_Init(Entity* this) { void sub_0806E4EC(Entity* this) { if (this->subAction == 0) { this->subAction += 1; - this->timer = (Random() & 0x1f) + 0x3c; + this->timer = (Random() & 0x1f) + 60; InitAnimationForceUpdate(this, 0); } if (--this->timer == 0) { diff --git a/src/npc/cuccoChick.c b/src/npc/cuccoChick.c index ffabb4dc..7947a99f 100644 --- a/src/npc/cuccoChick.c +++ b/src/npc/cuccoChick.c @@ -33,7 +33,7 @@ void CuccoChick_Init(Entity* this) { void sub_0806E764(Entity* this) { if (this->subAction == 0) { this->subAction += 1; - this->timer = (Random() & 0x1f) + 0x1e; + this->timer = (Random() & 0x1f) + 30; this->frameIndex = 0; } if (--this->timer == 0) { diff --git a/src/npc/dog.c b/src/npc/dog.c index 0b19a81c..af62571a 100644 --- a/src/npc/dog.c +++ b/src/npc/dog.c @@ -58,7 +58,7 @@ void sub_08069B44(Entity* this) { this->field_0x70.HALF.LO = uVar2 - 8; this->field_0x70.HALF.HI = uVar2 + 8; this->speed = 0x100; - this->timer = 0x1e; + this->timer = 30; this->animationState = 2; this->field_0x6a.HALF.LO = 0xff; this->field_0x74.HALF.LO = sub_0801E99C(this); @@ -90,12 +90,12 @@ void sub_08069C40(Entity* this) { this->animationState = GetAnimationState(this); sub_08069D00(this); } - this->timer = 0x1e; + this->timer = 30; } else { this->timer -= 1; if (this->timer == 0) { this->action = 2; - this->timer = (Random() & 0x1f) + 0x1e; + this->timer = (Random() & 0x1f) + 30; this->direction = gUnk_08111DA8[Random() & 7]; sub_08069F6C(this); } @@ -166,7 +166,7 @@ void sub_08069D54(Entity* this) { } else { this->action = 3; } - this->timer = (Random() & 0x1f) + 0x1e; + this->timer = (Random() & 0x1f) + 30; } void sub_08069DF8(Entity* this) { @@ -185,7 +185,7 @@ void sub_08069DF8(Entity* this) { this->action = 3; } } - this->timer = (Random() & 0x1f) + 0x1e; + this->timer = (Random() & 0x1f) + 30; } void sub_08069E44(Entity* this) { diff --git a/src/npc/ghostBrothers.c b/src/npc/ghostBrothers.c index 5c385f86..15d11888 100644 --- a/src/npc/ghostBrothers.c +++ b/src/npc/ghostBrothers.c @@ -103,7 +103,7 @@ void sub_08065C0C(Entity* this) { void sub_08065CCC(Entity* this) { this->action = 3; - this->timer = 0x1e; + this->timer = 30; this->spriteRendering.alphaBlend = 1; *(const u16**)&this->field_0x6c = gUnk_0811022E; gScreen.controls.layerFXControl = 0x3f40; @@ -117,7 +117,7 @@ void sub_08065D00(Entity* this) { void sub_08065D18(Entity* this) { this->action = 1; - this->timer = 0x1e; + this->timer = 30; this->subtimer = 0; this->spriteSettings.draw = 1; this->spriteRendering.alphaBlend = 1; @@ -150,7 +150,7 @@ void sub_08065DB8(Entity* this) { case 0: { if ((gMessage.doTextBox & 0x7f) == 0) { this->subAction++; - this->timer = 0x3c; + this->timer = 60; InitAnimationForceUpdate(this, 4); } break; @@ -158,7 +158,7 @@ void sub_08065DB8(Entity* this) { case 1: { if (--this->timer == 0) { this->subAction++; - this->timer = 0xb4; + this->timer = 180; gUnk_02018EB0.unk_1++; InitAnimationForceUpdate(this, 2); } @@ -176,7 +176,7 @@ void sub_08065DB8(Entity* this) { case 4: { if ((gMessage.doTextBox & 0x7f) == 0) { this->subAction++; - this->timer = 0x1e; + this->timer = 30; *(const u16**)&this->field_0x6c = gUnk_0811022E; } break; diff --git a/src/npc/gorman.c b/src/npc/gorman.c index cbac8031..fbeb916d 100644 --- a/src/npc/gorman.c +++ b/src/npc/gorman.c @@ -53,7 +53,7 @@ void sub_080697EC(Entity* this) { tmp = GetAnimationStateInRectRadius(this, 0x20, 0x20); if (tmp >= 0) { if (this->subtimer == 0) { - this->subtimer = 0x10; + this->subtimer = 16; if (this->animIndex != tmp) { InitializeAnimation(this, tmp); } diff --git a/src/npc/guard.c b/src/npc/guard.c index 56327f3d..fe0fcb7b 100644 --- a/src/npc/guard.c +++ b/src/npc/guard.c @@ -61,7 +61,7 @@ void sub_08063D44(Entity* this) { case 0 ... 3: ent = CreateProjectile(GUARD_LINE_OF_SIGHT); ent->parent = this; - ent->subtimer = 0x3c; + ent->subtimer = 60; break; case 4 ... 5: sub_08078778(this); @@ -75,7 +75,7 @@ void sub_08063D44(Entity* this) { void sub_08063DC8(Entity* this) { if (this->type == 0xff) { this->action = 2; - this->timer = 0x1e; + this->timer = 30; this->animationState = sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)); InitAnimationForceUpdate(this, this->animationState + 4); } else { diff --git a/src/npc/kid.c b/src/npc/kid.c index 19e02519..e546f3c8 100644 --- a/src/npc/kid.c +++ b/src/npc/kid.c @@ -53,7 +53,7 @@ void sub_08062130(Entity* this) { this->subtimer = 0; this->timer = (this->timer + 1) & 7; if (this->type == 6) { - this->timer = this->timer + 0x10; + this->timer = this->timer + 16; } InitAnimationForceUpdate(this, this->timer); } else { @@ -213,7 +213,7 @@ void sub_08062698(Entity* this) { } void sub_080626AC(Entity* this) { - this->timer = (Random() & 0x1f) + 0x40; + this->timer = (Random() & 0x1f) + 64; } void sub_080626C0(Entity* this, ScriptExecutionContext* context) { diff --git a/src/npc/kingDaltus.c b/src/npc/kingDaltus.c index 647c535d..bb7c4743 100644 --- a/src/npc/kingDaltus.c +++ b/src/npc/kingDaltus.c @@ -50,7 +50,7 @@ void sub_08066688(Entity* this) { tmp = 2; } else { if (this->subtimer == 0) { - this->subtimer = 0x10; + this->subtimer = 16; } else { this->subtimer -= 1; tmp = this->animIndex; diff --git a/src/npc/melari.c b/src/npc/melari.c index e08032d0..73b86a1a 100644 --- a/src/npc/melari.c +++ b/src/npc/melari.c @@ -39,7 +39,7 @@ void sub_08068730(Entity* this) { animIndex = GetAnimationStateInRectRadius(this, 0x20, 0x20); if (-1 < animIndex) { if (this->subtimer == 0) { - this->subtimer = 0x10; + this->subtimer = 16; if (this->animIndex != animIndex) { InitializeAnimation(this, animIndex); } @@ -129,7 +129,7 @@ void sub_08068910(Entity* this) { if (this->timer != 0) { this->timer--; } else { - this->timer = 0x10; + this->timer = 16; if ((this->frame & 0x20) != 0) { iVar1 = GetFacingDirectionInRectRadius(this, 0x30, 0x30); if (iVar1 < 0) { diff --git a/src/npc/ministerPotho.c b/src/npc/ministerPotho.c index 1cdd7a18..d746dbaf 100644 --- a/src/npc/ministerPotho.c +++ b/src/npc/ministerPotho.c @@ -36,7 +36,7 @@ void sub_08066808(Entity* this) { tmp = 2; } else { if (this->subtimer == 0) { - this->subtimer = 0x10; + this->subtimer = 16; } else { this->subtimer -= 1; tmp = this->animIndex; diff --git a/src/npc/mountainMinish.c b/src/npc/mountainMinish.c index 4c93569c..4901ae30 100644 --- a/src/npc/mountainMinish.c +++ b/src/npc/mountainMinish.c @@ -70,7 +70,7 @@ void sub_08067E88(Entity* this) { tmp = 2; } else { if (this->subtimer == 0) { - this->subtimer = 0x10; + this->subtimer = 16; } else { this->subtimer = this->subtimer - 1; tmp = this->animIndex; diff --git a/src/npc/npc26.c b/src/npc/npc26.c index 99e58286..a9c19cf2 100644 --- a/src/npc/npc26.c +++ b/src/npc/npc26.c @@ -30,7 +30,7 @@ static void sub_080669DC(Entity* this) { sVar1 = 2; } else { if (this->subtimer == 0) { - this->subtimer = 0x10; + this->subtimer = 16; } else { this->subtimer = this->subtimer - 1; sVar1 = this->animIndex; diff --git a/src/npc/npc5.c b/src/npc/npc5.c index ecfc685f..8c9948fd 100644 --- a/src/npc/npc5.c +++ b/src/npc/npc5.c @@ -553,7 +553,7 @@ void sub_08061358(Entity* this) { return; } this->subAction = 1; - this->timer = 0xf; + this->timer = 15; sub_08060E70(this, 0); break; case 1: @@ -565,7 +565,7 @@ void sub_08061358(Entity* this) { bVar4 = uVar2; if ((uVar2 & 1) == 0) { this->subAction = 3; - this->timer = (bVar4 & 0x18) + 0x1e; + this->timer = (bVar4 & 0x18) + 30; sub_08060E70(this, 4); return; } @@ -580,7 +580,7 @@ void sub_08061358(Entity* this) { this->animationState = ((this->frame & 0x18) >> 2); if ((Random() & 1)) { this->subAction = 3; - this->timer = (bVar4 & 0x18) + 0x1e; + this->timer = (bVar4 & 0x18) + 30; sub_08060E70(this, 4); return; } diff --git a/src/npc/picolyteBottle.c b/src/npc/picolyteBottle.c index 552da6fc..24cd8acf 100644 --- a/src/npc/picolyteBottle.c +++ b/src/npc/picolyteBottle.c @@ -77,7 +77,7 @@ void PicolyteBottle_Action1(PicolyteBottleEntity* this) { } this->ent1->timer++; this->ent2->timer++; - super->timer = 0xff; + super->timer = 255; SetRoomFlag(0); } } @@ -117,7 +117,7 @@ void sub_0806E014(PicolyteBottleEntity* this) { uVar1 = (Random() & 0x70) >> 4; super->type2 = 0xff; - super->timer = 0xff; + super->timer = 255; if (CheckLocalFlag(0x93) == 0) { super->damage = 0; iVar2 = uVar1 * 2; @@ -126,7 +126,7 @@ void sub_0806E014(PicolyteBottleEntity* this) { PositionRelative(super, this->ent1, 0x480000, 0x480000); this->ent2->subtimer = ptr[1]; PositionRelative(super, this->ent2, 0x680000, 0x480000); - this->ent3->subtimer = 0xff; + this->ent3->subtimer = 255; CopyPosition(super, this->ent3); } else { super->damage = 1; diff --git a/src/npc/postman.c b/src/npc/postman.c index 5b5946be..fd33d519 100644 --- a/src/npc/postman.c +++ b/src/npc/postman.c @@ -33,7 +33,7 @@ void Postman(Entity* this) { void sub_08060428(Entity* this) { void* data; - this->timer = 0x5a; + this->timer = 90; this->speed = 0x180; if (this->type2 != 0) { data = GetCurrentRoomProperty(this->type2); diff --git a/src/npc/rem.c b/src/npc/rem.c index 9e3d238a..bd1bc6a4 100644 --- a/src/npc/rem.c +++ b/src/npc/rem.c @@ -57,7 +57,7 @@ void sub_0806a370(Entity* this) { void sub_0806A3D8(Entity* this) { this->action = 1; - this->timer = 0xb4; + this->timer = 180; SetDefaultPriority(this, PRIO_MESSAGE); sub_0806A8C8(this); *(ScriptExecutionContext**)&this->cutsceneBeh = StartCutscene(this, &script_Rem); @@ -98,7 +98,7 @@ void sub_0806A458(Entity* this) { if (((this->frame & ANIM_DONE) != 0)) { this->action = 1; this->subAction = 0; - this->timer = 0x3c; + this->timer = 60; InitializeAnimation(this, 2); } break; @@ -126,7 +126,7 @@ void sub_0806A4CC(Entity* this) { } break; default: - this->timer = 0xb4; + this->timer = 180; break; } } @@ -166,11 +166,11 @@ void sub_0806A5E8(Entity* this) { if (this->action == 0) { this->action = 1; InitializeAnimation(this, 0x10); - this->timer = (Random() & 0x3f) + 0x3c; + this->timer = (Random() & 0x3f) + 60; } this->timer -= 1; if (this->timer == 0) { - this->timer = (Random() & 0x3f) + 0x78; + this->timer = (Random() & 0x3f) + 120; SoundReq(SFX_REM_SLEEP); } GetNextFrame(this); diff --git a/src/npc/smith.c b/src/npc/smith.c index f0de3132..0ff8ef31 100644 --- a/src/npc/smith.c +++ b/src/npc/smith.c @@ -86,7 +86,7 @@ void sub_08066118(Entity* this) { uVar1 = 2; } else { if (this->subtimer == 0) { - this->subtimer = 0x10; + this->subtimer = 16; } else { --this->subtimer; uVar1 = this->animIndex; diff --git a/src/npc/stockwell.c b/src/npc/stockwell.c index f7fec8f2..3c81cfd3 100644 --- a/src/npc/stockwell.c +++ b/src/npc/stockwell.c @@ -113,7 +113,7 @@ void sub_080651D8(Entity* this) { void sub_080651F8(Entity* this) { if ((this->frame & 0x20) == 0) { this->subAction = 1; - this->timer = 0x3c; + this->timer = 60; InitializeAnimation(this, 1); CreateSpeechBubbleExclamationMark(this, 8, 0xffffffe8); SetPlayerControl(1); @@ -131,7 +131,7 @@ void sub_08065250(Entity* this) { switch (sub_08056338()) { case 0: this->subAction += 1; - this->timer = 0x1e; + this->timer = 30; this->subtimer = 0; CreateSpeechBubbleExclamationMark(this, 8, 0xffffffe8); break; diff --git a/src/npc/townsperson.c b/src/npc/townsperson.c index b1f4bf79..93c215e4 100644 --- a/src/npc/townsperson.c +++ b/src/npc/townsperson.c @@ -50,7 +50,7 @@ void sub_08061C00(Entity* this) { uVar1 = this->animationState + 4; } else { if (this->subtimer == 0) { - this->subtimer = 0x10; + this->subtimer = 16; } else { this->subtimer--; uVar1 = this->animIndex & 3; diff --git a/src/npc/vaatiReborn.c b/src/npc/vaatiReborn.c index c4b59a64..a0e00fc0 100644 --- a/src/npc/vaatiReborn.c +++ b/src/npc/vaatiReborn.c @@ -32,8 +32,8 @@ void VaatiRebornAction0(Entity* this) { switch (this->type) { case 0: this->y.HALF.HI -= 0xa0; - this->timer = 0xa0; - this->subtimer = 0x20; + this->timer = 160; + this->subtimer = 32; this->spriteOffsetY = 0x20; for (i = 0; i < 4; i++) { entity = CreateNPC(VAATI_REBORN, 2, i); @@ -60,7 +60,7 @@ void VaatiRebornAction0(Entity* this) { break; case 3: this->timer = 1; - this->subtimer = 0x20; + this->subtimer = 32; entity = CreateNPC(VAATI_REBORN, 4, 0); if (entity != NULL) { CopyPosition(this, entity); @@ -105,7 +105,7 @@ void VaatiRebornAction1(Entity* this) { return; } if (this->subtimer-- == 1) { - this->subtimer = 0x20; + this->subtimer = 32; SoundReq(SFX_1A9); } UpdateAnimationSingleFrame(this); @@ -161,7 +161,7 @@ void VaatiRebornAction1(Entity* this) { } if (--this->subtimer == 0) { - this->subtimer = 0x20; + this->subtimer = 32; SoundReq(SFX_1A9); } UpdateAnimationSingleFrame(this); diff --git a/src/object/barrelInside.c b/src/object/barrelInside.c index fee1a436..adc437ba 100644 --- a/src/object/barrelInside.c +++ b/src/object/barrelInside.c @@ -9,7 +9,7 @@ void BarrelInside(Entity* this) { this->action = 1; this->spriteSettings.draw = 1; this->frameIndex = this->type; - this->timer = 0x10; + this->timer = 16; this->subtimer = 1; ptr = gUnk_08120C80 + this->type * 3; this->spriteRendering.b3 = *ptr; @@ -19,7 +19,7 @@ void BarrelInside(Entity* this) { if (this->type == 4) { if (--this->timer == 0) { - this->timer = 0x10; + this->timer = 16; this->frameIndex = gUnk_08120C92[this->subtimer++]; if (this->subtimer == 3) { this->subtimer = 0; diff --git a/src/object/beanstalk.c b/src/object/beanstalk.c index 8328945a..48d3ac96 100644 --- a/src/object/beanstalk.c +++ b/src/object/beanstalk.c @@ -174,7 +174,7 @@ void Beanstalk_Action1Type0SubAction0(BeanstalkEntity* this) { super->timer++; } else { InitAnimationForceUpdate(super, 1); - super->timer = 0x10; + super->timer = 16; super->subAction++; } } @@ -182,7 +182,7 @@ void Beanstalk_Action1Type0SubAction0(BeanstalkEntity* this) { void Beanstalk_Action1Type0SubAction1(BeanstalkEntity* this) { if (super->timer-- == 0) { - super->timer = 0x10; + super->timer = 16; SoundReq(SFX_198); } UpdateAnimationSingleFrame(super); @@ -206,7 +206,7 @@ void Beanstalk_Action1Type0SubAction1(BeanstalkEntity* this) { void Beanstalk_Action1Type0SubAction2(BeanstalkEntity* this) { if (super->timer-- == 0) { - super->timer = 0x10; + super->timer = 16; SoundReq(SFX_198); } } @@ -319,7 +319,7 @@ void Beanstalk_Action1Type8SubAction0(BeanstalkEntity* this) { obj->spriteVramOffset = super->spriteVramOffset; obj->palette.b.b0 = super->palette.b.b0; obj->animIndex = 2; - obj->timer = 0x80; + obj->timer = 128; obj->type = 1; obj->spriteRendering.b3 = 2; obj->spritePriority.b0 = 6; diff --git a/src/object/bigBarrel.c b/src/object/bigBarrel.c index 1f9f698a..25c8a48d 100644 --- a/src/object/bigBarrel.c +++ b/src/object/bigBarrel.c @@ -221,7 +221,7 @@ void sub_08088DB4(BigBarrelEntity* this) { if (--super->timer) { return; } - super->timer = 0x1e; + super->timer = 30; super->frameIndex++; super->action++; break; @@ -278,7 +278,7 @@ void sub_08088F20(BigBarrelEntity* this) { } super->action = 2; super->timer = 30; - RequestPriorityDuration(super, 0x10e); + RequestPriorityDuration(super, 270); pEVar3 = CreateObject(OBJECT_2A, 1, 0); if (pEVar3 != NULL) { pEVar3->updatePriority = 3; @@ -301,7 +301,7 @@ void sub_08088F20(BigBarrelEntity* this) { return; } super->action = 4; - super->timer = 0x78; + super->timer = 120; break; default: if (--super->timer == 0x5a) { @@ -315,7 +315,7 @@ void sub_08088F20(BigBarrelEntity* this) { if (super->timer == 0) { gRoomVars.animFlags &= ~0x10; if (CheckLocalFlags(0x15, 2)) { - RequestPriorityDuration(super, 0x3c); + RequestPriorityDuration(super, 60); SoundReq(SFX_SECRET); } DeleteEntity(super); diff --git a/src/object/bigIceBlock.c b/src/object/bigIceBlock.c index e3251336..289c41ef 100644 --- a/src/object/bigIceBlock.c +++ b/src/object/bigIceBlock.c @@ -96,7 +96,7 @@ void BigIceBlock_Action2(BigIceBlockEntity* this) { } } super->action = 3; - super->timer = 0x3c; + super->timer = 60; super->flags &= 0x7f; } diff --git a/src/object/bigPushableLever.c b/src/object/bigPushableLever.c index b36a0c00..8403bbea 100644 --- a/src/object/bigPushableLever.c +++ b/src/object/bigPushableLever.c @@ -56,7 +56,7 @@ void BigPushableLever_Idle(BigPushableLeverEntity* this) { SetTile(this->tileIndexUpper, this->tilePositionUpper, super->collisionLayer); SetTile(this->tileIndexLower, this->tilePositionLower, super->collisionLayer); EnqueueSFX(SFX_132); - RequestPriorityDuration(super, 0x1e); + RequestPriorityDuration(super, 30); if (PlayerCanBeMoved()) { gPlayerState.pushedObject = 0x98; gPlayerState.queued_action = 5; @@ -82,7 +82,7 @@ void BigPushableLever_Pushing(BigPushableLeverEntity* this) { void BigPushableLever_SetIdle(BigPushableLeverEntity* this) { super->action = IDLE; - this->timer = 0x3c; + this->timer = 60; BigPushableLever_SetTiles(this); } @@ -116,7 +116,7 @@ bool32 BigPushableLever_ShouldStartPushing(BigPushableLeverEntity* this) { BigPushableLever_CalculateSpriteOffsets(this); SetTile(gUnk_081236E8[super->type2], this->tilePositionLower, super->collisionLayer); } else { - this->timer = 0x3c; + this->timer = 60; super->spriteOffsetX = 0; super->spriteOffsetY = 0; } diff --git a/src/object/bigVortex.c b/src/object/bigVortex.c index 6b7ef06d..0347dd24 100644 --- a/src/object/bigVortex.c +++ b/src/object/bigVortex.c @@ -46,7 +46,7 @@ void sub_08098D6C(Entity* this) { if (CheckFlags(this->field_0x86.HWORD)) { this->action = 2; - this->timer = 0x2d; + this->timer = 45; ent = CreateFx(this, FX_BIG_EXPLOSION2, 0); if (ent != NULL) { ent->y.HALF.HI += 8; diff --git a/src/object/bird.c b/src/object/bird.c index 0ec0b1b6..e7346656 100644 --- a/src/object/bird.c +++ b/src/object/bird.c @@ -46,7 +46,7 @@ void Bird_Type0_Init(Entity* this) { this->action++; this->spriteSettings.draw = TRUE; - this->timer = 0x31; + this->timer = 49; this->subtimer = 1; this->zVelocity = Q_16_16(-1.5); this->z.WORD = Q_16_16(-56.75); @@ -295,7 +295,6 @@ void Bird_Type9(Entity* this) { this->spritePriority.b0 = 0; this->spriteRendering.b3 = 0; this->spriteOrientation.flipY = 1; - ; SetDefaultPriority(this, 6); this->x.HALF.HI = gRoomControls.scroll_x; this->y.HALF.HI = gPlayerEntity.y.HALF.HI; diff --git a/src/object/blockPushed.c b/src/object/blockPushed.c index 387518f6..35d9d883 100644 --- a/src/object/blockPushed.c +++ b/src/object/blockPushed.c @@ -38,7 +38,7 @@ void sub_08082EB4(BlockPushedEntity* this) { super->spriteSettings.draw = 1; } super->action = 1; - super->timer = 0x20; + super->timer = 32; super->speed = 0x80; super->spritePriority.b0 = 6; pos = COORD_TO_TILE(super); diff --git a/src/object/bossDoor.c b/src/object/bossDoor.c index dd199b79..c24d41ff 100644 --- a/src/object/bossDoor.c +++ b/src/object/bossDoor.c @@ -120,7 +120,7 @@ void BossDoor_Action4(BossDoorEntity* this) { if (sub_08083734(super, this->unk_76)) { super->action = 5; - super->timer = 0xc; + super->timer = 12; super->spriteSettings.draw = 1; super->direction = *(u8*)&this->unk_76 << 3 ^ 0x10; ptr = &gUnk_081214F4[this->unk_76 * 2]; @@ -166,7 +166,7 @@ void sub_0808C4BC(BossDoorEntity* this) { static const s8 gUnk_0812150C[] = { 0, -2, 2, 0, 0, 2, -2, 0 }; const s8* ptr; super->action = 3; - super->timer = 0xc; + super->timer = 12; super->direction = this->unk_76 * 8; ptr = &gUnk_0812150C[this->unk_76 * 2]; super->x.HALF.HI += ptr[0]; diff --git a/src/object/button.c b/src/object/button.c index 1429cb05..9688c31d 100644 --- a/src/object/button.c +++ b/src/object/button.c @@ -52,8 +52,8 @@ void sub_08081FF8(Entity*); void sub_08081BAC(Entity* this) { if (sub_08081CB0(this)) { this->subAction = 0; - this->timer = 0xA; - RequestPriorityDuration(this, 0xA); + this->timer = 10; + RequestPriorityDuration(this, 10); sub_08081FF8(this); if (this->type == 1) { this->action = 3; @@ -74,9 +74,9 @@ void sub_08081BE0(Entity* this) { this->action = 4; this->subtimer = 1; if ((gPlayerState.heldObject == 2) || (!(gPlayerState.field_0x35 & 0x80))) { - this->timer = 0x18; + this->timer = 24; } else { - this->timer = 0x8; + this->timer = 8; } } else { sub_08081E6C(this); diff --git a/src/object/chestSpawner.c b/src/object/chestSpawner.c index 0e6eadf6..1c8527e1 100644 --- a/src/object/chestSpawner.c +++ b/src/object/chestSpawner.c @@ -102,10 +102,10 @@ void ChestSpawner_Type2Action1(ChestSpawnerEntity* this) { gPauseMenuOptions.disabled = 1; super->action = 2; super->subAction = 0; - super->subtimer = 0x1e; + super->subtimer = 30; super->spriteSettings.draw = 1; super->spriteRendering.alphaBlend = 1; - RequestPriorityDuration(super, 0x1e); + RequestPriorityDuration(super, 30); sub_0805BC4C(); } } @@ -113,7 +113,7 @@ void ChestSpawner_Type2Action1(ChestSpawnerEntity* this) { void ChestSpawner_Type2Action2(ChestSpawnerEntity* this) { u32 tmp; - SetPriorityTimer(0x1e); + SetPriorityTimer(30); switch (super->subAction) { case 0: if (EntityInRectRadius(super, &gPlayerEntity, 0x10, 8)) { @@ -152,9 +152,9 @@ void ChestSpawner_Type2Action3(ChestSpawnerEntity* this) { sub_0800445C(super); if (super->interactType != 0) { super->action = 4; - super->subtimer = 0x1e; + super->subtimer = 30; sub_080788E0(super); - RequestPriorityDuration(super, 0x3c); + RequestPriorityDuration(super, 60); SoundReq(SFX_CHEST_OPEN); } } @@ -167,7 +167,7 @@ void ChestSpawner_Type2Action4(ChestSpawnerEntity* this) { if (super->timer == 0x18) { super->action = 6; super->timer = 8; - super->subtimer = 0x10; + super->subtimer = 16; } else { super->action = 5; sub_08084074(super->type2); diff --git a/src/object/crenelBeanSprout.c b/src/object/crenelBeanSprout.c index a953c47e..f0cf844d 100644 --- a/src/object/crenelBeanSprout.c +++ b/src/object/crenelBeanSprout.c @@ -221,7 +221,7 @@ void CrenelBeanSprout_Action2SubAction2(CrenelBeanSproutEntity* this) { } void CrenelBeanSprout_Action2SubAction3(CrenelBeanSproutEntity* this) { - InitScreenShake(0x10, 0); + InitScreenShake(16, 0); super->action = 1; super->subAction = 0; } @@ -247,7 +247,7 @@ void CrenelBeanSprout_Action4(CrenelBeanSproutEntity* this) { CreateDust(super); } } else { - super->timer = 0xc0; + super->timer = 192; } } @@ -274,12 +274,10 @@ void CrenelBeanSprout_Action6(CrenelBeanSproutEntity* this) { } void CrenelBeanSprout_Action6SubAction0(CrenelBeanSproutEntity* this) { - static const u8 gUnk_081231AC[] = { - 2, - 3, - }; + static const u8 gUnk_081231AC[] = { 2, 3 }; + SetLocalFlag(super->type2); - super->timer = 0x0f; + super->timer = 15; super->subtimer = gUnk_081231AC[super->type >> 1]; super->type2 = 0; super->spriteSettings.draw = 0; @@ -301,9 +299,9 @@ void CrenelBeanSprout_Action6SubAction1(CrenelBeanSproutEntity* this) { if (super->type2 == super->subtimer) { gPlayerState.keepFacing &= 0x7f; super->subAction++; - super->timer = 0x3c; + super->timer = 60; } else { - super->timer = 0x0f; + super->timer = 15; } } } diff --git a/src/object/ezloCap.c b/src/object/ezloCap.c index 9780c525..272e0b3a 100644 --- a/src/object/ezloCap.c +++ b/src/object/ezloCap.c @@ -73,7 +73,7 @@ void EzloCap_Type0Init(EzloCapEntity* this) { SoundReq(SFX_F3); } else { super->timer = 0; - super->subtimer = 0xa; + super->subtimer = 10; super->y.HALF.HI -= 0xe; InitAnimationForceUpdate(super, 0x14); } @@ -129,7 +129,7 @@ void EzloCap_Type1Action1(EzloCapEntity* this) { if (super->subAction == 0) { if (super->subtimer-- == 0) { super->timer++; - super->subtimer = 0xa; + super->subtimer = 10; tmp = super->timer - 1; obj = CreateObjectWithParent(super, OBJECT_79, tmp, 0); super->child = obj; @@ -142,7 +142,7 @@ void EzloCap_Type1Action1(EzloCapEntity* this) { } if (super->timer == 6) { super->subAction = 3; - super->timer = 0x3c; + super->timer = 60; super->parent->type2 = 1; InitAnimationForceUpdate(super, 0x1c); } else { diff --git a/src/object/fairy.c b/src/object/fairy.c index 349fdf68..aac60b8b 100644 --- a/src/object/fairy.c +++ b/src/object/fairy.c @@ -154,7 +154,7 @@ void Fairy_Action2(FairyEntity* this) { if (--super->subtimer == 0) { u32 rand = Random(); super->flags |= ENT_COLLIDE; - super->subtimer = 0x20; + super->subtimer = 32; super->speed = (u16)gUnk_081217A4[rand >> 8 & 1]; if (sub_0808DAA0(this)) { super->direction = rand & 0x1f; @@ -240,7 +240,7 @@ void sub_0808DAD0(FairyEntity* this) { DeleteThisEntity(); } super->action = 4; - super->timer = 0x80; + super->timer = 128; super->subtimer = 6; super->flags &= ~ENT_COLLIDE; super->spriteSettings.draw = 1; diff --git a/src/object/figurineDevice.c b/src/object/figurineDevice.c index d17525d6..0f2ae319 100644 --- a/src/object/figurineDevice.c +++ b/src/object/figurineDevice.c @@ -112,7 +112,7 @@ void FigurineDevice_Init(FigurineDeviceEntity* this) { InitializeAnimation(super, 1); break; case 3: - super->timer = 0x1e; + super->timer = 30; super->subtimer = 0; this->unk_81 = 1; this->unk_7a = 0; @@ -199,7 +199,7 @@ void FigurineDevice_Action3(FigurineDeviceEntity* this) { case 0: if ((super->frame & ANIM_DONE) != 0) { this->unk_7a = 1; - super->timer = 0x28; + super->timer = 40; ChangeObjPalette(super, gUnk_08120AA8[super->type2]); InitializeAnimation(super, 2); SoundReq(SFX_110); @@ -254,7 +254,7 @@ void FigurineDevice_Action4(FigurineDeviceEntity* this) { if ((gInput.newKeys & 1) != 0) { SoundReq(SFX_TEXTBOX_SELECT); this->unk_7a = 2; - super->timer = 0x3c; + super->timer = 60; sub_08050384(); return; } @@ -323,7 +323,7 @@ ASM_FUNC("asm/non_matching/figurineDevice/sub_08087F94.inc", void sub_08087F94(F void sub_08088034(FigurineDeviceEntity* this) { if (super->timer == 0) { - super->timer = 0x14; + super->timer = 20; SoundReq(SFX_MENU_ERROR); } } diff --git a/src/object/fourElements.c b/src/object/fourElements.c index 3b4b8d97..1754134f 100644 --- a/src/object/fourElements.c +++ b/src/object/fourElements.c @@ -93,7 +93,7 @@ void FourElements_Action2(FourElementsEntity* this) { DeleteEntity(super->child); super->spriteSettings.draw = 0; super->action = 3; - super->timer = 0x2d; + super->timer = 45; gScreen.controls.layerFXControl = 0x640; gScreen.controls.alphaBlend = 0; InitItemGetSequence(super->type, 0, 1); @@ -113,7 +113,7 @@ void FourElements_Action3(FourElementsEntity* this) { SetDefaultPriority(&gPlayerEntity, 0); } } else { - RequestPriorityDuration(NULL, 0x3c); + RequestPriorityDuration(NULL, 60); if (sub_0808C67C()) { super->action = 4; } @@ -121,7 +121,7 @@ void FourElements_Action3(FourElementsEntity* this) { } void FourElements_Action4(FourElementsEntity* this) { - RequestPriorityDuration(NULL, 0x3c); + RequestPriorityDuration(NULL, 60); if (gFadeControl.active == 0) { super->action = 5; this->unk_68 = 0x1a4; @@ -141,7 +141,7 @@ void FourElements_Action5(FourElementsEntity* this) { void FourElements_Action6(FourElementsEntity* this) { RequestPriorityDuration(NULL, 10); if ((gMessage.doTextBox & 0x7f) == 0) { - SetPriorityTimer(0x5a); + SetPriorityTimer(90); gPlayerState.controlMode = 1; sub_0807DF50(); SetRoomFlag(0); diff --git a/src/object/gyorgBossObject.c b/src/object/gyorgBossObject.c index 910498aa..251b3969 100644 --- a/src/object/gyorgBossObject.c +++ b/src/object/gyorgBossObject.c @@ -63,7 +63,7 @@ void GyorgBossObject_SetupStart(GyorgBossObjectEntity* this) { return; super->action = 1; super->myHeap = heap; - this->timer = 0x258; + this->timer = 600; this->unk_6c = 0; heap->boss = this; tmp = CreateEnemy(GYORG_FEMALE, 0); @@ -120,13 +120,13 @@ void GyorgBossObject_FemalePhase1(GyorgBossObjectEntity* this) { if (((GyorgHeap*)super->myHeap)->female->base.health == 0) { // start male phase 1 super->action = 3; - super->timer = 0x23; + super->timer = 35; this->unk_6c = 1; this->unk_78 = 0x400; this->unk_7b = 1; ((GyorgHeap*)super->myHeap)->male1->base.health = 12; SoundReq(SFX_BOSS_DIE); - InitScreenShake(0x96, 1); + InitScreenShake(150, 1); } gPlayerState.startPosX = gRoomControls.origin_x + 0x200; gPlayerState.startPosY = gRoomControls.origin_y + 0x210; @@ -156,12 +156,12 @@ void GyorgBossObject_FemalePhase2(GyorgBossObjectEntity* this) { // start male phase 2 ((GyorgHeap*)super->myHeap)->male1->base.health = 12; super->action = 5; - super->timer = 0x23; + super->timer = 35; this->unk_6c = 2; this->unk_78 = 0x400; this->unk_7b = 1; SoundReq(SFX_BOSS_DIE); - InitScreenShake(0x96, 1); + InitScreenShake(150, 1); } gPlayerState.startPosX = gRoomControls.origin_x + 0x200; gPlayerState.startPosY = gRoomControls.origin_y + 0x210; @@ -191,11 +191,11 @@ void GyorgBossObject_FemalePhase3(GyorgBossObjectEntity* this) { // start male phase 3 ((GyorgHeap*)super->myHeap)->male2->base.health = 12; super->action = 7; - super->timer = 0x23; + super->timer = 35; this->unk_6c = 0x104; this->unk_78 = 0x400; SoundReq(SFX_BOSS_DIE); - InitScreenShake(0x96, 1); + InitScreenShake(150, 1); } gPlayerState.startPosX = gRoomControls.origin_x + 0x200; gPlayerState.startPosY = gRoomControls.origin_y + 0x210; @@ -219,7 +219,7 @@ void GyorgBossObject_MalePhase3(GyorgBossObjectEntity* this) { void GyorgBossObject_FemalePhase4(GyorgBossObjectEntity* this) { if (((GyorgHeap*)super->myHeap)->female->base.health == 0) { if (this->unk_6c != 0) { - InitScreenShake(0x2d, 1); + InitScreenShake(45, 1); SoundReq(SFX_BOSS_DIE); this->unk_78 = 0x600; } @@ -228,8 +228,8 @@ void GyorgBossObject_FemalePhase4(GyorgBossObjectEntity* this) { if (PlayerCanBeMoved() && gPlayerEntity.z.HALF.HI == 0) { super->action = 9; super->timer = 0; - super->subtimer = 0xF0; - this->timer = 0x1a4; + super->subtimer = 240; + this->timer = 420; super->direction = 0; super->speed = 0x60; gPlayerState.flags &= ~PL_FLAGS20000; @@ -263,11 +263,11 @@ void GyorgBossObject_FightEnd(GyorgBossObjectEntity* this) { switch (this->timer) { case 0xb4: SoundReq(SFX_BOSS_DIE); - InitScreenShake(0x2d0, 2); + InitScreenShake(720, 2); break; case 0x12C: SoundReq(SFX_BOSS_DIE); - InitScreenShake(0x4b, 1); + InitScreenShake(75, 1); break; } } @@ -463,10 +463,10 @@ void sub_080A1FF0(GyorgBossObjectEntity* this) { if (EntityWithinDistance(&gPlayerEntity, gRoomControls.origin_x + 0x200, gRoomControls.origin_y + 0x210, 0x100)) { if (super->timer == 0) { - super->timer = 0x78; + super->timer = 120; } else { if (super->timer == 0x23) { - InitScreenShake(0x1e, 0); + InitScreenShake(30, 0); } } } else { diff --git a/src/object/keyStealingTakkuri.c b/src/object/keyStealingTakkuri.c index 9d6390f7..a7c90a1f 100644 --- a/src/object/keyStealingTakkuri.c +++ b/src/object/keyStealingTakkuri.c @@ -61,7 +61,7 @@ void KeyStealingTakkuri_Type0_Init(KeyStealingTakkuriEntity* this) { Entity* entity; super->action++; super->collisionLayer = 1; - super->timer = 0x1e; + super->timer = 30; super->subtimer = 0; super->spriteRendering.b3 = 1; super->speed = 0; @@ -92,7 +92,7 @@ void KeyStealingTakkuri_Type0_Action2(KeyStealingTakkuriEntity* this) { sub_0809E1F0(this); if ((s32)sub_080041DC(super, child->x.HALF.HI, child->y.HALF.HI) * 0x10 < super->speed) { super->action++; - super->timer = 0x10; + super->timer = 16; super->subtimer = 1; InitAnimationForceUpdate(super, 2); } @@ -189,7 +189,7 @@ void KeyStealingTakkuri_Type2_Init(KeyStealingTakkuriEntity* this) { super->action++; super->collisionLayer = 2; - super->timer = 0x1e; + super->timer = 30; super->subtimer = 1; super->spriteRendering.b3 = 1; super->speed = 0; @@ -236,7 +236,7 @@ void KeyStealingTakkuri_Type2_Action3(KeyStealingTakkuriEntity* this) { this->unk_6e += 8; if (--this->unk_6c == 0) { super->action++; - super->timer = 0x1e; + super->timer = 30; super->spriteSettings.flipX = 0; } else { sub_0809E238(this); @@ -276,7 +276,7 @@ void KeyStealingTakkuri_Type3_Init(KeyStealingTakkuriEntity* this) { super->action++; super->collisionLayer = 2; - super->timer = 0xa; + super->timer = 10; super->subtimer = 0; super->spriteRendering.b3 = 1; super->speed = 0; @@ -306,7 +306,7 @@ void KeyStealingTakkuri_Type3_Action1(KeyStealingTakkuriEntity* this) { switch (sub_0809E2C4(this, super->type2)) { case 1: super->action += 2; - super->timer = 0xff; + super->timer = 255; InitAnimationForceUpdate(super, super->animIndex + 2); SoundReq(SFX_123); child = super->child; @@ -330,7 +330,7 @@ void KeyStealingTakkuri_Type3_Action1(KeyStealingTakkuriEntity* this) { } break; default: - super->timer = 0xa; + super->timer = 10; break; } UpdateAnimationSingleFrame(super); diff --git a/src/object/ladderUp.c b/src/object/ladderUp.c index 99f459ed..e068963b 100644 --- a/src/object/ladderUp.c +++ b/src/object/ladderUp.c @@ -39,11 +39,11 @@ void LadderUp(Entity* this) { if (fxEnt) { fxEnt->y.HALF.HI += 8; } - InitScreenShake(0x1e, 0); + InitScreenShake(30, 0); SoundReq(SFX_10B); this->action = 2; #ifndef EU - this->timer = 0x3c; + this->timer = 60; #endif } break; diff --git a/src/object/lavaPlatform.c b/src/object/lavaPlatform.c index be0e619f..acf55a65 100644 --- a/src/object/lavaPlatform.c +++ b/src/object/lavaPlatform.c @@ -140,7 +140,7 @@ void LavaPlatform_Type1Action2(LavaPlatformEntity* this) { if (LavaPlatform_IsPlayerOnPlatform(this)) { super->action = 3; super->flags &= ~ENT_COLLIDE; - super->timer = 0x14; + super->timer = 20; gPlayerState.field_0x3f = 0xfd; } } diff --git a/src/object/lightableSwitch.c b/src/object/lightableSwitch.c index ae10b872..a49b4b37 100644 --- a/src/object/lightableSwitch.c +++ b/src/object/lightableSwitch.c @@ -135,7 +135,7 @@ void sub_0809EB80(Entity* this) { void sub_0809EBD8(Entity* this) { if ((this->contactFlags & 0x80) != 0) { this->action = 2; - this->timer = 0x10; + this->timer = 16; this->frameIndex = 2; SetFlag(this->field_0x86.HWORD); EnqueueSFX(SFX_110); diff --git a/src/object/lilypadSmall.c b/src/object/lilypadSmall.c index 0a14f7f2..55ec8dff 100644 --- a/src/object/lilypadSmall.c +++ b/src/object/lilypadSmall.c @@ -10,7 +10,7 @@ void LilypadSmall(Entity* this) { if (this->action == 0) { this->action = 1; - this->timer = 0x5a; + this->timer = 90; rand = Random(); this->subtimer = rand; this->frameIndex = (rand >> 0x10) & 3; diff --git a/src/object/lockedDoor.c b/src/object/lockedDoor.c index f1530d33..71f87df5 100644 --- a/src/object/lockedDoor.c +++ b/src/object/lockedDoor.c @@ -214,7 +214,7 @@ void sub_080835F8(Entity* this) { if (this->interactType == 0 && !CheckFlags(this->field_0x86.HWORD)) return; this->action = 1; - this->timer = 0x14; + this->timer = 20; sub_08083658(this); SetFlag(this->field_0x86.HWORD); sub_080526F8(-1); @@ -230,12 +230,12 @@ void sub_08083638(Entity* this) { void sub_08083658(Entity* this) { const struct_0811F680* tmp; this->action = 1; - this->timer = 0x14; + this->timer = 20; this->direction = this->field_0x7c.BYTES.byte2 << 3; tmp = &gUnk_0811F680[this->field_0x7c.BYTES.byte2]; this->x.HALF.HI += tmp->x; this->y.HALF.HI += tmp->y; - RequestPriorityDuration(this, 0x3c); + RequestPriorityDuration(this, 60); SoundReq(SFX_10B); } diff --git a/src/object/macroBook.c b/src/object/macroBook.c index f981eca7..d42f4c6d 100644 --- a/src/object/macroBook.c +++ b/src/object/macroBook.c @@ -35,7 +35,7 @@ void MacroBook(Entity* this) { void MacroBook_Init(MacroBookEntity* this) { super->action = 1; - super->timer = 0x80; + super->timer = 128; super->subtimer = 0; super->spriteRendering.b0 = 3; this->unk80 = 0x80; @@ -89,7 +89,7 @@ void MacroBook_Action2(MacroBookEntity* this) { super->action = 3; super->timer = 0; InitAnimationForceUpdate(super, 3); - RequestPriorityDuration(super, 0x78); + RequestPriorityDuration(super, 120); } } diff --git a/src/object/macroMushroomStalks.c b/src/object/macroMushroomStalks.c index 4bc6b577..d5a575ec 100644 --- a/src/object/macroMushroomStalks.c +++ b/src/object/macroMushroomStalks.c @@ -51,7 +51,6 @@ void sub_0808C964(Entity* this) { this->spriteSettings.draw = 1; this->spriteOrientation.flipY = 2; this->spriteRendering.b3 = 2; - ; this->spritePriority.b0 = this->type2; if (this->id != OBJECT_75 && (u8)(this->type - 1) < 3) { this->spriteRendering.b0 = 3; @@ -71,21 +70,21 @@ void sub_0808CA10(Entity* this) { switch (this->type) { case 1: if (gUnk_02018EB0.unk_18 != 0) { - this->timer = 0x20; + this->timer = 32; gUnk_02018EB0.unk_18 = 0; SoundReq(SFX_12E); } break; case 2: if (gUnk_02018EB0.unk_19 != 0) { - this->timer = 0x20; + this->timer = 32; gUnk_02018EB0.unk_19 = 0; SoundReq(SFX_12E); } break; case 3: if (gUnk_02018EB0.unk_1a != 0) { - this->timer = 0x20; + this->timer = 32; gUnk_02018EB0.unk_1a = 0; SoundReq(SFX_12E); } diff --git a/src/object/macroPlayer.c b/src/object/macroPlayer.c index 603251e6..690196b1 100644 --- a/src/object/macroPlayer.c +++ b/src/object/macroPlayer.c @@ -189,7 +189,7 @@ void MacroPlayer_Type0_Action4(MacroPlayerEntity* this) { void MacroPlayer_Type0_Action5(MacroPlayerEntity* this) { if (--super->timer == 0) { super->action++; - super->timer = 0x10; + super->timer = 16; } } diff --git a/src/object/metalDoor.c b/src/object/metalDoor.c index 1938f2b5..e0e3c0d4 100644 --- a/src/object/metalDoor.c +++ b/src/object/metalDoor.c @@ -43,7 +43,7 @@ void sub_080A0684(Entity* this) { void sub_080A0718(Entity* this) { if (sub_08083734(this, 2) != 0) { this->action = 2; - this->timer = 0xc; + this->timer = 12; this->spriteSettings.draw = TRUE; this->direction = 0; this->y.HALF.HI += 0x24; @@ -79,7 +79,7 @@ void sub_080A074C(Entity* this) { void sub_080A07BC(Entity* this) { if (CheckFlags(this->field_0x86.HWORD)) { this->action = 4; - this->timer = 0xc; + this->timer = 12; this->direction = 0x10; this->y.HALF.HI += 2; sub_080A0870(this); diff --git a/src/object/minecart.c b/src/object/minecart.c index 1b2988d1..c5ef1e98 100644 --- a/src/object/minecart.c +++ b/src/object/minecart.c @@ -154,7 +154,7 @@ void sub_080919AC(MinecartEntity* this) { if (super->subtimer-- == 0) { SoundReq(SFX_PLY_VO7); - super->subtimer = 0x3c; + super->subtimer = 60; } uVar3 = GetRelativeCollisionTile(super, gUnk_081223C8[super->animationState * 2], diff --git a/src/object/minishLight.c b/src/object/minishLight.c index 361e6768..c6a81f90 100644 --- a/src/object/minishLight.c +++ b/src/object/minishLight.c @@ -14,7 +14,7 @@ void MinishLight(Entity* this) { void sub_0809F840(Entity* this) { this->action = 1; this->frameIndex = 0; - this->timer = 0x20; + this->timer = 32; this->subtimer = 0; if (this->type2 != 0) { diff --git a/src/object/object12.c b/src/object/object12.c index d99bc2ad..4784011f 100644 --- a/src/object/object12.c +++ b/src/object/object12.c @@ -41,7 +41,7 @@ void Object12_Init(Object12Entity* this) { sub_080850FC(this); } else { super->action = 2; - super->timer = 0xf0; + super->timer = 240; super->speed = 0x80; super->direction = 0x18; } @@ -56,7 +56,7 @@ void Object12_Action2(Object12Entity* this) { u32 tmp2; if (--super->timer == 0) { super->action = 3; - super->timer = 0x1e; + super->timer = 30; super->spriteOffsetY = 4; gScreen.lcd.displayControl |= 0x2000; gScreen.controls.windowInsideControl = 0x1f; @@ -75,7 +75,7 @@ void Object12_Action2(Object12Entity* this) { void Object12_Action3(Object12Entity* this) { if (--super->timer == 0) { super->action = 4; - super->timer = 0x60; + super->timer = 96; } } diff --git a/src/object/object2A.c b/src/object/object2A.c index 4ace87be..226c9868 100644 --- a/src/object/object2A.c +++ b/src/object/object2A.c @@ -22,10 +22,10 @@ void Object2A_Init(Entity* this) { switch (this->type) { case 1: this->y.HALF.HI -= 8; - this->timer = 0x28; + this->timer = 40; break; case 2: - this->timer = 0xf; + this->timer = 15; sub_08004168(this); break; case 3: diff --git a/src/object/object30.c b/src/object/object30.c index 6ebc3d4f..6a1a3d2c 100644 --- a/src/object/object30.c +++ b/src/object/object30.c @@ -103,7 +103,7 @@ void Object30_Action2(Object30Entity* this) { void sub_0808A968(Object30Entity* this) { super->action = 2; - super->timer = 0x1e; + super->timer = 30; super->spriteSettings.draw = 1; super->zVelocity = Q_16_16(2.5); super->spritePriority.b1 = 3; diff --git a/src/object/object35.c b/src/object/object35.c index cee74852..75f401f6 100644 --- a/src/object/object35.c +++ b/src/object/object35.c @@ -60,7 +60,7 @@ void Object35_Type0Init(Object35Entity* this) { super->collisionLayer = 2; UpdateSpriteForCollisionLayer(super); super->spritePriority.b0 = 1; - super->timer = -0x4c; + super->timer = -76; InitializeAnimation(super, super->type2); } @@ -68,10 +68,10 @@ void Object35_Type0Action1(Object35Entity* this) { s8 tmp; GetNextFrame(super); if (--super->timer == 0) { - super->timer = -0x4c; + super->timer = -76; super->type2++; tmp = 3; - super->type2 = super->type2 % tmp; + super->type2 %= tmp; InitializeAnimation(super, super->type2); } } @@ -99,7 +99,7 @@ void Object35_Type1Init(Object35Entity* this) { this->unk_74 = GetTileIndex(this->unk_76, super->collisionLayer); if (super->timer == 0) { super->action = 1; - super->subtimer = 0x78; + super->subtimer = 120; SetTile(0x4022, this->unk_76, super->collisionLayer); } else { super->action = 3; @@ -160,7 +160,7 @@ void Object35_Type2(Object35Entity* this) { void Object35_Type2Init(Object35Entity* this) { super->action = 1; - super->timer = 0x10; + super->timer = 16; super->z.HALF.HI -= 0x10; if (super->type2 == 0) { super->frameIndex = 2; diff --git a/src/object/object36.c b/src/object/object36.c index cb262560..e7f23a70 100644 --- a/src/object/object36.c +++ b/src/object/object36.c @@ -38,7 +38,7 @@ void sub_0808BB30(Object36Entity* this) { } else { super->action = 1; super->flags |= ENT_COLLIDE; - super->timer = 0x78; + super->timer = 120; super->subtimer = 0; super->spriteRendering.b3 = 3; super->spritePriority.b0 = 4; @@ -87,7 +87,7 @@ void sub_0808BC3C(Object36Entity* this) { if (super->timer == 0) { SetGlobalFlag(LV1TARU_OPEN); super->action = 2; - super->subtimer = 0x80; + super->subtimer = 128; super->spriteOffsetY = 0; } else { if ((super->timer & 1) != 0) { @@ -100,7 +100,7 @@ void sub_0808BC3C(Object36Entity* this) { } } } else { - super->timer = 0x78; + super->timer = 120; super->spriteSettings.draw = 0; if (super->subtimer != 0) { super->subtimer = 0; @@ -130,7 +130,7 @@ void sub_0808BD14(Object36Entity* this) { } else { if ((super->flags & ENT_COLLIDE) != 0) { super->flags &= ~ENT_COLLIDE; - super->timer = 0x1e; + super->timer = 30; } else { super->spriteSettings.draw ^= 1; if (--super->timer == 0) { diff --git a/src/object/object3D.c b/src/object/object3D.c index 82213ab0..542167c4 100644 --- a/src/object/object3D.c +++ b/src/object/object3D.c @@ -71,8 +71,8 @@ void Object3D_Action1(Object3DEntity* this) { super->spriteOrientation.flipY = 0; super->spriteRendering.b3 = 0; super->spritePriority.b0 = 0; - super->timer = 0x1e; - super->subtimer = 0xff; + super->timer = 30; + super->subtimer = 255; super->spriteRendering.b0 = 3; SetAffineInfo(super, 0x100, 0x100, 0); gArea.field_0x10 = 1; diff --git a/src/object/object3E.c b/src/object/object3E.c index 6442831b..0ca77146 100644 --- a/src/object/object3E.c +++ b/src/object/object3E.c @@ -41,7 +41,7 @@ void Object3E_Type0(Object3EEntity* this) { switch (super->action) { case 0: super->action = 1; - super->timer = 0x40 - (Random() & 0x1f); + super->timer = 64 - (Random() & 0x1F); super->frameIndex = 0; super->animationState = 0; super->spriteRendering.b3 = 3; @@ -61,7 +61,7 @@ void Object3E_Type0(Object3EEntity* this) { if (--super->subtimer == 0) { super->frameIndex = 0; super->action = 1; - super->timer = 0x40 - (Random() & 0x1f); + super->timer = 64 - (Random() & 0x1F); } else { super->timer = 8; tmp2 = super->animationState; diff --git a/src/object/object42.c b/src/object/object42.c index 9f32164e..e75d74c9 100644 --- a/src/object/object42.c +++ b/src/object/object42.c @@ -39,7 +39,7 @@ void Object42(Object42Entity* this) { void sub_0808DDB4(Object42Entity* this) { super->action = 1; if (super->type != 0) { - super->timer = 0x78; + super->timer = 120; this->unk_6c = 0xf0; InitializeAnimation(super, 0); sub_0808DDE8(this); diff --git a/src/object/object43.c b/src/object/object43.c index 6a419c3a..f284d2a8 100644 --- a/src/object/object43.c +++ b/src/object/object43.c @@ -48,13 +48,13 @@ void Object43_Init(Object43Entity* this) { super->updatePriority = 6; InitializeAnimation(super, 7); if (super->type2 != 0) { - super->timer = 0x28; + super->timer = 40; } else { super->spriteSettings.draw = 1; - if ((gPlayerState.skills & SKILL_FAST_SPIN) != 0) { - super->timer = 0x28; + if (gPlayerState.skills & SKILL_FAST_SPIN) { + super->timer = 40; } else { - super->timer = 0x50; + super->timer = 80; } Object43_Action1(this); diff --git a/src/object/object4B.c b/src/object/object4B.c index 42677c72..8f923a5d 100644 --- a/src/object/object4B.c +++ b/src/object/object4B.c @@ -34,13 +34,13 @@ void Object4B(Object4BEntity* this) { void Object4B_Init(Object4BEntity* this) { super->action = 1; - super->timer = 0x3c; + super->timer = 60; InitializeAnimation(super, 0); } void Object4B_Action1(Object4BEntity* this) { if (--super->timer == 0) { - super->timer = 0x78; + super->timer = 120; super->action++; super->spriteSettings.draw = 1; } @@ -82,7 +82,7 @@ void Object4B_Action4(Object4BEntity* this) { super->y.HALF.HI = gRoomControls.origin_y + 0x230; if ((super->frame & ANIM_DONE) != 0) { super->action++; - super->timer = 0x78; + super->timer = 120; InitializeAnimation(super, 2); } } else if ((super->frame & ANIM_DONE) != 0) { @@ -104,7 +104,7 @@ void Object4B_Action6(Object4BEntity* this) { GetNextFrame(super); if ((super->frame & ANIM_DONE) != 0) { super->action++; - super->timer = 0x3c; + super->timer = 60; InitializeAnimation(super, 1); } } diff --git a/src/object/object61.c b/src/object/object61.c index acf2c4af..e9107fc6 100644 --- a/src/object/object61.c +++ b/src/object/object61.c @@ -95,7 +95,7 @@ void Object61_Action1Type0(Object61Entity* this) { this->unk_6e = 0x100; } if (this->unk_6e == 0x100) { - super->subtimer = 0xff; + super->subtimer = 255; } } else { sub_080936C8(this); diff --git a/src/object/object74.c b/src/object/object74.c index 977d9365..10702c2c 100644 --- a/src/object/object74.c +++ b/src/object/object74.c @@ -52,7 +52,7 @@ void sub_08097BDC(Object74Entity* this) { if (CheckFlags(this->unk_86)) { SetPlayerControl(CONTROL_1); gPauseMenuOptions.disabled = 1; - RequestPriorityDuration(super, 0x1e); + RequestPriorityDuration(super, 30); if (sub_08097CB0(this) == FALSE) { sub_08097CB4(this); } @@ -67,7 +67,7 @@ void sub_08097C1C(Object74Entity* this) { void sub_08097C20(Object74Entity* this) { u32 tmp; - SetPriorityTimer(0x1e); + SetPriorityTimer(30); sub_0800445C(super); CreateMagicSparkles(super->x.HALF.HI, super->y.HALF.HI, super->collisionLayer); if (--super->timer == 0) { @@ -95,7 +95,7 @@ void sub_08097CB4(Object74Entity* this) { super->action = 3; super->spriteSettings.draw = 1; super->spriteRendering.alphaBlend = 1; - super->timer = 0x1e; + super->timer = 30; super->subtimer = 0; gScreen.controls.layerFXControl = 0xf40; gScreen.controls.alphaBlend = 0x1000; diff --git a/src/object/object86.c b/src/object/object86.c index 44e88e88..5a2f2ac8 100644 --- a/src/object/object86.c +++ b/src/object/object86.c @@ -60,7 +60,7 @@ void sub_08099E8C(Entity* this) { if (EntityInRectRadius(this, &gPlayerEntity, 0xc, 0xc)) { if (this->subAction == 0) { sub_08099ECC(this); - RequestPriorityDuration(this, 0x1e); + RequestPriorityDuration(this, 30); } if (CheckLocalFlag(0x75)) { CreateHoleManager(0x7); diff --git a/src/object/object8E.c b/src/object/object8E.c index c987b2e8..0a7fc70f 100644 --- a/src/object/object8E.c +++ b/src/object/object8E.c @@ -36,11 +36,11 @@ void Object8E(Object8EEntity* this) { void Object8E_Type0(Object8EEntity* this) { u32 tmp; - RequestPriorityDuration(super, 0x1e); + RequestPriorityDuration(super, 30); switch (super->action) { case 0: super->action = 1; - super->timer = 0x3c; + super->timer = 60; super->subtimer = 0; gRoomControls.camera_target = super; gRoomControls.unk5 = 1; @@ -67,7 +67,7 @@ void Object8E_Type0(Object8EEntity* this) { } } else { super->action = 2; - super->timer = 0x3c; + super->timer = 60; gScreen.lcd.displayControl &= 0xdfff; gRoomControls.camera_target = &gPlayerEntity; SoundReq(SFX_134); @@ -110,12 +110,12 @@ void sub_0809B97C(Object8EEntity* this, u32 param_2) { void Object8E_Type1(Object8EEntity* this) { u32 tmp; - RequestPriorityDuration(super, 0x1e); + RequestPriorityDuration(super, 30); switch (super->action) { case 0: super->action = 1; - super->timer = 0x3c; - super->subtimer = 0x20; + super->timer = 60; + super->subtimer = 32; gRoomControls.camera_target = super; gRoomControls.unk5 = 1; if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) { @@ -141,7 +141,7 @@ void Object8E_Type1(Object8EEntity* this) { } } else { super->action = 2; - super->timer = 0x3c; + super->timer = 60; gRoomControls.camera_target = &gPlayerEntity; SoundReq(SFX_134); } @@ -165,7 +165,7 @@ void Object8E_Type2(Object8EEntity* this) { switch (super->action) { case 0: super->action++; - super->timer = 0x3c; + super->timer = 60; super->subtimer = 0; gRoomControls.camera_target = super; gRoomControls.unk5 = 1; @@ -194,7 +194,7 @@ void Object8E_Type2(Object8EEntity* this) { } } else { super->action = 2; - super->timer = 0x1e; + super->timer = 30; gScreen.lcd.displayControl = (gScreen.lcd.displayControl & 0xdfff) | 0x4800; super->x.HALF.HI += 0x68; super->y.HALF.HI += 0x28; @@ -205,7 +205,7 @@ void Object8E_Type2(Object8EEntity* this) { break; case 2: if (sub_0809BE78(this) && (--super->timer == 0)) { - super->timer = 0x78; + super->timer = 120; super->action = 3; SetLocalFlag(0x35); SoundReq(SFX_SECRET); @@ -231,11 +231,11 @@ void Object8E_Type2(Object8EEntity* this) { void Object8E_Type3(Object8EEntity* this) { u32 tmp; - RequestPriorityDuration(super, 0x1e); + RequestPriorityDuration(super, 30); switch (super->action) { case 0: super->action = 1; - super->timer = 0x3c; + super->timer = 60; super->subtimer = 0; gRoomControls.camera_target = super; gRoomControls.unk5 = 1; @@ -268,7 +268,7 @@ void Object8E_Type3(Object8EEntity* this) { } } else { super->action = 2; - super->timer = 0x78; + super->timer = 120; gScreen.lcd.displayControl = (gScreen.lcd.displayControl & 0xdfff) | 0x4800; SetLocalFlag(0x37); SoundReq(SFX_134); @@ -287,12 +287,12 @@ void Object8E_Type3(Object8EEntity* this) { void Object8E_Type4(Object8EEntity* this) { u32 tmp; - RequestPriorityDuration(super, 0x1e); + RequestPriorityDuration(super, 30); switch (super->action) { case 0: super->action = 1; - super->timer = 0x3c; - super->subtimer = 0x80; + super->timer = 60; + super->subtimer = 128; gRoomControls.camera_target = super; gRoomControls.unk5 = 1; if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) { @@ -312,7 +312,7 @@ void Object8E_Type4(Object8EEntity* this) { } } else { super->action = 2; - super->timer = 0x3c; + super->timer = 60; gRoomControls.camera_target = &gPlayerEntity; SoundReq(SFX_134); } diff --git a/src/object/objectA8.c b/src/object/objectA8.c index 98baa343..3830a672 100644 --- a/src/object/objectA8.c +++ b/src/object/objectA8.c @@ -93,7 +93,7 @@ void ObjectA8_Action1(ObjectA8Entity* this) { if (super->timer != 0) { super->timer *= 0x1e; } else { - super->timer = 0xf0; + super->timer = 240; } super->action = 3; super->subtimer = 1; @@ -147,7 +147,7 @@ void ObjectA8_Action3(ObjectA8Entity* this) { if (--super->subtimer == 0) { u32 rand = Random(); super->flags |= ENT_COLLIDE; - super->subtimer = 0x20; + super->subtimer = 32; super->speed = gUnk_0812484C[rand >> 8 & 1]; if (sub_0809FE9C(this)) { super->direction = rand & 0x1f; @@ -184,7 +184,7 @@ void ObjectA8_Action4(ObjectA8Entity* this) { void ObjectA8_Action5(ObjectA8Entity* this) { super->action = 6; - super->timer = 0x80; + super->timer = 128; super->subtimer = 6; super->flags &= ~ENT_COLLIDE; super->spriteSettings.draw = 1; diff --git a/src/object/objectAB.c b/src/object/objectAB.c index ce6cd1fb..8f232604 100644 --- a/src/object/objectAB.c +++ b/src/object/objectAB.c @@ -43,7 +43,7 @@ void ObjectAB_Action1(Entity* this) { void ObjectAB_Action2(Entity* this) { if (CheckRoomFlag(1)) { sub_080A0190(this); - RequestPriorityDuration(this, 0x1e); + RequestPriorityDuration(this, 30); if (EntityInRectRadius(this, &gPlayerEntity, 0x10, 0x10)) { CreateHoleManager(0x37); } diff --git a/src/object/objectB2.c b/src/object/objectB2.c index 7cbff895..ceefcfac 100644 --- a/src/object/objectB2.c +++ b/src/object/objectB2.c @@ -8,7 +8,7 @@ void ObjectB2(Entity* this) { if (this->action == 0) { this->action = 1; - this->timer = 0x10; + this->timer = 16; this->direction = this->type << 3; if (this->collisionLayer == 2) { collisionData = gMapTop.collisionData; diff --git a/src/object/objectB4.c b/src/object/objectB4.c index 4e3cd462..32c9255a 100644 --- a/src/object/objectB4.c +++ b/src/object/objectB4.c @@ -112,7 +112,7 @@ void ObjectB4_Type2(Entity* this) { this->spritePriority.b0 = 0; this->spriteOrientation.flipY = 1; this->frameIndex = 11; - this->timer = (Random() & 0x3f) + 0x40; + this->timer = (Random() & 0x3f) + 64; this->subtimer = 0; } @@ -120,7 +120,7 @@ void ObjectB4_Type2(Entity* this) { this->timer = 4; this->frameIndex = gUnk_08124B30[this->subtimer++] + 2; if (gUnk_08124B30[this->subtimer] == 0xff) { - this->timer = (Random() & 0x3f) + 0x40; + this->timer = (Random() & 0x3f) + 64; this->subtimer = 0; } } diff --git a/src/object/objectBlockingStairs.c b/src/object/objectBlockingStairs.c index 9101022c..417a3be7 100644 --- a/src/object/objectBlockingStairs.c +++ b/src/object/objectBlockingStairs.c @@ -114,8 +114,8 @@ void ObjectBlockingStairs_Action1(ObjectBlockingStairsEntity* this) { super->action = 3; super->direction = Direction8FromAnimationState(gPlayerEntity.animationState); super->speed = 0x80; - super->timer = 0x40; - RequestPriorityDuration(super, 0x50); + super->timer = 64; + RequestPriorityDuration(super, 80); EnqueueSFX(SFX_10F); sub_08093248(this); return; @@ -162,7 +162,7 @@ void ObjectBlockingStairs_Action2(ObjectBlockingStairsEntity* this) { gPlayerEntity.x.HALF.LO = 0; gPlayerEntity.y.HALF.LO = 0; super->direction = (gPlayerEntity.animationState ^ 4) << 2; - super->timer = 0x40; + super->timer = 64; EnqueueSFX(SFX_10F); sub_08093248(this); } diff --git a/src/object/objectE.c b/src/object/objectE.c index c5b05304..3f8319b8 100644 --- a/src/object/objectE.c +++ b/src/object/objectE.c @@ -13,7 +13,7 @@ void ObjectE(Entity* this) { if (this->action == 0) { this->action = 1; - this->timer = 0x14; + this->timer = 20; sub_08004168(this); } else { if (this->timer-- == 0) { diff --git a/src/object/octorokBossObject.c b/src/object/octorokBossObject.c index 7d47d15d..fc90f935 100644 --- a/src/object/octorokBossObject.c +++ b/src/object/octorokBossObject.c @@ -49,7 +49,7 @@ void OctorokBossObject_Init(Entity* this) { case 0: this->field_0x78.HALF.HI = 0x96; this->timer = 0; - this->subtimer = 0x1e; + this->subtimer = 30; case 1: InitializeAnimation(this, 0); EnqueueSFX(SFX_124); @@ -177,7 +177,7 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc", } if ((u32)this->timer == GET_HELPER(this)->tailCount - 1) { this->action = 2; - this->timer = 0xf0; + this->timer = 240; this->direction = gUnk_0812384C[(this->type2 & 0xf) * 2] + ((u8)Random() & 0xf); this->speed = gUnk_0812384C[(this->type2 & 0xf) * 2 + 1] + ((u16)Random() & 0x1ff); if (this->type != 0) { diff --git a/src/object/picoBloom.c b/src/object/picoBloom.c index 37b6a751..184fac91 100644 --- a/src/object/picoBloom.c +++ b/src/object/picoBloom.c @@ -26,7 +26,7 @@ void PicoBloom_Init(Entity* this) { nextAction = 2; } this->action = nextAction; - this->timer = (Random() & 0x7f) + 0x7f; + this->timer = (Random() & 0x7f) + 127; this->collisionLayer = 1; UpdateSpriteForCollisionLayer(this); InitializeAnimation(this, typeAnimationStates[this->type] + this->type2); diff --git a/src/object/pullableLever.c b/src/object/pullableLever.c index e3c762e4..59bdfc9a 100644 --- a/src/object/pullableLever.c +++ b/src/object/pullableLever.c @@ -229,7 +229,7 @@ void sub_0809153C(PullableLeverEntity* this) { SetFlag(this->pulledFlag); } else { if (--super->subtimer == 0) { - super->subtimer = 0x10; + super->subtimer = 16; EnqueueSFX(SFX_10F); } } diff --git a/src/object/pushableFurniture.c b/src/object/pushableFurniture.c index c7f05ffe..3685a0e4 100644 --- a/src/object/pushableFurniture.c +++ b/src/object/pushableFurniture.c @@ -79,7 +79,7 @@ void PushableFurniture_Action1(PushableFurnitureEntity* this) { case 0: if (sub_0808FECC(this)) { super->subAction = 1; - super->timer = 0xc; + super->timer = 12; } break; case 1: @@ -189,10 +189,10 @@ bool32 sub_0808FC5C(PushableFurnitureEntity* this) { if (this->unk_80 == 0) { super->timer = 4; } else { - super->timer = 0x18; + super->timer = 24; } if ((gPlayerState.flags & PL_MINISH) == 0) { - super->timer += 0x10; + super->timer += 16; } sub_0808FF50(this); return TRUE; @@ -215,19 +215,19 @@ void sub_0808FD44(PushableFurnitureEntity* this, u32 param_2) { } if ((gPlayerState.flags & PL_MINISH) != 0) { super->speed = 0x40; - super->timer = 0x20; + super->timer = 32; } else { super->speed = 0x80; - super->timer = 0x10; + super->timer = 16; } } else { tmp = this->unk_7c; if ((gPlayerState.flags & PL_MINISH) != 0) { super->speed = 0x40; - super->timer = 0x40; + super->timer = 64; } else { super->speed = 0x80; - super->timer = 0x20; + super->timer = 32; } } EnqueueSFX(SFX_10F); diff --git a/src/object/pushableGrave.c b/src/object/pushableGrave.c index 04d97a5a..c3cf2ba5 100644 --- a/src/object/pushableGrave.c +++ b/src/object/pushableGrave.c @@ -94,16 +94,16 @@ void PushableGrave_Action2(PushableGraveEntity* this) { if (super->subAction == 0) { if (--super->subtimer == 0) { super->subAction = 1; - super->subtimer = 0x78; + super->subtimer = 120; gRoomControls.camera_target = super; gRoomControls.unk5 = 2; } } else { if (--super->subtimer == 0) { super->action = 3; - super->timer = 0x60; - super->subtimer = 0x14; - RequestPriorityDuration(super, 0x60); + super->timer = 96; + super->subtimer = 20; + RequestPriorityDuration(super, 96); SoundReq(SFX_10F); } } @@ -152,7 +152,7 @@ bool32 sub_0809785C(PushableGraveEntity* this) { if (super->type2 != 0) { if ((CheckFlags(this->pushedFlag) != 0) || GetTileType(this->unk_68, super->collisionLayer) == 0x403f) { super->action = 3; - super->timer = 0x40; + super->timer = 64; super->subtimer = 0; super->direction = 0; super->speed = 0x40; @@ -177,8 +177,8 @@ bool32 sub_0809785C(PushableGraveEntity* this) { if (CheckFlags(this->pushedFlag) != 0) { super->action = 2; super->subAction = 0; - super->timer = 0xf0; - super->subtimer = 0x3c; + super->timer = 240; + super->subtimer = 60; super->direction = 0; super->speed = 0x40; RestorePrevTileEntity(this->unk_68, super->collisionLayer); diff --git a/src/object/pushableLever.c b/src/object/pushableLever.c index bdd17fa9..5eddfe98 100644 --- a/src/object/pushableLever.c +++ b/src/object/pushableLever.c @@ -55,7 +55,7 @@ void PushableLever_Idle(PushableLeverEntity* this) { super->spriteOffsetY = 0; SetTile(this->tileIndex, this->tilePosition, super->collisionLayer); EnqueueSFX(SFX_16A); - RequestPriorityDuration(super, 0x1e); + RequestPriorityDuration(super, 30); if (PlayerCanBeMoved()) { gPlayerState.pushedObject = 0x90; gPlayerState.queued_action = 5; @@ -81,7 +81,7 @@ void PushableLever_Pushing(PushableLeverEntity* this) { void PushableLever_SetIdle(PushableLeverEntity* this) { super->action = IDLE; - this->timer = 0x3c; + this->timer = 60; PushableLever_SetTiles(this); } @@ -109,7 +109,7 @@ bool32 PushableLever_ShouldStartPushing(PushableLeverEntity* this) { PushableLever_CalculateSpriteOffsets(this); SetTile(PushableLever_Tiles[super->type2], this->tilePosition, super->collisionLayer); } else { - this->timer = 0x3c; + this->timer = 60; super->spriteOffsetX = 0; super->spriteOffsetY = 0; } diff --git a/src/object/pushableStatue.c b/src/object/pushableStatue.c index c94f81fb..2a7fbf3e 100644 --- a/src/object/pushableStatue.c +++ b/src/object/pushableStatue.c @@ -226,7 +226,7 @@ bool32 sub_080895C0(PushableStatueEntity* this) { super->y.HALF.HI += gUnk_08120CBC[(super->direction >> 2) + 1]; sub_08089454(this); super->action = 4; - super->timer = 0x3c; + super->timer = 60; } sub_0800445C(super); return FALSE; diff --git a/src/object/railtrack.c b/src/object/railtrack.c index 187dd928..e4ffbce2 100644 --- a/src/object/railtrack.c +++ b/src/object/railtrack.c @@ -91,7 +91,7 @@ void sub_08085308(Entity* this) { break; case 3: if (CheckFlags(this->field_0x86.HWORD) == *(u16*)&this->field_0x7a) { - this->subtimer = 0xff; + this->subtimer = 255; } else { this->subtimer = 1; } diff --git a/src/object/smallIceBlock.c b/src/object/smallIceBlock.c index 6ba2940f..1a771c05 100644 --- a/src/object/smallIceBlock.c +++ b/src/object/smallIceBlock.c @@ -92,7 +92,7 @@ void SmallIceBlock_Action1(SmallIceBlockEntity* this) { switch (sub_08099618(tileType)) { case 1: super->action = 2; - super->timer = 0x16; + super->timer = 22; super->direction = ((tileType - 0x5b) & 3) << 3; super->speed = 0x20; sub_080994B8(this); @@ -147,7 +147,7 @@ void SmallIceBlock_Action3(SmallIceBlockEntity* this) { SoundReq(SFX_SECRET); } super->action = 4; - super->timer = 0x3c; + super->timer = 60; super->flags &= 0x7f; } diff --git a/src/object/smoke.c b/src/object/smoke.c index 8f76ea10..64d7d974 100644 --- a/src/object/smoke.c +++ b/src/object/smoke.c @@ -21,10 +21,10 @@ void sub_0808A40C(Entity* this) { if (this->action == 0) { this->action = 1; - this->timer = 0x28; + this->timer = 40; } if (--this->timer == 0) { - this->timer = 0x40 - (Random() & 0x1f); + this->timer = 64 - (Random() & 0x1F); ent = CreateObject(SMOKE, 1, 0); if (ent != NULL) { CopyPosition(this, ent); diff --git a/src/object/thoughtBubble.c b/src/object/thoughtBubble.c index eb3bf5e6..14e9a38a 100644 --- a/src/object/thoughtBubble.c +++ b/src/object/thoughtBubble.c @@ -24,7 +24,7 @@ void ThoughtBubble_Init(Entity* this) { this->action = 1; this->spriteSettings.draw = 1; if (this->timer == 0) { - this->timer = 0x2d; + this->timer = 45; } this->spriteOrientation.flipY = 1; InitializeAnimation(this, this->type2); diff --git a/src/object/treeHidingPortal.c b/src/object/treeHidingPortal.c index 6756d82f..8778f3c8 100644 --- a/src/object/treeHidingPortal.c +++ b/src/object/treeHidingPortal.c @@ -50,7 +50,7 @@ void sub_0809E86C(Entity* this) { } if (sub_0809E9A0() == 0x54) { this->action = 2; - this->timer = 0xf; + this->timer = 15; SetPlayerControl(1); } } @@ -58,7 +58,7 @@ void sub_0809E86C(Entity* this) { void sub_0809E8BC(Entity* this) { if (--this->timer == 0) { this->action = 3; - this->timer = 0x3c; + this->timer = 60; this->spriteSettings.draw = 0; sub_0809E96C(this); sub_0809E918(this); diff --git a/src/object/warpPoint.c b/src/object/warpPoint.c index c558ce37..47d70538 100644 --- a/src/object/warpPoint.c +++ b/src/object/warpPoint.c @@ -51,12 +51,12 @@ void sub_0808B474(Entity* this) { if (!sub_0808B7C8(this)) return; this->action = 4; - this->subtimer = 0x60; + this->subtimer = 96; gPlayerEntity.x.HALF.HI = this->x.HALF.HI; gPlayerEntity.y.HALF.HI = this->y.HALF.HI; gPlayerEntity.animationState = 4; EnqueueSFX(SFX_112); - RequestPriorityDuration(this, this->subtimer + 0x10); + RequestPriorityDuration(this, this->subtimer + 16); } void sub_0808B530(Entity* this) { @@ -85,13 +85,13 @@ void sub_0808B590(Entity* this) { if (this->timer) return; this->action = 5; - this->subtimer = 0x60; + this->subtimer = 96; PutAwayItems(); gPlayerEntity.x.HALF.HI = this->x.HALF.HI; gPlayerEntity.y.HALF.HI = this->y.HALF.HI; gPlayerEntity.animationState = 4; gPlayerEntity.flags &= ~ENT_COLLIDE; - RequestPriorityDuration(this, this->subtimer + 0x10); + RequestPriorityDuration(this, this->subtimer + 16); SoundReq(SFX_113); } else { this->timer = 0; diff --git a/src/object/windTribeTeleporter.c b/src/object/windTribeTeleporter.c index 5e4cb50e..f397feec 100644 --- a/src/object/windTribeTeleporter.c +++ b/src/object/windTribeTeleporter.c @@ -76,19 +76,19 @@ void WindTribeTeleporter_Action1(WindTribeTeleporterEntity* this) { void WindTribeTeleporter_Action2(WindTribeTeleporterEntity* this) { switch (super->subAction) { case 0: - super->timer = 0x1e; + super->timer = 30; super->subAction++; break; case 1: if (--super->timer == 0) { super->subAction++; - super->timer = 0x1e; + super->timer = 30; } break; case 2: if (--super->timer == 0) { super->subAction++; - super->timer = 0x1e; + super->timer = 30; SoundReq(SFX_113); } else { if ((gRoomTransition.frameCount & 7) == 0) { @@ -99,7 +99,7 @@ void WindTribeTeleporter_Action2(WindTribeTeleporterEntity* this) { case 3: if (--super->timer == 0) { super->subAction++; - super->timer = 0x1e; + super->timer = 30; } else { if ((gRoomTransition.frameCount & 3) == 0) { gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6; @@ -132,7 +132,7 @@ void WindTribeTeleporter_Action3(WindTribeTeleporterEntity* this) { switch (super->subAction) { case 0: super->subAction = 1; - super->timer = 0x1e; + super->timer = 30; SoundReq(SFX_114); break; case 1: @@ -142,13 +142,13 @@ void WindTribeTeleporter_Action3(WindTribeTeleporterEntity* this) { } } else { super->subAction++; - super->timer = 0x1e; + super->timer = 30; } break; case 2: if (--super->timer == 0) { super->subAction++; - super->timer = 0x1e; + super->timer = 30; } else { if ((gRoomTransition.frameCount & 3) == 0) { gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6; diff --git a/src/player.c b/src/player.c index 99ab57f3..92452736 100644 --- a/src/player.c +++ b/src/player.c @@ -649,7 +649,7 @@ static void PlayerBounceInit(Entity* this) { this->timer = gPlayerState.field_0x38; this->spriteIndex = 1; - if ((gPlayerState.flags & PL_MINISH) == 0) { + if (!(gPlayerState.flags & PL_MINISH)) { this->zVelocity = BOUNCE_SPEED_Z; gPlayerState.animation = 0x114; InitScreenShake(16, 0); @@ -702,7 +702,7 @@ static void PlayerBounceUpdate(Entity* this) { this->timer = 8; this->subAction++; - if ((gPlayerState.flags & PL_MINISH) == 0) + if (!(gPlayerState.flags & PL_MINISH)) gPlayerState.animation = DEFAULT_ANIM; } @@ -956,16 +956,16 @@ static void PlayerDrownInit(Entity* this) { this->spritePriority.b1 = 0; if (gPlayerState.flags & PL_MINISH) { - this->timer = 0x3c; + this->timer = 60; gPlayerState.animation = 0xc19; SoundReq(SFX_WATER_SPLASH); } else { - if ((gPlayerState.flags & PL_FLAGS10000) == 0) + if (!(gPlayerState.flags & PL_FLAGS10000)) sub_08004168(this); CreateFx(this, FX_WATER_SPLASH, 0); - if ((gPlayerState.flags & PL_NO_CAP) == 0) + if (!(gPlayerState.flags & PL_NO_CAP)) gPlayerState.animation = 0x72c; else gPlayerState.animation = 0x44c; @@ -980,7 +980,7 @@ static void sub_080712F0(Entity* this) { temp = FALSE; - if ((gPlayerState.flags & PL_MINISH) != 0) { + if (gPlayerState.flags & PL_MINISH) { if (--this->timer == 0) temp = TRUE; } else if ((this->frame & ANIM_DONE) != 0) { @@ -990,15 +990,14 @@ static void sub_080712F0(Entity* this) { temp = TRUE; } - if (temp == FALSE) - return; - - this->knockbackDuration = 0; - this->iframes = 32; - this->spritePriority.b1 = 1; - this->spriteSettings.draw = FALSE; - gPlayerState.flags &= ~PL_DROWNING; - RespawnPlayer(); + if (temp) { + this->knockbackDuration = 0; + this->iframes = 32; + this->spritePriority.b1 = 1; + this->spriteSettings.draw = FALSE; + gPlayerState.flags &= ~PL_DROWNING; + RespawnPlayer(); + } } static void PlayerUsePortal(Entity* this) { @@ -1014,7 +1013,7 @@ static void PlayerUsePortal(Entity* this) { if ((this->subAction == 7) || (this->subAction < 3)) return; - if ((gPlayerState.flags & PL_USE_PORTAL) == 0) + if (!(gPlayerState.flags & PL_USE_PORTAL)) return; if ((gInput.newKeys & (B_BUTTON | R_BUTTON)) == 0) @@ -1202,7 +1201,7 @@ static void PortalShrinkUpdate(Entity* this) { } if (*(u32*)&this->cutsceneBeh >= 0x340) { this->timer = 8; - this->subtimer = 0x1e; + this->subtimer = 30; this->subAction = 6; } else { *(u32*)&this->cutsceneBeh += uVar5 * 2; @@ -1538,7 +1537,7 @@ static void sub_08071CAC(Entity* this) { gPlayerState.animation = temp; this->subAction = 2; - this->timer = 0xf0; + this->timer = 240; SoundReq(SFX_PLY_VO7); } } @@ -1761,16 +1760,17 @@ static void sub_08072064(Entity* this) { static void sub_08072098(Entity* this) { UpdateAnimationSingleFrame(this); - if (this->timer != 0) - if (this->timer-- != 0) + if (this->timer != 0) { + if (this->timer-- != 0) { return; - else - ; - else if ((this->frame & ANIM_DONE) == 0) + } + } else if ((this->frame & ANIM_DONE) == 0) { return; + } - if (this->health != 0) + if (this->health != 0) { COLLISION_ON(this); + } SetPlayerActionNormal(); } @@ -1910,7 +1910,7 @@ static void sub_08072354(Entity* this) { this->spritePriority.b1 = 0; this->knockbackDuration = 0; this->subAction = 2; - this->timer = 0x3c; + this->timer = 60; gPlayerState.animation = 0x2c1; gPlayerState.flags &= ~PL_BURNING; UpdateSpriteForCollisionLayer(this); @@ -2067,7 +2067,7 @@ static void PlayerRollInit(Entity* this) { static void PlayerRollUpdate(Entity* this) { if (((gPlayerState.flags & (PL_ROLLING | PL_MOLDWORM_CAPTURED)) != PL_ROLLING) || - ((gPlayerState.flags & PL_MOLDWORM_RELEASED) == 0 && (this->iframes != 0) && (this->contactFlags & 0x80))) { + (!(gPlayerState.flags & PL_MOLDWORM_RELEASED) && (this->iframes != 0) && (this->contactFlags & 0x80))) { gPlayerState.flags &= ~PL_ROLLING; if (CheckQueuedAction()) return; @@ -2077,11 +2077,11 @@ static void PlayerRollUpdate(Entity* this) { } this->direction = Direction8FromAnimationState(AnimationStateIdle(this->animationState)); - if (((gPlayerState.flags & PL_MINISH) == 0) && (this->timer-- == 0)) { + if (!(gPlayerState.flags & PL_MINISH) && (this->timer-- == 0)) { CreateFx(&gPlayerEntity, FX_DASH, 0x40); this->timer = 4; } - if ((gPlayerState.flags & PL_FLAGS2) == 0) { + if (!(gPlayerState.flags & PL_FLAGS2)) { UpdateFloorType(); } if (CheckQueuedAction()) { @@ -2127,7 +2127,7 @@ static void PlayerRollUpdate(Entity* this) { CheckPlayerVelocity(); UpdatePlayerMovement(); } - if (((this->frame & 0x10) == 0) && ((gPlayerState.flags & PL_MINISH) == 0)) { + if (((this->frame & 0x10) == 0) && !(gPlayerState.flags & PL_MINISH)) { // dont take damage this->hurtType = 0; } @@ -2152,12 +2152,12 @@ static void PlayerWaitForScroll(Entity* this) { if (gPlayerState.swim_state != 0) this->speed = 0; - if ((gPlayerState.flags & PL_HIDDEN) == 0) + if (!(gPlayerState.flags & PL_HIDDEN)) gPlayerEntity.spriteSettings.draw = 3; - if ((gPlayerState.flags & PL_MINISH) == 0) + if (!(gPlayerState.flags & PL_MINISH)) gPlayerEntity.spritePriority.b1 = 1; - if ((gRoomControls.scroll_flags & 4) == 0) { + if (!(gRoomControls.scroll_flags & 4)) { if (gPlayerState.flags & PL_HIDDEN) COLLISION_ON(this); ResetPlayerAnimationAndAction(); @@ -2205,7 +2205,7 @@ static void PlayerInHoleUpdate(Entity* this) { if (this->frame & ANIM_DONE) { if (this->timer == 1) { this->subAction = 3; - this->timer = 0x28; + this->timer = 40; this->spritePriority.b1 = 1; gPlayerState.animation = 0x624; return; @@ -2244,7 +2244,7 @@ static void sub_08072ACC(Entity* this) { static void sub_08072B5C(Entity* this) { u32 temp; - sub_080042BA(this, ((0x28 - this->timer) >> 4) + 1); + sub_080042BA(this, ((40 - this->timer) >> 4) + 1); sub_0806F948(this); if (this->timer != 0) { this->timer--; @@ -3081,7 +3081,7 @@ void sub_08073B8C(Entity* this) { } gPlayerState.jump_status++; this->timer = 15; - InitScreenShake(0x10, 0); + InitScreenShake(16, 0); SoundReq(SFX_14C); } } diff --git a/src/playerItem/playerItemBomb.c b/src/playerItem/playerItemBomb.c index 34d1360c..af0450a6 100644 --- a/src/playerItem/playerItemBomb.c +++ b/src/playerItem/playerItemBomb.c @@ -48,7 +48,7 @@ void PlayerItemBomb(PlayerItemBombEntity* this) { super->timer -= 1; } if (super->timer == 0) { - super->subtimer = 0x50; + super->subtimer = 80; this->unk_68 = 0; super->spriteRendering.b0 = 3; SetAffineInfo(super, 0x100, 0x100, 0); @@ -61,7 +61,7 @@ void PlayerItemBomb(PlayerItemBombEntity* this) { } super->action = 0x03; super->spritePriority.b1 = 2; - super->timer = 0x0f; + super->timer = 15; super->spriteSettings.draw = 0; sub_0805EC60(super); FreeCarryEntity(super); @@ -81,12 +81,12 @@ void sub_0801B250(PlayerItemBombEntity* this) { super->spritePriority.b1 = 3; super->flags &= 0x7f; if (super->type == 0xff) { - super->timer = 0x3c; + super->timer = 60; } else if (super->type == 0xfe) { - super->timer = 0x0f; + super->timer = 15; super->type = 0xff; } else { - super->timer = 0x96; + super->timer = 150; } super->hitbox = (Hitbox*)&gUnk_080B77F4; super->carryFlags = 0; @@ -141,7 +141,7 @@ void sub_0801B368(PlayerItemBombEntity* this) { super->action -= 1; super->subAction = 0; if (0x3c < super->timer) { - super->timer = 0x3c; + super->timer = 60; } } diff --git a/src/playerItem/playerItemBottle.c b/src/playerItem/playerItemBottle.c index ad27462f..f7767a50 100644 --- a/src/playerItem/playerItemBottle.c +++ b/src/playerItem/playerItemBottle.c @@ -45,8 +45,8 @@ void PlayerItemBottle_Init(Entity* this) { this->hurtType = 0x1f; this->type = 1; this->type2 = ITEM_BOTTLE_EMPTY; - this->timer = 0x52; - this->subtimer = 0x1b; + this->timer = 82; + this->subtimer = 27; sub_0801766C(this); SoundReq(SFX_1DC); break; @@ -61,14 +61,14 @@ void PlayerItemBottle_Init(Entity* this) { case ITEM_BOTTLE_PICOLYTE_GREEN: case ITEM_BOTTLE_PICOLYTE_BLUE: case ITEM_BOTTLE_PICOLYTE_WHITE: - this->timer = 0xd5; - this->subtimer = 0x3c; + this->timer = 213; + this->subtimer = 60; break; case BOTTLE_CHARM_NAYRU: case BOTTLE_CHARM_FARORE: case BOTTLE_CHARM_DIN: default: - this->timer = 0x37; + this->timer = 55; this->subtimer = 0; } this->action = 1; diff --git a/src/playerItem/playerItemBow.c b/src/playerItem/playerItemBow.c index 5451585f..6f9014ef 100644 --- a/src/playerItem/playerItemBow.c +++ b/src/playerItem/playerItemBow.c @@ -161,7 +161,7 @@ void sub_0801917C(PlayerItemBowEntity* this) { } if ((sub_080B1BA4(COORD_TO_TILE(super), gPlayerEntity.collisionLayer, 0x80) == 0) && (!tmp2) && sub_080040D8(super, &gUnk_08003E44, super->x.HALF.HI, super->y.HALF.HI) != 0) { - super->timer = 0x1e; + super->timer = 30; super->action++; if (super->hurtType == 0x0e) { sub_08019468(this); diff --git a/src/playerItem/playerItemCellOverwriteSet.c b/src/playerItem/playerItemCellOverwriteSet.c index 20636f7b..5a5ff939 100644 --- a/src/playerItem/playerItemCellOverwriteSet.c +++ b/src/playerItem/playerItemCellOverwriteSet.c @@ -36,7 +36,7 @@ void PlayerItemCellOverwriteSet(Entity* this) { } if ((gInput.heldKeys & (DPAD_LEFT | DPAD_RIGHT)) != 0) { if (++this->subtimer > 0x1e) { - this->subtimer = 0x1e; + this->subtimer = 30; if ((gInput.heldKeys & DPAD_RIGHT) != 0) { this->field_0x6c.HWORD--; } diff --git a/src/playerItem/playerItemGustBig.c b/src/playerItem/playerItemGustBig.c index 6a46fe94..7e69b965 100644 --- a/src/playerItem/playerItemGustBig.c +++ b/src/playerItem/playerItemGustBig.c @@ -65,7 +65,7 @@ void sub_08018CBC(Entity* this) { if (pEVar3 != NULL) { this->action = 1; COLLISION_OFF(this); - this->timer = 0x56; + this->timer = 86; this->hurtType = 0x1c; this->damage = 6; this->hitbox = (Hitbox*)&gUnk_080B3E18; diff --git a/src/playerItem/playerItemGustJar.c b/src/playerItem/playerItemGustJar.c index e140d3a3..fcd04f00 100644 --- a/src/playerItem/playerItemGustJar.c +++ b/src/playerItem/playerItemGustJar.c @@ -28,7 +28,7 @@ void PlayerItemGustJar(Entity* this) { void PlayerItemGustJar_Init(Entity* this) { this->action = 1; - this->subtimer = 0xf; + this->subtimer = 15; this->hitbox = &gUnk_08132B28; this->hitbox->unk2[2] = 3; this->hitbox->unk2[1] = 3; diff --git a/src/playerItem/playerItemLantern.c b/src/playerItem/playerItemLantern.c index 53aa62b2..84673867 100644 --- a/src/playerItem/playerItemLantern.c +++ b/src/playerItem/playerItemLantern.c @@ -18,8 +18,8 @@ void PlayerItemLantern(Entity* this) { void sub_08054A60(Entity* this) { this->flags |= (ENT_PERSIST | ENT_COLLIDE); - this->action = 0x01; - this->timer = 0x04; + this->action = 1; + this->timer = 4; this->frameIndex = -1; // TODO regalloc and mov 6 too early this->updatePriority = 6; diff --git a/src/playerItem/playerItemSwordBeam.c b/src/playerItem/playerItemSwordBeam.c index ec5160db..9231a294 100644 --- a/src/playerItem/playerItemSwordBeam.c +++ b/src/playerItem/playerItemSwordBeam.c @@ -70,7 +70,7 @@ void sub_08019580(Entity* this) { if (--*(int*)&this->field_0x6c != -1) { GetNextFrame(this); LinearMoveUpdate(this); - this->timer += 0x01; + this->timer += 1; if (this->type2 == 0) { sub_0800451C(this); } diff --git a/src/playerUtils.c b/src/playerUtils.c index 684693eb..8a7a140f 100644 --- a/src/playerUtils.c +++ b/src/playerUtils.c @@ -235,7 +235,7 @@ bool32 sub_080777A0(void) { if ((gArea.unk1A == 0) && ((gPlayerState.flags & PL_MINISH) != 0)) { gPlayerEntity.subAction += 1; gPlayerEntity.flags &= ~ENT_COLLIDE; - RequestPriorityDuration(&gPlayerEntity, 0xb4); + RequestPriorityDuration(&gPlayerEntity, 180); return TRUE; } return FALSE; @@ -771,7 +771,7 @@ bool32 sub_08078108(ChargeState* state) { } bool32 sub_08078124(ChargeState* state) { - state->chargeTimer -= 0x10; + state->chargeTimer -= 16; if (state->chargeTimer < 0) { state->chargeTimer = 0; state->action = 2; @@ -2201,7 +2201,7 @@ void sub_0807B1A8(PlayerEntity* this) { void sub_0807B1DC(PlayerEntity* this) { this->unk_6e++; - super->timer = 0x1e; + super->timer = 30; } void sub_0807B1EC(PlayerEntity* this) { @@ -2220,7 +2220,7 @@ void sub_0807B21C(PlayerEntity* this) { GravityUpdate(super, Q_8_8(8.0)); } if (super->zVelocity < -Q_16_16(0.5)) { - super->timer = 0x78; + super->timer = 120; super->subtimer = 0; this->unk_6e++; this->unk_68 = super->z.WORD; @@ -2236,7 +2236,7 @@ void sub_0807B264(PlayerEntity* this) { tmp <<= 0x10; super->z.WORD = this->unk_68 + tmp; if (--super->timer == 0) { - super->timer = 0x50; + super->timer = 80; super->zVelocity = Q_16_16(0.5); this->unk_6e++; #ifndef EU diff --git a/src/projectile/arrowProjectile.c b/src/projectile/arrowProjectile.c index a90e3016..275a34fd 100644 --- a/src/projectile/arrowProjectile.c +++ b/src/projectile/arrowProjectile.c @@ -44,7 +44,7 @@ void ArrowProjectile_Init(Entity* this) { this->action = 1; this->spriteSettings.draw = 1; COLLISION_OFF(this); - this->timer = 0x6a; + this->timer = 106; this->subtimer = 0; this->zVelocity = Q_16_16(10.0 / 256.0); sub_080A94C0(this, this->type); @@ -70,7 +70,7 @@ void ArrowProjectile_Action2(Entity* this) { if (this->collisions != COL_NONE) { this->action = 3; COLLISION_OFF(this); - this->timer = 0x20; + this->timer = 32; InitializeAnimation(this, this->animIndex + 2); EnqueueSFX(SFX_18A); LinearMoveUpdate(this); diff --git a/src/projectile/cannonballProjectile.c b/src/projectile/cannonballProjectile.c index 0276947b..2a83603e 100644 --- a/src/projectile/cannonballProjectile.c +++ b/src/projectile/cannonballProjectile.c @@ -78,7 +78,7 @@ bool32 sub_080AB634(Entity* this) { if (entities[i] != NULL && (IsColliding(this, entities[i]) != 0)) { if (entities[i]->action < 3) { entities[i]->action = 3; - entities[i]->timer = 0x1e; + entities[i]->timer = 30; entities[i]->spriteSettings.draw = 0; CreateFx(entities[i], FX_WHITE_ROCK, 0); } diff --git a/src/projectile/dekuSeedProjectile.c b/src/projectile/dekuSeedProjectile.c index f4ca7fbf..797de83c 100644 --- a/src/projectile/dekuSeedProjectile.c +++ b/src/projectile/dekuSeedProjectile.c @@ -36,7 +36,7 @@ void sub_080A8470(Entity* this) { void DekuSeedProjectile_Init(Entity* this) { this->action = 1; - this->timer = 0x30; + this->timer = 48; this->subtimer = 0; this->z.HALF.HI -= 4; if (CheckGlobalFlag(TABIDACHI) == 0) { diff --git a/src/projectile/gleerokProjectile.c b/src/projectile/gleerokProjectile.c index 7db97e98..b4957290 100644 --- a/src/projectile/gleerokProjectile.c +++ b/src/projectile/gleerokProjectile.c @@ -58,7 +58,7 @@ void GleerokProjectile_Init(Entity* this) { iVar2 = 0x400; } this->zVelocity = this->z.WORD / (iVar2 << 8) << 0xd; - this->subtimer = 0x1e; + this->subtimer = 30; break; case 2: this->zVelocity = (this->z.WORD / 0x18000) << 0xc; @@ -92,14 +92,14 @@ void GleerokProjectile_Action1(Entity* this) { GetNextFrame(this); LinearMoveUpdate(this); if ((this->type != 2) && (this->subtimer-- == 0)) { - this->subtimer = 0x1e; + this->subtimer = 30; sub_08004596(this, GetFacingDirection(this, &gPlayerEntity)); } if (GravityUpdate(this, 0) == 0) { this->action = 2; sub_080A90D8(this); if (this->type == 2) { - this->timer = 0xf; + this->timer = 15; InitializeAnimation(this, 0x54); } else { InitializeAnimation(this, 0x52); diff --git a/src/projectile/guardLineOfSight.c b/src/projectile/guardLineOfSight.c index 52c8cada..a55ded6b 100644 --- a/src/projectile/guardLineOfSight.c +++ b/src/projectile/guardLineOfSight.c @@ -46,7 +46,7 @@ void GuardLineOfSight(Entity* this) { } else { if (this->action == 0) { this->action = 1; - this->timer = 0x12; + this->timer = 18; this->spriteSettings.draw = 0; this->speed = 0x800; this->hitbox = (Hitbox*)&gUnk_080FD1E4; diff --git a/src/projectile/gyorgMaleEnergyProjectile.c b/src/projectile/gyorgMaleEnergyProjectile.c index 4fb25abe..c71a8e39 100644 --- a/src/projectile/gyorgMaleEnergyProjectile.c +++ b/src/projectile/gyorgMaleEnergyProjectile.c @@ -44,7 +44,7 @@ void sub_080AC8DC(Entity* this) { void GyorgMaleEnergyProjectile_Init(Entity* this) { this->action = 1; - this->timer = 0x3c; + this->timer = 60; this->collisionLayer = 2; UpdateSpriteForCollisionLayer(this); InitializeAnimation(this, 0); diff --git a/src/projectile/gyorgTail.c b/src/projectile/gyorgTail.c index 586c90bd..866d9c22 100644 --- a/src/projectile/gyorgTail.c +++ b/src/projectile/gyorgTail.c @@ -355,7 +355,7 @@ void sub_080AC884(Entity* this) { if (this->parent->field_0x70.HALF_U.HI != 0) { this->parent->field_0x70.HALF_U.HI = 0; this->action = 2; - this->timer = 0x3c; - this->subtimer = 0x56; + this->timer = 60; + this->subtimer = 86; } } diff --git a/src/projectile/lakituLightning.c b/src/projectile/lakituLightning.c index 6e1e93f7..e89834a9 100644 --- a/src/projectile/lakituLightning.c +++ b/src/projectile/lakituLightning.c @@ -25,7 +25,7 @@ void sub_080A9DD8(Entity* this) { void LakituLightning_Init(Entity* this) { this->action = 1; - this->timer = 0xb4; + this->timer = 180; this->health = 1; InitializeAnimation(this, 0); } diff --git a/src/projectile/mandiblesProjectile.c b/src/projectile/mandiblesProjectile.c index a468d8a1..976c096b 100644 --- a/src/projectile/mandiblesProjectile.c +++ b/src/projectile/mandiblesProjectile.c @@ -53,7 +53,7 @@ void sub_080A9EBC(Entity* this) { this->field_0x82.HALF.LO = 2; this->animationState = 0xff; sub_080AA270(this); - this->subtimer = 0x20; + this->subtimer = 32; } break; default: @@ -134,7 +134,7 @@ void MandiblesProjectile_Action3(Entity* this) { if ((this->frame & ANIM_DONE) != 0) { this->action = 4; this->field_0x82.HALF.LO = 3; - this->subtimer = 0x40; + this->subtimer = 64; uVar1 = entity->animationState; this->direction = uVar1 << 2; this->animationState = uVar1 << 0x1a >> 0x1a; @@ -186,7 +186,7 @@ void MandiblesProjectile_Action4(Entity* this) { entity->speed = 0; entity->field_0x82.HALF.LO = 1; entity->timer = 0; - entity->subtimer = 0x78; + entity->subtimer = 120; entity->field_0x80.HWORD = 0x20; sub_080AA3E0(entity, 1); } @@ -280,7 +280,7 @@ void sub_080AA320(Entity* this) { this->field_0x82.HALF.LO = 1; this->subtimer = 0; parent->action = 2; - parent->subtimer = 0x30; + parent->subtimer = 48; parent->field_0x80.HWORD = 0x50; parent->speed = 0; parent->direction = sub_08049F84(parent, 0); diff --git a/src/projectile/octorokBossProjectile.c b/src/projectile/octorokBossProjectile.c index d338e65c..6645191b 100644 --- a/src/projectile/octorokBossProjectile.c +++ b/src/projectile/octorokBossProjectile.c @@ -58,7 +58,7 @@ void OctorokBossProjectile_Init(Entity* this) { this->direction = this->direction - (Random() & 7); } this->speed = 0x200; - this->timer = 0x30; + this->timer = 48; LinearMoveAngle(this, 0x5000, this->direction); InitializeAnimation(this, 5); break; diff --git a/src/projectile/rockProjectile.c b/src/projectile/rockProjectile.c index 9b82fc4b..3124605a 100644 --- a/src/projectile/rockProjectile.c +++ b/src/projectile/rockProjectile.c @@ -26,7 +26,7 @@ void sub_080A8064(Entity* this) { void RockProjectile_Init(Entity* this) { this->action = 1; - this->timer = 0x30; + this->timer = 48; this->zVelocity = Q_16_16(0.625); InitializeAnimation(this, 0); } diff --git a/src/projectile/torchTrapProjectile.c b/src/projectile/torchTrapProjectile.c index 402dc60a..b3d86421 100644 --- a/src/projectile/torchTrapProjectile.c +++ b/src/projectile/torchTrapProjectile.c @@ -20,7 +20,7 @@ void sub_080AAB1C(Entity* this) { void TorchTrapProjectile_Init(Entity* this) { this->action = 1; - this->timer = 0x1e; + this->timer = 30; InitializeAnimation(this, 0); } diff --git a/src/projectile/v1DarkMagicProjectile.c b/src/projectile/v1DarkMagicProjectile.c index 00c1366d..d6c4b568 100644 --- a/src/projectile/v1DarkMagicProjectile.c +++ b/src/projectile/v1DarkMagicProjectile.c @@ -200,7 +200,7 @@ void sub_080AAF74(Entity* this) { this->field_0x80.HALF.LO += (Random() & 1) + 1; } if (++this->timer == 0x3c) { - this->timer = 0x1e; + this->timer = 30; gPlayerEntity.iframes = 8; ModHealth(-4); SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6); diff --git a/src/projectile/v1FireProjectile.c b/src/projectile/v1FireProjectile.c index 022b48f4..ea57dd16 100644 --- a/src/projectile/v1FireProjectile.c +++ b/src/projectile/v1FireProjectile.c @@ -73,7 +73,7 @@ void V1FireProjectile_Action1(Entity* this) { LinearMoveUpdate(this); if (GravityUpdate(this, 0) == 0) { this->action = 2; - this->timer = 0xf; + this->timer = 15; InitializeAnimation(this, 0x54); sub_080AB4A4(this); } else { diff --git a/src/projectile/v2Projectile.c b/src/projectile/v2Projectile.c index 072d745f..98e757bb 100644 --- a/src/projectile/v2Projectile.c +++ b/src/projectile/v2Projectile.c @@ -88,7 +88,7 @@ void sub_080ABC90(Entity* this) { void sub_080ABCC4(Entity* this) { this->action = 1; - this->timer = (Random() & 0x3f) + 0x30; + this->timer = (Random() & 0x3f) + 48; this->subtimer = 0; this->direction = Random() & 0x1f; this->field_0x74.HWORD = TILE(this->x.HALF.HI, this->y.HALF.HI); @@ -159,7 +159,7 @@ void sub_080ABE88(Entity* this) { void sub_080ABEA8(Entity* this) { this->action = 1; - this->timer = 0x60; + this->timer = 96; this->spritePriority.b0 = 2; this->gustJarFlags = 1; if (this->type2 == 0) { diff --git a/src/projectile/v3ElectricProjectile.c b/src/projectile/v3ElectricProjectile.c index bbbec2ab..beec1f6a 100644 --- a/src/projectile/v3ElectricProjectile.c +++ b/src/projectile/v3ElectricProjectile.c @@ -31,7 +31,7 @@ void sub_080ABFEC(Entity* this) { case 0: { this->action = 1; this->timer = 0; - this->subtimer = 0x7; + this->subtimer = 7; this->cutsceneBeh.HALF.HI = 0x18; this->damage = 0x88; CopyPositionAndSpriteOffset(this->parent, this); @@ -51,7 +51,7 @@ void sub_080ABFEC(Entity* this) { default: { this->action = 2; this->timer = 0; - this->subtimer = 0xff; + this->subtimer = 255; this->speed = projectileSpeeds[this->type2]; this->damage = 0x88; sound = SFX_193; @@ -82,7 +82,7 @@ void V3ElectricProjectile_Action1(Entity* this) { SoundReq(SFX_193); } else { this->action = 3; - this->timer = 0x10; + this->timer = 16; } this->z.HALF.HI -= 0x28; } @@ -146,7 +146,7 @@ void sub_080AC200(Entity* this) { if (--this->timer) return; - this->timer = 0x10; + this->timer = 16; proj = CreateProjectile(V3_ELECTRIC_PROJECTILE); if (proj) { diff --git a/src/staffroll.c b/src/staffroll.c index d31ea833..632aa62c 100644 --- a/src/staffroll.c +++ b/src/staffroll.c @@ -65,7 +65,7 @@ void StaffrollTask_State0(void) { SetGlobalFlag(GAMECLEAR); gMain.state = 1; gStaffrollMenu.base.menuType = 0; - gStaffrollMenu.base.transitionTimer = 0xb4; + gStaffrollMenu.base.transitionTimer = 180; gStaffrollMenu.unk_16 = 5; gStaffrollMenu.unk_17 = 4; gStaffrollMenu.bgmMusicStarted = 0; @@ -241,7 +241,7 @@ void StaffrollTask_State2(void) { switch (gStaffrollMenu.base.overlayType) { case 0: gStaffrollMenu.base.overlayType = 1; - gStaffrollMenu.base.transitionTimer = 0x1e; + gStaffrollMenu.base.transitionTimer = 30; gStaffrollMenu.base.field_0x3 = 0; DispReset(1); InitSoundPlayingInfo(); @@ -278,7 +278,7 @@ void StaffrollTask_State2(void) { tmp = 2; } gStaffrollMenu.base.overlayType = tmp; - gStaffrollMenu.base.transitionTimer = 0x3c; + gStaffrollMenu.base.transitionTimer = 60; SoundReq(SFX_TEXTBOX_SELECT); break; } @@ -298,7 +298,7 @@ void StaffrollTask_State2(void) { gStaffrollMenu.base.overlayType = 4; break; case SAVE_ERROR: - gStaffrollMenu.base.transitionTimer = 0x3c; + gStaffrollMenu.base.transitionTimer = 60; CreateDialogBox(9, 0); gStaffrollMenu.base.overlayType = 3; break; diff --git a/src/subtask.c b/src/subtask.c index 3126c4b8..950e7f3f 100644 --- a/src/subtask.c +++ b/src/subtask.c @@ -127,7 +127,7 @@ void sub_08054C88(void) { SetFade(FADE_BLACK_WHITE | FADE_INSTANT, 0x10); SoundReq(SFX_SECRET_BIG); gMenu.overlayType++; - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; } } @@ -154,7 +154,7 @@ void sub_08054D3C(void) { sub_0801876C(gMenu.field_0x4, 1); sub_080553E0(gMenu.field_0x4); gMenu.overlayType++; - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; } } @@ -199,7 +199,7 @@ void sub_08054E1C(void) { void sub_08054E5C(void) { if ((gFadeControl.active == 0) && CheckRoomFlag(0xff)) { gMenu.overlayType++; - gMenu.transitionTimer = 0xb4; + gMenu.transitionTimer = 180; SetFade(FADE_BLACK_WHITE | FADE_INSTANT, 0x10); sub_080553E0(gMenu.field_0x4); sub_0801876C(gMenu.field_0x4, 1); @@ -354,7 +354,7 @@ void sub_08055184(void) { sub_08055B70(gMenu.field_0x4, 0, 0, 0); gMenu.overlayType++; gMenu.storyPanelIndex = 0; - gMenu.transitionTimer = 0x3c; + gMenu.transitionTimer = 60; gMenu.field_0xa = 0; gUpdateVisibleTiles = 1; SetFade(FADE_INSTANT, 0x10); @@ -380,7 +380,7 @@ void sub_0805524C(void) { } else { gScreen.lcd.displayControl &= 0xf7ff; gScreen.controls.alphaBlend = 0x1000; - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; gMenu.overlayType++; #ifndef EU SoundReq(SFX_SECRET_BIG); @@ -420,7 +420,7 @@ void sub_08055380(void) { SetFade(FADE_BLACK_WHITE | FADE_INSTANT, 0x10); SoundReq(SFX_SECRET_BIG); gMenu.overlayType++; - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; } } @@ -465,7 +465,7 @@ void sub_08055498(void) { SetFade(FADE_BLACK_WHITE | FADE_INSTANT, 0x10); SoundReq(SFX_SECRET_BIG); gMenu.overlayType++; - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; } } @@ -492,7 +492,7 @@ void sub_08055548(void) { sub_0801876C(gMenu.field_0x4, 1); sub_080553E0(gMenu.field_0x4); gMenu.overlayType++; - gMenu.transitionTimer = 0xb4; + gMenu.transitionTimer = 180; } } @@ -531,7 +531,7 @@ void sub_08055634(void) { obj->y.HALF.HI = gRoomControls.origin_y + *(s16*)(ptr + 10); } gMenu.overlayType++; - gMenu.transitionTimer = 0x186; + gMenu.transitionTimer = 390; } void sub_08055674(void) { @@ -579,7 +579,7 @@ void sub_08055710(void) { void sub_0805576C(void) { if ((gFadeControl.active == 0) && CheckRoomFlag(0xff)) { gMenu.overlayType++; - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; } } @@ -657,7 +657,7 @@ void sub_08055948(void) { if ((gFadeControl.active == 0) && CheckRoomFlag(0xff)) { sub_08055994(); gMenu.overlayType++; - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; } } @@ -709,7 +709,7 @@ void sub_08055A6C(void) { SetFade(FADE_BLACK_WHITE | FADE_INSTANT, 0x10); SoundReq(SFX_SECRET_BIG); gMenu.overlayType++; - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; } } @@ -737,7 +737,7 @@ void sub_08055AEC(void) { void sub_08055B38(void) { if (gFadeControl.active == 0) { - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; } } @@ -794,7 +794,7 @@ void sub_08055C34(void) { SetFade(FADE_BLACK_WHITE | FADE_INSTANT, 0x10); SoundReq(SFX_SECRET_BIG); gMenu.overlayType++; - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; } } @@ -822,7 +822,7 @@ void sub_08055D2C(void) { sub_0801876C(gMenu.field_0x4, 1); sub_080553E0(gMenu.field_0x4); gMenu.overlayType++; - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; } } @@ -846,7 +846,7 @@ void sub_08055DC0(void) { if (gFadeControl.active == 0) { MessageFromTarget(TEXT_INDEX(TEXT_EMPTY, 0x01)); gMenu.overlayType++; - gMenu.transitionTimer = 0x78; + gMenu.transitionTimer = 120; } } diff --git a/src/subtask2.c b/src/subtask2.c index 9e430801..36030515 100644 --- a/src/subtask2.c +++ b/src/subtask2.c @@ -474,7 +474,7 @@ void sub_080A59C8(void) { } if (bVar3) { - gMenu.transitionTimer = 0xff; + gMenu.transitionTimer = 255; if (uVar2 == 0) { CreateDialogBox(8, 0); SetMenuType(2); @@ -494,7 +494,7 @@ void sub_080A5A54(void) { switch (HandleSave(0)) { case SAVE_ERROR: CreateDialogBox(9, 0); - gMenu.transitionTimer = 0x3c; + gMenu.transitionTimer = 60; // fallthrough case SAVE_OK: SetMenuType(3); @@ -510,7 +510,7 @@ void sub_080A5A90(void) { switch (gMenu.transitionTimer) { case 0: if ((gInput.newKeys & (START_BUTTON | B_BUTTON | A_BUTTON)) != 0) { - gMenu.transitionTimer = 0xff; + gMenu.transitionTimer = 255; } break; case 0xff: @@ -580,7 +580,7 @@ void sub_080A5B34(void) { if (bVar1) { if (uVar3 == 0) { SetFade(FADE_IN_OUT | FADE_BLACK_WHITE | FADE_INSTANT, 0x20); - gMenu.transitionTimer = 0x3c; + gMenu.transitionTimer = 60; SetMenuType(2); } else { SoundReq(SFX_MENU_CANCEL); @@ -1084,7 +1084,7 @@ void sub_080A6534(void) { gSave.field_0x20 |= val; gGenericMenu.unk10.h[1] = val & gGenericMenu.unk10.h[0]; gGenericMenu.unk10.h[0] = 0; - gMenu.transitionTimer = 0x3c; + gMenu.transitionTimer = 60; SetMenuType(1); SetFade(FADE_INSTANT, 8); } @@ -1415,7 +1415,7 @@ void sub_080A6B04(void) { gMenu.field_0xa = uVar6; } } - gMenu.transitionTimer = 0x1e; + gMenu.transitionTimer = 30; SetMenuType(1); SetFade(FADE_INSTANT, 8); } diff --git a/src/vram.c b/src/vram.c index fd3ff67e..916a90e7 100644 --- a/src/vram.c +++ b/src/vram.c @@ -153,7 +153,7 @@ bool32 LoadFixedGFX(Entity* entity, u32 gfxIndex) { CleanUpGFXSlots(); index = FindFreeGFXSlots(count); if (index == 0) { - return 0; + return FALSE; } } ReserveGFXSlots(index, gfxIndex, count);