diff options
| author | theo3 <arisstephenson2@gmail.com> | 2020-11-13 23:27:50 -0800 |
|---|---|---|
| committer | theo3 <arisstephenson2@gmail.com> | 2020-11-13 23:27:50 -0800 |
| commit | 3079c016b455c7008995d26ea227a4f05bc79988 (patch) | |
| tree | fbe584b74e020cd6d25bf7904b1ab576327b62b1 /src/enemy | |
| parent | 8fd74813959a978489e0c4917fcbfe86500debbb (diff) | |
clang-format and newlines
Diffstat (limited to 'src/enemy')
| -rw-r--r-- | src/enemy/acroBandits.c | 4 | ||||
| -rw-r--r-- | src/enemy/beetle.c | 2 | ||||
| -rw-r--r-- | src/enemy/bladeTrap.c | 2 | ||||
| -rw-r--r-- | src/enemy/bombPeahat.c | 2 | ||||
| -rw-r--r-- | src/enemy/bowMoblin.c | 42 | ||||
| -rw-r--r-- | src/enemy/chaser.c | 5 | ||||
| -rw-r--r-- | src/enemy/cuccoChickAggr.c | 7 | ||||
| -rw-r--r-- | src/enemy/enemy4D.c | 2 | ||||
| -rw-r--r-- | src/enemy/fallingBoulder.c | 8 | ||||
| -rw-r--r-- | src/enemy/fireballGuy.c | 4 | ||||
| -rw-r--r-- | src/enemy/hangingSeed.c | 1 | ||||
| -rw-r--r-- | src/enemy/keaton.c | 2 | ||||
| -rw-r--r-- | src/enemy/lakitu.c | 171 | ||||
| -rw-r--r-- | src/enemy/lakituCloud.c | 74 | ||||
| -rw-r--r-- | src/enemy/likeLike.c | 21 | ||||
| -rw-r--r-- | src/enemy/miniSlime.c | 2 | ||||
| -rw-r--r-- | src/enemy/moldorm.c | 2 | ||||
| -rw-r--r-- | src/enemy/peahat.c | 5 | ||||
| -rw-r--r-- | src/enemy/smallPesto.c | 104 | ||||
| -rw-r--r--[-rwxr-xr-x] | src/enemy/treeItem.c | 6 |
20 files changed, 207 insertions, 259 deletions
diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c index 724880ac..73212e2f 100644 --- a/src/enemy/acroBandits.c +++ b/src/enemy/acroBandits.c @@ -206,7 +206,6 @@ void sub_08031C1C(Entity* this) { } } - void sub_08031C58(Entity* this) { Entity *a, *b; @@ -412,7 +411,6 @@ void sub_08032008(Entity* this) { if (this->direction & 0xf) this->spriteSettings.b.flipX = (this->direction >> 4 ^ 1); - ProcessMovement(this); } else { if (this->field_0x76.HALF.HI == 0) { @@ -544,7 +542,7 @@ void sub_080322E8(Entity* this) { } } -void sub_08032338(Entity *this) { +void sub_08032338(Entity* this) { if ((((Entity*)this->field_0x7c.WORD)->actionDelay += 15) != 80) this->field_0x6c.HALF.LO = 0; } diff --git a/src/enemy/beetle.c b/src/enemy/beetle.c index aa51a736..9536f297 100644 --- a/src/enemy/beetle.c +++ b/src/enemy/beetle.c @@ -315,7 +315,6 @@ void sub_08021D44(Entity* this, u32 direction) { } } - // clang-format off void (*const gUnk_080CB590[])(Entity*) = { sub_08021768, @@ -356,4 +355,3 @@ const s8 gUnk_080CB5E4[] = { -1, -2, -1, 0, 1, 2, 1, 0, }; // clang-format on - diff --git a/src/enemy/bladeTrap.c b/src/enemy/bladeTrap.c index b58ef0d6..54dcfcb7 100644 --- a/src/enemy/bladeTrap.c +++ b/src/enemy/bladeTrap.c @@ -20,8 +20,6 @@ void BladeTrap(Entity* ent) { sub_0806F69C(ent); } - - puVar3 = &(ent->field_0x74.HWORD); uVar1 = *puVar3; *puVar3 = uVar1 - 1; diff --git a/src/enemy/bombPeahat.c b/src/enemy/bombPeahat.c index 98f54841..938e9af1 100644 --- a/src/enemy/bombPeahat.c +++ b/src/enemy/bombPeahat.c @@ -665,4 +665,4 @@ const BoundingBox gUnk_080CD174 = { const BoundingBox gUnk_080CD17C = { 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x16, 0x16, }; -// clang-format on
\ No newline at end of file +// clang-format on diff --git a/src/enemy/bowMoblin.c b/src/enemy/bowMoblin.c index c23b1294..e29d6177 100644 --- a/src/enemy/bowMoblin.c +++ b/src/enemy/bowMoblin.c @@ -10,32 +10,30 @@ extern void sub_0803C5F0(Entity*); extern void (*const gUnk_080CFF78[])(Entity*); extern void (*const gUnk_080CFF90[])(Entity*); -void BowMoblin(Entity *this) -{ - EnemyFunctionHandler(this, gUnk_080CFF78); - SetChildOffset(this, 0, 1, -0x18); +void BowMoblin(Entity* this) { + EnemyFunctionHandler(this, gUnk_080CFF78); + SetChildOffset(this, 0, 1, -0x18); } -void sub_0803C180(Entity *this) -{ - gUnk_080CFF90[this->action](this); +void sub_0803C180(Entity* this) { + gUnk_080CFF90[this->action](this); } -void sub_0803C198(Entity *this) -{ - Entity *pEVar1; - - if (this->field_0x43 != 0) { - sub_0804A9FC(this,0x1c); - } - sub_0804AA30(this, &gUnk_080CFF78); - if ((this->bitfield & 0x80) != 0) { - sub_0803C5F0(this); - pEVar1 = this->attachedEntity; - if (pEVar1 != NULL) { - pEVar1->field_0xf++; +void sub_0803C198(Entity* this) { + Entity* pEVar1; + + if (this->field_0x43 != 0) { + sub_0804A9FC(this, 0x1c); + } + sub_0804AA30(this, &gUnk_080CFF78); + if ((this->bitfield & 0x80) != 0) { + sub_0803C5F0(this); + pEVar1 = this->attachedEntity; + if (pEVar1 != NULL) { + pEVar1->field_0xf++; + } } - } } -void nullsub_168(Entity* this){} +void nullsub_168(Entity* this) { +} diff --git a/src/enemy/chaser.c b/src/enemy/chaser.c index a5f1f522..00d99937 100644 --- a/src/enemy/chaser.c +++ b/src/enemy/chaser.c @@ -61,16 +61,15 @@ void sub_0802B56C(Entity* this) { } } -void sub_0802B5C8(Entity *this) { +void sub_0802B5C8(Entity* this) { GetNextFrame(this); if (this->frames.all & 0x80) { this->action = 1; this->actionDelay = 30; - InitializeAnimation(this,0); + InitializeAnimation(this, 0); } } - // clang-format off void (*const gUnk_080CD27C[])(Entity*) = { sub_0802B518, diff --git a/src/enemy/cuccoChickAggr.c b/src/enemy/cuccoChickAggr.c index 686e5100..de87165a 100644 --- a/src/enemy/cuccoChickAggr.c +++ b/src/enemy/cuccoChickAggr.c @@ -136,17 +136,16 @@ u32 sub_08022B20(Entity* this) { return sub_080041A0(this, &gPlayerEntity, 0x24, 0x24); } -void sub_08022B44(Entity *this){ +void sub_08022B44(Entity* this) { this->field_0x20 = 0xc000; - this->direction = GetFacingDirection(this,&gPlayerEntity); + this->direction = GetFacingDirection(this, &gPlayerEntity); if (this->direction & 0xf) - this->spriteSettings.b.flipX = (this->direction >> 4)^1; + this->spriteSettings.b.flipX = (this->direction >> 4) ^ 1; EnqueueSFX(0xd6); } - // clang-format off void (*const gUnk_080CBB64[])(Entity*) = { sub_08022934, diff --git a/src/enemy/enemy4D.c b/src/enemy/enemy4D.c index 3c168052..a29157bc 100644 --- a/src/enemy/enemy4D.c +++ b/src/enemy/enemy4D.c @@ -52,4 +52,4 @@ void sub_0803EB44(Entity* this) { InitAnimationForceUpdate(this, this->animationState << 2); sub_0803EE8C(this); } -}
\ No newline at end of file +} diff --git a/src/enemy/fallingBoulder.c b/src/enemy/fallingBoulder.c index 435e6b21..24f18515 100644 --- a/src/enemy/fallingBoulder.c +++ b/src/enemy/fallingBoulder.c @@ -143,13 +143,13 @@ void sub_0802C4B0(Entity* this) { switch (sub_080001DA(this->field_0x7c.HALF_U.HI, this->collisionLayer)) { case 0x1ab ... 0x1af: - offset = 8; + offset = 8; break; case 0x1c4: - offset = 4; + offset = 4; break; default: - offset = 0; + offset = 0; break; } @@ -208,7 +208,7 @@ void sub_0802C4B0(Entity* this) { } } -void sub_0802C62C(Entity *this) { +void sub_0802C62C(Entity* this) { this->action = 1; this->y.HALF.HI = this->field_0x82.HWORD; this->x.HALF.HI = this->field_0x80.HWORD; diff --git a/src/enemy/fireballGuy.c b/src/enemy/fireballGuy.c index bd033058..f7f51c71 100644 --- a/src/enemy/fireballGuy.c +++ b/src/enemy/fireballGuy.c @@ -95,11 +95,11 @@ void sub_08045454(Entity* this) { u32 sub_0804A024(Entity*, u32, u32); -void sub_08045524(Entity *this) { +void sub_08045524(Entity* this) { u32 tmp, tmp1, tmp2; this->field_0x20 = 0x1c000; - tmp = sub_0804A024(this,1,8); + tmp = sub_0804A024(this, 1, 8); if (tmp != 0xff && (Random() & 3) == 0) { this->actionDelay = Random() & 3; this->direction = DirectionRound(tmp); diff --git a/src/enemy/hangingSeed.c b/src/enemy/hangingSeed.c index f819287f..7ca8808a 100644 --- a/src/enemy/hangingSeed.c +++ b/src/enemy/hangingSeed.c @@ -50,4 +50,3 @@ void (*const gUnk_080CB588[])(Entity*) = { HangingSeed_Hang, }; // clang-format on - diff --git a/src/enemy/keaton.c b/src/enemy/keaton.c index 4d7e003d..18b4f87e 100644 --- a/src/enemy/keaton.c +++ b/src/enemy/keaton.c @@ -124,7 +124,7 @@ void sub_08032574(Entity* this) { sub_0803275C(this); return; } - + UpdateAnimationSingleFrame(this); if ((this->field_0x76.HWORD & 0x7) == 0) { sub_08032794(this); diff --git a/src/enemy/lakitu.c b/src/enemy/lakitu.c index 5225f644..163ec9e1 100644 --- a/src/enemy/lakitu.c +++ b/src/enemy/lakitu.c @@ -5,62 +5,62 @@ #include "random.h" #include "player.h" -extern void (*const LakituActionFuncs[])(Entity *); +extern void (*const LakituActionFuncs[])(Entity*); // Lakitu -extern void EnemyFunctionHandler(Entity *, void (*const funcs[])(Entity*)); +extern void EnemyFunctionHandler(Entity*, void (*const funcs[])(Entity*)); // sub_0803C784 -extern void sub_0804AA30(Entity *, void (*const funcs[])(Entity *)); +extern void sub_0804AA30(Entity*, void (*const funcs[])(Entity*)); // sub_0803C820 -extern u32 sub_0806F520(Entity *); +extern u32 sub_0806F520(Entity*); // sub_0803C850 -extern void sub_0806F4E8(Entity *); +extern void sub_0806F4E8(Entity*); // Lakitu_Initialize -extern void sub_0804A720(Entity *); +extern void sub_0804A720(Entity*); // Lakitu_Cloudless -extern u32 sub_08003FC4(Entity *, u32); +extern u32 sub_08003FC4(Entity*, u32); // sub_0803CA4C -extern u32 sub_080041A0(Entity *, Entity *, u32, u32); +extern u32 sub_080041A0(Entity*, Entity*, u32, u32); // sub_0803CAD0 -extern u32 sub_080AEFE0(Entity *); +extern u32 sub_080AEFE0(Entity*); // Lakitu_SpawnLightning void PositionRelative(Entity*, Entity*, s32, s32); extern void EnqueueSFX(u32); // sub_0803CC08 -extern void DeleteEntity(Entity *); +extern void DeleteEntity(Entity*); // Part of function tables -extern void sub_08001324(Entity *); -extern void sub_0804A7D4(Entity *); -extern void sub_08001242(Entity *); +extern void sub_08001324(Entity*); +extern void sub_0804A7D4(Entity*); +extern void sub_08001242(Entity*); // Used in multiple functions -extern Entity *CreateFx(Entity*, u32, u32); -extern Entity *sub_0804A98C(Entity *positionEntity, u8 subtype, u8 form); // Creates a projectile positioned at the given entity -extern void UpdateAnimationSingleFrame(Entity *); -extern void InitAnimationForceUpdate(Entity *, u32); -extern u32 sub_0806FCB8(Entity *, u32, u32, u32); -extern u32 GetFacingDirection(Entity *, Entity *); - +extern Entity* CreateFx(Entity*, u32, u32); +extern Entity* sub_0804A98C(Entity* positionEntity, u8 subtype, + u8 form); // Creates a projectile positioned at the given entity +extern void UpdateAnimationSingleFrame(Entity*); +extern void InitAnimationForceUpdate(Entity*, u32); +extern u32 sub_0806FCB8(Entity*, u32, u32, u32); +extern u32 GetFacingDirection(Entity*, Entity*); // Forward references to functions in lakitu.c -extern void sub_0803CAD0(Entity *); -extern void sub_0803CBAC(Entity *); -extern void sub_0803CA84(Entity *, u32); -extern bool32 sub_0803CA4C(Entity *); -extern bool32 sub_0803CB04(Entity *); -extern void Lakitu_SpawnLightning(Entity *); -extern void sub_0803CB34(Entity *); -extern void sub_0803CC08(Entity *this); +extern void sub_0803CAD0(Entity*); +extern void sub_0803CBAC(Entity*); +extern void sub_0803CA84(Entity*, u32); +extern bool32 sub_0803CA4C(Entity*); +extern bool32 sub_0803CB04(Entity*); +extern void Lakitu_SpawnLightning(Entity*); +extern void sub_0803CB34(Entity*); +extern void sub_0803CC08(Entity* this); enum { INIT, @@ -79,21 +79,21 @@ typedef struct { } PACKED OffsetCoords; // sub_0803CC08 -extern void DeleteEntity(Entity *); +extern void DeleteEntity(Entity*); // Variables -extern void (*const gUnk_080D0110[])(Entity *); -extern void (*const gUnk_080D0128[])(Entity *); -extern void (*const gUnk_080D0148[])(Entity *); +extern void (*const gUnk_080D0110[])(Entity*); +extern void (*const gUnk_080D0128[])(Entity*); +extern void (*const gUnk_080D0148[])(Entity*); extern const OffsetCoords gUnk_080D0154[]; -void Lakitu(Entity *this) { +void Lakitu(Entity* this) { EnemyFunctionHandler(this, gUnk_080D0110); SetChildOffset(this, 0, 1, -16); } -void Lakitu_DoAction(Entity *this) { +void Lakitu_DoAction(Entity* this) { if (this->action != 0 && this->action != 7) { sub_0803CAD0(this); } @@ -101,15 +101,14 @@ void Lakitu_DoAction(Entity *this) { LakituActionFuncs[this->action](this); } -void sub_0803C784(Entity *this) { +void sub_0803C784(Entity* this) { if ((this->bitfield & 0x7f) == 0x1d) { this->field_0x20 = 0x20000; sub_0803CBAC(this); - } - else { + } else { if (this->damageType == 0x43) { - Entity *fx = CreateFx(this, 2, 0); + Entity* fx = CreateFx(this, 2, 0); if (fx != NULL) { u32 angle = (this->field_0x3e ^ 0x10) << 3; @@ -139,19 +138,19 @@ void sub_0803C784(Entity *this) { sub_0804AA30(this, gUnk_080D0110); } -void sub_0803C820(Entity *this) { +void sub_0803C820(Entity* this) { if (sub_0806F520(this)) { gUnk_080D0148[this->previousActionFlag](this); } } -void sub_0803C844(Entity *this) { +void sub_0803C844(Entity* this) { this->previousActionFlag = 1; this->field_0x1d = 0x3c; } -void sub_0803C850(Entity *this) { - Entity *cloud = this->attachedEntity; +void sub_0803C850(Entity* this) { + Entity* cloud = this->attachedEntity; if (cloud != NULL) { cloud->spriteOffsetX = this->spriteOffsetX; } @@ -159,13 +158,13 @@ void sub_0803C850(Entity *this) { sub_0806F4E8(this); } -void sub_0803C86C(Entity *this) { +void sub_0803C86C(Entity* this) { sub_0803CBAC(this); this->attachedEntity = NULL; } -void Lakitu_Initialize(Entity *this) { - Entity *cloud = sub_0804A98C(this, 17, 0); +void Lakitu_Initialize(Entity* this) { + Entity* cloud = sub_0804A98C(this, 17, 0); if (cloud == NULL) { return; } @@ -185,7 +184,7 @@ void Lakitu_Initialize(Entity *this) { this->field_0x76.HWORD = this->y.HALF.HI; } -void Lakitu_Hide(Entity *this) { +void Lakitu_Hide(Entity* this) { sub_0803CA84(this, 0); if (sub_0803CA4C(this)) { @@ -194,7 +193,7 @@ void Lakitu_Hide(Entity *this) { } } -void Lakitu_EndHide(Entity *this) { +void Lakitu_EndHide(Entity* this) { UpdateAnimationSingleFrame(this); if (this->frames.b.f3) { @@ -207,7 +206,7 @@ void Lakitu_EndHide(Entity *this) { } } -void Lakitu_Idle(Entity *this) { +void Lakitu_Idle(Entity* this) { if (sub_0803CB04(this)) { return; } @@ -217,13 +216,12 @@ void Lakitu_Idle(Entity *this) { this->damageType = 0x43; InitAnimationForceUpdate(this, this->animationState + 0xc); - } - else { + } else { sub_0803CA84(this, 4); } } -void Lakitu_BeginHide(Entity *this) { +void Lakitu_BeginHide(Entity* this) { UpdateAnimationSingleFrame(this); if (this->frames.b.f3 != 0) { @@ -234,7 +232,7 @@ void Lakitu_BeginHide(Entity *this) { } } -void Lakitu_Lightning(Entity *this) { +void Lakitu_Lightning(Entity* this) { UpdateAnimationSingleFrame(this); if (this->frames.b.f3 == 0) { @@ -250,8 +248,7 @@ void Lakitu_Lightning(Entity *this) { this->actionDelay = 0xf; this->field_0x78.HALF.HI = TRUE; - } - else { + } else { this->actionDelay = 0x1e; this->field_0x78.HALF.HI = FALSE; @@ -260,17 +257,16 @@ void Lakitu_Lightning(Entity *this) { } } -void Lakitu_LightningDelay(Entity *this) { +void Lakitu_LightningDelay(Entity* this) { this->actionDelay--; if (this->actionDelay != 0) { return; } - + if (this->field_0x78.HALF.HI == 1) { sub_0803CB34(this); - } - else { + } else { this->action = IDLE; this->actionDelay = 0xb4; @@ -278,7 +274,7 @@ void Lakitu_LightningDelay(Entity *this) { } } -void Lakitu_Cloudless(Entity *this) { +void Lakitu_Cloudless(Entity* this) { if (sub_08003FC4(this, 0x1800) == 0 && this->animIndex <= 19) { InitAnimationForceUpdate(this, this->animationState + 20); @@ -289,7 +285,7 @@ void Lakitu_Cloudless(Entity *this) { sub_0803CC08(this); } -bool32 sub_0803CA4C(Entity *this) { +bool32 sub_0803CA4C(Entity* this) { if (sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x28) == 0) { if (sub_080041A0(this, &gPlayerEntity, 0x70, 0x50)) { return 1; @@ -299,10 +295,10 @@ bool32 sub_0803CA4C(Entity *this) { return 0; } -void sub_0803CA84(Entity *this, u32 unkParameter) { +void sub_0803CA84(Entity* this, u32 unkParameter) { u32 altAnimState = GetFacingDirection(this, &gPlayerEntity); - if (((altAnimState - 3) & 7) > 2 || ((this->animationState - (altAnimState >> 3)) & 3) > 1) { + if (((altAnimState - 3) & 7) > 2 || ((this->animationState - (altAnimState >> 3)) & 3) > 1) { altAnimState = DirectionRoundUp(altAnimState) >> 3; if (altAnimState != this->animationState) { @@ -314,23 +310,23 @@ void sub_0803CA84(Entity *this, u32 unkParameter) { } } -void sub_0803CAD0(Entity *this) { +void sub_0803CAD0(Entity* this) { if (sub_0806FCB8(this, this->field_0x74.HWORD, this->field_0x76.HWORD, 1) == 0) { - this->direction = sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, this->field_0x74.HWORD, this->field_0x76.HWORD); + this->direction = + sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, this->field_0x74.HWORD, this->field_0x76.HWORD); sub_080AEFE0(this); } } -bool32 sub_0803CB04(Entity *this) { +bool32 sub_0803CB04(Entity* this) { bool32 returnValue; u8 delay; delay = --this->actionDelay; if (delay != 0) { returnValue = 0; - } - else { + } else { sub_0803CB34(this); this->field_0x78.HALF.HI = delay; @@ -341,7 +337,7 @@ bool32 sub_0803CB04(Entity *this) { return returnValue; } -void sub_0803CB34(Entity *this) { +void sub_0803CB34(Entity* this) { this->action = LIGHTNING_THROW; this->damageType = 0xa6; @@ -350,9 +346,9 @@ void sub_0803CB34(Entity *this) { InitAnimationForceUpdate(this, this->animationState + 8); } -void Lakitu_SpawnLightning(Entity *this) { - Entity *lightning; - const OffsetCoords *offset; +void Lakitu_SpawnLightning(Entity* this) { + Entity* lightning; + const OffsetCoords* offset; lightning = sub_0804A98C(this, 18, 0); @@ -369,8 +365,8 @@ void Lakitu_SpawnLightning(Entity *this) { EnqueueSFX(0x193); } -void sub_0803CBAC(Entity *this) { - Entity *cloud; +void sub_0803CBAC(Entity* this) { + Entity* cloud; cloud = this->attachedEntity; if (cloud != NULL) { @@ -390,9 +386,9 @@ void sub_0803CBAC(Entity *this) { InitAnimationForceUpdate(this, this->animationState + 16); } -void sub_0803CC08(Entity *this) { - Entity *cloud; - Entity *fx; +void sub_0803CC08(Entity* this) { + Entity* cloud; + Entity* fx; cloud = this->attachedEntity; if (cloud == NULL) { @@ -439,27 +435,16 @@ void sub_0803CC08(Entity *this) { DeleteEntity(cloud); } -void (*const gUnk_080D0110[])(Entity *) = { - Lakitu_DoAction, - sub_0803C784, - sub_08001324, - sub_0804A7D4, - sub_08001242, - sub_0803C820, +void (*const gUnk_080D0110[])(Entity*) = { + Lakitu_DoAction, sub_0803C784, sub_08001324, sub_0804A7D4, sub_08001242, sub_0803C820, }; -void (*const LakituActionFuncs[])(Entity *) = { - Lakitu_Initialize, - Lakitu_Hide, - Lakitu_EndHide, - Lakitu_Idle, - Lakitu_BeginHide, - Lakitu_Lightning, - Lakitu_LightningDelay, - Lakitu_Cloudless, +void (*const LakituActionFuncs[])(Entity*) = { + Lakitu_Initialize, Lakitu_Hide, Lakitu_EndHide, Lakitu_Idle, + Lakitu_BeginHide, Lakitu_Lightning, Lakitu_LightningDelay, Lakitu_Cloudless, }; -void (*const gUnk_080D0148[])(Entity *) = { +void (*const gUnk_080D0148[])(Entity*) = { sub_0803C844, sub_0803C850, sub_0803C86C, diff --git a/src/enemy/lakituCloud.c b/src/enemy/lakituCloud.c index 85baf8ca..4ee9063b 100644 --- a/src/enemy/lakituCloud.c +++ b/src/enemy/lakituCloud.c @@ -2,61 +2,60 @@ #include "entity.h" #include "player.h" -extern u32 GetNextFunction(Entity *); +extern u32 GetNextFunction(Entity*); -extern void sub_0804A7D4(Entity *); -extern void sub_08001242(Entity *); +extern void sub_0804A7D4(Entity*); +extern void sub_08001242(Entity*); -extern void (*const gUnk_080D0418[6])(Entity *); -extern void (*const gUnk_080D0430[3])(Entity *); -extern void (*const gUnk_080D043C[3])(Entity *); +extern void (*const gUnk_080D0418[6])(Entity*); +extern void (*const gUnk_080D0430[3])(Entity*); +extern void (*const gUnk_080D043C[3])(Entity*); -extern bool32 sub_0806F3E4(Entity *); -extern bool32 sub_0806F520(Entity *); +extern bool32 sub_0806F3E4(Entity*); +extern bool32 sub_0806F520(Entity*); -extern void sub_0800449C(Entity *, u32); -extern void sub_0803CE14(Entity *); -extern void sub_0803CE3C(Entity *); -extern Entity *GetCurrentRoomProperty(u8); -extern void sub_0806F4E8(Entity *); -extern void sub_0806F69C(Entity *); +extern void sub_0800449C(Entity*, u32); +extern void sub_0803CE14(Entity*); +extern void sub_0803CE3C(Entity*); +extern Entity* GetCurrentRoomProperty(u8); +extern void sub_0806F4E8(Entity*); +extern void sub_0806F69C(Entity*); extern void sub_08079D84(void); -extern void sub_080A2CC0(Entity *, Entity **, u16 *); +extern void sub_080A2CC0(Entity*, Entity**, u16*); -void LakituCloud(Entity *this) { +void LakituCloud(Entity* this) { gUnk_080D0418[GetNextFunction(this)](this); } -void sub_0803CCD4(Entity *this) { +void sub_0803CCD4(Entity* this) { gUnk_080D0430[this->action](this); } -void sub_0803CCEC(Entity *this) { +void sub_0803CCEC(Entity* this) { this->field_0x42 = 0; sub_0803CCD4(this); } -void sub_0803CCFC(Entity *this) { +void sub_0803CCFC(Entity* this) { if (sub_0806F520(this) == 0) { if (this->previousActionFlag == 2) { sub_0803CE3C(this); } - } - else { + } else { gUnk_080D043C[this->previousActionFlag](this); } } -void sub_0803CD2C(Entity *this) { +void sub_0803CD2C(Entity* this) { this->previousActionFlag = 1; this->field_0x1d = 0x3c; } -void sub_0803CD38(Entity *this) { +void sub_0803CD38(Entity* this) { sub_0806F4E8(this); } -void sub_0803CD40(Entity *this) { +void sub_0803CD40(Entity* this) { if (!sub_0806F3E4(this)) { return; } @@ -69,8 +68,8 @@ void sub_0803CD40(Entity *this) { sub_0803CE3C(this); } -void sub_0803CD6C(Entity *this) { - Entity *lakitu; +void sub_0803CD6C(Entity* this) { + Entity* lakitu; this->action = 1; this->height.HALF.HI = -2; @@ -88,7 +87,7 @@ void sub_0803CD6C(Entity *this) { sub_0803CE14(this); } -void sub_0803CDA8(Entity *this) { +void sub_0803CDA8(Entity* this) { UpdateAnimationSingleFrame(this); if ((this->direction & 0x80) == 0) { @@ -100,7 +99,7 @@ void sub_0803CDA8(Entity *this) { } } -void sub_0803CDD8(Entity *this) { +void sub_0803CDD8(Entity* this) { u8 one; u8 draw; @@ -112,14 +111,14 @@ void sub_0803CDD8(Entity *this) { if (this->actionDelay == 0) { this->action = 1; - + this->flags |= 0x80; this->spriteSettings.b.draw = one; } } -void sub_0803CE14(Entity *this) { +void sub_0803CE14(Entity* this) { u8 direction; sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74.HWORD); @@ -134,7 +133,7 @@ void sub_0803CE14(Entity *this) { InitAnimationForceUpdate(this, direction); } -void sub_0803CE3C(Entity *this) { +void sub_0803CE3C(Entity* this) { CreateFx(this, 2, 0); this->action = 2; @@ -152,22 +151,17 @@ void sub_0803CE3C(Entity *this) { sub_0803CE14(this); } -void (*const gUnk_080D0418[])(Entity *) = { - sub_0803CCD4, - sub_0803CCD4, - sub_0803CCEC, - sub_0804A7D4, - sub_08001242, - sub_0803CCFC, +void (*const gUnk_080D0418[])(Entity*) = { + sub_0803CCD4, sub_0803CCD4, sub_0803CCEC, sub_0804A7D4, sub_08001242, sub_0803CCFC, }; -void (*const gUnk_080D0430[])(Entity *) = { +void (*const gUnk_080D0430[])(Entity*) = { sub_0803CD6C, sub_0803CDA8, sub_0803CDD8, }; -void (*const gUnk_080D043C[])(Entity *) = { +void (*const gUnk_080D043C[])(Entity*) = { sub_0803CD2C, sub_0803CD38, sub_0803CD40, diff --git a/src/enemy/likeLike.c b/src/enemy/likeLike.c index ca50374f..43c2417d 100644 --- a/src/enemy/likeLike.c +++ b/src/enemy/likeLike.c @@ -265,23 +265,10 @@ void sub_08028224(u32 param_1) { TextboxNoOverlapFollow(0x579); } - -void (*const gUnk_080CC6FC[])(Entity *) = { - sub_08027D8C, - sub_08027DA4, - sub_08001324, - sub_08027E40, - sub_08001242, - nullsub_139, +void (*const gUnk_080CC6FC[])(Entity*) = { + sub_08027D8C, sub_08027DA4, sub_08001324, sub_08027E40, sub_08001242, nullsub_139, }; -void (*const gUnk_080CC714[])(Entity *) = { - sub_08027E70, - sub_08027EFC, - nullsub_12, - sub_08027F84, - sub_08027FB4, - sub_08027FE0, - sub_0802802C, - sub_0802805C, +void (*const gUnk_080CC714[])(Entity*) = { + sub_08027E70, sub_08027EFC, nullsub_12, sub_08027F84, sub_08027FB4, sub_08027FE0, sub_0802802C, sub_0802805C, }; diff --git a/src/enemy/miniSlime.c b/src/enemy/miniSlime.c index 973f8839..55af91ab 100644 --- a/src/enemy/miniSlime.c +++ b/src/enemy/miniSlime.c @@ -65,7 +65,7 @@ void sub_080452E4(Entity* this) { this->actionDelay = (Random() & 0x1f) + 1; } -void sub_080452FC(Entity *this) { +void sub_080452FC(Entity* this) { u32 cVar2, bVar3; GetNextFrame(this); if (--this->actionDelay == 0) { diff --git a/src/enemy/moldorm.c b/src/enemy/moldorm.c index 3338a15a..6f86d987 100644 --- a/src/enemy/moldorm.c +++ b/src/enemy/moldorm.c @@ -173,7 +173,7 @@ void sub_08022F14(Entity* this) { this->direction += this->field_0x78.HALF.LO; this->direction &= 0x1f; - + this->animationState = ((this->direction + 2) & 0x1c) >> 2; this->frameIndex = this->animationState; } diff --git a/src/enemy/peahat.c b/src/enemy/peahat.c index 664e1615..828c2c4d 100644 --- a/src/enemy/peahat.c +++ b/src/enemy/peahat.c @@ -356,7 +356,7 @@ void sub_080205F8(Entity* this) { this->actionDelay = 60; } -void sub_08020604(Entity *this){ +void sub_08020604(Entity* this) { if (!sub_08049FA0(this) && (Random() & 3)) { this->direction = sub_08049EE4(this); } else { @@ -365,8 +365,6 @@ void sub_08020604(Entity *this){ } } - - // clang-format off void (*const gPeahatFunctions[])(Entity*) = { Peahat_OnTick, @@ -414,4 +412,3 @@ const s8 gUnk_080CA5D4[] = { }; */ // clang-format on - diff --git a/src/enemy/smallPesto.c b/src/enemy/smallPesto.c index 299d9219..b01daa8d 100644 --- a/src/enemy/smallPesto.c +++ b/src/enemy/smallPesto.c @@ -24,99 +24,98 @@ void sub_08031840(Entity*); extern BoundingBox gUnk_080CE560; -void SmallPesto(Entity *this){ - gUnk_080CE530[GetNextFunction(this)](this); +void SmallPesto(Entity* this) { + gUnk_080CE530[GetNextFunction(this)](this); } -void sub_08031680(Entity *this){ - gUnk_080CE548[this->action](this); +void sub_08031680(Entity* this) { + gUnk_080CE548[this->action](this); } -void nullsub_152(){} +void nullsub_152() { +} -void sub_0803169C(Entity *this){ - s32 iVar1; - - GetNextFrame(this); - iVar1 = sub_0806F520(this); - if (iVar1 == 0) { - this->action = 1; - this->previousActionFlag = 0; - this->flags = this->flags | 0x80; - this->nonPlanarMovement = 0x40; - this->field_0xf = 1; - } - else { - gUnk_080CE554[this->previousActionFlag](this); - } +void sub_0803169C(Entity* this) { + s32 iVar1; + + GetNextFrame(this); + iVar1 = sub_0806F520(this); + if (iVar1 == 0) { + this->action = 1; + this->previousActionFlag = 0; + this->flags = this->flags | 0x80; + this->nonPlanarMovement = 0x40; + this->field_0xf = 1; + } else { + gUnk_080CE554[this->previousActionFlag](this); + } } -void sub_080316DC(Entity *this){ - this->previousActionFlag = 1; - this->field_0x1d = 0x3c; +void sub_080316DC(Entity* this) { + this->previousActionFlag = 1; + this->field_0x1d = 0x3c; } -void sub_080316E8(Entity *this){ +void sub_080316E8(Entity* this) { sub_0806F4E8(this); } -void sub_080316F0(Entity *this){ - if (sub_0806F3E4()) { - sub_0804A7D4(this); - } +void sub_080316F0(Entity* this) { + if (sub_0806F3E4()) { + sub_0804A7D4(this); + } } -void sub_08031704(Entity *this){ - sub_0804A720(this); - sub_080317F8(this); +void sub_08031704(Entity* this) { + sub_0804A720(this); + sub_080317F8(this); } -void sub_08031714(Entity* this){ +void sub_08031714(Entity* this) { u8 newDirection; sub_080317B4(this); - if(--this->field_0xf == 0){ + if (--this->field_0xf == 0) { this->field_0xf = (Random() & 0xf) + 0x10; - if(sub_08049FA0(this) == 0){ - if((this->field_0xf & 1) != 0){ + if (sub_08049FA0(this) == 0) { + if ((this->field_0xf & 1) != 0) { this->direction = sub_08049EE4(this); goto _08031766; } } - this->direction += 0x18; - this->direction = ((Random() & 0xe) + this->direction) & 0x1f; + this->direction += 0x18; + this->direction = ((Random() & 0xe) + this->direction) & 0x1f; _08031766: - sub_080317E0(this); + sub_080317E0(this); } } -void sub_08031770(Entity* this){ - if(this->field_0x80.HWORD != 0){ - if(--this->field_0x80.HWORD == 0){ +void sub_08031770(Entity* this) { + if (this->field_0x80.HWORD != 0) { + if (--this->field_0x80.HWORD == 0) { sub_08031840(this); } - }else if(this->attachedEntity == NULL){ + } else if (this->attachedEntity == NULL) { this->field_0x80.HWORD = (Random() & 0x7f) | (0x80 << 2); - }else{ - if(this->attachedEntity->next == NULL){ + } else { + if (this->attachedEntity->next == NULL) { this->attachedEntity = NULL; } } return; } -void sub_080317B4(Entity* this){ - this->height.HALF.HI = ((Random() & 0x30) != 0) ? -0xc : -0xd; +void sub_080317B4(Entity* this) { + this->height.HALF.HI = ((Random() & 0x30) != 0) ? -0xc : -0xd; sub_0806F69C(this); GetNextFrame(this); } - -void sub_080317E0(Entity *this){ +void sub_080317E0(Entity* this) { this->animationState = ((u8)(this->direction + 2) & 0x1c) >> 2; InitializeAnimation(this, this->animationState); } -void sub_080317F8(Entity *this){ +void sub_080317F8(Entity* this) { u8 newDirection = Random() & 0x18; this->action = 1; this->height.HALF.HI = 0x0000FFF4; @@ -130,13 +129,12 @@ void sub_080317F8(Entity *this){ this->field_0xf = 0x20; } -void sub_08031840(Entity* this){ - Entity *enemy = CreateEnemy(0x2d, this->entityType.form); - if(enemy!= NULL){ +void sub_08031840(Entity* this) { + Entity* enemy = CreateEnemy(0x2d, this->entityType.form); + if (enemy != NULL) { CopyPosition(this, enemy); enemy->parent = this; this->attachedEntity = enemy; enemy->entityType.parameter = 1; } } - diff --git a/src/enemy/treeItem.c b/src/enemy/treeItem.c index 24cd16bb..38fce4c3 100755..100644 --- a/src/enemy/treeItem.c +++ b/src/enemy/treeItem.c @@ -87,10 +87,8 @@ static bool32 ShouldSpawnTreeItem(Entity* this) { } playerState = gPlayerEntity.animationState; - if ((playerState == 0 && expectedStateY == 0) || - (playerState == 4 && expectedStateY == 4) || - (playerState == 6 && expectedStateX == 6) || - (playerState == 2 && expectedStateX == 2)) { + if ((playerState == 0 && expectedStateY == 0) || (playerState == 4 && expectedStateY == 4) || + (playerState == 6 && expectedStateX == 6) || (playerState == 2 && expectedStateX == 2)) { return TRUE; } |
