diff options
| author | notyourav <65437533+notyourav@users.noreply.github.com> | 2022-08-07 16:01:46 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-07 16:01:46 -0700 |
| commit | 22cbdd2fd645a5525a6ef0c9b8ee8ec11af9e9aa (patch) | |
| tree | bba486c0af6698f2366f14cbf4b092b981f9e107 /src/enemy | |
| parent | e26311d0997e919b16e193aa57ecc4384a1b0140 (diff) | |
| parent | c45195c57754b1c802a2bae3e473df01bed4cd85 (diff) | |
Merge pull request #553 from hatal175/document
Diffstat (limited to 'src/enemy')
| -rw-r--r-- | src/enemy/chuchuBoss.c | 6 | ||||
| -rw-r--r-- | src/enemy/cuccoAggr.c | 2 | ||||
| -rw-r--r-- | src/enemy/dust.c | 2 | ||||
| -rw-r--r-- | src/enemy/enemy50.c | 4 | ||||
| -rw-r--r-- | src/enemy/flyingSkull.c | 2 | ||||
| -rw-r--r-- | src/enemy/ghini.c | 30 | ||||
| -rw-r--r-- | src/enemy/gyorgMale.c | 4 | ||||
| -rw-r--r-- | src/enemy/octorokGolden.c | 2 | ||||
| -rw-r--r-- | src/enemy/pesto.c | 2 | ||||
| -rw-r--r-- | src/enemy/stalfos.c | 2 | ||||
| -rw-r--r-- | src/enemy/vaatiWrath.c | 7 |
11 files changed, 32 insertions, 31 deletions
diff --git a/src/enemy/chuchuBoss.c b/src/enemy/chuchuBoss.c index 115a2e08..d86f012c 100644 --- a/src/enemy/chuchuBoss.c +++ b/src/enemy/chuchuBoss.c @@ -539,7 +539,7 @@ void sub_08026110(ChuchuBossEntity* this) { void sub_0802626C(ChuchuBossEntity* this) { gPauseMenuOptions.disabled = 1; gUnk_080CC20C[this->unk_84->unk_03](this); - if (gPlayerEntity.action != 23 && gPlayerEntity.action != 15) { + if (gPlayerEntity.action != PLAYER_ROOMTRANSITION && gPlayerEntity.action != PLAYER_ROOM_EXIT) { sub_08078B48(); } } @@ -565,7 +565,7 @@ void sub_080262A8(ChuchuBossEntity* this) { } void sub_08026328(ChuchuBossEntity* this) { - if (gPlayerEntity.action != 23) { + if (gPlayerEntity.action != PLAYER_ROOMTRANSITION) { this->unk_7d = 0x78; this->unk_84->unk_03++; sub_08078AC0(10, 0, 0); @@ -575,7 +575,7 @@ void sub_08026328(ChuchuBossEntity* this) { void sub_08026358(ChuchuBossEntity* this) { u32 bVar1; - if (gPlayerEntity.action != 15) { + if (gPlayerEntity.action != PLAYER_ROOM_EXIT) { bVar1 = --this->unk_7d; if (bVar1 == 0) { this->unk_7c = 0; diff --git a/src/enemy/cuccoAggr.c b/src/enemy/cuccoAggr.c index 99c4a6d8..c14a4464 100644 --- a/src/enemy/cuccoAggr.c +++ b/src/enemy/cuccoAggr.c @@ -274,7 +274,7 @@ void sub_08039140(CuccoAggrEntity* this) { super->action = 6; super->timer = Random(); super->direction = GetFacingDirection(super, &gPlayerEntity); - super->z.HALF.HI = 0xfffc; + super->z.HALF.HI = -4; this->unk_78 = 0xb4; sub_080390F8(this); InitializeAnimation(super, 4); diff --git a/src/enemy/dust.c b/src/enemy/dust.c index d4babd2f..74da343e 100644 --- a/src/enemy/dust.c +++ b/src/enemy/dust.c @@ -146,7 +146,7 @@ void sub_080441E0(DustEntity* this) { super->frameIndex = 1; super->spritePriority.b0 = 7; this->unk_75 = 0; - this->unk_76 = 0xffff; + this->unk_76 = -1; } else { super->frameIndex = 0; super->speed = 0; diff --git a/src/enemy/enemy50.c b/src/enemy/enemy50.c index 3a3968c3..7e47330c 100644 --- a/src/enemy/enemy50.c +++ b/src/enemy/enemy50.c @@ -98,7 +98,7 @@ void sub_08040B9C(Enemy50Entity* this) { if (super->confusedTime != 0) { super->animationState = super->knockbackDirection >> 4; InitializeAnimation(super, super->animationState + 7); - Create0x68FX(super, 0x1c); + Create0x68FX(super, FX_STARS); } if (super->health != this->unk_7a) { if (super->type == 0) { @@ -143,7 +143,7 @@ void sub_08040D30(Enemy50Entity* this) { } GenericConfused(super); if (super->z.HALF.HI == 0) { - super->z.HALF.HI = 0xffff; + super->z.HALF.HI = -1; } if (super->confusedTime == 0) { InitializeAnimation(super, (super->animationState ^ 1) + 1); diff --git a/src/enemy/flyingSkull.c b/src/enemy/flyingSkull.c index fd2e63c8..7897de3a 100644 --- a/src/enemy/flyingSkull.c +++ b/src/enemy/flyingSkull.c @@ -82,7 +82,7 @@ void sub_08039CE0(FlyingSkullEntity* this) { if (super->timer == 0) { sub_0803A100(this); super->timer = 1; - super->z.HALF.HI = 0xffff; + super->z.HALF.HI = -1; super->spriteOffsetX = 0; SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer); } diff --git a/src/enemy/ghini.c b/src/enemy/ghini.c index a620a5fe..86b9f00c 100644 --- a/src/enemy/ghini.c +++ b/src/enemy/ghini.c @@ -28,9 +28,9 @@ extern void (*const Ghini_Actions[])(GhiniEntity*); extern void (*const Ghini_SubActions[])(GhiniEntity*); extern const u8 gUnk_080D0970[]; extern const u8 gUnk_080D0974[]; -extern const u8 gUnk_080D0978[]; +extern const s8 gUnk_080D0978[]; extern const u8 gUnk_080D0980[]; -extern const u8 gUnk_080D0984[]; +extern const s8 gUnk_080D0984[]; void sub_0803F694(GhiniEntity*); void sub_0803F630(GhiniEntity*); @@ -102,7 +102,7 @@ void Ghini_OnConfused(GhiniEntity* this) { } GenericConfused(super); if (super->z.HALF.HI == 0) { - super->z.HALF.HI = 0xffff; + super->z.HALF.HI = -1; } if (super->confusedTime == 0) { InitializeAnimation(super, (super->animationState ^ 1) + 1); @@ -361,11 +361,11 @@ void sub_0803F66C(GhiniEntity* this) { } void sub_0803F694(GhiniEntity* this) { - super->z.HALF.HI = gUnk_080D0984[(((u32)this->unk_7b++ << 0x18) >> 0x1b) & 3] << 0x18 >> 0x18; + super->z.HALF.HI = gUnk_080D0984[(this->unk_7b++ >> 3) & 3]; } void sub_0803F6C0(GhiniEntity* this) { - super->frame &= 0xfe; + super->frame &= ~1; gPlayerEntity.iframes = 0xc; ModHealth(-4); SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6); @@ -373,9 +373,9 @@ void sub_0803F6C0(GhiniEntity* this) { void sub_0803F6EC(GhiniEntity* this) { if (gPlayerEntity.health != 0) { - gPlayerEntity.flags |= 0x80; - gPlayerEntity.zVelocity = 0x18000; - gPlayerEntity.z.HALF.HI = 0xfffe; + gPlayerEntity.flags |= ENT_COLLIDE; + gPlayerEntity.zVelocity = Q_16_16(1.5); + gPlayerEntity.z.HALF.HI = -2; gPlayerEntity.direction = gPlayerEntity.animationState << 2; gPlayerEntity.iframes = -0x3c; gPlayerState.jump_status = 0x41; @@ -416,8 +416,8 @@ const u8 gUnk_080D0974[] = { 160, 128, }; -const u8 gUnk_080D0978[] = { - 0, 254, 0, 2, 0, 252, 0, 4, +const s8 gUnk_080D0978[] = { + 0, -2, 0, 2, 0, -4, 0, 4, }; const u8 gUnk_080D0980[] = { 15, @@ -425,9 +425,9 @@ const u8 gUnk_080D0980[] = { 34, 45, }; -const u8 gUnk_080D0984[] = { - 255, - 254, - 253, - 254, +const s8 gUnk_080D0984[] = { + -1, + -2, + -3, + -2, }; diff --git a/src/enemy/gyorgMale.c b/src/enemy/gyorgMale.c index 42c07766..20f09035 100644 --- a/src/enemy/gyorgMale.c +++ b/src/enemy/gyorgMale.c @@ -949,9 +949,9 @@ void sub_08047BF0(GyorgMaleEntity* this) { tmp = CreateFx(super, FX_GIANT_EXPLOSION4, 0); if (tmp) { u32 rand = Random(); - tmp->x.HALF.HI += (rand & 0x1E) + 0xFFF1; + tmp->x.HALF.HI += (rand & 0x1E) - 15; rand >>= 8; - tmp->y.HALF.HI += (rand & 0x1E) + 0xFFF1; + tmp->y.HALF.HI += (rand & 0x1E) - 15; tmp->spritePriority.b0 = 3; tmp->collisionLayer = 1; UpdateSpriteForCollisionLayer(tmp); diff --git a/src/enemy/octorokGolden.c b/src/enemy/octorokGolden.c index 8cf3dff4..815c7411 100644 --- a/src/enemy/octorokGolden.c +++ b/src/enemy/octorokGolden.c @@ -84,7 +84,7 @@ static void sub_08037D54(Entity* this) { ptr = gUnk_080CF490 + (this->direction >> 2); proj->x.HALF.HI += *ptr; proj->y.HALF.HI += *(ptr + 1); - proj->z.HALF.HI = 0xfffd; + proj->z.HALF.HI = -3; EnqueueSFX(SFX_124); } } diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c index 822dc777..a9552cc9 100644 --- a/src/enemy/pesto.c +++ b/src/enemy/pesto.c @@ -355,7 +355,7 @@ void sub_080244E8(Entity* this) { case 1: if (++this->z.HALF.HI >= -0x10) { this->field_0x82.HALF.LO = 0; - this->field_0x78.HWORD = 0xfff0; + this->field_0x78.HWORD = -16; if (sub_08024AD8(this)) { this->field_0x80.HALF.LO++; } else { diff --git a/src/enemy/stalfos.c b/src/enemy/stalfos.c index 848f0d38..c966d468 100644 --- a/src/enemy/stalfos.c +++ b/src/enemy/stalfos.c @@ -109,7 +109,7 @@ NONMATCH("asm/non_matching/stalfos/sub_0803933C.inc", void sub_0803933C(StalfosE super->flags2 &= 0xfb; } if (super->confusedTime != 0) { - Create0x68FX(super, 0x1c); + Create0x68FX(super, FX_STARS); } EnemyFunctionHandlerAfterCollision(super, Stalfos_Functions); } diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c index 3f91afd9..22df2068 100644 --- a/src/enemy/vaatiWrath.c +++ b/src/enemy/vaatiWrath.c @@ -1002,8 +1002,9 @@ void VaatiWrathType0PreAction(Entity* this) { gSave.timers[3]--; } else { temp = gPlayerState.framestate_last; - if (temp < 2) { - if (temp >= 0) { + switch (temp) { + case PL_STATE_IDLE: + case PL_STATE_WALK: if (gPlayerState.item == NULL) { if (gPlayerEntity.field_0x7a.HWORD == 0) { if ((gPlayerEntity.z.HALF.HI & 0x8000U) == 0 || (gPlayerState.field_0xa != 0)) { @@ -1012,7 +1013,7 @@ void VaatiWrathType0PreAction(Entity* this) { } } } - } + break; } } } |
