diff --git a/asm/macros/entity.inc b/asm/macros/entity.inc index 0c70833c..01e15566 100755 --- a/asm/macros/entity.inc +++ b/asm/macros/entity.inc @@ -158,8 +158,8 @@ .2byte \unknownD, 0x0 .endm - .macro minish_entrance x=0, y=0, unknown=0, actionDelay=0 - .2byte \x, \y, \unknown, \actionDelay + .macro minish_entrance x=0, y=0, unknown=0, timer=0 + .2byte \x, \y, \unknown, \timer .endm .endif @ GUARD_ASM_MACROS_ENTITY_INC diff --git a/constants/audio_constants.inc b/constants/audio_constants.inc index f2f1f2c5..a94bfe59 100644 --- a/constants/audio_constants.inc +++ b/constants/audio_constants.inc @@ -263,7 +263,7 @@ .equiv SFX_106, 0x106 .equiv SFX_107, 0x107 .equiv SFX_108, 0x108 - .equiv SFX_109, 0x109 + .equiv SFX_ITEM_GET, 0x109 .equiv SFX_10A, 0x10a .equiv SFX_10B, 0x10b .equiv SFX_BUTTON_PRESS, 0x10c diff --git a/data/map/entity_headers.s b/data/map/entity_headers.s index 9df5f918..a8e6f13b 100644 --- a/data/map/entity_headers.s +++ b/data/map/entity_headers.s @@ -15553,16 +15553,16 @@ gUnk_additional_1f_HyruleTown_0:: @ 080EEF44 exit_raw transition=0x1, destX=0x58, destY=0x36, destArea=0x22, destRoom=0xc, unknownA=0x1, unknownB=0x1, unknownC=0x4 gUnk_additional_e_HyruleTown_0:: @ 080EEF58 - minish_entrance x=0x124, y=0x50, actionDelay=0x20 - minish_entrance x=0x2f8, y=0x70, actionDelay=0x21 - minish_entrance x=0x7c, y=0x168, actionDelay=0x22 - minish_entrance x=0x56, y=0x1c0, unknown=0x4, actionDelay=0x23 - minish_entrance x=0x56, y=0x1c0, unknown=0x6, actionDelay=0x24 - minish_entrance x=0x56, y=0x1c0, unknown=0x5, actionDelay=0x25 - minish_entrance x=0x54, y=0x248, actionDelay=0x26 - minish_entrance x=0x180, y=0x2f0, actionDelay=0x27 - minish_entrance x=0x2d0, y=0x2f8, actionDelay=0x28 - minish_entrance x=0x344, y=0x70, actionDelay=0x2c + minish_entrance x=0x124, y=0x50, timer=0x20 + minish_entrance x=0x2f8, y=0x70, timer=0x21 + minish_entrance x=0x7c, y=0x168, timer=0x22 + minish_entrance x=0x56, y=0x1c0, unknown=0x4, timer=0x23 + minish_entrance x=0x56, y=0x1c0, unknown=0x6, timer=0x24 + minish_entrance x=0x56, y=0x1c0, unknown=0x5, timer=0x25 + minish_entrance x=0x54, y=0x248, timer=0x26 + minish_entrance x=0x180, y=0x2f0, timer=0x27 + minish_entrance x=0x2d0, y=0x2f8, timer=0x28 + minish_entrance x=0x344, y=0x70, timer=0x2c .4byte 0 gUnk_additional_20_HyruleTown_0:: @ 080EEFAC diff --git a/data/scripts/cutscene/introAssembly/script_PlayerGetSword.inc b/data/scripts/cutscene/introAssembly/script_PlayerGetSword.inc index 09f52543..085e4244 100644 --- a/data/scripts/cutscene/introAssembly/script_PlayerGetSword.inc +++ b/data/scripts/cutscene/introAssembly/script_PlayerGetSword.inc @@ -2,9 +2,9 @@ SCRIPT_START script_PlayerGetSword SetInventoryValue 0x0001, 0x0001 CallWithArg PutItemAnySlot, 0x00000001 - PlaySound SFX_109 + PlaySound SFX_ITEM_GET CallWithArg SetPlayerAnimation2, 0x0000045f - Call WaitForPlayerFrameHiBit + Call WaitForPlayerAnim MessageFromTargetPos 0x0501, 0x000e WaitUntilTextboxCloses SetSyncFlag 0x00000020 diff --git a/data/scripts/cutscene/outro/script_PlayerGetGreenCap.inc b/data/scripts/cutscene/outro/script_PlayerGetGreenCap.inc index ab1e3e4c..04e6cd52 100644 --- a/data/scripts/cutscene/outro/script_PlayerGetGreenCap.inc +++ b/data/scripts/cutscene/outro/script_PlayerGetGreenCap.inc @@ -3,16 +3,16 @@ SCRIPT_START script_PlayerGetGreenCap BeginBlock Call sub_08094BE0 CallWithArg SetPlayerAnimation2, 0x0000045b - PlaySound SFX_109 + PlaySound SFX_ITEM_GET EndBlock - Call WaitForPlayerFrameHiBit + Call WaitForPlayerAnim Wait 0x005a SetSyncFlag 0x00000008 BeginBlock CallWithArg ResetPlayerFlag, 0x00000008 CallWithArg SetPlayerAnimation2, 0x000008e4 EndBlock - Call WaitForPlayerFrameHiBit + Call WaitForPlayerAnim SetAnimationState 0x0004 DoPostScriptAction 0x0000 Wait 0x003c diff --git a/data/scripts/cutscene/takeover/script_PlayerAtTakeover.inc b/data/scripts/cutscene/takeover/script_PlayerAtTakeover.inc index c7689ff9..de5db4ee 100644 --- a/data/scripts/cutscene/takeover/script_PlayerAtTakeover.inc +++ b/data/scripts/cutscene/takeover/script_PlayerAtTakeover.inc @@ -8,11 +8,11 @@ SCRIPT_START script_PlayerAtTakeover SetAnimationState 0x0004 DoPostScriptAction 0x0000 CallWithArg SetPlayerAnimation2, 0x000003c5 - Call WaitForPlayerFrameHiBit + Call WaitForPlayerAnim MessageFromTargetPos 0x1318, 0x000c WaitUntilTextboxCloses CallWithArg SetPlayerAnimation2, 0x000003c9 - Call WaitForPlayerFrameHiBit + Call WaitForPlayerAnim SetAnimationState 0x0004 DoPostScriptAction 0x0000 SetSyncFlag 0x00000100 diff --git a/data/scripts/dhc/script_PlayerStonesFall.inc b/data/scripts/dhc/script_PlayerStonesFall.inc index 538adc2a..b2a41dd6 100644 --- a/data/scripts/dhc/script_PlayerStonesFall.inc +++ b/data/scripts/dhc/script_PlayerStonesFall.inc @@ -4,7 +4,7 @@ SCRIPT_START script_PlayerStonesFall SetAnimationState 0x0004 DoPostScriptAction 0x0000 CallWithArg SetPlayerAnimation2, 0x000003c5 - Call WaitForPlayerFrameHiBit + Call WaitForPlayerAnim SetSyncFlag 0x00000004 Call SetPlayerActionNormal SCRIPT_END diff --git a/data/scripts/graveyard/script_DampeInside.inc b/data/scripts/graveyard/script_DampeInside.inc index 42ebf439..805105df 100644 --- a/data/scripts/graveyard/script_DampeInside.inc +++ b/data/scripts/graveyard/script_DampeInside.inc @@ -8,7 +8,7 @@ SCRIPT_START script_DampeInside Call sub_0806BE84 WaitUntilTextboxCloses JumpIfNot script_08009622 - PlaySound SFX_109 + PlaySound SFX_ITEM_GET _0807F088 0x003c MessageFromTarget 0x053c WaitPlayerGetItem diff --git a/data/scripts/mtCrenel/script_PlayerGetWhiteSword.inc b/data/scripts/mtCrenel/script_PlayerGetWhiteSword.inc index 1ebd20e1..0dde5b0a 100644 --- a/data/scripts/mtCrenel/script_PlayerGetWhiteSword.inc +++ b/data/scripts/mtCrenel/script_PlayerGetWhiteSword.inc @@ -2,9 +2,9 @@ SCRIPT_START script_PlayerGetWhiteSword SetInventoryValue 0x0002, 0x0001 CallWithArg PutItemAnySlot, 0x00000002 - PlaySound SFX_109 + PlaySound SFX_ITEM_GET CallWithArg SetPlayerAnimation2, 0x000001e2 - Call WaitForPlayerFrameHiBit + Call WaitForPlayerAnim MessageNoOverlap 0x0502 WaitUntilTextboxCloses SetSyncFlag 0x00000008 diff --git a/data/scripts/sanctuary/script_Npc4EPedestal.inc b/data/scripts/sanctuary/script_Npc4EPedestal.inc index 6900e574..b4c53e85 100644 --- a/data/scripts/sanctuary/script_Npc4EPedestal.inc +++ b/data/scripts/sanctuary/script_Npc4EPedestal.inc @@ -55,7 +55,7 @@ script_080134F8: SetInventoryValue 0x0003, 0x0001 Call NPC4E_SaveEquippedItems Call NPC4E_RestoreEquippedItems - Call WaitForPlayerFrameHiBit + Call WaitForPlayerAnim Wait 0x003c SetFadeTime 0x0004 SetFade7 @@ -66,7 +66,7 @@ script_080134F8: SetFadeTime 0x0002 SetFade6 WaitForFadeFinish - PlaySound SFX_109 + PlaySound SFX_ITEM_GET MessageFromTargetPos 0x0503, 0x000c WaitUntilTextboxCloses SetSyncFlag 0x00040000 diff --git a/data/scripts/sanctuary/script_Npc4ESecondSanctuary.inc b/data/scripts/sanctuary/script_Npc4ESecondSanctuary.inc index 4b069913..5953b17b 100644 --- a/data/scripts/sanctuary/script_Npc4ESecondSanctuary.inc +++ b/data/scripts/sanctuary/script_Npc4ESecondSanctuary.inc @@ -58,7 +58,7 @@ script_0801373C: SetInventoryValue 0x0004, 0x0001 Call NPC4E_SaveEquippedItems Call NPC4E_RestoreEquippedItems - Call WaitForPlayerFrameHiBit + Call WaitForPlayerAnim Wait 0x003c SetFadeTime 0x0004 SetFade7 @@ -69,7 +69,7 @@ script_0801373C: SetFadeTime 0x0002 SetFade6 WaitForFadeFinish - PlaySound SFX_109 + PlaySound SFX_ITEM_GET MessageFromTargetPos 0x0504, 0x000c WaitUntilTextboxCloses SetSyncFlag 0x00040000 diff --git a/data/scripts/sanctuary/script_Npc4EThirdSanctuary.inc b/data/scripts/sanctuary/script_Npc4EThirdSanctuary.inc index 509c2f48..ecbbcb7b 100644 --- a/data/scripts/sanctuary/script_Npc4EThirdSanctuary.inc +++ b/data/scripts/sanctuary/script_Npc4EThirdSanctuary.inc @@ -63,7 +63,7 @@ script_080138D0: Call UpdatePlayerSkills Call NPC4E_SaveEquippedItems Call NPC4E_RestoreEquippedItems - Call WaitForPlayerFrameHiBit + Call WaitForPlayerAnim Wait 0x003c SetFadeTime 0x0004 SetFade7 @@ -74,7 +74,7 @@ script_080138D0: SetFadeTime 0x0002 SetFade6 WaitForFadeFinish - PlaySound SFX_109 + PlaySound SFX_ITEM_GET MessageFromTargetPos 0x0505, 0x000c WaitUntilTextboxCloses SetSyncFlag 0x00040000 diff --git a/data/scripts/sanctuary/script_PlayerPickUpFinalSword.inc b/data/scripts/sanctuary/script_PlayerPickUpFinalSword.inc index a8148e96..ed6b1b3e 100644 --- a/data/scripts/sanctuary/script_PlayerPickUpFinalSword.inc +++ b/data/scripts/sanctuary/script_PlayerPickUpFinalSword.inc @@ -6,7 +6,7 @@ SCRIPT_START script_PlayerPickUpFinalSword Call sub_08096028 Wait 0x0078 SetSyncFlag 0x00020000 - Call WaitForPlayerFrameHiBit + Call WaitForPlayerAnim Wait 0x0078 WaitForSyncFlagAndClear 0x00040000 Call SetPlayerActionNormal diff --git a/data/scripts/sanctuary/script_PlayerPickUpSword.inc b/data/scripts/sanctuary/script_PlayerPickUpSword.inc index ca4a3ea3..c873fa4e 100644 --- a/data/scripts/sanctuary/script_PlayerPickUpSword.inc +++ b/data/scripts/sanctuary/script_PlayerPickUpSword.inc @@ -5,7 +5,7 @@ SCRIPT_START script_PlayerPickUpSword Call sub_08096028 Wait 0x003c SetSyncFlag 0x00020000 - Call WaitForPlayerFrameHiBit + Call WaitForPlayerAnim Wait 0x0078 WaitForSyncFlagAndClear 0x00040000 Call SetPlayerActionNormal diff --git a/include/enemy/octorokBoss.h b/include/enemy/octorokBoss.h index dcdfa2ca..d977c0c2 100644 --- a/include/enemy/octorokBoss.h +++ b/include/enemy/octorokBoss.h @@ -5,7 +5,7 @@ typedef struct OctorokBossEntity OctorokBossEntity; typedef struct { - /*0x00*/ u8 unk_0; // [0,1,2,4] is later stored in super->field_0xf + /*0x00*/ u8 unk_0; // [0,1,2,4] is later stored in super->subtimer /*0x01*/ u8 tailCount; /*0x02*/ u8 field_0x2; // [0,1] /*0x03*/ u8 targetAngle; // relates to this->field_0x7a.HALF.HI diff --git a/include/entity.h b/include/entity.h index 99f2b11d..a75ff456 100644 --- a/include/entity.h +++ b/include/entity.h @@ -124,16 +124,16 @@ typedef struct Entity_ { /*0x0b*/ u8 type2; /**< For use internally. */ /*0x0c*/ u8 action; /**< Current action. Usually used to index a function table. */ /*0x0d*/ u8 subAction; /**< Optional sub-action. */ - /*0x0e*/ u8 actionDelay; /**< General purpose timer. */ - /*0x0f*/ u8 field_0xf; /**< General purpose timer. */ + /*0x0e*/ u8 timer; /**< General purpose timer. */ + /*0x0f*/ u8 subtimer; /**< General purpose timer. */ /*0x10*/ u8 flags; /**< @see EntityFlags */ /*0x11*/ u8 updatePriority : 4; /**< Current priority. @see Priority */ /* */ u8 updatePriorityPrev : 4; /**< Priority to restore after request is over. @see RequestPriority. */ /*0x12*/ s16 spriteIndex; /*0x14*/ u8 animationState; /**< Animation state. @see AnimationState */ /*0x15*/ u8 direction; /**< Facing direction. @see Direction */ - /*0x16*/ u8 field_0x16; - /*0x17*/ u8 field_0x17; + /*0x16*/ u8 carryFlags; /**< Flags for carrying this Entity. */ + /*0x17*/ u8 followerFlag; /**< Controls collisions between followers, unused. */ /*0x18*/ struct { /* */ u32 draw : 2; /**< Draw type. 0 = disabled, 1 = clip to screen, 3 = draw always */ /* 0x2 */ /* */ u32 ss2 : 1; /* 4 */ @@ -160,35 +160,35 @@ typedef struct Entity_ { /* */ u32 b1 : 5; /* 0x2-0x10 */ /* */ u32 flipY : 2; /* 0x20-0x40 */ /* */ } PACKED spriteOrientation; - /*0x1c*/ u8 field_0x1c; - /*0x1d*/ u8 field_0x1d; + /*0x1c*/ u8 gustJarFlags; /**< Controls sfx and other things */ + /*0x1d*/ u8 gustJarTolerance; /**< Frames needed to pull off ground. */ /*0x1e*/ u8 frameIndex; /*0x1f*/ u8 lastFrameIndex; /*0x20*/ s32 zVelocity; /**< Z axis speed, measured in px/frame */ /*0x24*/ s16 speed; /**< Magnitude of speed. */ /*0x26*/ u8 spriteAnimation[3]; /*0x29*/ SpritePriority spritePriority; - /*0x2a*/ u16 collisions; + /*0x2a*/ u16 collisions; /**< Collision flags for each direction. */ /*0x2c*/ union SplitWord x; /**< X position, fixed point Q16.16. */ /*0x30*/ union SplitWord y; /**< Y position, fixed point Q16.16. */ /*0x34*/ union SplitWord z; /**< Z position, fixed point Q16.16. */ /*0x38*/ u8 collisionLayer; /**< Collision layer. */ /*0x39*/ s8 interactType; - /*0x3a*/ u8 field_0x3a; /**< 4: grabbed by GustJar */ - /*0x3b*/ u8 flags2; - /*0x3c*/ u8 field_0x3c; + /*0x3a*/ u8 gustJarState; /**< 4: grabbed by GustJar */ + /*0x3b*/ u8 flags2; /**< Debug visualization related? */ + /*0x3c*/ u8 collisionFlags; /**< Controls collision modes. */ /*0x3d*/ s8 iframes; /**< Invulnerability frames. */ /*0x3e*/ u8 knockbackDirection; /**< Direction of knockback. */ /*0x3f*/ u8 hitType; /**< Behavior as a collision sender. */ - /*0x40*/ u8 hurtType; /**< behavior as a collision receiver. */ - /*0x41*/ u8 bitfield; - /*0x42*/ u8 knockbackDuration; /**< Duration of knockback. */ - /*0x43*/ u8 confusedTime; /**< Frames that this Entity is confused. */ - /*0x44*/ u8 damage; /**< Damage this Entity inflicts. */ - /*0x45*/ u8 health; /**< Health of this Entity. */ - /*0x46*/ u16 knockbackSpeed; /**< How fast this Entity is knocked back. */ - /*0x48*/ Hitbox* hitbox; /**< Hitbox associated with this Entity. */ - /*0x4c*/ struct Entity_* field_0x4c; + /*0x40*/ u8 hurtType; /**< Behavior as a collision receiver. */ + /*0x41*/ u8 contactFlags; /**< Information about collision contact. */ + /*0x42*/ u8 knockbackDuration; /**< Duration of knockback. */ + /*0x43*/ u8 confusedTime; /**< Frames that this Entity is confused. */ + /*0x44*/ u8 damage; /**< Damage this Entity inflicts. */ + /*0x45*/ u8 health; /**< Health of this Entity. */ + /*0x46*/ u16 knockbackSpeed; /**< How fast this Entity is knocked back. */ + /*0x48*/ Hitbox* hitbox; /**< Hitbox associated with this Entity. */ + /*0x4c*/ struct Entity_* contactedEntity; /*0x50*/ struct Entity_* parent; /**< Parent Entity. Sometimes points to associated data. */ /*0x54*/ struct Entity_* child; /**< Child Entity. Sometimes points to associated data. */ /*0x58*/ u8 animIndex; diff --git a/include/functions.h b/include/functions.h index c2ded725..631f5176 100644 --- a/include/functions.h +++ b/include/functions.h @@ -5,7 +5,7 @@ #include "global.h" #include "entity.h" #include "manager.h" -#include "coord.h" +#include "physics.h" #include "player.h" #include "room.h" #include "structures.h" diff --git a/include/menu.h b/include/menu.h index f590e999..2549e327 100644 --- a/include/menu.h +++ b/include/menu.h @@ -104,12 +104,12 @@ typedef struct { /*0x14*/ u8 filler14[6]; /*0x1a*/ u8 unk1a; /*0x1b*/ u8 filler1b[1]; - /*0x1c*/ u8 unk1c; + /*0x1c*/ u8 figure_idx; /*0x1d*/ u8 unk1d; /*0x1e*/ u8 unk1e; /*0x1f*/ s8 unk1f; /*0x20*/ u8 unk20; - /*0x21*/ u8 unk21; + /*0x21*/ bool8 duplicate; /*0x22*/ u8 filler22[0xc]; /*0x2e*/ u16 unk2e; } FigurineMenu; diff --git a/include/npc.h b/include/npc.h index cfe0f9cf..1a57ccc9 100644 --- a/include/npc.h +++ b/include/npc.h @@ -9,7 +9,7 @@ #include "effects.h" #include "room.h" #include "flags.h" -#include "coord.h" +#include "physics.h" #include "message.h" #include "script.h" #include "save.h" diff --git a/include/object.h b/include/object.h index eb4582d4..c8b46a16 100644 --- a/include/object.h +++ b/include/object.h @@ -9,7 +9,7 @@ #include "flags.h" #include "effects.h" #include "room.h" -#include "coord.h" +#include "physics.h" #include "entity.h" #include "player.h" diff --git a/include/coord.h b/include/physics.h similarity index 100% rename from include/coord.h rename to include/physics.h diff --git a/include/save.h b/include/save.h index cd5ab988..d85cad01 100644 --- a/include/save.h +++ b/include/save.h @@ -38,7 +38,7 @@ typedef struct { /*0x002*/ u8 msg_speed; /**< Message speed. */ /*0x003*/ u8 brightness; /**< Brightness. */ /*0x004*/ u8 filler4[0x2]; - /*0x006*/ u8 unk6; + /*0x006*/ u8 saw_staffroll; /*0x007*/ u8 unk7; /*0x008*/ u8 global_progress; /**< @see UpdateGlobalProgress */ /*0x009*/ u8 field_0x9[0x34]; diff --git a/include/sound.h b/include/sound.h index 2e1e57b8..86fa8ac9 100644 --- a/include/sound.h +++ b/include/sound.h @@ -297,7 +297,7 @@ typedef enum { SFX_106, SFX_107, SFX_108, - SFX_109, + SFX_ITEM_GET, SFX_10A, SFX_10B, SFX_BUTTON_PRESS, diff --git a/linker.ld b/linker.ld index ad4af9da..e84fa0ea 100644 --- a/linker.ld +++ b/linker.ld @@ -594,7 +594,7 @@ SECTIONS { src/npc/npc58.o(.text); /* END npcs */ src/npcUtils.o(.text); - src/coord.o(.text); /* physics? */ + src/physics.o(.text); src/playerItem/playerItemPacciCaneProjectile.o(.text); src/playerItem/playerItemPacciCane.o(.text); src/player.o(.text); @@ -1304,7 +1304,7 @@ SECTIONS { data/const/npc/npc58.o(.rodata); src/npcDefinitions.o(.rodata); data/data_081146D0.o(.rodata); - src/coord.o(.rodata); + src/physics.o(.rodata); src/playerHitbox.o(.rodata); data/gfx/sprite_frames.o(.rodata); src/playerItem/playerItemPacciCaneProjectile.o(.rodata); diff --git a/src/collision.c b/src/collision.c index 4e5337bf..911b3f11 100644 --- a/src/collision.c +++ b/src/collision.c @@ -190,11 +190,11 @@ bool32 IsColliding(Entity* this, Entity* that) { this_len = bb_this->height; sumw = this_len + bb_that->height; if ((((this->y.HALF.HI - that->y.HALF.HI) + bb_this->offset_y) - bb_that->offset_y) + sumw <= (sumw)*2) { - if ((this->field_0x3c & 0x10) != 0) + if ((this->collisionFlags & 0x10) != 0) this_d = ((Hitbox3D*)bb_this)->depth; else this_d = 5; - if ((that->field_0x3c & 0x10) != 0) + if ((that->collisionFlags & 0x10) != 0) depth = this_d + ((Hitbox3D*)bb_that)->depth; else depth = this_d + 5; @@ -350,7 +350,7 @@ s32 CollisionNoOp(Entity* org, Entity* tgt, u32 direction, ColSettings* settings // target: item s32 CollisionGroundItem(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) { COLLISION_OFF(tgt); - tgt->bitfield = org->hurtType | 0x80; + tgt->contactFlags = org->hurtType | 0x80; if ((tgt->type == 0x5F || tgt->type == 0x60) && sub_08081420(tgt)) tgt->health = 0; return 2; @@ -368,18 +368,18 @@ s32 sub_08017B1C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) } s32 sub_08017B58(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) { - if ((tgt->field_0x3a & 4) != 0) { - if (tgt->field_0x1d) { - s32 x = tgt->field_0x1d = tgt->field_0x1d - gPlayerState.gustJarSpeed; + if ((tgt->gustJarState & 4) != 0) { + if (tgt->gustJarTolerance) { + s32 x = tgt->gustJarTolerance = tgt->gustJarTolerance - gPlayerState.gustJarSpeed; if (x << 24 <= 0) { - tgt->field_0x1d = 0; + tgt->gustJarTolerance = 0; tgt->subAction = 2; tgt->knockbackSpeed = 0; } } } else { tgt->subAction = 0; - tgt->field_0x3a |= 4u; + tgt->gustJarState |= 4u; } if (tgt->iframes == 0) tgt->iframes = -1; @@ -459,7 +459,7 @@ s32 sub_08017D6C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) x = org->hurtType; y = 0xac2; } else { - tgt->bitfield = 0xcb; + tgt->contactFlags = 0xcb; tgt->field_0x78.HALF.HI = org->hurtType; x = org->hurtType; y = 0xae4; @@ -469,7 +469,7 @@ s32 sub_08017D6C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) } int sub_08017DD4(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) { - org->bitfield = 0; + org->contactFlags = 0; if (tgt->damage & 0x80) tgt->damage &= ~0x80; else @@ -480,7 +480,7 @@ int sub_08017DD4(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) sub_08079D84(); org->iframes = 90; } else { - gPlayerEntity.bitfield = tgt->hurtType | 0x80; + gPlayerEntity.contactFlags = tgt->hurtType | 0x80; gPlayerEntity.iframes = 12; gPlayerEntity.knockbackDuration = 16; gPlayerEntity.knockbackDirection = DirectionTurnAround(direction); @@ -725,18 +725,18 @@ s32 sub_08018308(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) if (settings->_a & 1) sub_08017940(org, tgt); if (settings->_a & 2) - org->bitfield = 0xca; + org->contactFlags = 0xca; if (settings->_a & 4) { Entity* parent = tgt->parent; if (parent != NULL) { - parent->bitfield = 0xcc; + parent->contactFlags = 0xcc; parent->iframes = tgt->iframes; parent->knockbackDirection = direction; parent->knockbackDuration = tgt->knockbackDuration; if (parent->confusedTime == 0) parent->confusedTime = tgt->confusedTime; parent->knockbackSpeed = tgt->knockbackSpeed; - parent->field_0x4c = org; + parent->contactedEntity = org; } } if (org->kind == PLAYER_ITEM) { diff --git a/src/color.c b/src/color.c index 301e5613..3211e948 100644 --- a/src/color.c +++ b/src/color.c @@ -6,7 +6,7 @@ #include "global.h" #include "fileselect.h" #include "main.h" -#include "coord.h" +#include "physics.h" extern Palette gUnk_02001A3C; diff --git a/src/createEnemy.c b/src/createEnemy.c index ed4da368..36c4d4d4 100644 --- a/src/createEnemy.c +++ b/src/createEnemy.c @@ -3,9 +3,9 @@ /** Unsets bitfield 0x80 before calling GetNextFunction, so that the enemyFunction 1 is not called. */ void EnemyFunctionHandlerAfterCollision(Entity* entity, void (*fntable[])()) { u32 idx; - entity->bitfield &= ~0x80; + entity->contactFlags &= ~0x80; idx = GetNextFunction(entity); - entity->bitfield |= 0x80; + entity->contactFlags |= 0x80; fntable[idx](entity); } diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c index d240ecab..0fd0c667 100644 --- a/src/enemy/acroBandits.c +++ b/src/enemy/acroBandits.c @@ -50,7 +50,7 @@ void AcroBandit(Entity* this) { index = sub_080012DC(this); if (index) { - if ((this->field_0x3a & 1) == 0) + if ((this->gustJarState & 1) == 0) sub_08032338(this); gUnk_080012C8[index](this); @@ -71,7 +71,7 @@ void AcroBandit_OnTick(Entity* this) { void AcroBandit_OnCollision(Entity* this) { Entity* brother; - if (this->bitfield != 0x80 && this->bitfield != 0x81) { + if (this->contactFlags != 0x80 && this->contactFlags != 0x81) { if (this->type == 1) { if (this->action < 7 && this->knockbackDuration != 0) { brother = this->child; @@ -161,8 +161,8 @@ void AcroBandit_Type0Action1(Entity* this) { u32 rand; s32 x, y; - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else { if (sub_08049FDC(this, 1)) { rand = Random(); @@ -180,7 +180,7 @@ void AcroBandit_Type0Action1(Entity* this) { } void AcroBandit_Type0Action2(Entity* this) { - static const u8 actionDelays[] = { 2, 2, 2, 3, 3, 3, 3, 4 }; + static const u8 timers[] = { 2, 2, 2, 3, 3, 3, 3, 4 }; GetNextFrame(this); if (this->frame & 1) { @@ -189,7 +189,7 @@ void AcroBandit_Type0Action2(Entity* this) { } else { if (this->frame & ANIM_DONE) { this->action = 0x3; - this->actionDelay = actionDelays[Random() & 7]; + this->timer = timers[Random() & 7]; InitializeAnimation(this, 1); } } @@ -205,12 +205,12 @@ void AcroBandit_Type0Action3(Entity* this) { } InitializeAnimation(this, 3); } else { - if ((this->frame & 1) && this->actionDelay) { + if ((this->frame & 1) && this->timer) { this->frame &= 0xfe; - this->actionDelay--; + this->timer--; } GetNextFrame(this); - if (this->actionDelay == 0) { + if (this->timer == 0) { this->action = 4; COLLISION_OFF(this); InitializeAnimation(this, 2); @@ -219,11 +219,11 @@ void AcroBandit_Type0Action3(Entity* this) { } void AcroBandit_Type0Action4(Entity* this) { - static const u8 actionDelays[] = { 60, 60, 90, 120, 120, 120, 120, 150 }; + static const u8 timers[] = { 60, 60, 90, 120, 120, 120, 120, 150 }; GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 1; - this->actionDelay = actionDelays[Random() & 7]; + this->timer = timers[Random() & 7]; this->spriteSettings.draw = 0; } } @@ -273,7 +273,7 @@ void AcroBandit_Type0Action5(Entity* this) { sub_08031E48(this, a); this->action = 6; - this->actionDelay = 20; + this->timer = 20; this->spritePriority.b0 = 7; InitializeAnimation(this, 7); } @@ -287,21 +287,21 @@ void AcroBandit_Type0Action5(Entity* this) { void AcroBandit_Type0Action6(Entity* this) { GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 7; COLLISION_OFF(this); - this->actionDelay = 5; + this->timer = 5; this->spriteSettings.draw = 0; } } void AcroBandit_Type0Action7(Entity* this) { - if ((this->actionDelay & 0xf) == 0) { - if (this->actionDelay == 0x50) { + if ((this->timer & 0xf) == 0) { + if (this->timer == 0x50) { DeleteEntity(this); } else { this->action = 1; - this->actionDelay = 0xb4; + this->timer = 0xb4; } } } @@ -309,7 +309,7 @@ void AcroBandit_Type0Action7(Entity* this) { void AcroBandit_Type0Action8(Entity* this) { if (this->frame & ANIM_DONE) { this->action = 1; - this->actionDelay = 0xb4; + this->timer = 0xb4; this->spriteSettings.draw = 0; } else { GetNextFrame(this); @@ -391,7 +391,7 @@ void AcroBandit_Type1Action2(Entity* this) { GravityUpdate(this, banditGravity[this->type2]); if (this->type2 * -0xe <= this->z.HALF.HI) { this->action = 3; - this->actionDelay = 20; + this->timer = 20; this->z.HALF.HI = this->type2 * -0xe; if (this->parent != NULL) this->spritePriority.b1 = 0; @@ -401,7 +401,7 @@ void AcroBandit_Type1Action2(Entity* this) { void AcroBandit_Type1Action3(Entity* this) { GetNextFrame(this); - if ((this->frame & ANIM_DONE) && ((this->parent != NULL) || (--this->actionDelay == 0))) { + if ((this->frame & ANIM_DONE) && ((this->parent != NULL) || (--this->timer == 0))) { this->action = 4; this->direction = sub_08049F84(this, 1); *(u8*)&this->field_0x76 = 0; @@ -475,7 +475,7 @@ void AcroBandit_Type1Action6(Entity* this) { Entity* tmp; u32 dir; - if (this->actionDelay == 0) { + if (this->timer == 0) { this->action = 7; dir = fallDirections[this->field_0x74.HALF.LO * 5 + this->type2]; this->direction = dir; @@ -493,9 +493,9 @@ void AcroBandit_Type1Action6(Entity* this) { if (this->child == NULL) { for (tmp = this->parent; tmp != NULL; tmp = tmp->parent) { if (tmp->health != 0) - tmp->actionDelay = 0; + tmp->timer = 0; } - this->actionDelay = 0; + this->timer = 0; } } @@ -522,7 +522,7 @@ void AcroBandit_Type1Action8(Entity* this) { void AcroBandit_Type1Action9(Entity* this) { if (GravityUpdate(this, Q_8_8(24.0)) == 0) { if (this->frame & ANIM_DONE) { - ((Entity*)this->field_0x7c.WORD)->actionDelay--; + ((Entity*)this->field_0x7c.WORD)->timer--; DeleteEntity(this); } else { @@ -536,7 +536,7 @@ void AcroBandit_Type1Action9(Entity* this) { void sub_08032290(Entity* this) { this->action = 6; - this->actionDelay = 12; + this->timer = 12; InitializeAnimation(this, 11); } @@ -574,6 +574,6 @@ void sub_080322E8(Entity* this) { } void sub_08032338(Entity* this) { - if ((((Entity*)this->field_0x7c.WORD)->actionDelay += 15) != 80) + if ((((Entity*)this->field_0x7c.WORD)->timer += 15) != 80) this->field_0x6c.HALF.LO = 0; } diff --git a/src/enemy/armos.c b/src/enemy/armos.c index 09c732e7..228c12bf 100644 --- a/src/enemy/armos.c +++ b/src/enemy/armos.c @@ -96,7 +96,7 @@ void sub_080301BC(ArmosEntity* this) { } void sub_080301D4(ArmosEntity* this) { - if ((super->action == 1) && (super->field_0x4c == &gPlayerEntity)) { + if ((super->action == 1) && (super->contactedEntity == &gPlayerEntity)) { super->iframes = -0x1e; } if ((super->health != 0) && (super->health != this->unk_81)) { @@ -126,7 +126,7 @@ void nullsub_17(ArmosEntity* this) { void sub_0803026C(ArmosEntity* this) { u16* ptr; sub_0804A720(super); - this->unk_80 = super->actionDelay; + this->unk_80 = super->timer; ptr = &gRoomTransition.armos_data.data[this->unk_80 * 2]; if (ptr[0] != 0) { super->x.HALF.HI = ptr[0]; @@ -170,8 +170,8 @@ void sub_08030338(ArmosEntity* this) { if (super->subAction == 0) { super->subAction = 1; } - uVar3 = super->actionDelay + 1; - super->actionDelay = (u8)uVar3; + uVar3 = super->timer + 1; + super->timer = (u8)uVar3; if ((uVar3 & 1) == 0) { return; } @@ -200,7 +200,7 @@ void sub_08030338(ArmosEntity* this) { return; } super->action = 6; - super->actionDelay = 0x1a; + super->timer = 0x1a; super->speed = 0x300; super->direction = 0x10; return; @@ -219,15 +219,15 @@ void sub_08030430(ArmosEntity* this) { if (this->unk_7a != 0) { this->unk_7a--; } - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_080306C4(this); } } void sub_08030474(ArmosEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 3; - super->actionDelay = 1; + super->timer = 1; this->unk_7a = 0x3c; sub_080309E8(this); } else { @@ -259,7 +259,7 @@ END_NONMATCH void sub_080304F4(ArmosEntity* this) { LinearMoveUpdate(super); sub_080309A8(this); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 7; sub_080309C8(this, 5); sub_080307EC(this); @@ -302,7 +302,7 @@ ASM_FUNC("asm/non_matching/armos/sub_080305BC.inc", bool32 sub_080305BC(ArmosEnt bool32 sub_08030650(ArmosEntity* this) { if (super->type == 0) { - if (super->bitfield == 0x80) { + if (super->contactFlags == 0x80) { return 1; } } else if (this->unk_80 != 2) { diff --git a/src/enemy/ballChainSoldier.c b/src/enemy/ballChainSoldier.c index 9e1ef699..cd5e1600 100644 --- a/src/enemy/ballChainSoldier.c +++ b/src/enemy/ballChainSoldier.c @@ -133,15 +133,15 @@ void sub_0803E6E0(BallChainSoldierEntity* this) { if ((s8)this->unk_7e <= 0) { this->unk_7e = 0; super->action = 6; - super->actionDelay = 0x1e; + super->timer = 0x1e; InitAnimationForceUpdate(super, super->animationState + 0x20); } } void sub_0803E71C(BallChainSoldierEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 7; - super->actionDelay = 1; + super->timer = 1; this->unk_7c = gUnk_080D0724[super->animationState]; this->unk_7b = 0; this->unk_7f = 0xf6; @@ -153,8 +153,8 @@ void sub_0803E75C(BallChainSoldierEntity* this) { if ((super->frame & ANIM_DONE) == 0) { UpdateAnimationSingleFrame(super); } else { - if (--super->actionDelay == 0) { - super->actionDelay = 2; + if (--super->timer == 0) { + super->timer = 2; this->unk_7f++; } @@ -162,14 +162,14 @@ void sub_0803E75C(BallChainSoldierEntity* this) { this->unk_7e += 5; } else { super->action = 8; - super->actionDelay = 0x1e; + super->timer = 0x1e; InitScreenShake(8, 0); } } } void sub_0803E7B4(BallChainSoldierEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 9; } } @@ -178,7 +178,7 @@ void sub_0803E7CC(BallChainSoldierEntity* this) { this->unk_7e -= 2; if (this->unk_7e <= 0xa) { super->action = 0xa; - super->actionDelay = 0x5a; + super->timer = 0x5a; super->direction = DirectionFromAnimationState(super->animationState); this->unk_7c = 0; this->unk_7f = 0xfe; @@ -189,8 +189,8 @@ void sub_0803E7CC(BallChainSoldierEntity* this) { } void sub_0803E818(BallChainSoldierEntity* this) { - if (super->actionDelay) { - if (--super->actionDelay == 0) { + if (super->timer) { + 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 dc15be53..0abdeeeb 100644 --- a/src/enemy/beetle.c +++ b/src/enemy/beetle.c @@ -28,14 +28,14 @@ void Beetle_OnTick(Entity* this) { } void Beetle_OnCollision(Entity* this) { - switch (this->bitfield) { + switch (this->contactFlags) { case 0x80: if (gPlayerState.framestate == PL_STATE_CLIMB) { Beetle_OnTick(this); } else { this->action = 5; - this->actionDelay = 0xb4; - this->field_0xf = 0; + this->timer = 0xb4; + this->subtimer = 0; COLLISION_OFF(this); this->spritePriority.b0 = 3; CopyPositionAndSpriteOffset(&gPlayerEntity, this); @@ -61,7 +61,7 @@ void Beetle_OnDeath(Entity* this) { } else { Entity* ent = this->parent; if (ent != NULL) { - ent->field_0xf--; + ent->subtimer--; this->parent = NULL; } CreateDeathFx(this, 0xf0, 0); @@ -93,7 +93,7 @@ void sub_08021888(Entity* this) { void Beetle_Initialize(Entity* this) { sub_0804A720(this); this->action = 1; - this->field_0x1c = 1; + this->gustJarFlags = 1; InitializeAnimation(this, 3); } @@ -119,8 +119,8 @@ void sub_080218CC(Entity* this) { if (this->frame & ANIM_DONE) { this->action = 2; - this->actionDelay = (Random() & 0x38) + 8; - this->field_0xf = 1; + this->timer = (Random() & 0x38) + 8; + this->subtimer = 1; COLLISION_ON(this); this->speed = 0x180; InitializeAnimation(this, 0); @@ -140,8 +140,8 @@ void sub_08021984(Entity* this) { if (GravityUpdate(this, 0x1800) == 0) { this->action = 2; - this->actionDelay = 16; - this->field_0xf = 1; + this->timer = 16; + this->subtimer = 1; this->spriteSettings.draw = 1; this->speed = 0x180; ((u8*)&this->field_0x86)[0] = 60; @@ -153,9 +153,9 @@ void sub_08021984(Entity* this) { void sub_08021A10(Entity* this) { GetNextFrame(this); if (EntityInRectRadius(this, &gPlayerEntity, 120, 80) && sub_08021D00(this) == 0) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; - this->actionDelay = (Random() & 0x3f) + 30; + this->timer = (Random() & 0x3f) + 30; sub_08021D44(this, this->direction); InitializeAnimation(this, 2); } @@ -164,16 +164,16 @@ void sub_08021A10(Entity* this) { void sub_08021A64(Entity* this) { if (!sub_08021D00(this)) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; - this->actionDelay = (Random() & 0x1f) + 0x1e; + this->timer = (Random() & 0x1f) + 0x1e; InitializeAnimation(this, 0); } - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { u32 tmp; - this->field_0xf = 8; + this->subtimer = 8; tmp = sub_08049F84(this, 1); if (tmp == 0xff) { this->action = 7; @@ -190,14 +190,14 @@ void sub_08021A64(Entity* this) { void sub_08021AD8(Entity* this) { GetNextFrame(this); if (this->frame & 1) { - if (this->actionDelay) { + if (this->timer) { u32 tmp; - this->actionDelay = 0; + this->timer = 0; tmp = sub_08049F84(this, 1); if (tmp == 0xff) { this->action = 2; - this->actionDelay = '\b'; + this->timer = '\b'; InitializeAnimation(this, 0); return; } @@ -211,7 +211,7 @@ void sub_08021AD8(Entity* this) { if (this->frame & ANIM_DONE) { this->action = 2; - this->actionDelay = 20; + this->timer = 20; ((u8*)&this->field_0x86)[0] = 60; InitializeAnimation(this, 0); } @@ -228,11 +228,11 @@ void sub_08021B64(Entity* this) { if (sub_0807953C()) iVar4 = this->type * 3 + 8; - iVar4 = this->actionDelay - iVar4; + iVar4 = this->timer - iVar4; if (iVar4 < 0) iVar4 = 0; - this->actionDelay = (u8)iVar4; + this->timer = (u8)iVar4; } if (gPlayerState.flags & (PL_DISABLE_ITEMS | PL_CAPTURED)) @@ -253,7 +253,7 @@ void sub_08021B64(Entity* this) { gPlayerState.speed_modifier -= 0x50; gPlayerState.field_0xaa++; CopyPositionAndSpriteOffset(&gPlayerEntity, this); - this->x.HALF.HI += gUnk_080CB5E4[(this->field_0xf++ & 0xe) >> 1]; + this->x.HALF.HI += gUnk_080CB5E4[(this->subtimer++ & 0xe) >> 1]; this->z.HALF.HI--; GetNextFrame(this); } @@ -270,8 +270,8 @@ void sub_08021C58(Entity* this) { if (this->frame & ANIM_DONE) { this->action = 2; - this->actionDelay = 60; - this->field_0xf = 1; + this->timer = 60; + this->subtimer = 1; COLLISION_ON(this); this->spritePriority.b0 = 4; ((u8*)&this->field_0x86)[0] = 60; @@ -300,7 +300,7 @@ u32 sub_08021D00(Entity* this) { ret = 0; } else { this->action = 4; - this->actionDelay = 1; + this->timer = 1; this->zVelocity = Q_16_16(1.5); InitializeAnimation(this, 4); ret = 1; diff --git a/src/enemy/bobomb.c b/src/enemy/bobomb.c index 8e2a03a9..5bc0c6c8 100644 --- a/src/enemy/bobomb.c +++ b/src/enemy/bobomb.c @@ -30,8 +30,8 @@ void Bobomb_OnTick(Entity* this) { } void Bobomb_OnCollision(Entity* this) { - if (this->bitfield & 0x80) { - switch (this->bitfield & 0x7f) { + if (this->contactFlags & 0x80) { + switch (this->contactFlags & 0x7f) { case 0: case 1: if (this->field_0x82.HALF.LO) { @@ -58,7 +58,7 @@ void Bobomb_OnCollision(Entity* this) { case 2: this->action = 3; this->hitType = 0x6e; - this->field_0xf = 1; + this->subtimer = 1; this->zVelocity = Q_16_16(1.5); this->speed = 0; this->field_0x80.HALF.HI = 1; @@ -72,7 +72,7 @@ void Bobomb_OnCollision(Entity* this) { void Bobomb_OnGrabbed(Entity* this) { if (this->subAction < 3 && !sub_0806F520(this)) { this->subAction = 0; - this->field_0xf = 1; + this->subtimer = 1; this->z.HALF.HI = 0; if (this->field_0x82.HALF.LO != 2) { this->speed = this->field_0x82.HALF.LO ? 0x200 : 0x80; @@ -83,7 +83,7 @@ void Bobomb_OnGrabbed(Entity* this) { } else { this->z.HALF.HI = -1; gUnk_080CD600[this->subAction](this); - if (this->actionDelay != 0) { + if (this->timer != 0) { GetNextFrame(this); } } @@ -91,7 +91,7 @@ void Bobomb_OnGrabbed(Entity* this) { void sub_0802C820(Entity* this) { this->subAction = 1; - this->field_0x1d = 60; + this->gustJarTolerance = 60; } void sub_0802C82C(Entity* this) { @@ -104,7 +104,7 @@ void sub_0802C834(Entity* this) { void sub_0802C83C(Entity* this) { if (this->field_0x82.HALF.LO) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; switch (gPlayerEntity.animationState & 6) { case 2: @@ -122,7 +122,7 @@ void sub_0802C83C(Entity* this) { } } else { this->field_0x82.HALF.LO = 2; - this->actionDelay = 120; + this->timer = 120; InitializeAnimation(this, (this->direction >> 4) | 6); COLLISION_OFF(this); this->hitType = 0x6e; @@ -145,11 +145,11 @@ void Bobomb_OnDeath(Entity* this) { void sub_0802C8D8(Entity* this) { this->action = 1; - this->actionDelay = 0x3c; - this->field_0xf = 0; + this->timer = 0x3c; + this->subtimer = 0; this->direction = (Random() & 0x18) | 4; - this->field_0x16 = 0; - this->field_0x1c = 0x12; + this->carryFlags = 0; + this->gustJarFlags = 0x12; this->field_0x82.HALF.LO = 0; this->field_0x82.HALF.HI = 0; this->field_0x80.HALF.LO = 0; @@ -165,10 +165,10 @@ void sub_0802C91C(Entity* this) { sub_0800417E(this, this->collisions); InitializeAnimation(this, (this->direction >> 4) | 2); } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_0802CBC4(this); } else { - if ((this->actionDelay & 0xf) == 8) { + if ((this->timer & 0xf) == 8) { CreateDustSmall(this); } sub_0802CC18(this); @@ -178,8 +178,8 @@ void sub_0802C91C(Entity* this) { sub_0800417E(this, this->collisions); InitializeAnimation(this, this->direction >> 4); } - if (--this->actionDelay == 0) { - this->actionDelay = 60; + if (--this->timer == 0) { + this->timer = 60; this->direction = (this->direction + 8) & 0x1c; InitializeAnimation(this, this->direction >> 4); } @@ -202,7 +202,7 @@ void sub_0802C9D0(Entity* this) { void sub_0802CA10(Entity* this) { if (gPlayerState.heldObject != 5) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_0802CBC4(this); } else { sub_0802CC18(this); @@ -217,7 +217,7 @@ void sub_0802CA10(Entity* this) { } void sub_0802CA6C(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_0802CBC4(this); } else { sub_0802CC18(this); @@ -228,7 +228,7 @@ void sub_0802CA6C(Entity* this) { void sub_0802CA94(Entity* this) { this->action = 3; COLLISION_OFF(this); - this->field_0xf = 1; + this->subtimer = 1; this->spritePriority.b1 = 1; this->zVelocity = Q_16_16(1.5); this->speed = 0; @@ -239,7 +239,7 @@ void sub_0802CA94(Entity* this) { } void sub_0802CAF8(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_0802CBC4(this); } else { if (this->field_0x80.HALF.HI && sub_080044EC(this, 0x2800) == 1) { @@ -247,8 +247,8 @@ void sub_0802CAF8(Entity* this) { } sub_0802CC18(this); RegisterCarryEntity(this); - if (this->field_0xf && this->z.HALF.HI == 0) { - this->field_0xf = 0; + if (this->subtimer && this->z.HALF.HI == 0) { + this->subtimer = 0; COLLISION_ON(this); this->hitType = 0x6e; } @@ -267,11 +267,11 @@ void sub_0802CB68(Entity* this) { this->direction |= 4; COLLISION_ON(this); if (this->field_0x82.HALF.LO) { - this->actionDelay = 200; + this->timer = 200; this->speed = 0x200; InitializeAnimation(this, (this->direction >> 4) | 2); } else { - this->actionDelay = 0x3c; + this->timer = 0x3c; this->speed = 0x80; InitializeAnimation(this, this->direction >> 4); } diff --git a/src/enemy/bombPeahat.c b/src/enemy/bombPeahat.c index f49316d5..8829ad3e 100644 --- a/src/enemy/bombPeahat.c +++ b/src/enemy/bombPeahat.c @@ -74,7 +74,7 @@ void BombPeahat_OnGrabbed(Entity* this) { void sub_0802A8E0(Entity* this) { this->subAction = 1; - this->field_0x1d = 60; + this->gustJarTolerance = 60; } void sub_0802A8EC(Entity* this) { @@ -101,11 +101,11 @@ void sub_0802A91C(Entity* this) { void sub_0802A924(Entity* this) { this->action = 1; this->subAction = 0; - this->actionDelay = 0; - this->field_0xf = 0; + this->timer = 0; + this->subtimer = 0; this->hitbox = (Hitbox*)&gUnk_080CD16C; #ifdef EU - this->field_0x3c |= 0x10; + this->collisionFlags |= 0x10; #endif this->z.HALF.HI = -0x30; this->field_0x80.HALF.LO = Random() & 1; @@ -125,14 +125,14 @@ void sub_0802A924(Entity* this) { } void sub_0802A9A8(Entity* this) { - if (this->field_0xf) { - this->field_0xf--; + if (this->subtimer) { + this->subtimer--; } else { - if (this->actionDelay) { - if (--this->actionDelay == 0) { + if (this->timer) { + if (--this->timer == 0) { this->action = 2; this->subAction = 0; - this->actionDelay = 0x40; + this->timer = 0x40; sub_0802ACDC(this, 8); } } else { @@ -149,7 +149,7 @@ void sub_0802A9A8(Entity* this) { this->direction = 0x18; } this->y.HALF.HI = gRoomControls.scroll_y + 0x40; - this->actionDelay = 0x80; + this->timer = 0x80; sub_0802ADDC(this); } sub_0802AC40(this); @@ -158,12 +158,12 @@ void sub_0802A9A8(Entity* this) { void sub_0802AA40(Entity* this) { sub_0802AC40(this); - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { sub_0802ACDC(this, 8); this->field_0x7a.HALF.HI++; } - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else { Entity* ent = this->child; if (ent != NULL) { @@ -180,7 +180,7 @@ void sub_0802AA40(Entity* this) { this->speed = 0x180; this->field_0x7a.HALF.HI = 0; ent->field_0x80.HALF.LO = 1; - ent->actionDelay = 0x96; + ent->timer = 0x96; } } } @@ -189,7 +189,7 @@ void sub_0802AA40(Entity* this) { void sub_0802AAC0(Entity* this) { sub_0802AC40(this); - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { sub_0802AD1C(this, 4); } @@ -201,24 +201,24 @@ void sub_0802AAC0(Entity* this) { this->field_0x80.HALF.HI = 0; this->child = NULL; #ifdef EU - } else if (ent->actionDelay == 0) { + } else if (ent->timer == 0) { if (sub_080B1B44(COORD_TO_TILE(this), 1) == 0) { - if (EntityInRectRadius(this, &gPlayerEntity, 0x10, 0x10) && ent->field_0xf <= 0x50) { + if (EntityInRectRadius(this, &gPlayerEntity, 0x10, 0x10) && ent->subtimer <= 0x50) { this->field_0x80.HALF.HI = 0; } - } else if (ent->field_0xf <= 0x13) { + } else if (ent->subtimer <= 0x13) { this->field_0x80.HALF.HI = 0; } } #else - } else if ((ent->actionDelay == 0) && (ent->field_0xf <= 0x50)) { + } else if ((ent->timer == 0) && (ent->subtimer <= 0x50)) { this->field_0x80.HALF.HI = 0; } #endif } else { this->action = 4; - this->actionDelay = 0xc0; - this->field_0xf = 4; + this->timer = 0xc0; + this->subtimer = 4; this->field_0x80.HALF.LO ^= 1; #ifndef EU this->field_0x78.HALF.LO = 0; @@ -232,17 +232,17 @@ void sub_0802AAC0(Entity* this) { #ifdef EU void sub_0802AB40(Entity* this) { sub_0802AC40(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (this->field_0x7a.HALF.LO <= 4) { this->action = 5; this->speed = 0; InitializeAnimation(this, this->type + 1); } else { - this->actionDelay = 0xc0; - this->field_0xf = 0x4; + this->timer = 0xc0; + this->subtimer = 0x4; this->field_0x80.HALF.LO ^= 1; } - } else if (--this->field_0xf == 0) { + } else if (--this->subtimer == 0) { sub_0802ACDC(this, 4); } } @@ -291,7 +291,7 @@ void sub_0802AC08(Entity* this) { if (this->frame & ANIM_DONE) { this->action = 2; this->subAction = 0; - this->actionDelay = 0x40; + this->timer = 0x40; this->speed = 0xc0; sub_0802ACDC(this, 8); sub_0802ADDC(this); @@ -343,7 +343,7 @@ void sub_0802ACDC(Entity* this, u32 param_2) { x = sub_080045B4(this, gRoomControls.scroll_x + 0xd0, gRoomControls.scroll_y + 0x60); } sub_08004596(this, x); - this->field_0xf = param_2; + this->subtimer = param_2; } void sub_0802AD1C(Entity* this, u32 param_2) { @@ -352,7 +352,7 @@ void sub_0802AD1C(Entity* this, u32 param_2) { u32 y = ent->y.HALF.HI - 0x18; u32 x = ent->x.HALF.HI; sub_08004596(this, sub_080045B4(this, x, y)); - this->field_0xf = param_2; + this->subtimer = param_2; } else { sub_0802ACDC(this, param_2); } @@ -375,8 +375,8 @@ void sub_0802AD54(Entity* this) { if (this->field_0x80.HALF.HI) { if (this->child == NULL || this->child->next == NULL) { this->action = 4; - this->actionDelay = 0xc0; - this->field_0xf = 4; + this->timer = 0xc0; + this->subtimer = 4; this->field_0x80.HALF.LO ^= 1; } } @@ -401,12 +401,12 @@ void sub_0802ADDC(Entity* this) { void sub_0802AE24(Entity* this) { this->action = 1; - this->actionDelay = 0xf0; + this->timer = 0xf0; this->zVelocity = Q_16_16(0.5); this->hitbox = (Hitbox*)&gUnk_080CD174; - this->field_0x3c = 3; - this->field_0x16 = 0; - this->field_0x1c = 2; + this->collisionFlags = 3; + this->carryFlags = 0; + this->gustJarFlags = 2; this->field_0x80.HALF.HI = 0; this->field_0x7a.HALF.HI = 1; InitializeAnimation(this, 3); @@ -473,8 +473,8 @@ void sub_0802AED4(Entity* this) { } } if (this->type2 != 0 && this->field_0x80.HALF.HI) { - this->actionDelay = 0; - this->field_0xf = 1; + this->timer = 0; + this->subtimer = 1; } } @@ -497,8 +497,8 @@ void sub_0802AF58(Entity* this) { void sub_0802AF74(Entity* this) { this->action = 3; this->subAction = 0; - if (this->actionDelay > 60) { - this->actionDelay = 60; + if (this->timer > 60) { + this->timer = 60; } GetNextFrame(this); } @@ -509,7 +509,7 @@ void sub_0802AF94(Entity* this) { void sub_0802AF9C(Entity* this) { GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (this->parent->field_0x7a.HALF.LO) { this->parent->field_0x7a.HALF.LO--; } @@ -518,9 +518,9 @@ void sub_0802AF9C(Entity* this) { } NONMATCH("asm/non_matching/bombPeahat/sub_0802AFC8.inc", void sub_0802AFC8(Entity* this)) { - u32 field_0xf = this->field_0xf; + u32 subtimer = this->subtimer; u32 flag = 8; - if (field_0xf < 0x29) { + if (subtimer < 0x29) { u32 tmp, tmp2; flag = 4; if (this->field_0x82.HWORD & 0x8000) { @@ -536,7 +536,7 @@ NONMATCH("asm/non_matching/bombPeahat/sub_0802AFC8.inc", void sub_0802AFC8(Entit tmp = 0x130 - (this->field_0x82.HWORD & 0xf0); SetAffineInfo(this, tmp, tmp, 0); } - if (this->field_0xf & flag) { + if (this->subtimer & flag) { this->palette.b.b0 = this->palette.b.b4; } else { this->palette.b.b0 = 0; @@ -566,23 +566,23 @@ void sub_0802B048(Entity* this) { action = this->action; if (action != 4 && this->field_0x80.HALF.LO) { - if (this->actionDelay) { - if (--this->actionDelay == 0) { - this->field_0xf = 0x50; + if (this->timer) { + if (--this->timer == 0) { + this->subtimer = 0x50; this->field_0x82.HWORD = 0; this->spriteRendering.b0 = 3; SetAffineInfo(this, 0x100, 0x100, 0); } } else { - if (this->field_0xf) { - if (--this->field_0xf == 0) { + if (this->subtimer) { + if (--this->subtimer == 0) { if (action == 2 && this->subAction == 1) { gPlayerState.heldObject = 0; } sub_0805EC60(this); this->action = 4; this->hitbox = (Hitbox*)&gUnk_080CD17C; - this->actionDelay = 0xf; + this->timer = 0xf; this->spriteSettings.draw = 0; COLLISION_ON(this); this->field_0x7a.HALF.HI = 0; @@ -606,8 +606,8 @@ void sub_0802B048(Entity* this) { void sub_0802B1A0(Entity* this) { this->action = 1; - this->actionDelay = 0; - this->field_0xf = 0x4f; + this->timer = 0; + this->subtimer = 0x4f; this->field_0x80.HALF.HI = 1; InitializeAnimation(this, 0); } @@ -616,8 +616,8 @@ void sub_0802B1A0(Entity* this) { void sub_0802B1BC(Entity* this) { Entity* ent; - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } ent = this->parent; @@ -645,8 +645,8 @@ void sub_0802B1BC(Entity* this) { void sub_0802B1BC(Entity* this) { Entity* ent; - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } ent = sub_0802B250(this); diff --git a/src/enemy/bombarossa.c b/src/enemy/bombarossa.c index 2119c5e0..f873f5c4 100644 --- a/src/enemy/bombarossa.c +++ b/src/enemy/bombarossa.c @@ -23,7 +23,7 @@ void Bombarossa(Entity* this) { void Bombarossa_OnTick(BombarossaEntity* this) { if (super->action == 0) { super->action = 1; - super->actionDelay = Random() & 0xf; + super->timer = Random() & 0xf; InitializeAnimation(super, 0); if (super->type != 0) { super->child = GetCurrentRoomProperty(super->type); @@ -31,7 +31,7 @@ void Bombarossa_OnTick(BombarossaEntity* this) { } } - super->z.HALF.HI = gUnk_080CEB50[(((++super->actionDelay) >> 4) & 0x7) + (super->type2 << 3)]; + super->z.HALF.HI = gUnk_080CEB50[(((++super->timer) >> 4) & 0x7) + (super->type2 << 3)]; GetNextFrame(super); if (super->type != 0) { @@ -41,7 +41,7 @@ void Bombarossa_OnTick(BombarossaEntity* this) { void Bombarossa_OnCollision(BombarossaEntity* this) { Entity* ent; - switch (super->bitfield & 0x7f) { + switch (super->contactFlags & 0x7f) { default: ent = CreateObject(OBJECT_20, 0, 0); if (ent != NULL) { diff --git a/src/enemy/bowMoblin.c b/src/enemy/bowMoblin.c index 35d3b011..88017722 100644 --- a/src/enemy/bowMoblin.c +++ b/src/enemy/bowMoblin.c @@ -59,11 +59,11 @@ void BowMoblin_OnCollision(BowMoblinEntity* this) { Create0x68FX(super, FX_STARS); } EnemyFunctionHandlerAfterCollision(super, (EntityActionArray)BowMoblin_Functions); - if ((super->bitfield & 0x80) != 0) { + if ((super->contactFlags & 0x80) != 0) { sub_0803C5F0(this); pEVar1 = super->child; if (pEVar1 != NULL) { - pEVar1->field_0xf++; + pEVar1->subtimer++; } } } @@ -82,9 +82,9 @@ void sub_0803C1E0(BowMoblinEntity* this) { this->unk_0x7a = 0; this->unk_0x82 = 1; - if (super->actionDelay) { + if (super->timer) { super->animationState = super->type2 << 1; - super->actionDelay = 0x1e; + super->timer = 0x1e; super->speed = 0x80; super->direction = super->type2 << 3; sub_0803C690(this); @@ -100,7 +100,7 @@ void sub_0803C234(BowMoblinEntity* this) { this->unk_0x81--; } mask = 0xff; - if (((--super->actionDelay) & mask) == 0) { + if (((--super->timer) & mask) == 0) { u8 tmp = ++this->unk_0x80; if ((tmp) > 0xf) { @@ -125,30 +125,30 @@ void sub_0803C234(BowMoblinEntity* this) { void sub_0803C2DC(BowMoblinEntity* this) { u32 res; - u32 actionDelay = --super->actionDelay; - if (actionDelay == 0) { + u32 timer = --super->timer; + if (timer == 0) { super->action = 3; - this->unk_0x82 = actionDelay; - this->unk_0x80 = actionDelay; + this->unk_0x82 = timer; + this->unk_0x80 = timer; super->animationState = 0x10; sub_0803C4B0(this); } else if (res = sub_0803C568(this), res) { this->unk_0x7b |= 0x1; } - if (super->field_0xf > 0xb) { + if (super->subtimer > 0xb) { if (this->unk_0x7b != 0) { sub_0803C5F0(this); } } else { - super->field_0xf++; + super->subtimer++; } sub_0803C6DC(this); } void sub_0803C344(BowMoblinEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { switch (this->unk_0x82) { case 3: { super->action = 4; @@ -166,7 +166,7 @@ void sub_0803C344(BowMoblinEntity* this) { super->action = 2; super->speed = 0; tmp = Random() & 0x7; - super->actionDelay = (tmp << 1) + tmp + 0x40; + super->timer = (tmp << 1) + tmp + 0x40; break; } case 4: { @@ -180,12 +180,12 @@ void sub_0803C344(BowMoblinEntity* this) { this->unk_0x82 = 1; super->speed = 0x80; tmp = (Random() & 0x7); - super->actionDelay = (tmp << 1) + tmp + 0x22; + super->timer = (tmp << 1) + tmp + 0x22; break; } } - super->field_0xf = 0; + super->subtimer = 0; super->animationState = ((super->direction + 4) & 0x18) >> 2; sub_0803C690(this); } @@ -193,16 +193,16 @@ void sub_0803C344(BowMoblinEntity* this) { } void sub_0803C400(BowMoblinEntity* this) { - if (super->field_0xf) { + if (super->subtimer) { u8 mask; - super->field_0xf--; + super->subtimer--; mask = 0xff; - if ((super->field_0xf & mask) == 0) { + if ((super->subtimer & mask) == 0) { if (this->unk_0x82 == 3) { this->unk_0x7a++; if ((this->unk_0x7a & mask) <= 2) { if (Random() & 0xc0) { - super->actionDelay = 0; + super->timer = 0; sub_0803C690(this); sub_0803C6DC(this); return; @@ -213,7 +213,7 @@ void sub_0803C400(BowMoblinEntity* this) { } } else { Entity* projectile; - switch (++super->actionDelay) { + switch (++super->timer) { case 1: super->direction = super->animationState << 2; projectile = CreateProjectileWithParent(super, ARROW_PROJECTILE, super->animationState >> 1); @@ -224,8 +224,8 @@ void sub_0803C400(BowMoblinEntity* this) { } break; case 24: - super->actionDelay = 0; - super->field_0xf = 0x20; + super->timer = 0; + super->subtimer = 0x20; break; } @@ -238,9 +238,9 @@ void sub_0803C400(BowMoblinEntity* this) { void sub_0803C4B0(BowMoblinEntity* this) { u32 dir; - super->field_0xf = 0; + super->subtimer = 0; if (this->unk_0x82 == 1) { - super->actionDelay = gUnk_080CFFA4[Random() & 7]; + super->timer = gUnk_080CFFA4[Random() & 7]; super->speed = 0x80; if (sub_08049FA0(super)) { dir = Random(); @@ -252,14 +252,14 @@ void sub_0803C4B0(BowMoblinEntity* this) { dir += gUnk_080CFFAC[Random() & 0xf]; } else { dir += gUnk_080CFFAC[Random() & 0x7]; - super->actionDelay += 0x10; + super->timer += 0x10; this->unk_0x83--; } dir = (super->direction = (dir + 4) & 0x18) >> 2; } } else { - super->actionDelay = 0xc; - super->speed = super->field_0xf; + super->timer = 0xc; + super->speed = super->subtimer; dir = super->direction >> 2; } if (dir != super->animationState) { @@ -319,14 +319,14 @@ void sub_0803C634(BowMoblinEntity* this) { super->direction = super->animationState << 2; this->unk_0x83 = 0; sub_0803C664(this); - super->actionDelay <<= 1; + super->timer <<= 1; this->unk_0x82 = 4; } void sub_0803C664(BowMoblinEntity* this) { super->action = 3; - super->actionDelay = 0x20; - super->field_0xf = 0; + super->timer = 0x20; + super->subtimer = 0; this->unk_0x80 = 0; this->unk_0x7b = 0; super->speed = 0; diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c index 2e84061e..2f311941 100644 --- a/src/enemy/businessScrub.c +++ b/src/enemy/businessScrub.c @@ -55,10 +55,10 @@ void BusinessScrub_OnTick(Entity* this) { void BusinessScrub_OnCollision(Entity* this) { Entity* pEVar1; - if (this->hitType == 1 && (this->bitfield & 0x7f) == 0x42) { + if (this->hitType == 1 && (this->contactFlags & 0x7f) == 0x42) { this->action = 3; this->subAction = 0; - this->actionDelay = 0x28; + this->timer = 0x28; COLLISION_OFF(this); sub_080290E0(this, 4); pEVar1 = CreateFx(this, FX_BUSH, 0); @@ -74,7 +74,7 @@ void BusinessScrub_OnGrabbed(Entity* this) { } void sub_08028994(Entity* this) { - this->field_0xf = 0; + this->subtimer = 0; this->field_0x78.HWORD = this->x.HALF.HI; this->field_0x7a.HWORD = this->y.HALF.HI; this->animationState = 0; @@ -82,12 +82,12 @@ void sub_08028994(Entity* this) { sub_08028E9C(this); if ((*(u8*)this->field_0x7c.WORD & 1) || CheckFlags(this->field_0x86.HWORD)) { this->action = 4; - this->actionDelay = 0x78; + this->timer = 0x78; this->spritePriority.b1 = 1; sub_0802925C(this); sub_080290E0(this, 0); } else { - this->actionDelay = 0; + this->timer = 0; this->field_0x76.HWORD = COORD_TO_TILE(this); this->field_0x74.HWORD = GetTileIndex(this->field_0x76.HWORD, this->collisionLayer); this->hurtType = 0x41; @@ -96,12 +96,12 @@ void sub_08028994(Entity* this) { } void sub_08028A48(Entity* this) { - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else if (sub_08028F98(this, 0)) { sub_08029078(this); this->subAction = 0; - this->field_0xf = 1; + this->subtimer = 1; } } @@ -114,25 +114,25 @@ void sub_08028A74(Entity* this) { unk = 1; if (this->frame & ANIM_DONE) { this->subAction = 1; - this->actionDelay = 0x3c; - this->field_0xf = 0x10; + this->timer = 0x3c; + this->subtimer = 0x10; sub_08028FDC(this); sub_080290E0(this, 1); } break; case 1: unk = 1; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 2; - this->actionDelay = 0x20; - this->field_0xf = 0; + this->timer = 0x20; + this->subtimer = 0; sub_08028FDC(this); sub_080290E0(this, 2); - } else if (--this->field_0xf == 0) { + } else if (--this->subtimer == 0) { if (sub_08028FDC(this)) { sub_080290E0(this, 1); } - this->field_0xf = 0x10; + this->subtimer = 0x10; } break; case 2: @@ -152,23 +152,23 @@ void sub_08028A74(Entity* this) { unk = 2; if (this->frame & ANIM_DONE) { this->subAction = 4; - this->actionDelay = 0x50; + this->timer = 0x50; sub_080290E0(this, 1); } break; case 4: unk = 2; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (sub_08028F98(this, 0)) { this->subAction = 1; - this->actionDelay = 0x3c; - this->field_0xf = 0x10; + this->timer = 0x3c; + this->subtimer = 0x10; sub_08028FDC(this); } else { sub_08028FFC(this); this->subAction = 0; - this->actionDelay = 0x50; - this->field_0xf = 0; + this->timer = 0x50; + this->subtimer = 0; } return; } @@ -178,8 +178,8 @@ void sub_08028A74(Entity* this) { if (!sub_08028F98(this, unk)) { sub_08028FFC(this); this->subAction = 0; - this->actionDelay = 0x50; - this->field_0xf = 0; + this->timer = 0x50; + this->subtimer = 0; } } @@ -188,7 +188,7 @@ void sub_08028BC4(Entity* this) { switch (this->subAction) { case 0: - if (this->actionDelay == 0) { + if (this->timer == 0) { if (this->frame & ANIM_DONE) { this->subAction = 1; sub_08028FDC(this); @@ -196,15 +196,15 @@ void sub_08028BC4(Entity* this) { this->spritePriority.b1 = 1; } } else { - this->actionDelay--; + this->timer--; } break; case 1: if (this->frame & ANIM_DONE) { this->action = 4; this->subAction = 0; - this->actionDelay = 0x1e; - this->field_0xf = 5; + this->timer = 0x1e; + this->subtimer = 5; sub_080290E0(this, 0); iVar1 = Create0x68FX(this, FX_STARS); if (iVar1 != NULL) { @@ -226,10 +226,10 @@ extern void sub_0804AA1C(Entity*); void sub_08028F0C(Entity*); void sub_08028C84(Entity* this) { - if (--this->actionDelay == 0) { - this->actionDelay = 0x30; - if (this->field_0xf) { - if (--this->field_0xf == 0) { + if (--this->timer == 0) { + this->timer = 0x30; + if (this->subtimer) { + if (--this->subtimer == 0) { sub_0804AA1C(this); } } else if (sub_08028FDC(this) || this->field_0x80.HALF.LO) { @@ -264,7 +264,7 @@ void sub_08028CE8(Entity* this) { CreateItemEntity(offer->offeredItem, subtype, 0); this->action = 6; - this->actionDelay = 4; + this->timer = 4; this->field_0x80.HALF.HI = 0; sub_080290E0(this, 3); #if defined(USA) || defined(DEMO_USA) @@ -273,12 +273,12 @@ void sub_08028CE8(Entity* this) { return; case 1: CreateItemEntity(offer->offeredItem, offer->field_0x9, 0); - this->actionDelay = 4; + this->timer = 4; sub_0802922C(this); return; case 2: CreateItemEntity(offer->offeredItem, offer->field_0x9, 0); - this->actionDelay = 8; + this->timer = 8; sub_0802922C(this); return; } @@ -292,7 +292,7 @@ void sub_08028CE8(Entity* this) { sub_0800445C(this); this->action = 4; - this->actionDelay = 0x30; + this->timer = 0x30; sub_080290E0(this, 0); } @@ -306,7 +306,7 @@ void sub_08028DE8(Entity* this) { MessageFromTarget(0x2902); this->action = 4; this->field_0x80.HALF.HI = 0; - this->actionDelay = 1; + this->timer = 1; sub_08028EDC(this); SetPlayerControl(0); sub_0800445C(this); @@ -320,7 +320,7 @@ void sub_08028E40(Entity* this) { this->action = 4; this->subAction = gMessage.doTextBox & 0x7f; - this->actionDelay = 1; + this->timer = 1; if (CheckLocalFlag(offer->field_0xa) == 0) { SetLocalFlag(offer->field_0xa); } @@ -333,7 +333,7 @@ void sub_08028E40(Entity* this) { void sub_08028E84(Entity* this) { if (UpdateFuseInteraction(this)) { this->action = 4; - this->actionDelay = 1; + this->timer = 1; } } @@ -370,8 +370,8 @@ void sub_08028F0C(Entity* this) { this->direction = (GetAnimationState(this) << 3); sub_080290E0(this, 3); this->field_0x80.HALF.LO = 1; - this->actionDelay = 0x20; - this->field_0xf = 0; + this->timer = 0x20; + this->subtimer = 0; if (sub_08029198(offer)) { dialog = offer->field_0x6; } else { @@ -451,13 +451,13 @@ void sub_080290E0(Entity* this, u32 param_2) { } void sub_080290FC(Entity* this) { - if (this->actionDelay != 0) { - if (--this->actionDelay < 0x10 && (this->actionDelay & 1) == 0) { + 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->actionDelay & 8) ? -sVar3 : sVar3; + this->x.HALF.HI += (this->timer & 8) ? -sVar3 : sVar3; } else { - this->y.HALF.HI += (this->actionDelay & 8) ? sVar3 : -sVar3; + this->y.HALF.HI += (this->timer & 8) ? sVar3 : -sVar3; } } } diff --git a/src/enemy/businessScrubPrologue.c b/src/enemy/businessScrubPrologue.c index 4366c0ab..52c2f05c 100644 --- a/src/enemy/businessScrubPrologue.c +++ b/src/enemy/businessScrubPrologue.c @@ -41,10 +41,10 @@ void BusinessScrubPrologue_OnTick(BusinessScrubPrologueEntity* this) { void BusinessScrubPrologue_OnCollision(BusinessScrubPrologueEntity* this) { Entity* ent; if (super->hitType == 1) { - if ((super->bitfield & 0x7f) == 0x42) { + if ((super->contactFlags & 0x7f) == 0x42) { super->action = 4; super->subAction = 0; - super->actionDelay = 0x28; + super->timer = 0x28; super->flags &= ~ENT_COLLIDE; sub_08046030(this, 4); ent = CreateFx(super, FX_BUSH, 0); @@ -63,13 +63,13 @@ void BusinessScrubPrologue_OnGrabbed(BusinessScrubPrologueEntity* this) { } void sub_08045C3C(BusinessScrubPrologueEntity* this) { - super->field_0xf = 0; + super->subtimer = 0; this->unk_78 = super->x.HALF.HI; this->unk_7a = super->y.HALF.HI; super->animationState = 0; super->direction = 0x10; super->action = 5; - super->actionDelay = 0x78; + super->timer = 0x78; super->spritePriority.b1 = 1; super->spriteSettings.draw = 1; sub_08046030(this, 0); @@ -80,12 +80,12 @@ void sub_08045C3C(BusinessScrubPrologueEntity* this) { void sub_08045CA4(BusinessScrubPrologueEntity* this) { super->spriteSettings.draw = 0; - if (super->actionDelay) { - super->actionDelay--; + if (super->timer) { + super->timer--; } else if (sub_08045F54(this, 0)) { sub_08045FF0(this); super->subAction = 0; - super->field_0xf = 1; + super->subtimer = 1; } } @@ -102,18 +102,18 @@ void sub_08045CE0(BusinessScrubPrologueEntity* this) { r6 = 1; if (super->frame & ANIM_DONE) { super->subAction = 1; - super->actionDelay = 0x3c; - super->field_0xf = 0x10; + super->timer = 0x3c; + super->subtimer = 0x10; sub_08045F98(this); sub_08046030(this, 1); } break; case 1: r6 = 1; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction = 2; - super->actionDelay = 0x20; - super->field_0xf = 0; + super->timer = 0x20; + super->subtimer = 0; sub_08045F98(this); sub_08046030(this, 2); } @@ -135,22 +135,22 @@ void sub_08045CE0(BusinessScrubPrologueEntity* this) { r6 = 2; if (super->frame & ANIM_DONE) { super->subAction = 4; - super->actionDelay = 0x50; + super->timer = 0x50; sub_08046030(this, 1); } break; case 4: r6 = 2; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { if (sub_08045F54(this, 0)) { super->subAction = 1; - super->actionDelay = 0x3c; - super->field_0xf = 0x10; + super->timer = 0x3c; + super->subtimer = 0x10; sub_08045F98(this); } else { sub_08045FA0(this); - super->actionDelay = 0x50; - super->field_0xf = 0; + super->timer = 0x50; + super->subtimer = 0; } } break; @@ -159,8 +159,8 @@ void sub_08045CE0(BusinessScrubPrologueEntity* this) { if (sub_08045F54(this, r6) == 0) { sub_08045FA0(this); super->subAction = 0; - super->actionDelay = 0; - super->field_0xf = 0; + super->timer = 0; + super->subtimer = 0; } } @@ -169,7 +169,7 @@ void sub_08045E14(BusinessScrubPrologueEntity* this) { gPlayerState.field_0x27[0] = 0xff; switch (super->subAction) { case 0: - if (super->actionDelay == 0) { + if (super->timer == 0) { if (super->frame & ANIM_DONE) { super->subAction = 1; sub_08045F98(this); @@ -177,7 +177,7 @@ void sub_08045E14(BusinessScrubPrologueEntity* this) { super->spritePriority.b1 = 1; } } else { - super->actionDelay--; + super->timer--; } break; case 1: @@ -210,8 +210,8 @@ void sub_08045ED4(BusinessScrubPrologueEntity* this) { void sub_08045EDC(BusinessScrubPrologueEntity* this) { if (super->subAction == 0) { super->subAction++; - super->actionDelay = 0x20; - super->field_0xf = 0; + super->timer = 0x20; + super->subtimer = 0; sub_08045F98(this); sub_08046030(this, 2); } @@ -283,9 +283,9 @@ void sub_08046030(BusinessScrubPrologueEntity* this, u32 arg2) { } void sub_0804604C(BusinessScrubPrologueEntity* this) { - if (super->actionDelay) { - if (--super->actionDelay <= 0xf) { - super->spriteOffsetY = gUnk_080D1A3E[super->actionDelay]; + if (super->timer) { + if (--super->timer <= 0xf) { + super->spriteOffsetY = gUnk_080D1A3E[super->timer]; } } } diff --git a/src/enemy/chaser.c b/src/enemy/chaser.c index 24dca7cf..ad5f00d2 100644 --- a/src/enemy/chaser.c +++ b/src/enemy/chaser.c @@ -31,8 +31,8 @@ void sub_0802B530(Entity* this) { } void sub_0802B540(Entity* this) { - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else { u32 direction = sub_0804A024(this, 1, 0xc); if (direction != 0xff) { @@ -45,7 +45,7 @@ void sub_0802B540(Entity* this) { void sub_0802B56C(Entity* this) { GetNextFrame(this); - if (this->bitfield & 0x80) { + if (this->contactFlags & 0x80) { this->speed = 0x40; } @@ -66,7 +66,7 @@ void sub_0802B5C8(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 1; - this->actionDelay = 30; + this->timer = 30; InitializeAnimation(this, 0); } } diff --git a/src/enemy/chuchu.c b/src/enemy/chuchu.c index 856acda5..a162e302 100644 --- a/src/enemy/chuchu.c +++ b/src/enemy/chuchu.c @@ -46,7 +46,7 @@ void Chuchu(Entity* this) { /* ... */ break; case 2: - this->field_0x3a &= 0xfe; + this->gustJarState &= 0xfe; if (index != this->field_0x80.HALF.HI) { switch (this->type) { case 0: @@ -97,7 +97,7 @@ void Chuchu_OnCollision(Entity* this) { u8 health; if (this->type == 2) { - if (this->bitfield == 0x8e || this->bitfield == 0x95) { + if (this->contactFlags == 0x8e || this->contactFlags == 0x95) { COLLISION_OFF(this); this->health = 0; } @@ -105,7 +105,7 @@ void Chuchu_OnCollision(Entity* this) { health = this->health; if (health) { - if (this->bitfield == 0x94) { + if (this->contactFlags == 0x94) { sub_0801FB68(this); Create0x68FX(this, FX_STARS); InitializeAnimation(this, 6); @@ -175,8 +175,8 @@ void sub_0801F0C8(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 3; - this->actionDelay = (Random() & 3) + 0xc; - this->field_0xf = Random(); + this->timer = (Random() & 3) + 0xc; + this->subtimer = Random(); this->direction = sub_08049F84(this, 1); COLLISION_ON(this); this->spritePriority.b0 = 4; @@ -189,17 +189,17 @@ void sub_0801F12C(Entity* this) { if (sub_0801FBD0(this)) { sub_0801F328(this); } else { - if ((this->field_0xf++ & 7) == 0) { + if ((this->subtimer++ & 7) == 0) { this->direction = sub_08049F84(this, 1); } ProcessMovement0(this); GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (PlayerInRange(this, 1, 0x38)) { this->action = 4; Chuchu_JumpAtPlayer(this); } else if (PlayerInRange(this, 1, 0x48)) { - this->actionDelay = (Random() & 3) + 0xc; + this->timer = (Random() & 3) + 0xc; } else { sub_0801F328(this); } @@ -231,7 +231,7 @@ void sub_0801F1B0(Entity* this) { } void sub_0801F228(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; this->direction = sub_08049F84(this, 1); } @@ -245,7 +245,7 @@ void sub_0801F250(Entity* this) { } void sub_0801F270(Entity* this) { - if ((this->field_0xf++ & 7) == 0) { + if ((this->subtimer++ & 7) == 0) { this->direction = sub_08049F84(this, 1); } @@ -254,14 +254,14 @@ void sub_0801F270(Entity* this) { if (sub_0801FBD0(this)) return; - if (--this->actionDelay) + if (--this->timer) return; if (this->field_0x80.HALF.HI == 0) { this->action = 2; InitializeAnimation(this, 4); } else { - this->actionDelay = 8; + this->timer = 8; } } @@ -291,7 +291,7 @@ void sub_0801F328(Entity* this) { void sub_0801F340(Entity* this) { this->action = 5; - this->actionDelay = 60; + this->timer = 60; this->speed = 0x20; this->hitType = 92; InitializeAnimation(this, 2); @@ -299,8 +299,8 @@ void sub_0801F340(Entity* this) { void sub_0801F360(Entity* this) { this->action = 7; - this->actionDelay = (Random() & 0x38) + 0xb4; - this->field_0xf = Random(); + this->timer = (Random() & 0x38) + 0xb4; + this->subtimer = Random(); this->direction = sub_08049F84(this, 1); this->spritePriority.b1 = 2; this->spritePriority.b0 = 6; @@ -333,14 +333,14 @@ void sub_0801F3AC(Entity* this) { void sub_0801F428(Entity* this) { sub_0804A720(this); this->action = 1; - this->actionDelay = Random(); + this->timer = Random(); this->field_0x80.HALF.LO = this->health; this->field_0x82.HALF.LO = 0; if (this->type2 == 0) return; this->action = 3; - this->field_0xf = 30; + this->subtimer = 30; #ifdef EU this->direction = sub_08049F84(this, 1); @@ -364,7 +364,7 @@ void sub_0801F494(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 3; - this->field_0xf = 30; + this->subtimer = 30; this->direction = sub_08049F84(this, 1); COLLISION_ON(this); this->spritePriority.b0 = 4; @@ -375,7 +375,7 @@ void sub_0801F494(Entity* this) { void sub_0801F4EC(Entity* this) { GetNextFrame(this); - if (--this->field_0xf == 0) + if (--this->subtimer == 0) this->action = 4; } @@ -384,7 +384,7 @@ void sub_0801F508(Entity* this) { this->field_0x82.HALF.HI = 0; sub_0801F730(this); } else { - u8 tmp = ++this->actionDelay & 7; + u8 tmp = ++this->timer & 7; if (tmp == 0 && PlayerInRange(this, 1, 0x38)) { if (Random() & 1) { this->action = 5; @@ -424,7 +424,7 @@ void sub_0801F584(Entity* this) { sub_0801F730(this); } else { this->action = 6; - this->field_0xf = 60; + this->subtimer = 60; this->speed = 0x20; this->hitType = 92; InitializeAnimation(this, 2); @@ -433,7 +433,7 @@ void sub_0801F584(Entity* this) { } void sub_0801F61C(Entity* this) { - if (--this->field_0xf == 0) + if (--this->subtimer == 0) this->action = 4; GetNextFrame(this); } @@ -442,7 +442,7 @@ void sub_0801F638(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 8; - this->field_0xf = 30; + this->subtimer = 30; this->direction = sub_08049F84(this, 1); this->spritePriority.b1 = 2; this->spritePriority.b0 = 6; @@ -519,7 +519,7 @@ void sub_0801F764(Entity* this) { void sub_0801F7D8(Entity* this) { sub_0804A720(this); this->action = 1; - this->actionDelay = Random(); + this->timer = Random(); this->field_0x80.HALF.LO = this->health; this->field_0x82.HALF.LO = 0; } @@ -548,8 +548,8 @@ void sub_0801F840(Entity* this) { void sub_0801F884(Entity* this) { GetNextFrame(this); - if (this->field_0xf) { - this->field_0xf--; + if (this->subtimer) { + this->subtimer--; } else { Entity* ent = Create0x68FX(this, FX_LIGHTNING_STRIKE); if (ent != NULL) { @@ -567,7 +567,7 @@ void sub_0801F8C0(Entity* this) { } else if (sub_08049FDC(this, 1) == 0) { sub_0801F730(this); } else { - u8 tmp = ++this->actionDelay & 7; + u8 tmp = ++this->timer & 7; if (tmp == 0 && sub_08049F1C(this, gUnk_020000B0, 0x38)) { this->action = 5; Chuchu_JumpAtPlayer(this); @@ -599,7 +599,7 @@ void sub_0801F940(Entity* this) { sub_0801FAE0(this); } else { this->action = 6; - this->field_0xf = 60; + this->subtimer = 60; this->speed = 0x20; InitializeAnimation(this, 2); } @@ -607,7 +607,7 @@ void sub_0801F940(Entity* this) { } void sub_0801F9C4(Entity* this) { - if (--this->field_0xf == 0) + if (--this->subtimer == 0) this->action = 4; GetNextFrame(this); } @@ -616,7 +616,7 @@ void sub_0801F9E0(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 8; - this->field_0xf = 30; + this->subtimer = 30; this->direction = sub_08049F84(this, 1); this->spritePriority.b1 = 2; this->spritePriority.b0 = 6; @@ -671,7 +671,7 @@ void sub_0801FAF8(Entity* this) { void sub_0801FB14(Entity* this) { this->action = 3; - this->field_0xf = 30; + this->subtimer = 30; this->direction = sub_08049F84(this, 1); InitializeAnimation(this, 2); } diff --git a/src/enemy/cloudPiranha.c b/src/enemy/cloudPiranha.c index e1075af3..5f4eb371 100644 --- a/src/enemy/cloudPiranha.c +++ b/src/enemy/cloudPiranha.c @@ -10,7 +10,7 @@ #include "collision.h" #include "enemy.h" #include "functions.h" -#include "coord.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; @@ -61,9 +61,9 @@ void CloudPiranha_OnCollision(CloudPiranhaEntity* this) { Create0x68FX(super, FX_STARS); } EnemyFunctionHandlerAfterCollision(super, gUnk_080CF4F0); - if ((super->bitfield & 0x80) != 0) { + if ((super->contactFlags & 0x80) != 0) { if (super->hitType == 0x5a) { - switch (super->bitfield & 0x3f) { + switch (super->contactFlags & 0x3f) { case 0x14: super->action = 5; break; @@ -73,7 +73,7 @@ void CloudPiranha_OnCollision(CloudPiranhaEntity* this) { break; } #ifndef EU - } else if ((super->bitfield & 0x3f) == 0x1d) { + } else if ((super->contactFlags & 0x3f) == 0x1d) { sub_08038754(this); #endif } @@ -89,8 +89,8 @@ void CloudPiranha_Init(CloudPiranhaEntity* this) { super->direction = (Random() & 0x1c); super->animationState = super->direction >> 2; super->flags |= ENT_COLLIDE; - super->actionDelay = 0; - super->field_0xf = 0x20; + super->timer = 0; + super->subtimer = 0x20; this->unk_82 = 0; this->unk_80 = Random() & 1; this->unk_81 = 0; @@ -101,9 +101,9 @@ void CloudPiranha_Init(CloudPiranhaEntity* this) { void CloudPiranha_Action1(CloudPiranhaEntity* this) { u32 tmp; sub_080387F0(this); - if (--super->field_0xf == 0) { - super->actionDelay = 0; - super->field_0xf = 0x20; + if (--super->subtimer == 0) { + super->timer = 0; + super->subtimer = 0x20; if (sub_08049FA0(super)) { u32 tmp = super->animationState; if (this->unk_80 != 0) { @@ -118,9 +118,9 @@ void CloudPiranha_Action1(CloudPiranhaEntity* this) { super->animationState = super->direction >> 2; } InitializeAnimation(super, (u32)super->animationState); - } else if ((super->actionDelay == 0) && sub_0803872C(this, 0x80)) { + } else if ((super->timer == 0) && sub_0803872C(this, 0x80)) { super->action = 2; - super->field_0xf = 0x10; + super->subtimer = 0x10; super->speed = 0x40; super->animationState = sub_0806FCAC(super, super->child); super->direction = super->animationState << 2; @@ -133,14 +133,14 @@ NONMATCH("asm/non_matching/cloudPiranha/sub_080385CC.inc", void sub_080385CC(Clo sub_080387F0(this); if (sub_0803872C(this, 0x60)) { super->action = 3; - super->field_0xf = 0xc; + super->subtimer = 0xc; super->speed = 0x80; super->animationState = sub_0806FCAC(super, super->child); super->direction = super->animationState << 2; InitializeAnimation(super, super->animationState); } else { - if (--super->field_0xf == 0) { - super->field_0xf = 0x10; + if (--super->subtimer == 0) { + super->subtimer = 0x10; if (super->child != NULL) { super->animationState = sub_0806FCAC(super, super->child); } else { @@ -164,8 +164,8 @@ void CloudPiranha_Action3(CloudPiranhaEntity* this) { if (sub_0803872C(this, 0x14)) { sub_08038754(this); } else { - if (--super->field_0xf == 0) { - super->field_0xf = 0xa; + if (--super->subtimer == 0) { + super->subtimer = 0xa; if (this->unk_81 == 0) { tmp = super->speed += 0x40; if (0x2000000 < (tmp * 0x10000)) { @@ -186,8 +186,8 @@ void CloudPiranha_Action4(CloudPiranhaEntity* this) { if (sub_080044EC(super, 0x1800) == 1) { super->action = 1; super->hitType = 0x72; - super->actionDelay = 1; - super->field_0xf = 0x80; + super->timer = 1; + super->subtimer = 0x80; super->speed = 0x80; super->spritePriority.b1 = 2; EnqueueSFX(SFX_124); diff --git a/src/enemy/crow.c b/src/enemy/crow.c index efe2b3e5..55954cae 100644 --- a/src/enemy/crow.c +++ b/src/enemy/crow.c @@ -31,18 +31,18 @@ void Crow(Entity* this) { void Crow_OnTick(CrowEntity* this) { gUnk_080CE990[super->action](this); - if (super->field_0xf) { - if (--super->field_0xf == 0) { + if (super->subtimer) { + if (--super->subtimer == 0) { COLLISION_ON(super); } } } void Crow_OnCollision(CrowEntity* this) { - if (super->bitfield & 0x80) { - if ((super->bitfield & 0x3f) == 0) { + if (super->contactFlags & 0x80) { + if ((super->contactFlags & 0x3f) == 0) { COLLISION_OFF(super); - super->field_0xf = 0x10; + super->subtimer = 0x10; if (DirectionIsHorizontal(DirectionRoundUp(super->direction)) == 0) { if (DirectionIsVertical(super->direction)) { super->direction += 2; @@ -74,14 +74,14 @@ void Crow_OnGrabbed(CrowEntity* this) { super->action = 2; super->subAction = 0; this->unk_84 = 2; - super->actionDelay = 8; + super->timer = 8; super->speed = 0x1c0; sub_08032AF4(this); } void sub_08032900(CrowEntity* this) { super->subAction = 1; - super->field_0x1d = 0x3c; + super->gustJarTolerance = 0x3c; } void sub_0803290C(CrowEntity* this) { @@ -98,12 +98,12 @@ void sub_08032928(CrowEntity* this) { sub_0804A720(super); super->action = 1; - super->field_0xf = 0; + super->subtimer = 0; super->direction = sub_08049F84(super, 1); this->unk_80 = 0; this->unk_81 = 0; - super->field_0x1c = 1; - super->field_0x3c |= 0x10; + super->gustJarFlags = 1; + super->collisionFlags |= 0x10; super->collisionLayer = 3; super->spriteOrientation.flipY = 1; this->unk_78 = super->x.HALF.HI; @@ -125,7 +125,7 @@ void sub_0803298C(CrowEntity* this) { super->action = 2; this->unk_84 = 0; - super->actionDelay = 0x10; + super->timer = 0x10; this->unk_81 = 2; sub_08032AF4(this); } @@ -156,7 +156,7 @@ void sub_08032A48(CrowEntity* this) { super->action = 1; super->spriteSettings.draw = 1; COLLISION_OFF(super); - super->actionDelay = 8; + super->timer = 8; super->direction = sub_08049F84(super, 1); this->unk_80 = 0; super->spritePriority.b1 = 3; @@ -168,7 +168,7 @@ void sub_08032A48(CrowEntity* this) { void sub_08032AB0(CrowEntity* this) { u32 dir; - if (--super->actionDelay) + if (--super->timer) return; this->unk_80 = super->direction; @@ -177,7 +177,7 @@ void sub_08032AB0(CrowEntity* this) { super->direction = dir; } - super->actionDelay = 8; + super->timer = 8; if (DirectionIsVertical(this->unk_80) != DirectionIsVertical(super->direction)) { sub_08032AF4(this); } @@ -200,22 +200,22 @@ void sub_08032B38(CrowEntity* this) { u32 temp; switch (this->unk_84) { case 0: - if (super->actionDelay & 1) { + if (super->timer & 1) { super->z.HALF.HI--; } - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->unk_84 = 1; - super->actionDelay = 0x18; + super->timer = 0x18; COLLISION_ON(super); this->unk_81 = 2; sub_08032AF4(this); } break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->unk_84 = 2; - super->actionDelay = 8; + super->timer = 8; super->speed = 0x1c0; this->unk_81 = 4; sub_08032AF4(this); @@ -225,15 +225,15 @@ void sub_08032B38(CrowEntity* this) { if (--this->unk_82 == 0) { super->action = 3; this->unk_84 = 0; - super->actionDelay = 0; + super->timer = 0; super->speed = 0x180; if ((super->direction + 0x18) & 0x10) { super->direction = (0x10 - super->direction) & 0x1f; } sub_08032AF4(this); - } else if (--super->actionDelay == 0) { - super->actionDelay = 8; + } else if (--super->timer == 0) { + super->timer = 8; this->unk_80 = super->direction; sub_08004596(super, sub_08049F84(super, 1)); diff --git a/src/enemy/cuccoAggr.c b/src/enemy/cuccoAggr.c index c9993651..da22f6a2 100644 --- a/src/enemy/cuccoAggr.c +++ b/src/enemy/cuccoAggr.c @@ -84,7 +84,7 @@ void sub_08038D78(CuccoAggrEntity* this) { sub_0804A720(super); if (super->type != 2) { super->type2 = 0; - super->field_0x16 = 0x30; + super->carryFlags = 0x30; sub_08039120(this); } else { sub_08039140(this); @@ -92,7 +92,7 @@ void sub_08038D78(CuccoAggrEntity* this) { } void sub_08038DA0(CuccoAggrEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_0803901C(this); } @@ -105,8 +105,8 @@ void sub_08038DC0(CuccoAggrEntity* this) { void sub_08038DD8(CuccoAggrEntity* this) { super->subAction = 1; - super->actionDelay = 0x10; - super->field_0xf = gUnk_080CF7BC[super->type]; + super->timer = 0x10; + super->subtimer = gUnk_080CF7BC[super->type]; COLLISION_OFF(super); super->spritePriority.b1 = 0; InitializeAnimation(super, 4); @@ -114,8 +114,8 @@ void sub_08038DD8(CuccoAggrEntity* this) { } void sub_08038E18(CuccoAggrEntity* this) { - if (super->field_0xf) { - if (--super->field_0xf == 0) { + if (super->subtimer) { + if (--super->subtimer == 0) { PlayerDropHeldObject(); sub_08039218(this); COLLISION_ON(super); @@ -127,8 +127,8 @@ void sub_08038E18(CuccoAggrEntity* this) { } } - if (--super->actionDelay == 0) { - super->actionDelay = 0x10; + if (--super->timer == 0) { + super->timer = 0x10; super->spriteSettings.flipX ^= (Random() & 1); CuccoAggr_CreateFx(this); } @@ -152,7 +152,7 @@ void sub_08038EE0(CuccoAggrEntity* this) { GetNextFrame(super); sub_08039298(this); if (GravityUpdate(super, 0x1C00) == 0) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_0803901C(this); } else { super->zVelocity = 0x8000; @@ -184,7 +184,7 @@ void sub_08038F44(CuccoAggrEntity* this) { } void sub_08038FA0(CuccoAggrEntity* this) { - if ((super->actionDelay++ & 0x1f) == 0) { + if ((super->timer++ & 0x1f) == 0) { CuccoAggr_CreateFx(this); } @@ -228,12 +228,12 @@ void sub_0803901C(CuccoAggrEntity* this) { switch (r5) { default: super->action = 1; - super->actionDelay = gUnk_080CF7BE[(r3 >> 0x10) & 3]; + super->timer = gUnk_080CF7BE[(r3 >> 0x10) & 3]; InitializeAnimation(super, 0); break; case 1: super->action = 3; - super->actionDelay = ((r3 >> 8) & 3) + 2; + super->timer = ((r3 >> 8) & 3) + 2; super->zVelocity = 0x8000; sub_080390C0(this); InitializeAnimation(super, 1); @@ -274,7 +274,7 @@ void sub_08039120(CuccoAggrEntity* this) { void sub_08039140(CuccoAggrEntity* this) { super->action = 6; - super->actionDelay = Random(); + super->timer = Random(); super->direction = GetFacingDirection(super, &gPlayerEntity); super->z.HALF.HI = 0xfffc; this->unk_78 = 0xb4; diff --git a/src/enemy/cuccoChickAggr.c b/src/enemy/cuccoChickAggr.c index 2099cd13..004283b5 100644 --- a/src/enemy/cuccoChickAggr.c +++ b/src/enemy/cuccoChickAggr.c @@ -38,7 +38,7 @@ void sub_08022960(Entity* this) { } void sub_08022970(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_08022AA4(this); } } @@ -47,8 +47,8 @@ void sub_08022988(Entity* this) { if (this->z.HALF.HI == 0 && sub_08022B20(this)) { sub_08022B0C(this); } else { - if (this->field_0xf) { - if (--this->field_0xf) + if (this->subtimer) { + if (--this->subtimer) return; this->frameIndex = 1; @@ -58,10 +58,10 @@ void sub_08022988(Entity* this) { ProcessMovement0(this); if (GravityUpdate(this, 0x2000) == 0) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_08022A88(this); } else { - this->field_0xf = 4; + this->subtimer = 4; this->frameIndex = 0; } } @@ -70,10 +70,10 @@ void sub_08022988(Entity* this) { void sub_080229F8(Entity* this) { if (GravityUpdate(this, 0x2800) == 0) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 4; - this->actionDelay = 6; - this->field_0xf = 8; + this->timer = 6; + this->subtimer = 8; this->frameIndex = 0; this->speed = 0xc0; sub_08022B44(this); @@ -85,8 +85,8 @@ void sub_080229F8(Entity* this) { } void sub_08022A40(Entity* this) { - if (this->field_0xf) { - if (--this->field_0xf) + if (this->subtimer) { + if (--this->subtimer) return; this->frameIndex = 1; @@ -94,7 +94,7 @@ void sub_08022A40(Entity* this) { ProcessMovement0(this); if (GravityUpdate(this, 0x2000) == 0) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_08022A88(this); } else { sub_08022B44(this); @@ -104,7 +104,7 @@ void sub_08022A40(Entity* this) { void sub_08022A88(Entity* this) { this->action = 1; - this->actionDelay = (Random() & 0xf) + 8; + this->timer = (Random() & 0xf) + 8; this->frameIndex = 0; } @@ -112,8 +112,8 @@ void sub_08022AA4(Entity* this) { u32 rand = Random(); this->action = 2; - this->actionDelay = (rand & 3) + 1; - this->field_0xf = 1; + this->timer = (rand & 3) + 1; + this->subtimer = 1; this->speed = 0x80; if (!sub_08049FA0(this) && (rand >> 8) & 3) { @@ -128,8 +128,8 @@ void sub_08022AA4(Entity* this) { void sub_08022B0C(Entity* this) { this->action = 3; - this->actionDelay = 3; - this->field_0xf = 8; + this->timer = 3; + this->subtimer = 8; sub_08022B44(this); } diff --git a/src/enemy/curtain.c b/src/enemy/curtain.c index 0a0d342c..77af09ea 100644 --- a/src/enemy/curtain.c +++ b/src/enemy/curtain.c @@ -17,12 +17,12 @@ void Curtain_OnCollision(Entity* this) { this->action = 2; this->flags &= ~ENT_COLLIDE; this->spritePriority.b0 = 7; - this->actionDelay = 3; + this->timer = 3; } else { - this->actionDelay = 2; + this->timer = 2; } - InitializeAnimation(this, this->actionDelay); + InitializeAnimation(this, this->timer); } void Curtain_OnGrabbed() { @@ -33,24 +33,24 @@ void sub_08048224(Entity* this) { if (CheckLocalFlag(0x72) == 0) { this->action = 1; - this->actionDelay = 0; + this->timer = 0; } else { this->action = 3; this->flags &= ~ENT_COLLIDE; - this->actionDelay = 1; + this->timer = 1; } - InitializeAnimation(this, this->actionDelay); + InitializeAnimation(this, this->timer); } void sub_08048268(Entity* this) { - if (this->actionDelay == 0) { + if (this->timer == 0) { return; } GetNextFrame(this); if (this->frame & ANIM_DONE) { - this->actionDelay = 0; + this->timer = 0; InitializeAnimation(this, 0); } } diff --git a/src/enemy/darkNut.c b/src/enemy/darkNut.c index 3d91e7f4..4f948162 100644 --- a/src/enemy/darkNut.c +++ b/src/enemy/darkNut.c @@ -61,10 +61,10 @@ void DarkNut_OnTick(Entity* this) { } void DarkNut_OnCollision(Entity* this) { - switch (this->bitfield & 0x7f) { + switch (this->contactFlags & 0x7f) { case 0x1c: this->action = 11; - this->actionDelay = gUnk_080CAB0C[this->type]; + this->timer = gUnk_080CAB0C[this->type]; this->hitType = 81; sub_08021218(this, 8, DirectionToAnimationState(this->knockbackDirection ^ 0x10)); sub_08021588(this); @@ -72,7 +72,7 @@ void DarkNut_OnCollision(Entity* this) { break; case 0x16: this->action = 11; - this->actionDelay = gUnk_080CAB10[this->type]; + this->timer = gUnk_080CAB10[this->type]; this->hitType = 81; sub_08021218(this, 8, DirectionToAnimationState(this->knockbackDirection ^ 0x10)); sub_08021588(this); @@ -101,7 +101,7 @@ void DarkNut_OnCollision(Entity* this) { if (this->action == 15) { u8 bVar3 = 0xff; if (this->child != NULL) { - bVar3 = this->child->bitfield & 0x7f; + bVar3 = this->child->contactFlags & 0x7f; } if (bVar3 == 2) { sub_080213D0(this, gUnk_080CAB08[this->type]); @@ -152,7 +152,7 @@ void sub_08020DD4(Entity* this) { this->action = 5; sub_08021218(this, 5, this->animationState); } else { - if (--this->actionDelay == 0) + if (--this->timer == 0) sub_08021540(this); ProcessMovement0(this); UpdateAnimationSingleFrame(this); @@ -255,7 +255,7 @@ void sub_08020FAC(Entity* this) { void sub_08020FE4(Entity* this) { UpdateAnimationSingleFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 12; sub_08021218(this, 9, this->animationState); sub_0804AA1C(this); @@ -321,7 +321,7 @@ void sub_080210E4(Entity* this) { } sub_08021644(this); - if ((this->frame & 0x10) && (!ProcessMovement0(this) || (this->child && (this->child->bitfield & 0x80)))) { + if ((this->frame & 0x10) && (!ProcessMovement0(this) || (this->child && (this->child->contactFlags & 0x80)))) { sub_080213D0(this, 0); } else { if (--this->field_0x76.HWORD == 0) @@ -452,7 +452,7 @@ void sub_08021390(Entity* this) { void sub_080213B0(Entity* this) { this->action = 3; - this->actionDelay = 1; + this->timer = 1; this->speed = 0xc0; this->field_0x76.HWORD = 0xf0; sub_08021218(this, 3, this->animationState); @@ -554,7 +554,7 @@ void sub_08021540(Entity* this) { if (tmp != 0xff) sub_08021218(this, 3, tmp); - this->actionDelay = 30; + this->timer = 30; } void sub_08021588(Entity* this) { diff --git a/src/enemy/doorMimic.c b/src/enemy/doorMimic.c index 1f4d6b4a..9061ddb3 100644 --- a/src/enemy/doorMimic.c +++ b/src/enemy/doorMimic.c @@ -57,19 +57,19 @@ void sub_08022034(Entity* this) { } void sub_0802209C(Entity* this) { - if (this->actionDelay == 0) { + if (this->timer == 0) { if (CheckPlayerProximity(this->field_0x78.HWORD, this->field_0x7a.HWORD, 0x10, 0x10)) { this->action = 2; - this->actionDelay = 0x12; + this->timer = 0x12; InitializeAnimation(this, this->type2 + 4); } } else { - this->actionDelay = this->actionDelay - 1; + this->timer = this->timer - 1; } } void sub_080220D8(Entity* this) { - if (--this->actionDelay == 0) + if (--this->timer == 0) this->action = 3; } @@ -80,7 +80,7 @@ void sub_080220F0(Entity* this) { u32 i; this->action = 4; - this->actionDelay = 0x78; + this->timer = 0x78; this->damage = 0; off = gUnk_080CB76C[this->type2]; for (i = 0; i < 6; i++, off++) { @@ -98,7 +98,7 @@ void sub_080220F0(Entity* this) { void sub_08022174(Entity* this) { sub_0800445C(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 5; InitializeAnimation(this, this->type2 + 8); } @@ -109,7 +109,7 @@ void sub_08022198(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 1; - this->actionDelay = 0x5a; + this->timer = 0x5a; } } diff --git a/src/enemy/enemy4D.c b/src/enemy/enemy4D.c index 9c13ceaf..0fc6ab78 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->actionDelay = 0x0f; + super->timer = 0x0f; InitAnimationForceUpdate(super, super->animationState + 0x20); } } @@ -197,9 +197,9 @@ void Enemy4D_Action6(Enemy4DEntity* this) { 128, 188, }; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 7; - super->actionDelay = 1; + super->timer = 1; this->unk_7c = gUnk_080D08C4[super->animationState]; this->unk_7f = 0xf6; EnqueueSFX(SFX_15B); @@ -210,22 +210,22 @@ void Enemy4D_Action7(Enemy4DEntity* this) { if ((super->frame & ANIM_DONE) == 0) { UpdateAnimationSingleFrame(super); } else { - if (--super->actionDelay == 0) { - super->actionDelay = 2; + if (--super->timer == 0) { + super->timer = 2; this->unk_7f++; } if (this->unk_7f != 0) { this->unk_7e += 5; } else { super->action = 8; - super->actionDelay = 0x1e; + super->timer = 0x1e; InitScreenShake(8, 0); } } } void Enemy4D_Action8(Enemy4DEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 9; } } @@ -235,7 +235,7 @@ void Enemy4D_Action9(Enemy4DEntity* this) { tmp = this->unk_7e = this->unk_7e - 2; if (tmp < 0xb) { super->action = 0xa; - super->actionDelay = 0x3c; + super->timer = 0x3c; super->direction = super->animationState << 3; this->unk_7c = 0; this->unk_7f = 0xfe; @@ -246,8 +246,8 @@ void Enemy4D_Action9(Enemy4DEntity* this) { } void Enemy4D_Action10(Enemy4DEntity* this) { - if (super->actionDelay != 0) { - if (--super->actionDelay == 0) { + if (super->timer != 0) { + if (--super->timer == 0) { super->child->flags |= ENT_COLLIDE; sub_0803E94C(super, 0); } diff --git a/src/enemy/enemy50.c b/src/enemy/enemy50.c index 40bd1fde..8842b97f 100644 --- a/src/enemy/enemy50.c +++ b/src/enemy/enemy50.c @@ -83,16 +83,16 @@ void sub_08040B9C(Enemy50Entity* this) { sub_0803F6EC(this); } if (super->hitType == 0x25) { - if (super->bitfield == 0x80) { + if (super->contactFlags == 0x80) { super->action = 8; InitializeAnimation(super, 3); goto _08040C9C; } - } else if (super->bitfield == 0x80) { + } else if (super->contactFlags == 0x80) { this->unk_7c = 0x78; sub_08041128(this); } - if (super->bitfield == 0x9d) { + if (super->contactFlags == 0x9d) { super->zVelocity = 0x18000; } if (super->confusedTime != 0) { @@ -111,7 +111,7 @@ void sub_08040B9C(Enemy50Entity* this) { super->flags |= 0x80; super->health = 0xff; super->action = 0xa; - super->actionDelay = 0x3c; + super->timer = 0x3c; } this->unk_7a = super->health; } @@ -164,7 +164,7 @@ void sub_08040D90(Enemy50Entity* this) { void Enemy50_SubAction0(Enemy50Entity* this) { super->subAction = 1; - super->field_0x1d = 0x3c; + super->gustJarTolerance = 0x3c; InitializeAnimation(super, (gPlayerEntity.animationState >> 2) + 5); } @@ -195,13 +195,13 @@ void Enemy50_Init(Enemy50Entity* this) { rand = Random(); super->direction = rand & 0x1e; super->animationState = 0xff; - super->field_0x1c = 1; + super->gustJarFlags = 1; this->unk_7a = super->health; this->unk_7b = rand >> 4; this->unk_7c = 0; if (super->type == 0) { super->action = 1; - super->child = (Entity*)GetCurrentRoomProperty(super->actionDelay); + super->child = (Entity*)GetCurrentRoomProperty(super->timer); } else { sub_080411CC(this); } @@ -210,12 +210,12 @@ void Enemy50_Init(Enemy50Entity* this) { void Enemy50_Action1(Enemy50Entity* this) { if (sub_080411E8(this)) { super->action = 2; - super->actionDelay = 0x0f; + super->timer = 0x0f; } } void Enemy50_Action2(Enemy50Entity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_080411CC(this); sub_0804122C(this); } @@ -234,7 +234,7 @@ void Enemy50_Action4(Enemy50Entity* this) { if (sub_08041170(this) == 0) { sub_0803F58C(this); GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_08041128(this); } } @@ -250,7 +250,7 @@ void Enemy50_Action5(Enemy50Entity* this) { if (--this->unk_78 == 0) { super->action = 6; rand = Random(); - super->actionDelay = rand & 0xe0; + super->timer = rand & 0xe0; super->speed = 0x100; this->unk_7e = ((rand >> 8) & 0x78) + 0x3c; } @@ -267,8 +267,8 @@ void Enemy50_Action6(Enemy50Entity* this) { sub_08041128(this); } else { if (!((sub_08049DF4(1) == 0) || (--this->unk_7e == 0))) { - tmp = super->actionDelay + 1; - super->actionDelay = tmp; + tmp = super->timer + 1; + super->timer = tmp; if ((tmp & gUnk_080D0E14[tmp * 0x1000000 >> 0x1e]) == 0) { sub_08004596(super, GetFacingDirection(super, gUnk_020000B0)); } @@ -276,14 +276,14 @@ void Enemy50_Action6(Enemy50Entity* this) { ProcessMovement1(super); } else { super->action = 7; - super->actionDelay = 0x1e; + super->timer = 0x1e; } } } void Enemy50_Action7(Enemy50Entity* this) { GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->unk_7c = (Random() & 0xf8) + 0xb4; sub_08041128(this); } @@ -327,7 +327,7 @@ void Enemy50_Action9(Enemy50Entity* this) { void Enemy50_Action10(Enemy50Entity* this) { GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_08041128(this); } } @@ -427,7 +427,7 @@ void sub_0804122C(Enemy50Entity* this) { #ifndef EU bool32 sub_08041300(Enemy50Entity* this) { - if ((super->hitType == 0x25) && (super->bitfield == 0x80)) { + if ((super->hitType == 0x25) && (super->contactFlags == 0x80)) { return TRUE; } else { return super->action == 8 || super->action == 9; diff --git a/src/enemy/enemy64.c b/src/enemy/enemy64.c index 919a569b..9f3f242d 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->actionDelay = 0x3c; + super->timer = 0x3c; super->direction = 0xc0; super->animationState = 0xc0; super->speed = 0x300; @@ -107,8 +107,8 @@ void Enemy64_Action1(Enemy64Entity* this) { } void Enemy64_Action1_SubAction0(Enemy64Entity* this) { - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } else { sub_08049998(this, ((0x100 - super->direction) & 0xff) << 8); if ((gRoomControls.origin_x - 0x100) > super->x.HALF.HI) { @@ -193,8 +193,8 @@ void Enemy64_Action2_SubAction2(Enemy64Entity* this) { gRoomControls.origin_y + 0x80), ((((uVar3 + 2) & 0x1c) - (super->direction >> 3)) & 0xf) == 8)) { super->subAction = 4; - super->actionDelay = 0x3c; - super->field_0xf = 7; + super->timer = 0x3c; + super->subtimer = 7; } sub_08049944(this); sub_08047EA4(super, ((0x100 - super->direction) & 0xff) << 8); @@ -207,10 +207,10 @@ void Enemy64_Action2_SubAction3(Enemy64Entity* this) { iVar1 = this->unk_76 += this->unk_74; uVar2 = iVar1 * 0x10000; super->direction = (uVar2 >> 0x18); - if (super->actionDelay == 0) { + if (super->timer == 0) { if ((uVar2 >> 0x18 & 0x1f) == 0) { super->subAction = 4; - super->actionDelay = 0x5a; + super->timer = 0x5a; } } else { if (sub_08049A8C(this)) { @@ -228,15 +228,15 @@ void Enemy64_Action2_SubAction3(Enemy64Entity* this) { void Enemy64_Action2_SubAction4(Enemy64Entity* this) { sub_08049998(this, ((0x100 - super->direction) & 0xff) << 8); - if (--super->actionDelay == 0) { - if (--super->field_0xf == 0) { + if (--super->timer == 0) { + if (--super->subtimer == 0) { super->subAction = 5; super->speed += 0x40; } else { super->subAction = 3; - super->actionDelay = 0xa; + super->timer = 0xa; } - } else if (super->actionDelay == 0x50) { + } else if (super->timer == 0x50) { 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->actionDelay = 0x2d; + super->timer = 0x2d; this->unk_74 = gUnk_080D29B8[Random() & 7] << 0x18 >> 0x18; this->unk_76 = super->direction << 8; } @@ -288,15 +288,15 @@ void Enemy64_Action3_SubAction2(Enemy64Entity* this) { this->unk_76 += this->unk_74; super->direction = this->unk_76 >> 8; sub_08049998(this, ((0x100 - super->direction) & 0xff) << 8); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction = 3; - super->actionDelay = 0x1e; + super->timer = 0x1e; } } void Enemy64_Action3_SubAction3(Enemy64Entity* this) { sub_08049998(this, ((0x100 - super->direction) & 0xff) << 8); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 2; super->subAction = 0; } @@ -312,7 +312,7 @@ void Enemy64_Action4_SubAction0(Enemy64Entity* this) { if (sub_08079F8C() && gPlayerEntity.z.HALF.HI == 0) { SetPlayerControl(CONTROL_2); super->subAction = 2; - super->actionDelay = 0x1e; + super->timer = 0x1e; } else { super->subAction = 1; } @@ -323,15 +323,15 @@ void Enemy64_Action4_SubAction1(Enemy64Entity* this) { if (sub_08079F8C() && gPlayerEntity.z.HALF.HI == 0) { SetPlayerControl(CONTROL_2); super->subAction = 2; - super->actionDelay = 1; + super->timer = 1; } sub_08049944(this); } void Enemy64_Action4_SubAction2(Enemy64Entity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction = 3; - super->actionDelay = 0xb4; + super->timer = 0xb4; super->speed = 0x100; super->direction -= 0x40; } @@ -340,8 +340,8 @@ void Enemy64_Action4_SubAction2(Enemy64Entity* this) { void Enemy64_Action4_SubAction3(Enemy64Entity* this) { sub_08049AB0(this); - if (--super->actionDelay == 0) { - super->actionDelay = 0x1e; + if (--super->timer == 0) { + super->timer = 0x1e; super->subAction = 4; super->speed = 0x400; super->direction = super->animationState; @@ -356,7 +356,7 @@ void Enemy64_Action4_SubAction3(Enemy64Entity* this) { void Enemy64_Action4_SubAction4(Enemy64Entity* this) { sub_08049AB0(this); sub_08049998(this, ((0x100 - super->direction) & 0xff) << 8); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction = 5; SetFade(5, 0x10); } @@ -389,7 +389,7 @@ void Enemy64_Action4_SubAction5(Enemy64Entity* this) { void Enemy64_Action4_SubAction6(Enemy64Entity* this) { if (gFadeControl.active == 0) { super->subAction = 7; - super->actionDelay = 0xa0; + super->timer = 0xa0; SoundReq(SFX_SECRET); SetFlag(0x7c); SetPlayerControl(CONTROL_1); @@ -397,21 +397,21 @@ void Enemy64_Action4_SubAction6(Enemy64Entity* this) { } void Enemy64_Action4_SubAction7(Enemy64Entity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { DeleteThisEntity(); - } else if (super->actionDelay == 0x10) { + } else if (super->timer == 0x10) { sub_0807B7D8(0x36, 0xca, 1); SetTile(0x4081, 0xca, 2); SoundReq(SFX_HEART_GET); - } else if (super->actionDelay == 0x18) { + } else if (super->timer == 0x18) { sub_0807B7D8(0x36, 0x8a, 1); SetTile(0x4081, 0x8a, 2); SoundReq(SFX_HEART_GET); - } else if (super->actionDelay == 0x20) { + } else if (super->timer == 0x20) { sub_0807B7D8(0x36, 0x4a, 1); SetTile(0x4081, 0x4a, 2); SoundReq(SFX_HEART_GET); - } else if (super->actionDelay == 0x28) { + } else if (super->timer == 0x28) { sub_0807B7D8(0x36, 10, 1); SetTile(0x4081, 10, 2); SoundReq(SFX_HEART_GET); @@ -460,7 +460,7 @@ void sub_080499F0(Enemy64Entity* this) { } bool32 sub_08049A8C(Enemy64Entity* this) { - if (--super->actionDelay == 0 && (Random() & 0xf) != 0) { + if (--super->timer == 0 && (Random() & 0xf) != 0) { return TRUE; } else { return FALSE; @@ -470,7 +470,7 @@ bool32 sub_08049A8C(Enemy64Entity* this) { void sub_08049AB0(Enemy64Entity* this) { u32 rand; - if ((++super->field_0xf & 0xf) == 0) { + if ((++super->subtimer & 0xf) == 0) { Entity* effect = CreateFx(super, FX_GIANT_EXPLOSION3, 0); if (effect != NULL) { rand = Random(); diff --git a/src/enemy/enemy66.c b/src/enemy/enemy66.c index 6975e5e8..859bc556 100644 --- a/src/enemy/enemy66.c +++ b/src/enemy/enemy66.c @@ -4,8 +4,8 @@ void (*const gUnk_080D2ABC[])(Entity*); extern void sub_08029270(Entity* this); void Enemy66(Entity* this) { - if (gUnk_080D2ABC[this->field_0xf]) { - gUnk_080D2ABC[this->field_0xf](this); + if (gUnk_080D2ABC[this->subtimer]) { + gUnk_080D2ABC[this->subtimer](this); } else { DeleteThisEntity(); } diff --git a/src/enemy/eyegore.c b/src/enemy/eyegore.c index aae204a2..d23978ea 100644 --- a/src/enemy/eyegore.c +++ b/src/enemy/eyegore.c @@ -85,14 +85,14 @@ void Eyegore_OnTick(EyegoreEntity* this) { void Eyegore_OnCollision(EyegoreEntity* this) { u32 tmp; - if ((super->bitfield == 0x95) || (super->bitfield == 0x8e)) { - Entity* entity = super->field_0x4c; + if ((super->contactFlags == 0x95) || (super->contactFlags == 0x8e)) { + Entity* entity = super->contactedEntity; tmp = (((entity->direction + 4) & 0x18) ^ 0x10) >> 3; if (tmp == super->animationState) { if ((tmp & 1) != 0) { if (0x10 < ((entity->y.HALF.HI + entity->z.HALF.HI) - (super->y.HALF.HI + super->z.HALF.HI)) + 0x14U) { } else { - if (super->bitfield == 0x8e) { + if (super->contactFlags == 0x8e) { super->health = 0; } else { super->health--; @@ -108,7 +108,7 @@ void Eyegore_OnCollision(EyegoreEntity* this) { EnqueueSFX(SFX_BUTTON_PRESS); sub_08031344(this); } else { - if (super->bitfield == 0x8e) { + if (super->contactFlags == 0x8e) { super->health = 0; } else { super->health--; @@ -133,7 +133,7 @@ void Eyegore_OnDeath(EyegoreEntity* this) { this->unk_7e--; GravityUpdate(super, 0x1c00); } else { - if ((super->field_0x3a & 2) == 0) { + if ((super->gustJarState & 2) == 0) { CreateFx(super, FX_GIANT_EXPLOSION4, 0); } GenericDeath(super); @@ -169,12 +169,12 @@ void Eyegore_Action1(EyegoreEntity* this) { } void Eyegore_Action2(EyegoreEntity* this) { - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } else { if (sub_08049FDC(super, 1)) { super->action = 3; - super->actionDelay = 0x3c; + super->timer = 0x3c; 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) + @@ -192,8 +192,8 @@ void Eyegore_Action3(EyegoreEntity* this) { 0, 1, }; - if (super->actionDelay != 0) { - super->spriteOffsetX = gUnk_080CE2BC[--super->actionDelay & 3]; + if (super->timer != 0) { + super->spriteOffsetX = gUnk_080CE2BC[--super->timer & 3]; } else { GetNextFrame(super); if ((super->frame & ANIM_DONE) != 0) { @@ -469,7 +469,7 @@ void sub_08031250(EyegoreEntity* this) { void sub_08031320(EyegoreEntity* this) { super->action = 2; super->flags &= ~ENT_COLLIDE; - super->actionDelay = 0x1e; + super->timer = 0x1e; super->hitbox = (Hitbox*)&gUnk_080FD308; InitializeAnimation(super, 10); } @@ -478,7 +478,7 @@ void sub_08031344(EyegoreEntity* this) { static const s8 gUnk_080CE304[] = { 0, -6, -14, -14, 0, -28, 14, -14, }; - Entity* entity = sub_08017A90(super->field_0x4c, super); + Entity* entity = sub_08017A90(super->contactedEntity, super); if (entity != NULL) { const s8* ptr = &gUnk_080CE304[entity->animationState * 2]; entity->spriteOffsetX = ptr[0]; diff --git a/src/enemy/fallingBoulder.c b/src/enemy/fallingBoulder.c index 828b3670..b8395ee5 100644 --- a/src/enemy/fallingBoulder.c +++ b/src/enemy/fallingBoulder.c @@ -36,7 +36,7 @@ void FallingBoulder_OnGrabbed(Entity* this) { void sub_0802C258(Entity* this) { sub_0804A720(this); this->zVelocity = Q_16_16(2.0); - this->actionDelay = 2; + this->timer = 2; this->field_0x7a.HWORD = Random() & 0x70; switch (this->type) { case 1: @@ -169,8 +169,8 @@ void sub_0802C4B0(Entity* this) { rand = Random() & 7; if (rand & 4) { - if (this->actionDelay != 0) { - this->actionDelay = 0; + if (this->timer != 0) { + this->timer = 0; InitializeAnimation(this, 0); } if (rand & 3) { @@ -179,8 +179,8 @@ void sub_0802C4B0(Entity* this) { this->direction = gUnk_080CD580[offset | 0]; } } else { - if (this->actionDelay != 1) { - this->actionDelay = 1; + if (this->timer != 1) { + this->timer = 1; InitializeAnimation(this, 1); } if (rand & 3) { diff --git a/src/enemy/fireballGuy.c b/src/enemy/fireballGuy.c index 6e140df5..73c0771a 100644 --- a/src/enemy/fireballGuy.c +++ b/src/enemy/fireballGuy.c @@ -41,11 +41,11 @@ void FireballGuy_OnGrabbed(void) { void sub_080453E8(Entity* this) { this->action = 1; - this->actionDelay = 0; + this->timer = 0; this->spriteSettings.draw = 1; this->speed = 0x80; this->cutsceneBeh.HALF.LO = this->health; - this->field_0x3c |= 0x10; + this->collisionFlags |= 0x10; sub_0804A720(this); InitializeAnimation(this, 0); sub_08045524(this); @@ -105,14 +105,14 @@ void sub_08045524(Entity* this) { this->zVelocity = Q_16_16(1.75); tmp = sub_0804A024(this, 1, 8); if (tmp != 0xff && (Random() & 3) == 0) { - this->actionDelay = Random() & 3; + this->timer = Random() & 3; this->direction = DirectionRound(tmp); } else { - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; return; } - this->actionDelay = Random() & 3; + this->timer = Random() & 3; if (sub_08049FA0(this) == 0 && (Random() & 3)) { tmp1 = sub_08049EE4(this); tmp2 = Random() & 8; diff --git a/src/enemy/flyingPot.c b/src/enemy/flyingPot.c index 1736979d..c38a24b9 100644 --- a/src/enemy/flyingPot.c +++ b/src/enemy/flyingPot.c @@ -95,7 +95,7 @@ void FlyingPot_OnTick(FlyingPotEntity* this) { void FlyingPot_OnCollision(FlyingPotEntity* this) { sub_08037418(this); - if (super->bitfield == 0x9D) { + if (super->contactFlags == 0x9D) { super->action = FLYING_POT_ACTION_6; COLLISION_OFF(super); super->zVelocity = 0x2A000; @@ -122,8 +122,8 @@ void FlyingPot_SubAction0(FlyingPotEntity* this) { sub_08037418(this); super->subAction = FLYING_POT_SUBACTION_1; - super->actionDelay = 0; - super->field_0x1d = 0x30; + super->timer = 0; + super->gustJarTolerance = 0x30; } void FlyingPot_SubAction1(FlyingPotEntity* this) { @@ -141,9 +141,9 @@ void FlyingPot_SubAction1(FlyingPotEntity* this) { } void FlyingPot_SubAction2(FlyingPotEntity* this) { - if (super->actionDelay == 0) { + if (super->timer == 0) { sub_08037418(this); - super->actionDelay = 1; + super->timer = 1; COLLISION_OFF(super); super->spriteOffsetX = 0; @@ -174,7 +174,7 @@ void FlyingPot_Init(FlyingPotEntity* this) { u32 tile; super->action = FLYING_POT_ACTION_1; - super->field_0x1c = 2; + super->gustJarFlags = 2; super->y.HALF.HI += 3; tile = TILE(super->x.HALF.HI, super->y.HALF.HI); @@ -193,7 +193,7 @@ void FlyingPot_Action1(FlyingPotEntity* this) { if (PlayerInRange(super, 1, 0x40)) { super->action = FLYING_POT_ACTION_2; - super->actionDelay = 30; + super->timer = 30; } } @@ -202,9 +202,9 @@ void FlyingPot_Action2(FlyingPotEntity* this) { sub_08037418(this); - super->spriteOffsetX += offsets[super->actionDelay & 3]; + super->spriteOffsetX += offsets[super->timer & 3]; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = FLYING_POT_ACTION_3; super->spritePriority.b1 = 1; super->spriteOffsetX = 0; @@ -221,13 +221,13 @@ void FlyingPot_Action3(FlyingPotEntity* this) { if (super->z.HALF.HI <= -6) { super->action = FLYING_POT_ACTION_4; - super->actionDelay = 10; + super->timer = 10; super->direction = GetFacingDirection(super, &gPlayerEntity); } } void FlyingPot_Action4(FlyingPotEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = FLYING_POT_ACTION_5; } } diff --git a/src/enemy/flyingSkull.c b/src/enemy/flyingSkull.c index 0374b579..944094a3 100644 --- a/src/enemy/flyingSkull.c +++ b/src/enemy/flyingSkull.c @@ -42,7 +42,7 @@ void FlyingSkull_OnTick(FlyingSkullEntity* this) { void FlyingSkull_OnCollision(FlyingSkullEntity* this) { sub_0803A100(this); - if (super->bitfield == 0x9d) { + if (super->contactFlags == 0x9d) { super->action = 7; COLLISION_OFF(super); super->zVelocity = Q_16_16(2.625); @@ -62,8 +62,8 @@ void FlyingSkull_OnGrabbed(FlyingSkullEntity* this) { void sub_08039C98(FlyingSkullEntity* this) { sub_0803A100(this); super->subAction = 1; - super->actionDelay = 0; - super->field_0x1d = 0x30; + super->timer = 0; + super->gustJarTolerance = 0x30; } void sub_08039CB0(FlyingSkullEntity* this) { @@ -81,9 +81,9 @@ void sub_08039CB0(FlyingSkullEntity* this) { } void sub_08039CE0(FlyingSkullEntity* this) { - if (super->actionDelay == 0) { + if (super->timer == 0) { sub_0803A100(this); - super->actionDelay = 1; + super->timer = 1; super->z.HALF.HI = 0xffff; super->spriteOffsetX = 0; SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer); @@ -112,8 +112,8 @@ void sub_08039D6C(FlyingSkullEntity* this) { void sub_08039D74(FlyingSkullEntity* this) { u32 tmp; super->action = 1; - super->field_0x1c = 2; - super->field_0x16 = 0; + super->gustJarFlags = 2; + super->carryFlags = 0; super->y.HALF.HI += 3; tmp = COORD_TO_TILE(super); @@ -138,7 +138,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->actionDelay = 0x1e; + super->timer = 0x1e; } else { ent = CreateEnemy(STALFOS, super->type - 2); if (ent != NULL) { @@ -187,9 +187,9 @@ void sub_08039FA4(FlyingSkullEntity* this) { void sub_08039FAC(FlyingSkullEntity* this) { sub_0803A100(this); - super->spriteOffsetX += gUnk_080CFBE4[super->actionDelay & 3]; + super->spriteOffsetX += gUnk_080CFBE4[super->timer & 3]; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 4; COLLISION_ON(super); super->spritePriority.b1 = 1; @@ -206,7 +206,7 @@ void sub_0803A048(FlyingSkullEntity* this) { super->z.WORD += 0xFFFF0000; if (super->z.HALF.HI <= -6) { super->action = 5; - super->actionDelay = 10; + super->timer = 10; super->direction = GetFacingDirection(super, &gPlayerEntity); } } @@ -214,7 +214,7 @@ void sub_0803A048(FlyingSkullEntity* this) { void sub_0803A080(FlyingSkullEntity* this) { GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 6; } } diff --git a/src/enemy/ghini.c b/src/enemy/ghini.c index 5ffab6bf..1fb426b7 100644 --- a/src/enemy/ghini.c +++ b/src/enemy/ghini.c @@ -10,7 +10,7 @@ #include "enemy.h" #include "functions.h" #include "area.h" -#include "coord.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; @@ -62,11 +62,11 @@ void Ghini_OnCollision(GhiniEntity* this) { sub_0803F630(this); sub_0803F6EC(this); } - if ((super->hitType == 0x25) && (super->bitfield == 0x80)) { + if ((super->hitType == 0x25) && (super->contactFlags == 0x80)) { super->action = 8; InitializeAnimation(super, 3); } else { - if (super->bitfield == 0x9d) { + if (super->contactFlags == 0x9d) { super->zVelocity = 0x18000; } if (super->confusedTime != 0) { @@ -123,7 +123,7 @@ void Ghini_OnGrabbed(GhiniEntity* this) { void Ghini_SubAction0(GhiniEntity* this) { super->subAction = 1; - super->field_0x1d = 0x3c; + super->gustJarTolerance = 0x3c; InitializeAnimation(super, (gPlayerEntity.animationState >> 2) + 5); } @@ -150,7 +150,7 @@ void Ghini_Init(GhiniEntity* this) { rand = Random(); super->direction = rand & 0x1e; super->animationState = 0xff; - super->field_0x1c = 1; + super->gustJarFlags = 1; this->unk_7a = super->health; this->unk_7b = (rand >> 4); this->unk_7c = 0; @@ -165,7 +165,7 @@ void Ghini_Init(GhiniEntity* this) { void Ghini_Action1(GhiniEntity* this) { if (sub_0803F5A8(this)) { super->action = 2; - super->actionDelay = (Random() & 0x60) + 10; + super->timer = (Random() & 0x60) + 10; } } @@ -173,9 +173,9 @@ void Ghini_Action2(GhiniEntity* this) { if (sub_0803F5A8(this) == 0) { sub_0803F50C(this); } else { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 3; - super->actionDelay = 0x1e; + super->timer = 0x1e; if (sub_08049DF4(1) != NULL) { super->direction = GetFacingDirection(super, gUnk_020000B0); } else { @@ -189,7 +189,7 @@ void Ghini_Action2(GhiniEntity* this) { void Ghini_Action3(GhiniEntity* this) { GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_0803F51C(this); } } @@ -198,7 +198,7 @@ void Ghini_Action4(GhiniEntity* this) { if (sub_0803F5D4(this) == FALSE) { sub_0803F58C(this); GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_0803F51C(this); } } @@ -225,8 +225,8 @@ void Ghini_Action6(GhiniEntity* this) { sub_0803F51C(this); } else { if (sub_08049DF4(1) != NULL) { - tmp = super->actionDelay + 1; - super->actionDelay = tmp; + tmp = super->timer + 1; + super->timer = tmp; if ((tmp & gUnk_080D0970[tmp * 0x1000000 >> 0x1e]) == 0) { sub_08004596(super, GetFacingDirection(super, gUnk_020000B0)); } @@ -235,14 +235,14 @@ void Ghini_Action6(GhiniEntity* this) { GetNextFrame(super); } else { super->action = 7; - super->actionDelay = 0x1e; + super->timer = 0x1e; } } } void Ghini_Action7(GhiniEntity* this) { GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_0803F51C(this); } } @@ -295,7 +295,7 @@ void sub_0803F51C(GhiniEntity* this) { void sub_0803F528(GhiniEntity* this) { u32 rand = Random(); - super->actionDelay = (rand & 8) + 8; + super->timer = (rand & 8) + 8; if (sub_08049FA0(super)) { super->direction = (super->direction + gUnk_080D0978[rand & 7]) & 0x1e; } else { diff --git a/src/enemy/gibdo.c b/src/enemy/gibdo.c index dd2ec640..ac59891c 100644 --- a/src/enemy/gibdo.c +++ b/src/enemy/gibdo.c @@ -57,17 +57,17 @@ void Gibdo_OnTick(GibdoEntity* this) { void Gibdo_OnCollision(GibdoEntity* this) { u8 x; - if (super->bitfield == 0x87) { + if (super->contactFlags == 0x87) { if (super->action == 0x6) { sub_08037ACC(this); } super->action = 0x8; - super->actionDelay = 0x3c; + super->timer = 0x3c; COLLISION_OFF(super); Gibdo_CreateObjects(this); } else { if (super->action != 0x6) { - if (super->hitType == 0x27 && super->bitfield == 0x80) { + if (super->hitType == 0x27 && super->contactFlags == 0x80) { sub_08037A14(this); } else { if ((u8)(super->action - 1) < 2) { @@ -77,7 +77,7 @@ void Gibdo_OnCollision(GibdoEntity* this) { super->animationState = x >> 3; InitAnimationForceUpdate(super, super->animationState); if (sub_08037810(this) != 0) { - super->actionDelay = 4; + super->timer = 4; } } } @@ -118,7 +118,7 @@ void sub_080375A4(GibdoEntity* this) { } else { UpdateAnimationSingleFrame(super); if (ProcessMovement0(super) == 0) { - if (!(--super->field_0xf)) { + if (!(--super->subtimer)) { sub_080379BC(this); } } @@ -129,9 +129,9 @@ void sub_080375A4(GibdoEntity* this) { void sub_080375F8(GibdoEntity* this) { if (sub_080378B0(this) == 0) { - if (!(--super->actionDelay)) { + if (!(--super->timer)) { super->action = 4; - super->actionDelay = 0x18; + super->timer = 0x18; InitAnimationForceUpdate(super, super->animationState + 4); } } @@ -146,11 +146,11 @@ void sub_08037624(GibdoEntity* this) { UpdateAnimationSingleFrame(super); UpdateAnimationSingleFrame(super); if (ProcessMovement0(super) == 0) { - if (!(--super->field_0xf)) { + if (!(--super->subtimer)) { sub_080379BC(this); } } else { - if (!(--super->actionDelay)) { + if (!(--super->timer)) { sub_0803797C(this); } } @@ -201,7 +201,7 @@ void sub_0803773C(GibdoEntity* this) { // Turn into Stalfos void sub_0803775C(GibdoEntity* this) { Entity* x; - if (!(--super->actionDelay)) { + if (!(--super->timer)) { x = CreateEnemy(STALFOS, 0); if (x != 0) { sub_0804A4E4(super, x); @@ -222,7 +222,7 @@ void sub_080377B0(GibdoEntity* this) { u32 r1; u32 r2; super->action = 2; - super->field_0xf = 8; + super->subtimer = 8; r1 = Random(); this->field_0x74 = (r1 & 0x38) + 0x78; super->speed = 0x40; @@ -245,8 +245,8 @@ u32 sub_08037810(GibdoEntity* this) { x = GetFacingDirection(super, gUnk_020000B0); if (((x - super->direction + 6) & 0x1f) <= 0xc) { super->action = 3; - super->actionDelay = 0x18; - super->field_0xf = 0x8; + super->timer = 0x18; + super->subtimer = 0x8; super->speed = 0xc0; super->direction = DirectionRoundUp(GetFacingDirection(super, gUnk_020000B0)); super->animationState = super->direction >> 3; @@ -300,8 +300,8 @@ u32 sub_08037914(GibdoEntity* this) { void sub_0803797C(GibdoEntity* this) { u32 m; - super->actionDelay = 0x18; - super->field_0xf = 8; + super->timer = 0x18; + super->subtimer = 8; m = super->direction = (CalculateDirectionTo(super->x.HALF.HI, super->y.HALF.HI, this->field_0x78, this->field_0x7a) + 4) & 0x18; ; @@ -314,8 +314,8 @@ void sub_0803797C(GibdoEntity* this) { void sub_080379BC(GibdoEntity* this) { u32 r; - super->actionDelay = 0x18; - super->field_0xf = 0x8; + super->timer = 0x18; + super->subtimer = 0x8; r = Random(); super->animationState = ((super->animationState + (r & 2)) - 1) & 3; super->direction = DirectionFromAnimationState(super->animationState); @@ -324,7 +324,7 @@ void sub_080379BC(GibdoEntity* this) { u32 sub_080379EC(GibdoEntity* this) { if (sub_0807953C() != 0) { - if (!(--super->actionDelay)) { + if (!(--super->timer)) { sub_08037A58(this); return 1; } @@ -334,12 +334,12 @@ u32 sub_080379EC(GibdoEntity* this) { void sub_08037A14(GibdoEntity* this) { super->action = 6; - super->actionDelay = 0x18; - super->spritePriority.b0 = (super->spritePriority.b0 & (super->actionDelay - 0x20)); + super->timer = 0x18; + super->spritePriority.b0 = (super->spritePriority.b0 & (super->timer - 0x20)); super->spritePriority.b0 |= 3; super->flags2 &= 0xfe; this->field_0x7c = 5; - CopyPosition(super, super->field_0x4c); + CopyPosition(super, super->contactedEntity); InitAnimationForceUpdate(super, super->animationState + 0xc); } @@ -386,7 +386,7 @@ void Gibdo_CreateObjects(GibdoEntity* this) { Entity* E; E = CreateObject(OBJECT_2A, 3, 0); if (E != 0) { - E->type2 = super->actionDelay; + E->type2 = super->timer; E->spritePriority.b0 = 3; E->spriteOffsetX = 0; E->spriteOffsetY = 0xfc; @@ -395,7 +395,7 @@ void Gibdo_CreateObjects(GibdoEntity* this) { this->field_0x80 = E; E = CreateObject(OBJECT_2A, 3, 0); if (E != 0) { - E->type2 = super->actionDelay; + E->type2 = super->timer; E->spritePriority.b0 = 3; E->spriteOffsetX = 0xfd; E->spriteOffsetY = 0xf8; @@ -404,7 +404,7 @@ void Gibdo_CreateObjects(GibdoEntity* this) { this->field_0x84 = E; E = CreateObject(OBJECT_2A, 3, 0); if (E != 0) { - E->type2 = super->actionDelay; + E->type2 = super->timer; E->spritePriority.b0 = 3; E->spriteOffsetX = 0x5; E->spriteOffsetY = 0xf5; @@ -416,19 +416,19 @@ void Gibdo_CreateObjects(GibdoEntity* this) { void Gibdo_MoveObjectsToStalfos(GibdoEntity* this, Entity* that) { Entity* ent = this->field_0x80; if (ent != NULL) { - ent->actionDelay = 0xf; + ent->timer = 0xf; ent->parent = that; } ent = this->field_0x84; if (ent != NULL) { - ent->actionDelay = 0xf; + ent->timer = 0xf; ent->parent = that; } ent = super->child; if (ent != NULL) { - ent->actionDelay = 0xf; + ent->timer = 0xf; ent->parent = that; } } diff --git a/src/enemy/gleerok.c b/src/enemy/gleerok.c index d257fcea..67127b77 100644 --- a/src/enemy/gleerok.c +++ b/src/enemy/gleerok.c @@ -79,16 +79,16 @@ void Gleerok_OnDeath(GleerokEntity* this) { case 2: if (super->type2 == 0) { super->type2 = 1; - super->actionDelay = 0; - super->field_0xf = 0x3c; + super->timer = 0; + super->subtimer = 0x3c; this->unk_74 = 0x10; this->unk_75 = 0; gScreen.controls.alphaBlend = this->unk_74; gScreen.controls.layerFXControl = 0x1442; SoundReq(SFX_EVAPORATE); } else { - ++super->actionDelay; - if ((super->actionDelay & 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); @@ -98,8 +98,8 @@ void Gleerok_OnDeath(GleerokEntity* this) { } } - if (super->field_0xf) { - if (--super->field_0xf == 0) { + if (super->subtimer) { + if (--super->subtimer == 0) { SoundReq(SFX_APPARATE); } } @@ -148,7 +148,7 @@ void sub_0802D170(GleerokEntity* this) { } else { super->action = 3; this->unk_80 = 0; - ((Entity*)this->unk_84)->parent->actionDelay = 0x18; + ((Entity*)this->unk_84)->parent->timer = 0x18; this->unk_84->filler[0x19] = 0; } } @@ -158,10 +158,10 @@ void sub_0802D218(GleerokEntity* this) { return; super->action = 4; - super->actionDelay = 0; - super->field_0xf = 0; + super->timer = 0; + super->subtimer = 0; this->unk_7c.HALF_U.LO = 0xb4; - ((Entity*)(this->unk_84))->parent->actionDelay = 0xc; + ((Entity*)(this->unk_84))->parent->timer = 0xc; CreateObjectWithParent(super, 0x67, 0x2, this->unk_7c.HALF_U.LO); } @@ -178,12 +178,12 @@ void sub_0802D258(GleerokEntity* this) { } } - if (super->actionDelay == 0) { - super->actionDelay = gUnk_080CD774[super->field_0xf]; - super->direction = gUnk_080CD774[super->field_0xf + 1]; - super->field_0xf = (super->field_0xf & 0x3f) + 2; + if (super->timer == 0) { + super->timer = gUnk_080CD774[super->subtimer]; + super->direction = gUnk_080CD774[super->subtimer + 1]; + super->subtimer = (super->subtimer & 0x3f) + 2; } else { - super->actionDelay--; + super->timer--; } if (super->direction <= 1) { @@ -325,12 +325,12 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D3B8.inc", void sub_0802D3B8(GleerokE ptr = gUnk_080CD7C4; ptr += super->type2 * 4; super->spritePriority.b0 = *(ptr + 1); - super->field_0xf = 0; + super->subtimer = 0; InitializeAnimation(super, 0x24); break; case 2: super->spritePriority.b0 = 0; - super->field_0xf = 0; + super->subtimer = 0; InitAnimationForceUpdate(super, 0); break; case 3: @@ -434,7 +434,7 @@ void sub_0802D714(GleerokEntity* this) { ((GleerokEntity*)(super->child))->unk_84 = heap; } - heap->ent2->actionDelay = 0x18; + heap->ent2->timer = 0x18; } void sub_0802D77C(GleerokEntity* this) { @@ -446,20 +446,20 @@ void sub_0802D77C(GleerokEntity* this) { if (super->type2 != 2) return; - super->field_0xf = 0; - super->actionDelay = 0; + super->subtimer = 0; + super->timer = 0; super->subAction = 4; - this->unk_84->ent2->actionDelay = 0xc; + this->unk_84->ent2->timer = 0xc; } void sub_0802D7B4(GleerokEntity* this) { - if (super->actionDelay == 0) { - if (gUnk_080CD7F8[super->field_0xf] == 0xff) { - super->field_0xf = 0; - super->actionDelay = 0; + if (super->timer == 0) { + if (gUnk_080CD7F8[super->subtimer] == 0xff) { + super->subtimer = 0; + super->timer = 0; super->action = 1; super->subAction = 0; - this->unk_84->ent2->actionDelay = 0x18; + this->unk_84->ent2->timer = 0x18; gRoomControls.camera_target = &gPlayerEntity; #ifndef EU gPlayerState.controlMode = CONTROL_1; @@ -468,13 +468,13 @@ void sub_0802D7B4(GleerokEntity* this) { SoundReq(BGM_BOSS_THEME); return; } else { - super->actionDelay = gUnk_080CD7F8[super->field_0xf]; - super->direction = gUnk_080CD7F8[super->field_0xf + 1]; - super->field_0xf += 2; + super->timer = gUnk_080CD7F8[super->subtimer]; + super->direction = gUnk_080CD7F8[super->subtimer + 1]; + super->subtimer += 2; SoundReq(SFX_BOSS_HIT); } } else { - super->actionDelay--; + super->timer--; } if (super->direction <= 1) { @@ -505,11 +505,11 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE super->iframes = super->parent->iframes; if (super->iframes == 0) { - if (super->field_0xf == 0) { + if (super->subtimer == 0) { UnloadOBJPalette(super); LoadObjPalette(super, 0xc9); } else { - super->field_0xf--; + super->subtimer--; UnloadOBJPalette(super); LoadObjPalette(super, 0xca); } @@ -534,11 +534,11 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE return; ((GleerokEntity*)(super->parent))->unk_7b = 1; - super->actionDelay = 0; + super->timer = 0; do { - CreateObjectWithParent(super, OBJECT_67, 0, super->actionDelay); - } while (++super->actionDelay < 8); + CreateObjectWithParent(super, OBJECT_67, 0, super->timer); + } while (++super->timer < 8); SoundReq(SFX_150); DeleteThisEntity(); @@ -577,7 +577,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE super->child = enemy; if (enemy) { enemy->parent = super->parent; - super->actionDelay = this->unk_84->filler[1]; + super->timer = this->unk_84->filler[1]; this->unk_84->ent = super->child; ((GleerokEntity*)super->child)->unk_84 = this->unk_84; } @@ -599,8 +599,8 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE } } - if ((super->bitfield & 0x80) && this->unk_74 == 0) { - if ((super->bitfield & 0x7f) == 0x1d) { + if ((super->contactFlags & 0x80) && this->unk_74 == 0) { + if ((super->contactFlags & 0x7f) == 0x1d) { super->zVelocity = 0x30000; super->parent->subAction = 4; super->parent->type2 = 0; @@ -608,8 +608,8 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE SoundReq(SFX_BUTTON_PRESS); } } else { - if (super->actionDelay != this->unk_84->filler[1]) { - if (((super->actionDelay - this->unk_84->filler[1]) & 0x1f) > 0x10) { + if (super->timer != this->unk_84->filler[1]) { + if (((super->timer - this->unk_84->filler[1]) & 0x1f) > 0x10) { if (++super->frameIndex >= 0x31) { super->frameIndex = 0x28; } @@ -619,7 +619,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE } } - super->actionDelay = this->unk_84->filler[1]; + super->timer = this->unk_84->filler[1]; } } @@ -652,7 +652,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE END_NONMATCH void sub_0802DB84(GleerokEntity* this) { - u32 actionDelay; + u32 timer; super->direction = GetFacingDirection(super, &gPlayerEntity); if (this->unk_84->filler[0x1] == super->direction) { super->subAction = 1; @@ -661,11 +661,11 @@ void sub_0802DB84(GleerokEntity* this) { } if (((this->unk_84->filler[0x1] - super->direction) & 0x1f) > 0x10) { - actionDelay = 0; - super->actionDelay &= 0xfe; + timer = 0; + super->timer &= 0xfe; } else { - actionDelay = 1; - super->actionDelay = actionDelay; + timer = 1; + super->timer = timer; } switch (this->unk_79) { @@ -680,7 +680,7 @@ void sub_0802DB84(GleerokEntity* this) { break; } - sub_0802EA48(this->unk_84, 5, super->speed, actionDelay); + sub_0802EA48(this->unk_84, 5, super->speed, timer); sub_0802E768(this->unk_84); sub_0802E518(this); sub_0802EBC4(this); @@ -693,32 +693,32 @@ void sub_0802DC1C(GleerokEntity* this) { if (diff > 0x10) { if (diff <= 0x1d) { super->subAction = 0; - this->unk_84->ent2->actionDelay = 0; + this->unk_84->ent2->timer = 0; return; } } else if (diff >= 3) { super->subAction = 0; - this->unk_84->ent2->actionDelay = 0; + this->unk_84->ent2->timer = 0; return; } if (this->unk_78) { this->unk_78--; } else { - u8 actionDelay = super->actionDelay; + u8 timer = super->timer; diff = 0; - if (actionDelay == 1) { + if (timer == 1) { diff = 1; } sub_0802EA48(this->unk_84, 5, 0x20, diff); if (sub_0802EA18(*(u16*)&this->unk_84->filler[0], *(u16*)&this->unk_84->filler[0x14], 4)) { - if (super->actionDelay == 1) { + if (super->timer == 1) { *(u16*)&this->unk_84->filler[0x14] = (((this->unk_84->filler[0x1] - 4) & 0x1f) << 8) | 0xff; } else { *(u16*)&this->unk_84->filler[0x14] = (((this->unk_84->filler[0x1] + 4) & 0x1f) << 8); } - super->actionDelay ^= 1; + super->timer ^= 1; this->unk_78 = 0xc; } } @@ -730,12 +730,12 @@ void sub_0802DC1C(GleerokEntity* this) { } void sub_0802DCE0(GleerokEntity* this) { - if (this->unk_84->ent2->actionDelay != 0xc) { + if (this->unk_84->ent2->timer != 0xc) { super->direction = GetFacingDirection(super, &gPlayerEntity); if (this->unk_84->filler[0x15] == super->direction) { - this->unk_84->ent2->actionDelay = 0xc; + this->unk_84->ent2->timer = 0xc; this->unk_82 = 4; - super->field_0xf = 0; + super->subtimer = 0; } else { s32 svar1, diff; diff = ((this->unk_84->filler[0x15] - super->direction) & 0x1f); @@ -748,16 +748,16 @@ void sub_0802DCE0(GleerokEntity* this) { sub_0802E768(this->unk_84); } } else { - if (super->field_0xf < 6) { + if (super->subtimer < 6) { if (this->unk_82 == 0) { this->unk_82 = 4; - this->unk_84->entities[super->field_0xf]->field_0xf = 4; - super->field_0xf++; + this->unk_84->entities[super->subtimer]->subtimer = 4; + super->subtimer++; } else { this->unk_82--; } } else { - if (this->unk_84->ent2->field_0xf == 0) { + if (this->unk_84->ent2->subtimer == 0) { super->child = CreateProjectileWithParent(super, GLEEROK_PROJECTILE, 0); if (super->child != NULL) { @@ -767,7 +767,7 @@ void sub_0802DCE0(GleerokEntity* this) { super->child->child = this->unk_84->entities[0]; } - this->unk_84->ent2->actionDelay = 0; + this->unk_84->ent2->timer = 0; if (this->unk_74 == 0) { this->unk_74 = 1; } else { @@ -801,7 +801,7 @@ void sub_0802DDD8(GleerokEntity* this) { break; super->type2 = 1; - super->field_0xf = 0; + super->subtimer = 0; if ((Random() & 1) == 0) { super->direction = 0; @@ -825,7 +825,7 @@ void sub_0802DDD8(GleerokEntity* this) { r4 = 0; } - if (this->unk_84->ent2->field_0xf == 1) { + if (this->unk_84->ent2->subtimer == 1) { super->child = CreateProjectileWithParent(super, GLEEROK_PROJECTILE, r2); if (super->child != NULL) { super->child->direction = this->unk_84->filler[0x15]; @@ -837,10 +837,10 @@ void sub_0802DDD8(GleerokEntity* this) { if (this->unk_74 == 0) { this->unk_74 = r4; - this->unk_84->entities[super->field_0xf]->field_0xf = r8; + this->unk_84->entities[super->subtimer]->subtimer = r8; - if (++super->field_0xf > 5) { - super->field_0xf = 0; + if (++super->subtimer > 5) { + super->subtimer = 0; } } else { this->unk_74--; @@ -864,16 +864,16 @@ void sub_0802DDD8(GleerokEntity* this) { super->direction ^= 1; if (super->direction == 1) { this->unk_7a = (this->unk_7a - (uvar1 * 2)) & 0x1f; - super->actionDelay = 1; + super->timer = 1; } else { this->unk_7a = (this->unk_7a + (uvar1 * 2)) & 0x1f; - super->actionDelay &= 0xfe; + super->timer &= 0xfe; } - this->unk_84->ent2->actionDelay = 0xc; + this->unk_84->ent2->timer = 0xc; } else { super->subAction = 0; - this->unk_84->ent2->actionDelay = 0; + this->unk_84->ent2->timer = 0; sub_0802EB9C(this); } } @@ -903,7 +903,7 @@ void sub_0802DFC0(GleerokEntity* this) { if (this->unk_7b) { COLLISION_ON(super); super->type2 = 1; - this->unk_84->ent2->actionDelay = 0x18; + this->unk_84->ent2->timer = 0x18; SoundReq(SFX_BOSS_HIT); } } @@ -932,7 +932,7 @@ void sub_0802E034(GleerokEntity* this) { if (super->type2 == 2) { this->unk_7c.HALF.LO = 0x168; this->unk_80 = 1; - heap->ent2->actionDelay = 0; + heap->ent2->timer = 0; } super->type2++; @@ -982,7 +982,7 @@ void sub_0802E0B8(GleerokEntity* this) { super->type2 = 4; InitializeAnimation(super, 0x4e); } else { - if (super->bitfield & 0x80) { + if (super->contactFlags & 0x80) { if (super->iframes > 0) { SoundReq(SFX_BOSS_HIT); } @@ -1100,7 +1100,7 @@ void sub_0802E300(GleerokEntity* this) { ((GleerokEntity*)super->child)->unk_84 = heap; } - heap->ent2->actionDelay = 0x18; + heap->ent2->timer = 0x18; } 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->actionDelay == 0x18) { + if (heap->ent2->timer == 0x18) { r7 = (heap->filler[0x15] >> 3) << 2; if (heap->filler[0x2d] > 0xc) { r7 += 3; @@ -1217,7 +1217,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802E518.inc", void sub_0802E518(GleerokE if (this->unk_80 == 0) { sub_0802E7CC(heap, 5, 0, 0); r7 = (heap->ent2->animationState / 2 + heap->ent2->animationState) / 4; - r7 += heap->ent2->actionDelay; + r7 += heap->ent2->timer; } else { if (super->iframes == 0) { if ((super->animIndex != (heap->filler[0x15] >> 3) + 0x2f) || (super->frame & ANIM_DONE) != 0) { diff --git a/src/enemy/gyorgChild.c b/src/enemy/gyorgChild.c index 84bd4e6e..348e7aca 100644 --- a/src/enemy/gyorgChild.c +++ b/src/enemy/gyorgChild.c @@ -80,7 +80,7 @@ void GyorgChild_Action0(GyorgChildEntity* this) { 0x50, 0x1, 0x40, 0x1, 0x30, 0x1, 0x20, 0x1, 0x10, 0x1, 0, 0, 0x10, -0x1, 0x20, -0x1, 0x30, -0x1, 0x40, -0x1, 0x50, -0x1, }; - super->field_0x1c = 1; + super->gustJarFlags = 1; super->spriteOrientation.flipY = 3; super->spriteRendering.b3 = 3; super->spritePriority.b0 = 7; @@ -95,20 +95,20 @@ void GyorgChild_Action0(GyorgChildEntity* this) { super->direction -= 5; super->direction &= 0x1F; r *= 2; - super->actionDelay = gUnk_080D1EA0[r]; + super->timer = gUnk_080D1EA0[r]; this->unk_7b = gUnk_080D1EA0[r + 1]; super->speed = 0x200; } else { super->action = 2; - super->actionDelay = 1; + super->timer = 1; super->spriteSettings.draw = 0; } } void GyorgChild_Action1(GyorgChildEntity* this) { LinearMoveUpdate(super); - if (super->actionDelay != 0) { - if ((--super->actionDelay & 0xF) == 0) { + if (super->timer != 0) { + if ((--super->timer & 0xF) == 0) { super->direction += this->unk_7b; super->direction &= 0x1F; } @@ -136,12 +136,12 @@ void GyorgChild_Action1(GyorgChildEntity* this) { break; } super->action = 2; - super->actionDelay = 90; + super->timer = 90; super->spriteSettings.draw = 0; } void GyorgChild_Action2(GyorgChildEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 3; super->flags |= ENT_COLLIDE; Random(); diff --git a/src/enemy/gyorgFemale.c b/src/enemy/gyorgFemale.c index ac1bcb00..a5f35588 100644 --- a/src/enemy/gyorgFemale.c +++ b/src/enemy/gyorgFemale.c @@ -113,7 +113,7 @@ void GyorgFemale_Action1(GyorgFemaleEntity* this) { sub_080465C8(); if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x38) { super->action = 2; - super->actionDelay = 0; + super->timer = 0; this->eyeTimer = 0; this->eyesHitFrame = 0; this->eyesHit = 0; @@ -124,7 +124,7 @@ void GyorgFemale_Action1(GyorgFemaleEntity* this) { if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x40) { super->action = 3; this->childrenSpawnTimer = 0x3c; - super->actionDelay = 0; + super->timer = 0; this->eyeTimer = 0; this->eyesHitFrame = 0; this->eyesHit = 0; @@ -394,15 +394,15 @@ void GyorgFemale_ChooseEyePattern(GyorgFemaleEntity* this) { void GyorgFemale_ProcessEyeHit(GyorgFemaleEntity* this) { if (this->eyesHitFrame != 0) { this->eyesHit |= this->eyesHitFrame; - if (super->actionDelay == 0 && this->eyesVulnerable != 0xFF) { + if (super->timer == 0 && this->eyesVulnerable != 0xFF) { #ifndef EU - super->actionDelay = 4; + super->timer = 4; #else - super->actionDelay = 3; + super->timer = 3; #endif } if (sub_08000E62(this->eyesHit) > 2) { - super->actionDelay = 0; + super->timer = 0; this->eyesHit = 0; this->eyesVulnerable = 0xFF; SoundReq(SFX_BOSS_HIT); @@ -424,7 +424,7 @@ void GyorgFemale_ProcessEyeHit(GyorgFemaleEntity* this) { sub_080467DC(this); } } - if (super->actionDelay != 0 && this->eyesVulnerable != 0xFF && --super->actionDelay == 0) { + if (super->timer != 0 && this->eyesVulnerable != 0xFF && --super->timer == 0) { Entity* tmp; this->unk_80 |= this->eyesHit; this->eyesHit = 0; diff --git a/src/enemy/gyorgFemaleEye.c b/src/enemy/gyorgFemaleEye.c index 6ddb4f65..5033fdff 100644 --- a/src/enemy/gyorgFemaleEye.c +++ b/src/enemy/gyorgFemaleEye.c @@ -71,13 +71,13 @@ void GyorgFemaleEye_OnCollision(GyorgFemaleEyeEntity* this) { #endif parent->eyesHitFrame |= (1 << super->type); #ifndef EU - switch (super->bitfield & 0x7F) { + switch (super->contactFlags & 0x7F) { case 4 ... 6: case 8 ... 13: case 16 ... 18: case 24 ... 26: #endif - (*(((GyorgHeap**)&parent->base.myHeap)))->unk_18[super->type] = super->field_0x4c; + (*(((GyorgHeap**)&parent->base.myHeap)))->unk_18[super->type] = super->contactedEntity; (*(((GyorgHeap**)&parent->base.myHeap)))->reflectFxPos.HALF.x = (gPlayerEntity.x.HALF.HI + super->x.HALF.HI) / 2; (*(((GyorgHeap**)&parent->base.myHeap)))->reflectFxPos.HALF.y = diff --git a/src/enemy/gyorgMale.c b/src/enemy/gyorgMale.c index 8e6365da..975424f7 100644 --- a/src/enemy/gyorgMale.c +++ b/src/enemy/gyorgMale.c @@ -132,7 +132,7 @@ void sub_08046898(GyorgMaleEntity* this) { super->spriteSettings.draw = 1; super->spriteOrientation.flipY = 2; super->spriteRendering.b3 = 2; - super->field_0x3c |= 0x10; + super->collisionFlags |= 0x10; super->collisionLayer = 2; this->unk_7c = 0; this->unk_78 = 0; @@ -163,7 +163,7 @@ void sub_08046930(GyorgMaleEntity* this) { if (this->unk_7c == 0) return; super->subAction = 1; - super->actionDelay = 1; + super->timer = 1; super->animationState = 0; super->direction = 0; #ifdef EU @@ -185,13 +185,13 @@ void sub_0804696C(GyorgMaleEntity* this) { SoundReq(BGM_BOSS_THEME); #endif } - if (super->actionDelay) { + if (super->timer) { #ifdef EU if (gRoomControls.origin_y + 0x210 > super->y.HALF.HI) { #else if (gRoomControls.origin_y + 0x258 > super->y.HALF.HI) { #endif - super->actionDelay = 0; + super->timer = 0; SoundReq(SFX_APPARATE); } } @@ -392,8 +392,8 @@ void sub_08046E68(GyorgMaleEntity* this) { sub_08047EA4(this, ((0x100 - super->direction) & 0xFF) << 8); } else { super->subAction = 4; - super->actionDelay = 0x3F; - super->field_0xf = 1; + super->timer = 0x3F; + super->subtimer = 1; super->direction = (gUnk_080D1B70[Random() & 1] + tmp) & 0xC0; sub_08047D88(this); } @@ -403,14 +403,14 @@ const u16 gUnk_080D1B74[0x10] = { 0x20, 0x40, 0x60, 0x80, 0xA0, 0xC0, 0xE0, 0x1 0x100, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20 }; void sub_08046EF4(GyorgMaleEntity* this) { - if (--super->actionDelay == 0) { - super->actionDelay = 0x7F; + if (--super->timer == 0) { + super->timer = 0x7F; super->direction ^= 0x80; } - super->speed = gUnk_080D1B74[(super->actionDelay >> 3) & 0xF]; - if (--super->field_0xf == 0) { + super->speed = gUnk_080D1B74[(super->timer >> 3) & 0xF]; + if (--super->subtimer == 0) { Entity* tmp; - super->field_0xf = (Random() & 0x38) + 0x78; + super->subtimer = (Random() & 0x38) + 0x78; tmp = CreateProjectile(GYORG_MALE_ENERGY_PROJECTILE); if (tmp) { tmp->collisionLayer = 2; @@ -926,8 +926,8 @@ void sub_08047B84(GyorgMaleEntity* this) { void sub_08047BA4(GyorgMaleEntity* this) { super->subAction = 1; - super->actionDelay = 0x78; - super->field_0xf = 0; + super->timer = 0x78; + super->subtimer = 0; if (gRoomControls.origin_x + 0x200 < super->x.HALF.HI) { this->unk_76 = 0x78; } else { @@ -941,11 +941,11 @@ const s8 gUnk_080D1C00[4] = { 0x40, -0x40, -0x40, 0x40 }; void sub_08047BF0(GyorgMaleEntity* this) { Entity* tmp; - super->direction = gUnk_080D1C00[super->actionDelay & 3]; + super->direction = gUnk_080D1C00[super->timer & 3]; super->speed = 0x100; sub_08047E48(this); - if (super->actionDelay == 0) { - if ((super->field_0xf++ & 0xF) == 0) { + if (super->timer == 0) { + if ((super->subtimer++ & 0xF) == 0) { tmp = CreateFx(super, FX_GIANT_EXPLOSION4, 0); if (tmp) { u32 rand = Random(); @@ -967,18 +967,18 @@ void sub_08047BF0(GyorgMaleEntity* this) { InitAnimationForceUpdate(super, 1); } } else { - super->actionDelay--; - if (super->actionDelay == 0x5A) { + super->timer--; + if (super->timer == 0x5A) { tmp = super->child; tmp->spriteSettings.draw = 0; CreateFx(tmp, FX_GIANT_EXPLOSION4, 0); } else { - if (super->actionDelay == 0x3C) { + if (super->timer == 0x3C) { tmp = super->child->child; tmp->spriteSettings.draw = 0; CreateFx(tmp, FX_GIANT_EXPLOSION4, 0); } else { - if (super->actionDelay == 0x1E) { + if (super->timer == 0x1E) { 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 4e9128f3..b4bd94a7 100644 --- a/src/enemy/gyorgMaleEye.c +++ b/src/enemy/gyorgMaleEye.c @@ -82,13 +82,13 @@ void GyorgMaleEye_Action1(GyorgMaleEyeEntity* this) { if ((super->frame & ANIM_DONE) != 0) { super->action = 2; super->flags |= 0x80; - super->actionDelay = 0x2d; + super->timer = 0x2d; } } void GyorgMaleEye_Action2(GyorgMaleEyeEntity* this) { sub_08048F50(this); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 3; super->flags &= 0x7f; InitializeAnimation(super, super->animIndex + 4); diff --git a/src/enemy/hangingSeed.c b/src/enemy/hangingSeed.c index 51b119c7..3c6dbdab 100644 --- a/src/enemy/hangingSeed.c +++ b/src/enemy/hangingSeed.c @@ -21,7 +21,7 @@ void HangingSeed_OnTick(Entity* this) { } void HangingSeed_OnCollision(Entity* this) { - if (this->bitfield & 0x80) { + if (this->contactFlags & 0x80) { CreateFx(this, FX_BUSH, 0x80); DeleteThisEntity(); } diff --git a/src/enemy/helmasaur.c b/src/enemy/helmasaur.c index 731e24bb..609a4b07 100644 --- a/src/enemy/helmasaur.c +++ b/src/enemy/helmasaur.c @@ -47,7 +47,7 @@ void Helmasaur_OnTick(Entity* this) { void Helmasaur_OnCollision(Entity* this) { if (this->hitType != 0x19) { - switch (this->bitfield & 0x7f) { + switch (this->contactFlags & 0x7f) { case 0: case 2: case 3: @@ -78,7 +78,7 @@ void Helmasaur_OnGrabbed(Entity* this) { void sub_0802BC74(Entity* this) { sub_0802C1C0(this); this->subAction = 1; - this->field_0x1d = 60; + this->gustJarTolerance = 60; this->animationState = AnimationStateFlip90(gPlayerEntity.animationState >> 1); InitializeAnimation(this, this->animationState); } @@ -92,11 +92,11 @@ void sub_0802BCA8(Entity* this) { Entity* ent; this->action = 7; - this->actionDelay = 90; + this->timer = 90; this->zVelocity = Q_16_16(1.5); this->hitType = 0x19; - this->field_0x3a = this->field_0x3a & 0xfb; - this->field_0x1c = 0x12; + this->gustJarState = this->gustJarState & 0xfb; + this->gustJarFlags = 0x12; ent = CreateEnemy(HELMASAUR, 1); if (ent != NULL) { ent->animationState = this->animationState; @@ -108,7 +108,7 @@ void sub_0802BCA8(Entity* this) { void sub_0802BCFC(Entity* this) { this->subAction = 1; - this->field_0x1d = 60; + this->gustJarTolerance = 60; } void sub_0802BD08(Entity* this) { @@ -127,7 +127,7 @@ void nullsub_145(Entity* this) { void sub_0802BD28(Entity* this) { if (this->flags & ENT_COLLIDE) { COLLISION_ON(this); - this->field_0x3a &= ~0x4; + this->gustJarState &= ~0x4; } else { this->health = 0; } @@ -137,7 +137,7 @@ void sub_0802BD54(Entity* this) { sub_0804A720(this); this->action = 1; this->field_0x78.HALF.LO = Random(); - this->field_0x1d = 60; + this->gustJarTolerance = 60; this->field_0x78.HALF.HI = 0xff; this->direction = DirectionRound(Random()); this->animationState = this->direction >> 3; @@ -145,8 +145,8 @@ void sub_0802BD54(Entity* this) { } void sub_0802BD8C(Entity* this) { - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else { u32 direction; @@ -168,20 +168,20 @@ void sub_0802BD8C(Entity* this) { void sub_0802BDE0(Entity* this) { if (sub_0802C06C(this)) { this->action = 3; - this->actionDelay = 60; + this->timer = 60; this->field_0x78.HALF.HI = 0xff; } else { this->action = 1; - this->actionDelay = (Random() & 0xf) + 0xf; + this->timer = (Random() & 0xf) + 0xf; this->field_0x78.HALF.HI = this->direction; } } void sub_0802BE18(Entity* this) { UpdateAnimationVariableFrames(this, 2); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 4; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->speed = 0x300; } else { sub_0802C18C(this); @@ -212,7 +212,7 @@ void sub_0802BE80(Entity* this) { sub_0802C18C(this); } else { sub_0802C1C0(this); - this->actionDelay += 30; + this->timer += 30; } } @@ -226,15 +226,15 @@ void sub_0802BEBC(Entity* this) { } void sub_0802BEEC(Entity* this) { - if (this->actionDelay) { - if ((--this->actionDelay & 0x1f) == 0) { + if (this->timer) { + if ((--this->timer & 0x1f) == 0) { this->animationState ^= 2; this->direction = this->animationState << 3; InitializeAnimation(this, this->animationState + 4); } } else if (!GravityUpdate(this, Q_16_16(0.109375))) { this->action = 8; - this->actionDelay = 30; + this->timer = 30; this->speed = 0x120; } } @@ -242,10 +242,10 @@ void sub_0802BEEC(Entity* this) { void sub_0802BF3C(Entity* this) { ProcessMovement0(this); GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { u32 sprite; - this->actionDelay = 30; + this->timer = 30; this->direction = sub_0802C020(this); sprite = this->direction >> 3; if (sprite != this->animationState) { @@ -258,7 +258,7 @@ void sub_0802BF3C(Entity* this) { void sub_0802BF78(Entity* this) { this->action = 1; this->flags2 = 4; - this->field_0x1c = 1; + this->gustJarFlags = 1; this->direction = this->animationState << 3; InitializeAnimation(this, this->animationState + 8); } @@ -268,7 +268,7 @@ void sub_0802BF98(Entity* this) { gUnk_080CD450[this->subAction](this); } else { this->action = 2; - this->actionDelay = 30; + this->timer = 30; COLLISION_OFF(this); } } @@ -289,7 +289,7 @@ void sub_0802BFE0(Entity* this) { void sub_0802BFF4(Entity* this) { this->spriteSettings.draw ^= 1; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteEntity(this); } } @@ -332,7 +332,7 @@ bool32 sub_0802C06C(Entity* this) { bool32 sub_0806FC24(u32, u32); bool32 sub_0802C0E8(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { return TRUE; } else { const s8* ptr = &gUnk_080CD45C[this->direction >> 2]; @@ -364,7 +364,7 @@ void sub_0802C18C(Entity* this) { void sub_0802C1C0(Entity* this) { this->action = 1; - this->actionDelay = 30; + this->timer = 30; } void sub_0802C1CC(Entity* this) { diff --git a/src/enemy/keaton.c b/src/enemy/keaton.c index 09564cd3..a7548f9a 100644 --- a/src/enemy/keaton.c +++ b/src/enemy/keaton.c @@ -42,10 +42,10 @@ void Keaton_OnCollision(Entity* this) { if (this->action != 3 && this->action != 4) { this->action = 3; - this->actionDelay = 0xC; + this->timer = 0xC; this->direction = DirectionTurnAround(DirectionRoundUp(this->knockbackDirection)); InitAnimationForceUpdate(this, this->direction >> 3); - } else if (this->bitfield == 0xCC) { + } else if (this->contactFlags == 0xCC) { if (this->confusedTime == 0) { sub_0803275C(this); } @@ -70,12 +70,12 @@ void sub_08032468(Entity* this) { void sub_0803248C(Entity* this) { if (sub_080325E8(this) == 0) { if (sub_0803271C(this) == 0) { - this->actionDelay--; - if (this->actionDelay == 0) { + this->timer--; + if (this->timer == 0) { sub_08032650(this); } if (ProcessMovement0(this) == 0) { - this->actionDelay = 1; + this->timer = 1; } UpdateAnimationSingleFrame(this); } @@ -93,10 +93,10 @@ void sub_080324CC(Entity* this) { } void sub_080324FC(Entity* this) { - if (this->actionDelay != 0) { - this->actionDelay--; - if (this->actionDelay == 0) { - this->field_0xf = 0x1E; + if (this->timer != 0) { + this->timer--; + if (this->timer == 0) { + this->subtimer = 0x1E; this->animationState = this->direction / 8; InitAnimationForceUpdate(this, this->animationState + 4); } else { @@ -105,8 +105,8 @@ void sub_080324FC(Entity* this) { } UpdateAnimationSingleFrame(this); UpdateAnimationSingleFrame(this); - this->field_0xf--; - if (this->field_0xf == 0) { + this->subtimer--; + if (this->subtimer == 0) { this->action = 4; this->speed = 0x1E0; this->field_0x76.HWORD = 0x46; @@ -114,14 +114,14 @@ void sub_080324FC(Entity* this) { *(((u8*)&this->field_0x7a) + 1) = 0; sub_080327C8(this); } else { - if ((this->field_0xf & 0x3) == 0) { + if ((this->subtimer & 0x3) == 0) { sub_08032794(this); } } } void sub_08032574(Entity* this) { - if (this->child && (this->child->bitfield & 0x80)) { + if (this->child && (this->child->contactFlags & 0x80)) { sub_0803275C(this); return; } @@ -138,8 +138,8 @@ void sub_08032574(Entity* this) { } void sub_080325C4(Entity* this) { - this->actionDelay--; - if ((this->actionDelay == 0) && (sub_080325E8(this) == 0)) { + this->timer--; + if ((this->timer == 0) && (sub_080325E8(this) == 0)) { sub_08032784(this); } } @@ -149,7 +149,7 @@ u32 sub_080325E8(Entity* this) { (EntityInRectRadius(this, gUnk_020000B0, 0x68, 0x40) != 0)) { if (((GetFacingDirection(this, gUnk_020000B0) - (DirectionRound(this->frame)) + 2) & 0x1F) < 5) { this->action = 3; - this->actionDelay = 0xC; + this->timer = 0xC; this->direction = DirectionRound(this->frame); return 1; } @@ -161,7 +161,7 @@ void sub_08032650(Entity* this) { u32 uVar3; uVar3 = Random(); - this->actionDelay = gUnk_080CE7E0[uVar3 & 0xf]; + this->timer = gUnk_080CE7E0[uVar3 & 0xf]; if (!((sub_08049FA0(this) == 0) && ((uVar3 >> 8 & 1) == 0))) { this->direction = DirectionRound(uVar3 >> 0x10); } else { @@ -210,7 +210,7 @@ void sub_08032740(Entity* this) { void sub_0803275C(Entity* this) { this->action = 5; - this->actionDelay = 0x2D; + this->timer = 0x2D; 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 bbc2bac6..424432a5 100644 --- a/src/enemy/keese.c +++ b/src/enemy/keese.c @@ -64,7 +64,7 @@ void Keese_Initialize(Entity* this) { this->z.HALF.HI = -0x10; } this->direction = Random() & 0x1f; - this->field_0x1c = 1; + this->gustJarFlags = 1; this->spritePriority.b0 = 3; this->collisionLayer = 3; UpdateSpriteForCollisionLayer(this); @@ -88,14 +88,14 @@ void Keese_Fly(Entity* this) { } void Keese_Rest(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { Keese_StartFly(this); } } void Keese_Sleep(Entity* this) { - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { if (EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70)) Keese_StartFly(this); @@ -112,12 +112,12 @@ void Keese_StartFly(Entity* this) { void sub_08021F24(Entity* this) { if (this->field_0x78.HWORD == 0) { this->action = 2; - this->actionDelay = gKeeseRestDurations[Random() & 0xf]; + 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->actionDelay = 30; + this->timer = 30; InitializeAnimation(this, KeeseAnimation_Rest); } else { if (sub_08049FA0(this) != 0) { diff --git a/src/enemy/lakitu.c b/src/enemy/lakitu.c index 971ffd09..a4c2e6a0 100644 --- a/src/enemy/lakitu.c +++ b/src/enemy/lakitu.c @@ -58,7 +58,7 @@ void Lakitu_OnTick(Entity* this) { } void Lakitu_OnCollision(Entity* this) { - if ((this->bitfield & 0x7f) == 0x1d) { + if ((this->contactFlags & 0x7f) == 0x1d) { this->zVelocity = Q_16_16(2.0); sub_0803CBAC(this); @@ -102,7 +102,7 @@ void Lakitu_OnGrabbed(Entity* this) { void sub_0803C844(Entity* this) { this->subAction = 1; - this->field_0x1d = 0x3c; + this->gustJarTolerance = 0x3c; } void sub_0803C850(Entity* this) { @@ -154,7 +154,7 @@ void Lakitu_EndHide(Entity* this) { if (this->frame & ANIM_DONE) { this->action = IDLE; - this->actionDelay = 0x3c; + this->timer = 0x3c; this->hitType = 0x42; @@ -201,11 +201,11 @@ void Lakitu_Lightning(Entity* this) { this->hitType = 0x42; if ((Random() & 1) && !this->field_0x78.HALF.HI) { - this->actionDelay = 0xf; + this->timer = 0xf; this->field_0x78.HALF.HI = TRUE; } else { - this->actionDelay = 0x1e; + this->timer = 0x1e; this->field_0x78.HALF.HI = FALSE; @@ -214,9 +214,9 @@ void Lakitu_Lightning(Entity* this) { } void Lakitu_LightningDelay(Entity* this) { - this->actionDelay--; + this->timer--; - if (this->actionDelay != 0) { + if (this->timer != 0) { return; } @@ -224,7 +224,7 @@ void Lakitu_LightningDelay(Entity* this) { sub_0803CB34(this); } else { this->action = IDLE; - this->actionDelay = 0xb4; + this->timer = 0xb4; InitAnimationForceUpdate(this, this->animationState + 4); } @@ -279,7 +279,7 @@ bool32 sub_0803CB04(Entity* this) { bool32 returnValue; u8 delay; - delay = --this->actionDelay; + delay = --this->timer; if (delay != 0) { returnValue = 0; } else { diff --git a/src/enemy/lakituCloud.c b/src/enemy/lakituCloud.c index 1c311f6c..98ee064d 100644 --- a/src/enemy/lakituCloud.c +++ b/src/enemy/lakituCloud.c @@ -45,7 +45,7 @@ void LakituCloud_OnGrabbed(Entity* this) { void sub_0803CD2C(Entity* this) { this->subAction = 1; - this->field_0x1d = 0x3c; + this->gustJarTolerance = 0x3c; } void sub_0803CD38(Entity* this) { @@ -104,9 +104,9 @@ void sub_0803CDD8(Entity* this) { one = 1; this->spriteSettings.draw = draw ^ one; - this->actionDelay--; + this->timer--; - if (this->actionDelay == 0) { + if (this->timer == 0) { this->action = 1; COLLISION_ON(this); @@ -134,11 +134,11 @@ void sub_0803CE3C(Entity* this) { CreateFx(this, FX_DEATH, 0); this->action = 2; - this->actionDelay = 60; + this->timer = 60; COLLISION_OFF(this); - this->field_0x3a &= 0xfb; + this->gustJarState &= 0xfb; this->x.HALF.HI = this->field_0x78.HWORD; this->y.HALF.HI = this->field_0x7a.HWORD; diff --git a/src/enemy/leever.c b/src/enemy/leever.c index 3e53a53a..fe7095da 100644 --- a/src/enemy/leever.c +++ b/src/enemy/leever.c @@ -42,7 +42,7 @@ void Leever_OnTick(Entity* this) { } void Leever_OnCollision(Entity* this) { - if (this->bitfield == 0x80) { + if (this->contactFlags == 0x80) { if (this->action == 3) { this->field_0x74.HWORD = 1; } @@ -65,11 +65,11 @@ void Leever_OnDeath(Entity* this) { void Leever_Initialize(Entity* this) { sub_0804A720(this); this->action = 1; - this->actionDelay = Random(); + this->timer = Random(); } void Leever_Idle(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (Leever_PlayerInRange(this, Random() & 0x1f)) { this->action = 2; this->spriteSettings.draw = TRUE; @@ -77,7 +77,7 @@ void Leever_Idle(Entity* this) { InitializeAnimation(this, LeeverAnimation_DigUp); UpdateSpriteForCollisionLayer(this); } else { - this->actionDelay = DirectionRound(Random()) + 8; + this->timer = DirectionRound(Random()) + 8; } } } @@ -115,7 +115,7 @@ void Leever_DigDown(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 1; - this->actionDelay = 0xf0; + this->timer = 0xf0; this->spriteSettings.draw = FALSE; } } @@ -170,12 +170,12 @@ void Leever_Move(Entity* this) { this->speed = (this->frame & 0xf) * 0x20; if (this->type == LeeverForm_Red) { - if ((this->field_0xf++ & 0xf) == 0) { + if ((this->subtimer++ & 0xf) == 0) { sub_08004596(this, sub_0800132C(this, gUnk_020000B0)); } } else { this->speed += 0x40; - if ((this->field_0xf++ & 0x7) == 0) { + if ((this->subtimer++ & 0x7) == 0) { sub_08004596(this, sub_0800132C(this, gUnk_020000B0)); } } diff --git a/src/enemy/likeLike.c b/src/enemy/likeLike.c index da2f06c5..bca36368 100644 --- a/src/enemy/likeLike.c +++ b/src/enemy/likeLike.c @@ -39,12 +39,12 @@ void LikeLike_OnCollision(Entity* this) { } else { if (this->action == 7) { sub_0802810C(this); - } else if (this->bitfield & 0x80) { - u8 tmp = this->bitfield & ~0x80; + } else if (this->contactFlags & 0x80) { + u8 tmp = this->contactFlags & ~0x80; if (!tmp) { this->action = 7; - this->actionDelay = 0x5f; - this->field_0xf = tmp; + this->timer = 0x5f; + this->subtimer = tmp; this->flags2 &= 0xfc; this->field_0x82.HALF.HI = gPlayerEntity.spritePriority.b1; } @@ -52,7 +52,7 @@ void LikeLike_OnCollision(Entity* this) { } if (this->health == 0) { - this->actionDelay = 0x20; + this->timer = 0x20; } if (this->confusedTime) { @@ -63,7 +63,7 @@ void LikeLike_OnCollision(Entity* this) { } void LikeLike_OnDeath(Entity* this) { - if (this->actionDelay == 2 && this->field_0x80.HALF.LO != 0xff) { + if (this->timer == 2 && this->field_0x80.HALF.LO != 0xff) { SetDefaultPriority(this, PRIO_NO_BLOCK); sub_08028224(this->field_0x80.HALF.LO); } @@ -82,18 +82,18 @@ void sub_08027E70(Entity* this) { this->action = 3; this->spriteSettings.draw = 0; COLLISION_OFF(this); - this->actionDelay = 0; + this->timer = 0; break; case 1: this->action = 1; this->spriteSettings.draw = 1; - this->actionDelay = 8; + this->timer = 8; InitializeAnimation(this, 1); break; case 2: this->action = 1; this->spriteSettings.draw = 0; - this->actionDelay = 0; + this->timer = 0; this->hitType = 1; InitializeAnimation(this, 0); break; @@ -117,10 +117,10 @@ void sub_08027EFC(Entity* this) { this->direction = this->field_0x82.HALF.LO; } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->direction = sub_08049F84(this, 1); this->field_0x82.HALF.LO = this->direction; - this->actionDelay = 8; + this->timer = 8; } ProcessMovement0(this); GetNextFrame(this); @@ -145,9 +145,9 @@ void sub_08027F84(Entity* this) { } void sub_08027FB4(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; - this->actionDelay = 1; + this->timer = 1; this->flags2 |= 1; } GetNextFrame(this); @@ -159,7 +159,7 @@ void sub_08027FE0(Entity* this) { this->action = 1; COLLISION_ON(this); this->direction = sub_08049F84(this, 1); - this->actionDelay = 8; + this->timer = 8; this->spritePriority.b1 = 1; InitializeAnimation(this, 1); } @@ -171,7 +171,7 @@ void sub_0802802C(Entity* this) { this->action = 3; this->spriteSettings.draw = 0; this->direction = 0; - this->actionDelay = 0; + this->timer = 0; CreateDust(this); } } @@ -183,12 +183,12 @@ void sub_0802805C(Entity* this) { if (sub_0807953C()) { u32 tmp2 = Random(); - u32 tmp3 = this->field_0xf + 1; + u32 tmp3 = this->subtimer + 1; tmp3 += (tmp2 & 1); - this->field_0xf = tmp3; + this->subtimer = tmp3; } - if (this->field_0xf >= 0x19 || gSave.stats.health == 0) { + if (this->subtimer >= 0x19 || gSave.stats.health == 0) { sub_0802810C(this); } else { ResetPlayerItem(); @@ -200,11 +200,11 @@ void sub_0802805C(Entity* this) { gPlayerEntity.spriteOffsetY = tmp[1]; gPlayerEntity.spritePriority.b1 = 0; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_080281A0(this); } - if ((this->actionDelay & 3) == 0) { + if ((this->timer & 3) == 0) { EnqueueSFX(SFX_PLACE_OBJ); } } @@ -222,8 +222,8 @@ 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->actionDelay = 0x50; - this->field_0xf = 0; + this->timer = 0x50; + this->subtimer = 0; this->flags2 |= 2; if (this->iframes == 0) { this->iframes = -18; @@ -232,7 +232,7 @@ NONMATCH("asm/non_matching/likeLike/sub_0802810C.inc", void sub_0802810C(Entity* END_NONMATCH void sub_080281A0(Entity* this) { - this->field_0xf = 0x19; + this->subtimer = 0x19; if (sub_080281E0(ITEM_MIRROR_SHIELD)) { this->field_0x80.HALF.LO = ITEM_MIRROR_SHIELD; MessageFromTarget(0x578); diff --git a/src/enemy/madderpillar.c b/src/enemy/madderpillar.c index 52098e08..65da7b2a 100644 --- a/src/enemy/madderpillar.c +++ b/src/enemy/madderpillar.c @@ -43,7 +43,7 @@ void Madderpillar_OnTick(Entity* this) { void Madderpillar_OnCollision(Entity* this) { if (this->action == 1) { - switch (this->bitfield & 0x7f) { + switch (this->contactFlags & 0x7f) { case 0: case 1: case 2: @@ -55,7 +55,7 @@ void Madderpillar_OnCollision(Entity* this) { break; default: this->action = 2; - this->actionDelay = 0; + this->timer = 0; this->hitType = 0x6b; this->field_0x76.HALF.HI = 0; ChangeObjPalette(this, 0x7f); @@ -69,8 +69,8 @@ void Madderpillar_OnCollision(Entity* this) { } void Madderpillar_OnDeath(Entity* this) { - if (this->field_0xf) { - this->field_0xf--; + if (this->subtimer) { + this->subtimer--; } else { GenericDeath(this); } @@ -164,13 +164,13 @@ void sub_08029AE0(Entity* this) { void sub_08029B2C(Entity* this) { if (sub_0802A14C(this)) { if (this->field_0x86.HALF.LO) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { CreateFx(this, FX_GIANT_EXPLOSION3, 0); DeleteEntity(this); } } else { COLLISION_OFF(this); - this->actionDelay = -(this->type * 15 - 90); + this->timer = -(this->type * 15 - 90); this->field_0x86.HALF.LO = 1; } } else { @@ -210,13 +210,13 @@ void sub_08029BC4(Entity* this) { void sub_08029C08(Entity* this) { this->action = 3; - this->actionDelay = gUnk_080CCDA0[this->type]; + this->timer = gUnk_080CCDA0[this->type]; this->hitType = 0x6b; this->child->action = 2; } void sub_08029C2C(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 4; ChangeObjPalette(this, 0x7f); EnqueueSFX(SFX_MENU_CANCEL); @@ -265,12 +265,12 @@ void sub_08029CF0(Entity* this) { void sub_08029D08(Entity* this) { this->action = 3; - this->actionDelay = 0x47; + this->timer = 0x47; } void sub_08029D14(Entity* this) { - if (this->actionDelay) { - if (--this->actionDelay == 0) { + if (this->timer) { + if (--this->timer == 0) { InitializeAnimation(this, this->animationState + 0xc); ChangeObjPalette(this, 0x7f); EnqueueSFX(SFX_MENU_CANCEL); @@ -279,7 +279,7 @@ void sub_08029D14(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 4; - this->actionDelay = 0x78; + this->timer = 0x78; this->hitType = 0x6c; this->hitbox = (Hitbox*)&gUnk_080FD298; EnqueueSFX(SFX_6B); @@ -289,7 +289,7 @@ void sub_08029D14(Entity* this) { void sub_08029D78(Entity* this) { sub_0802A0F8(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 5; this->hitType = 0x6a; this->hitbox = (Hitbox*)&gUnk_080FD2A0; @@ -460,7 +460,7 @@ void sub_0802A098(Entity* this) { void sub_0802A0F8(Entity* this) { if (this->health != 0) { - if ((this->bitfield & 0x80) && this->iframes != 0) { + if ((this->contactFlags & 0x80) && this->iframes != 0) { Entity* ent = this; u32 i; for (i = 0; i < 6; i++) { @@ -471,7 +471,7 @@ void sub_0802A0F8(Entity* this) { } else { this->parent->flags &= ~ENT_COLLIDE; this->parent->health = 0; - this->parent->field_0xf = 0x69; + this->parent->subtimer = 0x69; } } @@ -491,8 +491,8 @@ void sub_0802A16C(Entity* this) { } void sub_0802A18C(Entity* this) { - if (this->bitfield & 0x80) { - switch (this->bitfield & 0x7f) { + if (this->contactFlags & 0x80) { + switch (this->contactFlags & 0x7f) { case 0: case 1: case 2: diff --git a/src/enemy/mazaalBracelet.c b/src/enemy/mazaalBracelet.c index a6a273a1..1f6ff296 100644 --- a/src/enemy/mazaalBracelet.c +++ b/src/enemy/mazaalBracelet.c @@ -138,7 +138,7 @@ void MazaalBracelet_OnCollision(Entity* this) { if (this->type < 2) { if (this->action != 0x2b) { - if ((0 < this->iframes) && ((this->bitfield == 0x95 || (this->bitfield == 0x8e)))) { + if ((0 < this->iframes) && ((this->contactFlags == 0x95 || (this->contactFlags == 0x8e)))) { this->action = 0x28; COLLISION_OFF(this); ent = this->parent; @@ -219,7 +219,7 @@ void sub_0803A364(Entity* this) { s8* ptr; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; switch (this->subAction & 0x7f) { case 0: @@ -250,11 +250,11 @@ void sub_0803A364(Entity* this) { this->type2 = 0; uVar1 = 6; this->subAction = uVar1; - this->actionDelay = 0x1e; + this->timer = 0x1e; break; case 6: - this->actionDelay--; - if (this->actionDelay == 0) { + this->timer--; + if (this->timer == 0) { this->subAction = 7; InitializeAnimation(this, 5); } @@ -275,11 +275,11 @@ void sub_0803A364(Entity* this) { } uVar1 = 9; this->subAction = uVar1; - this->actionDelay = 0x1e; + this->timer = 0x1e; break; case 9: - this->actionDelay--; - if (this->actionDelay == 0) { + this->timer--; + if (this->timer == 0) { this->subAction = 10; InitAnimationForceUpdate(this->child, 6); } @@ -300,16 +300,16 @@ void sub_0803A364(Entity* this) { if (this->type2 != 0) { uVar1 = 0xc; this->subAction = uVar1; - this->actionDelay = 0x1e; + this->timer = 0x1e; } else { this->type2 = 1; this->subAction = 6; - this->actionDelay = 10; + this->timer = 10; } break; default: - this->actionDelay--; - if (this->actionDelay == 0) { + this->timer--; + if (this->timer == 0) { COLLISION_ON(this); sub_0803B4D4(this); } @@ -324,7 +324,7 @@ void sub_0803A548(Entity* this) { sub_0803B5C0(this); UpdateAnimationSingleFrame(this); ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B4E4(this) == 0) { LinearMoveUpdate(this); @@ -336,7 +336,7 @@ void sub_0803A58C(Entity* this) { s8* ptr; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B4E4(this) != 0) { sub_0803B59C(this); @@ -352,7 +352,7 @@ void sub_0803A5D0(Entity* this) { this->action = 5; COLLISION_OFF(this); ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; InitializeAnimation(this, 5); } @@ -362,7 +362,7 @@ void sub_0803A60C(Entity* this) { s8* ptr; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); if ((this->frame & ANIM_DONE) != 0) { @@ -385,7 +385,7 @@ void sub_0803A660(Entity* this) { this->z.HALF.HI = this->z.HALF.HI - 2; } else { this->action = 7; - this->actionDelay = 0; + this->timer = 0; uVar2 = GetFacingDirection(this, &gPlayerEntity); this->direction = (u8)uVar2; this->speed = 0x280; @@ -397,7 +397,7 @@ void sub_0803A660(Entity* this) { SoundReq(SFX_157); } ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; } } @@ -407,7 +407,7 @@ void sub_0803A6E8(Entity* this) { if (sub_0803B610(this)) { this->action = 8; - this->actionDelay = 10; + this->timer = 10; } else { sub_0803B63C(this); LinearMoveUpdate(this); @@ -419,7 +419,7 @@ void sub_0803A6E8(Entity* this) { } void sub_0803A720(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 9; sub_0803B8E8(this, 0x16); } @@ -433,7 +433,7 @@ void sub_0803A740(Entity* this) { if (-1 < height * 0x10000) { this->z.HALF.HI = 0; this->action = 10; - this->actionDelay = 10; + this->timer = 10; this->parent->field_0x7c.BYTES.byte1 |= 0x40; sub_0803B8E8(this, 0x13); InitScreenShake(10, 0); @@ -442,7 +442,7 @@ void sub_0803A740(Entity* this) { } void sub_0803A780(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (--this->field_0x7c.BYTES.byte0) { this->action = 6; } else { @@ -464,7 +464,7 @@ void sub_0803A7CC(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B4E4(this)) { this->action = 0xd; @@ -479,7 +479,7 @@ void sub_0803A814(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; sub_0803B55C(this); if ((this->child->frame & ANIM_DONE) != 0) { @@ -494,7 +494,7 @@ void sub_0803A86C(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); if ((this->frame & ANIM_DONE) != 0) { @@ -508,12 +508,12 @@ void sub_0803A8B8(Entity* this) { u32 index; this->action = 0x10; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->direction = 0; this->speed = 0x80; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; InitializeAnimation(this, 6); InitAnimationForceUpdate(this->child, 1); @@ -525,13 +525,13 @@ void sub_0803A90C(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); sub_0803B55C(this); LinearMoveUpdate(this); - this->actionDelay--; - if (this->actionDelay == 0) { + this->timer--; + if (this->timer == 0) { this->action = 0x11; this->direction = this->type * 0x10 + 8; this->speed = 0x200; @@ -545,17 +545,17 @@ void sub_0803A978(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); sub_0803B55C(this); - if ((++this->actionDelay & 3) == 0) { + if ((++this->timer & 3) == 0) { sub_08004596(this, 0x10); } LinearMoveUpdate(this); if (this->direction == 0x10) { this->action = 0x12; - this->actionDelay = 3; + this->timer = 3; COLLISION_OFF(this); *(u8*)(*(int*)&this->field_0x74 + 0x10) &= 0x7f; InitializeAnimation(this, 8); @@ -569,11 +569,11 @@ void sub_0803AA00(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B870(this) == 0) { direction = (this->type ^ 1) * 0x10 + 8; - if ((++this->actionDelay & 3) == 0) { + if ((++this->timer & 3) == 0) { sub_08004596(this, direction); } LinearMoveUpdate(this); @@ -592,7 +592,7 @@ void sub_0803AA98(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B870(this) == 0) { LinearMoveUpdate(this); @@ -615,13 +615,13 @@ void sub_0803AB10(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; LinearMoveUpdate(this); sub_0803B55C(this); if ((this->child->frame & ANIM_DONE) != 0) { this->action = 0x15; - this->actionDelay = 0xf; + this->timer = 0xf; } } @@ -630,9 +630,9 @@ void sub_0803AB5C(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 0x16; this->spriteSettings.draw = 1; InitializeAnimation(this, 0xb); @@ -645,7 +645,7 @@ void sub_0803ABB4(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); sub_0803B55C(this); @@ -663,7 +663,7 @@ void sub_0803AC1C(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B4E4(this)) { sub_0803B59C(this); @@ -677,19 +677,19 @@ void sub_0803AC60(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); - if (!this->actionDelay) { + if (!this->timer) { if (sub_0803B4E4(this) != 0) { this->action = 0x19; this->subAction = 0; - this->actionDelay = 0x1e; + this->timer = 0x1e; } else { LinearMoveUpdate(this); } } else { - this->actionDelay = this->actionDelay - 1; + this->timer = this->timer - 1; } sub_0803B824(this); } @@ -699,7 +699,7 @@ void sub_0803ACC0(Entity* this) { switch (this->subAction) { default: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 1; } break; @@ -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->actionDelay = 0xc; + this->timer = 0xc; this->subAction = 3; InitScreenShake(8, 0); SoundReq(SFX_158); @@ -720,7 +720,7 @@ void sub_0803ACC0(Entity* this) { } break; case 3: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 4; } break; @@ -735,7 +735,7 @@ void sub_0803ACC0(Entity* this) { if (-1 < (uVar2 * 0x10000)) { this->z.HALF.HI = 0; this->action = 0x1a; - this->actionDelay = 0x3c; + this->timer = 0x3c; InitScreenShake(0x1e, 0); SoundReq(SFX_158); sub_0803B804(this); @@ -747,7 +747,7 @@ void sub_0803ACC0(Entity* this) { } void sub_0803ADAC(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 0x16; this->spriteSettings.draw = 1; (*(Entity**)&this->field_0x74)->flags |= ENT_COLLIDE; @@ -764,13 +764,13 @@ void sub_0803ADF4(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; UpdateAnimationSingleFrame(this); GetNextFrame(this); if ((this->frame & ANIM_DONE) != 0) { this->action = 0x1c; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->spriteSettings.draw = 0; } } @@ -780,10 +780,10 @@ void sub_0803AE48(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; UpdateAnimationSingleFrame(this); - if (((this->actionDelay == 0) || (--this->actionDelay == 0)) && ((this->parent->field_0x7c.BYTES.byte1 & 3) != 0)) { + if (((this->timer == 0) || (--this->timer == 0)) && ((this->parent->field_0x7c.BYTES.byte1 & 3) != 0)) { this->action = 0x1d; this->spriteSettings.draw = 1; InitializeAnimation(this, 4); @@ -799,7 +799,7 @@ void sub_0803AEC4(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; UpdateAnimationSingleFrame(this); GetNextFrame(this); @@ -813,7 +813,7 @@ void sub_0803AF18(Entity* this) { this->action = 0x1f; COLLISION_OFF(this); InitializeAnimation(this, 5); - this->z.HALF.HI = gUnk_080CED6C[(this->parent->field_0xf >> 4) & 7] + 4; + this->z.HALF.HI = gUnk_080CED6C[(this->parent->subtimer >> 4) & 7] + 4; } void sub_0803AF50(Entity* this) { @@ -829,25 +829,25 @@ void sub_0803AF7C(Entity* this) { sub_0803B55C(this); if ((this->child->frame & ANIM_DONE) != 0) { this->action = 0x21; - this->actionDelay = 0xf; + this->timer = 0xf; } } void sub_0803AF9C(Entity* this) { - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { if (-0x20 < this->z.HALF.HI) { this->z.HALF.HI -= 2; } else { this->action = 0x22; - this->actionDelay = 10; + this->timer = 10; } } } void sub_0803AFC8(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 0x23; } } @@ -857,7 +857,7 @@ void sub_0803AFE0(Entity* this) { this->z.HALF.HI += 4; } else { this->action = 0x24; - this->actionDelay = 0xf0; + this->timer = 0xf0; *(u8*)&this->cutsceneBeh = 3; this->z.HALF.HI = 0; InitScreenShake(0xa0, 0); @@ -866,10 +866,10 @@ void sub_0803AFE0(Entity* this) { } void sub_0803B01C(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 0x25; } else { - if ((0x46 < this->actionDelay) && ((this->actionDelay & 0xf) == 0)) { + if ((0x46 < this->timer) && ((this->timer & 0xf) == 0)) { sub_0803B724(this); } } @@ -889,7 +889,7 @@ void sub_0803B074(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; sub_0803B55C(this); if ((this->child->frame & ANIM_DONE) != 0) { @@ -968,7 +968,7 @@ void sub_0803B1B8(Entity* this) { } temp = CreateObject(GROUND_ITEM, 0x5e, 0); if (temp != (Entity*)0x0) { - temp->actionDelay = 0; + temp->timer = 0; temp->direction = 0x90; PositionRelative(this, temp, Q_16_16(this->hitbox->offset_x), Q_16_16(this->hitbox->offset_y)); } @@ -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->actionDelay = 0x78; + temp->timer = 0x78; 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->actionDelay = 0xf; + this->timer = 0xf; } } @@ -1030,9 +1030,9 @@ void sub_0803B35C(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 0x30; } } @@ -1042,7 +1042,7 @@ void sub_0803B398(Entity* this) { u32 index; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; if (sub_0803B4E4(this) != 0) { this->action = 0x31; @@ -1061,7 +1061,7 @@ void sub_0803B3F4(Entity* this) { Entity* temp; ptr = gUnk_080CED6C; - index = ((this->parent->field_0xf >> 4) + 3); + index = ((this->parent->subtimer >> 4) + 3); this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4; GetNextFrame(this); if ((this->frame & ANIM_DONE) != 0) { @@ -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->actionDelay++ >= 0xb5) { + if (this->timer++ >= 0xb5) { 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)); @@ -1208,7 +1208,7 @@ void sub_0803B724(Entity* param_1) { u32 random_value; u8 temp; - if (((param_1->field_0xf < 3) && (param_1->cutsceneBeh.HALF.LO != 0)) && + if (((param_1->subtimer < 3) && (param_1->cutsceneBeh.HALF.LO != 0)) && (pEVar1 = CreateEnemy(BEETLE, 1), pEVar1 != (Entity*)0x0)) { pEVar1->type2 = 1; random_value = Random(); @@ -1217,7 +1217,7 @@ void sub_0803B724(Entity* param_1) { pEVar1->y.HALF.HI = ((random_value >> 0x10) & 7) * 10 + 0x5c + gRoomControls.origin_y; pEVar1->parent = param_1; ResolveCollisionLayer(pEVar1); - param_1->field_0xf++; + param_1->subtimer++; param_1->cutsceneBeh.HALF.LO--; } } @@ -1255,9 +1255,9 @@ u32 sub_0803B870(Entity* this) { Entity* entity; entity = this->child; - if ((entity->bitfield & 0x80) != 0 && (gPlayerState.flags & PL_CAPTURED)) { + if ((entity->contactFlags & 0x80) != 0 && (gPlayerState.flags & PL_CAPTURED)) { this->action = 0x18; - this->actionDelay = 0x44; + this->timer = 0x44; this->spriteSettings.draw = 0; gPlayerEntity.flags &= ~ENT_COLLIDE; gPlayerEntity.iframes = -0x10; @@ -1305,24 +1305,24 @@ void sub_0803B978(Entity* this) { return; case 1: this->subAction = 2; - this->actionDelay = 2; - this->field_0xf = 0x1e; + this->timer = 2; + this->subtimer = 0x1e; this->field_0x74.HALF.LO = 0; SoundReq(SFX_1A9); case 2: - sub_0803BA8C(this, this->field_0xf); + sub_0803BA8C(this, this->subtimer); if ((this->field_0x74.HALF.HI | this->field_0x74.HALF.LO) == 0) { SoundReq(SFX_1A9); } if (this->field_0x74.HALF.LO != 0) { return; } - if (--this->actionDelay != 0) { + if (--this->timer != 0) { return; } - this->actionDelay = 2; - this->field_0xf -= 4; - if (this->field_0xf != 10) { + this->timer = 2; + this->subtimer -= 4; + if (this->subtimer != 10) { return; } this->parent->parent->subAction = 3; diff --git a/src/enemy/mazaalHead.c b/src/enemy/mazaalHead.c index feee0839..8b8432b3 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->actionDelay = 0xfc; + this->timer = 0xfc; 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->actionDelay = 0x1e; + this->timer = 0x1e; entity = *(Entity**)&(*(Entity**)&this->field_0x74)->field_0x74; entity->subAction = 1; entity = *(Entity**)&(*(Entity**)&this->field_0x78)->field_0x74; @@ -178,7 +178,7 @@ void sub_08033FFC(Entity* this) { UnloadOBJPalette(this); break; case 3: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 4; } break; @@ -191,7 +191,7 @@ void sub_08033FFC(Entity* this) { break; case 6: this->subAction = 7; - this->actionDelay = 0; + this->timer = 0; entity = *(Entity**)&this->field_0x74; entity->subAction = 1; entity = *(Entity**)&entity->field_0x74; @@ -204,9 +204,9 @@ void sub_08033FFC(Entity* this) { gScreen.controls.alphaBlend = 0x1000; break; case 7: - temp = ++this->actionDelay >> 1; + temp = ++this->timer >> 1; gScreen.controls.alphaBlend = (temp) | (0x10 - (temp)) * 0x100; - if (0x1f < (this->actionDelay & 0xff)) { + if (0x1f < (this->timer & 0xff)) { this->subAction = 8; entity = *(Entity**)&this->field_0x74; entity->subAction = 3; @@ -259,7 +259,7 @@ void sub_080341B8(Entity* this) { } void sub_080341D0(Entity* this) { - if (((this->field_0x80.HALF.LO & 3) != 3) && (--this->actionDelay == 0)) { + if (((this->field_0x80.HALF.LO & 3) != 3) && (--this->timer == 0)) { sub_0803443C(this); } } @@ -313,11 +313,11 @@ void sub_080342B4(Entity* this) { } void sub_080342C8(Entity* this) { - if (this->actionDelay != 0) { - if (--this->actionDelay == 0) { + if (this->timer != 0) { + if (--this->timer == 0) { SoundReq(SFX_115); } - this->spriteOffsetX = gUnk_080CECEC[this->actionDelay >> 1 & 7]; + this->spriteOffsetX = gUnk_080CECEC[this->timer >> 1 & 7]; } else { this->spriteOffsetX = 0; if (GravityUpdate(this, 0x2000) == 0) { @@ -350,17 +350,17 @@ void sub_0803438C(Entity* this) { Entity* pEVar3; const s8* pVar; - if (this->actionDelay == 0) { + if (this->timer == 0) { this->health = 0; } else { - this->actionDelay--; - if (this->actionDelay > 0xc0) { - this->spriteOffsetX = gUnk_080CED06[this->actionDelay & 3]; + this->timer--; + if (this->timer > 0xc0) { + this->spriteOffsetX = gUnk_080CED06[this->timer & 3]; } else { - if ((this->actionDelay & 0x1f) == 0) { + if ((this->timer & 0x1f) == 0) { pEVar3 = CreateFx(this, gUnk_080CED02[Random() & 3], 0); if (pEVar3 != NULL) { - pVar = &gUnk_080CECF4[this->actionDelay >> 4]; + pVar = &gUnk_080CECF4[this->timer >> 4]; pEVar3->x.HALF.HI = *pVar + pEVar3->x.HALF.HI; pVar++; pEVar3->y.HALF.HI = *pVar + pEVar3->y.HALF.HI; @@ -378,7 +378,7 @@ void sub_08034420(Entity* this) { void sub_0803442C(Entity* this, u32 unk) { this->action = 4; - this->actionDelay = unk; + this->timer = unk; this->field_0x7c.BYTES.byte1 = 3; } @@ -678,7 +678,7 @@ u32 sub_080348A4(Entity* this, Entity* hand_, u32 unk) { void sub_0803499C(Entity* this) { if (((this->field_0x80.HALF.LO & 0xc) != 0xc) && (this->field_0x80.HALF.HI != 0)) { - this->z.HALF.HI = gUnk_080CED6C[(++this->field_0xf >> 4) & 7]; + this->z.HALF.HI = gUnk_080CED6C[(++this->subtimer >> 4) & 7]; } } @@ -747,21 +747,21 @@ void sub_08034AC4(Entity* this) { void sub_08034AEC(Entity* this) { this->action = 1; - this->actionDelay = 0x1e; + this->timer = 0x1e; InitializeAnimation(this, this->type + 1); SoundReq(SFX_151); } void sub_08034B0C(Entity* this) { - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { GetNextFrame(this); if ((this->frame & ANIM_DONE) == 0) { return; } this->action = 2; - this->actionDelay = 0x50; + this->timer = 0x50; } } @@ -769,7 +769,7 @@ void sub_08034B38(Entity* this) { Entity* target; const s8* ptr; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; InitializeAnimation(this, this->type + 3); } else { @@ -777,9 +777,9 @@ void sub_08034B38(Entity* this) { if (target != NULL) { target->type = this->type - 2; if (target->type == 0) { - target->direction = 0xa8 - this->actionDelay; + target->direction = 0xa8 - this->timer; } else { - target->direction = this->actionDelay + 0x58; + target->direction = this->timer + 0x58; } ptr = &gUnk_080CED84[target->type * 2]; PositionRelative(this, target, Q_16_16(*(ptr++)), Q_16_16(*ptr)); diff --git a/src/enemy/mazaalMacro.c b/src/enemy/mazaalMacro.c index 24cca8a9..4dbf53d6 100644 --- a/src/enemy/mazaalMacro.c +++ b/src/enemy/mazaalMacro.c @@ -79,7 +79,7 @@ void sub_08034CC4(Entity* this) { if (sub_08035084(this) != 0) { this->action = this->type + 1; - this->field_0xf = 0; + this->subtimer = 0; this->field_0x6c.HALF.HI |= 1; this->field_0x78.HWORD = 0x4b0; sub_08034F70(this); @@ -99,7 +99,7 @@ void sub_08034D4C(Entity* this) { GetNextFrame(this); if (--this->field_0x78.HWORD == 0) { - if ((this->field_0xf < 8) && (entity = CreateEnemy(VAATI_PROJECTILE, 0), entity != (Entity*)0x0)) { + if ((this->subtimer < 8) && (entity = CreateEnemy(VAATI_PROJECTILE, 0), entity != (Entity*)0x0)) { entity->direction = (s32)Random() % 5 + 0xc; entity->x.HALF.HI = (gRoomControls.width / 2) + gRoomControls.origin_x; entity->y.HALF.HI = gRoomControls.origin_y + 8; @@ -107,7 +107,7 @@ void sub_08034D4C(Entity* this) { entity->parent = this; UpdateSpriteForCollisionLayer(entity); this->field_0x78.HWORD = 600; - this->field_0xf = this->field_0xf + 1; + this->subtimer = this->subtimer + 1; } else { this->field_0x78.HWORD = 0x78; } @@ -170,7 +170,7 @@ void sub_08034EE4(Entity* this) { u32 randomValue; Entity* entity; - if ((++this->actionDelay & 0xf) == 0) { + if ((++this->timer & 0xf) == 0) { randomValue = Random(); entity = CreateFx(this, gUnk_080CEEC8[randomValue & 3], 0); if (entity != NULL) { diff --git a/src/enemy/miniFireballGuy.c b/src/enemy/miniFireballGuy.c index 0f847151..5bc32f2b 100644 --- a/src/enemy/miniFireballGuy.c +++ b/src/enemy/miniFireballGuy.c @@ -41,7 +41,7 @@ void sub_08045618(Entity* this) { this->action = 1; this->spriteSettings.draw = 1; this->speed = 0x80; - this->field_0x3c = this->field_0x3c | 0x10; + this->collisionFlags = this->collisionFlags | 0x10; sub_0804A720(this); InitializeAnimation(this, 1); sub_08045678(this); @@ -58,10 +58,10 @@ void sub_08045654(Entity* this) { void sub_08045678(Entity* this) { this->zVelocity = Q_16_16(1.75); - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { - this->actionDelay = Random() & 3; + this->timer = Random() & 3; if ((sub_08049FA0(this) == 0) && (Random() & 3)) { this->direction = DirectionRound(sub_08049EE4(this) - 4 + (Random() & 8)); } else { diff --git a/src/enemy/miniSlime.c b/src/enemy/miniSlime.c index aba4510e..80e0666e 100644 --- a/src/enemy/miniSlime.c +++ b/src/enemy/miniSlime.c @@ -55,7 +55,7 @@ void sub_080452A4(Entity* this) { InitializeAnimation(this, 6); if (this->type2) { this->action = 2; - this->actionDelay = 1; + this->timer = 1; } else { sub_080452E4(this); } @@ -63,17 +63,17 @@ void sub_080452A4(Entity* this) { void sub_080452E4(Entity* this) { this->action = 2; - this->actionDelay = (Random() & 0x1f) + 1; + this->timer = (Random() & 0x1f) + 1; } void sub_080452FC(Entity* this) { u32 cVar2, bVar3; GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; - this->actionDelay = 1; + this->timer = 1; if (0 < this->speed) - this->actionDelay = FixedDiv(0x1000, this->speed) >> 0x8; + this->timer = FixedDiv(0x1000, this->speed) >> 0x8; if (sub_08049FA0(this) == 0 && (Random() & 3)) { cVar2 = sub_08049EE4(this); @@ -90,6 +90,6 @@ void sub_080452FC(Entity* this) { void sub_08045374(Entity* this) { ProcessMovement0(this); GetNextFrame(this); - if (--this->actionDelay == 0) + if (--this->timer == 0) this->action = 1; } diff --git a/src/enemy/moldorm.c b/src/enemy/moldorm.c index 2e7597ee..a38eec1e 100644 --- a/src/enemy/moldorm.c +++ b/src/enemy/moldorm.c @@ -40,7 +40,7 @@ void Moldorm_OnCollision(Entity* this) { this->field_0x7a.HALF.HI = 30; this->field_0x7a.HALF.LO = this->health; - this->actionDelay = 1; + this->timer = 1; this->direction = this->knockbackDirection; this->animationState = ((this->direction + 2) & 0x1c) >> 2; @@ -80,8 +80,8 @@ void sub_08022C58(Entity* this) { sub_0804A720(this); this->action = 1; - this->actionDelay = 1; - this->field_0xf = 1; + this->timer = 1; + this->subtimer = 1; COLLISION_ON(this); this->parent = this; this->child = tail0; @@ -157,7 +157,7 @@ void sub_08022F14(Entity* this) { if (sub_08049FA0(this) == 0) { u32 bVar6 = (sub_08049EE4(this) - this->direction) & 0x1f; if (8 < ((bVar6 + 4) & 0x1f)) { - this->field_0xf = 8; + this->subtimer = 8; if (bVar6 < 0x10) { this->field_0x78.HALF.LO = 1; } else { @@ -166,11 +166,11 @@ void sub_08022F14(Entity* this) { } } - if (--this->actionDelay == 0) { - this->actionDelay = 4; + if (--this->timer == 0) { + this->timer = 4; - if (--this->field_0xf == 0) { - this->field_0xf = 8; + if (--this->subtimer == 0) { + this->subtimer = 8; this->field_0x78.HALF.LO = gUnk_080CBBC4[Random() & 1]; } diff --git a/src/enemy/moldworm.c b/src/enemy/moldworm.c index 96a3ada3..8ae79c29 100644 --- a/src/enemy/moldworm.c +++ b/src/enemy/moldworm.c @@ -68,13 +68,13 @@ void Moldworm_OnTick(Entity* this) { void Moldworm_OnCollision(Entity* this) { if (this->subAction == 0xff) { this->action = 7; - this->actionDelay = 1; + this->timer = 1; this->subAction = 0; this->hitType = 0x85; this->iframes = -8; this->field_0x7c.BYTES.byte3 = 0; this->field_0x7a.HALF.HI = 0; - if (this->bitfield == 0x80 || this->bitfield == 0x9e) { + if (this->contactFlags == 0x80 || this->contactFlags == 0x9e) { this->type2 = 0; this->field_0x80.HALF.LO = 0x14; } else { @@ -137,7 +137,7 @@ void sub_080231BC(Entity* this) { ent->child = NULL; sub_0804A720(this); this->action = 6; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->parent = this; this->field_0x78.HWORD = 0x1e; this->palette.b.b0 = 5; @@ -151,7 +151,7 @@ void nullsub_136(Entity* this) { } void sub_08023288(Entity* this) { - if (sub_08049FDC(this, 1) && (this->actionDelay++ & 0xf) == 0) { + if (sub_08049FDC(this, 1) && (this->timer++ & 0xf) == 0) { u32 idx = Random() & 0x1e; u32 i; @@ -172,7 +172,7 @@ void sub_08023330(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 4; - this->actionDelay = 0x19; + this->timer = 0x19; COLLISION_ON(this); this->field_0x78.HWORD = 600; this->direction = Random() & 0x1c; @@ -201,7 +201,7 @@ void sub_08023398(Entity* this) { this->field_0x7c.BYTES.byte3 = 0; COLLISION_OFF(this); this->hitType = 0x85; - this->child->actionDelay = 1; + this->child->timer = 1; sub_08023A68(this); CreateFx(this, FX_ROCK, 0); return; @@ -213,9 +213,9 @@ void sub_08023398(Entity* this) { sub_08023AB0(this); } - if (--this->actionDelay < 3) { - if (this->actionDelay == 0) - this->actionDelay = 25; + if (--this->timer < 3) { + if (this->timer == 0) + this->timer = 25; } else { int prevX = this->x.WORD; int prevY = this->y.WORD; @@ -258,10 +258,10 @@ void sub_080234D8(Entity* this) { } void sub_0802351C(Entity* this) { - if ((this->actionDelay != 0) && ((this->type2 == 1) || (gPlayerEntity.frameIndex == 0xff))) { - this->actionDelay = 0; + if ((this->timer != 0) && ((this->type2 == 1) || (gPlayerEntity.frameIndex == 0xff))) { + this->timer = 0; this->child->action = 3; - this->child->field_0xf = this->field_0x80.HALF.LO; + this->child->subtimer = this->field_0x80.HALF.LO; InitializeAnimation(this->child, this->child->animationState + 1); InitializeAnimation(this, this->animationState); } @@ -301,7 +301,7 @@ void sub_080235D4(Entity* this) { void sub_08023604(Entity* this) { if (((u8*)&this->field_0x78)[this->parent->field_0x7c.BYTES.byte0 & 0xf] != 0x88) { this->action = 2; - this->actionDelay = 0; + this->timer = 0; COLLISION_ON(this); this->spriteSettings.draw = 1; sub_08023644(this); @@ -311,12 +311,12 @@ void sub_08023604(Entity* this) { void sub_08023644(Entity* this) { Entity* parent = this->parent; - if (parent->animIndex == 0x17 && this->actionDelay != 0 && this->x.HALF.HI == parent->x.HALF.HI && + if (parent->animIndex == 0x17 && this->timer != 0 && this->x.HALF.HI == parent->x.HALF.HI && this->y.HALF.HI == parent->y.HALF.HI) { this->action = 1; COLLISION_OFF(this); this->spriteSettings.draw = 0; - this->child->actionDelay = 1; + this->child->timer = 1; sub_080239F0(this); } @@ -331,10 +331,10 @@ void sub_08023644(Entity* this) { } void sub_080236F8(Entity* parent) { - if (--parent->field_0xf == 0) { + if (--parent->subtimer == 0) { parent->action = 2; parent->child->action = 3; - parent->child->field_0xf = parent->parent->field_0x80.HALF.LO; + parent->child->subtimer = parent->parent->field_0x80.HALF.LO; InitializeAnimation(parent->child, parent->child->animationState + 1); InitializeAnimation(parent, parent->animationState); } @@ -366,7 +366,7 @@ void sub_0802376C(Entity* this) { if (((u8*)&this->field_0x78)[parent->field_0x7c.BYTES.byte0 & 0xf] != 0x88) { this->action = 2; - this->actionDelay = 0; + this->timer = 0; COLLISION_ON(this); this->parent->field_0x7c.BYTES.byte3 = 1; sub_08023A88(this, 20); @@ -377,7 +377,7 @@ void sub_0802376C(Entity* this) { void sub_080237D8(Entity* this) { Entity* parent = this->parent; - if ((parent->animIndex == 0x17) && (this->actionDelay != 0) && (this->x.HALF.HI == parent->x.HALF.HI) && + if ((parent->animIndex == 0x17) && (this->timer != 0) && (this->x.HALF.HI == parent->x.HALF.HI) && (this->y.HALF.HI == parent->y.HALF.HI)) { this->action = 1; COLLISION_OFF(this); @@ -399,7 +399,7 @@ void sub_080237D8(Entity* this) { } void sub_08023894(Entity* this) { - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->action = 2; this->parent->field_0x7c.BYTES.byte3 = 1; InitializeAnimation(this, this->animationState); @@ -417,7 +417,7 @@ void sub_08023894(Entity* this) { } void sub_0802390C(Entity* this) { - if (this->bitfield & 0x80) { + if (this->contactFlags & 0x80) { Entity* ent = this->child; do { ent->iframes = this->iframes; @@ -425,7 +425,7 @@ void sub_0802390C(Entity* this) { } else { Entity* ent = this->child; do { - if (ent->bitfield & 0x80) { + if (ent->contactFlags & 0x80) { u8 bVar2 = 0xff - ent->health; if (bVar2 != 0) { u32 tmp; diff --git a/src/enemy/mulldozer.c b/src/enemy/mulldozer.c index 1550c4d1..adaa991a 100644 --- a/src/enemy/mulldozer.c +++ b/src/enemy/mulldozer.c @@ -59,13 +59,13 @@ void sub_08032CAC(MulldozerEntity* this) { Create0x68FX(super, 0x1c); } EnemyFunctionHandlerAfterCollision(super, Mulldozer_Functions); - if ((super->bitfield & 0x80) != 0) { - switch (super->bitfield & 0x3f) { + if ((super->contactFlags & 0x80) != 0) { + switch (super->contactFlags & 0x3f) { case 2: case 3: super->action = 6; - super->actionDelay = (super->type != 0) ? 0x5a : 200; - super->field_0xf = 2; + super->timer = (super->type != 0) ? 0x5a : 200; + super->subtimer = 2; this->unk_80 = 3; super->direction = super->knockbackDirection; super->direction += ((Random() & 0x40) != 0) ? 4 : 0x1c; @@ -74,7 +74,7 @@ void sub_08032CAC(MulldozerEntity* this) { break; default: super->action = 5; - super->field_0xf = 4; + super->subtimer = 4; sub_08033174(this); break; } @@ -82,8 +82,8 @@ void sub_08032CAC(MulldozerEntity* this) { } void sub_08032D3C(MulldozerEntity* this) { - if (--super->field_0xf == 0) { - super->field_0xf = 2; + if (--super->subtimer == 0) { + super->subtimer = 2; super->animationState = (super->animationState + 1) & 7; sub_08032F24(this); sub_080331E8(this); @@ -100,7 +100,7 @@ void Mulldozer_Init(MulldozerEntity* this) { } void Mulldozer_Action1(MulldozerEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_080330C0(this); } else { if (sub_08033364(this)) { @@ -111,16 +111,16 @@ void Mulldozer_Action1(MulldozerEntity* this) { } void Mulldozer_Action2(MulldozerEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_08033058(this); } sub_08032F48(this); } void Mulldozer_Action3(MulldozerEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 4; - super->field_0xf = 8; + super->subtimer = 8; super->speed = 0x1e0; sub_080331B4(this); if ((this->unk_82 & 0x80) != 0) { @@ -140,9 +140,9 @@ void Mulldozer_Action3(MulldozerEntity* this) { } void Mulldozer_Action4(MulldozerEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 5; - super->field_0xf = 4; + super->subtimer = 4; sub_08033174(this); } else { sub_08033000(this); @@ -152,11 +152,11 @@ void Mulldozer_Action4(MulldozerEntity* this) { } void Mulldozer_Action5(MulldozerEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_08033320(this); sub_080330C0(this); - } else if ((super->type == 0) && (--super->field_0xf == 0)) { - super->field_0xf = 4; + } else if ((super->type == 0) && (--super->subtimer == 0)) { + super->subtimer = 4; sub_080332A8(this); } sub_080331E8(this); @@ -166,15 +166,15 @@ void Mulldozer_Action5(MulldozerEntity* this) { void Mulldozer_Action6(MulldozerEntity* this) { ProcessMovement0(super); sub_08032F48(this); - if (--super->field_0xf == 0) { - super->field_0xf = 2; + if (--super->subtimer == 0) { + super->subtimer = 2; super->animationState = (super->animationState + 1) & 7; sub_08032F24(this); sub_080331E8(this); } - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 5; - super->field_0xf = 4; + super->subtimer = 4; sub_08033174(this); } } @@ -212,16 +212,16 @@ void sub_08032F64(MulldozerEntity* this) { void sub_08032F90(MulldozerEntity* this) { if (super->type == 0) { - if (super->actionDelay == 0x10) { + if (super->timer == 0x10) { this->unk_80 = 2; } - if (--super->field_0xf == 0) { - super->field_0xf = 8; + if (--super->subtimer == 0) { + super->subtimer = 8; sub_08033280(this); } } else { - if (--super->field_0xf == 0) { - super->field_0xf = 4; + if (--super->subtimer == 0) { + super->subtimer = 4; if ((this->unk_82 & 0x80) != 0) { super->direction = (super->direction + 0x1c) & 0x1c; } else { @@ -234,8 +234,8 @@ void sub_08032F90(MulldozerEntity* this) { } void sub_08033000(MulldozerEntity* this) { - if (--super->field_0xf == 0) { - super->field_0xf = 0x10; + if (--super->subtimer == 0) { + super->subtimer = 0x10; if ((this->unk_82 & 0x80) != 0) { super->direction = (super->direction + 0x18) & 0x1c; this->unk_82 &= 0x7f; @@ -255,7 +255,7 @@ void sub_08033058(MulldozerEntity* this) { super->action = 1; this->unk_80 = 1; - super->actionDelay = gUnk_080CEA50[Random() & 3]; + super->timer = gUnk_080CEA50[Random() & 3]; if ((sub_08049FA0(super) == 0) && ((Random() & 3) != 0)) { uVar2 = sub_08049EE4(super); uVar3 = Random(); @@ -271,9 +271,9 @@ void sub_080330C0(MulldozerEntity* this) { super->action = 2; this->unk_80 = 0; if (super->type == 0) { - super->actionDelay = (Random() & 0x38) + 0x18; + super->timer = (Random() & 0x38) + 0x18; } else { - super->actionDelay = 6; + super->timer = 6; } super->speed = 0x60; super->direction = (super->direction + 4) & 0x18; @@ -285,15 +285,15 @@ void sub_08033100(MulldozerEntity* this) { super->action = 3; if (super->type == 0) { this->unk_80 = 1; - super->actionDelay = 0x30; - super->field_0xf = 8; + super->timer = 0x30; + super->subtimer = 8; super->speed = 0; super->direction = (sub_08049F84(super, 1) + 2) & 0x1c; } else { this->unk_80 = 2; sub_080331B4(this); - super->actionDelay += 0x10; - super->field_0xf = 4; + super->timer += 0x10; + super->subtimer = 4; super->speed = 0x160; } this->unk_83 = 0; @@ -308,9 +308,9 @@ void sub_08033174(MulldozerEntity* this) { this->unk_82 = 0; this->unk_83 = 0; if (super->type == 0) { - super->actionDelay = (Random() & 0x18) + 0x18; + super->timer = (Random() & 0x18) + 0x18; } else { - super->actionDelay = 0xc; + super->timer = 0xc; } super->speed = 0xa0; sub_08032F24(this); @@ -318,18 +318,18 @@ void sub_08033174(MulldozerEntity* this) { void sub_080331B4(MulldozerEntity* this) { u32 rand = Random() & 0xf0; - u8 actionDelay = 0x1e; + u8 timer = 0x1e; if ((rand & 0x80) != 0) { - actionDelay = 0x3c; + timer = 0x3c; } else { if ((rand & 0x40) != 0) { - actionDelay = 0x2d; + timer = 0x2d; } if ((rand & 0x20) != 0) { - actionDelay = 0x4b; + timer = 0x4b; } } - super->actionDelay = actionDelay; + super->timer = timer; } void sub_080331E8(MulldozerEntity* this) { diff --git a/src/enemy/octorok.c b/src/enemy/octorok.c index 85ed9aaa..e36bc8af 100644 --- a/src/enemy/octorok.c +++ b/src/enemy/octorok.c @@ -61,7 +61,7 @@ void Octorok_OnGrabbed(Entity* this) { void sub_0801EB68(Entity* this) { this->subAction = 1; - this->field_0x1d = 60; + this->gustJarTolerance = 60; } void sub_0801EB74(Entity* this) { @@ -84,7 +84,7 @@ void nullsub_3(Entity* this) { void sub_0801EB9C(Entity* this) { if (this->flags & ENT_COLLIDE) { COLLISION_ON(this); - this->field_0x3a &= 0xfb; + this->gustJarState &= 0xfb; } else { this->health = 0; } @@ -98,15 +98,15 @@ void Octorok_Initialize(Entity* this) { } else { this->animationState = Random() & 3; } - this->field_0x1c = 18; + this->gustJarFlags = 18; Octorok_Pause(this); InitializeAnimation(this, this->animationState); } void Octorok_Idle(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; - this->actionDelay = gOctorokWalkDuration[Random() & 3]; + this->timer = gOctorokWalkDuration[Random() & 3]; Octorok_Turn(this); } GetNextFrame(this); @@ -115,7 +115,7 @@ void Octorok_Idle(Entity* this) { void Octorok_Move(Entity* this) { ProcessMovement0(this); GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (Octorok_FacesPlayer(this) && gOctorokSpitChanceModifier[this->type] <= (Random() & 3)) { this->action = 3; InitializeAnimation(this, this->animationState + 4); @@ -147,7 +147,7 @@ void Octorok_ShootNut(Entity* this) { void Octorok_Pause(Entity* this) { this->action = 1; - this->actionDelay = (Random() & 0x38) + 24; + this->timer = (Random() & 0x38) + 24; } void Octorok_Turn(Entity* this) { diff --git a/src/enemy/octorokBoss.c b/src/enemy/octorokBoss.c index 51e2b692..d7bc7015 100644 --- a/src/enemy/octorokBoss.c +++ b/src/enemy/octorokBoss.c @@ -457,10 +457,10 @@ void OctorokBoss_Action1(OctorokBossEntity* this) { SortEntityBelow(super->parent, super); if (((this->heap->field_0x2 != 0) || (super->parent->action == INTRO)) || (1 < (u8)(super->parent->subAction - 3))) { - if ((s8)super->field_0xf < 0) { - super->field_0xf = -this->heap->unk_0; + if ((s8)super->subtimer < 0) { + super->subtimer = -this->heap->unk_0; } else { - super->field_0xf = this->heap->unk_0; + super->subtimer = this->heap->unk_0; } sub_08036998(this); } @@ -507,7 +507,7 @@ void OctorokBoss_Action1(OctorokBossEntity* this) { UpdateAnimationSingleFrame(super); if (IS_FROZEN((OctorokBossEntity*)super->parent)) { sub_08036AF0(this, GET_TAIL_RADIUS(this), 0x10); - if ((super->bitfield & 0x7f) == 7) { + if ((super->contactFlags & 0x7f) == 7) { COLLISION_OFF(super); object = CreateObjectWithParent(super, OCTOROK_BOSS_OBJECT, 0, 0); super->child = object; @@ -522,7 +522,7 @@ void OctorokBoss_Action1(OctorokBossEntity* this) { sub_08036998(this); sub_080369D0(this, GET_TAIL_RADIUS(this), 4); } - super->bitfield = 0; + super->contactFlags = 0; SetAffineInfo(super, this->unk_76, this->unk_74, -this->angle.HWORD ^ 0x8000); break; @@ -995,17 +995,17 @@ NONMATCH("asm/non_matching/octorokBoss/sub_08036998.inc", void sub_08036998(Octo // TODO regalloc in this awful structure here tmp2 = &this->timer; - tmp = super->field_0xf + (u8)*tmp2; + tmp = super->subtimer + (u8)*tmp2; *tmp2 = tmp; - if ((s8)super->field_0xf < 0) { + if ((s8)super->subtimer < 0) { a = tmp; - b = -super->actionDelay; + b = -super->timer; if (a << 0x18 < b << 0x18) { - super->field_0xf = -super->field_0xf; + super->subtimer = -super->subtimer; } } else { - if (((s8)*tmp2) > ((s32)super->actionDelay)) { - super->field_0xf = -super->field_0xf; + if (((s8)*tmp2) > ((s32)super->timer)) { + super->subtimer = -super->subtimer; } } } @@ -1211,13 +1211,13 @@ void OctorokBoss_ChangePalette(OctorokBossEntity* this, u32 paletteIndex) { void sub_08036F60(OctorokBossEntity* this) { if ((super->subAction != 4) && (IS_FROZEN(this) == FALSE)) { - this->unk_76 += (s8)super->actionDelay; - this->unk_74 += (s8)super->actionDelay; + this->unk_76 += (s8)super->timer; + this->unk_74 += (s8)super->timer; if (this->unk_76 < 0x9c) { - super->actionDelay = 1; + super->timer = 1; } else { if (this->unk_76 > 0xa4) { - super->actionDelay = 0xff; + super->timer = 0xff; } } } diff --git a/src/enemy/octorokGolden.c b/src/enemy/octorokGolden.c index a2fcfab6..c630053d 100644 --- a/src/enemy/octorokGolden.c +++ b/src/enemy/octorokGolden.c @@ -35,7 +35,7 @@ void OctorokGolden_OnCollision(Entity* this) { } void OctorokGolden_OnDeath(Entity* this) { - if ((this->field_0x3a & 0x2) == 0) { + if ((this->gustJarState & 0x2) == 0) { SetGlobalFlag(this->type2); } @@ -54,8 +54,8 @@ void sub_08037CE4(Entity* this) { } void sub_08037D0C(Entity* this) { - if (this->field_0xf) { - this->field_0xf--; + if (this->subtimer) { + this->subtimer--; } else if (sub_08037E90(this)) { return; } @@ -63,7 +63,7 @@ void sub_08037D0C(Entity* this) { UpdateAnimationVariableFrames(this, 2); if (ProcessMovement0(this) == 0) { sub_08037E14(this); - } else if (--this->actionDelay == 0) { + } else if (--this->timer == 0) { sub_08037E14(this); } } @@ -88,9 +88,9 @@ void sub_08037D54(Entity* this) { } } } else if (this->frame & ANIM_DONE) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; - this->field_0xf = 0x3c; + this->subtimer = 0x3c; this->animationState |= 0xff; sub_08037E14(this); } else { @@ -107,7 +107,7 @@ void sub_08037E14(Entity* this) { u8* layer; const s8* ptr; s32 x, y; - this->actionDelay = 0x8; + this->timer = 0x8; dir = (GetFacingDirection(this, &gPlayerEntity) + 4) & 0x18; layer = (u8*)GetLayerByIndex(this->collisionLayer)->collisionData; ptr = gUnk_080CF498 + (dir >> 2); @@ -130,7 +130,7 @@ bool32 sub_08037E90(Entity* this) { u32 dir = sub_0804A044(this, &gPlayerEntity, 8); if (dir != 0xff) { this->action = 2; - this->actionDelay = 3; + this->timer = 3; this->direction = dir; this->animationState = dir >> 3; InitializeAnimation(this, this->animationState + 4); diff --git a/src/enemy/peahat.c b/src/enemy/peahat.c index 93452e64..9b2c8787 100644 --- a/src/enemy/peahat.c +++ b/src/enemy/peahat.c @@ -47,12 +47,12 @@ void Peahat(Entity* this) { void Peahat_OnTick(Entity* this) { gPeahatActions[this->action](this); if (this->field_0x80.HALF.HI) - this->z.HALF.HI = gPeahatFlightHeights[(this->field_0xf++ & 0x30) >> 4]; + this->z.HALF.HI = gPeahatFlightHeights[(this->subtimer++ & 0x30) >> 4]; } void Peahat_OnCollision(Entity* this) { if (this->field_0x82.HALF.LO) { - if (this->bitfield == 0x94) { + if (this->contactFlags == 0x94) { Entity* ent = CreateEnemy(PEAHAT, PeahatForm_Propeller); if (ent != NULL) { CopyPosition(this, ent); @@ -65,17 +65,17 @@ void Peahat_OnCollision(Entity* this) { this->iframes = -30; this->field_0x80.HALF.HI = 0; InitializeAnimation(this, this->animationState); - } else if (this->bitfield == 0x9b) { + } else if (this->contactFlags == 0x9b) { this->animationState = PeahatAnimation_BrokenPropeller; this->action = 5; this->speed = 0x80; this->iframes = -30; this->field_0x80.HALF.HI = 0; InitializeAnimation(this, this->animationState); - } else if (this->bitfield == 0x80) { + } else if (this->contactFlags == 0x80) { if (this->animationState == PeahatAnimation_Flying) { this->action = 1; - this->actionDelay = 30; + this->timer = 30; this->speed = 0x80; this->direction = -1; this->field_0x82.HALF.HI = 0x78; @@ -99,7 +99,7 @@ void Peahat_OnGrabbed(Entity* this) { void sub_080200B4(Entity* this) { this->subAction = 1; - this->field_0x1d = 60; + this->gustJarTolerance = 60; if (this->animationState == PeahatAnimation_Flying) { this->animationState = PeahatAnimation_BrokenPropeller; this->action = 5; @@ -127,7 +127,7 @@ void nullsub_5(Entity* this) { void sub_08020104(Entity* this) { if (this->flags & ENT_COLLIDE) { COLLISION_ON(this); - this->field_0x3a &= 0xfb; + this->gustJarState &= 0xfb; } else { this->health = 0; } @@ -136,10 +136,10 @@ void sub_08020104(Entity* this) { void Peahat_Initialize(Entity* this) { sub_0804A720(this); this->action = 1; - this->actionDelay = 16; - this->field_0xf = Random(); + this->timer = 16; + this->subtimer = Random(); this->direction = Random() & 0x1f; - this->field_0x1c = 18; + this->gustJarFlags = 18; this->field_0x80.HALF.LO = (Random() & 1) ? 2 : -2; this->field_0x80.HALF.HI = 1; this->field_0x82.HALF.LO = 1; @@ -152,16 +152,16 @@ void Peahat_Fly(Entity* this) { this->field_0x82.HALF.HI--; if (sub_08049FDC(this, 1)) { - if (this->field_0x82.HALF.HI == 0 && (this->field_0xf & 0xf) == 0 && sub_08049F1C(this, gUnk_020000B0, 0x30)) { + if (this->field_0x82.HALF.HI == 0 && (this->subtimer & 0xf) == 0 && sub_08049F1C(this, gUnk_020000B0, 0x30)) { this->action = 2; this->subAction = Random() & 3; - this->actionDelay = 60; + this->timer = 60; this->speed = 160; } } - if (--this->actionDelay == 0) { - this->actionDelay = 16; + if (--this->timer == 0) { + this->timer = 16; sub_08020604(this); if ((Random() & 3) == 0) { this->field_0x80.HALF.LO = (Random() & 1) ? 2 : -2; @@ -174,12 +174,12 @@ void Peahat_Fly(Entity* this) { void Peahat_ChargeStart(Entity* this) { if (sub_08049FDC(this, 1)) { - if (--this->actionDelay) { - UpdateAnimationVariableFrames(this, 4 - ((this->actionDelay >> 4) & 0x3)); + if (--this->timer) { + UpdateAnimationVariableFrames(this, 4 - ((this->timer >> 4) & 0x3)); return; } else { this->action = 3; - this->actionDelay = 120; + this->timer = 120; this->speed = 192; this->direction = (GetFacingDirection(this, gUnk_020000B0) + gUnk_080CA5D4[Random() & 1]) & 0x1f; } @@ -192,11 +192,11 @@ void Peahat_ChargeStart(Entity* this) { void Peahat_ChargeTarget(Entity* this) { if (sub_08049FDC(this, 1)) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_080205F8(this); } - if (60 < this->actionDelay) { - if (this->actionDelay & 1) + if (60 < this->timer) { + if (this->timer & 1) this->speed += 4; if ((gRoomTransition.frameCount & 3) == 0) @@ -210,14 +210,14 @@ void Peahat_ChargeTarget(Entity* this) { } void Peahat_ChargeEnd(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; - this->actionDelay = 1; + this->timer = 1; this->speed = 128; this->field_0x82.HALF.HI = 120; GetNextFrame(this); } else { - if (this->actionDelay & 1) + if (this->timer & 1) this->speed -= 8; ProcessMovement2(this); @@ -230,8 +230,8 @@ void Peahat_Stunned(Entity* this) { default: if (sub_080044EC(this, 0x1800) == 0) { this->action = 6; - this->actionDelay = 240; - this->field_0xf = 10; + this->timer = 240; + this->subtimer = 10; this->hitType = 0x71; } @@ -245,8 +245,8 @@ void Peahat_Stunned(Entity* this) { GravityUpdate(this, 0x1c00); if (this->z.HALF.HI == 0) { this->action = 7; - this->actionDelay = 150; - this->field_0xf = 10; + this->timer = 150; + this->subtimer = 10; this->hitType = 0x71; } break; @@ -254,11 +254,11 @@ void Peahat_Stunned(Entity* this) { } void Peahat_RepairPropeller(Entity* this) { - if (this->field_0xf) - if (--this->field_0xf == 0) + if (this->subtimer) + if (--this->subtimer == 0) Create0x68FX(this, FX_STARS); - if (!sub_0800442E(this) && --this->actionDelay) + if (!sub_0800442E(this) && --this->timer) return; this->action = 9; @@ -270,29 +270,29 @@ void Peahat_RepairPropeller(Entity* this) { } void Peahat_Recover(Entity* this) { - if (this->field_0xf) - if (--this->field_0xf == 0) + if (this->subtimer) + if (--this->subtimer == 0) Create0x68FX(this, FX_STARS); - if (!sub_0800442E(this) && --this->actionDelay) + if (!sub_0800442E(this) && --this->timer) return; this->action = 8; - this->actionDelay = 240; + this->timer = 240; this->direction = Random() & 0x1f; sub_0804AA1C(this); } void Peahat_Hop(Entity* this) { GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (this->frame & ANIM_DONE) { this->action = 9; this->zVelocity = Q_16_16(1.5); this->animationState = PeahatAnimation_NewPropeller; InitializeAnimation(this, this->animationState); } else { - this->actionDelay = 1; + this->timer = 1; } } @@ -327,8 +327,8 @@ void Peahat_Takeoff(Entity* this) { void PeahatPropeller_Initialize(Entity* this) { this->action = 1; - this->actionDelay = 240; - this->field_0xf = 40; + this->timer = 240; + this->subtimer = 40; this->spriteSettings.draw = 1; this->spriteRendering.b3 = 1; this->spriteOrientation.flipY = 1; @@ -340,16 +340,16 @@ void PeahatPropeller_Initialize(Entity* this) { void PeahatPropeller_Fly(Entity* this) { GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteEntity(this); } else { - if (this->actionDelay < 60) + if (this->timer < 60) this->spriteSettings.draw ^= 1; this->z.WORD -= 0xc000; LinearMoveUpdate(this); - if (--this->field_0xf == 0) { - this->field_0xf = 40; + if (--this->subtimer == 0) { + this->subtimer = 40; this->direction = (Random() & 0x10) + 8; } } @@ -357,7 +357,7 @@ void PeahatPropeller_Fly(Entity* this) { void sub_080205F8(Entity* this) { this->action = 4; - this->actionDelay = 60; + this->timer = 60; } void sub_08020604(Entity* this) { diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c index a5f07588..4da32bcb 100644 --- a/src/enemy/pesto.c +++ b/src/enemy/pesto.c @@ -50,7 +50,7 @@ void Pesto_OnTick(Entity* this) { void Pesto_OnCollision(Entity* this) { if (this->hitType != 0x6e) { - if (this->bitfield == 0x80) { + if (this->contactFlags == 0x80) { this->field_0x86.HALF.LO = 0x30; if ((this->field_0x82.HALF.HI & 0xf) == 3 && this->action == 6) { @@ -85,7 +85,7 @@ void Pesto_OnGrabbed(Entity* this) { this->subAction = 0; COLLISION_ON(this); this->hitType = 0x77; - this->actionDelay = 1; + this->timer = 1; this->speed = 0x40; } else { gUnk_080CBEF8[this->subAction](this); @@ -94,7 +94,7 @@ void Pesto_OnGrabbed(Entity* this) { void sub_08024038(Entity* this) { this->subAction = 1; - this->field_0x1d = 60; + this->gustJarTolerance = 60; GetNextFrame(this); } @@ -159,10 +159,10 @@ void sub_080240B8(Entity* this) { this->field_0x82.HALF.HI = 0x80; this->field_0x86.HALF.LO = 0; this->field_0x86.HALF.HI = 0; - this->actionDelay = 0; - this->field_0xf = 0x20; - this->field_0x3c |= 0x10; - this->field_0x1c = 2; + this->timer = 0; + this->subtimer = 0x20; + this->collisionFlags |= 0x10; + this->gustJarFlags = 2; this->direction = direction; sub_080249DC(this); @@ -188,12 +188,12 @@ void sub_080241C0(Entity* this) { this->field_0x80.HALF.LO++; this->speed = 0; sub_08024A14(this, 3, 10); - } else if (--this->field_0xf == 0) { + } else if (--this->subtimer == 0) { sub_08024A14(this, 0, 0x20); } break; case 1: - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { if (this->type != 0) { u8 tmp = this->field_0x82.HALF.HI & 0x80; if (tmp) { @@ -202,10 +202,10 @@ void sub_080241C0(Entity* this) { } else { this->action = 3; this->field_0x80.HALF.LO = tmp; - this->field_0xf = 10; + this->subtimer = 10; sub_08024E00(this, 0); sub_08024E1C(this); - sub_08024A14(this, 3, this->field_0xf); + sub_08024A14(this, 3, this->subtimer); } } else { sub_08024C94(this); @@ -222,7 +222,7 @@ void sub_08024298(Entity* this) { void sub_080242A0(Entity* this) { sub_08024940(this); if (sub_08024CC0(this)) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->direction = GetFacingDirection(this, gUnk_020000B0); sub_08024E00(this, 1); if (this->speed != 0) { @@ -230,14 +230,14 @@ void sub_080242A0(Entity* this) { } else { sub_08024E1C(this); } - } else if (--this->field_0xf == 0) { + } else if (--this->subtimer == 0) { sub_08024A14(this, 3, 10); } if (sub_08049F1C(this, gUnk_020000B0, 0x20) && sub_08049FDC(this, 3)) { this->action = 4; this->field_0x80.HALF.LO = 0; - this->actionDelay = 0x10; + this->timer = 0x10; this->speed = 0; } } @@ -247,22 +247,22 @@ void sub_0802433C(Entity* this) { sub_08024940(this); switch (this->field_0x80.HALF.LO) { case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO++; this->speed = 0x100; - this->field_0xf = 8; + this->subtimer = 8; sub_08024E00(this, 1); } break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 5; this->field_0x80.HALF.LO = 0; this->speed = 0x140; - this->actionDelay = 0xc0; - this->field_0xf = 8; + this->timer = 0xc0; + this->subtimer = 8; } else { - if (--this->field_0xf == 0) + if (--this->subtimer == 0) sub_08024A14(this, 2, 4); } break; @@ -276,18 +276,18 @@ 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->actionDelay = 0x20; + this->timer = 0x20; this->speed = 0x80; this->field_0x82.HALF.HI = 0x80; } else if (sub_08049F1C(this, gUnk_020000B0, 0xe)) { this->field_0x80.HALF.LO++; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->speed = 0x100; this->field_0x82.HALF.HI = 0x80; this->child->action = 2; - } else if (--this->actionDelay) { - if (--this->field_0xf == 0) { - sub_08024A14(this, 2, (this->actionDelay >> 6) + 1); + } else if (--this->timer) { + if (--this->subtimer == 0) { + sub_08024A14(this, 2, (this->timer >> 6) + 1); } } else { sub_08024C7C(this); @@ -297,14 +297,14 @@ void sub_080243B8(Entity* this) { } break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO++; - this->actionDelay = 0x20; + this->timer = 0x20; this->speed = 0x80; } break; case 2: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 6; this->field_0x80.HALF.LO = 0; this->speed = 0x80; @@ -313,18 +313,18 @@ void sub_080243B8(Entity* this) { if ((this->field_0x82.HALF.HI & 0x40) == 0) { switch (this->field_0x82.HALF.HI & 0x3f) { case 3: - this->actionDelay = 4; + this->timer = 4; break; case 1: - this->actionDelay = 0x14; + this->timer = 0x14; break; default: - this->actionDelay = 0x30; + this->timer = 0x30; break; } sub_08024A14(this, 2, 8); } else { - this->actionDelay = 0x40; + this->timer = 0x40; sub_08024A14(this, 0, 8); } } @@ -336,19 +336,19 @@ void sub_080244E8(Entity* this) { sub_08024940(this); switch (this->field_0x80.HALF.LO) { case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (sub_080B1B44(COORD_TO_TILE(this), 1) == 0) { this->field_0x80.HALF.LO += 1; this->field_0x82.HALF.LO += 1; - this->field_0xf = 0; + this->subtimer = 0; this->speed = 0; } else { - this->actionDelay = 0x30; - this->field_0xf = 4; + this->timer = 0x30; + this->subtimer = 4; } break; } else { - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { sub_08024A14(this, 1, 8); } } @@ -369,7 +369,7 @@ void sub_080244E8(Entity* this) { if (sub_08024AD8(this)) { u32 tmp; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (this->speed) { this->speed = 0; } else { @@ -378,7 +378,7 @@ void sub_080244E8(Entity* this) { this->direction = GetFacingDirection(this, this->child); sub_08024E00(this, 0); sub_080249DC(this); - } else if (--this->field_0xf == 0) { + } else if (--this->subtimer == 0) { sub_08024A14(this, 1, 8); } @@ -387,7 +387,7 @@ void sub_080244E8(Entity* this) { tmp = this->field_0x82.HALF.HI & 0x80; if (tmp == 0) { this->field_0x80.HALF.LO++; - this->actionDelay = 0xc; + this->timer = 0xc; this->direction = 0x10; this->speed = tmp; this->cutsceneBeh.HALF.LO = 0; @@ -407,7 +407,7 @@ void sub_080244E8(Entity* this) { Entity* ent; this->field_0x80.HALF.LO += 1; - this->actionDelay = 0xc; + this->timer = 0xc; this->field_0x82.HALF.HI &= ~0x80; CopyPosition(this->child, this); this->z.HALF.HI -= 0xe; @@ -428,7 +428,7 @@ void sub_080244E8(Entity* this) { Entity* ent; this->field_0x80.HALF.LO += 1; - this->actionDelay = 0xc; + this->timer = 0xc; this->field_0x82.HALF.HI &= ~0x80; ent = this->child; SetTile((u16)ent->field_0x70.HALF.LO, COORD_TO_TILE(ent), ent->collisionLayer); @@ -452,9 +452,9 @@ void sub_080244E8(Entity* this) { } break; case 3: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO++; - this->field_0xf = 0; + this->subtimer = 0; this->speed = 0; this->field_0x82.HALF.LO++; } @@ -482,8 +482,8 @@ void sub_080244E8(Entity* this) { break; case 1 ... 2: this->field_0x80.HALF.LO += 1; - this->actionDelay = 0xc0; - this->field_0xf = 8; + this->timer = 0xc0; + this->subtimer = 8; this->speed = 0x80; sub_080249DC(this); break; @@ -494,19 +494,19 @@ void sub_080244E8(Entity* this) { } break; case 6: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (this->field_0x82.HALF.HI & 0x80) { this->field_0x82.HALF.HI = 0xc0; this->field_0x80.HALF.LO = 0; this->speed = 0x40; - this->actionDelay = 0x40; - this->field_0xf = 8; + this->timer = 0x40; + this->subtimer = 8; sub_08024A14(this, 0, 8); } else { - this->actionDelay = 0x40; - this->field_0xf = 8; + this->timer = 0x40; + this->subtimer = 8; } - } else if (--this->field_0xf == 0) { + } else if (--this->subtimer == 0) { sub_08024A14(this, 2, 8); } break; @@ -606,7 +606,7 @@ void sub_08024A14(Entity* this, u32 param_2, u32 param_3) { } sub_080249DC(this); - this->field_0xf = param_3; + this->subtimer = param_3; } bool32 sub_08024AD8(Entity* this) { @@ -703,18 +703,18 @@ ASM_FUNC("asm/non_matching/pesto/sub_08024C48.inc", bool32 sub_08024C48(Entity* void sub_08024C7C(Entity* this) { this->action = 1; this->speed = 0x40; - this->actionDelay = 0; + this->timer = 0; sub_08024A14(this, 0, 0x20); } void sub_08024C94(Entity* this) { this->action = 2; this->field_0x80.HALF.LO = 0; - this->actionDelay = 0x40; - this->field_0xf = 0; + this->timer = 0x40; + this->subtimer = 0; this->speed = 0xc0; this->field_0x82.HALF.HI = 0x80; - sub_08024A14(this, 3, this->field_0xf); + sub_08024A14(this, 3, this->subtimer); } bool32 sub_08024CC0(Entity* this) { @@ -744,9 +744,9 @@ void sub_08024D00(Entity* this) { } else if (sub_08024CC0(this)) { switch (this->field_0x80.HALF.LO) { case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO++; - this->actionDelay = (Random() & 0xf) + 0x20; + this->timer = (Random() & 0xf) + 0x20; this->direction += this->field_0x80.HALF.HI ? 4 : 0x1c; this->direction &= 0x1f; @@ -756,15 +756,15 @@ void sub_08024D00(Entity* this) { } break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO = 0; - this->actionDelay = (Random() & 0x1f) + 0x20; + this->timer = (Random() & 0x1f) + 0x20; } else { - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->direction += this->field_0x80.HALF.HI ? 1 : 0x1f; this->direction &= 0x1f; - this->field_0xf = 0x10; + this->subtimer = 0x10; sub_080249DC(this); } } @@ -774,7 +774,7 @@ void sub_08024D00(Entity* this) { } void sub_08024E00(Entity* this, u32 unk) { - this->actionDelay = gUnk_080CBF10[sub_08024E34() * 2 | unk]; + this->timer = gUnk_080CBF10[sub_08024E34() * 2 | unk]; } void sub_08024E1C(Entity* this) { @@ -788,7 +788,7 @@ u32 sub_08024E34(void) { void sub_08024E4C(Entity* this) { if (this->field_0x82.HALF.HI == 3) { - this->field_0xf = ++this->field_0xf & 0x1f; + this->subtimer = ++this->subtimer & 0x1f; if (sub_0807953C()) { u32 r = Random(); this->cutsceneBeh.HALF.LO++; @@ -801,8 +801,8 @@ void sub_08024E4C(Entity* this) { sub_08024F50(this); this->field_0x80.HALF.LO = 0; this->speed = 0x40; - this->actionDelay = 0x40; - this->field_0xf = 8; + this->timer = 0x40; + this->subtimer = 8; sub_08024A14(this, 0, 8); } else { Entity* player = &gPlayerEntity; @@ -817,7 +817,7 @@ void sub_08024E4C(Entity* this) { player->spriteOffsetY = 0x1a; player->animationState = 4; player->spritePriority.b1 = 0; - if (this->field_0xf == 0) { + if (this->subtimer == 0) { this->field_0x86.HALF.HI++; player->iframes = 8; ModHealth(-2); diff --git a/src/enemy/puffstool.c b/src/enemy/puffstool.c index 3b080dd8..aac1c3e7 100644 --- a/src/enemy/puffstool.c +++ b/src/enemy/puffstool.c @@ -53,16 +53,16 @@ void Puffstool_OnTick(Entity* this) { void Puffstool_OnCollide(Entity* this) { u8 tmp; - switch (this->bitfield & 0x7f) { + switch (this->contactFlags & 0x7f) { case 0 ... 3: /* ... */ break; case 0x1b: sub_0804AA1C(this); - tmp = gUnk_080CBFE8[(*(Entity**)&this->field_0x4c)->type]; + tmp = gUnk_080CBFE8[(*(Entity**)&this->contactedEntity)->type]; if (tmp < this->field_0x82.HALF.LO) { - this->field_0x82.HALF.LO -= gUnk_080CBFE8[(*(Entity**)&this->field_0x4c)->type]; + this->field_0x82.HALF.LO -= gUnk_080CBFE8[(*(Entity**)&this->contactedEntity)->type]; } else { this->cutsceneBeh.HWORD = 0x294; this->hitType = 0x83; @@ -70,14 +70,14 @@ void Puffstool_OnCollide(Entity* this) { ChangeObjPalette(this, 0x7c); } this->action = 7; - this->actionDelay = 0x3c; + this->timer = 0x3c; if (0 < this->zVelocity) { this->zVelocity = 0; } this->iframes = -0xc; this->knockbackDuration = 0; if (this->field_0x80.HALF.LO == 0) { - this->animationState = (*(Entity**)&this->field_0x4c)->direction >> 3; + this->animationState = (*(Entity**)&this->contactedEntity)->direction >> 3; InitializeAnimation(this, this->animationState + 4); this->frameDuration = 6; this->field_0x80.HALF.LO = 1; @@ -99,7 +99,7 @@ void Puffstool_OnCollide(Entity* this) { } void Puffstool_OnDeath(Entity* this) { - if ((this->field_0x3a & 2) && this->actionDelay == 1 && this->field_0x82.HALF.LO) { + if ((this->gustJarState & 2) && this->timer == 1 && this->field_0x82.HALF.LO) { sub_08025B18(this); } GenericDeath(this); @@ -116,8 +116,8 @@ void Puffstool_OnGrabbed(Entity* this) { void sub_08025180(Entity* this) { this->subAction = 1; - this->actionDelay = Random(); - this->animationState = (((*(Entity**)&this->field_0x4c)->direction ^ 0x10) >> 3); + this->timer = Random(); + this->animationState = (((*(Entity**)&this->contactedEntity)->direction ^ 0x10) >> 3); InitializeAnimation(this, this->animationState + 4); sub_0804AA1C(this); } @@ -125,7 +125,7 @@ void sub_08025180(Entity* this) { void sub_080251AC(Entity* this) { if (this->field_0x82.HALF.LO >= 4) { this->field_0x82.HALF.LO -= 3; - if ((--this->actionDelay & 3) == 0) { + if ((--this->timer & 3) == 0) { sub_08025BD4(this); } } else { @@ -152,23 +152,23 @@ void sub_08025230(Entity* this) { sub_08025C44(this); GetNextFrame(this); - if (--this->actionDelay == 0) { - this->actionDelay = (Random() & 3) + 4; + if (--this->timer == 0) { + this->timer = (Random() & 3) + 4; this->direction = sub_08025C60(this); } if (this->collisions != COL_NONE) { - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { sub_0800417E(this, this->collisions); } } else { - this->field_0xf = 30; + this->subtimer = 30; } if (this->field_0x78.HWORD == 0) { if (sub_0802571C(this)) { this->action = 2; - this->actionDelay = 240; + this->timer = 240; this->field_0x86.HWORD = COORD_TO_TILE(this); } } else { @@ -187,26 +187,26 @@ void sub_080252E0(Entity* this) { tile = COORD_TO_TILE(this); if (tile == this->field_0x86.HWORD) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_080256B4(this); } } else { this->field_0x86.HWORD = tile; - this->actionDelay = 240; + this->timer = 240; } 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->actionDelay = 0x1e; - this->field_0xf = 0; + this->timer = 0x1e; + this->subtimer = 0; this->zVelocity = Q_16_16(1.5); InitializeAnimation(this, 1); } } void sub_0802538C(Entity* this) { - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else { if (this->frame == 0) { GetNextFrame(this); @@ -223,12 +223,12 @@ void sub_0802538C(Entity* this) { void sub_080253D4(Entity* this) { GetNextFrame(this); if (!GravityUpdate(this, 0x2000)) { - if (this->field_0xf == 0) { + if (this->subtimer == 0) { this->action = 5; InitializeAnimation(this, 3); } else { this->action = 6; - this->actionDelay = 0x1e; + this->timer = 0x1e; InitializeAnimation(this, 3); sub_08025A54(this); sub_08025AE8(this); @@ -240,7 +240,7 @@ void sub_0802541C(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->action = 3; - this->field_0xf = 1; + this->subtimer = 1; this->zVelocity = Q_16_16(2); InitializeAnimation(this, 1); } @@ -250,7 +250,7 @@ void sub_0802544C(Entity* this) { if (this->frame == 0) { GetNextFrame(this); } else { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_080256B4(this); InitializeAnimation(this, 0); } @@ -260,11 +260,11 @@ void sub_0802544C(Entity* this) { void sub_0802547C(Entity* this) { GravityUpdate(this, Q_16_16(0.125)); GetNextFrame(this); - if ((this->actionDelay & 7) == 0) { + if ((this->timer & 7) == 0) { sub_08025BD4(this); } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_08025C2C(this); } } @@ -290,13 +290,13 @@ void sub_080254B4(Entity* this) { void sub_08025514(Entity* this) { GetNextFrame(this); - if (sub_0802594C(this, this->actionDelay++)) { + if (sub_0802594C(this, this->timer++)) { this->action = 2; - this->actionDelay = 240; + this->timer = 240; this->field_0x80.HALF.HI = 120; - } else if (3 < this->actionDelay) { + } else if (3 < this->timer) { this->action = 10; - this->actionDelay = 0x20; + this->timer = 0x20; } } @@ -305,13 +305,13 @@ void sub_08025554(Entity* this) { if (ent == NULL) { sub_080256B4(this); } else { - if ((this->actionDelay & 3) == 0) { + if ((this->timer & 3) == 0) { this->direction = GetFacingDirection(ent, this); } sub_08025C44(this); GetNextFrame(this); - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { if (!sub_080258C4(this)) { sub_080256B4(this); @@ -329,10 +329,10 @@ void sub_080255AC(Entity* this) { this->field_0x80.HALF.HI--; } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { s32 tmp; - this->actionDelay = (Random() & 3) + 4; + this->timer = (Random() & 3) + 4; tmp = Random() & 0xf; if (tmp < 8) { @@ -378,8 +378,8 @@ void sub_0802563C(Entity* this) { void sub_080256B4(Entity* this) { this->action = 1; - this->actionDelay = (Random() & 3) + 4; - this->field_0xf = 0x1e; + this->timer = (Random() & 3) + 4; + this->subtimer = 0x1e; 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; @@ -454,11 +454,11 @@ bool32 sub_080258C4(Entity* this) { iVar4 = iVar4 + iVar1; if (this->cutsceneBeh.HWORD == 0 && this->field_0x80.HALF.HI == 0 && 0x400 >= iVar4) { this->action = 9; - this->actionDelay = 0; + this->timer = 0; return TRUE; } else if (0x900 >= iVar4) { this->action = 11; - this->actionDelay = 1; + this->timer = 1; this->field_0x78.HWORD = gUnk_080CC050[Random() & 0xf]; return TRUE; } else { diff --git a/src/enemy/rockChuchu.c b/src/enemy/rockChuchu.c index 9f118b2b..89f62eb5 100644 --- a/src/enemy/rockChuchu.c +++ b/src/enemy/rockChuchu.c @@ -23,7 +23,7 @@ void RockChuchu_OnCollision(Entity* this) { Entity* ent; if (this->health) { - switch (this->bitfield & 0x7f) { + switch (this->contactFlags & 0x7f) { case 4: case 5: case 6: @@ -72,25 +72,25 @@ void RockChuchu_OnGrabbed(Entity* this) { void sub_08022368(Entity* this) { sub_0804A720(this); this->action = 1; - this->actionDelay = Random(); + this->timer = Random(); this->direction = sub_08049F84(this, 1); InitializeAnimation(this, 0); } void sub_08022390(Entity* this) { if (sub_08049FDC(this, 1)) { - if ((this->actionDelay++ & 0xf) == 0) { + if ((this->timer++ & 0xf) == 0) { this->direction = sub_08049F84(this, 1); - this->field_0xf = Random() & 4; + this->subtimer = Random() & 4; } - if (this->field_0xf == 0) { + if (this->subtimer == 0) { ProcessMovement0(this); } else { - this->field_0xf = this->field_0xf - 1; + this->subtimer = this->subtimer - 1; } } else { - this->actionDelay = Random(); + this->timer = Random(); } GetNextFrame(this); @@ -101,7 +101,7 @@ void sub_080223E4(Entity* this) { ent = this->child; if (ent != NULL) { - ent->bitfield = 0x94; + ent->contactFlags = 0x94; ent->iframes = 0x10; #ifndef EU ent->knockbackDuration = 0xc; diff --git a/src/enemy/rollobite.c b/src/enemy/rollobite.c index f86dd5b9..3308f3b6 100644 --- a/src/enemy/rollobite.c +++ b/src/enemy/rollobite.c @@ -42,16 +42,16 @@ void Rollobite_OnCollision(Entity* this) { InitializeAnimation(this, this->animationState + 8); } - if (this->bitfield != 0x80) { + if (this->contactFlags != 0x80) { if (this->action == 4 || this->action == 5) { this->action = 4; - this->actionDelay = 180; + this->timer = 180; this->direction = 0xff; InitializeAnimation(this, this->animationState + 0x10); } } - if (this->bitfield == 0x93) + if (this->contactFlags == 0x93) Rollobite_OnTick(this); } @@ -80,7 +80,7 @@ void Rollobite_OnGrabbed(Entity* this) { void sub_0802077C(Entity* this) { this->subAction = 1; - this->field_0x1d = 60; + this->gustJarTolerance = 60; } void sub_08020788(Entity* this) { @@ -103,7 +103,7 @@ void sub_080207A8(Entity* this) { this->action = 4; COLLISION_ON(this); this->spritePriority.b0 = 4; - this->field_0x3a &= 0xfb; + this->gustJarState &= 0xfb; this->direction ^= 0x10; this->zVelocity = Q_16_16(1.5); this->speed = 0x80; @@ -112,8 +112,8 @@ void sub_080207A8(Entity* this) { void Rollobite_Initialize(Entity* this) { sub_0804A720(this); - this->field_0x16 = 0x30; - this->field_0x1c = 18; + this->carryFlags = 0x30; + this->gustJarFlags = 18; this->cutsceneBeh.HALF.LO = 0; this->direction = DirectionRound(Random()); sub_08020A30(this); @@ -124,14 +124,14 @@ void Rollobite_Walk(Entity* this) { if (this->frame & 0x1) { this->frame &= ~0x1; if (!ProcessMovement0(this)) - this->actionDelay = 1; + this->timer = 1; } if (this->frame & 0x10) { this->frame &= ~0x10; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; - this->actionDelay = 60; + this->timer = 60; } } } @@ -168,7 +168,7 @@ void sub_08020904(Entity* this) { } void Rollobite_Turn(Entity* this) { - if (--this->actionDelay == 0) + if (--this->timer == 0) sub_08020A30(this); } @@ -181,7 +181,7 @@ void Rollobite_RolledUp(Entity* this) { unk = sub_080044EC(this, 0x2800); if (unk == 0) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 5; InitializeAnimation(this, this->animationState + 12); } @@ -226,10 +226,10 @@ void Rollobite_Holed(Entity* this) { void sub_08020A30(Entity* this) { if (this->cutsceneBeh.HALF.LO < 2) { - this->actionDelay = gUnk_080CA6CC[Random() & 7]; - if (this->actionDelay == 0) { + this->timer = gUnk_080CA6CC[Random() & 7]; + if (this->timer == 0) { this->action = 3; - this->actionDelay = 60; + this->timer = 60; this->cutsceneBeh.HALF.LO++; return; } diff --git a/src/enemy/rope.c b/src/enemy/rope.c index 37c63337..c62edf1e 100644 --- a/src/enemy/rope.c +++ b/src/enemy/rope.c @@ -27,7 +27,7 @@ void Rope_OnTick(Entity* this) { void Rope_OnCollision(Entity* this) { if (this->action == 3) { - this->field_0xf = 0x1e; + this->subtimer = 0x1e; this->field_0x78.HALF.LO = 0x3c; sub_08031600(this); } @@ -45,7 +45,7 @@ void Rope_OnGrabbed(Entity* this) { void sub_0803140C(Entity* this) { this->subAction = 1; - this->field_0x1d = 0x3c; + this->gustJarTolerance = 0x3c; } void sub_08031418(Entity* this) { @@ -62,7 +62,7 @@ void sub_08031434(Entity* this) { sub_0804A720(this); this->animationState = 0xff; - this->field_0x1c = 1; + this->gustJarFlags = 1; this->field_0x7a.HWORD = this->speed; if (!(this->type)) { sub_08031600(this); @@ -77,8 +77,8 @@ void sub_08031434(Entity* this) { void sub_08031480(Entity* this) { if (this->subAction == 0) { - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { sub_08031600(this); this->action = 1; @@ -91,7 +91,7 @@ void sub_08031480(Entity* this) { } else { if (GravityUpdate(this, 0x1800) == 0) { this->action = 2; - this->field_0xf = 0xf; + this->subtimer = 0xf; this->spriteSettings.draw = 1; UpdateSpriteForCollisionLayer(this); EnqueueSFX(SFX_WATER_SPLASH); @@ -102,8 +102,8 @@ void sub_080314FC(Entity* this) { u32 u; GetNextFrame(this); - if (this->field_0xf) { - this->field_0xf--; + if (this->subtimer) { + this->subtimer--; } else { if (this->field_0x78.HALF.LO) { this->field_0x78.HALF.LO--; @@ -114,7 +114,7 @@ void sub_080314FC(Entity* this) { u = sub_0804A044(this, gUnk_020000B0, 0xc); if (u != 0xff) { this->action = 3; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->field_0x7a.HWORD = this->speed = 0x1a0; this->direction = u; this->animationState = this->direction >> 3; @@ -133,7 +133,7 @@ void sub_080314FC(Entity* this) { } } } - if (!(--this->actionDelay)) { + if (!(--this->timer)) { sub_08031600(this); } sub_0803163C(this); @@ -141,8 +141,8 @@ void sub_080314FC(Entity* this) { } void sub_080315BC(Entity* this) { - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; UpdateAnimationVariableFrames(this, 2); } else { if (sub_08049FA0(this)) { @@ -159,7 +159,7 @@ void sub_080315BC(Entity* this) { void sub_08031600(Entity* this) { u32 r; this->action = 2; - this->actionDelay = (Random() & 0x30) + 0x3c; + this->timer = (Random() & 0x30) + 0x3c; this->speed = 0x80; this->field_0x7a.HWORD = 0x80; r = Random() & 0x18; diff --git a/src/enemy/ropeGolden.c b/src/enemy/ropeGolden.c index a4a6fc99..5bb3796b 100644 --- a/src/enemy/ropeGolden.c +++ b/src/enemy/ropeGolden.c @@ -40,7 +40,7 @@ void RopeGolden_OnCollision(Entity* this) { } void RopeGolden_OnDeath(Entity* this) { - if ((this->field_0x3a & 2) == 0) { + if ((this->gustJarState & 2) == 0) { SetGlobalFlag(this->type2); } CreateDeathFx(this, 0xff, 0x58); @@ -56,8 +56,8 @@ void sub_08038258(Entity* this) { } void sub_0803827C(Entity* this) { - if (this->field_0xf != 0) { - this->field_0xf--; + if (this->subtimer != 0) { + this->subtimer--; } else { if ((sub_0804A044(this, &gPlayerEntity, 0x8) != 0xff) || (EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x24) != 0)) { @@ -69,14 +69,14 @@ void sub_0803827C(Entity* this) { if (ProcessMovement0(this) == 0) { sub_080383AC(this); } else { - if (!(--this->actionDelay)) { + if (!(--this->timer)) { sub_080383AC(this); } } } void sub_080382EC(Entity* this) { - if (!(--this->actionDelay)) { + if (!(--this->timer)) { this->action = 3; } } @@ -86,7 +86,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->actionDelay = 0x8; + this->timer = 0x8; this->speed = 0x100; this->direction = DirectionRoundUp(GetFacingDirection(this, &gPlayerEntity)); v = this->direction >> 3; @@ -99,7 +99,7 @@ void sub_080383AC(Entity* this) { void sub_080383E4(Entity* this) { u32 v; this->action = 2; - this->actionDelay = 0x8; + this->timer = 0x8; this->speed = 0x280; v = DirectionRoundUp(GetFacingDirection(this, &gPlayerEntity)); this->direction = v; diff --git a/src/enemy/rupeeLike.c b/src/enemy/rupeeLike.c index 0e6afccb..9a9fc7cd 100644 --- a/src/enemy/rupeeLike.c +++ b/src/enemy/rupeeLike.c @@ -60,14 +60,14 @@ void RupeeLike_OnCollision(Entity* this) { if (this->action == 4) { sub_080296D8(this); } - if (*(u8*)(*(u32*)&this->field_0x4c + 8) == 1) { + if (*(u8*)(*(u32*)&this->contactedEntity + 8) == 1) { if (this->action == 2) { InitializeAnimation(this, 0); InitializeAnimation(this->child, 4); } this->action = 4; - this->actionDelay = 0x3c; - this->field_0xf = 0; + this->timer = 0x3c; + this->subtimer = 0; this->field_0x82.HALF.HI = 0x41; this->flags2 &= 0xfc; this->field_0x80.HALF.LO = gPlayerEntity.spritePriority.b1; @@ -124,7 +124,7 @@ void sub_08029474(Entity* this) { sub_080296C8(this); if (this->frame & ANIM_DONE) { this->action = 3; - this->actionDelay = 8; + this->timer = 8; bVar1 = GetFacingDirection(this, &gPlayerEntity); this->direction = bVar1; this->animationState = (bVar1 << 0x18) >> 0x1c; @@ -140,8 +140,8 @@ void sub_08029474(Entity* this) { void sub_080294D4(Entity* this) { if (sub_08049FDC(this, 1) != 0) { - if (--this->actionDelay == 0) { - this->actionDelay = 8; + if (--this->timer == 0) { + this->timer = 8; sub_08004596(this, GetFacingDirection(this, &gPlayerEntity)); sub_0802969C(this); } @@ -161,12 +161,12 @@ void sub_0802953C(Entity* this) { sub_080296C8(this); sub_080296C8(this); if (sub_0807953C() != 0) { - this->field_0xf++; + this->subtimer++; } - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } - if (((this->field_0xf > 0x2d) || (gSave.stats.rupees == 0)) && (this->actionDelay == 0)) { + if (((this->subtimer > 0x2d) || (gSave.stats.rupees == 0)) && (this->timer == 0)) { sub_080296D8(this); } else { ResetPlayerItem(); @@ -187,9 +187,9 @@ void sub_0802953C(Entity* this) { } void sub_08029610(Entity* this) { - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->action = 3; - this->actionDelay = 1; + this->timer = 1; } sub_080296C8(this); } @@ -248,7 +248,7 @@ void sub_080296D8(Entity* this) { gPlayerEntity.spriteOffsetY = 0; gPlayerEntity.speed = 0x140; this->action = 5; - this->field_0xf = 0x3c; + this->subtimer = 0x3c; this->flags2 |= 3; if ((s8)this->iframes == 0) { this->iframes = 0xf4; @@ -276,7 +276,7 @@ void sub_08029770(Entity* this) { void sub_080297F0(Entity* this) { u32 temp; this->action = 1; - this->actionDelay = 0x78; + this->timer = 0x78; COLLISION_ON(this); this->spriteSettings.draw = TRUE; this->hitType = 0x8e; diff --git a/src/enemy/scissorsBeetle.c b/src/enemy/scissorsBeetle.c index 66914591..b4be1979 100644 --- a/src/enemy/scissorsBeetle.c +++ b/src/enemy/scissorsBeetle.c @@ -40,7 +40,7 @@ void ScissorsBeetle_OnCollision(ScissorsBeetleEntity* this) { } EnemyFunctionHandlerAfterCollision(super, ScissorsBeetle_Functions); - if ((super->bitfield & 0x80) && super->action != 4) { + if ((super->contactFlags & 0x80) && super->action != 4) { u32 knockbackDir; child = super->child; child->iframes = super->iframes; @@ -88,13 +88,13 @@ void sub_080389E8(ScissorsBeetleEntity* this) { if (--this->unk_80 == 0) { super->speed = 0x80; } - } else if (--super->field_0xf == 0) { + } else if (--super->subtimer == 0) { sub_08038BA8(this); sub_08038C2C((ScissorsBeetleEntity*)child); - } else if (super->actionDelay) { - super->actionDelay--; + } else if (super->timer) { + super->timer--; } else if (super->collisions != COL_NONE) { - super->actionDelay = 0xc; + super->timer = 0xc; if ((child->animationState & 1) == 0) { child->animationState += Random() & 0x20 ? 1 : 7; child->animationState &= 7; @@ -113,18 +113,18 @@ void sub_08038A70(ScissorsBeetleEntity* this) { super->action = 3; this->unk_82 = 4; super->speed = 0x80; - super->field_0xf = 0x20; + super->subtimer = 0x20; child->action = 3; ((ScissorsBeetleEntity*)child)->unk_82 = 2; child->animationState = 0xff; sub_08038C84(this, 0); sub_08038C2C((ScissorsBeetleEntity*)child); - child->field_0xf = 0x20; + child->subtimer = 0x20; child->parent = NULL; child->child = super; - } else if (--super->field_0xf == 0) { + } else if (--super->subtimer == 0) { u32 dir; - super->field_0xf = 0x10; + super->subtimer = 0x10; super->direction = sub_08049F84(super, 0); dir = (super->direction + 4) & 0x1c; child->animationState = dir >> 2; @@ -137,8 +137,8 @@ void sub_08038A70(ScissorsBeetleEntity* this) { } void sub_08038B08(ScissorsBeetleEntity* this) { - if (super->field_0xf) { - super->field_0xf--; + if (super->subtimer) { + super->subtimer--; return; } @@ -146,8 +146,8 @@ void sub_08038B08(ScissorsBeetleEntity* this) { if (super->frame & ANIM_DONE) { super->action = 4; this->unk_82 = 3; - super->actionDelay = 0x32; - super->field_0xf = 2; + super->timer = 0x32; + super->subtimer = 2; super->direction = ((super->animationState << 2) + 0x10) & 0x1f; super->speed = 0x80; sub_08038C84(this, 0); @@ -158,8 +158,8 @@ void sub_08038B08(ScissorsBeetleEntity* this) { void sub_08038B64(ScissorsBeetleEntity* this) { ProcessMovement0(super); UpdateAnimationSingleFrame(super); - if (--super->field_0xf == 0) { - super->field_0xf = 2; + if (--super->subtimer == 0) { + super->subtimer = 2; super->direction = DirectionNormalize(super->direction + 0x1f); } } @@ -174,7 +174,7 @@ void sub_08038BA8(ScissorsBeetleEntity* this) { Entity* child; u32 r3; u32 animationState; - super->field_0xf = gUnk_080CF62C[Random() & 7]; + super->subtimer = gUnk_080CF62C[Random() & 7]; this->unk_82 = 1; ((ScissorsBeetleEntity*)super->child)->unk_82 = 0; @@ -207,7 +207,7 @@ void sub_08038BA8(ScissorsBeetleEntity* this) { void sub_08038C2C(ScissorsBeetleEntity* this) { u32 parentAnimState; - super->field_0xf = gUnk_080CF634[Random() & 7]; + super->subtimer = gUnk_080CF634[Random() & 7]; parentAnimState = super->parent->animationState; if (super->animationState == 0xff) { super->animationState = parentAnimState; diff --git a/src/enemy/slime.c b/src/enemy/slime.c index ddae5cb9..70f43914 100644 --- a/src/enemy/slime.c +++ b/src/enemy/slime.c @@ -55,17 +55,17 @@ void sub_08044FC8(Entity* this) { void sub_08044FF8(Entity* this) { this->action = 2; - this->actionDelay = (Random() & 31) + 30; + this->timer = (Random() & 31) + 30; this->cutsceneBeh.HALF.LO = this->health; } void sub_08045018(Entity* this) { GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; - this->actionDelay = 1; + this->timer = 1; if (0 < this->speed) { - this->actionDelay = FixedDiv(4096, this->speed) >> 8; + this->timer = FixedDiv(4096, this->speed) >> 8; } if (sub_08049FA0(this) == 0 && (Random() & 3)) { this->direction = (sub_08049EE4(this) + 0xfc + (Random() & 8)) & 24; @@ -78,7 +78,7 @@ void sub_08045018(Entity* this) { void sub_08045088(Entity* this) { ProcessMovement0(this); GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; } } diff --git a/src/enemy/sluggula.c b/src/enemy/sluggula.c index 759a3c5c..5dc003ef 100644 --- a/src/enemy/sluggula.c +++ b/src/enemy/sluggula.c @@ -65,7 +65,7 @@ void Sluggula_OnGrabbed(Entity* this) { void sub_08023C5C(Entity* this) { sub_0804A720(this); this->action = 1; - this->actionDelay = (Random() & 0x30) + 0xb4; + this->timer = (Random() & 0x30) + 0xb4; this->direction = DirectionRound(Random()); this->animationState = this->direction >> 3; InitializeAnimation(this, this->animationState); @@ -75,11 +75,11 @@ void sub_08023C8C(Entity* this) { ProcessMovement0(this); GetNextFrame(this); sub_08023E54(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (this->frame != 1) { - this->actionDelay = 8; + this->timer = 8; } else { - this->actionDelay = (Random() & 0x30) + 0xb4; + this->timer = (Random() & 0x30) + 0xb4; sub_08023E9C(this); this->animationState = this->direction >> 3; InitializeAnimation(this, this->animationState); @@ -93,8 +93,8 @@ void sub_08023CE0(Entity* this) { sub_0804A720(this); if (this->type2 == 1) { this->action = 2; - if (this->actionDelay == 0) { - this->actionDelay = 1; + if (this->timer == 0) { + this->timer = 1; } this->spriteSettings.draw = 3; } else { @@ -108,15 +108,15 @@ void sub_08023CE0(Entity* this) { case 1: if (PlayerInRange(this, 1, 0x20)) { this->action = 2; - if (this->actionDelay == 0) { - this->actionDelay = 8; + if (this->timer == 0) { + this->timer = 8; } this->spriteSettings.draw = 3; } break; case 2: - if (this->actionDelay != 0) { - if (--this->actionDelay == 0) { + if (this->timer != 0) { + if (--this->timer == 0) { EnqueueSFX(SFX_12D); InitializeAnimation(this, 4); } @@ -160,8 +160,8 @@ void sub_08023E10(Entity* this) { void sub_08023E54(Entity* this) { Entity* ent; - if (this->field_0xf++ > 27) { - this->field_0xf = 0; + if (this->subtimer++ > 27) { + this->subtimer = 0; ent = CreateEnemy(SLUGGULA, 2); if (ent != NULL) { const s8* ptr = &gUnk_080CBDF7[this->animationState * 2]; diff --git a/src/enemy/smallPesto.c b/src/enemy/smallPesto.c index 1bb11fcd..a5d7b38f 100644 --- a/src/enemy/smallPesto.c +++ b/src/enemy/smallPesto.c @@ -41,7 +41,7 @@ void SmallPesto_OnGrabbed(Entity* this) { this->subAction = 0; COLLISION_ON(this); this->speed = 0x40; - this->field_0xf = 1; + this->subtimer = 1; } else { gUnk_080CE554[this->subAction](this); } @@ -49,7 +49,7 @@ void SmallPesto_OnGrabbed(Entity* this) { void sub_080316DC(Entity* this) { this->subAction = 1; - this->field_0x1d = 0x3c; + this->gustJarTolerance = 0x3c; } void sub_080316E8(Entity* this) { @@ -69,9 +69,9 @@ void sub_08031704(Entity* this) { void sub_08031714(Entity* this) { sub_080317B4(this); - if (--this->field_0xf == 0) { - this->field_0xf = (Random() & 0xf) + 0x10; - if (sub_08049FA0(this) == 0 && (this->field_0xf & 1) != 0) { + if (--this->subtimer == 0) { + this->subtimer = (Random() & 0xf) + 0x10; + if (sub_08049FA0(this) == 0 && (this->subtimer & 1) != 0) { this->direction = sub_08049EE4(this); } else { this->direction += 0x18; @@ -111,13 +111,13 @@ void sub_080317F8(Entity* this) { this->action = 1; this->z.HALF.HI = 0x0000FFF4; this->collisionLayer = 1; - this->field_0x3c |= 0x10; - this->field_0x1c = 1; + this->collisionFlags |= 0x10; + this->gustJarFlags = 1; this->direction = newDirection; this->hitbox = &gUnk_080CE560; sub_080317E0(this); - this->actionDelay = 0; - this->field_0xf = 0x20; + this->timer = 0; + this->subtimer = 0x20; } void sub_08031840(Entity* this) { diff --git a/src/enemy/spark.c b/src/enemy/spark.c index 32cb9345..6326654d 100644 --- a/src/enemy/spark.c +++ b/src/enemy/spark.c @@ -24,8 +24,8 @@ void Spark_OnTick(Entity* this) { void Spark_OnCollision(Entity* this) { Entity* ent; - if (this->bitfield & 0x80) { - if ((this->bitfield & 0x7f) == 0x14) { + if (this->contactFlags & 0x80) { + if ((this->contactFlags & 0x7f) == 0x14) { COLLISION_OFF(this); this->iframes = 0; this->spriteSettings.draw = 0; @@ -33,7 +33,7 @@ void Spark_OnCollision(Entity* this) { ent = CreateFx(this, FX_DEATH, 0); if (ent != NULL) { this->child = ent; - this->actionDelay = 14; + this->timer = 14; CopyPosition(this, ent); } } @@ -47,7 +47,7 @@ void sub_0802B33C(Entity* this) { sub_0804A720(this); this->action = 1; this->direction = this->type2; - this->field_0xf = 0x78; + this->subtimer = 0x78; InitializeAnimation(this, 0); } @@ -58,14 +58,14 @@ void sub_0802B35C(Entity* this) { ProcessMovement0(this); is_head = this->type == 0; if (this->collisions == COL_NONE) { - if (--this->field_0xf == 0) { - this->field_0xf = 0x78; + if (--this->subtimer == 0) { + this->subtimer = 0x78; this->direction += is_head ? 0x08 : 0x18; this->direction = DirectionRound(this->direction); } } else { - this->field_0xf = 0x78; + this->subtimer = 0x78; switch (DirectionRound(this->direction)) { case DirectionNorth: if ((this->collisions & COL_NORTH_ANY) != COL_NONE) { @@ -120,7 +120,7 @@ void sub_0802B35C(Entity* this) { } void sub_0802B4A8(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { Entity* ent = CreateObjectWithParent(this, GROUND_ITEM, 0x60, 0); if (ent != NULL) { ent->y.HALF.HI -= 4; diff --git a/src/enemy/spearMoblin.c b/src/enemy/spearMoblin.c index a824b803..1c4a1971 100644 --- a/src/enemy/spearMoblin.c +++ b/src/enemy/spearMoblin.c @@ -46,11 +46,11 @@ void SpearMoblin_OnCollision(Entity* this) { Create0x68FX(this, FX_STARS); EnemyFunctionHandlerAfterCollision(this, SpearMoblin_Functions); - if (this->bitfield & 0x80) { + if (this->contactFlags & 0x80) { if (this->action != 4) { sub_08028754(this); } else { - if ((this->bitfield & 0x3f) == 0) { + if ((this->contactFlags & 0x3f) == 0) { this->field_0x7a.HALF.LO++; this->field_0x80.HALF.HI = 0x16; sub_08028784(this); @@ -85,9 +85,9 @@ void sub_08028314(Entity* this) { this->field_0x7a.HALF.LO = 0; this->field_0x82.HALF.LO = 1; - if (this->actionDelay) { + if (this->timer) { this->animationState = this->type2 << 1; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->speed = 0x80; this->direction = this->animationState << 2; sub_080287E0(this); @@ -108,7 +108,7 @@ void sub_08028378(Entity* this) { this->field_0x80.HALF.HI--; } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (++this->field_0x80.HALF.LO >= 0x10) { sub_08028728(this); } else { @@ -126,19 +126,19 @@ void sub_08028378(Entity* this) { } } - if (this->field_0xf >= 0xc) { + if (this->subtimer >= 0xc) { if (this->field_0x7a.HALF.HI != 0) { sub_08028754(this); } } else { - this->field_0xf++; + this->subtimer++; } sub_08028858(this); } void sub_08028420(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; this->field_0x82.HALF.LO = 0; this->field_0x80.HALF.LO = 0; @@ -150,19 +150,19 @@ void sub_08028420(Entity* this) { } } - if (this->field_0xf >= 0xc) { + if (this->subtimer >= 0xc) { if (this->field_0x7a.HALF.HI != 0) { sub_08028754(this); } } else { - this->field_0xf++; + this->subtimer++; } sub_08028858(this); } void sub_08028488(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { switch (this->field_0x82.HALF.LO) { case 3: this->action = 4; @@ -173,7 +173,7 @@ void sub_08028488(Entity* this) { case 2: this->action = 2; this->speed = 0; - this->actionDelay = (Random() & 7) * 3 + 0x40; + this->timer = (Random() & 7) * 3 + 0x40; break; case 4: this->direction = (this->direction + 0x10) & 0x18; @@ -183,11 +183,11 @@ void sub_08028488(Entity* this) { this->action = 1; this->field_0x82.HALF.LO = 1; this->speed = 0x80; - this->actionDelay = (Random() & 7) * 3 + 0x22; + this->timer = (Random() & 7) * 3 + 0x22; break; } - this->field_0xf = 0; + this->subtimer = 0; this->animationState = DirectionRoundUp(this->direction) >> 2; sub_080287E0(this); } @@ -200,7 +200,7 @@ void sub_08028528(Entity* this) { const Hitbox* box; if (ent == NULL) { - this->field_0xf = 0; + this->subtimer = 0; sub_08028728(this); } else { sub_080288C0(this); @@ -215,16 +215,16 @@ void sub_08028528(Entity* this) { this->field_0x80.HALF.HI = 0x16; sub_08028784(this); } else { - if (++this->actionDelay == 0x20) { + if (++this->timer == 0x20) { u32 direction; - this->actionDelay = 0; + this->timer = 0; direction = GetFacingDirection(this, ent); if (sub_08028828(this->direction, direction)) { this->direction = direction; } } - if ((this->actionDelay & 7) == 0) { + if ((this->timer & 7) == 0) { EnqueueSFX(SFX_F0); CreateFx(this, FX_DEATH, 0x40); } @@ -243,9 +243,9 @@ void sub_08028528(Entity* this) { } NONMATCH("asm/non_matching/spearMoblin/sub_08028604.inc", void sub_08028604(Entity* this)) { - this->field_0xf = 0; + this->subtimer = 0; if (this->field_0x82.HALF.LO == 1) { - this->actionDelay = gUnk_080CC7BC[Random() & 3]; + this->timer = gUnk_080CC7BC[Random() & 3]; this->speed = 0x80; if (sub_08049FA0(this) != 0) { this->direction = gUnk_080CC7D0[Random() & 7] + 0x18 + (this->direction & 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->actionDelay = this->actionDelay + 0x10; + this->timer = this->timer + 0x10; this->field_0x82.HALF.HI--; } this->direction = iVar3 + uVar1 + (4U & 0x18); } } else { - this->actionDelay = 0xc; + this->timer = 0xc; this->speed = 0; } @@ -310,14 +310,14 @@ void sub_08028784(Entity* this) { this->direction = this->animationState << 2; this->field_0x82.HALF.HI = 0; sub_080287B4(this); - this->actionDelay <<= 1; + this->timer <<= 1; this->field_0x82.HALF.LO = 4; } void sub_080287B4(Entity* this) { this->action = 3; - this->actionDelay = 0x20; - this->field_0xf = 0; + this->timer = 0x20; + this->subtimer = 0; this->field_0x80.HALF.LO = 0; this->field_0x7a.HALF.HI = 0; this->speed = 0; @@ -380,7 +380,7 @@ bool32 sub_080288A4(Entity* this) { void sub_080288C0(Entity* this) { Entity* ent = this->child; - if ((ent != NULL) && (ent->bitfield & 0x80)) { + if ((ent != NULL) && (ent->contactFlags & 0x80)) { this->knockbackDirection = ent->knockbackDirection; this->iframes = -ent->iframes; this->knockbackSpeed = ent->knockbackSpeed; diff --git a/src/enemy/spikedBeetle.c b/src/enemy/spikedBeetle.c index e0dedef5..d4c1fb77 100644 --- a/src/enemy/spikedBeetle.c +++ b/src/enemy/spikedBeetle.c @@ -31,7 +31,7 @@ void SpikedBeetle_OnTick(Entity* this) { } void SpikedBeetle_OnCollision(Entity* this) { - switch (this->bitfield & 0x7f) { + switch (this->contactFlags & 0x7f) { case 0: case 4: case 5: @@ -42,7 +42,7 @@ void SpikedBeetle_OnCollision(Entity* this) { case 0xb: case 0xc: if (this->action == 4) { - this->actionDelay = 1; + this->timer = 1; } break; case 2: @@ -75,7 +75,7 @@ void SpikedBeetle_OnGrabbed(Entity* this) { void sub_0802B72C(Entity* this) { sub_0804A720(this); - this->actionDelay = 1; + this->timer = 1; this->animationState = 0xff; sub_0802B7A4(this); } @@ -86,25 +86,25 @@ void sub_0802B744(Entity* this) { GetNextFrame(this); if (sub_08049FDC(this, 1) && (direction = sub_0804A024(this, 1, 0xc), direction != 0xff)) { this->action = 3; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->direction = DirectionRound(direction); InitializeAnimation(this, 8); } else { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; - this->actionDelay = 0x1e; + this->timer = 0x1e; } else { if (!ProcessMovement0(this)) { - this->actionDelay = 1; + this->timer = 1; } } } } void sub_0802B7A4(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; - this->actionDelay = gUnk_080CD314[Random() & 3]; + this->timer = gUnk_080CD314[Random() & 3]; this->speed = 0x60; sub_0802B960(this); if (this->direction != 0xff) { @@ -119,22 +119,22 @@ void sub_0802B7A4(Entity* this) { void sub_0802B7FC(Entity* this) { GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 4; - this->actionDelay = 0x78; + this->timer = 0x78; this->speed = 0x1c0; } } void sub_0802B820(Entity* this) { if (!ProcessMovement2(this)) { - this->actionDelay = 1; + this->timer = 1; } GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_0802B9B4(this); } else if (sub_08049FDC(this, 1)) { - if ((this->actionDelay & 0xf) == 0) { + if ((this->timer & 0xf) == 0) { sub_08004596(this, GetFacingDirection(this, gUnk_020000B0)); } } else { @@ -143,9 +143,9 @@ void sub_0802B820(Entity* this) { } void sub_0802B880(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; - this->actionDelay = 0x3c; + this->timer = 0x3c; 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->actionDelay = 0x96; + this->timer = 0x96; /* fallthrough */ case 1: EnqueueSFX(SFX_12B); @@ -165,9 +165,9 @@ void sub_0802B8B0(Entity* this) { } void sub_0802B8E0(Entity* this) { - if (--this->actionDelay) { - if (this->actionDelay < 0x3c && (this->actionDelay & 1)) { - this->spriteOffsetX += gUnk_080CD318[(this->actionDelay >> 1) & 3]; + if (--this->timer) { + if (this->timer < 0x3c && (this->timer & 1)) { + this->spriteOffsetX += gUnk_080CD318[(this->timer >> 1) & 3]; } } else { this->action = 8; @@ -182,7 +182,7 @@ void sub_0802B8E0(Entity* this) { void sub_0802B948(Entity* this) { if (!GravityUpdate(this, 0x1800)) { this->action = 1; - this->actionDelay = 1; + this->timer = 1; } } @@ -204,7 +204,7 @@ void sub_0802B960(Entity* this) { void sub_0802B9B4(Entity* this) { this->action = 5; - this->actionDelay = 0x3c; + this->timer = 0x3c; this->animationState = (this->direction >> 3) & 3; InitializeAnimation(this, this->animationState + 4); } diff --git a/src/enemy/spinyBeetle.c b/src/enemy/spinyBeetle.c index cbdfe52e..d1a3e8ca 100644 --- a/src/enemy/spinyBeetle.c +++ b/src/enemy/spinyBeetle.c @@ -44,15 +44,15 @@ void SpinyBeetle_OnCollision(SpinyBeetleEntity* this) { } EnemyFunctionHandlerAfterCollision(super, SpinyBeetle_Functions); - if (super->bitfield & 0x80) { + if (super->contactFlags & 0x80) { if (super->iframes > 0 && super->child) { sub_08033E1C(this); } - if ((super->bitfield & 0x3f) == 0x14 && super->action != 5) { + if ((super->contactFlags & 0x3f) == 0x14 && super->action != 5) { super->action = 3; - super->actionDelay = 0x5a; - super->field_0xf = 0x10; + super->timer = 0x5a; + super->subtimer = 0x10; super->spritePriority.b1 = 1; super->direction = DirectionRoundUp(sub_08049F84(super, 1)); sub_08033D78(this); @@ -77,8 +77,8 @@ void SpinyBeetle_OnConfused(SpinyBeetleEntity* this) { void SpinyBeetle_Init(SpinyBeetleEntity* this) { Entity* obj; super->action = 1; - super->actionDelay = 0; - super->field_0xf = 0; + super->timer = 0; + super->subtimer = 0; this->unk_7c = (super->x.WORD & 0xfff00000) | 0x80000; this->unk_80 = (super->y.WORD & 0xfff00000) | 0x80000; super->x.WORD = this->unk_7c; @@ -175,8 +175,8 @@ void sub_08033A7C(SpinyBeetleEntity* this) { return; super->action = 3; - super->actionDelay = 0x78; - super->field_0xf = 0x20; + super->timer = 0x78; + super->subtimer = 0x20; super->spritePriority.b1 = 1; InitializeAnimation(super, 3); } @@ -190,14 +190,14 @@ void sub_08033ACC(SpinyBeetleEntity* this) { GetNextFrame(super); GetNextFrame(super); - if (super->field_0xf) { - super->field_0xf--; + if (super->subtimer) { + super->subtimer--; return; } - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 4; - super->actionDelay = 0x78; + super->timer = 0x78; super->x.WORD = (super->x.WORD & 0xfff00000) | 0x80000; super->y.WORD = (super->y.WORD & 0xfff00000) | 0xC0000; this->unk_7c = super->x.WORD; @@ -216,7 +216,7 @@ void sub_08033B44(SpinyBeetleEntity* this) { } GetNextFrame(super); - if (--super->actionDelay) + if (--super->timer) return; super->action = 1; @@ -267,10 +267,10 @@ void sub_08033C94(SpinyBeetleEntity* this) { super->spriteSettings.draw = 1; } case 1: - if (--super->actionDelay) + if (--super->timer) return; this->unk_79 = 2; - super->actionDelay = 0x78; + super->timer = 0x78; super->spriteOffsetY = 0; super->direction = sub_08049F84(super, 1) + 0x14; @@ -286,15 +286,15 @@ void sub_08033C94(SpinyBeetleEntity* this) { super->direction &= 0x18; break; case 2: - if (super->field_0xf != 0) { - super->field_0xf--; + if (super->subtimer != 0) { + super->subtimer--; } else { sub_08033D78(this); } - if (--super->actionDelay) + if (--super->timer) return; - super->actionDelay = (Random() & 0x1f) + 0x20; + super->timer = (Random() & 0x1f) + 0x20; super->direction = sub_08049F84(super, 1) + 0x14; switch (Random() & 3) { case 1: @@ -361,8 +361,8 @@ void sub_08033E1C(SpinyBeetleEntity* this) { super->y.WORD = (super->y.WORD & 0xfff00000) | 0xC0000; super->hitType = 0x19; super->spritePriority.b1 = 1; - super->actionDelay = 0x30; - super->field_0xf = 0; + super->timer = 0x30; + super->subtimer = 0; super->speed = 0x100; super->child = NULL; InitializeAnimation(super, 3); diff --git a/src/enemy/spinyChuchu.c b/src/enemy/spinyChuchu.c index 7499234b..9cb2653d 100644 --- a/src/enemy/spinyChuchu.c +++ b/src/enemy/spinyChuchu.c @@ -31,11 +31,11 @@ void SpinyChuchu_OnTick(Entity* this) { void SpinyChuchu_OnCollision(Entity* this) { if (this->health) { if (this->hitType == 0x65) { - switch (this->bitfield & 0x7f) { + switch (this->contactFlags & 0x7f) { case 2: case 3: this->action = 2; - this->field_0xf = 0x3c; + this->subtimer = 0x3c; this->hitType = 0x5c; this->hitbox = (Hitbox*)&gHitbox_23; InitializeAnimation(this, 0); @@ -54,7 +54,7 @@ void SpinyChuchu_OnCollision(Entity* this) { this->hitType = 0x5c; InitializeAnimation(this, 1); } - } else if (this->bitfield == 0x94) { + } else if (this->contactFlags == 0x94) { Create0x68FX(this, FX_STARS); this->action = 5; InitializeAnimation(this, 1); @@ -101,12 +101,12 @@ void sub_080225EC(Entity* this) { sub_0804A720(this); this->field_0x80.HALF.LO = this->health; this->field_0x80.HALF.HI = 0x5a; - if (this->actionDelay == 0) { + if (this->timer == 0) { this->action = 2; InitializeAnimation(this, 0); } else { this->action = 1; - this->field_0xf = 0x3c; + this->subtimer = 0x3c; this->spriteSettings.draw = 3; this->spriteRendering.b3 = 1; this->spriteOrientation.flipY = 1; @@ -118,7 +118,7 @@ void sub_080225EC(Entity* this) { void sub_08022654(Entity* this) { switch (this->subAction) { case 0: - if (--this->field_0xf) + if (--this->subtimer) return; this->subAction = 1; SoundReq(SFX_12D); @@ -136,7 +136,7 @@ void sub_08022654(Entity* this) { /* fallthrough */ case 2: GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; this->hitType = 0x65; InitializeAnimation(this, 2); @@ -164,7 +164,7 @@ void sub_080226EC(Entity* this) { return; } - if ((this->actionDelay++ & 7) == 0) { + if ((this->timer++ & 7) == 0) { this->direction = sub_08049F84(this, 1); } @@ -198,7 +198,7 @@ void sub_080227AC(Entity* this) { if (this->frame & ANIM_DONE) { this->action = 2; - this->field_0xf = gUnk_080CBA60[Random() & 3]; + this->subtimer = gUnk_080CBA60[Random() & 3]; InitializeAnimation(this, 0); } } @@ -238,11 +238,11 @@ void sub_0802289C(Entity* this) { } u32 sub_080228CC(Entity* this) { - if (this->field_0xf == 0) { + if (this->subtimer == 0) { if (PlayerInRange(this, 1, 0x28)) return 1; } else { - this->field_0xf--; + this->subtimer--; } return 0; } diff --git a/src/enemy/stalfos.c b/src/enemy/stalfos.c index 31086dc1..a8209b1f 100644 --- a/src/enemy/stalfos.c +++ b/src/enemy/stalfos.c @@ -75,8 +75,8 @@ void Stalfos_OnTick(StalfosEntity* this) { NONMATCH("asm/non_matching/stalfos/sub_0803933C.inc", void sub_0803933C(StalfosEntity* this)) { if (super->hitType == 0x44) { - if ((super->bitfield & 0x7f) < 7) { - if ((super->bitfield & 0x7f) > 3) { + if ((super->contactFlags & 0x7f) < 7) { + if ((super->contactFlags & 0x7f) > 3) { if (super->iframes < 1) { super->action = 4; super->direction = super->knockbackDirection; @@ -87,7 +87,7 @@ NONMATCH("asm/non_matching/stalfos/sub_0803933C.inc", void sub_0803933C(StalfosE } } } - if (super->bitfield == 0x9d) { + if (super->contactFlags == 0x9d) { if (super->child == NULL) { if (super->action < 9) { Entity* projectile = CreateProjectileWithParent(super, STALFOS_PROJECTILE, 1); @@ -100,7 +100,7 @@ NONMATCH("asm/non_matching/stalfos/sub_0803933C.inc", void sub_0803933C(StalfosE this->unk_78 += 0x5a; } } else { - super->child->bitfield = 0x9d; + super->child->contactFlags = 0x9d; EnqueueSFX(SFX_186); super->child = NULL; sub_08039A48(this); @@ -131,7 +131,7 @@ void sub_08039438(StalfosEntity* this) { void Stalfos_SubAction0(StalfosEntity* this) { super->subAction = 1; - super->field_0x1d = 0x5a; + super->gustJarTolerance = 0x5a; } void Stalfos_SubAction1(StalfosEntity* this) { @@ -150,7 +150,7 @@ void Stalfos_SubAction2(StalfosEntity* this) { COLLISION_ON(projectile); } super->child = NULL; - super->field_0x3a &= 0xfb; + super->gustJarState &= 0xfb; super->flags2 &= 0xfb; sub_08039A48(this); this->unk_78 += 0x5a; @@ -176,13 +176,13 @@ void Stalfos_Init(StalfosEntity* this) { void Stalfos_Action1(StalfosEntity* this) { if (GravityUpdate(super, 0x1800) == 0 && sub_08039758(this) == 0 && --this->unk_78 == 0) { super->action = 2; - super->actionDelay = 0xa; + super->timer = 0xa; sub_08039858(this); } } void Stalfos_Action2(StalfosEntity* this) { - if (sub_08039758(this) == 0 && --super->actionDelay == 0) { + if (sub_08039758(this) == 0 && --super->timer == 0) { sub_0803992C(this); } } @@ -215,20 +215,20 @@ void Stalfos_Action5(StalfosEntity* this) { GravityUpdate(super, 0x1800); if (super->zVelocity < 0) { super->action = 6; - super->actionDelay = 0x0f; + super->timer = 0x0f; } } void Stalfos_Action6(StalfosEntity* this) { u16 tmp; - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } else { tmp = super->z.HALF.HI += 4; if (-1 < (tmp * 0x10000)) { super->action = 7; - super->actionDelay = 0xa; + super->timer = 0xa; super->z.HALF.HI = 0; this->unk_7a = 0x78; this->unk_7c = 0x3c; @@ -239,17 +239,17 @@ void Stalfos_Action6(StalfosEntity* this) { } void Stalfos_Action7(StalfosEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_0803998C(this); } } void Stalfos_Action8(StalfosEntity* this) { UpdateAnimationSingleFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_08039A00(this, 0x3c); sub_0803998C(this); - } else if ((super->actionDelay & 0x1f) == 0) { + } else if ((super->timer & 0x1f) == 0) { sub_08039A20(this); } } @@ -303,7 +303,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->actionDelay = 0x3c; + super->timer = 0x3c; 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 64c61158..41de753b 100644 --- a/src/enemy/takkuri.c +++ b/src/enemy/takkuri.c @@ -41,8 +41,8 @@ void Takkuri_OnTick(TakkuriEntity* this) { } void Takkuri_OnCollision(TakkuriEntity* this) { - if (super->bitfield & 0x80) { - if ((super->bitfield & 0x7f) == 0) { + if (super->contactFlags & 0x80) { + if ((super->contactFlags & 0x7f) == 0) { u32 direction; sub_0803C0AC(super); COLLISION_OFF(super); @@ -78,7 +78,7 @@ void Takkuri_OnGrabbed(TakkuriEntity* this) { super->action = 2; super->subAction = 0; this->unk_0x84 = 2; - super->actionDelay = 8; + super->timer = 8; super->speed = 0x1c0; sub_0803BF2C(this); } @@ -86,7 +86,7 @@ void Takkuri_OnGrabbed(TakkuriEntity* this) { void sub_0803BC7C(TakkuriEntity* this) { super->subAction = 1; - super->field_0x1d = 0x3c; + super->gustJarTolerance = 0x3c; } void sub_0803BC88(TakkuriEntity* this) { @@ -103,12 +103,12 @@ void sub_0803BCA4(TakkuriEntity* this) { sub_0804A720(super); super->action = 1; - super->field_0xf = 0; + super->subtimer = 0; super->direction = sub_08049F84(super, 1); this->unk_0x80 = 0; this->unk_0x81 = 0; - super->field_0x1c = 1; - super->field_0x3c |= 0x10; + super->gustJarFlags = 1; + super->collisionFlags |= 0x10; super->collisionLayer = 3; super->spriteOrientation.flipY = 1; this->x_0x78 = super->x.HALF.HI; @@ -120,9 +120,9 @@ void sub_0803BCA4(TakkuriEntity* this) { void sub_0803BD08(TakkuriEntity* this) { Entity* ent; - if (super->field_0xf) { + if (super->subtimer) { if (CheckOnScreen(super) == 0) { - super->field_0xf = 0; + super->subtimer = 0; super->spriteSettings.draw = 1; } else { return; @@ -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->actionDelay = 0x10; + super->timer = 0x10; this->unk_0x81 = 2; sub_0803BF2C(this); } @@ -155,7 +155,7 @@ void sub_0803BD90(TakkuriEntity* this) { super->spriteSettings.draw = 4; COLLISION_OFF(super); super->spritePriority.b1 = 1; - super->actionDelay = 8; + super->timer = 8; } else { sub_0803BF48(this); GetNextFrame(super); @@ -163,7 +163,7 @@ void sub_0803BD90(TakkuriEntity* this) { } void sub_0803BDD8(TakkuriEntity* this) { - if (--super->actionDelay) { + if (--super->timer) { return; } @@ -183,7 +183,7 @@ void sub_0803BDD8(TakkuriEntity* this) { COLLISION_ON(super); super->action = 2; this->unk_0x84 = 1; - super->actionDelay = 0x18; + super->timer = 0x18; this->unk_0x82 = 0x12c; super->speed = 0x12c + 0x94; this->unk_0x81 = 4; @@ -199,8 +199,8 @@ void sub_0803BE7C(TakkuriEntity* this) { super->action = 1; super->spriteSettings.draw = 1; COLLISION_OFF(super); - super->actionDelay = 0x8; - super->field_0xf = 1; + super->timer = 0x8; + super->subtimer = 1; super->direction = sub_08049F84(super, 1); this->unk_0x80 = 0; super->spritePriority.b1 = 3; @@ -211,7 +211,7 @@ void sub_0803BE7C(TakkuriEntity* this) { } void sub_0803BEE8(TakkuriEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { u32 direction; this->unk_0x80 = super->direction; direction = sub_08049F84(super, 1); @@ -219,7 +219,7 @@ void sub_0803BEE8(TakkuriEntity* this) { super->direction = direction; } - super->actionDelay = 8; + super->timer = 8; if (DirectionIsVertical(this->unk_0x80) != DirectionIsVertical(super->direction)) { sub_0803BF2C(this); } @@ -241,21 +241,21 @@ void sub_0803BF70(TakkuriEntity* this) { u32 tmp1, tmp2, tmp3; switch (this->unk_0x84) { case 0: - if (super->actionDelay & 0x1) { + if (super->timer & 0x1) { super->z.HALF.HI--; } - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->unk_0x84 = 1; - super->actionDelay = 0x18; + super->timer = 0x18; COLLISION_ON(super); this->unk_0x81 = 2; sub_0803BF2C(this); } break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->unk_0x84 = 2; - super->actionDelay = 8; + super->timer = 8; super->speed = 0x1c0; this->unk_0x81 = 4; sub_0803BF2C(this); @@ -265,7 +265,7 @@ void sub_0803BF70(TakkuriEntity* this) { if (--this->unk_0x82 == 0) { super->action = 3; this->unk_0x84 = 0; - super->actionDelay = 0; + super->timer = 0; super->speed = 0x180; if ((super->direction + 0x18) & 0x10) { super->direction = (0x10 - super->direction) & 0x1f; @@ -273,8 +273,8 @@ void sub_0803BF70(TakkuriEntity* this) { sub_0803BF2C(this); } else { - if (--super->actionDelay == 0) { - super->actionDelay = 8; + if (--super->timer == 0) { + super->timer = 8; this->unk_0x80 = super->direction; sub_08004596(super, sub_08049F84(super, 1)); if ((super->direction + 0x18) & 0x10) { diff --git a/src/enemy/tektite.c b/src/enemy/tektite.c index 776f08e5..da49b413 100644 --- a/src/enemy/tektite.c +++ b/src/enemy/tektite.c @@ -33,17 +33,17 @@ void Tektite_OnCollision(Entity* this) { Create0x68FX(this, FX_STARS); } EnemyFunctionHandlerAfterCollision(this, Tektite_Functions); - if ((this->bitfield & 0x80) != 0) { - switch (this->bitfield & 0x3f) { + if ((this->contactFlags & 0x80) != 0) { + switch (this->contactFlags & 0x3f) { case 0x14: this->action = 1; this->subAction = 0; if (this->type != 0) { - this->actionDelay = 0xc0; + this->timer = 0xc0; } else { - this->actionDelay = gUnk_080CDEF8[Random() & 3]; + this->timer = gUnk_080CDEF8[Random() & 3]; } - this->field_0xf = 0; + this->subtimer = 0; *(u8*)&this->field_0x7c = 0; if (this->z.HALF.HI != 0) { this->zVelocity >>= 2; @@ -77,9 +77,9 @@ void sub_0802F210(Entity* this) { sub_0804A720(this); this->action = 1; this->subAction = 0; - this->actionDelay = gUnk_080CDEF8[Random() & 3]; - this->actionDelay = (Random() & 0x1f) + this->actionDelay; - this->field_0xf = 0; + this->timer = gUnk_080CDEF8[Random() & 3]; + this->timer = (Random() & 0x1f) + this->timer; + this->subtimer = 0; *(u8*)&this->field_0x7c = 0; this->field_0x80.HWORD = this->type == 0 ? 0x1800 : 0x2800; @@ -90,24 +90,24 @@ void sub_0802F210(Entity* this) { } void sub_0802F284(Entity* this) { - if (this->actionDelay > 0x60) { + if (this->timer > 0x60) { UpdateAnimationVariableFrames(this, 2); } else { GetNextFrame(this); } - if (this->actionDelay != 0) { - this->actionDelay--; - } else if (this->field_0xf != 0) { + if (this->timer != 0) { + this->timer--; + } else if (this->subtimer != 0) { if (this->frame & ANIM_DONE) { this->action = 2; - this->actionDelay = 0x10; - this->field_0xf = this->type; + this->timer = 0x10; + this->subtimer = this->type; this->zVelocity = this->field_0x82.HWORD << 4; sub_0802F45C(this); InitializeAnimation(this, 2); } } else if (this->frame & ANIM_DONE) { - this->field_0xf = 0x40; + this->subtimer = 0x40; InitializeAnimation(this, 1); } } @@ -129,11 +129,11 @@ void sub_0802F300(Entity* this) { } if (rand == 0) { - this->actionDelay = 0xc0; + this->timer = 0xc0; } else { - this->actionDelay = gUnk_080CDEF8[rand & 3] + rand; + this->timer = gUnk_080CDEF8[rand & 3] + rand; } - this->field_0xf = 0; + this->subtimer = 0; InitializeAnimation(this, 3); return; } else if (this->collisions != COL_NONE) { @@ -142,10 +142,10 @@ void sub_0802F300(Entity* this) { this->direction = (this->direction + 0x10) & 0x1f; } - if (--this->actionDelay == 0) { - this->actionDelay = 0x10; - if (this->field_0xf != 0) { - this->field_0xf--; + if (--this->timer == 0) { + this->timer = 0x10; + if (this->subtimer != 0) { + this->subtimer--; sub_0802F45C(this); } } @@ -171,8 +171,8 @@ 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->actionDelay = 0x10; - this->field_0xf = this->type; + this->timer = 0x10; + this->subtimer = this->type; this->zVelocity = this->field_0x82.HWORD << 4; (*(u8*)&this->field_0x7c.HALF.LO)++; sub_0802F45C(this); diff --git a/src/enemy/tektiteGolden.c b/src/enemy/tektiteGolden.c index f8862aa8..c77cfdaa 100644 --- a/src/enemy/tektiteGolden.c +++ b/src/enemy/tektiteGolden.c @@ -30,11 +30,11 @@ void TektiteGolden_OnCollision(Entity* this) { Create0x68FX(this, FX_STARS); } EnemyFunctionHandlerAfterCollision(this, &TektiteGolden_Functions); - if (this->bitfield == 0x94) { + if (this->contactFlags == 0x94) { this->action = 1; this->subAction = 0; - this->actionDelay = 0x14; - this->field_0xf = 0; + this->timer = 0x14; + this->subtimer = 0; this->field_0x80.HALF.LO = 0; if (this->z.HALF.HI != 0) { this->zVelocity >>= 2; @@ -49,7 +49,7 @@ void TektiteGolden_OnCollision(Entity* this) { void TektiteGolden_OnDeath(Entity* this) { u32 uVar1; - if ((this->field_0x3a & 2) == 0) { + if ((this->gustJarState & 2) == 0) { SetGlobalFlag(this->type2); } if (this->type != 0) { @@ -75,27 +75,27 @@ void sub_08037FA0(Entity* this) { sub_0804A720(this); this->action = 1; this->subAction = 0; - this->actionDelay = (Random() & 0x1f) + 0x20; - this->field_0xf = 0; + this->timer = (Random() & 0x1f) + 0x20; + this->subtimer = 0; this->field_0x80.HALF.LO = 0; InitializeAnimation(this, 0); } void sub_08037Fe0(Entity* this) { UpdateAnimationVariableFrames(this, 2); - if (this->actionDelay != 0) { - this->actionDelay--; - } else if (this->field_0xf != 0) { + if (this->timer != 0) { + this->timer--; + } else if (this->subtimer != 0) { if (this->frame & ANIM_DONE) { this->action = 2; - this->actionDelay = 6; - this->field_0xf = 0; + this->timer = 6; + this->subtimer = 0; this->zVelocity = Q_16_16(3.5); sub_08038168(this); InitializeAnimation(this, 2); } } else if (this->frame & ANIM_DONE) { - this->field_0xf = 0x40; + this->subtimer = 0x40; InitializeAnimation(this, 1); } } @@ -112,7 +112,7 @@ void sub_08038048(Entity* this) { if (sub_080044EC(this, 0x3000) == 1) { this->action = 3; this->subAction = 0; - this->actionDelay = 0x14; + this->timer = 0x14; InitializeAnimation(this, 3); return; } else if (this->collisions != COL_NONE) { @@ -121,8 +121,8 @@ void sub_08038048(Entity* this) { this->direction = (this->direction + 0x10) & 0x1f; } - if (--this->actionDelay == 0) { - this->actionDelay = rand + 0x10; + if (--this->timer == 0) { + this->timer = rand + 0x10; sub_08038168(this); } @@ -145,14 +145,14 @@ void sub_08038110(Entity* this) { if (this->frame & ANIM_DONE) { if (this->field_0x80.HALF.LO < 5) { this->action = 2; - this->actionDelay = 8; + this->timer = 8; this->zVelocity = Q_16_16(3.5); sub_08038168(this); InitializeAnimation(this, 2); } else { this->action = 1; this->field_0x80.HALF.LO = 0; - this->actionDelay = 0xc0; + this->timer = 0xc0; InitializeAnimation(this, 0); } } diff --git a/src/enemy/treeItem.c b/src/enemy/treeItem.c index 47264fdd..00005671 100644 --- a/src/enemy/treeItem.c +++ b/src/enemy/treeItem.c @@ -56,7 +56,7 @@ void TreeItem(Entity* this) { case FAIRY_INDEX: itemEntity = CreateObject(FAIRY, 0x60, 0); if (itemEntity) { - itemEntity->actionDelay = 0; + itemEntity->timer = 0; CopyPosition(this, itemEntity); } break; diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c index d9f17946..e032cdaa 100644 --- a/src/enemy/vaatiArm.c +++ b/src/enemy/vaatiArm.c @@ -266,7 +266,7 @@ void sub_08042654(Entity* this) { if ((((VaatiArm_HeapStruct*)this->myHeap)->s1[4].unk0c += 2) < 0x1c) break; this->subAction = 5; - this->actionDelay = 0x5a; + this->timer = 0x5a; ((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; @@ -281,7 +281,7 @@ void sub_08042654(Entity* this) { SoundReq(SFX_15E); break; default: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_08043BC8(this); } break; @@ -335,7 +335,7 @@ void sub_080428AC(Entity* this) { pVVar3->unk00.HWORD += pVVar3->unk08; } else { this->subAction = 2; - this->actionDelay = 0x1e; + this->timer = 0x1e; } sub_08043BF0(this); } @@ -344,7 +344,7 @@ void sub_080428FC(Entity* this) { u32 uVar2; VaatiArm_HeapStruct1* ptr; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 3; ptr = &((VaatiArm_HeapStruct*)this->myHeap)->s1[0]; ptr->unk08 *= -3; @@ -380,7 +380,7 @@ void sub_08042970(Entity* this) { pVVar3->unk00.HWORD += pVVar3->unk08; } else { this->subAction = 5; - this->actionDelay = 0x3c; + this->timer = 0x3c; uVar2 = 0; do { ((VaatiArm_HeapStruct*)this->myHeap)->entities[uVar2]->hitType = 0x39; @@ -394,7 +394,7 @@ void sub_080429D4(Entity* this) { s16 sVar2; VaatiArm_HeapStruct1* pVVar3; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 6; pVVar3 = &((VaatiArm_HeapStruct*)this->myHeap)->s1[0]; sVar2 = -this->speed / 6; @@ -448,14 +448,14 @@ void sub_08042A88(Entity* this) { pVVar4->unk04.HWORD = 0; pVVar4->unk08 = gUnk_080D12CA[this->type2]; this->subAction = 2; - this->actionDelay = 0x1e; + this->timer = 0x1e; } } void sub_08042AEC(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 3; - this->actionDelay = 4; + this->timer = 4; this->hitType = 0x3d; InitAnimationForceUpdate(this, 0xe); ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x3d; @@ -500,10 +500,10 @@ void sub_08042B20(Entity* this) { } } else { this->field_0x78.HALF.LO += 2; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 5; this->subAction = 0; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->hitType = 0x39; ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x39; } @@ -525,9 +525,9 @@ void sub_08042C34(Entity* this) { VaatiArm_HeapStruct1* ptr; - if (--this->actionDelay == 0) { - this->actionDelay = 0x3c; - this->field_0xf = 3; + if (--this->timer == 0) { + this->timer = 0x3c; + this->subtimer = 3; this->subAction = 1; random = Random() & 6; temp = &gUnk_080D12F8[random]; @@ -575,7 +575,7 @@ void sub_08042C34(Entity* this) { void sub_08042D24(Entity* this) { Entity* entity; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 2; this->hitType = 0x3d; ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x3d; @@ -612,7 +612,7 @@ 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->actionDelay = 0x1e; + this->timer = 0x1e; this->hitType = 0x39; this->field_0x7c.BYTES.byte3 = 0x2d; InitAnimationForceUpdate(this, 0); @@ -635,9 +635,9 @@ void sub_08042E30(Entity* this) { this->field_0x7c.BYTES.byte3--; } pVVar9 = &((VaatiArm_HeapStruct*)this->myHeap)->s1[0]; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 4; - this->actionDelay = (Random() & 0x38) + 0x28; + this->timer = (Random() & 0x38) + 0x28; this->speed = 0x200; this->direction = pVVar9->unk00.HALF.HI >> 3; uVar6 = CalculateDirectionTo(this->x.HALF.HI, this->y.HALF.HI, gRoomControls.origin_x + 0x110, @@ -668,10 +668,10 @@ void sub_08042EF4(Entity* this) { UpdateAnimationSingleFrame(this); if (sub_08043C98(this) == 0) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x50)) { this->subAction = 6; - this->actionDelay = 0x28; + this->timer = 0x28; } else { this->subAction = 5; InitAnimationForceUpdate(this, 0xf); @@ -714,12 +714,12 @@ void sub_08042FD8(Entity* this) { } } else { if (this->frame & ANIM_DONE) { - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->subAction = 8; - this->actionDelay = 0x3c; + this->timer = 0x3c; } else { this->subAction = 3; - this->actionDelay = 0x3c; + this->timer = 0x3c; InitAnimationForceUpdate(this, 0); } } @@ -743,7 +743,7 @@ void sub_08043048(Entity* this) { } } else { ptr[0].unk00.HWORD += ptr[0].unk08 * 8; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 7; for (i = 0; i < 5; i++) { ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->hitType = 0x39; @@ -762,12 +762,12 @@ void sub_080430D0(Entity* this) { ptr[0].unk00.HWORD += ptr[0].unk08; ptr[0].unk04.HWORD -= 0x100; if (ptr[0].unk04.HALF.HI < 0x18) { - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->subAction = 8; - this->actionDelay = 0x3c; + this->timer = 0x3c; } else { this->subAction = 3; - this->actionDelay = 0x3c; + this->timer = 0x3c; ptr[0].unk0a = -0xc0; InitAnimationForceUpdate(this, 0); } @@ -788,8 +788,8 @@ void sub_08043130(Entity* this) { } } } else { - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; for (i = 1; i < 4; i++) { ptr = &((VaatiArm_HeapStruct*)this->myHeap)->s1[i]; if (ptr->unk04.HALF.HI != 0) { @@ -810,7 +810,7 @@ void sub_08043130(Entity* this) { } if (this->spriteSettings.draw == 0) { this->subAction = 9; - this->actionDelay = 0x3c; + this->timer = 0x3c; sub_0804AA1C(this); } } @@ -821,7 +821,7 @@ void sub_080431E8(Entity* this) { u32 i; VaatiArm_HeapStruct1* ptr; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 6; this->subAction = 0; for (i = 0; i < 4; i++) { @@ -864,8 +864,8 @@ NONMATCH("asm/non_matching/vaati/sub_0804334C.inc", void sub_0804334C(Entity* th u32 i; u8* ptr; - if (this->actionDelay != 0) { - if (--this->actionDelay != 0) { + if (this->timer != 0) { + if (--this->timer != 0) { return; } for (i = 0; i < 5; i++) { @@ -958,7 +958,7 @@ void sub_08043490(Entity* this) { if (entity->z.HALF.HI < 0) { entity->flags = entity->flags | ENT_COLLIDE; entity->spriteSettings.draw = 1; - entity->field_0x3c = entity->field_0x3c & 0xef; + entity->collisionFlags = entity->collisionFlags & 0xef; entity->hitType = 0x3a; entity->hitbox = (Hitbox*)&gUnk_080FD450; entity2 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[2]; @@ -1004,9 +1004,9 @@ void sub_08043580(Entity* this) { } if ((this->spriteSettings.draw & 3) == 0) { this->subAction = 5; - this->actionDelay = 0x3c; + this->timer = 0x3c; entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]; - entity->field_0x3c = entity->field_0x3c | 0x10; + entity->collisionFlags = entity->collisionFlags | 0x10; entity->hitType = 0x39; entity->hitbox = (Hitbox*)&gUnk_080FD538; sub_0804AA1C(this); @@ -1018,10 +1018,10 @@ void sub_080435F4(Entity* this) { u32 i; VaatiArm_HeapStruct1* ptr; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 6; this->subAction = 1; - this->actionDelay = 1; + this->timer = 1; for (i = 0; i < 5; i++) { ptr = &((VaatiArm_HeapStruct*)this->myHeap)->s1[i]; ptr->unk00.HWORD = gUnk_080D1338[this->type2]; @@ -1047,7 +1047,7 @@ void sub_08043698(Entity* this) { u32 i; this->subAction = 1; - this->actionDelay = 0x3c; + this->timer = 0x3c; for (i = 0; i < 5; i++) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; entity->flags = entity->flags & ~ENT_COLLIDE; @@ -1055,8 +1055,8 @@ void sub_08043698(Entity* this) { } static inline void deleteThing(Entity* this, const u32 index) { - if (--this->actionDelay == 0) { - this->actionDelay = 0x14; + if (--this->timer == 0) { + this->timer = 0x14; this->subAction = index + 1; if (index == 1) { this->spriteSettings.draw = 0; @@ -1082,7 +1082,7 @@ void sub_08043738(Entity* this) { void sub_08043770(Entity* this) { Entity* entity; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->parent; if ((gRoomTransition.field_0x39 & 0xc) == 0) { entity->subAction = 2; @@ -1112,30 +1112,30 @@ u32 sub_080437DC(Entity* this) { if (heapStruct == NULL) return 0; this->spritePriority.b0 = 5; - this->field_0x3c = this->field_0x3c | 0x10; + this->collisionFlags = this->collisionFlags | 0x10; this->myHeap = (u32*)heapStruct; heapStruct->entities[0] = this; entity = CreateEnemy(VAATI_ARM, 1); entity->spritePriority.b0 = 5; - entity->field_0x3c = entity->field_0x3c | 0x10; + entity->collisionFlags = entity->collisionFlags | 0x10; entity->myHeap = (u32*)heapStruct; heapStruct->entities[1] = entity; CopyPosition(this, entity); entity = CreateEnemy(VAATI_ARM, 2); entity->spritePriority.b0 = 5; - entity->field_0x3c = entity->field_0x3c | 0x10; + entity->collisionFlags = entity->collisionFlags | 0x10; entity->myHeap = (u32*)heapStruct; heapStruct->entities[2] = entity; CopyPosition(this, entity); entity = CreateEnemy(VAATI_ARM, 3); entity->spritePriority.b0 = 5; - entity->field_0x3c = entity->field_0x3c | 0x10; + entity->collisionFlags = entity->collisionFlags | 0x10; entity->myHeap = (u32*)heapStruct; heapStruct->entities[3] = entity; CopyPosition(this, entity); entity = CreateEnemy(VAATI_ARM, 4); entity->spritePriority.b0 = 5; - entity->field_0x3c = entity->field_0x3c | 0x10; + entity->collisionFlags = entity->collisionFlags | 0x10; entity->myHeap = (u32*)heapStruct; heapStruct->entities[4] = entity; CopyPosition(this, entity); @@ -1284,7 +1284,7 @@ void sub_08043C40(Entity* this, VaatiArm_HeapStruct1* heapStruct) { u32 sub_08043C98(Entity* this) { #if defined EU || defined JP Entity* e1 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3]; - if ((e1->bitfield == 0x9d)) { + if ((e1->contactFlags == 0x9d)) { sub_08043D08(this); return 1; } else { @@ -1293,7 +1293,7 @@ u32 sub_08043C98(Entity* this) { #else Entity* e1 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[2]; Entity* e2 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3]; - if ((e1->bitfield == 0x9d) || (e2->bitfield == 0x9d)) { + if ((e1->contactFlags == 0x9d) || (e2->contactFlags == 0x9d)) { sub_08043D08(this); gRoomTransition.field_0x38 |= 2; return 1; @@ -1306,7 +1306,7 @@ u32 sub_08043C98(Entity* this) { void sub_08043CD4(Entity* this) { u32 i; for (i = 0; i < 5; i++) { - if (((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->bitfield == 0x9d) { + if (((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->contactFlags == 0x9d) { this->field_0x7c.BYTES.byte0 = 0x78; this->field_0x7c.BYTES.byte1 = i; return; @@ -1406,7 +1406,7 @@ void sub_08043EB8(Entity* this) { pEVar4->x.HALF.HI = (this->type2 == 0) ? gRoomTransition.field_0x44 : gRoomTransition.field_0x48; pEVar4->y.HALF.HI = (this->type2 == 0) ? gRoomTransition.field_0x46 : gRoomTransition.field_0x4a; pEVar4->z.HALF.HI = 0; - pEVar4->field_0x3c = pEVar4->field_0x3c & 0xef; + pEVar4->collisionFlags = pEVar4->collisionFlags & 0xef; pEVar4->hitType = 0x3a; pEVar4->hitbox = (Hitbox*)&gUnk_080FD450; pEVar4 = CreateObject(OBJECT_AF, 0, 0); diff --git a/src/enemy/vaatiBall.c b/src/enemy/vaatiBall.c index fa72f6f8..8d3da887 100644 --- a/src/enemy/vaatiBall.c +++ b/src/enemy/vaatiBall.c @@ -35,8 +35,8 @@ void VaatiBall(Entity* this) { this->health = -1; } - if (this->bitfield & 0x80) { - if ((this->bitfield & 0x3f) == 0 && this->action == 6) { + if (this->contactFlags & 0x80) { + if ((this->contactFlags & 0x3f) == 0 && this->action == 6) { ModHealth(-2); } @@ -65,7 +65,7 @@ void sub_0804468C(Entity* this) { switch (this->type) { case 0: this->action = 1; - this->actionDelay = 1; + this->timer = 1; this->direction = (this->field_0x78.HALF.HI * 8) & 0x1f; this->field_0x78.HALF.LO = 0; this->field_0x82.HALF.HI = 0; @@ -90,17 +90,17 @@ void sub_0804474C(Entity* this) { case 3: this->action = 3; this->field_0x74.HALF.LO = 0; - this->actionDelay = 0; + this->timer = 0; break; case 5: this->action = 5; this->field_0x74.HALF.LO = 0; - this->field_0xf = 1; + this->subtimer = 1; break; case 6: this->action = 6; this->field_0x74.HALF.LO = 0; - this->field_0xf = 32; + this->subtimer = 32; break; case 2: this->action = 2; @@ -112,8 +112,8 @@ void sub_0804474C(Entity* this) { if (this->action != 1) { UpdateAnimationSingleFrame(this); } else { - if (--this->actionDelay == 0) { - this->actionDelay = 2; + if (--this->timer == 0) { + this->timer = 2; this->direction++; this->direction &= 0x1f; } @@ -174,7 +174,7 @@ void sub_08044868(Entity* this) { this->field_0x74.HALF.LO++; this->x.HALF.HI = vaati->x.HALF.HI; this->y.HALF.HI = vaati->y.HALF.HI - 0x10; - vaati->actionDelay++; + vaati->timer++; } else { this->direction = sub_080045B4(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10); } @@ -200,11 +200,11 @@ void sub_08044868(Entity* this) { } } } - this->actionDelay = 32; + this->timer = 32; break; case 2: - if (this->actionDelay) - if (--this->actionDelay < 0x11) + if (this->timer) + if (--this->timer < 0x11) LinearMoveUpdate(this); break; case 3: { @@ -235,7 +235,7 @@ void sub_080449F8(Entity* this) { switch (vaati->field_0x74.HALF.LO) { case 0: LinearMoveUpdate(this); - if (--this->actionDelay) + if (--this->timer) break; if (this->field_0x78.HALF.LO == 0) { @@ -243,17 +243,17 @@ void sub_080449F8(Entity* this) { this->speed = 640; } - this->actionDelay = 4; + this->timer = 4; this->direction++; this->direction &= 0x1f; if (vaati->field_0x80.HALF.LO == 0) vaati->field_0x74.HALF.LO = 1; break; case 1: - switch (this->actionDelay) { + switch (this->timer) { case 2: if (vaati->field_0x80.HALF.LO == 0) { - this->field_0xf = 0; + this->subtimer = 0; sub_08044E74(this, 0); } break; @@ -261,16 +261,16 @@ void sub_080449F8(Entity* this) { this->direction = (this->direction + 0x10) & 0x1f; LinearMoveUpdate(this); this->direction = (this->direction + 0x10) & 0x1f; - this->actionDelay = 2; + this->timer = 2; break; case 3: LinearMoveUpdate(this); - this->actionDelay = 2; + this->timer = 2; break; case 4: LinearMoveUpdate(this); LinearMoveUpdate(this); - this->actionDelay = 2; + this->timer = 2; break; } break; @@ -291,8 +291,8 @@ void sub_080449F8(Entity* this) { } break; case 3: - if (this->field_0xf) { - this->field_0xf = 0; + if (this->subtimer) { + this->subtimer = 0; } break; } @@ -304,7 +304,7 @@ void sub_08044B04(Entity* this) { UpdateAnimationSingleFrame(this); if (vaati->action == 1) { sub_08044E74(this, 0); - this->actionDelay = 32; + this->timer = 32; return; } @@ -313,22 +313,22 @@ void sub_08044B04(Entity* this) { LinearMoveUpdate(this); switch (this->field_0x74.HALF.LO) { case 0: - if (--this->actionDelay == 0) { - this->actionDelay = this->field_0x78.HALF.LO ? 4 : 2; + if (--this->timer == 0) { + this->timer = this->field_0x78.HALF.LO ? 4 : 2; this->direction++; this->direction &= 0x1f; } - if (--this->field_0xf == 0) { - if (this->actionDelay != 2) { - this->field_0xf = 1; + if (--this->subtimer == 0) { + if (this->timer != 2) { + this->subtimer = 1; } else { if (++this->field_0x78.HALF.LO > 2) { this->field_0x74.HALF.LO++; this->field_0x78.HALF.LO = 1; - this->actionDelay = 4; - this->field_0xf = 0; + this->timer = 4; + this->subtimer = 0; } else { - this->field_0xf = 32; + this->subtimer = 32; } this->speed = this->field_0x78.HALF.LO ? 640 : 1280; @@ -336,22 +336,22 @@ void sub_08044B04(Entity* this) { } break; case 1: - if (--this->actionDelay == 0) { - this->actionDelay = 6; + if (--this->timer == 0) { + this->timer = 6; this->direction = (this->direction + 1) & 0x1f; - if (++this->field_0xf == 0x30) { + if (++this->subtimer == 0x30) { u32 direction = sub_080045B4(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10); this->speed = 0; this->direction = (direction + 16) & 0x1f; - this->actionDelay = 16; - this->field_0xf = 16; + this->timer = 16; + this->subtimer = 16; this->field_0x74.HALF.LO++; } } break; case 2: - if (this->field_0xf == 0) { - switch (--this->actionDelay) { + if (this->subtimer == 0) { + switch (--this->timer) { case 12: this->speed = 1280; break; @@ -359,32 +359,32 @@ void sub_08044B04(Entity* this) { this->field_0x74.HALF.LO++; this->direction = sub_080045B4(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10); this->speed = 0; - this->actionDelay = 4; - this->field_0xf = 16; + this->timer = 4; + this->subtimer = 16; break; case 4: this->speed = 640; break; } } else { - if (--this->field_0xf == 0) + if (--this->subtimer == 0) this->speed = 640; } break; case 3: - if (this->field_0xf) { - if (--this->field_0xf == 0) + if (this->subtimer) { + if (--this->subtimer == 0) this->speed = 640; } else { - if (this->actionDelay) { - if (--this->actionDelay == 0) { + if (this->timer) { + if (--this->timer == 0) { this->speed = 1280; SoundReq(SFX_14F); } } if (this->field_0x78.HALF.HI == 3) if (EntityWithinDistance(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10, 0xc)) - vaati->actionDelay++; + vaati->timer++; this->direction = sub_080045B4(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10); return; } @@ -395,17 +395,17 @@ void sub_08044B04(Entity* this) { switch (this->field_0x74.HALF.LO) { case 3: this->field_0x74.HALF.LO = 1; - this->actionDelay = 80; + this->timer = 80; COLLISION_OFF(this); PositionRelative(vaati, this, 0, Q_16_16(-16.0)); - if (this->field_0xf) + if (this->subtimer) this->spriteSettings.draw = 0; break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x74.HALF.LO = 0; - this->actionDelay = 32; - this->field_0xf = 4; + this->timer = 32; + this->subtimer = 4; } break; } @@ -416,17 +416,17 @@ void sub_08044B04(Entity* this) { case 3: switch (this->field_0x74.HALF.LO) { case 0: - if (this->field_0xf) { - if (--this->field_0xf == 0) { + if (this->subtimer) { + if (--this->subtimer == 0) { sub_08044DEC(this); this->field_0x74.HALF.LO = 1; - this->actionDelay = 16; + this->timer = 16; } } break; case 1: LinearMoveUpdate(this); - if (--this->actionDelay == 0) + if (--this->timer == 0) this->field_0x74.HALF.LO++; break; case 2: { @@ -439,7 +439,7 @@ void sub_08044B04(Entity* this) { } else { COLLISION_OFF(this); } - vaati->actionDelay++; + vaati->timer++; break; } } @@ -488,11 +488,11 @@ void sub_08044E74(Entity* this, u32 state) { break; case 0: if (this->field_0x78.HALF.LO) { - switch (this->actionDelay) { + switch (this->timer) { case 3 ... 4: do { LinearMoveUpdate(this); - } while (this->actionDelay-- != 3); + } while (this->timer-- != 3); break; case 1: this->direction = (this->direction + 0x10) & 0x1f; @@ -501,13 +501,13 @@ void sub_08044E74(Entity* this, u32 state) { break; } } else { - if (this->actionDelay == 2) { + if (this->timer == 2) { LinearMoveUpdate(this); } } break; } - this->actionDelay = 1; + this->timer = 1; this->field_0x78.HALF.LO = 0; this->speed = Q_8_8(5); } diff --git a/src/enemy/vaatiEyesMacro.c b/src/enemy/vaatiEyesMacro.c index 2d26cd89..0d4d067d 100644 --- a/src/enemy/vaatiEyesMacro.c +++ b/src/enemy/vaatiEyesMacro.c @@ -139,7 +139,7 @@ void VaatiEyesMacroFunction0Type1Action0(Entity* this) { entity->parent = this; this->action = 1; rand = Random(); - this->actionDelay = (rand & 3) + 1; + this->timer = (rand & 3) + 1; this->field_0x78.HALF.LO = Random() >> 8; this->direction = gUnk_080CDE6C[rand >> 0x10 & 3]; InitializeAnimation(this, 1); @@ -234,7 +234,7 @@ void sub_0802EFB8(Entity* this) { if (iVar4 != 0) { this->direction = 0xff; } else { - this->actionDelay = (rand & 3) + 1; + this->timer = (rand & 3) + 1; this->direction = (uVar1 & 0x18); this->speed = gUnk_080CDE98[rand >> 0x18 & 3]; } @@ -253,10 +253,10 @@ void sub_0802F04C(Entity* this) { switch (this->direction >> 3) { case 0: if (((oldY & 0xf) > 8) && ((this->y.HALF.HI & 0xf) < 9)) { - this->actionDelay--; + this->timer--; oldY = (this->y.HALF.HI & 0xfff0) + 8; } - if (this->actionDelay == 0) { + if (this->timer == 0) { this->x.HALF.HI = oldX; this->y.HALF.HI = oldY; } else { @@ -265,10 +265,10 @@ void sub_0802F04C(Entity* this) { break; case 1: if (((oldX & 0xf) < 8) && ((this->x.HALF.HI & 0xf) >= 8)) { - this->actionDelay--; + this->timer--; oldX = (this->x.HALF.HI & 0xfff0) + 8; } - if (this->actionDelay == 0) { + if (this->timer == 0) { this->x.HALF.HI = oldX; this->y.HALF.HI = oldY; } else { @@ -277,10 +277,10 @@ void sub_0802F04C(Entity* this) { break; case 2: if (((oldY & 0xf) < 8) && ((this->y.HALF.HI & 0xf) >= 8)) { - this->actionDelay--; + this->timer--; oldY = (this->y.HALF.HI & 0xfff0) + 8; } - if (this->actionDelay == 0) { + if (this->timer == 0) { this->x.HALF.HI = oldX; this->y.HALF.HI = oldY; } else { @@ -289,10 +289,10 @@ void sub_0802F04C(Entity* this) { break; default: if (((oldX & 0xf) >= 9) && ((this->x.HALF.HI & 0xf) < 9)) { - this->actionDelay--; + this->timer--; oldX = (this->x.HALF.HI & 0xfff0) + 8; } - if (this->actionDelay == 0) { + if (this->timer == 0) { this->x.HALF.HI = oldX; this->y.HALF.HI = oldY; } else { diff --git a/src/enemy/vaatiProjectile.c b/src/enemy/vaatiProjectile.c index c3abb271..252b7fb2 100644 --- a/src/enemy/vaatiProjectile.c +++ b/src/enemy/vaatiProjectile.c @@ -58,7 +58,7 @@ void VaatiProjectile_OnTick(Entity* this) { void VaatiProjectile_OnCollision(Entity* this) { Entity* entity; - if (this->bitfield == 0x80) { + if (this->contactFlags == 0x80) { #ifndef EU if (this->health != 0) { #endif @@ -87,7 +87,7 @@ void VaatiProjectile_OnCollision(Entity* this) { void VaatiProjectile_OnDeath(Entity* this) { if (this->parent != NULL) { - this->parent->field_0xf--; + this->parent->subtimer--; this->parent = NULL; } GenericDeath(this); @@ -130,7 +130,7 @@ void VaatiProjectileFunction0Action1(Entity* this) { sub_0803E480(this); if (PlayerInRange(this, 0, 8) != 0) { this->action = 2; - this->actionDelay = 10; + this->timer = 10; InitializeAnimation(this->child, 2); } else { if (gUnk_020000B0 != NULL) { @@ -142,8 +142,8 @@ void VaatiProjectileFunction0Action1(Entity* this) { } void VaatiProjectileFunction0Action2(Entity* this) { - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { if (++this->z.HALF.HI == 0) { this->action = 3; @@ -156,7 +156,7 @@ void VaatiProjectileFunction0Action3(Entity* this) { if (this->child->frame & ANIM_DONE) { if (--this->z.HALF.HI <= -0x18) { this->action = 4; - this->actionDelay = (Random() & 0xf) + 0xf; + this->timer = (Random() & 0xf) + 0xf; InitializeAnimation(this->child, 1); } GetNextFrame(this); @@ -164,7 +164,7 @@ void VaatiProjectileFunction0Action3(Entity* this) { } void VaatiProjectileFunction0Action4(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->direction = GetFacingDirection(this, &gPlayerEntity); } @@ -173,19 +173,19 @@ void VaatiProjectileFunction0Action4(Entity* this) { void VaatiProjectileFunction0Action5(Entity* this) { sub_0803E444(this); - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { if (-0x18 < --this->z.HALF.HI) { return; } this->action = 6; - this->actionDelay = 0x14; + this->timer = 0x14; } } void VaatiProjectileFunction0Action6(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 7; this->direction = 0x10; this->speed = 0x300; @@ -216,7 +216,7 @@ void VaatiProjectileFunction0Action9(Entity* this) { this->y.HALF.HI = gPlayerEntity.y.HALF.HI; if (this->z.HALF.HI < -8) { if (this->animIndex != 2) { - this->actionDelay = 0; + this->timer = 0; InitializeAnimation(this->child, 2); } VaatiProjectileFunction0Action2(this); @@ -229,7 +229,7 @@ void sub_0803E444(Entity* this) { ResetPlayerItem(); gPlayerState.mobility = gPlayerState.mobility | 0x80; gPlayerState.field_0xa = gPlayerState.field_0xa | 0x80; - sub_0806FA90(this, this->field_0x4c, 0, -2); + sub_0806FA90(this, this->contactedEntity, 0, -2); gPlayerEntity.spriteOffsetY += 0xe; } diff --git a/src/enemy/vaatiRebornEnemy.c b/src/enemy/vaatiRebornEnemy.c index 07639d76..019963cf 100644 --- a/src/enemy/vaatiRebornEnemy.c +++ b/src/enemy/vaatiRebornEnemy.c @@ -100,7 +100,7 @@ void VaatiRebornEnemyType0Action0(Entity* this) { ClearRoomFlag(0); this->action = 3; this->field_0x74.HALF.LO = -1; - this->actionDelay = 0; + this->timer = 0; this->field_0x76.HALF.LO = 0; this->spriteSettings.draw = 1; this->direction = 0xff; @@ -126,7 +126,7 @@ void VaatiRebornEnemyType0Action0(Entity* this) { for (i = 0; i < 4; i++) { entity = CreateEnemy(VAATI_REBORN_ENEMY, 3); entity->parent = this; - entity->actionDelay = i; + entity->timer = i; } for (i = 0; i < 2; i++) { entity = CreateEnemy(VAATI_BALL, 1); @@ -140,15 +140,15 @@ void VaatiRebornEnemyType0Action0(Entity* this) { } void VaatiRebornEnemyType0Action1(Entity* this) { - if (this->actionDelay != 0) { - if (--this->actionDelay == 0) { + if (this->timer != 0) { + if (--this->timer == 0) { if ((this->field_0x74.HALF.LO & 0x70) == 0) { - if (this->child->actionDelay == 0) { + if (this->child->timer == 0) { sub_0803DD78(this); if (this->field_0x74.HALF.HI != 0) { this->action = 2; this->field_0x74.HALF.LO = 0; - this->actionDelay = 0x10; + this->timer = 0x10; this->direction = 0xff; } else { if ((this->field_0x86.HALF.LO != 0) || (this->field_0x80.HALF.LO != 0)) { @@ -158,13 +158,13 @@ void VaatiRebornEnemyType0Action1(Entity* this) { } } } else { - this->actionDelay = 2; + this->timer = 2; } } else { this->action = 3; this->field_0x74.HALF.HI = this->field_0x74.HALF.LO & 0x80; this->field_0x74.HALF.LO = 0; - this->actionDelay = 0xc0; + this->timer = 0xc0; 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->actionDelay = 0xa0; + this->timer = 0xa0; this->direction = 0xff; this->cutsceneBeh.HALF.LO = 0xff; InitAnimationForceUpdate(this, 1); @@ -183,18 +183,18 @@ void VaatiRebornEnemyType0Action1(Entity* this) { case 1: this->action = 6; this->field_0x74.HALF.LO = 0; - this->actionDelay = 0; + this->timer = 0; this->direction = 0xff; break; case 3: this->action = 5; this->field_0x74.HALF.LO = 0; - this->field_0xf = 0x20; + this->subtimer = 0x20; this->direction = 0xff; break; case 2: this->field_0x74.HALF.LO = 0; - this->actionDelay = 0x20; + this->timer = 0x20; if ((this->field_0x86.HALF.LO != 0) || (this->field_0x80.HALF.LO != 0)) { this->direction = ((Random() & 0x80) >> 3) | 8; } else { @@ -203,7 +203,7 @@ void VaatiRebornEnemyType0Action1(Entity* this) { break; } } - if (this->child->actionDelay == 0) { + if (this->child->timer == 0) { this->cutsceneBeh.HALF.HI++; if ((this->cutsceneBeh.HALF.HI & 3) == 0) { switch (this->cutsceneBeh.HALF.HI & 0x30) { @@ -227,9 +227,9 @@ void VaatiRebornEnemyType0Action2(Entity* this) { switch (this->field_0x74.HALF.LO) { case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x74.HALF.LO++; - this->actionDelay = 0x20; + this->timer = 0x20; InitAnimationForceUpdate(this, 3); SoundReq(SFX_19B); } @@ -238,11 +238,11 @@ void VaatiRebornEnemyType0Action2(Entity* this) { if ((this->frame & ANIM_DONE) != 0) { this->field_0x74.HALF.LO = 2; this->spriteSettings.draw = 0; - this->actionDelay = 0x10; + this->timer = 0x10; } break; case 2: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x74.HALF.LO++; if (sub_0803E028(this) == 0) { s32 tmp; @@ -254,7 +254,7 @@ void VaatiRebornEnemyType0Action2(Entity* this) { this->y.HALF.HI = gRoomControls.origin_y + ptr->HALF.y + 0x10; } this->spriteSettings.draw = 1; - this->actionDelay = 0x20; + this->timer = 0x20; InitAnimationForceUpdate(this, 4); SoundReq(SFX_F5); } @@ -268,10 +268,10 @@ void VaatiRebornEnemyType0Action2(Entity* this) { } if (--this->field_0x76.HALF.HI == 0) { this->action = 1; - this->actionDelay = 1; + this->timer = 1; } else { this->field_0x74.HALF.LO = 0; - this->actionDelay = 0x10; + this->timer = 0x10; } InitAnimationForceUpdate(this, 0); } @@ -286,30 +286,30 @@ void VaatiRebornEnemyType0Action3(Entity* this) { switch (this->field_0x74.HALF.LO) { case 0xfe: this->field_0x74.HALF.LO = 0; - this->actionDelay = 1; + this->timer = 1; break; case 0xff: if (this->z.HALF.HI != -4) { this->z.WORD -= Q_16_16(0.125); } - if (this->actionDelay == 2) { + if (this->timer == 2) { this->field_0x74.HALF.LO = 0xfe; } break; case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x74.HALF.LO++; if ((this->field_0x74.HALF.HI & 0x80) != 0) { temp = 0x14; } else { temp = 0x20; } - this->actionDelay = temp; + this->timer = temp; this->field_0x80.HALF.LO = ((this->field_0x86.HALF.LO + 1) >> 1) * 2 + 2; } break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x74.HALF.LO++; if ((this->field_0x74.HALF.HI & 0x80) == 0) { SoundReq(SFX_1B0); @@ -326,7 +326,7 @@ void VaatiRebornEnemyType0Action3(Entity* this) { case 3: this->action = 1; this->field_0x74.HALF.LO = 0; - this->actionDelay = 1; + this->timer = 1; break; } UpdateAnimationSingleFrame(this); @@ -336,10 +336,10 @@ void VaatiRebornEnemyType0Action4(Entity* this) { u32 index; Entity* entity; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->cutsceneBeh.HALF.LO = 0xff; - this->actionDelay = 1; + this->timer = 1; this->direction = (this->direction + 0x10) & 0x1f; InitAnimationForceUpdate(this, 0); } else { @@ -348,15 +348,15 @@ void VaatiRebornEnemyType0Action4(Entity* this) { if (this->cutsceneBeh.HALF.LO == 0xff) { index = Direction8RoundUp(GetFacingDirection(this, &gPlayerEntity)); this->cutsceneBeh.HALF.LO = gUnk_080D04C0[index >> 2]; - this->field_0xf = 0; + this->subtimer = 0; } - if ((this->field_0xf < 0x10) && + if ((this->subtimer < 0x10) && (entity = CreateProjectileWithParent(this, V1_FIRE_PROJECTILE, this->cutsceneBeh.HALF.LO), entity != NULL)) { - entity->field_0xf = this->field_0xf; + entity->subtimer = this->subtimer; entity->parent = this; entity->z.HALF.HI = this->z.HALF.HI; - this->field_0xf = this->field_0xf + 1; + this->subtimer = this->subtimer + 1; } } } @@ -368,7 +368,7 @@ void VaatiRebornEnemyType0Action5(Entity* this) { if (this->field_0x80.HALF.LO == 0) { this->action = 1; - this->actionDelay = 1; + this->timer = 1; this->direction = 0xff; InitAnimationForceUpdate(this, 0); return; @@ -376,7 +376,7 @@ void VaatiRebornEnemyType0Action5(Entity* this) { switch (this->field_0x74.HALF.LO) { case 0: - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->field_0x74.HALF.LO++; InitAnimationForceUpdate(this, 1); } @@ -384,30 +384,30 @@ void VaatiRebornEnemyType0Action5(Entity* this) { case 1: if ((this->frame & 0x10) != 0) { this->field_0x74.HALF.LO = 2; - this->field_0xf = (Random() & 0x3f) + 0x40; + this->subtimer = (Random() & 0x3f) + 0x40; SoundReq(SFX_SUMMON); } break; case 2: - if (--this->field_0xf == 0) { + 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->field_0xf = (Random() & 0x3f) + 0x40; + this->subtimer = (Random() & 0x3f) + 0x40; uVar3 = GetFacingDirection(this, &gPlayerEntity); this->direction = (uVar3 & 0x10) | 8; } else { this->field_0x74.HALF.LO++; this->field_0x86.HALF.HI = 0; - this->field_0xf = 0x30; + this->subtimer = 0x30; InitAnimationForceUpdate(this, 0); } } break; case 3: - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->action = 1; this->field_0x74.HALF.LO = 0; - this->actionDelay = 1; + this->timer = 1; this->direction = 0xff; } break; @@ -424,19 +424,19 @@ void VaatiRebornEnemyType0Action6(Entity* this) { if (this->field_0x80.HALF.LO == 0) { this->action = 1; - this->actionDelay = 1; + this->timer = 1; return; } switch (this->field_0x74.HALF.LO) { case 0: - if (this->actionDelay != 0) { + if (this->timer != 0) { this->field_0x74.HALF.LO = 1; - this->actionDelay = 0x70; + this->timer = 0x70; } break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x74.HALF.LO++; SoundReq(SFX_150); target = CreateProjectileWithParent(this, V1_DARK_MAGIC_PROJECTILE, 0); @@ -444,24 +444,24 @@ void VaatiRebornEnemyType0Action6(Entity* this) { PositionRelative(this, target, 0, Q_16_16(-16.0)); target->parent = this; } - } else if (this->actionDelay == 0x40) { + } else if (this->timer == 0x40) { SoundReq(SFX_196); } break; case 2: - if (this->field_0xf != 0) { - this->field_0xf = 0; + if (this->subtimer != 0) { + this->subtimer = 0; } break; case 3: - if (this->field_0xf == 0) { - this->field_0xf = 1; + if (this->subtimer == 0) { + this->subtimer = 1; SoundReq(SFX_14F); } - if (this->actionDelay) { + if (this->timer) { this->action = 1; this->field_0x74.HALF.LO = 0; - this->actionDelay = 1; + this->timer = 1; } break; } @@ -472,11 +472,11 @@ void VaatiRebornEnemyType0Action7(Entity* this) { Entity* fx; u32 tmp; - if (this->actionDelay != 0) { - if (--this->actionDelay == 0) { + if (this->timer != 0) { + if (--this->timer == 0) { SetRoomFlag(1); } else { - if ((this->actionDelay & 7) == 0) { + if ((this->timer & 7) == 0) { fx = CreateFx(this, FX_DEATH, 0); if (fx != NULL) { tmp = Random() & 0x3f3f; @@ -497,7 +497,7 @@ void VaatiRebornEnemyType1Action0(Entity* this) { this->action = 1; this->field_0x74.HALF.LO = 0; this->field_0x74.HALF.HI = 1; - this->actionDelay = 0; + this->timer = 0; this->spriteOffsetY = -1; PositionRelative(this->parent, this, 0, Q_16_16(1.0)); enemy = CreateEnemy(VAATI_REBORN_ENEMY, 2); @@ -522,9 +522,9 @@ void VaatiRebornEnemyType1Action1(Entity* this) { this->hitType = 0x2f; InitAnimationForceUpdate(this, this->field_0x74.HALF.LO); } else { - if (((this->bitfield & 0x80) != 0) && (0 < this->iframes)) { + if (((this->contactFlags & 0x80) != 0) && (0 < this->iframes)) { parent->iframes = this->iframes; - parent->bitfield = this->bitfield; + parent->contactFlags = this->contactFlags; } if ((this->frame & 0x40) != 0) { InitAnimationForceUpdate(this, 2); @@ -633,7 +633,7 @@ void sub_0803DC0C(Entity* this) { const xy* tmp; parent = this->parent; - tmp = &gUnk_080D04C8[this->actionDelay]; + tmp = &gUnk_080D04C8[this->timer]; this->spriteSettings.draw = parent->spriteSettings.draw; this->spriteOffsetX = parent->spriteOffsetX; PositionRelative(parent, this, Q_16_16(tmp->x), Q_16_16(tmp->y + 1)); @@ -648,32 +648,32 @@ void VaatiRebornEnemyType1PreAction(Entity* this) { } parent = this->parent; this->field_0x76.HALF.HI = 0; - if ((this->bitfield & 0x80) != 0) { + if ((this->contactFlags & 0x80) != 0) { if (gUnk_080D04D0[parent->field_0x86.HALF.LO] > this->health) { if (2 < ++parent->field_0x86.HALF.LO) { COLLISION_OFF(this); parent->action = 7; parent->flags &= ~ENT_COLLIDE; - parent->actionDelay = 0x80; + parent->timer = 0x80; parent->spriteOffsetX = 0; parent->direction = -1; - this->actionDelay = 0; + this->timer = 0; SoundReq(SONG_STOP_BGM); gArea.bgm = gArea.queued_bgm; return; } - this->actionDelay = 1; + this->timer = 1; this->field_0x76.HALF.HI = 0xff; } if (0 < this->iframes) { SoundReq(SFX_BOSS_HIT); InitScreenShake(0xc, 1); - if (this->actionDelay == 0) - this->actionDelay = 0x48; + if (this->timer == 0) + this->timer = 0x48; } } - if (this->actionDelay != 0) { - if (--this->actionDelay == 0) { + if (this->timer != 0) { + if (--this->timer == 0) { this->hitType = 0x2f; this->field_0x74.HALF.LO = 1; if (this->field_0x76.HALF.HI == 0) { @@ -683,7 +683,7 @@ void VaatiRebornEnemyType1PreAction(Entity* this) { this->health = 0xff; } parent->action = 1; - parent->actionDelay = 1; + parent->timer = 1; InitAnimationForceUpdate(this, 0); } } diff --git a/src/enemy/vaatiTransfigured.c b/src/enemy/vaatiTransfigured.c index 7149ea69..e9d7b344 100644 --- a/src/enemy/vaatiTransfigured.c +++ b/src/enemy/vaatiTransfigured.c @@ -141,8 +141,8 @@ void VaatiTransfiguredType0Action0(Entity* this) { this->spritePriority.b0 = 5; this->field_0x6c.HALF.HI |= 1; this->direction = (Random() & 0x17) + 4; - this->actionDelay = 48; - this->field_0xf = 12; + this->timer = 48; + this->subtimer = 12; this->field_0x82.HALF.LO = 4; this->field_0x80.HALF.LO = 0xff; this->field_0x74.HALF.LO = 0; @@ -165,9 +165,9 @@ void VaatiTransfiguredType0Action0(Entity* this) { enemy->parent = this; enemy->type2 = i; if ((this->field_0x74.HALF.HI >> (i)&1) != 0) { - enemy->actionDelay = 1; + enemy->timer = 1; } else { - enemy->actionDelay = 0; + enemy->timer = 0; } } InitAnimationForceUpdate(this, 0); @@ -179,41 +179,41 @@ void VaatiTransfiguredType0Action1(Entity* this) { switch (this->field_0x80.HALF.LO) { case 0xff: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO = 0; - this->actionDelay = 11; + this->timer = 11; } break; case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; this->speed = 0x180; - this->actionDelay = 0x14; + this->timer = 0x14; } break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; this->speed = 0xc0; - this->actionDelay = 12; + this->timer = 12; } break; case 2: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; this->speed = 0; if (this->animationState < 2) { - this->actionDelay = (Random() & 0x7f) + 0x40; + this->timer = (Random() & 0x7f) + 0x40; } else { - this->actionDelay = 8; + this->timer = 8; } } break; case 3: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->z.HALF.HI = 0; this->field_0x80.HALF.LO = 0; - this->actionDelay = gUnk_080D0ABF[(u32)this->animationState * 2]; + this->timer = gUnk_080D0ABF[(u32)this->animationState * 2]; switch (sub_08040934(this)) { case 1: this->action = 4; @@ -269,20 +269,20 @@ void VaatiTransfiguredType0Action3(Entity* this) { if (uVar4 != 1) break; this->field_0x80.HALF.LO = 1; - this->actionDelay = 0xc0; + this->timer = 0xc0; COLLISION_ON(this); SoundReq(SFX_14C); InitScreenShake(0x14, 4); break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO = 2; this->hitType = 0x35; this->spriteOffsetX = 0; } if (this->health < gUnk_080D0ABC[this->animationState]) { tmp = 1; - this->actionDelay = 1; + this->timer = 1; } else { tmp = 0; } @@ -293,7 +293,7 @@ void VaatiTransfiguredType0Action3(Entity* this) { this->animationState++; if (this->animationState > 2) { this->action = 7; - this->actionDelay = 0xe0; + this->timer = 0xe0; DeleteClones(); SoundReq(SFX_BOSS_HIT); return; @@ -302,26 +302,26 @@ void VaatiTransfiguredType0Action3(Entity* this) { break; case 2: this->child->field_0x74.HALF.LO = 0x10; - if (this->actionDelay) { + if (this->timer) { this->field_0x80.HALF.LO = 3; - this->actionDelay = 0x40; + this->timer = 0x40; } else { this->field_0x80.HALF.LO = 4; - this->actionDelay = 0x50; + this->timer = 0x50; } break; case 3: - if (this->actionDelay != 0) { - if (--this->actionDelay == 0) { + if (this->timer != 0) { + if (--this->timer == 0) { COLLISION_OFF(this); this->zVelocity = Q_16_16(3.5); - this->field_0xf = 0x10; + this->subtimer = 0x10; } break; } if (GravityUpdate(this, 0x2800) == 0) { this->field_0x80.HALF.LO = 5; - this->actionDelay = 0x10; + this->timer = 0x10; COLLISION_ON(this); this->health = 0xff; this->field_0x86.HALF.LO = 0; @@ -329,11 +329,11 @@ void VaatiTransfiguredType0Action3(Entity* this) { SoundReq(SFX_14C); InitScreenShake(0x1e, 4); } else { - if (this->field_0xf != 0) { - if (--this->field_0xf == 0) { + if (this->subtimer != 0) { + if (--this->subtimer == 0) { SoundReq(SFX_1B0); } else { - if ((this->field_0xf & 7) == 0) { + if ((this->subtimer & 7) == 0) { SoundReq(SFX_149); } } @@ -341,13 +341,13 @@ void VaatiTransfiguredType0Action3(Entity* this) { } break; case 4: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO = 5; - this->actionDelay = 0x10; + this->timer = 0x10; this->field_0x86.HALF.LO = 0; sub_080408EC(this); } else { - if (((this->actionDelay & 1) != 0) && (pEVar3 = CreateObject(OBJECT_9B, 1, 0xff), pEVar3 != NULL)) { + if (((this->timer & 1) != 0) && (pEVar3 = CreateObject(OBJECT_9B, 1, 0xff), pEVar3 != NULL)) { pEVar3->parent = this; CopyPosition(this, pEVar3); pEVar3->x.HALF.HI += (Random() & 0xf) - 7; @@ -358,7 +358,7 @@ void VaatiTransfiguredType0Action3(Entity* this) { } break; case 5: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->field_0x80.HALF.LO = 0; this->field_0x80.HALF.HI = 0; @@ -367,7 +367,7 @@ void VaatiTransfiguredType0Action3(Entity* this) { } } if (this->field_0x80.HALF.LO > 2) { - this->spriteOffsetX = this->actionDelay & 1; + this->spriteOffsetX = this->timer & 1; } UpdateAnimationSingleFrame(this); } @@ -375,11 +375,11 @@ void VaatiTransfiguredType0Action3(Entity* this) { void VaatiTransfiguredType0Action4(Entity* this) { switch (this->field_0x80.HALF.LO) { case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; this->field_0x74.HALF.LO = 0; - this->actionDelay = 0x80; - this->field_0xf = 0; + this->timer = 0x80; + this->subtimer = 0; this->zVelocity = Q_16_16(2.25); SoundReq(SFX_12B); } @@ -391,38 +391,38 @@ void VaatiTransfiguredType0Action4(Entity* this) { switch (this->cutsceneBeh.HALF.LO) { case 1: case 3: - this->field_0xf = 1; + this->subtimer = 1; break; case 0: case 2: - this->field_0xf = 0; + this->subtimer = 0; break; default: - this->field_0xf = (Random() & 0x20) >> 5; + this->subtimer = (Random() & 0x20) >> 5; break; } if (1 < this->animationState) { - this->field_0xf = 1; + this->subtimer = 1; } SoundReq(SFX_14C); InitScreenShake(0x1e, 4); break; case 2: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; - this->actionDelay = gUnk_080D0ABF[((u32)this->animationState << 1 | 1)]; + this->timer = gUnk_080D0ABF[((u32)this->animationState << 1 | 1)]; } else { - if ((this->actionDelay & 7) == 0) { - CreateProjectileWithParent(this, V2_PROJECTILE, this->field_0xf); + if ((this->timer & 7) == 0) { + CreateProjectileWithParent(this, V2_PROJECTILE, this->subtimer); } - if (((this->field_0xf != 0) && (1 < this->animationState)) && (this->actionDelay < 6)) { - this->actionDelay = 0x80; - this->field_0xf = 0; + if (((this->subtimer != 0) && (1 < this->animationState)) && (this->timer < 6)) { + this->timer = 0x80; + this->subtimer = 0; } } break; case 3: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->field_0x80.HALF.LO = 0; this->z.HALF.HI = 0; @@ -443,30 +443,30 @@ void VaatiTransfiguredType0Action5(Entity* this) { switch (this->field_0x80.HALF.LO) { case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; - this->actionDelay = 0x40; + this->timer = 0x40; if (1 < this->animationState) { - this->actionDelay = 0x80; - this->field_0xf = 1; + this->timer = 0x80; + this->subtimer = 1; } } break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; - this->actionDelay = gUnk_080D0ABF[(this->animationState << 1 | 1)]; + this->timer = gUnk_080D0ABF[(this->animationState << 1 | 1)]; } else { - if (this->field_0xf) { - if ((this->actionDelay & 7) == 0) { - CreateProjectileWithParent(this, V2_PROJECTILE, this->field_0xf); + if (this->subtimer) { + if ((this->timer & 7) == 0) { + CreateProjectileWithParent(this, V2_PROJECTILE, this->subtimer); } - if (this->actionDelay < 6) { - this->actionDelay = 0x40; - this->field_0xf = 0; + if (this->timer < 6) { + this->timer = 0x40; + this->subtimer = 0; } } else { - if ((this->actionDelay & 0xf) == 0) { + if ((this->timer & 0xf) == 0) { entity = CreateProjectileWithParent(this, V2_PROJECTILE, 2); if (entity != NULL) { entity->type2 = 0; @@ -479,7 +479,7 @@ void VaatiTransfiguredType0Action5(Entity* this) { } break; case 2: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->field_0x80.HALF.LO = 0; sub_08040670(this); @@ -496,29 +496,29 @@ void VaatiTransfiguredType0Action6(Entity* this) { switch (this->field_0x80.HALF.LO) { case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; - this->actionDelay = 0x80; + this->timer = 0x80; if (1 < this->animationState) { - this->field_0xf = 1; + this->subtimer = 1; } } break; case 1: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x80.HALF.LO += 1; - this->actionDelay = gUnk_080D0ABF[(this->animationState << 1) | 1]; + this->timer = gUnk_080D0ABF[(this->animationState << 1) | 1]; } else { - if (this->field_0xf) { - if ((this->actionDelay & 7) == 0) { - CreateProjectileWithParent(this, V2_PROJECTILE, this->field_0xf); + if (this->subtimer) { + if ((this->timer & 7) == 0) { + CreateProjectileWithParent(this, V2_PROJECTILE, this->subtimer); } - if (this->actionDelay < 6) { - this->actionDelay = 0x80; - this->field_0xf = 0; + if (this->timer < 6) { + this->timer = 0x80; + this->subtimer = 0; } } else { - if ((this->actionDelay & 0x1f) == 0) { + if ((this->timer & 0x1f) == 0) { pEVar2 = CreateProjectileWithParent(this, V2_PROJECTILE, 2); if (pEVar2 != NULL) { pEVar2->type2 = 1; @@ -532,7 +532,7 @@ void VaatiTransfiguredType0Action6(Entity* this) { } break; case 2: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->field_0x80.HALF.LO = 0; sub_08040670(this); @@ -548,16 +548,16 @@ void VaatiTransfiguredType0Action7(Entity* this) { u32 uVar4; sub_08078B48(); - if (this->actionDelay) { - if (--this->actionDelay == 0) { + if (this->timer) { + if (--this->timer == 0) { SetRoomFlag(2); - this->field_0xf = 8; + this->subtimer = 8; UpdateAnimationSingleFrame(this); return; } } else { - if (this->field_0xf != 0) { - if (--this->field_0xf == 0) { + if (this->subtimer != 0) { + if (--this->subtimer == 0) { this->health = 0; this->spriteSettings.draw = 0; } @@ -567,8 +567,8 @@ void VaatiTransfiguredType0Action7(Entity* this) { UpdateAnimationSingleFrame(this); return; } - this->field_0xf = (this->field_0xf + 1) & 7; - if (this->field_0xf == 0) { + this->subtimer = (this->subtimer + 1) & 7; + if (this->subtimer == 0) { pEVar3 = CreateFx(this, FX_AURA_BASE, 0); if (pEVar3 != NULL) { uVar4 = Random() & 0x3f3f; @@ -585,10 +585,10 @@ void VaatiTransfiguredType0Action7(Entity* this) { void VaatiTransfiguredType1Action0(Entity* this) { this->action = 1; - this->actionDelay = 0; + this->timer = 0; this->field_0x80.HALF.LO = 0; this->spritePriority.b0 = 6; - InitAnimationForceUpdate(this, (u32)this->actionDelay); + InitAnimationForceUpdate(this, (u32)this->timer); } void VaatiTransfiguredType1Action1(Entity* this) { @@ -607,13 +607,13 @@ void VaatiTransfiguredType1Action1(Entity* this) { sub_080042BA(this, 2); } if (parent->action >= 5) { - if (this->actionDelay == 0) { - this->actionDelay = 1; + if (this->timer == 0) { + this->timer = 1; InitAnimationForceUpdate(this, 1); } } else { - if (this->actionDelay != 0) { - this->actionDelay = 0; + if (this->timer != 0) { + this->timer = 0; InitAnimationForceUpdate(this, 0); } } @@ -633,8 +633,8 @@ void VaatiTransfiguredType2Action0(Entity* this) { sub_08040648(this, 2, 1); sub_08040648(this, 2, 2); this->action = 1; - this->actionDelay = 0; - this->field_0xf = (Random() & 0x7f) + 0x17; + this->timer = 0; + this->subtimer = (Random() & 0x7f) + 0x17; this->field_0x74.HALF.LO = 0; InitAnimationForceUpdate(this, 0); } @@ -666,9 +666,9 @@ void VaatiTransfiguredType2Action1(Entity* this) { case 0: switch (this->field_0x74.HALF.LO) { case 0: - if (--this->field_0xf == 0) { - this->field_0xf = (Random() & 0x7f) + 0x27; - if ((this->field_0xf & 1) != 0) { + if (--this->subtimer == 0) { + this->subtimer = (Random() & 0x7f) + 0x27; + 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->field_0xf = (Random() & 0x7f) + 0x17; + this->subtimer = (Random() & 0x7f) + 0x17; InitAnimationForceUpdate(this, 0); } break; case 0x10: InitAnimationForceUpdate(this, 7); this->field_0x74.HALF.LO = 0x11; - this->field_0xf = 0x50; + this->subtimer = 0x50; break; case 0x11: - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->field_0x74.HALF.LO = 1; - this->field_0xf = 0x30; + this->subtimer = 0x30; InitAnimationForceUpdate(this, 8); } } @@ -728,7 +728,7 @@ void VaatiTransfiguredType3Action1(Entity* this) { void VaatiTransfiguredType4Action0(Entity* this) { this->action = 1; this->field_0x80.HALF.LO = 0; - this->actionDelay = 10; + this->timer = 10; this->spriteSettings.draw = 0; this->spritePriority.b0 = 7; InitializeAnimation(this, 0); @@ -749,8 +749,8 @@ void VaatiTransfiguredType4Action1(Entity* this) { this->field_0x80.HALF.LO += 1; this->spriteSettings.draw = 1; } - if (--this->actionDelay == 0) { - this->actionDelay = 10; + if (--this->timer == 0) { + this->timer = 10; SoundReq(SFX_149); } } @@ -761,7 +761,7 @@ void VaatiTransfiguredType4Action1(Entity* this) { void VaatiTransfiguredType5Action0(Entity* this) { if (this->type2 != 0) { this->action = 2; - this->actionDelay = 10; + this->timer = 10; this->spritePriority.b0 = 3; InitializeAnimation(this, 2); } else { @@ -796,8 +796,8 @@ void VaatiTransfiguredType5Action1(Entity* this) { sub_08040648(this, this->type, 1); } } - if (--this->actionDelay == 0) { - this->actionDelay = 10; + if (--this->timer == 0) { + this->timer = 10; SoundReq(SFX_149); } GetNextFrame(this); @@ -844,7 +844,7 @@ void sub_08040670(Entity* this) { this->action = 1; this->field_0x80.HALF.LO = 0; this->speed = 0x100; - this->actionDelay = 12; + this->timer = 12; if (this->animationState == 0) { sub_080406A0(this); } else { @@ -1074,26 +1074,26 @@ void sub_080409B0(Entity* this) { Knockback1(this); } } else { - if (((this->bitfield & 0x80) != 0) && (0 < this->iframes)) { + if (((this->contactFlags & 0x80) != 0) && (0 < this->iframes)) { InitScreenShake(0xc, 1); SoundReq(SFX_BOSS_HIT); } - if ((this->bitfield == 0x8a) && (gPlayerState.chargeState.action == 5)) { + if ((this->contactFlags == 0x8a) && (gPlayerState.chargeState.action == 5)) { this->health = 0xc0; } } } void sub_08040AD4(Entity* this) { - u32 actionDelay; + u32 timer; - actionDelay = this->actionDelay & 0x3f; - if ((actionDelay & 0x1f) == 0) { + timer = this->timer & 0x3f; + if ((timer & 0x1f) == 0) { SoundReq(SFX_1A9); } - if ((actionDelay & 3) == 0) { - actionDelay >>= 2; - this->x.HALF.HI += ((actionDelay + 4) & 8) ? -1 : 1; - this->y.HALF.HI += ((actionDelay + 2) & 4) ? -1 : 1; + if ((timer & 3) == 0) { + timer >>= 2; + this->x.HALF.HI += ((timer + 4) & 8) ? -1 : 1; + this->y.HALF.HI += ((timer + 2) & 4) ? -1 : 1; } } diff --git a/src/enemy/vaatiTransfiguredEye.c b/src/enemy/vaatiTransfiguredEye.c index 457b294d..04980820 100644 --- a/src/enemy/vaatiTransfiguredEye.c +++ b/src/enemy/vaatiTransfiguredEye.c @@ -8,7 +8,7 @@ #include "entity.h" #include "enemy.h" #include "message.h" -#include "coord.h" +#include "physics.h" #include "functions.h" void sub_08045A00(Entity*); @@ -59,17 +59,17 @@ void VaatiTransfiguredEye_OnCollision(Entity* this) { if (this->type != 0) { pEVar4 = this->parent->parent; - if ((this->bitfield & 0x80) != 0) { - bVar1 = this->bitfield & 0x3f; + if ((this->contactFlags & 0x80) != 0) { + bVar1 = this->contactFlags & 0x3f; if ((bVar1 == 0xe) || (bVar1 == 0x15)) { if (this->field_0x80.HALF.HI == 0) { this->action = 3; this->field_0x80.HALF.HI += 1; - InitializeAnimation(this, (this->type << 3) | (this->actionDelay + 2)); - InitializeAnimation(this->parent, (this->parent->type << 3) | (this->actionDelay + 2)); + InitializeAnimation(this, (this->type << 3) | (this->timer + 2)); + InitializeAnimation(this->parent, (this->parent->type << 3) | (this->timer + 2)); } - if (this->actionDelay != 0) { + if (this->timer != 0) { SoundReq(SFX_17A); } else { SoundReq(SFX_ITEM_GLOVES_KNOCKBACK); @@ -77,7 +77,7 @@ void VaatiTransfiguredEye_OnCollision(Entity* this) { } else { if (this->health != 0xff) { this->health = 0xff; - if (this->actionDelay != 0 && (pEVar4->field_0x80.HALF.HI != 0)) { + if (this->timer != 0 && (pEVar4->field_0x80.HALF.HI != 0)) { pEVar4->field_0x76.HALF.LO |= (1 << this->type2); if (this->cutsceneBeh.HALF.HI == 0) { this->cutsceneBeh.HALF.HI += 1; @@ -106,7 +106,7 @@ void VaatiTransfiguredEyeFunction0Action0(Entity* this) { this->field_0x80.HALF.LO = bVar2; this->field_0x80.HALF.HI = bVar2; this->cutsceneBeh.HALF.HI = bVar2; - this->field_0xf = bVar2; + this->subtimer = bVar2; this->field_0x82.HALF.LO = 0x30; this->field_0x82.HALF.HI = bVar2; if (this->type == 0) { @@ -115,7 +115,7 @@ void VaatiTransfiguredEyeFunction0Action0(Entity* this) { if (child != NULL) { child->parent = this; this->child = child; - child->actionDelay = this->actionDelay; + child->timer = this->timer; child->type2 = this->type2; CopyPosition(this, child); } @@ -153,10 +153,10 @@ void VaatiTransfiguredEyeFunction0Action2(Entity* this) { } if ((parent->action == 3) && (parent->field_0x80.HALF.LO == 1)) { this->action = 4; - this->field_0xf = 0; + this->subtimer = 0; if (this->type != 0) { COLLISION_OFF(this); - if (this->actionDelay != 0) { + if (this->timer != 0) { InitializeAnimation(this, this->type << 3 | 5); InitializeAnimation(this->parent, this->parent->type << 3 | 5); } else { @@ -172,7 +172,7 @@ void VaatiTransfiguredEyeFunction0Action3(Entity* this) { if ((this->frame & ANIM_DONE) != 0) { this->action = 2; if (this->type != 0) { - if (this->actionDelay == 0) { + if (this->timer == 0) { this->hitType = 0x32; } else { this->parent->parent->field_0x76.HALF.LO |= (1 << this->type2); @@ -186,9 +186,9 @@ void VaatiTransfiguredEyeFunction0Action4(Entity* this) { Entity* parent; sub_08045A28(this); - if (this->field_0xf == 0) { + if (this->subtimer == 0) { if ((this->frame & ANIM_DONE) != 0) { - this->field_0xf = 0x20; + this->subtimer = 0x20; } } else { parent = this->parent; @@ -197,16 +197,16 @@ void VaatiTransfiguredEyeFunction0Action4(Entity* this) { } if ((parent->animationState < 3) && (parent->action != 3)) { this->action = 1; - this->field_0xf = 0; + this->subtimer = 0; this->field_0x80.HALF.HI = 0; this->cutsceneBeh.HALF.HI = 0; if (this->type != 0) { this->hitType = 0x33; } if ((parent->field_0x74.HALF.HI >> this->type2 & 1U) != 0) { - this->actionDelay = 1; + this->timer = 1; } else { - this->actionDelay = 0; + this->timer = 0; } InitializeAnimation(this, this->type << 3 | 1); } diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c index f2c8c769..44c2569b 100644 --- a/src/enemy/vaatiWrath.c +++ b/src/enemy/vaatiWrath.c @@ -101,7 +101,7 @@ const s8 gUnk_080D0EB0[] = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x0 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd }; void VaatiWrath(Entity* this) { - if (((this->type == 0) && ((this->bitfield & 0x80) != 0)) && (this->health == 0)) { + if (((this->type == 0) && ((this->contactFlags & 0x80) != 0)) && (this->health == 0)) { COLLISION_ON(this); this->health = 0xff; if (--this->cutsceneBeh.HALF.LO == 0) { @@ -134,7 +134,7 @@ void VaatiWrathType0Action0(Entity* this) { this->subAction = 1; } else { this->action = 2; - this->actionDelay = 0x3c; + this->timer = 0x3c; } this->x.HALF.HI = gRoomTransition.hurtType; this->y.HALF.HI = gRoomTransition.field_0x42; @@ -145,7 +145,7 @@ void VaatiWrathType0Action0(Entity* this) { } this->action = 1; this->subAction = bVar1; - this->actionDelay = 120; + this->timer = 120; this->spritePriority.b1 = 0; this->z.HALF.HI = 0xffb0; gRoomControls.camera_target = this; @@ -178,36 +178,36 @@ void VaatiWrathType0Action1(Entity* this) { break; case 2: sub_08042004(this); - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { if (sub_08041F74(this, 0) == 0) { return; } this->subAction = 3; - this->actionDelay = 0x3c; + this->timer = 0x3c; } break; case 3: sub_08042004(this); - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { if (sub_08041F74(this, 1) != 0) { this->subAction = 4; - this->actionDelay = 120; - this->field_0xf = 0; + this->timer = 120; + this->subtimer = 0; } } break; case 4: sub_08042004(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 5; } else { - if ((this->actionDelay < 0x3d) && (this->field_0xf == 0)) { + if ((this->timer < 0x3d) && (this->subtimer == 0)) { if (sub_08041F1C(this) != 0) { - this->field_0xf = 1; + this->subtimer = 1; } } } @@ -215,18 +215,18 @@ void VaatiWrathType0Action1(Entity* this) { case 5: sub_08042004(this); this->subAction = 6; - this->actionDelay = 0x1e; + this->timer = 0x1e; gRoomTransition.field_0x38 |= 1; gRoomControls.camera_target = &gPlayerEntity; gPlayerState.controlMode = CONTROL_1; break; default: sub_08042004(this); - if (--this->actionDelay != 0) { + if (--this->timer != 0) { return; } this->action = 2; - this->actionDelay = 0x3c; + this->timer = 0x3c; break; } } @@ -234,8 +234,8 @@ void VaatiWrathType0Action1(Entity* this) { void VaatiWrathType0Action2(Entity* this) { sub_08042004(this); UpdateAnimationSingleFrame(this); - if (--this->actionDelay == 0) { - this->field_0xf = (Random() & 1) + 1; + if (--this->timer == 0) { + this->subtimer = (Random() & 1) + 1; sub_08042028(this); } } @@ -262,18 +262,18 @@ void VaatiWrathType0Action3(Entity* this) { } } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 4; - this->actionDelay = 8; + this->timer = 8; } else { - if (this->actionDelay < 0x1e) { + if (this->timer < 0x1e) { this->speed -= 8; } else { if (this->speed < 0x100) { this->speed += 6; } } - if ((this->actionDelay & 3) == 0) { + if ((this->timer & 3) == 0) { sub_08004596(this, sub_0804207C(this)); } } @@ -284,8 +284,8 @@ void VaatiWrathType0Action3(Entity* this) { void VaatiWrathType0Action4(Entity* this) { sub_08042004(this); UpdateAnimationSingleFrame(this); - if (--this->actionDelay == 0) { - if (--this->field_0xf == 0) { + if (--this->timer == 0) { + if (--this->subtimer == 0) { sub_08042120(this); } else { sub_08042028(this); @@ -320,7 +320,7 @@ void VaatiWrathType0Action5(Entity* this) { arm->action = 4; arm->subAction = 0; } else { - this->field_0xf = (Random() & 1) + 1; + this->subtimer = (Random() & 1) + 1; sub_08042028(this); } } else { @@ -333,13 +333,13 @@ void VaatiWrathType0Action5(Entity* this) { ((VaatiWrathHeapStruct*)this->myHeap)->object5b = object; gRoomControls.camera_target = object; this->action = 6; - this->actionDelay = 0x1e; + this->timer = 0x1e; ((VaatiWrathHeapStruct*)this->myHeap)->type1->subAction = 1; InitializeAnimation(((VaatiWrathHeapStruct*)this->myHeap)->type1, 0xe); } } else { this->action = 2; - this->actionDelay = 0x3c; + this->timer = 0x3c; } } } @@ -349,7 +349,7 @@ void VaatiWrathType0Action5(Entity* this) { void VaatiWrathType0Action6(Entity* this) { Entity* type1; - if (this->actionDelay == 0) { + if (this->timer == 0) { type1 = ((VaatiWrathHeapStruct*)this->myHeap)->type1; GetNextFrame(type1); if (type1->frame == 1) { @@ -371,7 +371,7 @@ void VaatiWrathType0Action6(Entity* this) { } } } else { - this->actionDelay--; + this->timer--; } sub_08042004(this); UpdateAnimationSingleFrame(this); @@ -386,7 +386,7 @@ void VaatiWrathType0Action7(Entity* this) { this->direction = ((gRoomControls.origin_y + 0x48) >= this->y.HALF.HI) ? 0x10 : 0; LinearMoveUpdate(this); } else { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_08042050(this); } } @@ -401,11 +401,11 @@ void VaatiWrathType0Action8(Entity* this) { this->direction ^= 0x10; } } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 9; - this->actionDelay = 0x3c; + this->timer = 0x3c; } else { - if (this->actionDelay < 0x1e) { + if (this->timer < 0x1e) { this->speed -= 0xc; } else { if (0x1ff >= this->speed) @@ -421,17 +421,17 @@ void VaatiWrathType0Action9(Entity* this) { if (this->field_0x78.HALF.HI != 0) { sub_08042214(this); } else { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if ((gPlayerEntity.x.HALF.HI - this->x.HALF.HI) + 0x40u < 0x81) { this->action = 10; this->field_0x7a.HALF.HI = 0; - ((VaatiWrathHeapStruct*)this->myHeap)->eyes[0]->actionDelay = 1; - ((VaatiWrathHeapStruct*)this->myHeap)->eyes[1]->actionDelay = 1; - ((VaatiWrathHeapStruct*)this->myHeap)->eyes[2]->actionDelay = 1; - ((VaatiWrathHeapStruct*)this->myHeap)->eyes[3]->actionDelay = 1; + ((VaatiWrathHeapStruct*)this->myHeap)->eyes[0]->timer = 1; + ((VaatiWrathHeapStruct*)this->myHeap)->eyes[1]->timer = 1; + ((VaatiWrathHeapStruct*)this->myHeap)->eyes[2]->timer = 1; + ((VaatiWrathHeapStruct*)this->myHeap)->eyes[3]->timer = 1; } else { this->action = 7; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->field_0x78.HALF.HI = 0; } } @@ -445,7 +445,7 @@ void VaatiWrathType0ActionA(Entity* this) { UpdateAnimationSingleFrame(this); if (this->field_0x7a.HALF.HI == 0x0f) { this->action = 7; - this->actionDelay = 120; + this->timer = 120; this->field_0x78.HALF.HI = 0; } else { if (this->field_0x7a.HALF.HI == 0xf0) { @@ -475,7 +475,7 @@ void VaatiWrathType0ActionB(Entity* this) { GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2); if (GravityUpdate(this, 0x2000) == 0) { this->subAction = 1; - this->actionDelay = 0xf0; + this->timer = 0xf0; this->health = 8; this->hitType = 0x38; InitScreenShake(0x14, 0); @@ -486,16 +486,16 @@ void VaatiWrathType0ActionB(Entity* this) { case 1: UpdateAnimationSingleFrame(this); GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 2; - this->actionDelay = 0x3c; + this->timer = 0x3c; this->hitType = 0x39; this->health = 0xff; } break; default: - this->spriteOffsetX = gUnk_080D0E64[--this->actionDelay & 3]; - if (this->actionDelay == 0) { + this->spriteOffsetX = gUnk_080D0E64[--this->timer & 3]; + if (this->timer == 0) { this->action = 0xc; this->subAction = 0; ChangeObjPalette(this, 0x140); @@ -520,15 +520,15 @@ void VaatiWrathType0ActionC(Entity* this) { this->z.WORD -= 0x8000; if (this->z.HALF.HI < -4) { this->subAction = 1; - this->actionDelay = 120; + this->timer = 120; this->direction = 0x10; this->speed = 0x80; } break; case 1: sub_08042004(this); - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else { LinearMoveUpdate(this); if (gRoomControls.origin_y + 0x48 == this->y.HALF.HI) { @@ -563,7 +563,7 @@ void sub_08041BE8(Entity* this) { if (sub_08079F8C()) { this->subAction = 1; - this->actionDelay = 120; + this->timer = 120; this->updatePriority = PRIO_NO_BLOCK; InitAnimationForceUpdate(this, 10); @@ -618,11 +618,11 @@ void sub_08041BE8(Entity* this) { void sub_08041CD0(Entity* this) { GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2); if (this->frame & ANIM_DONE) { - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { this->subAction = 2; - this->actionDelay = 0x3c; + this->timer = 0x3c; MessageFromTarget(0x1651); } } else { @@ -635,8 +635,8 @@ void sub_08041D14(Entity* this) { GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2); if ((gMessage.doTextBox & 0x7f) == 0) { - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { if (gEntCount < 0x46) { pEVar1 = CreateObject(OBJECT_B6, 0, 0); @@ -645,8 +645,8 @@ void sub_08041D14(Entity* this) { pEVar1 = CreateObject(OBJECT_B6, 1, 0); pEVar1->parent = this; this->subAction = 3; - this->actionDelay = 0x96; - this->field_0xf = 0; + this->timer = 0x96; + this->subtimer = 0; this->spriteSettings.draw = 0; SoundReq(SFX_1C4); } @@ -656,16 +656,16 @@ void sub_08041D14(Entity* this) { void sub_08041D84(Entity* this) { GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2); - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { - if (this->field_0xf < 0xf0) { - if ((0xb7 < this->field_0xf) && ((this->field_0xf & 7) == 0)) { + if (this->subtimer < 0xf0) { + if ((0xb7 < this->subtimer) && ((this->subtimer & 7) == 0)) { ChangeObjPalette(((VaatiWrathHeapStruct*)this->myHeap)->type2, - gUnk_080D0E80[(this->field_0xf - 0xb8) >> 3]); - ChangeObjPalette(this->child, gUnk_080D0E80[(this->field_0xf - 0xb8) >> 3]); + gUnk_080D0E80[(this->subtimer - 0xb8) >> 3]); + ChangeObjPalette(this->child, gUnk_080D0E80[(this->subtimer - 0xb8) >> 3]); } - if (this->field_0xf == 0xe6) { + if (this->subtimer == 0xe6) { SetFade(7, 4); } } else { @@ -674,25 +674,25 @@ void sub_08041D84(Entity* this) { ChangeObjPalette(this, 0x173); InitAnimationForceUpdate(this, 0xb); } - this->field_0xf++; + this->subtimer++; sub_08041E78(this); } } void sub_08041E20(Entity* this) { - this->field_0xf += 1; + this->subtimer += 1; sub_08041E78(this); GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2); if (gFadeControl.active == 0) { this->subAction = 5; - this->actionDelay = 0x5a; + this->timer = 0x5a; } } void sub_08041E50(Entity* this) { Entity* type2; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { SetGlobalFlag(ENDING); type2 = ((VaatiWrathHeapStruct*)this->myHeap)->type2; type2->myHeap = NULL; @@ -705,10 +705,10 @@ void sub_08041E78(Entity* this) { Entity* fx; const s8* temp; - if ((this->field_0xf & 0xf) == 0) { + if ((this->subtimer & 0xf) == 0) { fx = CreateFx(this, FX_GIANT_EXPLOSION4, 0); if (fx != NULL) { - temp = &gUnk_080D0E90[this->field_0xf >> 3 & 0xe]; + temp = &gUnk_080D0E90[this->subtimer >> 3 & 0xe]; fx->x.HALF.HI += *temp++; fx->y.HALF.HI += *temp; fx->spritePriority.b0 = 3; @@ -804,7 +804,7 @@ void sub_08042004(Entity* this) { void sub_08042028(Entity* this) { this->action = 3; - this->actionDelay = gUnk_080D0EA8[Random() & 3]; + this->timer = gUnk_080D0EA8[Random() & 3]; this->speed = 0x40; this->direction = sub_0804207C(this); } @@ -814,7 +814,7 @@ void sub_08042050(Entity* this) { this->action = 8; uVar1 = Random(); - this->actionDelay = gUnk_080D0EAC[uVar1 & 3]; + this->timer = gUnk_080D0EAC[uVar1 & 3]; this->speed = 0x20; this->direction = ((uVar1 >> 8) & 0x10) + 8; } @@ -983,7 +983,7 @@ void sub_0804235C(Entity* this) { Entity* type1; this->action = 7; - this->actionDelay = 120; + this->timer = 120; this->field_0x78.HALF.HI = 0; this->field_0x7c.HALF.HI = 0xf0; InitAnimationForceUpdate(this, 0); diff --git a/src/enemy/vaatiWrathEye.c b/src/enemy/vaatiWrathEye.c index 784be12b..c5d0a044 100644 --- a/src/enemy/vaatiWrathEye.c +++ b/src/enemy/vaatiWrathEye.c @@ -92,33 +92,33 @@ 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->actionDelay = 0x3c; + this->timer = 0x3c; } } } void VaatiWrathEyeAction4(Entity* this) { sub_080485FC(this); - if (this->actionDelay != 0) { - if (--this->actionDelay == 0) { + if (this->timer != 0) { + if (--this->timer == 0) { InitializeAnimation(this, 3); } } else { GetNextFrame(this); if ((this->frame & ANIM_DONE) != 0) { this->action = 5; - this->actionDelay = 0; + this->timer = 0; } } } void VaatiWrathEyeAction5(Entity* this) { - if (this->actionDelay != 0) { + if (this->timer != 0) { this->action = 6; if (this->parent->health >= 0x15) { - this->actionDelay = 120; + this->timer = 120; } else { - this->actionDelay = 0x3c; + this->timer = 0x3c; } this->child = NULL; InitializeAnimation(this, 5); @@ -132,15 +132,15 @@ void VaatiWrathEyeAction6(Entity* this) { sub_080485FC(this); GetNextFrame(this); - if (this->actionDelay != 0) { - if (--this->actionDelay == 0) { + if (this->timer != 0) { + if (--this->timer == 0) { InitializeAnimation(this, 6); } } else { if (this->frame & ANIM_DONE) { this->action = 7; - this->actionDelay = 120; - this->field_0xf = 0; + this->timer = 120; + this->subtimer = 0; } else { if (this->frame & 1) { this->frame &= 0xfe; @@ -158,28 +158,28 @@ void VaatiWrathEyeAction6(Entity* this) { void VaatiWrathEyeAction7(Entity* this) { sub_080485FC(this); GetNextFrame(this); - if (this->field_0xf != 0) { + if (this->subtimer != 0) { this->action = 8; - this->actionDelay = 0x3c; + this->timer = 0x3c; COLLISION_OFF(this); this->spriteSettings.draw = 0; CreateFx(this, FX_REFLECT2, 0x40); this->parent->field_0x7a.HALF.HI |= 0x10 << this->type; } else { - if (--this->actionDelay != 0) { + if (--this->timer != 0) { return; } this->action = 5; - this->actionDelay = 0; + this->timer = 0; this->parent->field_0x7a.HALF.HI |= 1 << this->type; } } void VaatiWrathEyeAction8(Entity* this) { if (this->parent->action == 0xb) { - this->actionDelay = 0x3c; + this->timer = 0x3c; } else { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 9; COLLISION_ON(this); this->spriteSettings.draw = 1; @@ -195,7 +195,7 @@ void VaatiWrathEyeAction9(Entity* this) { GetNextFrame(this); if ((this->frame & ANIM_DONE) != 0) { this->action = 4; - this->actionDelay = 1; + this->timer = 1; this->parent->field_0x7a.HALF.HI = (this->parent->field_0x7a.HALF.HI & 0xf) | (1 << this->type); } } diff --git a/src/enemy/wallMaster.c b/src/enemy/wallMaster.c index b9377a19..0e06f87e 100644 --- a/src/enemy/wallMaster.c +++ b/src/enemy/wallMaster.c @@ -29,7 +29,7 @@ void WallMaster_OnTick(Entity* this) { } void WallMaster_OnCollision(Entity* this) { - if (this->hitType != 0x75 && ((this->bitfield & 0x7f) == 0 || (this->bitfield & 0x7f) == 0x1e)) { + if (this->hitType != 0x75 && ((this->contactFlags & 0x7f) == 0 || (this->contactFlags & 0x7f) == 0x1e)) { this->action = 5; COLLISION_OFF(this); this->field_0x7c.HALF.HI = gPlayerEntity.x.HALF.HI; @@ -61,8 +61,8 @@ void sub_0802A4E4(Entity* this) { this->collisionLayer = 3; this->field_0x7c.BYTES.byte1 = Random(); this->field_0x7a.HWORD = this->type2 * 0x3c; - this->field_0x7c.BYTES.byte0 = this->actionDelay; - this->field_0x78.HWORD = this->actionDelay * 0x3c; + this->field_0x7c.BYTES.byte0 = this->timer; + this->field_0x78.HWORD = this->timer * 0x3c; UpdateSpriteForCollisionLayer(this); sub_0802A7D0(this); } @@ -74,7 +74,7 @@ void sub_0802A534(Entity* this) { Entity* ent = sub_08049DF4(1); if (ent != NULL) { this->action = 2; - this->actionDelay = 0x5a; + this->timer = 0x5a; COLLISION_ON(this); this->spriteSettings.draw = 3; this->x.HALF.HI = ent->x.HALF.HI; @@ -90,8 +90,8 @@ void sub_0802A534(Entity* this) { void sub_0802A5B8(Entity* this) { sub_0802A7D0(this); - if (this->actionDelay) { - if (--this->actionDelay == 0) { + if (this->timer) { + if (--this->timer == 0) { EnqueueSFX(SFX_12D); InitializeAnimation(this, 0); } @@ -115,7 +115,7 @@ void sub_0802A610(Entity* this) { flags = this->frame & ANIM_DONE; if (flags) { this->action = 4; - this->actionDelay = 0x1e; + this->timer = 0x1e; } 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->actionDelay = 0x1e; + this->timer = 0x1e; } else if (this->frame & 0x1) { this->frame = flags; this->spriteOffsetY = 3; @@ -167,7 +167,7 @@ void sub_0802A69C(Entity* this) { void sub_0802A734(Entity* this) { sub_0802A7D0(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { SetInitializationPriority(); DoExitTransition(gUnk_0813AB1C[gArea.dungeon_idx]); } else { diff --git a/src/enemy/wallMaster2.c b/src/enemy/wallMaster2.c index 989097fe..59a3e042 100644 --- a/src/enemy/wallMaster2.c +++ b/src/enemy/wallMaster2.c @@ -34,8 +34,8 @@ void WallMaster2_OnTick(Entity* this) { } void WallMaster2_OnCollision(Entity* this) { - u8 bVar1 = this->bitfield & 0x7f; - switch (this->bitfield & 0x7f) { + u8 bVar1 = this->contactFlags & 0x7f; + switch (this->contactFlags & 0x7f) { case 0 ... 1: case 0x1e: this->action = 3; @@ -59,8 +59,8 @@ void sub_0802CCE0(Entity* this) { sub_0804A720(this); this->action = 1; - this->actionDelay = 60; - this->field_0xf = Random(); + this->timer = 60; + this->subtimer = Random(); this->spriteSettings.shadow = 2; this->animationState = 0xff; this->z.HALF.HI = -2; @@ -87,7 +87,7 @@ void sub_0802CD54(Entity* this) { this->action = 2; tmp = Random() >> 0x10; - this->actionDelay = tmp; + this->timer = tmp; this->speed = 0xc0; this->field_0x78.HWORD = gUnk_080CD728[Random() & 3]; this->field_0x7a.HALF.HI = (tmp >> 8) & 0x60; @@ -95,8 +95,8 @@ void sub_0802CD54(Entity* this) { } } - if (--this->actionDelay == 0) { - this->actionDelay = 60; + if (--this->timer == 0) { + this->timer = 60; sub_0802CF64(this); } LinearMoveUpdate(this); @@ -104,14 +104,14 @@ void sub_0802CD54(Entity* this) { void sub_0802CDE8(Entity* this) { if (--this->field_0x78.HWORD && sub_08049FDC(this, 1)) { - if ((this->actionDelay++ & 3) == 0) { + if ((this->timer++ & 3) == 0) { sub_08004596(this, GetFacingDirection(this, gUnk_020000B0)); sub_0802CF8C(this); } LinearMoveUpdate(this); } else { this->action = 1; - this->actionDelay = 60; + this->timer = 60; this->speed = 0x60; this->field_0x7c.HALF.LO = (Random() & 0x38) + 0x96; } @@ -134,7 +134,7 @@ void sub_0802CE68(Entity* this) { frames = this->frame & ANIM_DONE; if (frames) { this->action = 4; - this->actionDelay = 30; + this->timer = 30; } else if (this->frame & 1) { this->frame = frames; gPlayerEntity.spriteSettings.draw = 0; @@ -143,7 +143,7 @@ void sub_0802CE68(Entity* this) { void sub_0802CEF4(Entity* this) { sub_0802CFD8(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { SetInitializationPriority(); DoExitTransition(gUnk_0813AB1C[gArea.dungeon_idx]); } else { diff --git a/src/enemy/waterDrop.c b/src/enemy/waterDrop.c index 2b390879..51da1e65 100644 --- a/src/enemy/waterDrop.c +++ b/src/enemy/waterDrop.c @@ -25,7 +25,7 @@ void sub_0802A250(Entity* this) { Entity* ent; this->action = 1; - this->actionDelay = 0; + this->timer = 0; this->zVelocity = Q_16_16(-3.0); this->speed = gUnk_080CD03C[Random() & 3]; this->direction = gUnk_080CD040[Random() & 3] + 0x18; diff --git a/src/enemy/wisp.c b/src/enemy/wisp.c index 73f82457..be4d3f75 100644 --- a/src/enemy/wisp.c +++ b/src/enemy/wisp.c @@ -31,7 +31,7 @@ void Wisp_OnCollision(Entity* this) { u32 bits; Entity* ent; - bits = this->bitfield; + bits = this->contactFlags; if ((bits & 0x80) == 0) { return; } @@ -61,7 +61,7 @@ void Wisp_OnCollision(Entity* this) { ent = CreateFx(this, FX_DEATH, 0); if (ent != NULL) { this->child = ent; - this->actionDelay = 0xe; + this->timer = 0xe; CopyPosition(this, ent); } DeleteThisEntity(); @@ -91,9 +91,9 @@ void sub_08033660(Entity* this) { void sub_08033674(Entity* this) { sub_0804A720(this); - this->actionDelay = 0; + this->timer = 0; this->action = 1; - this->field_0x1c = 1; + this->gustJarFlags = 1; this->field_0x80.HWORD = this->x.HALF.HI; this->field_0x82.HWORD = this->y.HALF.HI; sub_08033744(this); @@ -101,7 +101,7 @@ void sub_08033674(Entity* this) { } void sub_080336A8(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_08033744(this); } else if (this->collisions != COL_NONE) { sub_0800417E(this, this->collisions); @@ -135,7 +135,7 @@ static void sub_08033744(Entity* this) { u32 rand = (u32)Random() % 256; // 8 potential options - this->actionDelay = gUnk_080CEBA4[(rand & 0x70) >> 4]; + this->timer = gUnk_080CEBA4[(rand & 0x70) >> 4]; // 4 potential options temp = ((rand & 0xc) * 2); diff --git a/src/enemy/wizzrobeFire.c b/src/enemy/wizzrobeFire.c index 9cf0272d..714f3866 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->actionDelay = 0x28; - super->field_0xf = 0x60; + super->timer = 0x28; + super->subtimer = 0x60; sub_0802F888(this); projectile = CreateProjectileWithParent(super, FIRE_PROJECTILE, 0); if (projectile != NULL) { @@ -58,25 +58,25 @@ void WizzrobeFire_Action1(WizzrobeEntity* this) { switch (this->timer2) { case 0xff: - if (--super->field_0xf == 0) { + if (--super->subtimer == 0) { this->timer2 = 0; } break; case 0: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2 += 1; - super->actionDelay = 0x0e; + super->timer = 0x0e; super->flags |= 0x80; } break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 2; this->timer2 = 0; - super->actionDelay = 0x20; + super->timer = 0x20; tmp = super->direction >> 3; child = super->child; - child->actionDelay = 1; + child->timer = 1; child->spriteSettings.draw = 1; InitializeAnimation(super, tmp | 4); } @@ -90,11 +90,11 @@ void WizzrobeFire_Action1(WizzrobeEntity* this) { void WizzrobeFire_Action2(WizzrobeEntity* this) { switch (this->timer2) { case 0: - switch (--super->actionDelay) { + switch (--super->timer) { case 0: this->timer2 += 1; - super->actionDelay = 0x38; - super->field_0xf = 0; + super->timer = 0x38; + super->subtimer = 0; super->child->spriteSettings.draw = 0; break; case 6: @@ -108,11 +108,11 @@ void WizzrobeFire_Action2(WizzrobeEntity* this) { } break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2++; this->timer1 = 0x28; - super->actionDelay = 0x28; - super->field_0xf = 0; + super->timer = 0x28; + super->subtimer = 0; super->flags &= 0x7f; SetTile(this->tileIndex, this->tilePosition, super->collisionLayer); EnqueueSFX(SFX_156); @@ -121,18 +121,18 @@ void WizzrobeFire_Action2(WizzrobeEntity* this) { break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2++; - super->actionDelay = (Random() & 0x3f) + 0x1c; + super->timer = (Random() & 0x3f) + 0x1c; super->spriteSettings.draw = 0; } break; case 3: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 1; this->timer2 = 0; this->timer1 = 0x28; - super->actionDelay = 0x28; + super->timer = 0x28; EnqueueSFX(SFX_156); sub_0802F8E4(this); InitializeAnimation(super, super->direction >> 3); diff --git a/src/enemy/wizzrobeIce.c b/src/enemy/wizzrobeIce.c index b053eb71..78397f59 100644 --- a/src/enemy/wizzrobeIce.c +++ b/src/enemy/wizzrobeIce.c @@ -29,7 +29,7 @@ void WizzrobeIce_OnCollision(WizzrobeEntity* this) { Create0x68FX(super, FX_STARS); } EnemyFunctionHandlerAfterCollision(super, WizzrobeIce_Functions); - if (super->bitfield == 0x87) { + if (super->contactFlags == 0x87) { Entity* obj = CreateObject(OBJECT_2A, 3, 0); if (obj != NULL) { obj->spritePriority.b0 = 3; @@ -49,8 +49,8 @@ void WizzrobeIce_Init(WizzrobeEntity* this) { super->action = 1; this->timer2 = 0xff; this->timer1 = 0x28; - super->actionDelay = 0x28; - super->field_0xf = 0x60; + super->timer = 0x28; + super->subtimer = 0x60; sub_0802F888(this); projectile = CreateProjectileWithParent(super, ICE_PROJECTILE, 0); if (projectile != NULL) { @@ -66,26 +66,26 @@ void WizzrobeIce_Action1(WizzrobeEntity* this) { Entity* child; switch (this->timer2) { case 0xff: - if (--super->field_0xf == 0) { + if (--super->subtimer == 0) { this->timer2 = 0; } break; case 0: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2++; - super->actionDelay = 0xc; + super->timer = 0xc; super->flags |= 0x80; } break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 2; this->timer2 = 0; - super->actionDelay = 0x20; + super->timer = 0x20; tmp = super->direction >> 3; child = super->child; - child->actionDelay = 1; + child->timer = 1; child->spriteSettings.draw = 1; InitializeAnimation(super, tmp | 4); } @@ -97,11 +97,11 @@ void WizzrobeIce_Action1(WizzrobeEntity* this) { void WizzrobeIce_Action2(WizzrobeEntity* this) { switch (this->timer2) { case 0: - switch (--super->actionDelay) { + switch (--super->timer) { case 0: this->timer2 += 1; - super->actionDelay = 0x38; - super->field_0xf = 0; + super->timer = 0x38; + super->subtimer = 0; super->child->spriteSettings.draw = 0; break; case 0xa: @@ -115,11 +115,11 @@ void WizzrobeIce_Action2(WizzrobeEntity* this) { } break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2++; this->timer1 = 0x28; - super->actionDelay = 0x28; - super->field_0xf = 0; + super->timer = 0x28; + super->subtimer = 0; super->flags &= 0x7f; SetTile(this->tileIndex, this->tilePosition, super->collisionLayer); EnqueueSFX(SFX_156); @@ -127,18 +127,18 @@ void WizzrobeIce_Action2(WizzrobeEntity* this) { } break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2++; - super->actionDelay = (Random() & 0x3f) + 0x18; + super->timer = (Random() & 0x3f) + 0x18; super->spriteSettings.draw = 0; } break; case 3: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 1; this->timer2 = 0; this->timer1 = 0x28; - super->actionDelay = 0x28; + super->timer = 0x28; EnqueueSFX(SFX_156); sub_0802F8E4(this); InitializeAnimation(super, super->direction >> 3); diff --git a/src/enemy/wizzrobeWind.c b/src/enemy/wizzrobeWind.c index 4fce3d5a..79fe7f9a 100644 --- a/src/enemy/wizzrobeWind.c +++ b/src/enemy/wizzrobeWind.c @@ -36,7 +36,7 @@ void WizzrobeWind_OnCollision(WizzrobeEntity* this) { Create0x68FX(super, FX_STARS); } EnemyFunctionHandlerAfterCollision(super, WizzrobeWind_Functions); - if (super->bitfield == 0x87) { + if (super->contactFlags == 0x87) { Entity* obj = CreateObject(OBJECT_2A, 3, 0); if (obj != NULL) { obj->spritePriority.b0 = 3; @@ -57,7 +57,7 @@ void WizzrobeWind_Init(WizzrobeEntity* this) { super->speed = 0xc0; super->flags |= 0x80; this->targetIndex = 0; - super->child = (Entity*)GetCurrentRoomProperty(super->actionDelay); + super->child = (Entity*)GetCurrentRoomProperty(super->timer); sub_0802FA48(this); sub_0802FA88(this); } else { @@ -65,8 +65,8 @@ void WizzrobeWind_Init(WizzrobeEntity* this) { super->action = 1; this->timer2 = 0xff; this->timer1 = 0x28; - super->actionDelay = 0x28; - super->field_0xf = 0x60; + super->timer = 0x28; + super->subtimer = 0x60; sub_0802F888(this); } projectile = CreateProjectileWithParent(super, WIND_PROJECTILE, 0); @@ -83,25 +83,25 @@ void WizzrobeWind_Action1(WizzrobeEntity* this) { Entity* parent; switch (this->timer2) { case 0xff: - if (--super->field_0xf == 0) { + if (--super->subtimer == 0) { this->timer2 = 0; } break; case 0: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2++; - super->actionDelay = 0x10; + super->timer = 0x10; super->flags |= 0x80; } break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 2; this->timer2 = 0; - super->actionDelay = 0x28; + super->timer = 0x28; tmp = super->direction >> 3; parent = super->parent; - parent->actionDelay = 1; + parent->timer = 1; parent->spriteSettings.draw = 1; InitializeAnimation(super, tmp | 4); } @@ -113,11 +113,11 @@ void WizzrobeWind_Action1(WizzrobeEntity* this) { void WizzrobeWind_Action2(WizzrobeEntity* this) { switch (this->timer2) { case 0: - switch (--super->actionDelay) { + switch (--super->timer) { case 0: this->timer2++; - super->actionDelay = 0x38; - super->field_0xf = 0; + super->timer = 0x38; + super->subtimer = 0; super->parent->spriteSettings.draw = 0; break; case 8: @@ -131,11 +131,11 @@ void WizzrobeWind_Action2(WizzrobeEntity* this) { } break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2++; this->timer1 = 0x28; - super->actionDelay = 0x28; - super->field_0xf = 0; + super->timer = 0x28; + super->subtimer = 0; super->flags &= 0x7f; EnqueueSFX(SFX_156); SetTile(this->tileIndex, this->tilePosition, super->collisionLayer); @@ -143,18 +143,18 @@ void WizzrobeWind_Action2(WizzrobeEntity* this) { } break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2++; - super->actionDelay = (Random() & 0x3f) + 0x20; + super->timer = (Random() & 0x3f) + 0x20; super->spriteSettings.draw = 0; } break; case 3: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 1; this->timer2 = 0; this->timer1 = 0x28; - super->actionDelay = 0x28; + super->timer = 0x28; EnqueueSFX(SFX_156); sub_0802F8E4(this); InitializeAnimation(super, super->direction >> 3); @@ -174,25 +174,25 @@ void WizzrobeWind_Action3(WizzrobeEntity* this) { switch (this->timer2) { case 0: this->timer2 = 1; - super->actionDelay = 0x40; + super->timer = 0x40; break; case 1: - if (--super->actionDelay != 0) { + if (--super->timer != 0) { return; } this->timer2++; - super->actionDelay = 0x28; - parent->actionDelay = 1; + super->timer = 0x28; + parent->timer = 1; parent->spriteSettings.draw = 1; InitializeAnimation(super, super->animationState >> 1 | 4); break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->timer2++; - super->actionDelay = (Random() & 0x1f) + 0x30; + super->timer = (Random() & 0x1f) + 0x30; parent->spriteSettings.draw = 0; InitializeAnimation(super, super->animationState >> 1); - } else if (super->actionDelay == 8) { + } else if (super->timer == 8) { parent = CreateProjectileWithParent(super, WIND_PROJECTILE, 1); if (parent != NULL) { parent->direction = super->direction & 0x18; @@ -250,7 +250,7 @@ void sub_0802F8E4(WizzrobeEntity* this) { } void sub_0802F9C8(WizzrobeEntity* this) { - if (super->field_0xf == 0) { + if (super->subtimer == 0) { if (this->timer1 != 0) { if ((--this->timer1 & 1) != 0) { super->spriteSettings.draw = 0; diff --git a/src/enemyUtils.c b/src/enemyUtils.c index 5e60a0d9..1c2c8484 100644 --- a/src/enemyUtils.c +++ b/src/enemyUtils.c @@ -55,8 +55,8 @@ bool32 EnemyInit(GenericEntity* this) { if (uVar4 != 0) { Entity* object = CreateObject(OBJECT_A9, uVar4 - 1, 0); if (object != NULL) { - object->actionDelay = super->flags; - object->field_0xf = super->spriteSettings.draw; + object->timer = super->flags; + object->subtimer = super->spriteSettings.draw; object->spritePriority.b0 = 3; object->parent = super; CopyPosition(super, object); @@ -125,12 +125,12 @@ void CreateDeathFx(GenericEntity* parent, u32 parentId, u32 fixedItem) { DeleteThisEntity(); return; } else { - int tmp = parent->base.field_0x3a & 2; + int tmp = parent->base.gustJarState & 2; if (tmp == 0) { sub_08049CF4(&(parent->base)); gSave.unk50 += 1; - parent->base.field_0x3a |= 2; - parent->base.actionDelay = 0xff; + parent->base.gustJarState |= 2; + parent->base.timer = 0xff; SetDefaultPriority(&(parent->base), 3); deathFx2 = (DeathFxObject*)CreateObject(DEATH_FX, parent->base.id, 0); if (deathFx2 != NULL) { @@ -146,8 +146,8 @@ void CreateDeathFx(GenericEntity* parent, u32 parentId, u32 fixedItem) { DeleteEntity(&(parent->base)); return; } - if ((parent->base.bitfield & 0x7f) == 0x13) { - bVar3 = parent->base.field_0x1c & 0xf; + if ((parent->base.contactFlags & 0x7f) == 0x13) { + bVar3 = parent->base.gustJarFlags & 0xf; if (bVar3 != 1) { if ((bVar3 == 2) && (deathFx2 != NULL)) { deathFx2->unk6c |= 2; @@ -163,14 +163,14 @@ void CreateDeathFx(GenericEntity* parent, u32 parentId, u32 fixedItem) { } } - if (parent->base.actionDelay == 0) { + if (parent->base.timer == 0) { DeleteThisEntity(); } else { - if (--parent->base.actionDelay == 0) { + if (--parent->base.timer == 0) { parent->base.spriteSettings.draw = 0; SetDefaultPriority(&(parent->base), 0); } else { - if (parent->base.actionDelay < 9) { + if (parent->base.timer < 9) { if (parent->base.spriteSettings.draw) { parent->base.spriteSettings.draw = 0; } else { diff --git a/src/entity.c b/src/entity.c index 20949041..be882d66 100644 --- a/src/entity.c +++ b/src/entity.c @@ -354,8 +354,8 @@ void DeleteEntity(Entity* ent) { } COLLISION_OFF(ent); ent->spriteSettings.draw = 0; - ent->field_0x3c = 0; - ent->bitfield = 0; + ent->collisionFlags = 0; + ent->contactFlags = 0; ent->knockbackDuration = 0; ent->health = 0; UnlinkEntity(ent); diff --git a/src/game.c b/src/game.c index ecc81a82..6578ea67 100644 --- a/src/game.c +++ b/src/game.c @@ -2558,9 +2558,9 @@ u32 CreateItemDrop(Entity* arg0, u32 itemID, u32 itemParameter) { itemEntity = CreateObject(GROUND_ITEM, itemID, adjustedParam); if (itemEntity != NULL) { if (arg0 == &gPlayerEntity) { - itemEntity->actionDelay = 1; + itemEntity->timer = 1; } else { - itemEntity->actionDelay = 0; + itemEntity->timer = 0; } if (arg0->kind == OBJECT) { if (arg0->id == 99) { diff --git a/src/interrupts.c b/src/interrupts.c index f57f9b83..1ea6b512 100644 --- a/src/interrupts.c +++ b/src/interrupts.c @@ -230,7 +230,7 @@ void HandlePlayerLife(Entity* this) { gUnk_0200AF00.unk_2d = 0; gUnk_0200AF00.unk_2e = 0; - if ((gPlayerEntity.bitfield & 0x80) && (gPlayerEntity.iframes > 0)) + if ((gPlayerEntity.contactFlags & 0x80) && (gPlayerEntity.iframes > 0)) SoundReq(SFX_86); gPlayerState.flags &= ~(0x2000000 | PL_FALLING); @@ -316,7 +316,7 @@ void sub_080171F0(void) { if (gPlayerEntity.field_0x7a.HWORD != 0) gPlayerEntity.field_0x7a.HWORD--; - gPlayerEntity.bitfield &= ~0x80; + gPlayerEntity.contactFlags &= ~0x80; if (gPlayerEntity.action != PLAYER_DROWN) COPY_FLAG_FROM_TO(gPlayerState.flags, 0x2, 0x10000); diff --git a/src/item/itemBomb.c b/src/item/itemBomb.c index 9adeaa54..e284a9e0 100644 --- a/src/item/itemBomb.c +++ b/src/item/itemBomb.c @@ -1,5 +1,5 @@ #include "item.h" -#include "coord.h" +#include "physics.h" #include "sound.h" #include "functions.h" #include "playeritem.h" diff --git a/src/item/itemMoleMitts.c b/src/item/itemMoleMitts.c index bd80a910..786276e5 100644 --- a/src/item/itemMoleMitts.c +++ b/src/item/itemMoleMitts.c @@ -72,8 +72,8 @@ void sub_080771C8(ItemBehavior* this, u32 idx) { if (this->field_0x5[3] != 0xff) { object = CreateObjectWithParent(&gPlayerEntity, 0x1f, 0, this->field_0x2[1]); if (object != NULL) { - object->actionDelay = this->field_0x5[2]; - object->field_0xf = this->field_0x5[3]; + object->timer = this->field_0x5[2]; + object->subtimer = this->field_0x5[3]; object->animationState = gPlayerEntity.animationState & 6; gPlayerEntity.frame = 0; gPlayerEntity.frameDuration = gUnk_0811BE14[this->field_0x5[3]]; @@ -138,7 +138,7 @@ void sub_080772A8(ItemBehavior* this, u32 idx) { if (effect != NULL) { effect->animationState = this->field_0x5[5]; effect->spritePriority.b0 = gPlayerEntity.spritePriority.b0 - 1; - effect->field_0xf = 1; + effect->subtimer = 1; } this->stateID = 3; this->field_0x5[0] = 1; diff --git a/src/item/itemTryPickupObject.c b/src/item/itemTryPickupObject.c index e2c71d66..d932582e 100644 --- a/src/item/itemTryPickupObject.c +++ b/src/item/itemTryPickupObject.c @@ -23,7 +23,7 @@ void ItemPickupCheck(ItemBehavior* this, u32 idx) { switch (sub_080789A8()) { case 2: - if (((gCarriedEntity.unk_8)->field_0x16 & 0xf) == 0) { + if (((gCarriedEntity.unk_8)->carryFlags & 0xf) == 0) { sub_08076088(this, gCarriedEntity.unk_8, idx); return; } @@ -75,7 +75,7 @@ void sub_08076488(ItemBehavior* this, u32 idx) { if (this->field_0x5[2] == 0) { if (PlayerTryDropObject(this, idx) != 0) { - if ((((this->field_0x18->field_0x16) & 0xf0) == 0x10) && ((gRoomTransition.frameCount & 1U) != 0)) { + if ((((this->field_0x18->carryFlags) & 0xf0) == 0x10) && ((gRoomTransition.frameCount & 1U) != 0)) { return; } UpdateItemAnim(this); diff --git a/src/manager/manager1.c b/src/manager/manager1.c index 8664caab..8de090f6 100644 --- a/src/manager/manager1.c +++ b/src/manager/manager1.c @@ -60,7 +60,7 @@ static void sub_080570F8(void) { } void sub_08057118(Entity* this) { - this->actionDelay = 0; + this->timer = 0; ZV(this)[0] = 0; ZV(this)[1] = 0; ZV(this)[2] = 0; @@ -104,45 +104,45 @@ NONMATCH("asm/non_matching/manager1/sub_08057174.inc", void sub_08057174(Entity* case 1: if (ZV(this)[1] == 2) { this->action = 3; - this->actionDelay = 9; + this->timer = 9; } break; case 5: if (ZV(this)[1] == 6) { this->action = 3; - this->actionDelay = 9; + this->timer = 9; } break; case 2: if (ZV(this)[1] == 0) { this->action = 2; - this->actionDelay = 0; + this->timer = 0; ZV(this)[0] = 0; } break; case 6: if (ZV(this)[1] == 0) { this->action = 2; - this->actionDelay = 0; + this->timer = 0; } break; case 4: if (ZV(this)[1] == 0) { this->action = 2; - this->actionDelay = 0; + this->timer = 0; this->z.WORD = 0; } break; case 3: if (ZV(this)[1] == 4) { this->action = 3; - this->actionDelay = 9; + this->timer = 9; } break; } if (this->action != 1) { - this->field_0xf = 8; + this->subtimer = 8; ZV(this)[1] = prop->unk0; ZV(this)[2] = 1; return; @@ -154,11 +154,11 @@ NONMATCH("asm/non_matching/manager1/sub_08057174.inc", void sub_08057174(Entity* END_NONMATCH void sub_0805728C(Entity* this) { - if (--this->field_0xf == 0) { - this->field_0xf = 8; - gScreen.controls.alphaBlend = gUnk_08107C1C[this->actionDelay++]; + if (--this->subtimer == 0) { + this->subtimer = 8; + gScreen.controls.alphaBlend = gUnk_08107C1C[this->timer++]; - if (this->actionDelay == 10) { + if (this->timer == 10) { this->action = 1; ZV(this)[2] = 0; } @@ -166,11 +166,11 @@ void sub_0805728C(Entity* this) { } void sub_080572D4(Entity* this) { - if (--this->field_0xf == 0) { - this->field_0xf = 8; - gScreen.controls.alphaBlend = gUnk_08107C1C[this->actionDelay--]; + if (--this->subtimer == 0) { + this->subtimer = 8; + gScreen.controls.alphaBlend = gUnk_08107C1C[this->timer--]; - if (this->actionDelay == 0xff) { + if (this->timer == 0xff) { this->action = 1; ZV(this)[2] = 0; ZV(this)[1] = 0; diff --git a/src/manager/manager14.c b/src/manager/manager14.c index 9f5d8154..0ca86740 100644 --- a/src/manager/manager14.c +++ b/src/manager/manager14.c @@ -3,7 +3,7 @@ #include "screen.h" #include "room.h" #include "flags.h" -#include "coord.h" +#include "physics.h" #include "main.h" typedef struct { diff --git a/src/manager/manager17.c b/src/manager/manager17.c index 54c1656b..9ba38cda 100644 --- a/src/manager/manager17.c +++ b/src/manager/manager17.c @@ -35,7 +35,7 @@ void sub_0805AD80(Manager17* manager) { if (CheckFlags(manager->field_0x3e) != 0) { Entity* object = CreateObject(GROUND_ITEM, manager->manager.unk_0a, manager->manager.unk_0b); if (object != NULL) { - object->actionDelay = manager->field_0x35; + object->timer = manager->field_0x35; object->collisionLayer = manager->field_0x36; object->x.HALF.HI = manager->field_0x38 + gRoomControls.origin_x; object->y.HALF.HI = manager->field_0x3a + gRoomControls.origin_y; diff --git a/src/manager/manager21.c b/src/manager/manager21.c index d07cbb18..e227a2ae 100644 --- a/src/manager/manager21.c +++ b/src/manager/manager21.c @@ -15,7 +15,7 @@ typedef struct { u16 x; u16 y; u16 field_0x4; - u16 actionDelay; + u16 timer; } MinishEntranceSpawnData; bool32 sub_0805B8CC(u32); @@ -38,8 +38,8 @@ void Manager21_Main(Manager21* this) { if (((this->field_0x20 & (1 << count)) == 0) && (sub_0805B8CC(spawnData->field_0x4) != 0)) { Entity* object = CreateObject(MINISH_SIZED_ENTRANCE, 1, 0); if (object != NULL) { - object->actionDelay = spawnData->actionDelay; - object->field_0xf = count; + object->timer = spawnData->timer; + object->subtimer = count; object->x.HALF.HI = gRoomControls.origin_x + spawnData->x; object->y.HALF.HI = gRoomControls.origin_y + spawnData->y; object->parent = (Entity*)this; diff --git a/src/manager/manager22.c b/src/manager/manager22.c index 3bcefffb..df516e8d 100644 --- a/src/manager/manager22.c +++ b/src/manager/manager22.c @@ -5,7 +5,7 @@ #include "screen.h" #include "player.h" #include "room.h" -#include "coord.h" +#include "physics.h" #include "functions.h" #include "common.h" #include "game.h" diff --git a/src/manager/manager26.c b/src/manager/manager26.c index 5471660f..dc8223b6 100644 --- a/src/manager/manager26.c +++ b/src/manager/manager26.c @@ -38,7 +38,7 @@ void sub_0805C6D0(Manager26* this) { Entity* obj; obj = CreateObject(PUSHABLE_FURNITURE, tmp->unk_01, tmp->unk_02); if (obj) { - obj->actionDelay = tmp->unk_03; + obj->timer = tmp->unk_03; obj->x.HALF.HI = gRoomControls.origin_x + tmp->unk_04; obj->y.HALF.HI = gRoomControls.origin_y + tmp->unk_06; obj->parent = (Entity*)this; diff --git a/src/manager/manager27.c b/src/manager/manager27.c index e5c4483c..69801aa7 100644 --- a/src/manager/manager27.c +++ b/src/manager/manager27.c @@ -35,14 +35,14 @@ void sub_0805C874(Entity* this) { this->action = 1; } - this->actionDelay = 1; - this->field_0xf = 0; + this->timer = 1; + this->subtimer = 0; } void sub_0805C894(Entity* this) { if (sub_0805C920(this)) { this->action = 2; - this->actionDelay = 1; + this->timer = 1; SoundReq(SFX_EM_ARMOS_ON); } } @@ -51,14 +51,14 @@ void sub_0805C8B4(Entity* this) { u8 bVar1; int iVar2; - if (--this->actionDelay == 0) { - this->actionDelay = 0x14; + if (--this->timer == 0) { + this->timer = 0x14; - if (5 < ++this->field_0xf) { - this->field_0xf = 0; + if (5 < ++this->subtimer) { + this->subtimer = 0; } - LoadPaletteGroup(gUnk_08108D20[this->field_0xf]); - if (this->field_0xf == 0) { + LoadPaletteGroup(gUnk_08108D20[this->subtimer]); + if (this->subtimer == 0) { SoundReq(SFX_EM_ARMOS_ON); } } @@ -68,7 +68,7 @@ void sub_0805C8B4(Entity* this) { } void sub_0805C908(Entity* this) { - if (this->field_0xf == 0) { + if (this->subtimer == 0) { this->action = 1; } else { sub_0805C8B4(this); diff --git a/src/manager/manager31.c b/src/manager/manager31.c index 8b12bd0c..f9a151bc 100644 --- a/src/manager/manager31.c +++ b/src/manager/manager31.c @@ -63,8 +63,8 @@ void Manager31_Main(Manager31* this) { Entity* object = CreateObject(SHOP_ITEM, 0x5c, ((s32)Random() % spawnData->maxType) + spawnData->minType); if (object != NULL) { - object->actionDelay = 1; - object->field_0xf = count; + object->timer = 1; + object->subtimer = count; object->x.HALF.HI = spawnData->x + gRoomControls.origin_x; object->y.HALF.HI = spawnData->y + gRoomControls.origin_y; object->field_0x80.HWORD = spawnData->x; diff --git a/src/manager/manager38.c b/src/manager/manager38.c index 5b081a28..3bfae97f 100644 --- a/src/manager/manager38.c +++ b/src/manager/manager38.c @@ -14,7 +14,7 @@ void sub_0805E0C0(Entity* this) { Entity* entity; this->action = 1; - this->actionDelay = 0; + this->timer = 0; entityData = (EntityData*)GetCurrentRoomProperty(this->type); if (entityData == NULL) { DeleteThisEntity(); @@ -22,10 +22,10 @@ void sub_0805E0C0(Entity* this) { while (*(u8*)entityData != 0xff) { entity = LoadRoomEntity(entityData++); entity->parent = this; - entity->actionDelay = 0xff; + entity->timer = 0xff; } } void sub_0805E0F4(Entity* this) { - this->actionDelay = 0; + this->timer = 0; } diff --git a/src/manager/managerC.c b/src/manager/managerC.c index c3fdaa8a..ac7203c4 100644 --- a/src/manager/managerC.c +++ b/src/manager/managerC.c @@ -5,7 +5,7 @@ #include "structures.h" #include "room.h" #include "screen.h" -#include "coord.h" +#include "physics.h" #include "functions.h" #include "save.h" #include "area.h" diff --git a/src/manager/managerF.c b/src/manager/managerF.c index 41e4024b..1614bd94 100644 --- a/src/manager/managerF.c +++ b/src/manager/managerF.c @@ -179,7 +179,7 @@ void sub_08059064(ManagerF* this) { tmp = CreateObject(GROUND_ITEM, ITEM_SMALL_KEY, 0); if (!tmp) return; - tmp->actionDelay = 2; + tmp->timer = 2; tmp->x.HALF.HI = this->unk_38 + gRoomControls.origin_x; tmp->y.HALF.HI = this->unk_3a + gRoomControls.origin_y; } diff --git a/src/menu/figurine_menu.c b/src/menu/figurine_menu.c index ae7c0c51..22e9decc 100644 --- a/src/menu/figurine_menu.c +++ b/src/menu/figurine_menu.c @@ -94,7 +94,7 @@ void Subtask_FigurineMenu(void) { } void FigurineMenu_080A4608(void) { - s32 iVar2; + s32 iVar2, r1, r2; SetBgmVolume(0x80); sub_080A4DA8(3); @@ -110,20 +110,13 @@ void FigurineMenu_080A4608(void) { for (iVar2 = 0; iVar2 < 0x10; iVar2++) { gFigurineMenu.unk10.a[iVar2] = 0xee; } - { - int r0, r1, r2; - r1 = gUI.field_0x3; - r0 = gSave.unk6; - r2 = 0x88; - if (r0 == 0) { - r2 = 0x82; - } - if (r2 < r1) { - r1 = 1; - } - gFigurineMenu.unk1c = r1; + r1 = gUI.field_0x3; + r2 = !gSave.saw_staffroll ? 0x82 : 0x88; + if (r2 < r1) { + r1 = 1; } + gFigurineMenu.figure_idx = r1; SetFade(4, 8); } @@ -141,7 +134,7 @@ void FigurineMenu0_Type0(void) { void FigurineMenu0_Type1(void) { if (gFadeControl.active == 0) { - CreateObject(OBJECT_A2, gUnk_080FC3E4[gFigurineMenu.unk1c].unk7, 0); + CreateObject(OBJECT_A2, gUnk_080FC3E4[gFigurineMenu.figure_idx].unk7, 0); SetMenuType(2); } } @@ -154,7 +147,7 @@ void FigurineMenu0_Type2(void) { gFigurineMenu.unk20 += 1; switch (gFigurineMenu.unk20) { case 0x40: - gFigurineMenu.unk21 = WriteBit(&gUnk_02002B0E, gFigurineMenu.unk1c); + gFigurineMenu.duplicate = WriteBit(&gUnk_02002B0E, gFigurineMenu.figure_idx); gMenu.column_idx = 1; default: bVar1 = gFigurineMenu.unk20 >> 2; @@ -171,8 +164,8 @@ void FigurineMenu0_Type2(void) { SetMenuType(3); sub_080A70AC((KeyButtonLayout*)&gUnk_0812813C); gMenu.column_idx = 0x15; - if (gFigurineMenu.unk21 == 0) { - sound = SFX_109; + if (!gFigurineMenu.duplicate) { + sound = SFX_ITEM_GET; } else { sound = SFX_MENU_ERROR; } @@ -225,43 +218,43 @@ void FigurineMenu1_Type1(void) { return; r5 = gFigurineMenu.unk1f; - r4 = gFigurineMenu.unk1c; + r4 = gFigurineMenu.figure_idx; switch (gInput.unk4) { - case 2: - case 8: + case B_BUTTON: + case START_BUTTON: SetMenuType(3); break; - case 0x200: + case L_BUTTON: r4 -= 5; break; - case 0x100: + case R_BUTTON: r4 += 5; break; - case 0x40: + case DPAD_UP: r4--; break; - case 0x80: + case DPAD_DOWN: r4++; break; - case 0x10: + case DPAD_RIGHT: r5 += 8; break; - case 0x20: + case DPAD_LEFT: r5 -= 8; break; - case 1: + case A_BUTTON: break; } - r1 = (gSave.unk6 == 0) ? 0x82 : 0x88; + r1 = !gSave.saw_staffroll ? 0x82 : 0x88; if (r4 <= 0) { r4 = 1; } if (r1 < r4) { r4 = r1; } - r0 = gFigurineMenu.unk1c; + r0 = gFigurineMenu.figure_idx; if (r0 != r4) { - gFigurineMenu.unk1c = r4; + gFigurineMenu.figure_idx = r4; SoundReq(SFX_TEXTBOX_CHOICE); SetMenuType(2); r5 = 0; @@ -290,7 +283,7 @@ u32 sub_080A4948(s32 param_1) { u32 uVar2; uVar2 = 0; - iVar1 = gSave.unk6 == 0 ? 0x82 : 0x88; + iVar1 = !gSave.saw_staffroll ? 0x82 : 0x88; if ((0 < param_1) || (iVar1 >= param_1)) { if (ReadBit((u32*)&gSave.stats.filler4[4], param_1)) { uVar2 = 1; @@ -322,11 +315,11 @@ void FigurineMenu_080A4978(void) { gOamCmd.x = 0x9c; gOamCmd.y = 0x48; DrawDirect(sub_080A4978_draw_constant, 0); - r2 = (gSave.unk6 == 0) ? 0x82 : 0x88; + r2 = !gSave.saw_staffroll ? 0x82 : 0x88; if ((gMenu.column_idx & 2) != 0) { - if (r2 >= (gFigurineMenu.unk1c)) { + if (r2 >= (gFigurineMenu.figure_idx)) { gOamCmd.x = 0xe8; - r0 = (0x5000 / r2) * (gFigurineMenu.unk1c - 1); + r0 = (0x5000 / r2) * (gFigurineMenu.figure_idx - 1); if (r0 < 0) { r0 += 0xff; } @@ -364,7 +357,7 @@ void FigurineMenu_080A4978(void) { if (gSaveHeader->language) { if (gMenu.column_idx & 0x4) { gOamCmd.y = 0x10; - r4 = gFigurineMenu.unk1c; + r4 = gFigurineMenu.figure_idx; for (r6 = 2; r6 >= 0; r6--) { gOamCmd.x = 0x5d + (r6 * 7); gOamCmd._8 = ((r4 % 10) << 1) | 0x9e0; @@ -374,16 +367,16 @@ void FigurineMenu_080A4978(void) { } } if (gMenu.column_idx & 1) { - if (sub_080A4948(gFigurineMenu.unk1c)) { + if (sub_080A4948(gFigurineMenu.figure_idx)) { gOamCmd.x = 0x2c; gOamCmd.y = 0x48; gOamCmd._8 = 0xd4 << 7; - DrawDirect(sub_080A4978_draw_constant - 4, gFigurineMenu.unk1c - 1); - if (gFigurineMenu.unk1d != gFigurineMenu.unk1c) { + DrawDirect(sub_080A4978_draw_constant - 4, gFigurineMenu.figure_idx - 1); + if (gFigurineMenu.unk1d != gFigurineMenu.figure_idx) { const Figurine* fig; u8* gfx; - gFigurineMenu.unk1d = gFigurineMenu.unk1c; - fig = &gFigurines[gFigurineMenu.unk1c]; + gFigurineMenu.unk1d = gFigurineMenu.figure_idx; + fig = &gFigurines[gFigurineMenu.figure_idx]; LoadPalettes(fig->pal, 0x16, 9); gfx = fig->gfx; if (fig->size < 0) { @@ -399,7 +392,7 @@ void FigurineMenu_080A4978(void) { void sub_080A4B44(void) { u32 uVar1; - uVar1 = gFigurineMenu.unk1c; + uVar1 = gFigurineMenu.figure_idx; if ((gMenu.column_idx & 0x10) != 0) { gFigurineMenu.unk1e = sub_080A4CBC(uVar1); } @@ -472,7 +465,7 @@ void sub_080A4BA0(u32 arg1, u32 arg2) { s0.unk14 = arg2; } - tmp = (gSave.unk6 == 0) ? 0x82 : 0x88; + tmp = !gSave.saw_staffroll ? 0x82 : 0x88; if (r5 <= 0 || tmp < r5) { r5 = -1; diff --git a/src/menu/kinstone_menu.c b/src/menu/kinstone_menu.c index 13d95850..c0e9f7b6 100644 --- a/src/menu/kinstone_menu.c +++ b/src/menu/kinstone_menu.c @@ -641,11 +641,11 @@ void KinstoneMenu_080A4528(void) { if (entity != NULL) { if (entity->kind == NPC) { NPCInit(entity); - entity->field_0xf = entity->id; + entity->subtimer = entity->id; entity->id = 0x56; } else { EnemyInit(entity); - entity->field_0xf = entity->id; + entity->subtimer = entity->id; entity->id = 0x66; } entity->x.HALF.HI = 0xcc; diff --git a/src/movement.c b/src/movement.c index 66cfb465..0c4f0368 100644 --- a/src/movement.c +++ b/src/movement.c @@ -6,7 +6,7 @@ #include "game.h" #include "asm.h" #include "item.h" -#include "coord.h" +#include "physics.h" #include "transitions.h" #include "functions.h" diff --git a/src/npc/anju.c b/src/npc/anju.c index 375917e2..224978a9 100644 --- a/src/npc/anju.c +++ b/src/npc/anju.c @@ -7,7 +7,7 @@ void Anju(Entity* this) { case 0: this->action = 1; this->spriteSettings.draw = 1; - this->animationState = this->actionDelay; + this->animationState = this->timer; sub_0807DD50(this); return; case 1: diff --git a/src/npc/beedle.c b/src/npc/beedle.c index ab3d2bae..002f3253 100644 --- a/src/npc/beedle.c +++ b/src/npc/beedle.c @@ -48,11 +48,11 @@ void sub_080632E0(Entity* this) { void sub_08063314(Entity* this) { u32 offset; - if (((++this->field_0xf & 0xF) == 0) && (offset = sub_080633C8(this), this->animIndex != offset)) { + if (((++this->subtimer & 0xF) == 0) && (offset = sub_080633C8(this), this->animIndex != offset)) { InitializeAnimation(this, offset); } if (this->interactType != 0) { - MessageFromTarget(this->actionDelay + 0xA01); + MessageFromTarget(this->timer + 0xA01); this->action++; } sub_0806ED78(this); diff --git a/src/npc/bigGoron.c b/src/npc/bigGoron.c index c3187bd1..26749520 100644 --- a/src/npc/bigGoron.c +++ b/src/npc/bigGoron.c @@ -75,11 +75,11 @@ void sub_0806CF30(Entity* this) { } break; case 2: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { u32 uVar2 = Random(); SoundReq(gUnk_081140CC[uVar2 % 4]); - this->actionDelay = ((u8)uVar2 & 7) * 16; - this->actionDelay += 128; + this->timer = ((u8)uVar2 & 7) * 16; + this->timer += 128; } break; case 3: @@ -167,20 +167,20 @@ void sub_0806D1D0(Entity* this) { this->spritePriority.b0 = 7; this->spriteSettings.draw = 3; this->frameIndex = 0; - this->actionDelay = 0x1e; + this->timer = 0x1e; SetDefaultPriority(this, PRIO_MESSAGE); } switch (this->subAction) { case 0: default: - if (--this->actionDelay == 0) { - this->actionDelay = (Random() & 0x7f) + 0x30; - this->field_0xf = 8; + if (--this->timer == 0) { + this->timer = (Random() & 0x7f) + 0x30; + this->subtimer = 8; this->frameIndex = 1; } - if (this->field_0xf != 0) { - if (--this->field_0xf == 0) { + if (this->subtimer != 0) { + if (--this->subtimer == 0) { this->frameIndex = 0; } } @@ -208,7 +208,7 @@ void sub_0806D274(Entity* this) { this->spriteRendering.b3 = 3; this->spritePriority.b0 = 7; this->frameIndex = 2; - this->actionDelay = 8; + this->timer = 8; SetDefaultPriority(this, PRIO_MESSAGE); npc = CreateNPC(BIG_GORON, 3, 0); if (npc != NULL) { @@ -223,14 +223,14 @@ void sub_0806D274(Entity* this) { this->frameIndex = 2; break; } - if (--this->actionDelay == 0) { - this->actionDelay = 8; + if (--this->timer == 0) { + this->timer = 8; this->frameIndex ^= 1; } break; case 2: - if (--this->actionDelay == 0) { - this->actionDelay = 8; + if (--this->timer == 0) { + this->timer = 8; this->frameIndex ^= 1; } break; @@ -344,9 +344,9 @@ void sub_0806D514(Entity* this) { void sub_0806D520(Entity* this, u32 param_2) { if (this->action == 0) { this->action = 1; - this->field_0xf = gUnk_08114100[param_2] + 6; - this->frameIndex = this->field_0xf; - this->actionDelay = 8; + this->subtimer = gUnk_08114100[param_2] + 6; + this->frameIndex = this->subtimer; + this->timer = 8; } this->x.HALF.HI = this->parent->x.HALF.HI; this->y.HALF.HI = this->parent->y.HALF.HI; @@ -355,22 +355,22 @@ void sub_0806D520(Entity* this, u32 param_2) { this->spriteOrientation.flipY = this->parent->spriteOrientation.flipY; if (this->subAction != 0 || CheckPlayerProximity(this->x.HALF.HI + param_2 * -0x10 + 0xc, this->y.HALF.HI, 0x18, 0x40)) { - if (this->frameIndex >= this->field_0xf + 2) { + if (this->frameIndex >= this->subtimer + 2) { return; } - if (--this->actionDelay != 0) { + if (--this->timer != 0) { return; } - this->actionDelay = 8; + this->timer = 8; this->frameIndex++; } else { - if (this->frameIndex <= this->field_0xf) { + if (this->frameIndex <= this->subtimer) { return; } - if (--this->actionDelay != 0) { + if (--this->timer != 0) { return; } - this->actionDelay = 8; + this->timer = 8; this->frameIndex--; } } diff --git a/src/npc/bladeBrothers.c b/src/npc/bladeBrothers.c index 14777d9a..eb73c163 100644 --- a/src/npc/bladeBrothers.c +++ b/src/npc/bladeBrothers.c @@ -74,10 +74,10 @@ void sub_08068A4C(Entity* this) { if (uVar1 < 0) { uVar1 = 2; } else { - if (this->field_0xf == 0) { - this->field_0xf = 0x10; + if (this->subtimer == 0) { + this->subtimer = 0x10; } else { - this->field_0xf--; + this->subtimer--; uVar1 = (u32)this->animIndex; } } @@ -143,10 +143,10 @@ void sub_08068B84(Entity* this) { u8 p; if (gUnk_08111618) {} - if (p = this->actionDelay, gUnk_08111618[p]) { - ForceEquipItem(gUnk_08111618[this->actionDelay], 0); + if (p = this->timer, gUnk_08111618[p]) { + ForceEquipItem(gUnk_08111618[this->timer], 0); } - InitPlayerMacro(gUnk_081115EC[this->actionDelay]); + InitPlayerMacro(gUnk_081115EC[this->timer]); } void sub_08068BB4(Entity* this) { @@ -174,16 +174,16 @@ static void sub_08068BEC(Entity* this, u32 unused) { } void sub_08068C28(Entity* this) { - this->actionDelay = gUnk_08111623[this->type]; + this->timer = gUnk_08111623[this->type]; if (this->type == 1) { if (GetInventoryValue(ITEM_SKILL_SPIN_ATTACK)) { if (!GetInventoryValue(ITEM_SKILL_ROCK_BREAKER)) { - this->actionDelay = 1; + this->timer = 1; } else { if (!GetInventoryValue(ITEM_SKILL_DASH_ATTACK)) { - this->actionDelay = 2; + this->timer = 2; } else { - this->actionDelay = 3; + this->timer = 3; } } } @@ -191,12 +191,12 @@ void sub_08068C28(Entity* this) { } void sub_08068C6C(Entity* this) { - InitItemGetSequence(gUnk_0811162B[this->actionDelay] & 0xffffff7f, 0, 0); + InitItemGetSequence(gUnk_0811162B[this->timer] & 0xffffff7f, 0, 0); } void sub_08068C8C(Entity* this, ScriptExecutionContext* context) { u8* arr = gUnk_0811162B + 0xd; - context->condition = *(u32*)(arr + this->actionDelay * 4); + context->condition = *(u32*)(arr + this->timer * 4); } void sub_08068CA0(Entity* this, ScriptExecutionContext* context) { @@ -223,7 +223,7 @@ void sub_08068CA0(Entity* this, ScriptExecutionContext* context) { return; } } else { - uVar2 = GetInventoryValue(gUnk_0811162B[this->actionDelay] & -0x81); + uVar2 = GetInventoryValue(gUnk_0811162B[this->timer] & -0x81); if (uVar2 != 0) { uVar2 = 1; } @@ -236,7 +236,7 @@ void sub_08068CFC(Entity* this, ScriptExecutionContext* context) { u8 itemID; context->condition = 0; - bVar1 = this->actionDelay; + bVar1 = this->timer; if (bVar1 > 10) return; @@ -299,48 +299,48 @@ void sub_08068CFC(Entity* this, ScriptExecutionContext* context) { // Introduction dialoague void sub_08068DB8(Entity* this) { - MessageNoOverlap(gUnk_08111664[this->actionDelay], this); + MessageNoOverlap(gUnk_08111664[this->timer], this); } // Ask to teach dialoague void sub_08068DD0(Entity* this) { - MessageNoOverlap(gUnk_0811167A[this->actionDelay], this); + MessageNoOverlap(gUnk_0811167A[this->timer], this); } // Technique Dialogue void sub_08068DE8(Entity* this) { - MessageNoOverlap(gUnk_08111690[this->actionDelay], this); + MessageNoOverlap(gUnk_08111690[this->timer], this); } // Posession dialogue void sub_08068E00(Entity* this) { - MessageNoOverlap(gUnk_081116A6[this->actionDelay], this); + MessageNoOverlap(gUnk_081116A6[this->timer], this); } void sub_08068E18(Entity* this) { - MessageNoOverlap(gUnk_081116BC[this->actionDelay], this); + MessageNoOverlap(gUnk_081116BC[this->timer], this); } void sub_08068E30(Entity* this) { - MessageNoOverlap(gUnk_081116D2[this->actionDelay], this); + MessageNoOverlap(gUnk_081116D2[this->timer], this); } void sub_08068E48(Entity* this) { - MessageNoOverlap(gUnk_081116E8[this->actionDelay], this); + MessageNoOverlap(gUnk_081116E8[this->timer], this); } void sub_08068E60(Entity* this) { - MessageNoOverlap(gUnk_081116FE[this->actionDelay], this); + MessageNoOverlap(gUnk_081116FE[this->timer], this); } void sub_08068E78(Entity* this) { - MessageNoOverlap(gUnk_08111714[this->actionDelay], this); + MessageNoOverlap(gUnk_08111714[this->timer], this); } void sub_08068E90(Entity* this) { // Learn a skill. PlayerState* s = &gPlayerState; - *(u16*)&s->skills = (1 << (gUnk_08111740[this->actionDelay] - 1)) | *(u16*)&s->skills; + *(u16*)&s->skills = (1 << (gUnk_08111740[this->timer] - 1)) | *(u16*)&s->skills; } void sub_08068EB4(void) { @@ -348,8 +348,8 @@ void sub_08068EB4(void) { } void sub_08068EC4(Entity* this, ScriptExecutionContext* context) { - if (gUnk_08111740[this->actionDelay] == gPlayerState.field_0xab) { - context->wait = gUnk_0811172A[this->actionDelay]; + if (gUnk_08111740[this->timer] == gPlayerState.field_0xab) { + context->wait = gUnk_0811172A[this->timer]; context->condition = 1; } else { context->condition = 0; @@ -357,23 +357,23 @@ void sub_08068EC4(Entity* this, ScriptExecutionContext* context) { } void sub_08068F00(Entity* this) { - if (this->actionDelay == 1) { + if (this->timer == 1) { LoadRoomEntityList(&gUnk_080F3494); } } void sub_08068F14(Entity* this) { - if (this->actionDelay == 5) { + if (this->timer == 5) { ModHealth(160); } - if (this->actionDelay == 6) { + if (this->timer == 6) { ModHealth(-160); ModHealth(2); } } void sub_08068F3C(Entity* this) { - if (this->actionDelay == 6) { + if (this->timer == 6) { ModHealth(160); } } diff --git a/src/npc/brocco.c b/src/npc/brocco.c index 3ee53bcd..680688f2 100644 --- a/src/npc/brocco.c +++ b/src/npc/brocco.c @@ -37,25 +37,25 @@ void sub_0806355C(Entity* this) { void sub_08063584(Entity* this) { if (GetAnimationStateInRectRadius(this, 0x20, 0x20) >= 0) { - if (this->field_0xf == 0) { + if (this->subtimer == 0) { if ((Random() & 0x3f) == 0) { - this->field_0xf = 1; + this->subtimer = 1; InitAnimationForceUpdate(this, 0); } } } - if (this->field_0xf != 0) { + if (this->subtimer != 0) { UpdateAnimationSingleFrame(this); if ((this->frame & ANIM_DONE) != 0) { - this->field_0xf = 0; + this->subtimer = 0; } } if (this->interactType != 0) { this->action = 2; InitAnimationForceUpdate(this, GetAnimationState(this) + 4); - MessageFromTarget(this->actionDelay + 0xa01); + MessageFromTarget(this->timer + 0xa01); } sub_0806ED78(this); } @@ -64,7 +64,7 @@ void sub_08063608(Entity* this) { u8 tmp = gMessage.doTextBox & 0x7f; if (tmp == 0) { this->action = 1; - this->field_0xf = tmp; + this->subtimer = tmp; InitAnimationForceUpdate(this, 4); } } diff --git a/src/npc/castleMaid.c b/src/npc/castleMaid.c index b846a04a..2f17c380 100644 --- a/src/npc/castleMaid.c +++ b/src/npc/castleMaid.c @@ -66,7 +66,7 @@ void sub_08064570(Entity* this) { return; } this->action += 1; - this->actionDelay = 0; + this->timer = 0; tmp2 = sub_0805ACC0(this); if (tmp2 == 0) { this->field_0x6c.HWORD = this->x.HALF.HI; diff --git a/src/npc/cat.c b/src/npc/cat.c index 8ff4860d..d7be469c 100644 --- a/src/npc/cat.c +++ b/src/npc/cat.c @@ -58,7 +58,7 @@ void sub_080677EC(Entity* this) { this->spriteSettings.draw = 1; this->direction = 8; this->speed = 0x80; - this->field_0x3c = 7; + this->collisionFlags = 7; this->hurtType = 0x48; this->hitType = -0x58; this->flags2 = 1; @@ -78,8 +78,8 @@ void sub_080677EC(Entity* this) { uVar2 >>= 0x10; } this->field_0x6c.HWORD = uVar2; - this->field_0x6e.HWORD = this->actionDelay + uVar2; - this->actionDelay = 0; + this->field_0x6e.HWORD = this->timer + uVar2; + this->timer = 0; this->field_0x74.HALF.HI = 0; this->field_0x74.HALF.LO = (Random() & 0x7f) + 0x1e; this->field_0x68.HALF.HI = 0xff; @@ -169,7 +169,7 @@ void sub_08067A0C(Entity* this) { if (this->frame & ANIM_DONE) { if (sub_08067D20(this) != 0) { sub_08067B80(this, 5); - this->actionDelay = this->actionDelay + 0x14; + this->timer = this->timer + 0x14; } else { sub_08067C24(this); } @@ -226,7 +226,7 @@ void sub_08067B70(Entity* this) { void sub_08067B80(Entity* this, u32 param) { this->action = 5; - this->actionDelay = 0x14; + this->timer = 0x14; this->field_0x74.HALF.LO = (Random() & 0x7f) + 0x1e; InitAnimationForceUpdate(this, param); sub_08067DDC(this); @@ -342,15 +342,15 @@ u32 sub_08067D74(Entity* this) { int iVar2; if (this->type != 5) { - if (this->actionDelay != 0) { - this->actionDelay -= 1; + if (this->timer != 0) { + this->timer -= 1; } entity = sub_08049DF4(2); if (entity != NULL) { iVar2 = this->spriteSettings.flipX ? 0x8 : 0x18; if ((((u32)(entity->x.HALF.HI - (this->x.HALF.HI - iVar2)) < 0x1f) && ((u32)(entity->y.HALF.HI - this->y.HALF.HI) < 0x17)) && - (this->actionDelay == 0)) { + (this->timer == 0)) { return 1; } } @@ -365,7 +365,7 @@ void sub_08067DCC(Entity* this, u32 param) { void sub_08067DDC(Entity* this) { COLLISION_OFF(this); - this->bitfield = 0; + this->contactFlags = 0; this->iframes = 0; this->hitbox = &gUnk_08110EF0; } diff --git a/src/npc/cow.c b/src/npc/cow.c index 481877ab..4ebbf928 100644 --- a/src/npc/cow.c +++ b/src/npc/cow.c @@ -52,14 +52,14 @@ void sub_08069018(Entity* ent) { if (ent->subAction == 0) { ent->subAction++; - ent->field_0xf = (Random() & 0x3F) + 0x3C; + ent->subtimer = (Random() & 0x3F) + 0x3C; InitAnimationForceUpdate(ent, ent->animationState); } UpdateAnimationSingleFrame(ent); - var0 = --ent->field_0xf; + var0 = --ent->subtimer; if (var0 == 0) { - if (ent->actionDelay == 0) { + if (ent->timer == 0) { ent->action = 2; } else { ent->action = 3; @@ -83,7 +83,7 @@ void sub_08069068(Entity* ent) { ent->animationState = anim; ent->direction = anim <<= 3; - ent->field_0xf = (Random() & 0x3F) + 0x3C; + ent->subtimer = (Random() & 0x3F) + 0x3C; InitAnimationForceUpdate(ent, ent->animationState + 4); } @@ -96,11 +96,11 @@ void sub_08069068(Entity* ent) { x -= *x2; if (x > 16) { ent->x.HALF.HI = *x2 + 16; - ent->field_0xf = 1; + ent->subtimer = 1; } if (x < -16) { ent->x.HALF.HI = *x2 - 16; - ent->field_0xf = 1; + ent->subtimer = 1; } } { @@ -109,15 +109,15 @@ void sub_08069068(Entity* ent) { y -= *y2; if (y > 16) { ent->y.HALF.HI = *y2 + 16; - ent->field_0xf = 1; + ent->subtimer = 1; } if (y < -16) { ent->y.HALF.HI = *y2 - 16; - ent->field_0xf = 1; + ent->subtimer = 1; } } - var0 = --ent->field_0xf; + var0 = --ent->subtimer; if (var0 == 0) { ent->action = 3; ent->subAction = var0; @@ -135,7 +135,7 @@ void sub_08069124(Entity* ent) { void sub_08069148(Entity* ent) { u32 var0 = Random() & 3; var0 += 3; - ent->field_0xf = var0; + ent->subtimer = var0; ent->subAction = 1; InitAnimationForceUpdate(ent, ent->animationState + 8); } @@ -152,7 +152,7 @@ void sub_08069188(Entity* ent) { return; ent->frame = 0; - if (((s8)--ent->field_0xf) != 0) + if (((s8)--ent->subtimer) != 0) return; ent->subAction = 3; InitAnimationForceUpdate(ent, ent->animationState + 16); diff --git a/src/npc/cucco.c b/src/npc/cucco.c index 254fbcbb..7b022a00 100644 --- a/src/npc/cucco.c +++ b/src/npc/cucco.c @@ -25,10 +25,10 @@ void Cucco_Init(Entity* this) { void sub_0806E4EC(Entity* this) { if (this->subAction == 0) { this->subAction += 1; - this->actionDelay = (Random() & 0x1f) + 0x3c; + this->timer = (Random() & 0x1f) + 0x3c; InitAnimationForceUpdate(this, 0); } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if ((Random() & 1) != 0) { this->action = 3; } else { @@ -50,13 +50,13 @@ void Cucco_Fly(Entity* this) { this->spriteSettings.flipX ^= 1; } - this->actionDelay = (Random() & 1) + 1; + this->timer = (Random() & 1) + 1; this->zVelocity = 0x18000; InitAnimationForceUpdate(this, 1); } if (GravityUpdate(this, 0x2800) == 0) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->subAction = 0; } else { diff --git a/src/npc/cuccoChick.c b/src/npc/cuccoChick.c index 4d88c5b1..476c44cd 100644 --- a/src/npc/cuccoChick.c +++ b/src/npc/cuccoChick.c @@ -33,10 +33,10 @@ void CuccoChick_Init(Entity* this) { void sub_0806E764(Entity* this) { if (this->subAction == 0) { this->subAction += 1; - this->actionDelay = (Random() & 0x1f) + 0x1e; + this->timer = (Random() & 0x1f) + 0x1e; this->frameIndex = 0; } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; this->subAction = 0; if ((Random() & 1) != 0) { @@ -52,12 +52,12 @@ void CuccoChick_Fly(Entity* this) { if ((Random() & 1) != 0) { this->spriteSettings.flipX ^= 1; } - this->actionDelay = (Random() & 3) + 1; + this->timer = (Random() & 3) + 1; this->zVelocity = 0x10000; this->frameIndex = 1; } if (GravityUpdate(this, 0x3000) == 0) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->subAction = 0; } else { diff --git a/src/npc/dog.c b/src/npc/dog.c index 9a6364ec..0b19a81c 100644 --- a/src/npc/dog.c +++ b/src/npc/dog.c @@ -51,14 +51,14 @@ void sub_08069B44(Entity* this) { uVar2 = uVar5; } - uVar4 = this->actionDelay == 0 ? 0x20 : this->actionDelay; + uVar4 = this->timer == 0 ? 0x20 : this->timer; this->field_0x6e.HWORD = sVar3 - uVar4; this->field_0x6c.HWORD = sVar3 + uVar4; this->field_0x70.HALF.LO = uVar2 - 8; this->field_0x70.HALF.HI = uVar2 + 8; this->speed = 0x100; - this->actionDelay = 0x1e; + this->timer = 0x1e; 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->actionDelay = 0x1e; + this->timer = 0x1e; } else { - this->actionDelay -= 1; - if (this->actionDelay == 0) { + this->timer -= 1; + if (this->timer == 0) { this->action = 2; - this->actionDelay = (Random() & 0x1f) + 0x1e; + this->timer = (Random() & 0x1f) + 0x1e; this->direction = gUnk_08111DA8[Random() & 7]; sub_08069F6C(this); } @@ -136,8 +136,8 @@ void sub_08069D00(Entity* this) { void sub_08069D54(Entity* this) { u16 collisions; if (sub_08069F90(this) == 0) { - this->actionDelay -= 1; - if (this->actionDelay != 0) { + this->timer -= 1; + if (this->timer != 0) { UpdateAnimationSingleFrame(this); ProcessMovement0(this); collisions = this->collisions; @@ -166,7 +166,7 @@ void sub_08069D54(Entity* this) { } else { this->action = 3; } - this->actionDelay = (Random() & 0x1f) + 0x1e; + this->timer = (Random() & 0x1f) + 0x1e; } void sub_08069DF8(Entity* this) { @@ -174,8 +174,8 @@ void sub_08069DF8(Entity* this) { if (sub_08069F90(this) != 0) { this->action = 1; } else { - this->actionDelay -= 1; - if (this->actionDelay != 0) { + this->timer -= 1; + if (this->timer != 0) { sub_08069D00(this); return; } @@ -185,7 +185,7 @@ void sub_08069DF8(Entity* this) { this->action = 3; } } - this->actionDelay = (Random() & 0x1f) + 0x1e; + this->timer = (Random() & 0x1f) + 0x1e; } void sub_08069E44(Entity* this) { diff --git a/src/npc/farmers.c b/src/npc/farmers.c index 92d520da..1066168b 100644 --- a/src/npc/farmers.c +++ b/src/npc/farmers.c @@ -14,13 +14,13 @@ void Farmers(Entity* this) { return; } this->action++; - this->spriteSettings.flipX = this->actionDelay; + this->spriteSettings.flipX = this->timer; if (this->spriteSettings.flipX == 0) { this->animationState = 6; } else { this->animationState = 2; } - this->actionDelay = this->animationState; + this->timer = this->animationState; sub_0806BC58(this); sub_0807DD64(this); } @@ -49,7 +49,7 @@ void sub_0806BC94(Entity* this, ScriptExecutionContext* context) { } void sub_0806BCB8(Entity* this) { - this->animationState = this->actionDelay; + this->animationState = this->timer; } void sub_0806BCC0(Entity* this) { diff --git a/src/npc/festari.c b/src/npc/festari.c index 8dbc8274..2ee629fb 100644 --- a/src/npc/festari.c +++ b/src/npc/festari.c @@ -34,10 +34,10 @@ void sub_0805FE48(Entity* this) { uVar4 = this->field_0x80.HWORD; if (uVar4 < 8) { if ((this->field_0x82.HWORD & 1) != 0) { - uVar4 = (uVar4 & 0xfc) + (this->field_0xf >> 1); + uVar4 = (uVar4 & 0xfc) + (this->subtimer >> 1); } else { uVar4 = (uVar4 & 0xfc) + (this->animationState >> 1); - this->field_0xf = this->animationState; + this->subtimer = this->animationState; } } if (uVar4 != this->animIndex) { diff --git a/src/npc/forestMinish.c b/src/npc/forestMinish.c index 65f2ff56..0227e6ba 100644 --- a/src/npc/forestMinish.c +++ b/src/npc/forestMinish.c @@ -18,8 +18,8 @@ void ForestMinish(Entity* this) { if (LoadExtraSpriteData(this, &gUnk_0810A348)) { this->action = 1; this->spriteSettings.draw = TRUE; - this->field_0x68.HALF.HI = this->animationState = this->actionDelay << 1; - this->actionDelay = 0; + this->field_0x68.HALF.HI = this->animationState = this->timer << 1; + this->timer = 0; SetDefaultPriority(this, PRIO_MESSAGE); StartCutscene(this, (u16*)gUnk_08109D18[this->type2]); sub_0807DD50(this); @@ -73,10 +73,10 @@ void sub_080600F0(Entity* this) { uVar2 = this->field_0x80.HWORD; if (this->field_0x80.HWORD < 8) { if ((this->field_0x82.HWORD & 1) != 0) { - uVar2 = (uVar2 & 0xfc) + (this->field_0xf >> 1); + uVar2 = (uVar2 & 0xfc) + (this->subtimer >> 1); } else { uVar2 = (uVar2 & 0xfc) + (this->animationState >> 1); - this->field_0xf = this->animationState; + this->subtimer = this->animationState; } } if (uVar2 != this->animIndex) { @@ -91,7 +91,7 @@ void sub_080600F0(Entity* this) { } void sub_0806014C(Entity* this) { - this->actionDelay = 0; + this->timer = 0; sub_08060158(this); } @@ -100,10 +100,10 @@ void sub_08060158(Entity* this) { u8* idx3; u8 tmp1, tmp2; - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else { - this->actionDelay = 2; + this->timer = 2; index = GetFacingDirectionInRectRadius(this, 0x20, 0x20); if (index < 0) { int state = this->field_0x68.HALF.HI; diff --git a/src/npc/fusionMenuNPC.c b/src/npc/fusionMenuNPC.c index 5f2128ed..01f5c111 100644 --- a/src/npc/fusionMenuNPC.c +++ b/src/npc/fusionMenuNPC.c @@ -3,15 +3,15 @@ #include "npc.h" void FusionMenuNPC(Entity* this) { - if (gNPCFunctions[this->field_0xf][2] != NULL) { - gNPCFunctions[this->field_0xf][2](this); + if (gNPCFunctions[this->subtimer][2] != NULL) { + gNPCFunctions[this->subtimer][2](this); } else { DeleteThisEntity(); } } void FusionMenuNPC_Head(Entity* this) { - if (gNPCFunctions[this->field_0xf][1] != NULL) { - gNPCFunctions[this->field_0xf][1](this); + if (gNPCFunctions[this->subtimer][1] != NULL) { + gNPCFunctions[this->subtimer][1](this); } } diff --git a/src/npc/ghostBrothers.c b/src/npc/ghostBrothers.c index 466b5285..a0a04942 100644 --- a/src/npc/ghostBrothers.c +++ b/src/npc/ghostBrothers.c @@ -30,8 +30,8 @@ void GhostBrothers(Entity* this) { if (this->type < 3) { s8* ptr = gUnk_0811015C; - u32 field_0xf = this->field_0xf++; - this->z.HALF_U.HI = *(ptr + (((field_0xf << 0x18) >> 0x1b) & 0x7)); + u32 subtimer = this->subtimer++; + this->z.HALF_U.HI = *(ptr + (((subtimer << 0x18) >> 0x1b) & 0x7)); } } } @@ -67,14 +67,14 @@ void sub_08065C0C(Entity* this) { this->action = 1; break; case 3: - if (--this->actionDelay != 0) { + if (--this->timer != 0) { return; } puVar3 = *(u16**)&this->field_0x6c.HWORD; if (*puVar3 != 0xffff) { gScreen.controls.alphaBlend = *puVar3; - this->actionDelay = (u8) * (++puVar3); + this->timer = (u8) * (++puVar3); *(u16**)&this->field_0x6c = ++puVar3; return; } @@ -88,7 +88,7 @@ void sub_08065C0C(Entity* this) { void sub_08065CCC(Entity* this) { this->action = 3; - this->actionDelay = 0x1e; + this->timer = 0x1e; this->spriteRendering.alphaBlend = 1; *(u32**)&this->field_0x6c = (u32*)gUnk_0811022E; gScreen.controls.layerFXControl = 0x3f40; @@ -102,8 +102,8 @@ void sub_08065D00(Entity* this) { void sub_08065D18(Entity* this) { this->action = 1; - this->actionDelay = 0x1e; - this->field_0xf = 0; + this->timer = 0x1e; + this->subtimer = 0; this->spriteSettings.draw = 1; this->spriteRendering.alphaBlend = 1; *(u32**)&this->field_0x6c = &gUnk_08110188; @@ -115,14 +115,14 @@ void sub_08065D18(Entity* this) { void sub_08065D74(Entity* this) { u16* ptr; - if (--this->actionDelay) { + if (--this->timer) { return; } ptr = *(u16**)&this->field_0x6c; if (*ptr != 0xffff) { gScreen.controls.alphaBlend = *ptr; - this->actionDelay = *(ptr + 1); + this->timer = *(ptr + 1); *(u32*)&this->field_0x6c = (u32)(ptr + 2); } else { this->action++; @@ -135,15 +135,15 @@ void sub_08065DB8(Entity* this) { case 0: { if ((gMessage.doTextBox & 0x7f) == 0) { this->subAction++; - this->actionDelay = 0x3c; + this->timer = 0x3c; InitAnimationForceUpdate(this, 4); } break; } case 1: { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction++; - this->actionDelay = 0xb4; + this->timer = 0xb4; gUnk_02018EB0[1]++; InitAnimationForceUpdate(this, 2); } @@ -152,7 +152,7 @@ void sub_08065DB8(Entity* this) { case 2: break; case 3: { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { MessageFromTarget(0); this->subAction++; } @@ -161,17 +161,17 @@ void sub_08065DB8(Entity* this) { case 4: { if ((gMessage.doTextBox & 0x7f) == 0) { this->subAction++; - this->actionDelay = 0x1e; + this->timer = 0x1e; *(u8**)&this->field_0x6c = gUnk_0811022E; } break; } default: { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { u16* puVar3 = *(u16**)&this->field_0x6c.HWORD; if (*puVar3 != 0xffff) { gScreen.controls.alphaBlend = *puVar3; - this->actionDelay = (u8) * (puVar3 + 1); + this->timer = (u8) * (puVar3 + 1); *(u16**)&this->field_0x6c = (puVar3 + 2); } else { gUnk_02018EB0[0]++; @@ -191,11 +191,11 @@ void sub_08065EBC(Entity* this) { } void sub_08065EDC(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { u16* puVar3 = *(u16**)&this->field_0x6c.HWORD; if (*puVar3 != 0xffff) { gScreen.controls.alphaBlend = *puVar3; - this->actionDelay = (u8) * (++puVar3); + this->timer = (u8) * (++puVar3); *(u16**)&this->field_0x6c = (++puVar3); } else { this->action++; diff --git a/src/npc/gorman.c b/src/npc/gorman.c index 52ec2316..90266bf1 100644 --- a/src/npc/gorman.c +++ b/src/npc/gorman.c @@ -46,13 +46,13 @@ void sub_080697EC(Entity* this) { tmp = GetAnimationStateInRectRadius(this, 0x20, 0x20); if (tmp >= 0) { - if (this->field_0xf == 0) { - this->field_0xf = 0x10; + if (this->subtimer == 0) { + this->subtimer = 0x10; if (this->animIndex != tmp) { InitializeAnimation(this, tmp); } } else { - this->field_0xf -= 1; + this->subtimer -= 1; } } if (this->interactType != 0) { diff --git a/src/npc/goron.c b/src/npc/goron.c index b6c943e5..4212123b 100644 --- a/src/npc/goron.c +++ b/src/npc/goron.c @@ -25,10 +25,10 @@ void sub_08069310(Entity* this) { } void sub_08069328(Entity* this) { - if (((u32)(++this->field_0xf << 24) >> 24) > 16) { + if (((u32)(++this->subtimer << 24) >> 24) > 16) { int action; - this->field_0xf = 0; + this->subtimer = 0; action = GetAnimationStateInRectRadius(this, 40, 40); if (action >= 0) { this->animationState = action; @@ -41,7 +41,7 @@ void sub_08069328(Entity* this) { this->action = 2; RequestPriority(this); InitAnimationForceUpdate(this, 8); - MessageFromTarget(this->actionDelay + (0x90 << 5)); + MessageFromTarget(this->timer + (0x90 << 5)); } } diff --git a/src/npc/goronMerchant.c b/src/npc/goronMerchant.c index 96e6172f..96125b1e 100644 --- a/src/npc/goronMerchant.c +++ b/src/npc/goronMerchant.c @@ -36,8 +36,8 @@ void sub_08069584(Entity* this) { void sub_080695AC(Entity* this) { s32 iVar2; - if (++this->field_0xf > 0x10) { - this->field_0xf = 0; + if (++this->subtimer > 0x10) { + this->subtimer = 0; iVar2 = GetAnimationStateInRectRadius(this, 0x28, 0x28); if (iVar2 > -1) { this->animationState = iVar2; diff --git a/src/npc/guard.c b/src/npc/guard.c index 27496fe3..56327f3d 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->field_0xf = 0x3c; + ent->subtimer = 0x3c; 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->actionDelay = 0x1e; + this->timer = 0x1e; this->animationState = sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)); InitAnimationForceUpdate(this, this->animationState + 4); } else { @@ -96,7 +96,7 @@ void sub_08063DC8(Entity* this) { } void sub_08063E54(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { SetRoomFlag(0xf); } } @@ -117,12 +117,12 @@ void sub_08063E90(Entity* this) { return; this->action++; - if (this->actionDelay) { + if (this->timer) { this->field_0x70.BYTES.byte0 = 8; } else { this->field_0x70.BYTES.byte0 = 0; } - this->actionDelay = 0; + this->timer = 0; unk = sub_0805ACC0(this); if (unk == 0) { diff --git a/src/npc/kid.c b/src/npc/kid.c index 79cb7a89..19e02519 100644 --- a/src/npc/kid.c +++ b/src/npc/kid.c @@ -49,13 +49,13 @@ void sub_08062130(Entity* this) { this->action = 2; InitAnimationForceUpdate(this, GetAnimationState(this)); } - if (this->field_0xf++ >= 0x79) { - this->field_0xf = 0; - this->actionDelay = (this->actionDelay + 1) & 7; + if (this->subtimer++ >= 0x79) { + this->subtimer = 0; + this->timer = (this->timer + 1) & 7; if (this->type == 6) { - this->actionDelay = this->actionDelay + 0x10; + this->timer = this->timer + 0x10; } - InitAnimationForceUpdate(this, this->actionDelay); + InitAnimationForceUpdate(this, this->timer); } else { UpdateAnimationSingleFrame(this); } @@ -75,8 +75,8 @@ void sub_080621AC(Entity* this) { case 0: if (LoadExtraSpriteData(this, gUnk_0810BDC4[this->type]) != 0) { this->action = 1; - this->animationState = this->actionDelay; - this->actionDelay = 0; + this->animationState = this->timer; + this->timer = 0; this->field_0x68.HALF.LO = 0; this->field_0x68.HALF.HI = 0; this->field_0x6a.HALF.HI = 0xff; @@ -213,12 +213,12 @@ void sub_08062698(Entity* this) { } void sub_080626AC(Entity* this) { - this->actionDelay = (Random() & 0x1f) + 0x40; + this->timer = (Random() & 0x1f) + 0x40; } void sub_080626C0(Entity* this, ScriptExecutionContext* context) { context->condition = 0; - if ((this->actionDelay != 0) && (--this->actionDelay == 0)) { + if ((this->timer != 0) && (--this->timer == 0)) { context->condition = 1; } } diff --git a/src/npc/kingDaltus.c b/src/npc/kingDaltus.c index b39db01f..076a78a9 100644 --- a/src/npc/kingDaltus.c +++ b/src/npc/kingDaltus.c @@ -37,10 +37,10 @@ void sub_08066688(Entity* this) { if (tmp < 0) { tmp = 2; } else { - if (this->field_0xf == 0) { - this->field_0xf = 0x10; + if (this->subtimer == 0) { + this->subtimer = 0x10; } else { - this->field_0xf -= 1; + this->subtimer -= 1; tmp = this->animIndex; } } diff --git a/src/npc/librari.c b/src/npc/librari.c index a0d1cb45..98ef6450 100644 --- a/src/npc/librari.c +++ b/src/npc/librari.c @@ -10,7 +10,7 @@ void Librari(Entity* this) { case 0: this->action = 1; this->spriteSettings.draw = TRUE; - this->animationState = this->actionDelay; + this->animationState = this->timer; this->field_0x68.HALF.LO = sub_0801E99C(this); sub_08078784(this, this->field_0x68.HALF.LO); SetDefaultPriority(this, PRIO_MESSAGE); diff --git a/src/npc/mama.c b/src/npc/mama.c index 210bce90..974aa58f 100644 --- a/src/npc/mama.c +++ b/src/npc/mama.c @@ -15,7 +15,7 @@ void Mama(Entity* this) { if (sub_0806C454(this) != 0) { this->action = 1; this->spriteSettings.draw = 1; - this->animationState = this->actionDelay; + this->animationState = this->timer; this->field_0x68.HALF.HI = 0; sub_0807DD50(this); } diff --git a/src/npc/melari.c b/src/npc/melari.c index 11cd5f93..c6b29640 100644 --- a/src/npc/melari.c +++ b/src/npc/melari.c @@ -32,18 +32,18 @@ void sub_08068730(Entity* this) { animIndex = GetAnimationStateInRectRadius(this, 0x20, 0x20); if (-1 < animIndex) { - if (this->field_0xf == 0) { - this->field_0xf = 0x10; + if (this->subtimer == 0) { + this->subtimer = 0x10; if (this->animIndex != animIndex) { InitializeAnimation(this, animIndex); } } else { - this->field_0xf--; + this->subtimer--; } } if (this->interactType != 0) { this->interactType = 0; - MessageFromTarget(this->actionDelay + 0x1200); + MessageFromTarget(this->timer + 0x1200); } } @@ -118,10 +118,10 @@ void Melari_Head(Entity* this) { void sub_08068910(Entity* this) { s32 iVar1; - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { - this->actionDelay = 0x10; + this->timer = 0x10; if ((this->frame & 0x20) != 0) { iVar1 = GetFacingDirectionInRectRadius(this, 0x30, 0x30); if (iVar1 < 0) { diff --git a/src/npc/minishEzlo.c b/src/npc/minishEzlo.c index d501f60f..8eaccbcf 100644 --- a/src/npc/minishEzlo.c +++ b/src/npc/minishEzlo.c @@ -10,7 +10,7 @@ void MinishEzlo(Entity* this) { return; } this->action += 1; - this->animationState = this->actionDelay * 2; + this->animationState = this->timer * 2; SetDefaultPriority(this, PRIO_MESSAGE); sub_0807DD50(this); } diff --git a/src/npc/ministerPotho.c b/src/npc/ministerPotho.c index 282a7985..f7c1652a 100644 --- a/src/npc/ministerPotho.c +++ b/src/npc/ministerPotho.c @@ -30,10 +30,10 @@ void sub_08066808(Entity* this) { if (tmp < 0) { tmp = 2; } else { - if (this->field_0xf == 0) { - this->field_0xf = 0x10; + if (this->subtimer == 0) { + this->subtimer = 0x10; } else { - this->field_0xf -= 1; + this->subtimer -= 1; tmp = this->animIndex; } } diff --git a/src/npc/mountainMinish.c b/src/npc/mountainMinish.c index 8c9a24c7..ca72be22 100644 --- a/src/npc/mountainMinish.c +++ b/src/npc/mountainMinish.c @@ -69,10 +69,10 @@ void sub_08067E88(Entity* this) { if (tmp < 0) { tmp = 2; } else { - if (this->field_0xf == 0) { - this->field_0xf = 0x10; + if (this->subtimer == 0) { + this->subtimer = 0x10; } else { - this->field_0xf = this->field_0xf - 1; + this->subtimer = this->subtimer - 1; tmp = this->animIndex; } } @@ -82,7 +82,7 @@ void sub_08067E88(Entity* this) { if (this->interactType != 0) { this->interactType = 0; this->action = 2; - MessageFromTarget(this->actionDelay + 0x1200); + MessageFromTarget(this->timer + 0x1200); } } @@ -191,10 +191,10 @@ void sub_0806811C(Entity* this) { int iVar4; const u8* ptr; - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else { - this->actionDelay = 2; + this->timer = 2; iVar4 = GetFacingDirectionInRectRadius(this, 0x20, 0x20); if (iVar4 < 0) { type = this->type; diff --git a/src/npc/npc23.c b/src/npc/npc23.c index 2dedb197..ee98b803 100644 --- a/src/npc/npc23.c +++ b/src/npc/npc23.c @@ -27,7 +27,7 @@ void sub_080662F8(Entity* this) { this->field_0x7c.HALF.HI = this->x.HALF.HI; this->field_0x80.HWORD = this->y.HALF.HI; this->field_0x86.HWORD = 0; - this->field_0x82.HWORD = this->actionDelay; + this->field_0x82.HWORD = this->timer; this->parent = &gPlayerEntity; this->cutsceneBeh.HWORD = 0; sub_08066490(this, this->parent); diff --git a/src/npc/npc26.c b/src/npc/npc26.c index e52d796e..99e58286 100644 --- a/src/npc/npc26.c +++ b/src/npc/npc26.c @@ -29,10 +29,10 @@ static void sub_080669DC(Entity* this) { if (sVar1 < 0) { sVar1 = 2; } else { - if (this->field_0xf == 0) { - this->field_0xf = 0x10; + if (this->subtimer == 0) { + this->subtimer = 0x10; } else { - this->field_0xf = this->field_0xf - 1; + this->subtimer = this->subtimer - 1; sVar1 = this->animIndex; } } diff --git a/src/npc/npc5.c b/src/npc/npc5.c index 1560980d..27459f66 100644 --- a/src/npc/npc5.c +++ b/src/npc/npc5.c @@ -147,12 +147,12 @@ void sub_08060AE0(Entity* this) { this->action = 1; COLLISION_ON(this); this->animationState &= 3; - this->field_0x3c = 7; + this->collisionFlags = 7; this->hurtType = 0x48; this->hitType = 0x49; this->flags2 = 3; this->hitbox = (Hitbox*)&gHitbox_0; - this->field_0x17 &= 0xfe; + this->followerFlag &= 0xfe; this->field_0x6c.HALF.LO = 0xff; sub_08060E70(this, this->animationState); otherNpc = CreateNPC(NPC_UNK_5, 2, 0); @@ -168,7 +168,7 @@ void sub_08060B5C(Entity* this) { if ((sub_08060F80(this) == 0) && (((GetFacingDirection(this, &gPlayerEntity) + (this->animationState * -4) + 4) & 0x1f)) < 9) { this->action = 2; - this->field_0xf = 0; + this->subtimer = 0; return; } sub_08060EDC(this); @@ -492,24 +492,24 @@ u32 sub_080611D4(Entity* this) { continue; } - ++this->field_0xf; + ++this->subtimer; - if (this->field_0xf < 8) { + if (this->subtimer < 8) { return 0xff; } return ptr2[1]; } while (ptr2 += 2, *ptr2 != 0); - this->field_0xf = 0; + this->subtimer = 0; return 0xff; } u32 sub_08061230(Entity* this) { if ((((UnkHeap*)this->myHeap)->unk_0 & 1) == 0) { - if ((this->bitfield & 0x80) != 0) { - switch (this->bitfield & 0x7f) { + if ((this->contactFlags & 0x80) != 0) { + switch (this->contactFlags & 0x7f) { case 0: case 1: case 2: @@ -534,7 +534,7 @@ u32 sub_08061230(Entity* this) { ((UnkHeap*)this->myHeap)->unk_0 &= 0xfe; InitAnimationForceUpdate(this, this->field_0x6c.HALF.LO + (this->animationState >> 1)); } - this->bitfield = this->bitfield & 0x7f; + this->contactFlags = this->contactFlags & 0x7f; if (this->iframes != 0) { this->iframes += 1; } @@ -555,19 +555,19 @@ void sub_08061358(Entity* this) { return; } this->subAction = 1; - this->actionDelay = 0xf; + this->timer = 0xf; sub_08060E70(this, 0); break; case 1: - this->actionDelay -= 1; - if (this->actionDelay != 0) { + this->timer -= 1; + if (this->timer != 0) { return; } uVar2 = Random(); bVar4 = uVar2; if ((uVar2 & 1) == 0) { this->subAction = 3; - this->actionDelay = (bVar4 & 0x18) + 0x1e; + this->timer = (bVar4 & 0x18) + 0x1e; sub_08060E70(this, 4); return; } @@ -582,7 +582,7 @@ void sub_08061358(Entity* this) { this->animationState = ((this->frame & 0x18) >> 2); if ((Random() & 1)) { this->subAction = 3; - this->actionDelay = (bVar4 & 0x18) + 0x1e; + this->timer = (bVar4 & 0x18) + 0x1e; sub_08060E70(this, 4); return; } @@ -597,7 +597,7 @@ void sub_08061358(Entity* this) { InitAnimationForceUpdate(this, gUnk_0810AC5D[this->animationState * 2 + (bVar4 >> 4 & 3)]); return; } - if (--this->actionDelay != 0) { + if (--this->timer != 0) { return; } this->subAction = 0; @@ -875,8 +875,8 @@ void sub_08061ACC(Entity* this) { this->flags = this->flags | ENT_PERSIST; this->action = 1; this->subAction = 0xff; - this->actionDelay = 0; - this->field_0x17 = this->field_0x17 & 0xfe; + this->timer = 0; + this->followerFlag = this->followerFlag & 0xfe; sub_08078778(this); sub_08061AFC(this); } @@ -886,7 +886,7 @@ void sub_08061AFC(Entity* this) { if (this->subAction != 0) { this->subAction = tmp; *((u16**)&this->field_0x68) = gUnk_0810B660[0]; - this->actionDelay = 0; + this->timer = 0; } } @@ -900,9 +900,9 @@ void sub_08061B18(Entity* this) { this->interactType = 0; sub_08061AFC(this); puVar2 = *(u16**)&this->field_0x68; - puVar2 += (this->actionDelay++); + puVar2 += (this->timer++); if (puVar2[1] == 0) { - this->actionDelay = 0; + this->timer = 0; } MessageNoOverlap(puVar2[0], this); break; diff --git a/src/npc/picolyteBottle.c b/src/npc/picolyteBottle.c index dec3e542..0f22d9b5 100644 --- a/src/npc/picolyteBottle.c +++ b/src/npc/picolyteBottle.c @@ -70,13 +70,13 @@ void PicolyteBottle_Init(PicolyteBottleEntity* this) { void PicolyteBottle_Action1(PicolyteBottleEntity* this) { sub_0807DD94(super, 0); - if (super->actionDelay != 0xff) { + if (super->timer != 0xff) { if (super->damage != 0) { - this->ent3->actionDelay++; + this->ent3->timer++; } - this->ent1->actionDelay++; - this->ent2->actionDelay++; - super->actionDelay = 0xff; + this->ent1->timer++; + this->ent2->timer++; + super->timer = 0xff; SetRoomFlag(0); } } @@ -86,12 +86,12 @@ void PicolyteBottle_Action2(PicolyteBottleEntity* this) { if (super->interactType != 0) { super->interactType = 0; - super->parent->actionDelay = super->type2; - super->parent->type2 = super->field_0xf; + super->parent->timer = super->type2; + super->parent->type2 = super->subtimer; } else { - if (super->actionDelay != 0) { - super->actionDelay = 0; - obj = CreateObject(OBJECT_35, 2, super->field_0xf); + if (super->timer != 0) { + super->timer = 0; + obj = CreateObject(OBJECT_35, 2, super->subtimer); if (obj != NULL) { obj->parent = super; super->child = obj; @@ -116,33 +116,33 @@ void sub_0806E014(PicolyteBottleEntity* this) { uVar1 = (Random() & 0x70) >> 4; super->type2 = 0xff; - super->actionDelay = 0xff; + super->timer = 0xff; if (CheckLocalFlag(0x93) == 0) { super->damage = 0; iVar2 = uVar1 * 2; ptr = &gUnk_081142CC[iVar2]; - this->ent1->field_0xf = ptr[0]; + this->ent1->subtimer = ptr[0]; PositionRelative(super, this->ent1, 0x480000, 0x480000); - this->ent2->field_0xf = ptr[1]; + this->ent2->subtimer = ptr[1]; PositionRelative(super, this->ent2, 0x680000, 0x480000); - this->ent3->field_0xf = 0xff; + this->ent3->subtimer = 0xff; CopyPosition(super, this->ent3); } else { super->damage = 1; iVar2 = uVar1 * 4; ptr = &gUnk_081142DC[iVar2]; - this->ent1->field_0xf = ptr[0]; + this->ent1->subtimer = ptr[0]; PositionRelative(super, this->ent1, 0x380000, 0x480000); - this->ent2->field_0xf = ptr[1]; + this->ent2->subtimer = ptr[1]; PositionRelative(super, this->ent2, 0x580000, 0x480000); - this->ent3->field_0xf = ptr[2]; + this->ent3->subtimer = ptr[2]; PositionRelative(super, this->ent3, 0x780000, 0x480000); } } void sub_0806E0DC(PicolyteBottleEntity* this) { - super->actionDelay = 0; - if (super->field_0xf != 0xff) { + super->timer = 0; + if (super->subtimer != 0xff) { super->action = 2; this->unk76 = TILE(super->x.HALF.HI, super->y.HALF.HI); if (super->child != NULL) { diff --git a/src/npc/pina.c b/src/npc/pina.c index e1ea0e4b..17473005 100644 --- a/src/npc/pina.c +++ b/src/npc/pina.c @@ -39,25 +39,25 @@ void sub_08063A98(Entity* this) { void sub_08063AC0(Entity* this) { if (GetAnimationStateInRectRadius(this, 0x20, 0x20) >= 0) { - if (this->field_0xf == 0) { + if (this->subtimer == 0) { if ((Random() & 0x3f) == 0) { InitAnimationForceUpdate(this, 0); - this->field_0xf = 1; + this->subtimer = 1; } } } - if (this->field_0xf != 0) { + if (this->subtimer != 0) { UpdateAnimationSingleFrame(this); if ((this->frame & ANIM_DONE) != 0) { - this->field_0xf = 0; + this->subtimer = 0; } } if (this->interactType != 0) { this->action = 2; InitAnimationForceUpdate(this, GetAnimationState(this) + 4); - MessageFromTarget(this->actionDelay + 0xa01); + MessageFromTarget(this->timer + 0xa01); } sub_0806ED78(this); } @@ -66,7 +66,7 @@ void sub_08063B44(Entity* this) { u8 tmp = gMessage.doTextBox & 0x7f; if (tmp == 0) { this->action = 1; - this->field_0xf = tmp; + this->subtimer = tmp; InitAnimationForceUpdate(this, 4); } } diff --git a/src/npc/postman.c b/src/npc/postman.c index cc814d46..d8c61312 100644 --- a/src/npc/postman.c +++ b/src/npc/postman.c @@ -31,7 +31,7 @@ void Postman(Entity* this) { void sub_08060428(Entity* this) { void* data; - this->actionDelay = 0x5a; + this->timer = 0x5a; this->speed = 0x180; if (this->type2 != 0) { data = GetCurrentRoomProperty(this->type2); diff --git a/src/npc/rem.c b/src/npc/rem.c index 2315efbd..c0e26933 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->actionDelay = 0xb4; + this->timer = 0xb4; SetDefaultPriority(this, PRIO_MESSAGE); sub_0806A8C8(this); *(ScriptExecutionContext**)&this->cutsceneBeh = StartCutscene(this, &script_Rem); @@ -67,7 +67,7 @@ void sub_0806A3D8(Entity* this) { void sub_0806A410(Entity* this) { switch (this->subAction) { case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction++; InitializeAnimation(this, 8); } @@ -83,7 +83,7 @@ void sub_0806A410(Entity* this) { void sub_0806A458(Entity* this) { switch (this->subAction) { case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction += 1; } break; @@ -98,7 +98,7 @@ void sub_0806A458(Entity* this) { if (((this->frame & ANIM_DONE) != 0)) { this->action = 1; this->subAction = 0; - this->actionDelay = 0x3c; + this->timer = 0x3c; InitializeAnimation(this, 2); } break; @@ -126,7 +126,7 @@ void sub_0806A4CC(Entity* this) { } break; default: - this->actionDelay = 0xb4; + this->timer = 0xb4; break; } } @@ -166,11 +166,11 @@ void sub_0806A5E8(Entity* this) { if (this->action == 0) { this->action = 1; InitializeAnimation(this, 0x10); - this->actionDelay = (Random() & 0x3f) + 0x3c; + this->timer = (Random() & 0x3f) + 0x3c; } - this->actionDelay -= 1; - if (this->actionDelay == 0) { - this->actionDelay = (Random() & 0x3f) + 0x78; + this->timer -= 1; + if (this->timer == 0) { + this->timer = (Random() & 0x3f) + 0x78; SoundReq(SFX_REM_SLEEP); } GetNextFrame(this); @@ -211,12 +211,12 @@ void sub_0806A674(Entity* this) { if (this->parent->animIndex == 9) { this->spritePriority.b0 = 3; - if (this->actionDelay == 0) { + if (this->timer == 0) { rand = Random(); - this->actionDelay = rand & 7; + this->timer = rand & 7; this->field_0x68.HALF.LO = auStack16[rand >> 8 & 7]; } else if ((gRoomTransition.frameCount & 3U) == 0) { - this->actionDelay--; + this->timer--; if ((s8)this->spriteOffsetX < 1) { this->field_0x68.HALF.LO = 1; } @@ -227,12 +227,12 @@ void sub_0806A674(Entity* this) { this->spriteOffsetX += this->field_0x68.HALF.LO; } - if (this->field_0xf == 0) { + if (this->subtimer == 0) { rand = Random(); - this->field_0xf = rand & 7; + this->subtimer = rand & 7; this->field_0x68.HALF.HI = auStack16[rand >> 8 & 7]; } else if (((u32)gRoomTransition.frameCount >> 4 & 3) == 0) { - this->field_0xf--; + this->subtimer--; if (-1 < this->spriteOffsetY) { this->field_0x68.HALF.HI = -1; } @@ -360,7 +360,7 @@ void sub_0806A9B0(Entity* this, ScriptExecutionContext* context) { static const u8 gUnk_081122A0[] = { 60, 100, 200, 60, 100, 200, 80, 80 }; this->action = 2; this->subAction = 0; - this->actionDelay = gUnk_081122A0[Random() & 7]; + this->timer = gUnk_081122A0[Random() & 7]; this->field_0x80.HWORD = 9; InitializeAnimation(this, 9); SetLocalFlag(NPC37_REM_SLEEP); diff --git a/src/npc/sittingPerson.c b/src/npc/sittingPerson.c index 87db1f2f..2a8f3772 100644 --- a/src/npc/sittingPerson.c +++ b/src/npc/sittingPerson.c @@ -23,7 +23,7 @@ void SittingPerson(Entity* this) { void SittingPersion_Init(Entity* this) { if (LoadExtraSpriteData(this, &gUnk_0810CB78[this->type * 3])) { this->action = 1; - this->spriteSettings.flipX = this->actionDelay; + this->spriteSettings.flipX = this->timer; if (this->spriteSettings.flipX == 0) { this->animationState = 6; @@ -31,7 +31,7 @@ void SittingPersion_Init(Entity* this) { this->animationState = 2; } - this->actionDelay = this->animationState; + this->timer = this->animationState; this->field_0x68.HALF.HI = 0; sub_0807DD50(this); sub_080637B8(this); @@ -75,7 +75,7 @@ void sub_08063850(Entity* this, ScriptExecutionContext* context) { } void sub_08063874(Entity* this) { - this->animationState = this->actionDelay; + this->animationState = this->timer; } #if defined(EU) || defined(DEMO_JP) || defined(JP) diff --git a/src/npc/smith.c b/src/npc/smith.c index ae4394dd..d6d428bb 100644 --- a/src/npc/smith.c +++ b/src/npc/smith.c @@ -68,10 +68,10 @@ void sub_08066118(Entity* this) { if (uVar1 < 0) { uVar1 = 2; } else { - if (this->field_0xf == 0) { - this->field_0xf = 0x10; + if (this->subtimer == 0) { + this->subtimer = 0x10; } else { - --this->field_0xf; + --this->subtimer; uVar1 = this->animIndex; } } diff --git a/src/npc/stockwell.c b/src/npc/stockwell.c index e9069519..be0ce8e2 100644 --- a/src/npc/stockwell.c +++ b/src/npc/stockwell.c @@ -92,7 +92,7 @@ void sub_080651D8(Entity* this) { void sub_080651F8(Entity* this) { if ((this->frame & 0x20) == 0) { this->subAction = 1; - this->actionDelay = 0x3c; + this->timer = 0x3c; InitializeAnimation(this, 1); CreateSpeechBubbleExclamationMark(this, 8, 0xffffffe8); SetPlayerControl(1); @@ -100,7 +100,7 @@ void sub_080651F8(Entity* this) { } void sub_0806522C(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { ++this->subAction; MessageNoOverlap(0x2c16, this); } @@ -110,20 +110,20 @@ void sub_08065250(Entity* this) { switch (sub_08056338()) { case 0: this->subAction += 1; - this->actionDelay = 0x1e; - this->field_0xf = 0; + this->timer = 0x1e; + this->subtimer = 0; CreateSpeechBubbleExclamationMark(this, 8, 0xffffffe8); break; case 1: this->subAction = 7; - this->actionDelay = 0; - this->field_0xf = 2; + this->timer = 0; + this->subtimer = 2; break; } } void sub_0806528C(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { ++this->subAction; MessageNoOverlap(0x2c18, this); } @@ -132,15 +132,15 @@ void sub_0806528C(Entity* this) { void sub_080652B0(Entity* this) { if ((gMessage.doTextBox & 0x7f) == 0) { this->subAction += 1; - this->actionDelay = 10; - gRoomVars.animFlags = this->field_0xf; + this->timer = 10; + gRoomVars.animFlags = this->subtimer; CreateItemEntity(ITEM_QST_DOGFOOD, 0, 0); } } void sub_080652E4(Entity* this) { - if (this->actionDelay != 0) { - this->actionDelay -= 1; + if (this->timer != 0) { + this->timer -= 1; } else { if (gPlayerEntity.action != PLAYER_ITEMGET) { this->subAction += 1; @@ -160,7 +160,7 @@ void sub_08065338(Entity* this) { if ((gMessage.doTextBox & 0x7f) == 0) { this->action = 1; this->subAction = gMessage.doTextBox & 0x7f; - gRoomVars.animFlags = this->field_0xf; + gRoomVars.animFlags = this->subtimer; InitializeAnimation(this, 4); } } diff --git a/src/npc/sturgeon.c b/src/npc/sturgeon.c index e0045afc..90903566 100644 --- a/src/npc/sturgeon.c +++ b/src/npc/sturgeon.c @@ -22,7 +22,7 @@ void Sturgeon(Entity* this) { if (this->action == 0) { if (LoadExtraSpriteData(this, &gUnk_0810FA38) != 0) { this->action = 1; - this->actionDelay = 0; + this->timer = 0; sub_0807DD50(this); } } else { @@ -62,14 +62,14 @@ ASM_FUNC("asm/non_matching/sturgeon/sub_08064B88.inc", void sub_08064B88(Entity* void sub_08064C2C(Entity* this) { if ((gMessage.doTextBox & 0x7f) == 0) { this->action = 1; - InitializeAnimation(this, (u32)this->field_0xf); + InitializeAnimation(this, (u32)this->subtimer); } } void sub_08064C50(Entity* this) { if (UpdateFuseInteraction(this) != 0) { this->action = 1; - InitializeAnimation(this, this->field_0xf); + InitializeAnimation(this, this->subtimer); } } @@ -81,7 +81,7 @@ void Sturgeon_Head(Entity* this) { } void sub_08064C9C(Entity* this) { - if ((this->actionDelay != 0) && ((gRoomTransition.frameCount & 3U) == 0)) { + if ((this->timer != 0) && ((gRoomTransition.frameCount & 3U) == 0)) { CreateDust(this); } } @@ -105,11 +105,11 @@ void sub_08064CD8(Entity* this) { } void sub_08064D08(Entity* this) { - this->actionDelay = 1; + this->timer = 1; } void sub_08064D10(Entity* this) { - this->actionDelay = 0; + this->timer = 0; } void Sturgeon_Fusion(Entity* this) { diff --git a/src/npc/talon.c b/src/npc/talon.c index 4f52ea9d..c9f09dad 100644 --- a/src/npc/talon.c +++ b/src/npc/talon.c @@ -23,7 +23,7 @@ void sub_08065570(Entity* this) { InitializeAnimation(this, 0); sub_08078778(this); this->action = 1; - this->field_0xf = 1; + this->subtimer = 1; this->animationState = 2; } } @@ -32,9 +32,9 @@ void sub_0806559C(Entity* this) { s32 offset; s32 result; - this->actionDelay++; - if (this->actionDelay >= 9) { - this->actionDelay = 0; + this->timer++; + if (this->timer >= 9) { + this->timer = 0; result = GetAnimationStateInRectRadius(this, 0x20, 0x20); if (result < 0) { offset = this->animationState + 4; diff --git a/src/npc/teachers.c b/src/npc/teachers.c index d99151da..8f0c277e 100644 --- a/src/npc/teachers.c +++ b/src/npc/teachers.c @@ -15,7 +15,7 @@ void Teachers(Entity* this) { if (LoadExtraSpriteData(this, &gUnk_08113910[this->type * 4])) { this->action = 1; this->spriteSettings.draw = TRUE; - this->animationState = this->actionDelay; + this->animationState = this->timer; this->field_0x68.HALF.HI = 0; SetDefaultPriority(this, PRIO_MESSAGE); sub_0807DD50(this); diff --git a/src/npc/tingleSiblings.c b/src/npc/tingleSiblings.c index 32d6ab05..476a53d5 100644 --- a/src/npc/tingleSiblings.c +++ b/src/npc/tingleSiblings.c @@ -26,7 +26,7 @@ void sub_08064D78(Entity* this) { void sub_08064D90(Entity* this) { InitAnimationForceUpdate(this, 2); - this->field_0xf = 1; + this->subtimer = 1; } void sub_08064DA0(Entity* this) { diff --git a/src/npc/townMinish.c b/src/npc/townMinish.c index 93914b00..28d815b3 100644 --- a/src/npc/townMinish.c +++ b/src/npc/townMinish.c @@ -40,12 +40,12 @@ void sub_0806ABFC(Entity* this) { InitializeAnimation(this, 2); this->action = 1; - this->field_0x6a.HALF.LO = this->actionDelay; + this->field_0x6a.HALF.LO = this->timer; this->animationState = this->field_0x6a.HALF.LO << 1; this->field_0x68.HALF.HI = this->animationState * 4; - this->actionDelay = 0; + this->timer = 0; } void sub_0806AC3C(Entity* this) { @@ -85,10 +85,10 @@ void sub_0806ACC4(Entity* this) { return; this->action = 1; - delay = this->actionDelay; + delay = this->timer; this->field_0x6a.HALF.LO = delay; this->animationState = delay * 2; - this->actionDelay = 0; + this->timer = 0; this->field_0x68.HALF.LO = sub_0801E99C(this); sub_0807DD50(this); @@ -175,7 +175,7 @@ void sub_0806AEA8(Entity* this) { } void sub_0806AED8(Entity* this) { - this->actionDelay = 0; + this->timer = 0; sub_0806AEE4(this); } @@ -184,10 +184,10 @@ void sub_0806AEE4(Entity* this) { u8* idx3; u8 tmp1, tmp2; - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else { - this->actionDelay = 2; + this->timer = 2; index = GetFacingDirectionInRectRadius(this, 0x20, 0x20); if (index < 0) { int state = this->field_0x6a.HALF.LO; diff --git a/src/npc/townsperson.c b/src/npc/townsperson.c index 401b4a86..ff763c57 100644 --- a/src/npc/townsperson.c +++ b/src/npc/townsperson.c @@ -36,7 +36,7 @@ void Townsperson(Entity* this) { void sub_08061BC8(Entity* this) { if (LoadExtraSpriteData(this, gUnk_0810B6EC[this->type])) { this->animationState = 2; - this->field_0xf = this->type + 1; + this->subtimer = this->type + 1; this->action++; sub_08061CB4(this, 2); } @@ -49,10 +49,10 @@ void sub_08061C00(Entity* this) { if (uVar1 < 0) { uVar1 = this->animationState + 4; } else { - if (this->field_0xf == 0) { - this->field_0xf = 0x10; + if (this->subtimer == 0) { + this->subtimer = 0x10; } else { - this->field_0xf--; + this->subtimer--; uVar1 = this->animIndex & 3; } } @@ -89,7 +89,7 @@ void sub_08061CEC(Entity* this) { if (LoadExtraSpriteData(this, gUnk_0810B6EC[this->type])) { this->action = 1; this->spriteSettings.draw = TRUE; - this->animationState = this->actionDelay; + this->animationState = this->timer; this->field_0x68.HALF.HI = 0xff; uVar2 = sub_0805ACC0(this); if (uVar2 == 0) { diff --git a/src/npc/vaatiReborn.c b/src/npc/vaatiReborn.c index 5209022d..b52e4262 100644 --- a/src/npc/vaatiReborn.c +++ b/src/npc/vaatiReborn.c @@ -28,12 +28,12 @@ void VaatiRebornAction0(Entity* this) { this->action = 1; this->subAction = 0; - this->actionDelay = 0; + this->timer = 0; switch (this->type) { case 0: this->y.HALF.HI -= 0xa0; - this->actionDelay = 0xa0; - this->field_0xf = 0x20; + this->timer = 0xa0; + this->subtimer = 0x20; this->spriteOffsetY = 0x20; for (i = 0; i < 4; i++) { entity = CreateNPC(VAATI_REBORN, 2, i); @@ -59,8 +59,8 @@ void VaatiRebornAction0(Entity* this) { InitAnimationForceUpdate(this, 0); break; case 3: - this->actionDelay = 1; - this->field_0xf = 0x20; + this->timer = 1; + this->subtimer = 0x20; entity = CreateNPC(VAATI_REBORN, 4, 0); if (entity != NULL) { CopyPosition(this, entity); @@ -93,7 +93,7 @@ void VaatiRebornAction1(Entity* this) { switch (this->type) { case 0: this->y.HALF.HI++; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { entity = CreateNPC(VAATI_REBORN, 3, 0); if (entity == NULL) { break; @@ -104,8 +104,8 @@ void VaatiRebornAction1(Entity* this) { DeleteThisEntity(); return; } - if (this->field_0xf-- == 1) { - this->field_0xf = 0x20; + if (this->subtimer-- == 1) { + this->subtimer = 0x20; SoundReq(SFX_1A9); } UpdateAnimationSingleFrame(this); @@ -125,7 +125,7 @@ void VaatiRebornAction1(Entity* this) { case 3: switch (this->subAction) { case 0: - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction += 1; } break; @@ -140,13 +140,13 @@ void VaatiRebornAction1(Entity* this) { if ((this->frame & 0x10) != 0) { this->frame &= 0xef; - switch (++this->actionDelay) { + switch (++this->timer) { case 1: break; case 10: this->subAction++; EnqueueSFX(SFX_SUMMON); - this->actionDelay = 0; + this->timer = 0; InitAnimationForceUpdate(this, this->subAction - 1); break; } @@ -160,8 +160,8 @@ void VaatiRebornAction1(Entity* this) { break; } - if (--this->field_0xf == 0) { - this->field_0xf = 0x20; + if (--this->subtimer == 0) { + this->subtimer = 0x20; SoundReq(SFX_1A9); } UpdateAnimationSingleFrame(this); diff --git a/src/npc/windTribespeople.c b/src/npc/windTribespeople.c index c4087885..54ea46a9 100644 --- a/src/npc/windTribespeople.c +++ b/src/npc/windTribespeople.c @@ -38,7 +38,7 @@ void sub_0806C798(Entity* this) { if (iVar1 != 0) { this->action = 1; this->spriteSettings.draw = 1; - this->animationState = this->actionDelay; + this->animationState = this->timer; sub_0807DD50(this); sub_0806C7D4(this); } diff --git a/src/npc/zelda.c b/src/npc/zelda.c index 60eb6ee3..7978a1eb 100644 --- a/src/npc/zelda.c +++ b/src/npc/zelda.c @@ -57,7 +57,7 @@ void sub_08066D4C(Entity* this, ScriptExecutionContext* context) { this->parent->spriteSettings.draw = 1; this->parent->animationState = this->animationState; this->spriteSettings.draw = 0; - this->field_0x17 &= 0xFE; + this->followerFlag &= 0xFE; sub_08068694(this, this->parent); context->condition = 1; } else { diff --git a/src/npcUtils.c b/src/npcUtils.c index 407169e3..813f8772 100644 --- a/src/npcUtils.c +++ b/src/npcUtils.c @@ -128,10 +128,10 @@ s32 GetFacingDirectionInRectRadius(Entity* ent, u32 x, u32 y) { void sub_0806EE04(Entity* ent, void* a2, u32 a3) { ent->child = a2; - ent->field_0x3c = a3; + ent->collisionFlags = a3; ent->hitType = 0; ent->knockbackSpeed = 0; - ent->field_0x16 = 0; + ent->carryFlags = 0; } u32 sub_0806EE20(Entity* ent) { @@ -139,7 +139,7 @@ u32 sub_0806EE20(Entity* ent) { if (!ent->interactType) { if (ent->child != NULL) - return gUnk_08114EFC[ent->field_0x16](ent); + return gUnk_08114EFC[ent->carryFlags](ent); } else { ent->knockbackSpeed = 8; v3 = GetFacingDirection(ent, &gPlayerEntity); @@ -187,7 +187,7 @@ static void sub_0806EF14(Entity* ent) { u16 xy[2]; sub_0806EF4C(ent, xy); ent->direction = sub_080045B4(ent, xy[0], xy[1]); - if ((ent->field_0x3c & 1) == 0) + if ((ent->collisionFlags & 1) == 0) ent->knockbackDirection = sub_0806F5A4(ent->direction); } @@ -213,22 +213,22 @@ u32 sub_0806EFAC(Entity* ent, u16* a2) { } u32 sub_0806EFBC(Entity* ent, u16* a2) { - ent->field_0x16 = 1; + ent->carryFlags = 1; ent->knockbackSpeed = 8; return 0; } u32 sub_0806EFCC(Entity* ent, u16* a2) { - ent->field_0x16 = 2; + ent->carryFlags = 2; ent->knockbackSpeed = a2[1]; return 0; } u32 sub_0806EFDC(Entity* ent, u16* a2) { if (*a2 >> 8) { - ent->field_0x3c &= ~1; + ent->collisionFlags &= ~1; } else { - ent->field_0x3c |= 1; + ent->collisionFlags |= 1; } ent->hitType++; return sub_0806EF88(ent); @@ -247,7 +247,7 @@ u32 sub_0806F02C(Entity* ent, u16* a2) { } u32 sub_0806F048(Entity* ent, u16* a2) { - ent->field_0x16 = 3; + ent->carryFlags = 3; return 0; } @@ -258,7 +258,7 @@ u32 sub_0806F050(Entity* ent, u16* a2) { } u32 sub_0806F064(Entity* ent, u16* a2) { - ent->field_0x16 = 0; + ent->carryFlags = 0; ent->hitType++; return *a2 >> 8; } @@ -291,13 +291,13 @@ void sub_0806F0A4(void) { Entity* nextEnt; if ((currentEntity->flags & ENT_DID_INIT) == 0) continue; - if ((currentEntity->field_0x17 & 1) == 0) + if ((currentEntity->followerFlag & 1) == 0) continue; for (nextEnt = currentEntity->next; nextEnt != (Entity*)entityList; nextEnt = nextEnt->next) { if ((nextEnt->flags & ENT_DID_INIT) == 0) continue; - if ((nextEnt->field_0x17 & 1) == 0) + if ((nextEnt->followerFlag & 1) == 0) continue; sub_08004484(currentEntity, nextEnt); } diff --git a/src/object.c b/src/object.c index 060876d7..c0c4eb40 100644 --- a/src/object.c +++ b/src/object.c @@ -207,7 +207,7 @@ void ObjectUpdate(Entity* this) { this->iframes++; if (!EntityIsDeleted(this)) { gObjectFunctions[this->id](this); - this->bitfield &= ~0x80; + this->contactFlags &= ~0x80; } DrawEntity(this); } diff --git a/src/object/ambientClouds.c b/src/object/ambientClouds.c index 22fa0964..acddf0c1 100644 --- a/src/object/ambientClouds.c +++ b/src/object/ambientClouds.c @@ -82,12 +82,12 @@ void sub_08089944(Entity* this) { this->spriteRendering.b3 = 0; if ((this->type2 == 1) || (this->child->action == 2)) { if (gPlayerEntity.z.HALF.HI < -0x24) - this->actionDelay = 1; + this->timer = 1; else - this->actionDelay = 0; + this->timer = 0; this->y.HALF.HI += (this->type2 - 1) * -0x24; iVar1 = EntityInRectRadius(this, &gPlayerEntity, 0xf, 0xf); - if ((iVar1 != 0) && (this->actionDelay != 0)) { + if ((iVar1 != 0) && (this->timer != 0)) { this->action = 2; this->spriteOrientation.flipY = 2; this->spriteRendering.b3 = 3; @@ -98,7 +98,7 @@ void sub_08089944(Entity* this) { gPlayerEntity.y.HALF.HI -= 0x24; gPlayerEntity.z.HALF.HI += 0x24; sub_0807AA80(&gPlayerEntity); - if (this->field_0xf == 0) { + if (this->subtimer == 0) { pEVar2 = CreateFx(&gPlayerEntity, FX_DEATH, 0); if (pEVar2 != NULL) { pEVar2->x.HALF.HI += 8; @@ -118,7 +118,7 @@ void sub_08089944(Entity* this) { } } this->y.HALF.HI += (this->type2 - 1) * 0x24; - this->field_0xf = this->actionDelay; + this->subtimer = this->timer; } } } diff --git a/src/object/angryStatue.c b/src/object/angryStatue.c index d3fbe01d..f997a69f 100644 --- a/src/object/angryStatue.c +++ b/src/object/angryStatue.c @@ -3,7 +3,7 @@ #include "room.h" #include "sound.h" #include "projectile.h" -#include "coord.h" +#include "physics.h" extern Hitbox gUnk_080FD178; @@ -29,7 +29,7 @@ void AngryStatue_Init(Entity* this) { } void AngryStatue_Action1(Entity* this) { - if (this->parent->field_0xf == 1) { + if (this->parent->subtimer == 1) { this->action = 2; InitializeAnimation(this, this->type + 4); } @@ -62,9 +62,9 @@ void AngryStatue_Action2(Entity* this) { } void AngryStatue_Action3(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 4; - this->actionDelay = 15; + this->timer = 15; InitializeAnimation(this, this->type); } else { this->parent->z.BYTES.byte2 |= 1 << this->type2; @@ -73,7 +73,7 @@ void AngryStatue_Action3(Entity* this) { void AngryStatue_Action4(Entity* this) { this->spriteSettings.draw ^= 1; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->spriteSettings.draw = 1; } diff --git a/src/object/backgroundCloud.c b/src/object/backgroundCloud.c index 176bdd58..617ce505 100644 --- a/src/object/backgroundCloud.c +++ b/src/object/backgroundCloud.c @@ -21,7 +21,7 @@ void sub_0808F658(Entity* this) { this->field_0x7a.HWORD = gRoomControls.origin_x + gRoomControls.width + 0x60; this->animationState = 0; this->x.HALF.HI += (Random() & 0xf) << 4; - this->actionDelay = 0; + this->timer = 0; this->subAction = 0; } @@ -35,7 +35,7 @@ void sub_0808F6E0(Entity* this) { void sub_0808F70C(Entity* this) { if (this->subAction == 0) { this->subAction = 1; - this->actionDelay = ((Random() & 7) << 3) + 31; + this->timer = ((Random() & 7) << 3) + 31; if ((this->direction & 0x10)) { this->x.HALF.HI = this->field_0x7a.HWORD; @@ -48,7 +48,7 @@ void sub_0808F70C(Entity* this) { } if (this->subAction == 1) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->subAction = 0; } diff --git a/src/object/bakerOven.c b/src/object/bakerOven.c index d4b26c28..8f77955f 100644 --- a/src/object/bakerOven.c +++ b/src/object/bakerOven.c @@ -31,10 +31,10 @@ void sub_0809CC74(Entity* this) { } else { if (this->type2 & 1) { this->spriteSettings.draw = 1; - this->actionDelay = 20; + this->timer = 20; } else { this->action = 2; - this->actionDelay = (this->type2 & 2) ? 20 : 18; + this->timer = (this->type2 & 2) ? 20 : 18; } InitializeAnimation(this, 0); } @@ -57,9 +57,9 @@ void sub_0809CD0C(Entity* this) { } /* Damage minish link if he touches a steam cloud */ - if (this->field_0xf == 0 && gPlayerEntity.iframes == 0 && this->frameIndex && + if (this->subtimer == 0 && gPlayerEntity.iframes == 0 && this->frameIndex && sub_0806FC80(this, &gPlayerEntity, 4)) { - this->field_0xf++; + this->subtimer++; ModHealth(-2); SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6); gPlayerEntity.iframes = 16; @@ -72,10 +72,10 @@ void sub_0809CD0C(Entity* this) { void sub_0809CDB4(Entity* this) { /* Reset cloud position and start animation. */ - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; - this->actionDelay = 30; - this->field_0xf = 0; + this->timer = 30; + this->subtimer = 0; this->spriteSettings.draw = 1; this->y.HALF.HI = this->parent->y.HALF.HI - 0xe; InitializeAnimation(this, 0); diff --git a/src/object/barrelInside.c b/src/object/barrelInside.c index ea09fd37..fee1a436 100644 --- a/src/object/barrelInside.c +++ b/src/object/barrelInside.c @@ -9,8 +9,8 @@ void BarrelInside(Entity* this) { this->action = 1; this->spriteSettings.draw = 1; this->frameIndex = this->type; - this->actionDelay = 0x10; - this->field_0xf = 1; + this->timer = 0x10; + this->subtimer = 1; ptr = gUnk_08120C80 + this->type * 3; this->spriteRendering.b3 = *ptr; this->spritePriority.b0 = *(ptr + 1); @@ -18,11 +18,11 @@ void BarrelInside(Entity* this) { } if (this->type == 4) { - if (--this->actionDelay == 0) { - this->actionDelay = 0x10; - this->frameIndex = gUnk_08120C92[this->field_0xf++]; - if (this->field_0xf == 3) { - this->field_0xf = 0; + if (--this->timer == 0) { + this->timer = 0x10; + 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 5dace1cc..ee4a6ab0 100644 --- a/src/object/beanstalk.c +++ b/src/object/beanstalk.c @@ -76,8 +76,8 @@ void Beanstalk_Init(BeanstalkEntity* this) { return; } #endif - if (super->type2 == 0 && super->actionDelay != 0) { - if (CheckLocalFlag(super->actionDelay) == 0) { + if (super->type2 == 0 && super->timer != 0) { + if (CheckLocalFlag(super->timer) == 0) { return; } super->spriteOrientation.flipY = 2; @@ -104,22 +104,22 @@ void Beanstalk_Init(BeanstalkEntity* this) { case 5: case 6: super->spriteVramOffset = 0x1c0; - super->actionDelay = 0; + super->timer = 0; break; case 7: switch (super->type2) { case 0: this->unk_6c = 0x10; - super->actionDelay = 0; + super->timer = 0; do { obj = CreateObject(BEANSTALK, 7, 1); super->child = obj; if (obj != NULL) { obj->x.HALF.HI = super->x.HALF.HI; (super->child)->y.HALF.HI = super->y.HALF.HI - (s16)this->unk_6c; - super->field_0xf = 4; - while (--super->field_0xf != 0) { - ptr = &gUnk_08120DFC[super->actionDelay]; + super->subtimer = 4; + while (--super->subtimer != 0) { + ptr = &gUnk_08120DFC[super->timer]; obj = CreateObject(BEANSTALK, 7, ptr->type - 2); super->child = obj; if (obj != NULL) { @@ -127,15 +127,15 @@ void Beanstalk_Init(BeanstalkEntity* this) { (super->child)->y.HALF.HI = (super->y.HALF.HI - (s16)this->unk_6c) - ptr->y; super->child->spriteSettings.flipX = ptr->flipX; } - super->actionDelay++; + super->timer++; } - if (super->actionDelay > 5) { - super->actionDelay = 0; + if (super->timer > 5) { + super->timer = 0; } } this->unk_6c += 0x38; } while (((s16)(super->y.HALF_U.HI - this->unk_6c)) >= gRoomControls.origin_y); - super->actionDelay = 1; + super->timer = 1; break; case 2: case 3: @@ -170,19 +170,19 @@ void Beanstalk_Action1Type0(BeanstalkEntity* this) { void Beanstalk_Action1Type0SubAction0(BeanstalkEntity* this) { UpdateAnimationSingleFrame(super); if ((super->frame & ANIM_DONE) != 0) { - if (super->actionDelay < 2) { - super->actionDelay++; + if (super->timer < 2) { + super->timer++; } else { InitAnimationForceUpdate(super, 1); - super->actionDelay = 0x10; + super->timer = 0x10; super->subAction++; } } } void Beanstalk_Action1Type0SubAction1(BeanstalkEntity* this) { - if (super->actionDelay-- == 0) { - super->actionDelay = 0x10; + if (super->timer-- == 0) { + super->timer = 0x10; SoundReq(SFX_198); } UpdateAnimationSingleFrame(super); @@ -205,8 +205,8 @@ void Beanstalk_Action1Type0SubAction1(BeanstalkEntity* this) { } void Beanstalk_Action1Type0SubAction2(BeanstalkEntity* this) { - if (super->actionDelay-- == 0) { - super->actionDelay = 0x10; + if (super->timer-- == 0) { + super->timer = 0x10; SoundReq(SFX_198); } } @@ -217,15 +217,15 @@ void Beanstalk_Action1Type2(BeanstalkEntity* this) { GetNextFrame(super); if ((super->frame & 1) != 0) { - ptr = &gUnk_08120DFC[super->actionDelay]; + ptr = &gUnk_08120DFC[super->timer]; super->child = CreateObject(BEANSTALK, ptr->type, 0); if (super->child != NULL) { super->child->x.HALF.HI = super->x.HALF.HI + ptr->x; super->child->y.HALF.HI = super->y.HALF.HI - ptr->y; super->child->spriteSettings.flipX = ptr->flipX; } - if (++super->actionDelay > 5) { - super->actionDelay = 0; + if (++super->timer > 5) { + super->timer = 0; } } if ((super->frame & ANIM_DONE) != 0) { @@ -253,7 +253,7 @@ void Beanstalk_Action1Type1(BeanstalkEntity* this) { void Beanstalk_Action1Type7(BeanstalkEntity* this) { switch (super->type2) { case 0: - if (super->actionDelay == 0) { + if (super->timer == 0) { return; } this->unk_6c = gRoomControls.origin_y; @@ -269,7 +269,7 @@ void Beanstalk_Action1Type7(BeanstalkEntity* this) { break; } } - super->actionDelay = 0; + super->timer = 0; return; break; case 1: @@ -279,15 +279,15 @@ void Beanstalk_Action1Type7(BeanstalkEntity* this) { case 4: if (gPlayerState.floor_type == 0x1e) { if (EntityInRectRadius(super, &gPlayerEntity, 0, 8)) { - if ((super->animIndex == (super->type2 - 1) * 3 + 1) && (super->actionDelay == 0)) { - super->actionDelay = 1; + if ((super->animIndex == (super->type2 - 1) * 3 + 1) && (super->timer == 0)) { + super->timer = 1; InitializeAnimation(super, super->animIndex + 1); } } else { - super->actionDelay = 0; + super->timer = 0; } } else { - super->actionDelay = 0; + super->timer = 0; } GetNextFrame(super); if ((super->frame & ANIM_DONE) != 0) { @@ -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->actionDelay = 0x80; + obj->timer = 0x80; obj->type = 1; obj->spriteRendering.b3 = 2; obj->spritePriority.b0 = 6; diff --git a/src/object/bigBarrel.c b/src/object/bigBarrel.c index 77e6ff6a..3bb56c73 100644 --- a/src/object/bigBarrel.c +++ b/src/object/bigBarrel.c @@ -59,30 +59,30 @@ void sub_08088A68(BigBarrelEntity* this) { } else { if (gRoomVars.animFlags & 1) { gRoomVars.animFlags &= ~1; - super->actionDelay = 1; + super->timer = 1; this->unk68 = gUnk_08120C1C; SoundReq(SFX_BARREL_ENTER); } if (gRoomVars.animFlags & 2) { gRoomVars.animFlags &= ~2; - super->actionDelay = 1; + super->timer = 1; this->unk68 = gUnk_08120C25; SoundReq(SFX_BARREL_RELEASE); } if (gRoomVars.animFlags & 4) { gRoomVars.animFlags &= ~4; - super->actionDelay = 1; + super->timer = 1; this->unk68 = gUnk_08120C2E; SoundReq(SFX_BARREL_ENTER); } - if (super->actionDelay) { - if (super->actionDelay-- == 1) { + if (super->timer) { + if (super->timer-- == 1) { pcVar3 = this->unk68; uVar3 = pcVar3[0]; *(u8*)&super->spriteOffsetY = uVar3; pcVar3++; if (*pcVar3 != 0xff) { - super->actionDelay = 8; + super->timer = 8; this->unk68 = pcVar3; } else { super->spriteOffsetY = 0; @@ -154,8 +154,8 @@ void sub_08088C9C(BigBarrelEntity* this) { } else { localFlag = 22; } - super->field_0xf = localFlag; - if (CheckLocalFlag(super->field_0xf) == 0) { + super->subtimer = localFlag; + if (CheckLocalFlag(super->subtimer) == 0) { return; } @@ -163,7 +163,7 @@ void sub_08088C9C(BigBarrelEntity* this) { super->action = 4; break; case 1: - if (CheckLocalFlag(super->field_0xf) == 0) { + if (CheckLocalFlag(super->subtimer) == 0) { return; } super->action = 2; @@ -175,12 +175,12 @@ void sub_08088C9C(BigBarrelEntity* this) { gRoomVars.animFlags &= ~0x20; super->action = 3; super->subAction = 4; - super->actionDelay = 1; + super->timer = 1; case 3: - if (--super->actionDelay) { + if (--super->timer) { return; } - super->actionDelay = 8; + super->timer = 8; x = super->x.HALF.HI; if (super->type2) { super->x.HALF.HI = x - 2; @@ -209,7 +209,7 @@ void sub_08088DB4(BigBarrelEntity* this) { case 1: if (CheckLocalFlag(super->type2)) { super->action++; - super->actionDelay = 10; + super->timer = 10; } break; case 2: @@ -218,15 +218,15 @@ void sub_08088DB4(BigBarrelEntity* this) { if ((gRoomVars.animFlags & 8) == 0) { return; } - if (--super->actionDelay) { + if (--super->timer) { return; } - super->actionDelay = 0x1e; + super->timer = 0x1e; super->frameIndex++; super->action++; break; default: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { gRoomVars.animFlags &= ~0x8; DeleteEntity(super); } @@ -277,7 +277,7 @@ void sub_08088F20(BigBarrelEntity* this) { return; } super->action = 2; - super->actionDelay = 30; + super->timer = 30; RequestPriorityDuration(super, 0x10e); pEVar3 = CreateObject(OBJECT_2A, 1, 0); if (pEVar3 != NULL) { @@ -290,7 +290,7 @@ void sub_08088F20(BigBarrelEntity* this) { SetTileType(0x76, COORD_TO_TILE(super), 2); break; case 2: - if (--super->actionDelay) { + if (--super->timer) { return; } sub_08089094(this); @@ -301,10 +301,10 @@ void sub_08088F20(BigBarrelEntity* this) { return; } super->action = 4; - super->actionDelay = 0x78; + super->timer = 0x78; break; default: - if (--super->actionDelay == 0x5a) { + if (--super->timer == 0x5a) { if (CheckLocalFlags(0x15, 2)) { gRoomVars.animFlags |= 2; } else { @@ -312,7 +312,7 @@ void sub_08088F20(BigBarrelEntity* this) { } gRoomVars.animFlags |= 0x20; } - if (super->actionDelay == 0) { + if (super->timer == 0) { gRoomVars.animFlags &= ~0x10; if (CheckLocalFlags(0x15, 2)) { RequestPriorityDuration(super, 0x3c); diff --git a/src/object/bigIceBlock.c b/src/object/bigIceBlock.c index f86ac054..e3251336 100644 --- a/src/object/bigIceBlock.c +++ b/src/object/bigIceBlock.c @@ -48,7 +48,7 @@ void BigIceBlock_Init(BigIceBlockEntity* this) { super->action = 1; super->flags |= 0x80; super->updatePriority = 3; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = 1; super->flags2 = 0x80; @@ -64,7 +64,7 @@ void BigIceBlock_Init(BigIceBlockEntity* this) { void BigIceBlock_Action1(BigIceBlockEntity* this) { if (sub_0809963C(this)) { super->action = 2; - super->actionDelay = 0; + super->timer = 0; EnqueueSFX(SFX_ICE_BLOCK_MELT); BigIceBlock_Action2(this); } @@ -73,20 +73,20 @@ void BigIceBlock_Action1(BigIceBlockEntity* this) { void BigIceBlock_Action2(BigIceBlockEntity* this) { u32 tmp; if (!sub_0809963C(this)) { - if (super->actionDelay >= 2) { - super->actionDelay -= 2; + if (super->timer >= 2) { + super->timer -= 2; } else { - super->actionDelay = 0; + super->timer = 0; } - if (super->actionDelay == 0) { + if (super->timer == 0) { super->action = 1; sub_0805EC60(super); return; } } else { - super->actionDelay += 1; + super->timer += 1; } - tmp = gUnk_081237B0[super->actionDelay >> 5]; + tmp = gUnk_081237B0[super->timer >> 5]; SetAffineInfo(super, 0x100, tmp, 0); if (super->type != 1) { if (super->type != 2) { @@ -96,7 +96,7 @@ void BigIceBlock_Action2(BigIceBlockEntity* this) { } } super->action = 3; - super->actionDelay = 0x3c; + super->timer = 0x3c; super->flags &= 0x7f; } @@ -107,13 +107,13 @@ void sub_08099880(BigIceBlockEntity* this) { u32 uVar4; s32 x; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { DeleteThisEntity(); } else { - if (super->actionDelay == 0x30) { + if (super->timer == 0x30) { sub_08099C18(this); } - uVar4 = (0x3c - super->actionDelay) * 0x20 + 0x100; + uVar4 = (0x3c - super->timer) * 0x20 + 0x100; SetAffineInfo(super, 0x100, uVar4, 0); sub_0806FCF4(super, uVar4, 2, 0); obj = CreateObject(SPECIAL_FX, 0x11, 0x40); diff --git a/src/object/bigVortex.c b/src/object/bigVortex.c index 00e43c6b..2aa0f349 100644 --- a/src/object/bigVortex.c +++ b/src/object/bigVortex.c @@ -42,7 +42,7 @@ void sub_08098D6C(Entity* this) { if (CheckFlags(this->field_0x86.HWORD)) { this->action = 2; - this->actionDelay = 0x2d; + this->timer = 0x2d; ent = CreateFx(this, FX_BIG_EXPLOSION2, 0); if (ent != NULL) { ent->y.HALF.HI += 8; @@ -51,7 +51,7 @@ void sub_08098D6C(Entity* this) { } void sub_08098D9C(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; this->spriteSettings.draw = TRUE; sub_08098E88(this); diff --git a/src/object/bird.c b/src/object/bird.c index c798c6f5..78798b49 100644 --- a/src/object/bird.c +++ b/src/object/bird.c @@ -45,8 +45,8 @@ void Bird_Type0_Init(Entity* this) { this->action++; this->spriteSettings.draw = TRUE; - this->actionDelay = 0x31; - this->field_0xf = 1; + this->timer = 0x31; + this->subtimer = 1; this->zVelocity = Q_16_16(-1.5); this->z.WORD = Q_16_16(-56.75); this->field_0x68.HWORD = Q_16_16(-0.03125); @@ -68,9 +68,9 @@ void Bird_Type0_Init(Entity* this) { void Bird_Type0_Action1(Entity* this) { LinearMoveUpdate(this); GravityUpdate(this, *(s16*)&this->field_0x68.HWORD); - if (this->actionDelay != 0) { - if (--this->actionDelay == 0) { - this->field_0xf = 0; + if (this->timer != 0) { + if (--this->timer == 0) { + this->subtimer = 0; } } else if (CheckOnScreen(this) == 0) { DeleteThisEntity(); @@ -105,7 +105,7 @@ void Bird_Type1_Action1_Subaction0(Entity* this) { u32 temp; if (this->parent != NULL) { - temp = this->parent->field_0xf; + temp = this->parent->subtimer; if (temp != 0) { PositionRelative(this->parent, this, 0, Q_16_16(8.0)); } else { @@ -183,9 +183,9 @@ void Bird_Type8(Entity* this) { switch (this->action) { case 0: - if (this->actionDelay != 0) { + if (this->timer != 0) { this->frameIndex = 0xff; - this->actionDelay--; + this->timer--; return; } this->action = 1; @@ -221,7 +221,7 @@ void Bird_Type8(Entity* this) { if (pEVar5 != NULL) { this->child = pEVar5; this->action = 2; - this->actionDelay = 8; + this->timer = 8; this->speed = 0x300; this->field_0x68.HWORD = 0xe000; PlayerDropHeldObject(); @@ -249,17 +249,17 @@ void Bird_Type8(Entity* this) { pEVar5 = this->child; if (pEVar5 != NULL) { if (gPlayerEntity.x.HALF.HI < this->x.HALF.HI - 8) { - this->actionDelay = 0; + this->timer = 0; } - if (this->actionDelay == 0) { + if (this->timer == 0) { PositionRelative(this, pEVar5, 0xfff80000, 0); pEVar5->z.HALF.HI += 0x18; pEVar5->spritePriority.b0 = this->spritePriority.b0; pEVar5->spriteRendering.b3 = this->spriteRendering.b3; pEVar5->spriteOrientation.flipY = this->spriteOrientation.flipY; } else { - this->actionDelay--; + this->timer--; CopyPosition(&gPlayerEntity, pEVar5); } } @@ -375,7 +375,7 @@ void CreateBird(void) { if (!FindEntity(OBJECT, BIRD, 6, 8, 0)) { birdEnt = CreateObject(BIRD, 8, 0); if (birdEnt != NULL) { - birdEnt->actionDelay = 0; + birdEnt->timer = 0; } } } diff --git a/src/object/blockPushed.c b/src/object/blockPushed.c index 58280fcd..387518f6 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->actionDelay = 0x20; + super->timer = 0x20; super->speed = 0x80; super->spritePriority.b0 = 6; pos = COORD_TO_TILE(super); @@ -93,7 +93,7 @@ void sub_08082EB4(BlockPushedEntity* this) { void sub_08083094(BlockPushedEntity* this) { LinearMoveUpdate(super); sub_0800445C(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_080830B8(this); } } diff --git a/src/object/book.c b/src/object/book.c index 3c9e12b5..05af98ed 100644 --- a/src/object/book.c +++ b/src/object/book.c @@ -45,8 +45,8 @@ void sub_0809B3C4(Entity* this) { switch (this->type2) { case 0: this->action = 1; - this->actionDelay = 22; - this->field_0xf = 2; + this->timer = 22; + this->subtimer = 2; this->field_0x80.HALF.LO = 0; this->spritePriority.b0 = 3; break; @@ -82,12 +82,12 @@ void sub_0809B4A8(Entity* this) { } if (sub_0809B688(this)) { - if (--this->actionDelay) { + if (--this->timer) { return; } this->action = 2; - this->actionDelay = 30; + this->timer = 30; this->speed = 0x40; this->direction = 0x10; @@ -100,19 +100,19 @@ void sub_0809B4A8(Entity* this) { gPlayerEntity.direction = gPlayerEntity.animationState << 2; EnqueueSFX(SFX_10F); } else { - this->actionDelay = 22; + this->timer = 22; } } void sub_0809B524(Entity* this) { - if (--this->actionDelay == 0) { - if (--this->field_0xf == 0) { + if (--this->timer == 0) { + if (--this->subtimer == 0) { this->action = 3; this->y.HALF.HI += 0x20; this->z.HALF.HI -= 0x20; } else { this->action = 1; - this->actionDelay = 22; + this->timer = 22; this->field_0x80.HALF.LO = 0x18; } } diff --git a/src/object/bossDoor.c b/src/object/bossDoor.c index 0d1844e1..dd199b79 100644 --- a/src/object/bossDoor.c +++ b/src/object/bossDoor.c @@ -105,7 +105,7 @@ void BossDoor_Action2(BossDoorEntity* this) { void BossDoor_Action3(BossDoorEntity* this) { LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { if (super->type < 4) { sub_08078AC0(0x40, 0, 1); gPlayerEntity.direction = super->type << 3; @@ -120,7 +120,7 @@ void BossDoor_Action4(BossDoorEntity* this) { if (sub_08083734(super, this->unk_76)) { super->action = 5; - super->actionDelay = 0xc; + super->timer = 0xc; super->spriteSettings.draw = 1; super->direction = *(u8*)&this->unk_76 << 3 ^ 0x10; ptr = &gUnk_081214F4[this->unk_76 * 2]; @@ -136,7 +136,7 @@ void BossDoor_Action5(BossDoorEntity* this) { const s8* ptr; LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 6; super->z.HALF.HI = 0; super->x.HALF.HI = this->unk_70; @@ -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->actionDelay = 0xc; + super->timer = 0xc; 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 d4f602ba..20a34d21 100644 --- a/src/object/button.c +++ b/src/object/button.c @@ -44,7 +44,7 @@ void sub_08081FF8(Entity*); void sub_08081BAC(Entity* this) { if (sub_08081CB0(this)) { this->subAction = 0; - this->actionDelay = 0xA; + this->timer = 0xA; RequestPriorityDuration(this, 0xA); sub_08081FF8(this); if (this->type == 1) { @@ -64,11 +64,11 @@ void sub_08081BE0(Entity* this) { return; if (!sub_08081D28(this)) { this->action = 4; - this->field_0xf = 1; + this->subtimer = 1; if ((gPlayerState.heldObject == 2) || (!(gPlayerState.field_0x35 & 0x80))) { - this->actionDelay = 0x18; + this->timer = 0x18; } else { - this->actionDelay = 0x8; + this->timer = 0x8; } } else { sub_08081E6C(this); @@ -76,15 +76,15 @@ void sub_08081BE0(Entity* this) { } void sub_08081C30(Entity* this) { - if (this->actionDelay != 0) { - this->actionDelay--; - if (this->field_0xf != 0) { - this->field_0xf = 0; + if (this->timer != 0) { + this->timer--; + if (this->subtimer != 0) { + this->subtimer = 0; SetTile(0x4035, this->field_0x74.HWORD, this->collisionLayer); } if (sub_08081CB0(this)) { this->action = 3; - this->actionDelay = 0; + this->timer = 0; } } else { this->action = 2; @@ -239,13 +239,13 @@ void sub_08081F24(Entity* this) { u32 sub_08081F7C(Entity* this, u32 r7) { u16 tmp; - if (this->actionDelay == 0) + if (this->timer == 0) return 1; - if (--this->actionDelay > 6) { + if (--this->timer > 6) { if (this->child != NULL) this->child->spriteOffsetY = -4; } else { - if (this->actionDelay == 6) { + if (this->timer == 6) { SetFlag(this->field_0x86.HWORD); SetTileType(r7, this->field_0x74.HWORD, this->collisionLayer); sub_08081F24(this); diff --git a/src/object/chestSpawner.c b/src/object/chestSpawner.c index af493443..af7f4adb 100644 --- a/src/object/chestSpawner.c +++ b/src/object/chestSpawner.c @@ -102,7 +102,7 @@ void ChestSpawner_Type2Action1(ChestSpawnerEntity* this) { gPauseMenuOptions.disabled = 1; super->action = 2; super->subAction = 0; - super->field_0xf = 0x1e; + super->subtimer = 0x1e; super->spriteSettings.draw = 1; super->spriteRendering.alphaBlend = 1; RequestPriorityDuration(super, 0x1e); @@ -125,17 +125,17 @@ void ChestSpawner_Type2Action2(ChestSpawnerEntity* this) { case 1: if ((super->type == 5) || (gPlayerEntity.action == 1)) { super->subAction = 2; - super->actionDelay = 8; - super->field_0xf = 0; + super->timer = 8; + super->subtimer = 0; SoundReq(SFX_14A); } break; default: sub_0800445C(super); CreateMagicSparkles(super->x.HALF.HI, super->y.HALF.HI, 2); - if (--super->actionDelay == 0) { - super->actionDelay = 8; - tmp = ++super->field_0xf; + if (--super->timer == 0) { + super->timer = 8; + tmp = ++super->subtimer; gScreen.controls.alphaBlend = (((0x10 - tmp) * 0x100) & 0xff00) | tmp; if (gScreen.controls.alphaBlend == 0x10) { gPauseMenuOptions.disabled = 0; @@ -152,7 +152,7 @@ void ChestSpawner_Type2Action3(ChestSpawnerEntity* this) { sub_0800445C(super); if (super->interactType != 0) { super->action = 4; - super->field_0xf = 0x1e; + super->subtimer = 0x1e; sub_080788E0(super); RequestPriorityDuration(super, 0x3c); SoundReq(SFX_CHEST_OPEN); @@ -163,11 +163,11 @@ void ChestSpawner_Type2Action4(ChestSpawnerEntity* this) { sub_0800445C(super); GetNextFrame(super); if ((super->frame & ANIM_DONE) != 0) { - if (--super->field_0xf == 0) { - if (super->actionDelay == 0x18) { + if (--super->subtimer == 0) { + if (super->timer == 0x18) { super->action = 6; - super->actionDelay = 8; - super->field_0xf = 0x10; + super->timer = 8; + super->subtimer = 0x10; } else { super->action = 5; sub_08084074(super->type2); @@ -195,7 +195,7 @@ void sub_080840A8(s32 param_1, s32 param_2) { static const s8 gUnk_0811F850[] = { -6, 0, 0, 6 }; Entity* obj = CreateObject(GROUND_ITEM, gUnk_0811F838[Random() & 7], 0); if (obj != NULL) { - obj->actionDelay = 6; + obj->timer = 6; obj->direction = ((Random() & 7) + 0xc) | 0x80; obj->speed = (Random() & 0xf) * 2 + 0x20; obj->zVelocity = gUnk_0811F840[Random() & 3]; @@ -211,9 +211,9 @@ void sub_080840A8(s32 param_1, s32 param_2) { } void ChestSpawner_Type2Action6(ChestSpawnerEntity* this) { - if (--super->actionDelay == 0) { - super->actionDelay = 8; - if (--super->field_0xf != 0) { + if (--super->timer == 0) { + super->timer = 8; + if (--super->subtimer != 0) { sub_080840A8(super->x.HALF.HI, super->y.HALF.HI); } else { super->action = 5; @@ -263,7 +263,7 @@ void ChestSpawner_Type0Action2(ChestSpawnerEntity* this) { break; } super->action = 3; - this->unk_72 = super->actionDelay * 0x3c; + this->unk_72 = super->timer * 0x3c; if ((super->type & 1) == 0) { DeleteThisEntity(); } diff --git a/src/object/cloud.c b/src/object/cloud.c index a8b22546..5c7349bb 100644 --- a/src/object/cloud.c +++ b/src/object/cloud.c @@ -29,7 +29,7 @@ void sub_0809F4DC(Entity* this) { void sub_0809F514(Entity* this) { this->action = 1; - this->actionDelay = 120; + this->timer = 120; this->spriteSettings.draw = 0; this->field_0x68.HALF.LO = 12; gRoomControls.camera_target = this; @@ -39,9 +39,9 @@ void sub_0809F514(Entity* this) { void sub_0809F548(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; - this->actionDelay = 90; + this->timer = 90; SoundReq(SFX_11D); sub_0809F814((((this->x.HALF.HI - gRoomControls.origin_x) >> 4) & 63) | (((this->y.HALF.HI - gRoomControls.origin_y) >> 4) & 63) << 6); @@ -54,7 +54,7 @@ void sub_0809F548(Entity* this) { } void sub_0809F5B0(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { SoundReq(SFX_SECRET_BIG); SetGlobalFlag(KUMOTATSUMAKI); LoadRoomEntityList((EntityData*)&gUnk_080DD750); @@ -71,10 +71,10 @@ void sub_0809F5DC(Entity* this) { void sub_0809F5F0(Entity* this) { u32 iVar1; - iVar1 = CheckRoomFlag(this->actionDelay); + iVar1 = CheckRoomFlag(this->timer); if (iVar1 != 0) { this->action = 2; - this->actionDelay = 120; + this->timer = 120; SetPlayerControl(3); sub_08078B48(); gRoomControls.camera_target = this; @@ -84,12 +84,12 @@ void sub_0809F5F0(Entity* this) { void sub_0809F61C(Entity* this) { if ((gRoomControls.scroll_flags & 4) == 0) { - if (this->actionDelay == 30) { + if (this->timer == 30) { SetLocalFlag(this->type2); } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; - this->actionDelay = 120; + this->timer = 120; SoundReq(SFX_11D); sub_0809F814((((this->x.HALF.HI - gRoomControls.origin_x) >> 4) & 63) | (((this->y.HALF.HI - gRoomControls.origin_y) >> 4) & 63) << 6); @@ -104,8 +104,8 @@ void sub_0809F61C(Entity* this) { void sub_0809F69C(Entity* this) { - if (--this->actionDelay == 0) { - this->actionDelay = 30; + if (--this->timer == 0) { + this->timer = 30; this->action = 4; gRoomControls.camera_target = &gPlayerEntity; SoundReq(SFX_SECRET_BIG); @@ -114,7 +114,7 @@ void sub_0809F69C(Entity* this) { void sub_0809F6CC(Entity* this) { - if (((gRoomControls.scroll_flags & 4) == 0) && (--this->actionDelay == 0)) { + if (((gRoomControls.scroll_flags & 4) == 0) && (--this->timer == 0)) { gPlayerState.controlMode = CONTROL_1; DeleteThisEntity(); } @@ -126,7 +126,7 @@ void sub_0809F700(Entity* this) { if (this->action == 0) { this->action = 1; - this->actionDelay = (Random() & 30) + 8; + this->timer = (Random() & 30) + 8; this->flags = this->flags | 12; } if ((gRoomTransition.frameCount & 3) == 0) { @@ -135,7 +135,7 @@ void sub_0809F700(Entity* this) { this->spriteOffsetY = gUnk_081247C0[uVar2 >> 4 & 7]; } LinearMoveUpdate(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteThisEntity(); } } diff --git a/src/object/crenelBeanSprout.c b/src/object/crenelBeanSprout.c index ec5400b3..ab865f7d 100644 --- a/src/object/crenelBeanSprout.c +++ b/src/object/crenelBeanSprout.c @@ -67,7 +67,7 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) { return; } super->type2 = 0; - super->field_0xf = 2; + super->subtimer = 2; sub_080969A4(this); DeleteThisEntity(); } @@ -94,7 +94,7 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) { if (obj != NULL) { PositionRelative(super, obj, -0x1c0000, -0x280000); } - super->field_0x16 = 0x10; + super->carryFlags = 0x10; super->spriteRendering.b0 = 3; InitializeAnimation(super, 0xc); CrenelBeanSprout_Action1(this); @@ -114,7 +114,7 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) { return; } else { super->type2 = 0; - super->field_0xf = 3; + super->subtimer = 3; sub_080969A4(this); DeleteThisEntity(); return; @@ -241,13 +241,13 @@ void CrenelBeanSprout_Action4(CrenelBeanSproutEntity* this) { gPlayerState.keepFacing |= 0x80; gPlayerState.field_0xa |= 0x80; gPlayerState.field_0x7 |= 0x80; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 6; super->subAction = 0; CreateDust(super); } } else { - super->actionDelay = 0xc0; + super->timer = 0xc0; } } @@ -279,8 +279,8 @@ void CrenelBeanSprout_Action6SubAction0(CrenelBeanSproutEntity* this) { 3, }; SetLocalFlag(super->type2); - super->actionDelay = 0x0f; - super->field_0xf = gUnk_081231AC[super->type >> 1]; + super->timer = 0x0f; + super->subtimer = gUnk_081231AC[super->type >> 1]; super->type2 = 0; super->spriteSettings.draw = 0; super->subAction++; @@ -294,22 +294,22 @@ void CrenelBeanSprout_Action6SubAction0(CrenelBeanSproutEntity* this) { void CrenelBeanSprout_Action6SubAction1(CrenelBeanSproutEntity* this) { static const u16 gUnk_081231AE[] = { 0x1cc, 0x1cb, 0x1c9 }; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->y.HALF.HI += -0x10; sub_0807B7D8(gUnk_081231AE[super->type2], COORD_TO_TILE(super), super->collisionLayer); super->type2++; - if (super->type2 == super->field_0xf) { + if (super->type2 == super->subtimer) { gPlayerState.keepFacing &= 0x7f; super->subAction++; - super->actionDelay = 0x3c; + super->timer = 0x3c; } else { - super->actionDelay = 0x0f; + super->timer = 0x0f; } } } void CrenelBeanSprout_Action6SubAction2(CrenelBeanSproutEntity* this) { - if ((super->actionDelay != 0) && (--super->actionDelay == 0)) { + if ((super->timer != 0) && (--super->timer == 0)) { SoundReq(SFX_SECRET); } } @@ -321,7 +321,7 @@ void sub_080969A4(CrenelBeanSproutEntity* this) { } else { sub_0807B7D8(0x1cd, COORD_TO_TILE(super), super->collisionLayer); } - while (super->type2 != super->field_0xf) { + while (super->type2 != super->subtimer) { super->y.HALF.HI -= 0x10; sub_0807B7D8(gUnk_081231B4[super->type2], COORD_TO_TILE(super), super->collisionLayer); super->type2++; diff --git a/src/object/deathFx.c b/src/object/deathFx.c index dee32ccc..3c305737 100644 --- a/src/object/deathFx.c +++ b/src/object/deathFx.c @@ -43,11 +43,11 @@ void DeathFx_Action0(DeathFxObject* this) { super->collisionLayer = 2; UpdateSpriteForCollisionLayer(&this->base); super->spriteRendering.b0 = 3; - if (super->actionDelay == 0) { + if (super->timer == 0) { tmp = 0x80; } else { - tmp = super->actionDelay; - super->actionDelay = 0; + tmp = super->timer; + super->timer = 0; } SetAffineInfo(super, tmp, tmp, 0); LoadSwapGFX(super, 4, 0); @@ -67,7 +67,7 @@ void DeathFx_Action0(DeathFxObject* this) { uVar4 &= 3; parent = super->parent; if (parent != NULL) { - parent->actionDelay = gUnk_0811EC20[uVar4]; + parent->timer = gUnk_0811EC20[uVar4]; } InitializeAnimation(&this->base, uVar4); } diff --git a/src/object/doubleBookshelf.c b/src/object/doubleBookshelf.c index b1fd39fe..65e1b510 100644 --- a/src/object/doubleBookshelf.c +++ b/src/object/doubleBookshelf.c @@ -81,7 +81,7 @@ void DoubleBookshelf_Action1(DoubleBookshelfEntity* this) { void DoubleBookshelf_Action2(DoubleBookshelfEntity* this) { LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 1; this->unk_80 = COORD_TO_TILE(super); SetPlayerControl(CONTROL_ENABLED); diff --git a/src/object/enemyItem.c b/src/object/enemyItem.c index 29f360c6..81910655 100644 --- a/src/object/enemyItem.c +++ b/src/object/enemyItem.c @@ -29,7 +29,7 @@ void EnemyItem(EnemyItemEntity* this) { } if (super->action == 0) { super->action++; - super->type = super->actionDelay; + super->type = super->timer; super->child = NULL; list = &gEntityLists[4]; for (entity = list->first; entity != (Entity*)list; entity = entity->next) { @@ -65,7 +65,7 @@ void sub_080A2508(EnemyItemEntity* this) { entity = (EnemyItemEntity*)CreateObjectWithParent(super, GROUND_ITEM, super->type, 0); if (entity != NULL) { - (entity->base).actionDelay = 5; + (entity->base).timer = 5; entity->unk_86 = this->unk_86; } sub_080A2500(this); @@ -76,7 +76,7 @@ void sub_080A2534(EnemyItemEntity* this) { entity = (EnemyItemEntity*)CreateObjectWithParent(super, GROUND_ITEM, super->type, 0); if (entity != NULL) { - (entity->base).actionDelay = 4; + (entity->base).timer = 4; entity->unk_86 = this->unk_86; } sub_080A2500(this); diff --git a/src/object/eyeSwitch.c b/src/object/eyeSwitch.c index 769a2cdf..67a5f62d 100644 --- a/src/object/eyeSwitch.c +++ b/src/object/eyeSwitch.c @@ -29,7 +29,7 @@ void EyeSwitch(Entity* this) { void sub_080886A4(EyeSwitchEntity* this) { super->animationState = super->type & 3; super->spritePriority.b0 = 6; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = 1; super->flags2 = 2; @@ -45,8 +45,8 @@ void sub_080886A4(EyeSwitchEntity* this) { } void sub_08088718(EyeSwitchEntity* this) { - if ((super->bitfield == 0x95 || super->bitfield == 0x8e) && - (DirectionRoundUp(super->field_0x4c->direction) >> 3 == (super->animationState & 3))) { + if ((super->contactFlags == 0x95 || super->contactFlags == 0x8e) && + (DirectionRoundUp(super->contactedEntity->direction) >> 3 == (super->animationState & 3))) { super->action = 2; COLLISION_OFF(super); EnqueueSFX(SFX_111); @@ -58,15 +58,15 @@ void sub_08088760(EyeSwitchEntity* this) { GetNextFrame(super); if ((super->frame & ANIM_DONE) != 0) { super->action = 3; - this->unk70 = super->actionDelay << 1; + this->unk70 = super->timer << 1; InitializeAnimation(super, super->animationState + 4); } } void sub_08088790(EyeSwitchEntity* this) { - if (super->actionDelay != 0) { + if (super->timer != 0) { if ((this->eyeSwitchFlags2 != this->eyeSwitchFlags) && (CheckFlags(this->eyeSwitchFlags))) { - super->actionDelay = 0; + super->timer = 0; } else { if (--this->unk70 == 0) { super->action = 4; diff --git a/src/object/ezloCap.c b/src/object/ezloCap.c index 1a0d8894..39c7793a 100644 --- a/src/object/ezloCap.c +++ b/src/object/ezloCap.c @@ -68,12 +68,12 @@ void EzloCap_Type0Init(EzloCapEntity* this) { } LoadSwapGFX(super, 1, 3); if (super->type == 0) { - super->field_0xf = 7; + super->subtimer = 7; InitAnimationForceUpdate(super, 7); SoundReq(SFX_F3); } else { - super->actionDelay = 0; - super->field_0xf = 0xa; + super->timer = 0; + super->subtimer = 0xa; super->y.HALF.HI -= 0xe; InitAnimationForceUpdate(super, 0x14); } @@ -89,30 +89,30 @@ void EzloCap_Type0Action1(EzloCapEntity* this) { } if ((gMessage.doTextBox & 0x7f) != 5) { if (((gMessage.unk == 0xa) || (gMessage.unk == 0)) || ((gMessage.unk & 0xf) > 9)) { - if (super->animIndex != (super->field_0xf | 3)) { - InitAnimationForceUpdate(super, super->field_0xf | 3); + if (super->animIndex != (super->subtimer | 3)) { + InitAnimationForceUpdate(super, super->subtimer | 3); return; } } else { if ((gMessage.unk & 0x80) != 0) { if ((super->frame & 0x90) != 0) { - super->field_0xf = gUnk_0811F16C[(s32)Random() % 9]; - InitAnimationForceUpdate(super, super->field_0xf); + super->subtimer = gUnk_0811F16C[(s32)Random() % 9]; + InitAnimationForceUpdate(super, super->subtimer); return; } } else { if (super->animIndex != gUnk_0811F16C[gMessage.unk]) { - super->field_0xf = gUnk_0811F16C[gMessage.unk]; - InitAnimationForceUpdate(super, super->field_0xf); + super->subtimer = gUnk_0811F16C[gMessage.unk]; + InitAnimationForceUpdate(super, super->subtimer); return; } } } } if (super->animIndex > 7) { - super->actionDelay = 1; + super->timer = 1; } else { - super->actionDelay = 0; + super->timer = 0; } UpdateAnimationSingleFrame(super); } @@ -127,10 +127,10 @@ void EzloCap_Type1Action1(EzloCapEntity* this) { } UpdateAnimationSingleFrame(super); if (super->subAction == 0) { - if (super->field_0xf-- == 0) { - super->actionDelay++; - super->field_0xf = 0xa; - tmp = super->actionDelay - 1; + if (super->subtimer-- == 0) { + super->timer++; + super->subtimer = 0xa; + tmp = super->timer - 1; obj = CreateObjectWithParent(super, OBJECT_79, tmp, 0); super->child = obj; if (obj != NULL) { @@ -140,23 +140,23 @@ void EzloCap_Type1Action1(EzloCapEntity* this) { obj->parent = super->parent; } } - if (super->actionDelay == 6) { + if (super->timer == 6) { super->subAction = 3; - super->actionDelay = 0x3c; + super->timer = 0x3c; super->parent->type2 = 1; InitAnimationForceUpdate(super, 0x1c); } else { - InitAnimationForceUpdate(super, gUnk_0811F178[super->actionDelay - 1]); - if (super->actionDelay > 2) { + InitAnimationForceUpdate(super, gUnk_0811F178[super->timer - 1]); + if (super->timer > 2) { super->spriteSettings.flipX = 1; } } } } else if ((super->frame & ANIM_DONE) != 0) { - super->actionDelay = Random() & 3; - if (super->actionDelay != 0) { + super->timer = Random() & 3; + if (super->timer != 0) { super->spriteSettings.flipX = Random() & 1; - InitAnimationForceUpdate(super, super->actionDelay + 0x1b); + InitAnimationForceUpdate(super, super->timer + 0x1b); } } } diff --git a/src/object/fairy.c b/src/object/fairy.c index 3289562c..76fdb2df 100644 --- a/src/object/fairy.c +++ b/src/object/fairy.c @@ -40,13 +40,13 @@ void Fairy(FairyEntity* this) { Fairy_Init, Fairy_Action1, Fairy_Action2, Fairy_Action3, Fairy_Action4, }; - if (((super->bitfield & 0x80) != 0)) { - switch (super->bitfield & 0x7f) { + if (((super->contactFlags & 0x80) != 0)) { + switch (super->contactFlags & 0x7f) { case 0x14: super->action = 3; super->flags &= ~ENT_COLLIDE; super->spriteSettings.draw = 1; - super->child = super->field_0x4c; + super->child = super->contactedEntity; break; case 0x1f: DeleteThisEntity(); @@ -84,7 +84,7 @@ void sub_0808D76C(FairyEntity* this) { void Fairy_SubAction0(FairyEntity* this) { super->subAction = 1; - super->field_0x1d = 1; + super->gustJarTolerance = 1; super->spriteSettings.draw = 1; } @@ -100,13 +100,13 @@ void Fairy_SubAction2(FairyEntity* this) { void Fairy_Init(FairyEntity* this) { super->collisionLayer = 3; - super->field_0x3c = 0x17; + super->collisionFlags = 0x17; super->hurtType = 0x49; super->hitType = 7; super->flags2 = 0x17; super->health = 0xff; super->hitbox = (Hitbox*)&gUnk_080FD1A8; - super->field_0x1c = 1; + super->gustJarFlags = 1; this->unk_74 = super->x.HALF.HI; this->unk_76 = super->y.HALF.HI; SetDefaultPriority(super, 6); @@ -132,13 +132,13 @@ void Fairy_Init(FairyEntity* this) { void Fairy_Action1(FairyEntity* this) { super->z.WORD -= 0xe000; if (super->frame != 0) { - if (super->actionDelay != 0) { + if (super->timer != 0) { this->unk_78 *= 0x1e; } else { this->unk_78 = 600; } super->action = 2; - super->field_0xf = 1; + super->subtimer = 1; super->speed = 0x80; } } @@ -150,10 +150,10 @@ void Fairy_Action2(FairyEntity* this) { 0, 0, }; - if (--super->field_0xf == 0) { + if (--super->subtimer == 0) { u32 rand = Random(); super->flags |= ENT_COLLIDE; - super->field_0xf = 0x20; + super->subtimer = 0x20; super->speed = (u16)gUnk_081217A4[rand >> 8 & 1]; if (sub_0808DAA0(this)) { super->direction = rand & 0x1f; @@ -192,27 +192,27 @@ void Fairy_Action4(FairyEntity* this) { s32 tmp; child = super->child; - tmp = gSineTable[super->actionDelay] * 0xa00; + tmp = gSineTable[super->timer] * 0xa00; if (tmp < 0) { tmp += 0xffff; } super->x.HALF.HI = (tmp >> 0x10) + child->x.HALF.HI; - tmp = gSineTable[super->actionDelay + 0x40] * 0x500; + tmp = gSineTable[super->timer + 0x40] * 0x500; if (tmp < 0) { tmp += 0xffff; } super->y.HALF.HI = child->y.HALF.HI - (tmp >> 0x10); - super->actionDelay += 8; + super->timer += 8; super->z.HALF.HI = child->z.HALF.HI; super->spriteOrientation.flipY = child->spriteOrientation.flipY; super->spriteRendering.b3 = child->spriteRendering.b3; - if ((u8)(super->actionDelay - 0x41) < 0x7f) { + if ((u8)(super->timer - 0x41) < 0x7f) { super->spritePriority.b0 = 3; } else { super->spritePriority.b0 = 5; } - if (--super->field_0xf == 0) { - super->field_0xf = 6; + if (--super->subtimer == 0) { + super->subtimer = 6; if (((--super->spriteOffsetY) * 0x1000000) >> 0x18 < -0x16) { sub_08081404(super, 1); } @@ -239,8 +239,8 @@ void sub_0808DAD0(FairyEntity* this) { DeleteThisEntity(); } super->action = 4; - super->actionDelay = 0x80; - super->field_0xf = 6; + super->timer = 0x80; + super->subtimer = 6; super->flags &= ~ENT_COLLIDE; super->spriteSettings.draw = 1; super->spritePriority.b1 = 2; diff --git a/src/object/fan.c b/src/object/fan.c index d372ff5c..51815c83 100644 --- a/src/object/fan.c +++ b/src/object/fan.c @@ -99,7 +99,7 @@ void sub_0809EE24(FanEntity* this) { void sub_0809EE34(FanEntity* this) { super->action = 1; - this->unk74 = super->actionDelay << 2; + this->unk74 = super->timer << 2; } void sub_0809EE44(FanEntity* this) { @@ -138,7 +138,7 @@ void sub_0809EE44(FanEntity* this) { break; break; case 0x4: - if (super->field_0xf != 0) + if (super->subtimer != 0) bVar3 = 1; break; case 0x11: @@ -215,18 +215,18 @@ void sub_0809EFB0(FanEntity* this) { } void sub_0809F08C(FanEntity* this) { - if (super->field_0xf != 0) { - super->field_0xf--; + if (super->subtimer != 0) { + super->subtimer--; } GetNextFrame(super); if (super->frame & 0x20) { super->frame &= ~0x20; - super->field_0xf = 20; + super->subtimer = 20; sub_0809F0E4(this); } else { - if ((super->frame & 0x10) && super->field_0xf == 0) { - super->field_0xf = 20; + if ((super->frame & 0x10) && super->subtimer == 0) { + super->subtimer = 20; super->frame ^= 0x10; sub_0809F0E4(this); } diff --git a/src/object/figurineDevice.c b/src/object/figurineDevice.c index a9efe80c..741548a7 100644 --- a/src/object/figurineDevice.c +++ b/src/object/figurineDevice.c @@ -82,7 +82,7 @@ void FigurineDevice_Init(FigurineDeviceEntity* this) { super->action = super->type + 1; switch (super->type) { case 0: - if (CheckLocalFlag(0x5e)) { + if (CheckLocalFlag(SHOP07_TANA)) { this->unk_7a = 1; sub_080787B4(super); } else { @@ -112,8 +112,8 @@ void FigurineDevice_Init(FigurineDeviceEntity* this) { InitializeAnimation(super, 1); break; case 3: - super->actionDelay = 0x1e; - super->field_0xf = 0; + super->timer = 0x1e; + super->subtimer = 0; this->unk_81 = 1; this->unk_7a = 0; this->unk_7b = 0; @@ -134,7 +134,7 @@ void FigurineDevice_Action1(FigurineDeviceEntity* this) { if (super->interactType != 0) { super->interactType = 0; ResetPlayerAnimationAndAction(); - if (CheckLocalFlag(0x5e)) { + if (CheckLocalFlag(SHOP07_TANA)) { this->unk_7a = 2; SetRoomFlag(2); MenuFadeIn(7, 0xff); @@ -160,7 +160,7 @@ void FigurineDevice_Action2(FigurineDeviceEntity* this) { switch (this->unk_7a) { case 0: if (CheckRoomFlag(0)) { - if (CheckLocalFlag(0x5e)) { + if (CheckLocalFlag(SHOP07_TANA)) { this->unk_7a = 1; } else { this->unk_7a = 2; @@ -168,7 +168,7 @@ void FigurineDevice_Action2(FigurineDeviceEntity* this) { } break; case 2: - SetLocalFlag(0x5e); + SetLocalFlag(SHOP07_TANA); case 1: this->unk_7a = 0; sub_08088328((FigurineDeviceEntity*)super->child); @@ -176,9 +176,9 @@ void FigurineDevice_Action2(FigurineDeviceEntity* this) { entity = CreateObject(FIGURINE_DEVICE, 2, 0); if (entity != NULL) { entity->parent = super; - entity->field_0xf = this->unk_7d; + entity->subtimer = this->unk_7d; ptr = (u8*)gUnk_080FC3E4; // FIXME use struct - entity->type2 = ptr[(entity->field_0xf << 3) + 7]; + entity->type2 = ptr[(entity->subtimer << 3) + 7]; PositionRelative(super, entity, 0x80000, 0x70000); } EnqueueSFX(SFX_111); @@ -199,7 +199,7 @@ void FigurineDevice_Action3(FigurineDeviceEntity* this) { case 0: if ((super->frame & ANIM_DONE) != 0) { this->unk_7a = 1; - super->actionDelay = 0x28; + super->timer = 0x28; ChangeObjPalette(super, gUnk_08120AA8[super->type2]); InitializeAnimation(super, 2); SoundReq(SFX_110); @@ -207,10 +207,10 @@ void FigurineDevice_Action3(FigurineDeviceEntity* this) { break; case 1: - if (((super->frame & ANIM_DONE) != 0) && (--super->actionDelay == 0)) { + if (((super->frame & ANIM_DONE) != 0) && (--super->timer == 0)) { this->unk_7a = 2; SetRoomFlag(2); - MenuFadeIn(7, super->field_0xf); + MenuFadeIn(7, super->subtimer); } break; case 2: @@ -248,13 +248,13 @@ void FigurineDevice_Action4(FigurineDeviceEntity* this) { } break; case 1: - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } if ((gInput.newKeys & 1) != 0) { SoundReq(SFX_TEXTBOX_SELECT); this->unk_7a = 2; - super->actionDelay = 0x3c; + super->timer = 0x3c; sub_08050384(); return; } @@ -322,31 +322,27 @@ void sub_08087F58(FigurineDeviceEntity* this) { ASM_FUNC("asm/non_matching/figurineDevice/sub_08087F94.inc", void sub_08087F94(FigurineDeviceEntity* this, s32 param_2)) void sub_08088034(FigurineDeviceEntity* this) { - if (super->actionDelay == 0) { - super->actionDelay = 0x14; + if (super->timer == 0) { + super->timer = 0x14; SoundReq(SFX_MENU_ERROR); } } void sub_0808804C(FigurineDeviceEntity* this) { u8 result = 0; - if (gSave.unk6 != 0) { + if (gSave.saw_staffroll) { result = 9; } else if (CheckGlobalFlag(LV5_CLEAR)) { result = 7; - } else if (CheckLocalFlagByBank(0x800, 0x77)) { + } else if (CheckLocalFlagByBank(FLAG_BANK_9, LV5_31_CAP_0)) { result = 6; - } else if (CheckLocalFlagByBank(0x300, 0x32)) { + } else if (CheckLocalFlagByBank(FLAG_BANK_3, OUBO_KAKERA)) { result = 5; } else if (CheckGlobalFlag(LV4_CLEAR)) { result = 4; } else if (CheckGlobalFlag(LV3_CLEAR)) { result = 3; -#if defined(JP) || defined(DEMO_JP) || defined(EU) - } else if (CheckLocalFlagByBank(0x100, 0x9b)) { -#else - } else if (CheckLocalFlagByBank(0x100, 0x9c)) { -#endif + } else if (CheckLocalFlagByBank(FLAG_BANK_1, SOUGEN_08_TORITSUKI)) { result = 2; } else if (CheckGlobalFlag(LV2_CLEAR)) { result = 1; @@ -374,8 +370,8 @@ void sub_080880D8(FigurineDeviceEntity* this) { } gSave.field_0x9[0] = this->unk_80; } - if (CheckLocalFlag(0x5f) && (this->unk_80 != gSave.stats.filler[0])) { - ClearLocalFlag(0x5f); + if (CheckLocalFlag(SHOP07_COMPLETE) && (this->unk_80 != gSave.stats.filler[0])) { + ClearLocalFlag(SHOP07_COMPLETE); } } } @@ -387,7 +383,7 @@ void sub_0808826C(FigurineDeviceEntity* this) { s32 tmp = 0x64; tmp *= ((this->unk_80 - gSave.stats.filler[0])); tmp = tmp / this->unk_80; - if (tmp == 0 && !CheckLocalFlag(0x5f)) { + if (tmp == 0 && !CheckLocalFlag(SHOP07_COMPLETE)) { tmp = 1; } this->unk_83 = tmp; @@ -463,7 +459,7 @@ void sub_08088478(void) { messageIndex = 0x4329; break; case 0x82: - if (gSave.unk6 != 0) { + if (gSave.saw_staffroll) { messageIndex = 0x4327; } else { messageIndex = 0x4328; @@ -521,7 +517,7 @@ void sub_08088574(void) { #else if (CheckRoomFlag(9)) { #endif - if (CheckLocalFlag(0x5f)) { + if (CheckLocalFlag(SHOP07_COMPLETE)) { index = 0x4313; } else { index = 0x430c; diff --git a/src/object/fileScreenObjects.c b/src/object/fileScreenObjects.c index c7cac4e7..9a00d152 100644 --- a/src/object/fileScreenObjects.c +++ b/src/object/fileScreenObjects.c @@ -163,7 +163,7 @@ void sub_0808E988(Entity* this) { } void sub_0808E9F4(Entity* this) { - if (sub_0808E950() && gSave.unk6) { + if (sub_0808E950() && gSave.saw_staffroll) { this->spriteSettings.draw = 2; } else { this->spriteSettings.draw = 0; @@ -294,7 +294,7 @@ void sub_0808EBB8(Entity* this) { case 0: break; case 1: - y = ((SaveHeader*)0x2000000)->language * 16 + 24; + y = gSaveHeader->language * 16 + 24; x = 112; break; case 2: @@ -394,8 +394,8 @@ void sub_0808ED98(Entity* this) { this->y.HALF.HI = y; this->field_0x6a.HWORD = y; - this->field_0xf++; - this->spriteOffsetY = gUnk_08121D10[(this->field_0xf / 4) & 0x7]; + this->subtimer++; + this->spriteOffsetY = gUnk_08121D10[(this->subtimer / 4) & 0x7]; sub_0808EF6C(this); } @@ -424,9 +424,9 @@ void nullsub_522(Entity* this) { } void sub_0808EE98(Entity* this) { - this->actionDelay = gUI.lastState; - this->frameIndex = gUnk_08121D48[this->actionDelay]; - if (this->actionDelay != 2) { + this->timer = gUI.lastState; + this->frameIndex = gUnk_08121D48[this->timer]; + if (this->timer != 2) { this->field_0x68.HWORD = 96; } else { this->field_0x68.HWORD = -96; diff --git a/src/object/fireplace.c b/src/object/fireplace.c index a4513cb8..5a86491a 100644 --- a/src/object/fireplace.c +++ b/src/object/fireplace.c @@ -27,7 +27,7 @@ void sub_0809B708(Entity* this) { void sub_0809B7A0(Entity* this) { sub_0809B7C0(this); - if (this->actionDelay) { + if (this->timer) { SetFlag(this->field_0x86.HWORD); DeleteThisEntity(); } @@ -43,5 +43,5 @@ void sub_0809B7C0(Entity* this) { void sub_0809B7DC(Entity* this) { sub_0807B7D8(0xc3 << 2, TILE(this->x.HALF.HI, this->y.HALF.HI), 2); SetTile(0x4062, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer); - this->actionDelay = 1; + this->timer = 1; } diff --git a/src/object/floatingPlatform.c b/src/object/floatingPlatform.c index 9701ba66..74ab1231 100644 --- a/src/object/floatingPlatform.c +++ b/src/object/floatingPlatform.c @@ -35,14 +35,14 @@ void sub_080860D8(FloatingPlatformEntity* this) { void sub_0808611C(FloatingPlatformEntity* this) { bool32 iVar2 = sub_08086168(this); - if (super->actionDelay != 0 && super->parent->actionDelay == 0) { + if (super->timer != 0 && super->parent->timer == 0) { if (iVar2) { - super->parent->actionDelay++; + super->parent->timer++; } sub_080A2BE4(super, iVar2); - } else if (super->actionDelay == 0) { + } else if (super->timer == 0) { sub_080A2BE4(super, iVar2); } else { sub_080A2BE4(super, FALSE); diff --git a/src/object/fourElements.c b/src/object/fourElements.c index 942cc485..8fd25f49 100644 --- a/src/object/fourElements.c +++ b/src/object/fourElements.c @@ -92,7 +92,7 @@ void FourElements_Action2(FourElementsEntity* this) { DeleteEntity(super->child); super->spriteSettings.draw = 0; super->action = 3; - super->actionDelay = 0x2d; + super->timer = 0x2d; gScreen.controls.layerFXControl = 0x640; gScreen.controls.alphaBlend = 0; InitItemGetSequence(super->type, 0, 1); @@ -106,9 +106,9 @@ void FourElements_Action2(FourElementsEntity* this) { } void FourElements_Action3(FourElementsEntity* this) { - if (super->actionDelay != 0) { + if (super->timer != 0) { sub_080A0424(this); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { SetDefaultPriority(&gPlayerEntity, 0); } } else { @@ -159,7 +159,7 @@ void sub_080A0444(FourElementsEntity* this) { static const u8 gUnk_081248B4[] = { 249, 248, 247, 246, 245, 246, 247, 248, }; - super->z.HALF.HI = gUnk_081248B4[(super->field_0xf++ >> 3) & 7] << 0x18 >> 0x18; + super->z.HALF.HI = gUnk_081248B4[(super->subtimer++ >> 3) & 7] << 0x18 >> 0x18; } void sub_080A0464(FourElementsEntity* this, ScriptExecutionContext* context) { diff --git a/src/object/frozenOctorok.c b/src/object/frozenOctorok.c index ea1ea894..100ec565 100644 --- a/src/object/frozenOctorok.c +++ b/src/object/frozenOctorok.c @@ -80,7 +80,7 @@ ASM_FUNC("asm/non_matching/frozenOctorok/FrozenOctorok_Action1.inc", void FrozenOctorok_Action1SubAction0(FrozenOctorokEntity* this) { Entity* child; - if (super->field_0xf != 0) { + if (super->subtimer != 0) { if (this->unk_7e == 0) { child = super->child; if (child->z.HALF.HI > -0x10) { @@ -108,7 +108,7 @@ void FrozenOctorok_Action1SubAction1(FrozenOctorokEntity* this) { obj->y.HALF.HI -= 0x50; gRoomControls.camera_target = obj; } - if (super->field_0xf < 3) { + if (super->subtimer < 3) { super->subAction = 2; this->unk_79 = 0x1e; SoundReq(SFX_THUD_HEAVY); @@ -124,7 +124,7 @@ void FrozenOctorok_Action1SubAction2(FrozenOctorokEntity* this) { if (this->unk_79-- == 0) { super->subAction = 1; this->unk_79 = 0x1e; - super->field_0xf++; + super->subtimer++; return; } switch (this->unk_79 & 3) { @@ -194,7 +194,7 @@ NONMATCH("asm/non_matching/frozenOctorok/FrozenOctorok_Action1SubAction5.inc", super->subAction = 6; super->speed = 0xc0; super->type2 = 0; - super->field_0xf = 0; + super->subtimer = 0; child = super->child; child->spriteSettings.draw = 0; this->heap->mouthObject->unk_76 = 0x100; @@ -257,14 +257,14 @@ void sub_0809CB70(FrozenOctorokEntity* this, s32 angle, s32 radius) { } NONMATCH("asm/non_matching/frozenOctorok/sub_0809CBE4.inc", void sub_0809CBE4(FrozenOctorokEntity* this)) { - this->unk_79 += super->field_0xf; - if ((s8)super->field_0xf < 0) { - if (super->actionDelay < -(this->unk_79 << 0x18 >> 0x18)) { - super->field_0xf = -super->field_0xf; + this->unk_79 += super->subtimer; + if ((s8)super->subtimer < 0) { + if (super->timer < -(this->unk_79 << 0x18 >> 0x18)) { + super->subtimer = -super->subtimer; SoundReq(SFX_19E); } - } else if ((s8)this->unk_79 > super->actionDelay) { - super->field_0xf = -super->field_0xf; + } else if ((s8)this->unk_79 > super->timer) { + super->subtimer = -super->subtimer; SoundReq(SFX_19E); } } diff --git a/src/object/frozenWaterElement.c b/src/object/frozenWaterElement.c index 953480c4..223f172c 100644 --- a/src/object/frozenWaterElement.c +++ b/src/object/frozenWaterElement.c @@ -77,7 +77,7 @@ void sub_0809BF74(FrozenWaterElementEntity* this) { s32 tmp2; if (--this->unk_74 == 0) { - (super->child)->field_0xf = 1; + (super->child)->subtimer = 1; sub_0809C23C(this); CheckFlags(0x9b); DeleteThisEntity(); diff --git a/src/object/furniture.c b/src/object/furniture.c index 5683156c..1e8770ac 100644 --- a/src/object/furniture.c +++ b/src/object/furniture.c @@ -259,23 +259,23 @@ static void FurnitureUpdate(FurnitureEntity* this) { } break; case 0x8: - if (++super->actionDelay == 16) { - super->actionDelay = 0; - super->field_0xf = (super->field_0xf + 1) & 3; + if (++super->timer == 16) { + super->timer = 0; + super->subtimer = (super->subtimer + 1) & 3; sub_08090E4C(this); } break; case 0x10: if (super->type != FORGE_HELPER) { - if (++super->actionDelay == 20) { + if (++super->timer == 20) { super->frameIndex = (super->frameIndex + 1) & 3; - super->actionDelay = 0; + super->timer = 0; } } else { - if (++super->actionDelay == 14) { - super->actionDelay = 0; - super->field_0xf = (super->field_0xf + 1) % 3; - super->frameIndex = super->field_0xf + 1; + if (++super->timer == 14) { + super->timer = 0; + super->subtimer = (super->subtimer + 1) % 3; + super->frameIndex = super->subtimer + 1; } } break; @@ -444,7 +444,7 @@ static void sub_08090DC4(FurnitureEntity* this) { static void sub_08090E4C(FurnitureEntity* this) { static const u32 sPalettes[] = { 0x5f, 0x60, 0x61, 0x62 }; - ChangeObjPalette(super, sPalettes[super->field_0xf]); + ChangeObjPalette(super, sPalettes[super->subtimer]); } void sub_08090E64(FurnitureEntity* this) { diff --git a/src/object/greatFairy.c b/src/object/greatFairy.c index ffbfe2a6..ab08f369 100644 --- a/src/object/greatFairy.c +++ b/src/object/greatFairy.c @@ -65,7 +65,7 @@ void GreatFairy_CallBehavior(Entity* this) { // Init void GreatFairy_Init(Entity* this) { GreatFairy_InitializeAnimation(this); - this->actionDelay = 0; + this->timer = 0; this->cutsceneBeh.HWORD = 290; } @@ -92,9 +92,9 @@ void GreatFairy_DormantUpdate(Entity* this) { case 289: ripple = GreatFairy_CreateForm(this, RIPPLE, 0); if (ripple) { - PositionRelative(this, ripple, Q_16_16(GreatFairy_RippleOffsets[this->actionDelay]), - Q_16_16(GreatFairy_RippleOffsets[this->actionDelay + 1])); - this->actionDelay += 2; + PositionRelative(this, ripple, Q_16_16(GreatFairy_RippleOffsets[this->timer]), + Q_16_16(GreatFairy_RippleOffsets[this->timer + 1])); + this->timer += 2; break; } } @@ -122,7 +122,7 @@ void GreatFairy_SpawningUpdate(Entity* this) { SetFade(6, 4); SoundReq(SFX_145); this->action = 4; - this->actionDelay = 60; + this->timer = 60; this->spriteSettings.draw = 1; } } @@ -132,15 +132,15 @@ void GreatFairy_MiniUpdate(Entity* this) { Entity* target; GetNextFrame(this); - if (this->actionDelay != 0) { - --this->actionDelay; + if (this->timer != 0) { + --this->timer; } else { target = GreatFairy_CreateForm(this, WINGS, 0); if (target != NULL) { PositionRelative(this, target, 0, Q_16_16(-20.0)); this->action = 5; - this->actionDelay = 120; - this->field_0xf = 0; + this->timer = 120; + this->subtimer = 0; } } } @@ -149,13 +149,13 @@ void GreatFairy_MiniUpdate(Entity* this) { void GreatFairy_FinalUpdate(Entity* this) { Entity* target; - if (this->actionDelay != 0) { - --this->actionDelay; + if (this->timer != 0) { + --this->timer; } else { - if ((this->field_0xf == 0) && (target = GreatFairy_CreateForm(this, FORM9, 0), target != NULL)) { + if ((this->subtimer == 0) && (target = GreatFairy_CreateForm(this, FORM9, 0), target != NULL)) { PositionRelative(this, target, 0, Q_16_16(-76.0)); target->parent = this; - this->field_0xf = 1; + this->subtimer = 1; } } GetNextFrame(this); @@ -220,7 +220,7 @@ void GreatFairy_MiniInit(Entity* this) { aff->parent = this; GreatFairy_InitializeAnimation(this); this->spriteSettings.draw = 1; - this->field_0xf = 0; + this->subtimer = 0; } } @@ -234,10 +234,10 @@ void GreatFairy_MiniRisingUpdate(Entity* this) { this->action = 2; SoundReq(SFX_HEART_CONTAINER_SPAWN); } else { - if (((this->z.HALF.HI == -10) && (this->field_0xf == 0)) && + if (((this->z.HALF.HI == -10) && (this->subtimer == 0)) && (target = GreatFairy_CreateForm(this, DROPLET, 0), target != NULL)) { PositionRelative(this, target, 0, Q_16_16(4.0)); - this->field_0xf = 1; + this->subtimer = 1; } } } @@ -270,7 +270,7 @@ void GreatFairy_MiniAffineInit2(Entity* this) { if (this->z.HALF.HI == -20) { this->action = 2; - this->actionDelay = 90; + this->timer = 90; this->speed = 4096; this->spriteRendering.b0 = 3; SetAffineInfo(this, 256, 256, 0); @@ -279,7 +279,7 @@ void GreatFairy_MiniAffineInit2(Entity* this) { // Mini great fairy stretch void GreatFairy_MiniAffineUpdate(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { gRoomVars.animFlags |= 1; this->action = 3; sub_0805EC60(this); @@ -335,7 +335,7 @@ void GreatFairy_BigRippleCallBehavior(Entity* this) { void GreatFairy_BigRippleInit(Entity* this) { GreatFairy_InitializeAnimation(this); - this->actionDelay = 120; + this->timer = 120; this->spriteSettings.draw = 1; this->spritePriority.b0 = 5; SoundReq(SFX_TELEPORTER); @@ -345,8 +345,8 @@ void GreatFairy_BigRippleUpdate(Entity* this) { Entity* target; GetNextFrame(this); - if (this->actionDelay != 0) { - --this->actionDelay; + if (this->timer != 0) { + --this->timer; } else { target = GreatFairy_CreateForm(this, MINI, 0); if (target != NULL) { @@ -400,15 +400,15 @@ void nullsub_516(Entity* this) { } void sub_080871A8(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; - this->actionDelay = 60; + this->timer = 60; gRoomVars.animFlags |= 4; } } void sub_080871D0(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { gRoomVars.animFlags |= 8; DeleteEntity(this); } @@ -428,20 +428,20 @@ void sub_080871F8(Entity* this) { void sub_08087240(Entity* this) { if (gRoomVars.animFlags & 4) { this->action = 3; - this->actionDelay = 20; + this->timer = 20; this->direction = 16; } } void sub_08087264(Entity* this) { - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; LinearMoveUpdate(this); } } void sub_0808727C(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteEntity(this); } } @@ -471,9 +471,9 @@ void sub_080872F8(Entity* this) { (s16)this->field_0x6a.HWORD); this->direction = (this->direction + gUnk_081207AC[Random() & 3]) & 0x1f; } - temp = gSineTable[this->actionDelay + 64]; + temp = gSineTable[this->timer + 64]; this->z.HALF.HI = (temp >> 6) - 8; - this->actionDelay++; + this->timer++; } void GreatFairy_InitializeAnimation(Entity* this) { @@ -500,13 +500,13 @@ Entity* GreatFairy_CreateForm(Entity* this, u32 curForm, u32 parameter) { void sub_080873D0(Entity* this) { Entity* ent; - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; } else { ent = GreatFairy_CreateForm(this, 8, 0); if (ent != NULL) { CopyPosition(this, ent); - this->actionDelay = 48; + this->timer = 48; } } } diff --git a/src/object/gyorgBossObject.c b/src/object/gyorgBossObject.c index ebbec424..b0f0920b 100644 --- a/src/object/gyorgBossObject.c +++ b/src/object/gyorgBossObject.c @@ -120,7 +120,7 @@ void GyorgBossObject_FemalePhase1(GyorgBossObjectEntity* this) { if (((GyorgHeap*)super->myHeap)->female->base.health == 0) { // start male phase 1 super->action = 3; - super->actionDelay = 0x23; + super->timer = 0x23; this->unk_6c = 1; this->unk_78 = 0x400; this->unk_7b = 1; @@ -156,7 +156,7 @@ void GyorgBossObject_FemalePhase2(GyorgBossObjectEntity* this) { // start male phase 2 ((GyorgHeap*)super->myHeap)->male1->base.health = 12; super->action = 5; - super->actionDelay = 0x23; + super->timer = 0x23; this->unk_6c = 2; this->unk_78 = 0x400; this->unk_7b = 1; @@ -191,7 +191,7 @@ void GyorgBossObject_FemalePhase3(GyorgBossObjectEntity* this) { // start male phase 3 ((GyorgHeap*)super->myHeap)->male2->base.health = 12; super->action = 7; - super->actionDelay = 0x23; + super->timer = 0x23; this->unk_6c = 0x104; this->unk_78 = 0x400; SoundReq(SFX_BOSS_DIE); @@ -227,8 +227,8 @@ void GyorgBossObject_FemalePhase4(GyorgBossObjectEntity* this) { gRoomTransition.field_0x39 = 0; if (sub_08079F8C() && gPlayerEntity.z.HALF.HI == 0) { super->action = 9; - super->actionDelay = 0; - super->field_0xf = 0xF0; + super->timer = 0; + super->subtimer = 0xF0; this->timer = 0x1a4; super->direction = 0; super->speed = 0x60; @@ -246,12 +246,12 @@ void GyorgBossObject_FightEnd(GyorgBossObjectEntity* this) { if (this->timer == 0) { LinearMoveUpdate(super); sub_080A1E54(this); - if (--super->field_0xf == 0) { + if (--super->subtimer == 0) { SetFlag(0x7B); sub_0808091C(&gUnk_0813ABD0, 8); return; } - if (super->field_0xf == 0x3C) { + if (super->subtimer == 0x3C) { SetFade(7, 4); } return; @@ -350,7 +350,7 @@ void sub_080A1DCC(GyorgBossObjectEntity* this) { void sub_080A1E54(GyorgBossObjectEntity* this) { Entity* fx; - if ((++super->actionDelay & 0x1F) == 0) { + if ((++super->timer & 0x1F) == 0) { fx = CreateFx(super, FX_GIANT_EXPLOSION4, 0); if (fx) { u32 r = Random(); @@ -444,9 +444,9 @@ void GyorgBossObject_SpawnChildren(u32 unk0, bool32 fromBlue, u32 animationState } void sub_080A1FF0(GyorgBossObjectEntity* this) { - if (super->actionDelay != 0) { - super->actionDelay--; - if (super->actionDelay <= 0x20 && (super->actionDelay & 0xF) == 0) { + if (super->timer != 0) { + super->timer--; + if (super->timer <= 0x20 && (super->timer & 0xF) == 0) { Entity* fx; fx = CreateFx(super, FX_GIANT_EXPLOSION4, 0); if (fx) { @@ -462,10 +462,10 @@ void sub_080A1FF0(GyorgBossObjectEntity* this) { if (this->unk_7b) { if (EntityWithinDistance(&gPlayerEntity, gRoomControls.origin_x + 0x200, gRoomControls.origin_y + 0x210, 0x100)) { - if (super->actionDelay == 0) { - super->actionDelay = 0x78; + if (super->timer == 0) { + super->timer = 0x78; } else { - if (super->actionDelay == 0x23) { + if (super->timer == 0x23) { InitScreenShake(0x1e, 0); } } diff --git a/src/object/heartContainer.c b/src/object/heartContainer.c index 421990cb..89f7cc8e 100644 --- a/src/object/heartContainer.c +++ b/src/object/heartContainer.c @@ -44,13 +44,13 @@ static void sub_0808E6E4(Entity* this) { } static void sub_0808E714(Entity* this) { - int var0 = 0x400 - this->field_0xf * 8; + int var0 = 0x400 - this->subtimer * 8; if (var0 > 0x100) { - this->field_0xf++; + this->subtimer++; SetAffineInfo(this, var0, var0, 0); } else { this->action = 3; - this->field_0x3c |= 0x10; + this->collisionFlags |= 0x10; sub_0805EC60(this); SoundReq(SFX_HEART_CONTAINER_SPAWN); } diff --git a/src/object/hittableLever.c b/src/object/hittableLever.c index 401e9671..293035a8 100644 --- a/src/object/hittableLever.c +++ b/src/object/hittableLever.c @@ -33,7 +33,7 @@ void HittableLever(HittableLeverEntity* this) { void HittableLever_Init(HittableLeverEntity* this) { super->action = 1; super->flags |= ENT_COLLIDE; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hitType = 0x8f; super->flags2 = 0xa; super->hitbox = (Hitbox*)&HittableLever_Hitbox; @@ -50,7 +50,7 @@ void HittableLever_Init(HittableLeverEntity* this) { } void HittableLever_Idle(HittableLeverEntity* this) { - if (((super->bitfield & 0x80) != 0) && (this->wasHit == 0)) { + if (((super->contactFlags & 0x80) != 0) && (this->wasHit == 0)) { this->wasHit = 1; super->type ^= 1; super->iframes = -0x18; diff --git a/src/object/houseDoorExterior.c b/src/object/houseDoorExterior.c index baadd362..828497e4 100644 --- a/src/object/houseDoorExterior.c +++ b/src/object/houseDoorExterior.c @@ -43,7 +43,7 @@ void sub_080866D8(Entity* this) { if (this->action == 0) { this->action = 1; *((u32*)(&this->field_0x68)) = 0; - this->field_0x6c.HALF.LO = this->actionDelay; + this->field_0x6c.HALF.LO = this->timer; SetDefaultPriority(this, PRIO_PLAYER_EVENT); } @@ -94,7 +94,7 @@ void sub_0808681C(Entity* this) { switch (this->action) { case 0: this->action = 1; - this->actionDelay = 8; + this->timer = 8; this->spriteSettings.draw = 1; this->frameIndex = 0; this->hitbox = &gUnk_081206AC; @@ -127,7 +127,7 @@ void sub_080868B0(Entity* this) { this->action = 1; this->spriteSettings.draw = 1; this->hitbox = &gUnk_081206AC; - this->actionDelay = 8; + this->timer = 8; } ExecuteScript(this, *(ScriptExecutionContext**)&this->cutsceneBeh); sub_080868EC(this, *(void**)&this->cutsceneBeh); @@ -159,25 +159,25 @@ void sub_0808692C(Entity* this) { this->type2 = 2; this->action = (this->frameIndex == 0) ? 1 : 2; this->subAction = 0; - this->actionDelay = 8; + this->timer = 8; } static u8 sub_08086954(Entity* this) { if (sub_0800445C(this)) { if (GetAnimationStateInRectRadius(this, 6, 20) >= 0 && gPlayerEntity.animationState == 0 && (u16)gPlayerState.field_0x90 == 0x400 && gPlayerState.jump_status == 0) { - this->actionDelay--; + this->timer--; } } else { - this->actionDelay = 8; + this->timer = 8; } - return this->actionDelay; + return this->timer; } void sub_080869A4(Entity* this, ScriptExecutionContext* context) { context->condition = 0; if (!sub_08086954(this)) { - this->actionDelay = 8; + this->timer = 8; context->condition = 1; } } diff --git a/src/object/houseDoorInterior.c b/src/object/houseDoorInterior.c index 6ca11ef6..ae0a247e 100644 --- a/src/object/houseDoorInterior.c +++ b/src/object/houseDoorInterior.c @@ -61,10 +61,10 @@ void HouseDoorInterior_Init(HouseDoorInteriorEntity* this) { } super->action = 1; super->spriteSettings.draw = 1; - this->unk7d = super->actionDelay; + this->unk7d = super->timer; super->spritePriority.b0 = 7; super->hitbox = (Hitbox*)&HouseDoorInteriorHitbox; - super->actionDelay = 8; + super->timer = 8; ptr = HouseDoorInteriorFrameIndices + super->type; if (ptr->frameIndex == 0xff) { super->frameIndex = super->type2; @@ -87,13 +87,13 @@ void HouseDoorInterior_Action1(HouseDoorInteriorEntity* this) { ptr = gUnk_081227CC + super->type2; if (GetAnimationStateInRectRadius(super, ptr->x, ptr->y) >= 0 && ptr->animationState == gPlayerEntity.animationState && gPlayerState.field_0x90 & ptr->unk2) { - --super->actionDelay; + --super->timer; } } else { - super->actionDelay = 8; + super->timer = 8; } - if (super->actionDelay == 0) { + if (super->timer == 0) { super->action = 2; sub_08078AC0(8, 0, 0); SoundReq(SFX_111); diff --git a/src/object/itemForSale.c b/src/object/itemForSale.c index c119010f..2718a209 100644 --- a/src/object/itemForSale.c +++ b/src/object/itemForSale.c @@ -23,7 +23,7 @@ typedef struct { typedef struct { u8 before[0x20]; - u8 unk_20[0x4]; // TODO for Entity this is zVelocity which is not an array. spriteAnimation[super->field_0xf-6] does + u8 unk_20[0x4]; // TODO for Entity this is zVelocity which is not an array. spriteAnimation[super->subtimer-6] does // not match. } ModifiedParentEntity; @@ -49,7 +49,7 @@ void ItemForSale(ItemForSaleEntity* this) { if (CheckOnScreen(super)) { sub_08080CB4(super); } - switch (super->actionDelay) { + switch (super->timer) { case 1: case 2: if (super->action == 1) { @@ -66,13 +66,13 @@ void ItemForSale_Init(ItemForSaleEntity* this) { super->action = 1; super->spriteSettings.draw = 1; super->spritePriority.b1 = 0; - super->field_0x16 = 0; + super->carryFlags = 0; #ifdef EU SetDefaultPriority(super, 6); #endif super->child = super; sub_08081A5C(this); - switch (super->actionDelay) { + switch (super->timer) { case 0: super->hitbox = (Hitbox*)&gUnk_080FD328; break; @@ -133,7 +133,7 @@ void sub_080819B4(ItemForSaleEntity* this) { if (gRoomVars.shopItemType == 0) { if (super->parent != NULL) { - ((ModifiedParentEntity*)super->parent)->unk_20[super->field_0xf] = 0xff; + ((ModifiedParentEntity*)super->parent)->unk_20[super->subtimer] = 0xff; } DeleteThisEntity(); } @@ -158,7 +158,7 @@ void sub_080819B4(ItemForSaleEntity* this) { void sub_08081A5C(ItemForSaleEntity* this) { u32 tmp = sub_080787D8(super); - if (super->actionDelay == 1) { + if (super->timer == 1) { gUnk_03003DF0.array[tmp].unk_2 = 0; } } diff --git a/src/object/itemOnGround.c b/src/object/itemOnGround.c index b4683933..b356c38a 100644 --- a/src/object/itemOnGround.c +++ b/src/object/itemOnGround.c @@ -35,14 +35,14 @@ typedef struct { extern const Unk_0811E84C gUnk_0811E84C[]; void ItemOnGround(Entity* this) { - if (this->bitfield & 0x80) { - switch (this->bitfield & 0x7F) { + if (this->contactFlags & 0x80) { + switch (this->contactFlags & 0x7F) { case 20: this->action = 3; COLLISION_OFF(this); this->spriteSettings.draw = 1; - this->field_0x3c |= 0x10; - this->child = this->field_0x4c; + this->collisionFlags |= 0x10; + this->child = this->contactedEntity; break; case 0: case 1: @@ -83,7 +83,7 @@ void sub_08080F20(Entity* this) { this->spritePriority.b1 = 3; this->spriteSettings.shadow = 0; this->hitType = 7; - this->field_0x3c = 0x47; + this->collisionFlags = 0x47; this->hurtType = 0x44; this->health = 0xFF; this->hitbox = (Hitbox*)&gUnk_080FD1A8; @@ -105,19 +105,19 @@ void sub_08080F20(Entity* this) { break; } - this->field_0x68.HALF.HI = this->actionDelay; + this->field_0x68.HALF.HI = this->timer; this->field_0x6a.HALF.LO = 0; this->field_0x6c.HWORD = 0; this->field_0x68.HALF.LO = 0; - this->actionDelay = 0; + this->timer = 0; SetDefaultPriority(this, PRIO_NO_BLOCK); - this->field_0x1c = sub_0808147C(this->type); + this->gustJarFlags = sub_0808147C(this->type); gUnk_0811E7E8[this->field_0x68.HALF.HI](this); } else { Entity* entity = CreateObject(FAIRY, 0x60, 0); if (entity != NULL) { - entity->actionDelay = 0; - if (this->actionDelay == 1) { + entity->timer = 0; + if (this->timer == 1) { entity->type2 = 2; } CopyPosition(this, entity); @@ -286,7 +286,7 @@ void sub_08081328(Entity* this) { } void sub_0808136C(Entity* this) { - if (--this->actionDelay) { + if (--this->timer) { Entity* other = this->child; this->x.WORD = other->x.WORD; this->y.WORD = other->y.WORD; @@ -304,7 +304,7 @@ void sub_080813BC(Entity* this) { void sub_080813D4(Entity* this) { this->subAction = 1; - this->field_0x1d = 1; + this->gustJarTolerance = 1; this->spriteSettings.draw = 1; } @@ -417,7 +417,7 @@ void sub_08081598(Entity* this) { COLLISION_OFF(this); this->action = 4; - this->actionDelay = 14; + this->timer = 14; this->zVelocity = Q_16_16(2.0); this->spriteSettings.draw = 1; this->spritePriority.b1 = 2; diff --git a/src/object/jarPortal.c b/src/object/jarPortal.c index adcd258f..355a6b78 100644 --- a/src/object/jarPortal.c +++ b/src/object/jarPortal.c @@ -18,7 +18,7 @@ void JarPortal(Entity* this) { void sub_0808BE9C(Entity* this) { COLLISION_ON(this); this->hitType = 1; - this->field_0x3c = 0x47; + this->collisionFlags = 0x47; this->hurtType = 0x44; this->flags2 = 0x80; this->field_0x68.HALF.LO = 0; @@ -75,7 +75,7 @@ void sub_0808BF58(Entity* this) { UpdateAnimationSingleFrame(this); if (!this->z.HALF.HI) { ++this->action; - this->field_0xf = 0; + this->subtimer = 0; InitAnimationForceUpdate(this, 1); sub_0808C148(this, 1); } @@ -115,8 +115,8 @@ void sub_0808C01C(Entity* this, u32 r1) { } } CreateMagicSparkles(this->x.HALF.HI, this->y.HALF.HI, this->collisionLayer); - if (this->field_0xf == 0) { - this->field_0xf = 1; + if (this->subtimer == 0) { + this->subtimer = 1; SoundReq(SFX_NEAR_PORTAL); } } @@ -151,7 +151,7 @@ void sub_0808C0AC(Entity* this) { } u32 sub_0808C128(Entity* this) { - return this->bitfield == 157; + return this->contactFlags == 157; } void sub_0808C13C(Entity* this) { diff --git a/src/object/keyStealingTakkuri.c b/src/object/keyStealingTakkuri.c index 76fd3480..d1dc56bf 100644 --- a/src/object/keyStealingTakkuri.c +++ b/src/object/keyStealingTakkuri.c @@ -61,8 +61,8 @@ void KeyStealingTakkuri_Type0_Init(KeyStealingTakkuriEntity* this) { Entity* entity; super->action++; super->collisionLayer = 1; - super->actionDelay = 0x1e; - super->field_0xf = 0; + super->timer = 0x1e; + super->subtimer = 0; super->spriteRendering.b3 = 1; super->speed = 0; super->direction = 0x18; @@ -78,7 +78,7 @@ void KeyStealingTakkuri_Type0_Init(KeyStealingTakkuriEntity* this) { } void KeyStealingTakkuri_Type0_Action1(KeyStealingTakkuriEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action++; super->y.WORD += 0x100000; super->z.WORD -= 0x100000; @@ -92,8 +92,8 @@ 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->actionDelay = 0x10; - super->field_0xf = 1; + super->timer = 0x10; + super->subtimer = 1; InitAnimationForceUpdate(super, 2); } UpdateAnimationSingleFrame(super); @@ -101,8 +101,8 @@ void KeyStealingTakkuri_Type0_Action2(KeyStealingTakkuriEntity* this) { void KeyStealingTakkuri_Type0_Action3(KeyStealingTakkuriEntity* this) { sub_0809E1C8(this, sub_080045B4(super, gRoomControls.origin_x + 0x78, gRoomControls.origin_y + 0xa8)); - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; super->speed -= 0x80; } sub_0809E1F0(this); @@ -141,7 +141,7 @@ void KeyStealingTakkuri_Type1_Action1(KeyStealingTakkuriEntity* this) { if (parent->next == NULL) { DeleteThisEntity(); } - if (parent->field_0xf != 0) { + if (parent->subtimer != 0) { PositionRelative(parent, super, 0, 0x80000); } super->spriteSettings.draw = parent->spriteSettings.draw; @@ -160,15 +160,15 @@ void KeyStealingTakkuri_Type5_Init(KeyStealingTakkuriEntity* this) { super->direction = 0x18; super->speed = 0x100; super->zVelocity = 0x20000; - super->actionDelay = 1; + super->timer = 1; SoundReq(SFX_RUPEE_BOUNCE); } void KeyStealingTakkuri_Type5_Action1(KeyStealingTakkuriEntity* this) { LinearMoveUpdate(super); if (sub_080044EC(super, 0x2000) < 2) { - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; super->zVelocity = 0x10000; } else { super->action++; @@ -189,8 +189,8 @@ void KeyStealingTakkuri_Type2_Init(KeyStealingTakkuriEntity* this) { super->action++; super->collisionLayer = 2; - super->actionDelay = 0x1e; - super->field_0xf = 1; + super->timer = 0x1e; + super->subtimer = 1; super->spriteRendering.b3 = 1; super->speed = 0; super->direction = 0x18; @@ -213,7 +213,7 @@ void KeyStealingTakkuri_Type2_Init(KeyStealingTakkuriEntity* this) { } void KeyStealingTakkuri_Type2_Action1(KeyStealingTakkuriEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action++; SoundReq(SFX_146); } @@ -236,7 +236,7 @@ void KeyStealingTakkuri_Type2_Action3(KeyStealingTakkuriEntity* this) { this->unk_6e += 8; if (--this->unk_6c == 0) { super->action++; - super->actionDelay = 0x1e; + super->timer = 0x1e; super->spriteSettings.flipX = 0; } else { sub_0809E238(this); @@ -246,7 +246,7 @@ void KeyStealingTakkuri_Type2_Action3(KeyStealingTakkuriEntity* this) { } void KeyStealingTakkuri_Type2_Action4(KeyStealingTakkuriEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action++; SoundReq(SFX_15B); } @@ -276,8 +276,8 @@ void KeyStealingTakkuri_Type3_Init(KeyStealingTakkuriEntity* this) { super->action++; super->collisionLayer = 2; - super->actionDelay = 0xa; - super->field_0xf = 0; + super->timer = 0xa; + super->subtimer = 0; super->spriteRendering.b3 = 1; super->speed = 0; super->direction = gUnk_0812412D[super->type2]; @@ -306,7 +306,7 @@ void KeyStealingTakkuri_Type3_Action1(KeyStealingTakkuriEntity* this) { switch (sub_0809E2C4(this, super->type2)) { case 1: super->action += 2; - super->actionDelay = 0xff; + super->timer = 0xff; InitAnimationForceUpdate(super, super->animIndex + 2); SoundReq(SFX_123); child = super->child; @@ -320,17 +320,17 @@ void KeyStealingTakkuri_Type3_Action1(KeyStealingTakkuriEntity* this) { } break; case 2: - if (super->actionDelay == 0) { + if (super->timer == 0) { super->action++; InitAnimationForceUpdate(super, super->animIndex + 2); SoundReq(SFX_123); SoundReq(SFX_1F3); } else { - super->actionDelay--; + super->timer--; } break; default: - super->actionDelay = 0xa; + super->timer = 0xa; break; } UpdateAnimationSingleFrame(super); @@ -342,7 +342,7 @@ void KeyStealingTakkuri_Type3_Action2(KeyStealingTakkuriEntity* this) { child = super->child; if ((child != NULL) && ((((child->x.HALF.HI - super->x.HALF.HI) ^ super->direction << 0xb) & 0x8000) != 0)) { super->action++; - super->field_0xf = 1; + super->subtimer = 1; SoundReq(SFX_102); } KeyStealingTakkuri_Type3_Action3(this); @@ -357,7 +357,7 @@ void KeyStealingTakkuri_Type3_Action3(KeyStealingTakkuriEntity* this) { if (child != NULL) { child->parent = NULL; } - tmp = super->actionDelay & 0x80; + tmp = super->timer & 0x80; if (tmp != 0) { DeleteThisEntity(); } else { @@ -394,7 +394,7 @@ void sub_0809E0A0(KeyStealingTakkuriEntity* this) { if (obj != NULL) { obj->parent = super; super->child = obj; - super->field_0xf = 0; + super->subtimer = 0; CopyPosition(&gPlayerEntity, obj); obj->z.HALF.HI = 0xfff8; } @@ -446,7 +446,7 @@ void sub_0809E0D4(KeyStealingTakkuriEntity* this, ScriptExecutionContext* contex if ((varX3 < 1) && (varY3 < 1)) { super->x.HALF.HI = varX; super->y.HALF.HI = varY; - super->field_0xf = 1; + super->subtimer = 1; SoundReq(SFX_102); } else { gActiveScriptInfo.commandSize = 0; diff --git a/src/object/ladderUp.c b/src/object/ladderUp.c index d45dd1f9..98a3b01a 100644 --- a/src/object/ladderUp.c +++ b/src/object/ladderUp.c @@ -12,7 +12,7 @@ void LadderUp(Entity* this) { switch (this->action) { case 0: - if (this->actionDelay) { + if (this->timer) { uVar4 = 1; } else { #ifndef EU @@ -43,13 +43,13 @@ void LadderUp(Entity* this) { SoundReq(SFX_10B); this->action = 2; #ifndef EU - this->actionDelay = 0x3c; + this->timer = 0x3c; #endif } break; case 2: #ifndef EU - if (--this->actionDelay) { + if (--this->timer) { return; } this->action = 3; diff --git a/src/object/lavaPlatform.c b/src/object/lavaPlatform.c index 56338844..830ba02e 100644 --- a/src/object/lavaPlatform.c +++ b/src/object/lavaPlatform.c @@ -105,7 +105,7 @@ void sub_08092344(LavaPlatformEntity* this) { LavaPlatform_Type1Init, LavaPlatform_Type1Action1, LavaPlatform_Type1Action2, LavaPlatform_Type1Action3, LavaPlatform_Type1Action4, LavaPlatform_Type1Action5, LavaPlatform_Type1Action6, LavaPlatform_Type1Action7, }; - super->field_0xf = 0; + super->subtimer = 0; LavaPlatform_Type1Actions[super->action](this); sub_080926E4(this); } @@ -114,7 +114,7 @@ void LavaPlatform_Type1Init(LavaPlatformEntity* this) { super->animationState = super->type2; super->spritePriority.b0 = 7; super->hurtType = 0x48; - super->field_0x3c = 7; + super->collisionFlags = 7; super->flags2 = 0x81; super->hitbox = (Hitbox*)&gUnk_080FD280; sub_0809264C(this); @@ -134,13 +134,13 @@ void LavaPlatform_Type1Action1(LavaPlatformEntity* this) { } void LavaPlatform_Type1Action2(LavaPlatformEntity* this) { - if (super->bitfield == 0x9d) { + if (super->contactFlags == 0x9d) { sub_08092620(this); } else { if (LavaPlatform_IsPlayerOnPlatform(this)) { super->action = 3; super->flags &= ~ENT_COLLIDE; - super->actionDelay = 0x14; + super->timer = 0x14; gPlayerState.field_0x3f = 0xfd; } } @@ -151,7 +151,7 @@ void LavaPlatform_Type1Action3(LavaPlatformEntity* this) { if (LavaPlatform_IsPlayerOnPlatform(this)) { gPlayerState.field_0x3f = 0xfd; } - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 4; this->timer = this->wobbleTime; super->spriteOffsetY = 0; @@ -226,7 +226,7 @@ void LavaPlatform_Type1Action6(LavaPlatformEntity* this) { } void LavaPlatform_Type1Action7(LavaPlatformEntity* this) { - if (super->bitfield == 0x9d) { + if (super->contactFlags == 0x9d) { sub_08092620(this); } } @@ -285,7 +285,7 @@ bool32 LavaPlatform_IsPlayerOnPlatform(LavaPlatformEntity* this) { sub_08079F8C()) { gPlayerState.field_0x14 = 1; if (gPlayerEntity.z.HALF.HI == 0) { - super->field_0xf = 1; + super->subtimer = 1; return TRUE; } } @@ -294,7 +294,7 @@ bool32 LavaPlatform_IsPlayerOnPlatform(LavaPlatformEntity* this) { } void sub_080926E4(LavaPlatformEntity* this) { - sub_080A2BE4(super, super->field_0xf); + sub_080A2BE4(super, super->subtimer); if (super->action == 1) { (super->parent)->x.HALF.HI = super->x.HALF.HI; (super->parent)->y.HALF.HI = super->y.HALF.HI; diff --git a/src/object/lightableSwitch.c b/src/object/lightableSwitch.c index ec5fdad5..dcf5ca1e 100644 --- a/src/object/lightableSwitch.c +++ b/src/object/lightableSwitch.c @@ -24,7 +24,7 @@ void sub_0809EA34(Entity* this) { this->action = 1; COLLISION_ON(this); this->frameIndex = 0; - this->field_0x3c = 7; + this->collisionFlags = 7; this->hurtType = 0x48; this->hitType = 0x28; this->flags2 = 10; @@ -36,7 +36,7 @@ void sub_0809EA34(Entity* this) { void sub_0809EA80(Entity* this) { - if ((this->bitfield & 0x80) != 0) { + if ((this->contactFlags & 0x80) != 0) { if (CheckFlags(this->field_0x86.HWORD) != 0) { ClearFlag(this->field_0x86.HWORD); } else { @@ -96,7 +96,7 @@ void sub_0809EB80(Entity* this) { this->action = 1; COLLISION_ON(this); this->frameIndex = 3; - this->field_0x3c = 7; + this->collisionFlags = 7; this->hurtType = 0x48; this->hitType = 0x28; this->flags2 = 10; @@ -110,9 +110,9 @@ void sub_0809EB80(Entity* this) { } void sub_0809EBD8(Entity* this) { - if ((this->bitfield & 0x80) != 0) { + if ((this->contactFlags & 0x80) != 0) { this->action = 2; - this->actionDelay = 0x10; + this->timer = 0x10; this->frameIndex = 2; SetFlag(this->field_0x86.HWORD); EnqueueSFX(SFX_110); @@ -125,7 +125,7 @@ void sub_0809EC08(Entity* this) { this->action = 3; } else { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; this->frameIndex = 3; ClearFlag(this->field_0x86.HWORD); diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c index 845fa697..241ee9de 100644 --- a/src/object/lilypadLarge.c +++ b/src/object/lilypadLarge.c @@ -66,11 +66,11 @@ void sub_08085504(LilypadLargeEntity* this) { } } } - if (super->actionDelay != 0) { + if (super->timer != 0) { if (sub_080040A2(super) == 0) { DeleteThisEntity(); } - super->actionDelay = 0; + super->timer = 0; } else { if (EntityHasDuplicateID(super) != 0) { DeleteThisEntity(); @@ -81,7 +81,7 @@ void sub_08085504(LilypadLargeEntity* this) { super->spritePriority.b0 = 6; super->hitbox = &gUnk_08120640; super->flags |= ENT_COLLIDE; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hitType = 1; super->flags2 = 4; this->unk_78.WORD = 0x1000000; @@ -172,13 +172,13 @@ void sub_08085B40(LilypadLargeEntity* this) { ResetCollisionLayer(&gPlayerEntity); sub_08085F1C(this); super->action = 1; - super->field_0xf = 4; - while (super->field_0xf != 0) { + super->subtimer = 4; + while (super->subtimer != 0) { sub_080A2AF4(super, 8, 10); - super->field_0xf--; + super->subtimer--; } - super->field_0xf = 1; - super->actionDelay |= 0x80; + super->subtimer = 1; + super->timer |= 0x80; this->unk_70 = 0; this->unk_6c = 0; if (GetTileUnderEntity(super) == 0xd) { @@ -338,7 +338,7 @@ void sub_08085F1C(LilypadLargeEntity* this) { } void sub_08085F48(LilypadLargeEntity* this) { - u32 tmp = super->actionDelay & 0x80; + u32 tmp = super->timer & 0x80; if (tmp != 0) { if (gPlayerState.floor_type == SURFACE_ICE) { ResetPlayerVelocity(); @@ -348,35 +348,35 @@ void sub_08085F48(LilypadLargeEntity* this) { if (this->unk_78.WORD_U < 0x1280000) { this->unk_78.WORD_U += 0x80000; } else { - super->actionDelay = 0; + super->timer = 0; } } else { if ((gPlayerState.flags & PL_FLAGS2) != 0) { - if (super->actionDelay != 0) { + if (super->timer != 0) { if (this->unk_78.WORD_U < 0x1200000) { this->unk_78.WORD_U += 0x8000; } else { - super->actionDelay = tmp; + super->timer = tmp; } } else { if (this->unk_78.WORD_U > 0x1100000) { this->unk_78.WORD_U -= 0x8000; } else { - super->actionDelay = 1; + super->timer = 1; } } } else { - if (super->actionDelay != 0) { + if (super->timer != 0) { if (this->unk_78.WORD_U < 0x1100000) { this->unk_78.WORD_U += 0x4000; } else { - super->actionDelay = 0; + super->timer = 0; } } else { if (this->unk_78.WORD_U > 0x1060000) { this->unk_78.WORD_U -= 0x4000; } else { - super->actionDelay = 1; + super->timer = 1; } } } diff --git a/src/object/lilypadSmall.c b/src/object/lilypadSmall.c index eed1578f..3f72f3e3 100644 --- a/src/object/lilypadSmall.c +++ b/src/object/lilypadSmall.c @@ -12,9 +12,9 @@ void LilypadSmall(Entity* this) { if (this->action == 0) { this->action = 1; - this->actionDelay = 0x5a; + this->timer = 0x5a; rand = Random(); - this->field_0xf = rand; + this->subtimer = rand; this->frameIndex = (rand >> 0x10) & 3; this->spriteSettings.draw = TRUE; this->spritePriority.b0 = 7; @@ -51,12 +51,12 @@ static void sub_08097B24(Entity* this) { u32 temp2; u16* temp3; - if (--this->actionDelay == 0) { - this->actionDelay = 90; + if (--this->timer == 0) { + this->timer = 90; this->frameIndex = (this->frameIndex + 1) & 3; } temp3 = gUnk_08123318; - temp2 = ++this->field_0xf; + temp2 = ++this->subtimer; temp = temp3[(temp2 >> 5) & 7]; SetAffineInfo(this, temp, temp, 0); diff --git a/src/object/litArea.c b/src/object/litArea.c index f042209e..0c915d6a 100644 --- a/src/object/litArea.c +++ b/src/object/litArea.c @@ -15,14 +15,14 @@ void LitArea(Entity* this) { this->spriteRendering.b0 = 3; this->frameIndex = 3; this->flags |= ENT_PERSIST; - this->field_0xf = gRoomControls.room; - this->actionDelay = 2; + this->subtimer = gRoomControls.room; + this->timer = 2; this->field_0x68.HWORD = 0xfffe; this->field_0x6a.HWORD = 0x80; SetAffineInfo(this, 0x80, 0x80, 0); } else { - if (--this->actionDelay == 0) { - this->actionDelay = 2; + if (--this->timer == 0) { + this->timer = 2; this->field_0x6a.HWORD += this->field_0x68.HWORD; if (this->field_0x6a.HWORD < 0x78) { this->field_0x68.HWORD = 1; @@ -37,7 +37,7 @@ void LitArea(Entity* this) { gScreen.controls.windowOutsideControl = (gScreen.controls.windowOutsideControl & 0xff) | WINOUT_WINOBJ_BG0 | WINOUT_WINOBJ_BG1 | WINOUT_WINOBJ_BG2 | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR; - if ((gRoomControls.room != this->field_0xf) && (gRoomControls.reload_flags == 0)) { + if ((gRoomControls.room != this->subtimer) && (gRoomControls.reload_flags == 0)) { DeleteThisEntity(); } } diff --git a/src/object/lockedDoor.c b/src/object/lockedDoor.c index ebe88f20..f1530d33 100644 --- a/src/object/lockedDoor.c +++ b/src/object/lockedDoor.c @@ -141,9 +141,9 @@ void sub_08083338(Entity* this) { } void sub_080834B4(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; - this->actionDelay = 7; + this->timer = 7; SetTile(this->field_0x74.HWORD, this->field_0x76.HWORD, this->collisionLayer); EnqueueSFX(SFX_10B); } @@ -151,7 +151,7 @@ void sub_080834B4(Entity* this) { void sub_080834EC(Entity* this) { LinearMoveUpdate(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (this->type & 0x80) { sub_08083638(this); } else { @@ -169,7 +169,7 @@ void sub_08083518(Entity* this) { void sub_08083540(Entity* this) { LinearMoveUpdate(this); - if (!--this->actionDelay) { + if (!--this->timer) { if (this->type & 0x10) { this->type &= ~0x10; sub_080836A0(this); @@ -214,7 +214,7 @@ void sub_080835F8(Entity* this) { if (this->interactType == 0 && !CheckFlags(this->field_0x86.HWORD)) return; this->action = 1; - this->actionDelay = 0x14; + this->timer = 0x14; sub_08083658(this); SetFlag(this->field_0x86.HWORD); sub_080526F8(-1); @@ -230,7 +230,7 @@ void sub_08083638(Entity* this) { void sub_08083658(Entity* this) { const struct_0811F680* tmp; this->action = 1; - this->actionDelay = 0x14; + this->timer = 0x14; this->direction = this->field_0x7c.BYTES.byte2 << 3; tmp = &gUnk_0811F680[this->field_0x7c.BYTES.byte2]; this->x.HALF.HI += tmp->x; @@ -250,7 +250,7 @@ void sub_080836A0(Entity* this) { void sub_080836DC(Entity* this, u32 unk_0, u32 unk_1) { const struct_0811F680* tmp; SetTile(0x4022, unk_1, this->collisionLayer); - this->actionDelay = 7; + this->timer = 7; this->spriteSettings.draw = 1; this->direction = (unk_0 << 3) ^ 0x10; tmp = &gUnk_0811F688[unk_0]; diff --git a/src/object/macroAcorn.c b/src/object/macroAcorn.c index ca77f1b0..0f34165b 100644 --- a/src/object/macroAcorn.c +++ b/src/object/macroAcorn.c @@ -1,5 +1,5 @@ #include "entity.h" -#include "coord.h" +#include "physics.h" #include "object.h" void sub_0809E518(Entity*); diff --git a/src/object/macroBook.c b/src/object/macroBook.c index a69daa92..722ce8a4 100644 --- a/src/object/macroBook.c +++ b/src/object/macroBook.c @@ -35,8 +35,8 @@ void MacroBook(Entity* this) { void MacroBook_Init(MacroBookEntity* this) { super->action = 1; - super->actionDelay = 0x80; - super->field_0xf = 0; + super->timer = 0x80; + super->subtimer = 0; super->spriteRendering.b0 = 3; this->unk80 = 0x80; this->playerWithinRect = 0; @@ -46,24 +46,24 @@ void MacroBook_Init(MacroBookEntity* this) { super->spriteRendering.b3 = 3; SetAffineInfo(super, this->unk80, this->unk80, 0); UpdateSpriteForCollisionLayer(super); - InitAnimationForceUpdate(super, super->field_0xf); + InitAnimationForceUpdate(super, super->subtimer); sub_0809A958(this); } void MacroBook_Action1(MacroBookEntity* this) { UpdateAnimationSingleFrame(super); sub_0809AA00(this); - if (super->actionDelay) { - super->actionDelay--; + if (super->timer) { + super->timer--; } else { if ((super->frame & ANIM_DONE) != 0) { - if (super->field_0xf == 3) { + if (super->subtimer == 3) { super->action = 2; - super->actionDelay = 90; - super->field_0xf = 0; + super->timer = 90; + super->subtimer = 0; InitAnimationForceUpdate(super, 2); } else { - InitAnimationForceUpdate(super, super->field_0xf); + InitAnimationForceUpdate(super, super->subtimer); } } } @@ -72,22 +72,22 @@ void MacroBook_Action1(MacroBookEntity* this) { void MacroBook_Action2(MacroBookEntity* this) { UpdateAnimationSingleFrame(super); sub_0809AA00(this); - if (super->field_0xf < 2) { + if (super->subtimer < 2) { super->action = 1; - super->actionDelay = 0; - } else if (super->actionDelay) { - super->actionDelay--; + super->timer = 0; + } else if (super->timer) { + super->timer--; if (gPlayerClones[0] != 0) { return; } super->action = 1; - super->actionDelay = 0; + super->timer = 0; } else { if ((super->frame & ANIM_DONE) == 0) { return; } super->action = 3; - super->actionDelay = 0; + super->timer = 0; InitAnimationForceUpdate(super, 3); RequestPriorityDuration(super, 0x78); } @@ -105,7 +105,7 @@ void MacroBook_Action3(MacroBookEntity* this) { sub_0809A9D4(this); break; case 0x20: - super->actionDelay++; + super->timer++; super->frame &= 0xdf; SetPlayerControl(0xff); SetGlobalFlag(0x2a); @@ -114,7 +114,7 @@ void MacroBook_Action3(MacroBookEntity* this) { break; } - if (super->actionDelay) { + if (super->timer) { this->unk80 += 8; super->x.WORD += 0x400; SetAffineInfo(super, this->unk80, this->unk80, 0); @@ -167,7 +167,7 @@ void sub_0809A9D4(MacroBookEntity* this) { void sub_0809AA00(MacroBookEntity* this) { Entity* ent; - super->field_0xf = 0; + super->subtimer = 0; if (super->child == NULL) { for (ent = FindEntityByID(NPC, TOWN_MINISH, 7); ent != NULL; ent = FindNextDuplicateID(ent, NPC)) { if (ent->type == 0 && ent->type2 == 8) { @@ -202,7 +202,7 @@ void sub_0809AA9C(MacroBookEntity* this, Entity* ent, u32 arg3) { } if (ent->x.HALF.HI <= gRoomControls.origin_x + 0x15a) { - super->field_0xf++; + super->subtimer++; ent->spriteOffsetY++; } } diff --git a/src/object/macroPlayer.c b/src/object/macroPlayer.c index f024215f..4b9f4182 100644 --- a/src/object/macroPlayer.c +++ b/src/object/macroPlayer.c @@ -1,6 +1,6 @@ #define NENT_DEPRECATED #include "entity.h" -#include "coord.h" +#include "physics.h" #include "functions.h" #include "object.h" #include "area.h" @@ -181,7 +181,7 @@ void MacroPlayer_Type0_Action4(MacroPlayerEntity* this) { } } else { super->action++; - super->actionDelay = 60; + super->timer = 60; this->unk68.HWORD = 0xc04; DeleteEntity(super->child); sub_0805EC60(super); @@ -189,9 +189,9 @@ void MacroPlayer_Type0_Action4(MacroPlayerEntity* this) { } void MacroPlayer_Type0_Action5(MacroPlayerEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action++; - super->actionDelay = 0x10; + super->timer = 0x10; } } @@ -199,7 +199,7 @@ void MacroPlayer_Type0_Action6(MacroPlayerEntity* this) { static const u8 gUnk_081216B4[] = { 0, 0x1a, 0x2, 0x5, 0x4, 0x11, 0x6, 0x1a }; u32 uVar2; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { uVar2 = gArea.portal_exit_dir; super->action += 1; super->action += uVar2; diff --git a/src/object/mask.c b/src/object/mask.c index 689d3a88..6571de7e 100644 --- a/src/object/mask.c +++ b/src/object/mask.c @@ -38,8 +38,8 @@ void sub_080929A4(Entity* this) { this->field_0x78.HWORD = ((Random() & 7) << 10) | 0x2000; - this->field_0xf = this->actionDelay >> 1; - this->actionDelay = 0; + this->subtimer = this->timer >> 1; + this->timer = 0; this->frameIndex = this->type2 & 0x3f; @@ -67,8 +67,8 @@ void sub_08092A94(Entity* this) { return; } - if (this->x.HALF.HI - gPlayerEntity.x.HALF.HI >= this->field_0xf || - this->x.HALF.HI - gPlayerEntity.x.HALF.HI <= -this->field_0xf) { + if (this->x.HALF.HI - gPlayerEntity.x.HALF.HI >= this->subtimer || + this->x.HALF.HI - gPlayerEntity.x.HALF.HI <= -this->subtimer) { return; } @@ -87,10 +87,10 @@ void sub_08092A94(Entity* this) { // Probably falling down void sub_08092B0C(Entity* this) { - if (this->actionDelay == 1) { + if (this->timer == 1) { this->action = 3; - this->actionDelay = 0; + this->timer = 0; switch (this->type2 & 0xC0) { case 0x80: EnqueueSFX(SFX_SECRET); @@ -106,7 +106,7 @@ void sub_08092B0C(Entity* this) { sub_080044EC(this, this->field_0x78.HWORD); if (this->z.HALF.HI == 0) { - this->actionDelay++; + this->timer++; } } } diff --git a/src/object/mazaalBossObject.c b/src/object/mazaalBossObject.c index adc3ab6d..b82c1910 100644 --- a/src/object/mazaalBossObject.c +++ b/src/object/mazaalBossObject.c @@ -81,7 +81,7 @@ void MazaalBossObject_Action0(MazaalBossObjectEntity* this) { sub_080809D4(); } else { super->action = MAZAAL_BOSS_OBJECT_ACTION_1; - super->actionDelay = 30; + super->timer = 30; super->frameIndex = gRoomTransition.field_0x38; super->spritePriority.b0 = 7; super->spriteOffsetY = 0x20; @@ -95,27 +95,27 @@ void MazaalBossObject_Action1(MazaalBossObjectEntity* this) { } void MazaalBossObject_Action2(MazaalBossObjectEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = MAZAAL_BOSS_OBJECT_ACTION_3; - super->actionDelay = 120; + super->timer = 120; gRoomControls.camera_target = super->child; } } void MazaalBossObject_Action3(MazaalBossObjectEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = MAZAAL_BOSS_OBJECT_ACTION_4; - super->actionDelay = 90; + super->timer = 90; super->child->subAction = 1; } } void MazaalBossObject_Action4(MazaalBossObjectEntity* this) { if (super->child->subAction > 2) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = MAZAAL_BOSS_OBJECT_ACTION_5; - super->actionDelay = 8; - super->field_0xf = 0; + super->timer = 8; + super->subtimer = 0; super->spriteRendering.alphaBlend = BLDALPHA_BLEND(1, 0); gScreen.controls.layerFXControl = @@ -128,25 +128,25 @@ void MazaalBossObject_Action4(MazaalBossObjectEntity* this) { void MazaalBossObject_Action5(MazaalBossObjectEntity* this) { u32 tmp; - if (--super->actionDelay == 0) { - super->actionDelay = 8; + if (--super->timer == 0) { + super->timer = 8; - tmp = ++super->field_0xf; + tmp = ++super->subtimer; tmp &= 0xFF; gScreen.controls.alphaBlend = BLDALPHA_BLEND((0x10 - tmp) & 0xFF, tmp); - if (super->field_0xf > 15) { + if (super->subtimer > 15) { super->spriteRendering.alphaBlend = BLDALPHA_BLEND(4, 0); gScreen.controls.layerFXControl = 0; super->action = MAZAAL_BOSS_OBJECT_ACTION_6; - super->actionDelay = 15; + super->timer = 15; super->spriteSettings.draw = 0; } } } void MazaalBossObject_Action6(MazaalBossObjectEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->child->subAction = 6; gRoomTransition.field_0x38 = 0xF1; @@ -155,18 +155,18 @@ void MazaalBossObject_Action6(MazaalBossObjectEntity* this) { } void MazaalBossObject_Action7(MazaalBossObjectEntity* this) { - if (super->child->actionDelay == 1) { + if (super->child->timer == 1) { super->action = MAZAAL_BOSS_OBJECT_ACTION_8; super->subAction = 0; - super->actionDelay = 180; + super->timer = 180; } } void MazaalBossObject_Action8(MazaalBossObjectEntity* this) { switch (super->subAction) { default: - if (--super->actionDelay == 0) { - super->actionDelay = 90; + if (--super->timer == 0) { + super->timer = 90; super->subAction = 1; SoundReq(SFX_SECRET_BIG); SetFlag(0x31); @@ -174,14 +174,14 @@ void MazaalBossObject_Action8(MazaalBossObjectEntity* this) { } break; case 1: - if (--super->actionDelay == 0) { - super->actionDelay = 120; + if (--super->timer == 0) { + super->timer = 120; super->subAction = 2; sub_0809AD68(this); } break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { gRoomControls.camera_target = &gNewPlayerEntity.base; gPlayerState.controlMode = CONTROL_1; DeleteThisEntity(); diff --git a/src/object/metalDoor.c b/src/object/metalDoor.c index 383949b5..fd5e7b22 100644 --- a/src/object/metalDoor.c +++ b/src/object/metalDoor.c @@ -37,7 +37,7 @@ void sub_080A0684(Entity* this) { void sub_080A0718(Entity* this) { if (sub_08083734(this, 2) != 0) { this->action = 2; - this->actionDelay = 0xc; + this->timer = 0xc; this->spriteSettings.draw = TRUE; this->direction = 0; this->y.HALF.HI += 0x24; @@ -51,7 +51,7 @@ void sub_080A074C(Entity* this) { LinearMoveUpdate(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; this->z.HALF.HI = 0; this->x.HALF.HI = this->field_0x70.HALF.LO; @@ -73,7 +73,7 @@ void sub_080A074C(Entity* this) { void sub_080A07BC(Entity* this) { if (CheckFlags(this->field_0x86.HWORD)) { this->action = 4; - this->actionDelay = 0xc; + this->timer = 0xc; this->direction = 0x10; this->y.HALF.HI += 2; sub_080A0870(this); @@ -85,7 +85,7 @@ void sub_080A07F0(Entity* this) { LinearMoveUpdate(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteThisEntity(); } } diff --git a/src/object/minecart.c b/src/object/minecart.c index 937439fe..f49042bf 100644 --- a/src/object/minecart.c +++ b/src/object/minecart.c @@ -28,11 +28,11 @@ void Minecart(Entity* this) { sub_080916EC, sub_080917DC, sub_080918A4, sub_080919AC, sub_08091C0C, sub_08091C98, sub_08091CC8, sub_08091D90, }; actionFuncs[this->action]((MinecartEntity*)this); - this->bitfield = 0; + this->contactFlags = 0; } void sub_080916EC(MinecartEntity* this) { - struct_030010EC* unk = &gRoomTransition.minecart_data[super->actionDelay]; + struct_030010EC* unk = &gRoomTransition.minecart_data[super->timer]; this->minecartData = unk; if ((gRoomControls.room != unk->room) || (gPlayerState.flags & PL_IN_MINECART) != 0) { @@ -46,7 +46,7 @@ void sub_080916EC(MinecartEntity* this) { super->hitbox = (Hitbox*)&gUnk_080FD310; COLLISION_ON(super); super->hitType = 1; - super->field_0x3c = 0x47; + super->collisionFlags = 0x47; super->hurtType = 0x44; super->flags2 = 0x80; super->direction = DirectionFromAnimationState(super->animationState); @@ -57,7 +57,7 @@ void sub_080916EC(MinecartEntity* this) { } void sub_080917DC(MinecartEntity* this) { - if ((super->bitfield & 0x7f) == 0x1d) { + if ((super->contactFlags & 0x7f) == 0x1d) { super->zVelocity = Q_16_16(2.625); super->action = 7; InitAnimationForceUpdate(super, super->type2 + 4 + super->animationState); @@ -66,15 +66,15 @@ void sub_080917DC(MinecartEntity* this) { if (sub_0800445C(super) != 0) { if (!((gPlayerState.flags & (PL_MINISH | PL_ROLLING)) || gPlayerState.field_0x1c || gPlayerState.heldObject || gPlayerState.jump_status)) { - super->actionDelay++; + super->timer++; } else { - super->actionDelay = 0; + super->timer = 0; } } else { - super->actionDelay = 0; + super->timer = 0; } if (super->type2 == 0) { - if (super->actionDelay > 8) { + if (super->timer > 8) { super->action++; gPlayerState.jump_status = 0x81; gPlayerState.flags |= PL_ENTER_MINECART; @@ -86,7 +86,7 @@ void sub_080917DC(MinecartEntity* this) { SoundReq(SFX_PLY_JUMP); } } else { - super->actionDelay = 0; + super->timer = 0; } } } @@ -102,10 +102,10 @@ void sub_080918A4(MinecartEntity* this) { gPlayerEntity.animationState = super->animationState << 1; gPlayerState.flags = (gPlayerState.flags ^ PL_ENTER_MINECART) | PL_IN_MINECART; super->action++; - super->field_0xf = 1; + super->subtimer = 1; super->flags |= ENT_PERSIST; super->hitType = 0x97; - super->field_0x3c = (gPlayerEntity.field_0x3c + 1) | 0x20; + super->collisionFlags = (gPlayerEntity.collisionFlags + 1) | 0x20; super->flags2 = gPlayerEntity.flags2; super->hurtType = 0x18; super->damage = 8; @@ -152,9 +152,9 @@ void sub_080919AC(MinecartEntity* this) { SoundReq(SFX_138); } - if (super->field_0xf-- == 0) { + if (super->subtimer-- == 0) { SoundReq(SFX_PLY_VO7); - super->field_0xf = 0x3c; + super->subtimer = 0x3c; } uVar3 = GetRelativeCollisionTile(super, gUnk_081223C8[super->animationState * 2], @@ -168,7 +168,7 @@ void sub_080919AC(MinecartEntity* this) { case 0x64: super->flags &= ~ENT_PERSIST; super->hitType = 1; - super->field_0x3c = 0x47; + super->collisionFlags = 0x47; super->hurtType = 0x44; super->flags2 = 0x80; super->action = 6; diff --git a/src/object/minecartDoor.c b/src/object/minecartDoor.c index 514e9b1a..e7f3e52c 100644 --- a/src/object/minecartDoor.c +++ b/src/object/minecartDoor.c @@ -74,7 +74,7 @@ void MinecartDoor_Init(MinecartDoorEntity* this) { void MinecartDoor_Action1(MinecartDoorEntity* this) { if (sub_08096CEC(this)) { super->action = 2; - super->actionDelay = 7; + super->timer = 7; super->direction = super->type << 3; SetTile(this->unk_74, this->unk_76, super->collisionLayer); EnqueueSFX(SFX_10B); @@ -83,7 +83,7 @@ void MinecartDoor_Action1(MinecartDoorEntity* this) { void MinecartDoor_Action2(MinecartDoorEntity* this) { LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_08096E04(this); super->spriteSettings.draw = 0; super->x.HALF.HI = this->unk_70; @@ -107,7 +107,7 @@ void MinecartDoor_Action3(MinecartDoorEntity* this) { } bVar3 = FALSE; } else { - bVar3 = --super->actionDelay * 0x1000000; + bVar3 = --super->timer * 0x1000000; } } else { bVar3 = sub_08096D84(this); @@ -120,7 +120,7 @@ void MinecartDoor_Action3(MinecartDoorEntity* this) { void MinecartDoor_Action4(MinecartDoorEntity* this) { LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 1; super->x.HALF.HI = this->unk_70; super->y.HALF.HI = this->unk_72; @@ -189,5 +189,5 @@ bool32 sub_08096D84(MinecartDoorEntity* this) { void sub_08096E04(MinecartDoorEntity* this) { super->action = 3; - super->actionDelay = 8; + super->timer = 8; } diff --git a/src/object/mineralWaterSource.c b/src/object/mineralWaterSource.c index e4b438d4..40f40837 100644 --- a/src/object/mineralWaterSource.c +++ b/src/object/mineralWaterSource.c @@ -32,7 +32,7 @@ void MineralWaterSource_Init(Entity* this) { COLLISION_ON(this); - this->field_0x3c = 7; + this->collisionFlags = 7; this->hitType = 145; this->flags2 = 2; @@ -40,5 +40,5 @@ void MineralWaterSource_Init(Entity* this) { } void sub_080973DC(Entity* this) { - this->bitfield = 0; + this->contactFlags = 0; } diff --git a/src/object/minishEmoticon.c b/src/object/minishEmoticon.c index 20c68e43..fe93538d 100644 --- a/src/object/minishEmoticon.c +++ b/src/object/minishEmoticon.c @@ -70,20 +70,20 @@ void sub_08082098(Entity* this) { animIndex = origAnimIndex + 4; if (this->animIndex != animIndex) { this->z.WORD = 0; - this->actionDelay = 6; - } else if (this->actionDelay-- == 0) { + this->timer = 6; + } else if (this->timer-- == 0) { switch (this->spriteOffsetY) { case 0: this->spriteOffsetY = -2; - this->actionDelay = 6; + this->timer = 6; break; case -2: this->spriteOffsetY = -1; - this->actionDelay = 6; + this->timer = 6; break; case -1: this->spriteOffsetY = 0; - this->actionDelay = 3; + this->timer = 3; break; } } diff --git a/src/object/minishLight.c b/src/object/minishLight.c index a316e499..3ec27575 100644 --- a/src/object/minishLight.c +++ b/src/object/minishLight.c @@ -9,8 +9,8 @@ void MinishLight(Entity* this) { void sub_0809F840(Entity* this) { this->action = 1; this->frameIndex = 0; - this->actionDelay = 0x20; - this->field_0xf = 0; + this->timer = 0x20; + this->subtimer = 0; if (this->type2 != 0) { this->spriteSettings.flipX = 1; @@ -20,16 +20,16 @@ void sub_0809F840(Entity* this) { } void sub_0809F868(Entity* this) { - if (--this->actionDelay == 0) { - if (this->field_0xf == 0) { + if (--this->timer == 0) { + if (this->subtimer == 0) { if (++this->frameIndex == 3) { - this->field_0xf = 1; + this->subtimer = 1; } } else { if (--this->frameIndex == 0) { - this->field_0xf = 0; + this->subtimer = 0; } } - this->actionDelay = 32; + this->timer = 32; } } diff --git a/src/object/minishSizedEntrance.c b/src/object/minishSizedEntrance.c index bf235ee0..e40ac638 100644 --- a/src/object/minishSizedEntrance.c +++ b/src/object/minishSizedEntrance.c @@ -24,13 +24,13 @@ void sub_08090EC0(Entity* this) { void sub_08090F00(Entity* this) { if (this->type == 1) { Entity* parent = this->parent; - u32 mask = 1 << this->field_0xf; + u32 mask = 1 << this->subtimer; if (!(parent->zVelocity & mask)) { DeleteThisEntity(); } } if ((gPlayerState.flags & PL_MINISH) && EntityInRectRadius(this, &gPlayerEntity, 4, 4) && (gPlayerEntity.z.HALF.HI == 0) && (((u16)gPlayerState.field_0x90) & gUnk_0812225C[this->type2])) { - DoExitTransition(GetCurrentRoomProperty(this->actionDelay)); + DoExitTransition(GetCurrentRoomProperty(this->timer)); } } diff --git a/src/object/object11.c b/src/object/object11.c index 884491df..76f688b7 100644 --- a/src/object/object11.c +++ b/src/object/object11.c @@ -60,12 +60,12 @@ void Object11_Init(Object11Entity* this) { super->action = 2; super->flags |= ENT_COLLIDE; super->spriteRendering.b3 = 2; - super->field_0x1d = gUnk_08120588[super->type].unk_1; - super->field_0x1c = gUnk_08120588[super->type].unk_2; + super->gustJarTolerance = gUnk_08120588[super->type].unk_1; + super->gustJarFlags = gUnk_08120588[super->type].unk_2; super->speed = 0x80; super->collisionLayer = gPlayerEntity.collisionLayer; super->health = 1; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hitType = 0x6e; super->flags2 = 4; super->hitbox = (Hitbox*)&gUnk_081205B4; @@ -76,7 +76,7 @@ void Object11_Init(Object11Entity* this) { } void Object11_Action1(Object11Entity* this) { - if (((gPlayerState.field_0x1c & 0xf) != 1) || ((super->bitfield & 0x7f) != 0x13)) { + if (((gPlayerState.field_0x1c & 0xf) != 1) || ((super->contactFlags & 0x7f) != 0x13)) { RestorePrevTileEntity(COORD_TO_TILE(super), super->collisionLayer); DeleteThisEntity(); } @@ -100,7 +100,7 @@ void Object11_Action2SubAction0(Object11Entity* this) { void Object11_Action2SubAction1(Object11Entity* this) { Object11_Action1(this); sub_0806F4E8(super); - if ((super->field_0x1d != 0) && (--super->field_0x1d == 0)) { + if ((super->gustJarTolerance != 0) && (--super->gustJarTolerance == 0)) { super->subAction = 2; } } @@ -111,10 +111,10 @@ void Object11_Action2SubAction2(Object11Entity* this) { super->spriteOffsetX = 0; sub_0807B9B8(this->unk_70, COORD_TO_TILE(super), super->collisionLayer); } - if (((gPlayerState.field_0x1c & 0xf) != 1) || ((super->bitfield & 0x7f) != 0x13)) { + if (((gPlayerState.field_0x1c & 0xf) != 1) || ((super->contactFlags & 0x7f) != 0x13)) { Object11_Action2SubAction5(this); } - if (sub_0806F3E4(super) && ((super->field_0x1c & 0xf) == 1)) { + if (sub_0806F3E4(super) && ((super->gustJarFlags & 0xf) == 1)) { DeleteThisEntity(); } } @@ -130,12 +130,12 @@ void Object11_Action2SubAction5(Object11Entity* this) { case 0xff: break; case 0xf: - CreateFx(super, super->actionDelay, 0x80); + CreateFx(super, super->timer, 0x80); break; case 0: break; default: - CreateObjectWithParent(super, super->type2, super->actionDelay, 0); + CreateObjectWithParent(super, super->type2, super->timer, 0); break; } DeleteThisEntity(); diff --git a/src/object/object12.c b/src/object/object12.c index bc5aa3d6..2b1ce0c5 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->actionDelay = 0xf0; + super->timer = 0xf0; super->speed = 0x80; super->direction = 0x18; } @@ -53,9 +53,9 @@ void Object12_Action1(Object12Entity* this) { NONMATCH("asm/non_matching/object12/Object12_Action2.inc", void Object12_Action2(Object12Entity* this)) { u32 tmp; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 3; - super->actionDelay = 0x1e; + super->timer = 0x1e; super->spriteOffsetY = 4; gScreen.lcd.displayControl |= 0x2000; gScreen.controls.windowInsideControl = 0x1f; @@ -69,15 +69,15 @@ NONMATCH("asm/non_matching/object12/Object12_Action2.inc", void Object12_Action2 END_NONMATCH void Object12_Action3(Object12Entity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 4; - super->actionDelay = 0x60; + super->timer = 0x60; } } void Object12_Action4(Object12Entity* this) { LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { gScreen.lcd.displayControl &= 0xdfff; DeleteEntity(super); } diff --git a/src/object/object15.c b/src/object/object15.c index 43b03d0b..183ff93b 100644 --- a/src/object/object15.c +++ b/src/object/object15.c @@ -28,9 +28,9 @@ void Object15_Action1(Entity* this) { this->spriteSettings.draw ^= 1; } - if ((int)(this->actionDelay * 0x1000000) >= 0) { - if (this->actionDelay) { - if (--this->actionDelay == 0) { + if ((int)(this->timer * 0x1000000) >= 0) { + if (this->timer) { + if (--this->timer == 0) { DeleteThisEntity(); } } else { diff --git a/src/object/object17.c b/src/object/object17.c index 419b3173..ca83a1c7 100644 --- a/src/object/object17.c +++ b/src/object/object17.c @@ -3,7 +3,7 @@ #include "player.h" #include "asm.h" #include "room.h" -#include "coord.h" +#include "physics.h" void Object17_Init(Entity*); void Object17_Action1(Entity*); diff --git a/src/object/object1F.c b/src/object/object1F.c index 2c548d67..351ff739 100644 --- a/src/object/object1F.c +++ b/src/object/object1F.c @@ -49,13 +49,13 @@ void Object1F_Init(Object1FEntity* this) { super->x.HALF.HI = gUnk_08120A20[super->animationState] + super->x.HALF.HI; super->y.HALF.HI = gUnk_08120A20[super->animationState + 1] + super->y.HALF.HI; - super->spriteVramOffset = gUnk_08120A18[super->field_0xf].spriteVramOffset; - temp = gUnk_08120A18[super->field_0xf].unk1; + super->spriteVramOffset = gUnk_08120A18[super->subtimer].spriteVramOffset; + temp = gUnk_08120A18[super->subtimer].unk1; super->palette.b.b0 = temp; - this->unk6c = gUnk_08120A18[super->field_0xf].unk2; + this->unk6c = gUnk_08120A18[super->subtimer].unk2; super->collisionLayer = gPlayerEntity.collisionLayer; super->speed = 0x100; - InitializeAnimation(super, gUnk_08120A18[super->field_0xf].animationState); + InitializeAnimation(super, gUnk_08120A18[super->subtimer].animationState); } void Object1F_Action1(Object1FEntity* this) { @@ -92,9 +92,9 @@ void Object1F_Action2(Object1FEntity* this) { default: if (super->type2 != 0) { if (super->type2 == 15) { - CreateFx(super, super->actionDelay, 0x80); + CreateFx(super, super->timer, 0x80); } else { - CreateObjectWithParent(super, super->type2, super->actionDelay, 0); + CreateObjectWithParent(super, super->type2, super->timer, 0); } } } diff --git a/src/object/object20.c b/src/object/object20.c index 9474f662..cf8c1d55 100644 --- a/src/object/object20.c +++ b/src/object/object20.c @@ -34,7 +34,7 @@ void sub_08087824(Entity* this) { } this->action = 1; this->flags |= 0x80; - this->field_0x3c = 0x13; + this->collisionFlags = 0x13; this->health = 0xff; this->hitType = 0xa9; this->hurtType = 0x16; diff --git a/src/object/object21.c b/src/object/object21.c index f25e1a50..4f085cf2 100644 --- a/src/object/object21.c +++ b/src/object/object21.c @@ -33,8 +33,8 @@ void Object21(Object21Entity* this) { }; gUnk_08120A68[super->action](this); GetNextFrame(super); - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } else { if (super->animIndex == 0xa) { InitializeAnimation(super, 0xd); @@ -79,14 +79,14 @@ void sub_08087A10(Object21Entity* this) { case 3: super->flags |= ENT_COLLIDE; super->health = 1; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hitType = 0xaa; super->flags2 = 0x0e; super->hitbox = (Hitbox*)&gUnk_08120A8C; - super->field_0x1c = 0; + super->gustJarFlags = 0; case 2: rand = Random(); - super->actionDelay = gUnk_08120A7A[rand & 3]; + super->timer = gUnk_08120A7A[rand & 3]; tmp = (rand >> 8) & 3; if ((rand & 0x10) != 0) { tmp = -tmp; @@ -104,12 +104,12 @@ void sub_08087A10(Object21Entity* this) { void sub_08087AFC(Object21Entity* this) { Object21Entity* entity; - if ((super->bitfield & 0x80) == 0) { + if ((super->contactFlags & 0x80) == 0) { return; } - switch (super->bitfield & 0x7f) { + switch (super->contactFlags & 0x7f) { case 0x16: - super->direction = GetFacingDirection(super->field_0x4c, super); + super->direction = GetFacingDirection(super->contactedEntity, super); super->speed = 0x100; break; case 0x13: @@ -118,7 +118,7 @@ void sub_08087AFC(Object21Entity* this) { break; case 0x1b: case 0x1c: - entity = (Object21Entity*)super->field_0x4c; + entity = (Object21Entity*)super->contactedEntity; super->direction = CalculateDirectionTo(entity->unk_84, entity->unk_80, super->x.WORD, super->y.WORD); super->speed = 0x100; break; @@ -131,7 +131,7 @@ void sub_08087B58(Object21Entity* this) { sub_08087B9C, sub_08087B9C, }; - if ((super->bitfield & 0x80) != 0) { + if ((super->contactFlags & 0x80) != 0) { gUnk_08120A80[super->subAction](this); } else { super->action = 1; @@ -143,7 +143,7 @@ const Hitbox gUnk_08120A8C = { 0, 0, { 6, 3, 3, 6 }, 3, 3 }; void sub_08087B88(Object21Entity* this) { super->knockbackSpeed = 0x100; super->subAction = 1; - super->field_0x1d = 1; + super->gustJarTolerance = 1; } void sub_08087B9C(Object21Entity* this) { diff --git a/src/object/object2A.c b/src/object/object2A.c index 2f24592d..4ace87be 100644 --- a/src/object/object2A.c +++ b/src/object/object2A.c @@ -16,16 +16,16 @@ void Object2A_Init(Entity* this) { this->action = 1; this->spriteSettings.draw = TRUE; if (this->type2 != 0) { - this->actionDelay = this->type2; + this->timer = this->type2; } InitializeAnimation(this, 0); switch (this->type) { case 1: this->y.HALF.HI -= 8; - this->actionDelay = 0x28; + this->timer = 0x28; break; case 2: - this->actionDelay = 0xf; + this->timer = 0xf; sub_08004168(this); break; case 3: @@ -52,7 +52,7 @@ void sub_08089BA0(Entity* this) { return; case 1: case 2: - if (this->actionDelay-- != 0) + if (this->timer-- != 0) return; if (this->type == 2) { sub_0807B7D8(((u16*)this->child)[3], COORD_TO_TILE(this), this->collisionLayer); @@ -67,7 +67,7 @@ void sub_08089BA0(Entity* this) { if (this->parent->next == NULL) { DeleteThisEntity(); } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteThisEntity(); } diff --git a/src/object/object30.c b/src/object/object30.c index dca304b4..4f6f1d33 100644 --- a/src/object/object30.c +++ b/src/object/object30.c @@ -89,7 +89,7 @@ void Object30_Action2(Object30Entity* this) { } // fallthrough case 1: - tmp = gUnk_08121194[(super->field_0xf++ >> 3) & 7]; + tmp = gUnk_08121194[(super->subtimer++ >> 3) & 7]; super->z.HALF.HI = tmp << 0x18 >> 0x18; if (!IsCollidingPlayer(super)) { return; @@ -102,12 +102,12 @@ void Object30_Action2(Object30Entity* this) { void sub_0808A968(Object30Entity* this) { super->action = 2; - super->actionDelay = 0x1e; + super->timer = 0x1e; super->spriteSettings.draw = 1; super->zVelocity = 0x28000; super->spritePriority.b1 = 3; super->spriteSettings.shadow = 0; - super->field_0x3c |= 0x10; + super->collisionFlags |= 0x10; super->hitbox = (Hitbox*)&gUnk_08121C58; SetDefaultPriority(super, 2); this->unk_70 = 0x2800; diff --git a/src/object/object35.c b/src/object/object35.c index 5a7f0a83..cee74852 100644 --- a/src/object/object35.c +++ b/src/object/object35.c @@ -60,15 +60,15 @@ void Object35_Type0Init(Object35Entity* this) { super->collisionLayer = 2; UpdateSpriteForCollisionLayer(super); super->spritePriority.b0 = 1; - super->actionDelay = -0x4c; + super->timer = -0x4c; InitializeAnimation(super, super->type2); } void Object35_Type0Action1(Object35Entity* this) { s8 tmp; GetNextFrame(super); - if (--super->actionDelay == 0) { - super->actionDelay = -0x4c; + if (--super->timer == 0) { + super->timer = -0x4c; super->type2++; tmp = 3; super->type2 = super->type2 % tmp; @@ -97,22 +97,22 @@ void Object35_Type1Init(Object35Entity* this) { super->spritePriority.b0 = 5; this->unk_76 = COORD_TO_TILE(super); this->unk_74 = GetTileIndex(this->unk_76, super->collisionLayer); - if (super->actionDelay == 0) { + if (super->timer == 0) { super->action = 1; - super->field_0xf = 0x78; + super->subtimer = 0x78; SetTile(0x4022, this->unk_76, super->collisionLayer); } else { super->action = 3; super->spriteSettings.draw = 0; super->spriteSettings.flipY = 1; - super->actionDelay = 0; + super->timer = 0; } } void Object35_Type1Action1(Object35Entity* this) { if (CheckRoomFlag(0)) { super->action = 2; - super->actionDelay = 7; + super->timer = 7; super->direction = 0; SetTile(this->unk_74, this->unk_76, super->collisionLayer); EnqueueSFX(SFX_10B); @@ -121,9 +121,9 @@ void Object35_Type1Action1(Object35Entity* this) { void Object35_Type1Action2(Object35Entity* this) { LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 5; - super->actionDelay = 8; + super->timer = 8; super->spriteSettings.draw = 0; super->x.HALF.HI = this->unk_70; super->y.HALF.HI = this->unk_72; @@ -139,7 +139,7 @@ void Object35_Type1Action3(Object35Entity* this) { void Object35_Type1Action4(Object35Entity* this) { LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 5; sub_08083814(super, 2); EnqueueSFX(SFX_10B); @@ -160,7 +160,7 @@ void Object35_Type2(Object35Entity* this) { void Object35_Type2Init(Object35Entity* this) { super->action = 1; - super->actionDelay = 0x10; + super->timer = 0x10; super->z.HALF.HI -= 0x10; if (super->type2 == 0) { super->frameIndex = 2; @@ -174,7 +174,7 @@ void Object35_Type2Init(Object35Entity* this) { } void Object35_Type2Action1(Object35Entity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { DeleteThisEntity(); } } diff --git a/src/object/object36.c b/src/object/object36.c index 94dae2b3..cb262560 100644 --- a/src/object/object36.c +++ b/src/object/object36.c @@ -38,14 +38,14 @@ void sub_0808BB30(Object36Entity* this) { } else { super->action = 1; super->flags |= ENT_COLLIDE; - super->actionDelay = 0x78; - super->field_0xf = 0; + super->timer = 0x78; + super->subtimer = 0; super->spriteRendering.b3 = 3; super->spritePriority.b0 = 4; super->spriteOrientation.flipY = 2; super->speed = 0x300; super->hitType = 1; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hurtType = 0x48; super->flags2 = 4; super->hitbox = (Hitbox*)&gHitbox_0; @@ -71,7 +71,7 @@ void sub_0808BBE0(Object36Entity* this) { ptr = &gUnk_0812144C[diff * 2]; SetAffineInfo(super, ptr[0], ptr[1], 0); } else { - super->bitfield &= 0x7f; + super->contactFlags &= 0x7f; } } @@ -81,29 +81,29 @@ void sub_0808BC3C(Object36Entity* this) { tmp = -0x170; super->y.HALF.HI = gRoomControls.origin_y - ((super->parent)->zVelocity + tmp); sub_0808BBE0(this); - if (super->bitfield == 0x93) { - super->actionDelay--; + if (super->contactFlags == 0x93) { + super->timer--; super->spriteSettings.draw = 1; - if (super->actionDelay == 0) { + if (super->timer == 0) { SetGlobalFlag(LV1TARU_OPEN); super->action = 2; - super->field_0xf = 0x80; + super->subtimer = 0x80; super->spriteOffsetY = 0; } else { - if ((super->actionDelay & 1) != 0) { + if ((super->timer & 1) != 0) { super->x.HALF.HI += ((Random() & 3) - 2); super->y.HALF.HI += ((Random() & 3) - 1); } - if (super->field_0xf != 1) { - super->field_0xf = 1; + if (super->subtimer != 1) { + super->subtimer = 1; LoadGfxGroup(0x4a); } } } else { - super->actionDelay = 0x78; + super->timer = 0x78; super->spriteSettings.draw = 0; - if (super->field_0xf != 0) { - super->field_0xf = 0; + if (super->subtimer != 0) { + super->subtimer = 0; LoadGfxGroup(0x49); } } @@ -117,11 +117,11 @@ void sub_0808BD00(Object36Entity* this) { void sub_0808BD14(Object36Entity* this) { - if (super->field_0xf != 0) { - super->field_0xf -= 8; - SetAffineInfo(super, 0x200 - super->field_0xf, 0x200 - super->field_0xf, 0); + if (super->subtimer != 0) { + super->subtimer -= 8; + SetAffineInfo(super, 0x200 - super->subtimer, 0x200 - super->subtimer, 0); } - if (super->bitfield == 0x93) { + if (super->contactFlags == 0x93) { super->direction = GetFacingDirection(super, &gPlayerEntity); LinearMoveUpdate(super); if (EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI - 6, 0x1c)) { @@ -130,10 +130,10 @@ void sub_0808BD14(Object36Entity* this) { } else { if ((super->flags & ENT_COLLIDE) != 0) { super->flags &= ~ENT_COLLIDE; - super->actionDelay = 0x1e; + super->timer = 0x1e; } else { super->spriteSettings.draw ^= 1; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_0808BD00(this); } } diff --git a/src/object/object3D.c b/src/object/object3D.c index 807285ce..79a1aa16 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->actionDelay = 0x1e; - super->field_0xf = 0xff; + super->timer = 0x1e; + super->subtimer = 0xff; super->spriteRendering.b0 = 3; SetAffineInfo(super, 0x100, 0x100, 0); gArea.field_0x10 = 1; @@ -97,7 +97,7 @@ void sub_0808D030(void) { } void Object3D_Action2(Object3DEntity* this) { - u32 tmp = super->actionDelay--; + u32 tmp = super->timer--; if (tmp != 0) { if (this->unk_68 != 0) { this->unk_68 -= 2; @@ -105,10 +105,10 @@ void Object3D_Action2(Object3DEntity* this) { this->unk_68 = 0; } sub_0801E1EC(super->x.HALF.HI, super->y.HALF.HI, this->unk_68); - if (0x80 < super->field_0xf) { - super->field_0xf -= 8; + if (0x80 < super->subtimer) { + super->subtimer -= 8; } - SetAffineInfo(super, super->field_0xf, super->field_0xf, 0); + SetAffineInfo(super, super->subtimer, super->subtimer, 0); } else { gArea.filler3[0]++; gArea.field_0x10 = 0; diff --git a/src/object/object3E.c b/src/object/object3E.c index c950452e..6442831b 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->actionDelay = 0x40 - (Random() & 0x1f); + super->timer = 0x40 - (Random() & 0x1f); super->frameIndex = 0; super->animationState = 0; super->spriteRendering.b3 = 3; @@ -49,21 +49,21 @@ void Object3E_Type0(Object3EEntity* this) { super->collisionLayer = 1; break; case 1: - if (--super->actionDelay == 0) { - super->actionDelay = 8; - super->field_0xf = 4; + if (--super->timer == 0) { + super->timer = 8; + super->subtimer = 4; super->action = 2; super->animationState = Random() & 3; } break; case 2: - if (--super->actionDelay == 0) { - if (--super->field_0xf == 0) { + if (--super->timer == 0) { + if (--super->subtimer == 0) { super->frameIndex = 0; super->action = 1; - super->actionDelay = 0x40 - (Random() & 0x1f); + super->timer = 0x40 - (Random() & 0x1f); } else { - super->actionDelay = 8; + super->timer = 8; tmp2 = super->animationState; if (super->frameIndex != tmp2) { tmp = tmp2; @@ -85,8 +85,8 @@ void Object3E_Type1(Object3EEntity* this) { switch (super->action) { case 0: super->action = 1; - super->actionDelay = 8; - super->field_0xf = 0; + super->timer = 8; + super->subtimer = 0; super->frameIndex = 0; super->spritePriority.b0 = 7; SetTile(0x4069, COORD_TO_TILE(super) - 0x40, 1); @@ -104,14 +104,14 @@ void Object3E_Type1(Object3EEntity* this) { case 1: break; } - if (--super->actionDelay == 0) { - super->actionDelay = 8; + if (--super->timer == 0) { + super->timer = 8; if (super->type == 9) { - super->actionDelay = 2; + super->timer = 2; } - ChangeObjPalette(super, gUnk_08121704[super->field_0xf++]); - if (gUnk_08121704[super->field_0xf] == 0) { - super->field_0xf = 0; + ChangeObjPalette(super, gUnk_08121704[super->subtimer++]); + if (gUnk_08121704[super->subtimer] == 0) { + super->subtimer = 0; } } } @@ -170,16 +170,16 @@ void Object3E_Type6(Object3EEntity* this) { static const u16 gUnk_08121720[] = { 0x149, 0x14a, 0x14b, 0x14a, 0, 0 }; if (super->action == 0) { super->action = 1; - super->actionDelay = 8; + super->timer = 8; super->spritePriority.b0 = 7; gScreen.controls.layerFXControl = 0x640; gScreen.controls.alphaBlend = 0x1003; } - if (--super->actionDelay == 0) { - super->actionDelay = 2; - sub_0801D28C(super, gUnk_08121720[super->field_0xf++]); - if (gUnk_08121720[super->field_0xf] == 0) { - super->field_0xf = 0; + if (--super->timer == 0) { + super->timer = 2; + sub_0801D28C(super, gUnk_08121720[super->subtimer++]); + if (gUnk_08121720[super->subtimer] == 0) { + super->subtimer = 0; } } } @@ -212,13 +212,13 @@ void Object3E_Type8_Init(Object3EEntity* this) { super->action = 2; if ((super->type2 == 0) && (CheckLocalFlag(0x7c) == 0)) { super->action = 1; - super->actionDelay = 0; + super->timer = 0; super->spriteRendering.alphaBlend = 1; gScreen.controls.layerFXControl = 0x640; gScreen.controls.alphaBlend = 0x1000; SoundReq(SFX_179); } else { - super->actionDelay = 8; + super->timer = 8; tilePosition = COORD_TO_TILE(super); if (super->type2 != 0) { tilePosition -= 0x40; @@ -229,11 +229,11 @@ void Object3E_Type8_Init(Object3EEntity* this) { void Object3E_Type8_Action1(Object3EEntity* this) { if ((gRoomTransition.frameCount & 3U) == 0) { - gScreen.controls.alphaBlend = ((0x10 - super->actionDelay) * 0x100) | super->actionDelay; - super->actionDelay++; + gScreen.controls.alphaBlend = ((0x10 - super->timer) * 0x100) | super->timer; + super->timer++; if (gScreen.controls.alphaBlend == 0x10) { super->action = 2; - super->actionDelay = 8; + super->timer = 8; super->spriteRendering.alphaBlend = 0; gScreen.controls.layerFXControl = 0; SetTile(0x4069, COORD_TO_TILE(super), super->collisionLayer); @@ -245,11 +245,11 @@ void Object3E_Type8_Action2(Object3EEntity* this) { static const u16 gUnk_08121738[] = { 0x14c, 0x14d, 0x14e, 0x14f, 0x150, 0x151, 0x150, 0x14f, 0x14e, 0x14d, 0x14c, 0, }; - if (--super->actionDelay == 0) { - super->actionDelay = 8; - ChangeObjPalette(super, gUnk_08121738[super->field_0xf++]); - if (gUnk_08121738[super->field_0xf] == 0) { - super->field_0xf = 0; + if (--super->timer == 0) { + super->timer = 8; + ChangeObjPalette(super, gUnk_08121738[super->subtimer++]); + if (gUnk_08121738[super->subtimer] == 0) { + super->subtimer = 0; } } } diff --git a/src/object/object42.c b/src/object/object42.c index 28a5df5c..5fa85943 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->actionDelay = 0x78; + super->timer = 0x78; this->unk_6c = 0xf0; InitializeAnimation(super, 0); sub_0808DDE8(this); @@ -55,9 +55,9 @@ void sub_0808DDE8(Object42Entity* this) { Entity* player; this->unk_6c--; if (sub_0807953C()) { - super->field_0xf++; + super->subtimer++; } - if (((0x1e < super->field_0xf) || ((gPlayerState.flags & 0x1810) != 0)) || (this->unk_6c == 0)) { + if (((0x1e < super->subtimer) || ((gPlayerState.flags & 0x1810) != 0)) || (this->unk_6c == 0)) { gPlayerState.flags &= 0xfffffbff; DeleteThisEntity(); } diff --git a/src/object/object43.c b/src/object/object43.c index b8d9edea..6a419c3a 100644 --- a/src/object/object43.c +++ b/src/object/object43.c @@ -39,7 +39,7 @@ void Object43_Init(Object43Entity* this) { super->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY; super->animationState = gPlayerEntity.animationState >> 1; super->direction = (((super->animationState + 1) & 3) << 3); - super->field_0xf = 6; + super->subtimer = 6; super->speed = 0x140; super->spriteVramOffset = 0x3c; super->palette.b.b0 = 4; @@ -48,13 +48,13 @@ void Object43_Init(Object43Entity* this) { super->updatePriority = 6; InitializeAnimation(super, 7); if (super->type2 != 0) { - super->actionDelay = 0x28; + super->timer = 0x28; } else { super->spriteSettings.draw = 1; if ((gPlayerState.skills & SKILL_FAST_SPIN) != 0) { - super->actionDelay = 0x28; + super->timer = 0x28; } else { - super->actionDelay = 0x50; + super->timer = 0x50; } Object43_Action1(this); @@ -99,13 +99,13 @@ void Object43_Action1(Object43Entity* this) { if (tmp1 != 0) { GetNextFrame(super); - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; tmp2 = 3; if ((super->type2 == 0) && ((gPlayerState.skills & SKILL_FAST_SPIN) == 0)) { tmp2 = 7; } - if ((super->actionDelay & tmp2) == 0) { + if ((super->timer & tmp2) == 0) { this->unk_6c++; } } else { @@ -148,8 +148,8 @@ void Object43_Action1(Object43Entity* this) { break; } - if (--super->field_0xf == 0) { - super->field_0xf = 6; + if (--super->subtimer == 0) { + super->subtimer = 6; super->direction ^= 0x10; } LinearMoveUpdate(super); diff --git a/src/object/object49.c b/src/object/object49.c index 12ad7e38..75998481 100644 --- a/src/object/object49.c +++ b/src/object/object49.c @@ -172,7 +172,7 @@ void sub_0808F3DC(Entity* this) { if (this->action == 0) { this->spriteSettings.draw = 1; this->action = 1; - this->actionDelay = 120; + this->timer = 120; InitializeAnimation(this, this->type + 1); // TODO: This block of code might supposed to be a switch statement. if (this->type != 8) { @@ -217,7 +217,7 @@ void sub_0808F498(Entity* this) { DeleteThisEntity(); } - if (this->actionDelay-- == 0) { + if (this->timer-- == 0) { DeleteThisEntity(); } @@ -226,7 +226,7 @@ void sub_0808F498(Entity* this) { } } else { this->action = 1; - this->actionDelay = 64; + this->timer = 64; var0 = this->type2 != 0 ? 44 : 43; this->x.HALF.HI -= this->parent->hitbox->width; this->x.HALF.HI += (s32)Random() % (this->parent->hitbox->width * 2); diff --git a/src/object/object4B.c b/src/object/object4B.c index b7dbc6ab..94fd9943 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->actionDelay = 0x3c; + super->timer = 0x3c; InitializeAnimation(super, 0); } void Object4B_Action1(Object4BEntity* this) { - if (--super->actionDelay == 0) { - super->actionDelay = 0x78; + if (--super->timer == 0) { + super->timer = 0x78; super->action++; super->spriteSettings.draw = 1; } @@ -57,13 +57,13 @@ void Object4B_Action2(Object4BEntity* this) { void Object4B_Action3(Object4BEntity* this) { GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action++; super->direction = 0; super->speed = 0x100; super->zVelocity = 0x20000; super->spriteOrientation.flipY = 0; - super->actionDelay = 0; + super->timer = 0; InitializeAnimation(super, 3); SoundReq(SFX_12B); } @@ -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->actionDelay = 0x78; + super->timer = 0x78; InitializeAnimation(super, 2); } } else if ((super->frame & ANIM_DONE) != 0) { @@ -94,7 +94,7 @@ void Object4B_Action4(Object4BEntity* this) { void Object4B_Action5(Object4BEntity* this) { GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action++; InitializeAnimation(super, 5); } @@ -104,14 +104,14 @@ void Object4B_Action6(Object4BEntity* this) { GetNextFrame(super); if ((super->frame & ANIM_DONE) != 0) { super->action++; - super->actionDelay = 0x3c; + super->timer = 0x3c; InitializeAnimation(super, 1); } } void Object4B_Action7(Object4BEntity* this) { GetNextFrame(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { gMenu.overlayType++; DeleteThisEntity(); } diff --git a/src/object/object53.c b/src/object/object53.c index 0e10371e..c4717fce 100644 --- a/src/object/object53.c +++ b/src/object/object53.c @@ -53,10 +53,10 @@ void sub_08091198(Entity* this) { case 0xff: break; case 0xf: - CreateFx(this, this->actionDelay, 0x80); + CreateFx(this, this->timer, 0x80); break; default: - CreateObjectWithParent(this, this->type2, this->actionDelay, 0); + CreateObjectWithParent(this, this->type2, this->timer, 0); break; } diff --git a/src/object/object61.c b/src/object/object61.c index 5756afdd..acf2c4af 100644 --- a/src/object/object61.c +++ b/src/object/object61.c @@ -73,17 +73,17 @@ void Object61_Action1Type0(Object61Entity* this) { this->unk_72 -= 4; break; case 2: - if (super->field_0xf == 0) { + if (super->subtimer == 0) { if (this->unk_72 > 0x80) { this->unk_72 -= 0x20; } else { - super->field_0xf += 1; + super->subtimer += 1; SoundReq(SFX_124); } if (this->unk_6e < 0x120) { this->unk_6e += 0x40; } - } else if (super->field_0xf != 0xff) { + } else if (super->subtimer != 0xff) { if (this->unk_72 < 0x100) { this->unk_72 += 0x20; } else { @@ -95,7 +95,7 @@ void Object61_Action1Type0(Object61Entity* this) { this->unk_6e = 0x100; } if (this->unk_6e == 0x100) { - super->field_0xf = 0xff; + super->subtimer = 0xff; } } else { sub_080936C8(this); @@ -146,12 +146,12 @@ void sub_080936C8(Object61Entity* this) { s32 tmp = gNewPlayerEntity.unk_7c; this->unk_76 = 0x138 - (gNewPlayerEntity.unk_7c >> 2); this->unk_74 = 8 - (tmp / 0x3c); - if (super->actionDelay == 0) { + if (super->timer == 0) { if (this->unk_76 < this->unk_6e) { this->unk_6e -= 8; this->unk_72 += 8; } else { - super->actionDelay++; + super->timer++; this->unk_6e = this->unk_76; this->unk_72 = this->unk_76 + 0x30; } @@ -160,7 +160,7 @@ void sub_080936C8(Object61Entity* this) { this->unk_6e += 8; this->unk_72 -= 8; } else { - super->actionDelay = 0; + super->timer = 0; this->unk_6e = this->unk_76 + 0x30; this->unk_72 = this->unk_76; } diff --git a/src/object/object63.c b/src/object/object63.c index 5cdd827e..120adaf5 100644 --- a/src/object/object63.c +++ b/src/object/object63.c @@ -25,7 +25,7 @@ void sub_08093D88(Entity* this) { this->action = 1; this->z.HALF.HI -= 8; this->zVelocity = 0x2a000; - this->actionDelay = 32; + this->timer = 32; switch (this->type) { case 0: if (CreateRandomItemDrop(this, 4) == 0) { @@ -36,7 +36,7 @@ void sub_08093D88(Entity* this) { case 1: objEnt = CreateObject(0, OBJECT_BLOCKING_STAIRS, 0); if (objEnt != NULL) { - objEnt->actionDelay = 5; + objEnt->timer = 5; sub_08093E10(this, objEnt); } break; @@ -44,11 +44,11 @@ void sub_08093D88(Entity* this) { } void sub_08093DE0(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; } - if ((this->actionDelay & 1) != 0) { + if ((this->timer & 1) != 0) { this->child->y.HALF.HI++; } } diff --git a/src/object/object67.c b/src/object/object67.c index 4f794dd6..dec36521 100644 --- a/src/object/object67.c +++ b/src/object/object67.c @@ -45,7 +45,7 @@ typedef struct { typedef struct { s8 x; s8 y; - u8 actionDelay; + u8 timer; u8 unk3; u8 unk4; u8 filler[3]; @@ -118,8 +118,8 @@ void sub_08094148(Object67Entity* this) { ptr = gUnk_081229F0 + super->type2; super->x.HALF.HI = ptr->x + super->x.HALF.HI; super->y.HALF.HI = ptr->y + super->y.HALF.HI; - super->actionDelay = ptr->actionDelay; - super->field_0xf = ptr->unk3; + super->timer = ptr->timer; + super->subtimer = ptr->unk3; this->unk7c = 0xce; this->unk74 = 0; if ((ptr->unk4 & 0x40) != 0) { @@ -144,7 +144,7 @@ void sub_08094148(Object67Entity* this) { super->hitbox->height = gUnk_080FD2E8.height; COLLISION_ON(super); super->collisionLayer = 2; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = 0x7a; super->flags2 = 1; @@ -220,8 +220,8 @@ void sub_08094424(Object67Entity* this) { super->action = 3; this->unk7c = 0x78; } else { - sub_0806FCF4(super, this->unk80.HALF.HI, 0x20, super->actionDelay); - sub_0806FCF4(super, this->unk84.HALF.HI, 0x20, super->field_0xf); + sub_0806FCF4(super, this->unk80.HALF.HI, 0x20, super->timer); + sub_0806FCF4(super, this->unk84.HALF.HI, 0x20, super->subtimer); SetAffineInfo(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0); } @@ -271,8 +271,8 @@ void sub_08094570(Object67Entity* this) { this->unk84.HALF.HI = this->unk84.HALF.HI + 1; uVar3 = this->unk84.HALF_U.HI; } - sub_0806FCF4(super, this->unk80.HALF.HI, 0x20, super->actionDelay); - sub_0806FCF4(super, this->unk84.HALF.HI, 0x20, super->field_0xf); + sub_0806FCF4(super, this->unk80.HALF.HI, 0x20, super->timer); + sub_0806FCF4(super, this->unk84.HALF.HI, 0x20, super->subtimer); SetAffineInfo(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0); } diff --git a/src/object/object68.c b/src/object/object68.c index d26bb550..f08b1659 100644 --- a/src/object/object68.c +++ b/src/object/object68.c @@ -58,7 +58,7 @@ void sub_08094774(Object68Entity* this) { } if (super->type2 == 0) { CopyPosition(super->child, super); - super->actionDelay = 0; + super->timer = 0; super->spritePriority.b0 = 0; super->spriteRendering.b3 = 0; sub_08094980(this, 0x403b, 0x403c); @@ -70,7 +70,7 @@ void sub_08094774(Object68Entity* this) { child = CreateGroundItem(&gPlayerEntity, ITEM_FAIRY, 0); super->child = child; if (child != NULL) { - child->actionDelay = 1; + child->timer = 1; } break; case 3 ... 8: @@ -88,9 +88,9 @@ void sub_080948D0(Object68Entity* this) { } void sub_080948E8(Object68Entity* this) { - if (super->actionDelay < 0x3c) { + if (super->timer < 0x3c) { super->z.WORD -= 0x4000; - if ((super->actionDelay & 3) == 0) { + if ((super->timer & 3) == 0) { super->child = CreateFx(super, FX_DASH, 0x40); if (super->child != NULL) { super->child->spriteRendering.b3 = super->spriteRendering.b3; @@ -102,7 +102,7 @@ void sub_080948E8(Object68Entity* this) { } } } - super->actionDelay++; + super->timer++; } else { DeleteThisEntity(); } diff --git a/src/object/object6A.c b/src/object/object6A.c index 79670b5a..83e29ec0 100644 --- a/src/object/object6A.c +++ b/src/object/object6A.c @@ -358,7 +358,7 @@ void sub_08094E30(Object6AEntity* this) { } } else if (super->action == 0) { super->action++; - switch (super->actionDelay) { + switch (super->timer) { case 1: InitializeAnimation(super, 2); break; @@ -414,7 +414,7 @@ void sub_08094FA8(Object6AEntity* this) { if (!CheckGlobalFlag(BIN_DOGFOOD)) { CreateItemEntity(0x1c, 0, 0); SetGlobalFlag(BIN_DOGFOOD); - super->actionDelay = 60; + super->timer = 60; } #else CreateItemEntity(0x1c, 0, 0); @@ -423,7 +423,7 @@ void sub_08094FA8(Object6AEntity* this) { break; #ifndef EU case 4: - if (!--super->actionDelay) { + if (!--super->timer) { super->action = 5; SetPlayerControl(1); } @@ -502,7 +502,7 @@ void sub_080951C4(Object6AEntity* this) { if (super->action == 0) { super->action++; super->z.HALF.HI = -16; - super->actionDelay = 0; + super->timer = 0; sub_0807DD64(super); InitializeAnimation(super, 3); } @@ -512,8 +512,8 @@ void sub_080951C4(Object6AEntity* this) { if (super->z.HALF.HI == 0) { super->z.WORD = 0; super->parent = NULL; - if (super->actionDelay == 0) { - super->actionDelay++; + if (super->timer == 0) { + super->timer++; SoundReq(230); } } @@ -550,8 +550,8 @@ void sub_08095288(Object6AEntity* this) { super->subAction = 0; SetAffineInfo(super, 0x100, 0x100, 0xC000); } else { - SetAffineInfo(super, 0x100, 0x100, super->actionDelay << 8); - super->actionDelay += 10; + SetAffineInfo(super, 0x100, 0x100, super->timer << 8); + super->timer += 10; LinearMoveUpdate(super); } } @@ -653,8 +653,8 @@ void sub_080954AC(Object6AEntity* this, u32 arg2) { void sub_080954DC(Object6AEntity* this) { switch (super->action) { case 0: - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } else { super->action++; super->subAction = 0; @@ -810,7 +810,7 @@ void sub_0809584C(Object6AEntity* this) { idx = super->health; if ((idx & 0x7F) != 0 && !ReadBit((u32*)gArea.filler5, idx - 1)) DeleteThisEntity(); - if (super->actionDelay != 0 && CheckKinstoneFused(super->type2)) + if (super->timer != 0 && CheckKinstoneFused(super->type2)) DeleteThisEntity(); if (super->action == 0) { super->action++; @@ -916,20 +916,20 @@ void sub_08095A8C(Object6AEntity* this) { break; case 2: super->action++; - super->actionDelay = 120; + super->timer = 120; case 3: super->spriteSettings.draw ^= 1; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 1; super->spriteSettings.draw = 1; } break; case 4: super->action++; - super->actionDelay = 120; + super->timer = 120; case 5: super->spriteSettings.draw ^= 1; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 1; super->spriteSettings.draw = 0; } @@ -1006,11 +1006,11 @@ void sub_08095C68(Object6AEntity* this) { super->action++; sub_080042D0(super, super->frameIndex, (u16)super->spriteIndex); } - if (super->actionDelay != 0) { - if (--super->actionDelay < 8) { + if (super->timer != 0) { + if (--super->timer < 8) { super->spriteSettings.draw ^= 1; } - if (super->actionDelay != 0) { + if (super->timer != 0) { return; } } @@ -1023,7 +1023,7 @@ void sub_08095CB0(Object6AEntity* this) { super->child = e; e->parent = super; CopyPosition(super, e); - e->actionDelay = 16; + e->timer = 16; e->frameIndex = super->frameIndex; e->lastFrameIndex = super->frameIndex; } @@ -1153,12 +1153,12 @@ void sub_08095F38(Object6AEntity* this) { ChangeObjPalette(super, pal); if ((gPlayerEntity.frame & 1) == 0) { local->anim = 0x8BF; - super->actionDelay = 52; - super->field_0xf = -75; + super->timer = 52; + super->subtimer = -75; } else { local->anim = 0x8E3; - super->actionDelay = 85; - super->field_0xf = -42; + super->timer = 85; + super->subtimer = -42; } CopyPosition(&gPlayerEntity, super); super->spritePriority.b0 = 3; @@ -1169,7 +1169,7 @@ void sub_08095F38(Object6AEntity* this) { } if ((u16)gPlayerEntity.spriteIndex != local->anim >> 8 || gPlayerEntity.animIndex != (u8)local->anim) DeleteThisEntity(); - tmp = gPlayerEntity.frameIndex - super->actionDelay + super->field_0xf; + tmp = gPlayerEntity.frameIndex - super->timer + super->subtimer; if (tmp != super->frameIndex) { super->frameIndex = tmp; sub_080042D0(super, super->frameIndex, (u16)super->spriteIndex); diff --git a/src/object/object74.c b/src/object/object74.c index 459880bc..828ad006 100644 --- a/src/object/object74.c +++ b/src/object/object74.c @@ -70,9 +70,9 @@ void sub_08097C20(Object74Entity* this) { SetPriorityTimer(0x1e); sub_0800445C(super); CreateMagicSparkles(super->x.HALF.HI, super->y.HALF.HI, super->collisionLayer); - if (--super->actionDelay == 0) { - super->actionDelay = 8; - tmp = ++super->field_0xf; + if (--super->timer == 0) { + super->timer = 8; + tmp = ++super->subtimer; gScreen.controls.alphaBlend = (((0x10 - tmp) * 0x100)) | tmp; if (gScreen.controls.alphaBlend == 0x10) { SetPlayerControl(CONTROL_ENABLED); @@ -95,8 +95,8 @@ void sub_08097CB4(Object74Entity* this) { super->action = 3; super->spriteSettings.draw = 1; super->spriteRendering.alphaBlend = 1; - super->actionDelay = 0x1e; - super->field_0xf = 0; + super->timer = 0x1e; + super->subtimer = 0; gScreen.controls.layerFXControl = 0xf40; gScreen.controls.alphaBlend = 0x1000; SoundReq(SFX_14A); diff --git a/src/object/object79.c b/src/object/object79.c index b90046a1..fdcf8824 100644 --- a/src/object/object79.c +++ b/src/object/object79.c @@ -42,8 +42,8 @@ void Object79_Init(Object79Entity* this) { super->speed = 0; this->unk6c = 0; this->unk7a = 0x1200; - super->actionDelay = 0; - super->field_0xf = 30; + super->timer = 0; + super->subtimer = 30; this->objDir.HALF.HI = Object79_Directions[super->type]; this->unk74 = 0x2000; SetDefaultPriority(super, 6); @@ -64,7 +64,7 @@ void Object79_Action1(Object79Entity* this) { if (super->type == 0) { UpdateAnimationSingleFrame(super); if (super->type2 != 0) { - gPlayerEntity.field_0xf = 0; + gPlayerEntity.subtimer = 0; super->action++; InitAnimationForceUpdate(super, 1); SoundReq(SFX_178); @@ -95,9 +95,9 @@ void Object79_Action2(Object79Entity* this) { this->objDir.WORD += this->unk74; this->objDir.HALF.HI = DirectionNormalize(this->objDir.HALF.HI); this->unk74 += 0x140; - if (super->field_0xf-- == 0) { - super->field_0xf = 30; - super->actionDelay ^= 1; + if (super->subtimer-- == 0) { + super->subtimer = 30; + super->timer ^= 1; } sub_08098130(this); } diff --git a/src/object/object7E.c b/src/object/object7E.c index a23b0e5c..b73ba84f 100644 --- a/src/object/object7E.c +++ b/src/object/object7E.c @@ -1,6 +1,6 @@ #include "global.h" #include "entity.h" -#include "coord.h" +#include "physics.h" void Object7E(Entity* this) { diff --git a/src/object/object81.c b/src/object/object81.c index ea5b8072..975fbd2b 100644 --- a/src/object/object81.c +++ b/src/object/object81.c @@ -24,7 +24,7 @@ void Object81(Entity* this) { void Object81_Init(Object81Entity* this) { super->action = 1; - super->actionDelay = 0; + super->timer = 0; this->tilePos = COORD_TO_TILE(super); if (gPlayerState.flags & PL_MINISH) { super->collisionLayer = 2; diff --git a/src/object/object86.c b/src/object/object86.c index bdaa2811..72f880e4 100644 --- a/src/object/object86.c +++ b/src/object/object86.c @@ -42,8 +42,8 @@ void sub_08099E58(Entity* this) { GetNextFrame(this); if (this->frame & ANIM_DONE) { this->frame &= ~0x80; - this->actionDelay++; - if (this->actionDelay == 3) { + this->timer++; + if (this->timer == 3) { this->action = 3; this->frameIndex = 4; } diff --git a/src/object/object8E.c b/src/object/object8E.c index 2c0ce508..5a4956c3 100644 --- a/src/object/object8E.c +++ b/src/object/object8E.c @@ -40,8 +40,8 @@ void Object8E_Type0(Object8EEntity* this) { switch (super->action) { case 0: super->action = 1; - super->actionDelay = 0x3c; - super->field_0xf = 0; + super->timer = 0x3c; + super->subtimer = 0; gRoomControls.camera_target = super; gRoomControls.unk5 = 1; if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) { @@ -55,19 +55,19 @@ void Object8E_Type0(Object8EEntity* this) { gScreen.controls.window0VerticalDimensions = 0xa0; break; case 1: - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } else { - if (super->field_0xf < 0x20) { + if (super->subtimer < 0x20) { if ((gRoomTransition.frameCount & 0x1fU) == 0) { SoundReq(SFX_133); } if ((gRoomTransition.frameCount & 3U) == 0) { - sub_0809B97C(this, ++super->field_0xf); + sub_0809B97C(this, ++super->subtimer); } } else { super->action = 2; - super->actionDelay = 0x3c; + super->timer = 0x3c; gScreen.lcd.displayControl &= 0xdfff; gRoomControls.camera_target = &gPlayerEntity; SoundReq(SFX_134); @@ -75,7 +75,7 @@ void Object8E_Type0(Object8EEntity* this) { } break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { gScreen.lcd.displayControl |= 0x4800; gRoomControls.unk5 = 4; (super->parent)->subAction = 1; @@ -114,8 +114,8 @@ void Object8E_Type1(Object8EEntity* this) { switch (super->action) { case 0: super->action = 1; - super->actionDelay = 0x3c; - super->field_0xf = 0x20; + super->timer = 0x3c; + super->subtimer = 0x20; gRoomControls.camera_target = super; gRoomControls.unk5 = 1; if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) { @@ -129,26 +129,26 @@ void Object8E_Type1(Object8EEntity* this) { gScreen.controls.window0VerticalDimensions = 0xa0; break; case 1: - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } else { - if (super->field_0xf != 0) { + if (super->subtimer != 0) { if ((gRoomTransition.frameCount & 0x1fU) == 0) { SoundReq(SFX_133); } if ((gRoomTransition.frameCount & 3U) == 0) { - sub_0809B97C(this, --super->field_0xf); + sub_0809B97C(this, --super->subtimer); } } else { super->action = 2; - super->actionDelay = 0x3c; + super->timer = 0x3c; gRoomControls.camera_target = &gPlayerEntity; SoundReq(SFX_134); } } break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { gRoomControls.unk5 = 4; gScreen.lcd.displayControl &= 0xd7ff; (super->parent)->subAction = 1; @@ -165,8 +165,8 @@ void Object8E_Type2(Object8EEntity* this) { switch (super->action) { case 0: super->action++; - super->actionDelay = 0x3c; - super->field_0xf = 0; + super->timer = 0x3c; + super->subtimer = 0; gRoomControls.camera_target = super; gRoomControls.unk5 = 1; if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) { @@ -180,8 +180,8 @@ void Object8E_Type2(Object8EEntity* this) { break; case 1: if (sub_0809BE78(this)) { - if (super->actionDelay != 0) { - if (--super->actionDelay == 0) { + if (super->timer != 0) { + if (--super->timer == 0) { gScreen.lcd.displayControl = (gScreen.lcd.displayControl & 0xbfff) | 0x2800; } } else { @@ -194,7 +194,7 @@ void Object8E_Type2(Object8EEntity* this) { } } else { super->action = 2; - super->actionDelay = 0x1e; + super->timer = 0x1e; gScreen.lcd.displayControl = (gScreen.lcd.displayControl & 0xdfff) | 0x4800; super->x.HALF.HI += 0x68; super->y.HALF.HI += 0x28; @@ -204,15 +204,15 @@ void Object8E_Type2(Object8EEntity* this) { } break; case 2: - if (sub_0809BE78(this) && (--super->actionDelay == 0)) { - super->actionDelay = 0x78; + if (sub_0809BE78(this) && (--super->timer == 0)) { + super->timer = 0x78; super->action = 3; SetLocalFlag(0x35); SoundReq(SFX_SECRET); } break; case 3: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->action = 4; gRoomControls.camera_target = &gPlayerEntity; gRoomControls.unk5 = 2; @@ -235,8 +235,8 @@ void Object8E_Type3(Object8EEntity* this) { switch (super->action) { case 0: super->action = 1; - super->actionDelay = 0x3c; - super->field_0xf = 0; + super->timer = 0x3c; + super->subtimer = 0; gRoomControls.camera_target = super; gRoomControls.unk5 = 1; if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) { @@ -251,8 +251,8 @@ void Object8E_Type3(Object8EEntity* this) { break; case 1: if (sub_0809BE78(this)) { - if (super->actionDelay != 0) { - if (--super->actionDelay == 0) { + if (super->timer != 0) { + if (--super->timer == 0) { SetFade(6, 8); sub_0805AAF0(3); gScreen.lcd.displayControl = (gScreen.lcd.displayControl & 0xbfff) | 0x2800; @@ -268,7 +268,7 @@ void Object8E_Type3(Object8EEntity* this) { } } else { super->action = 2; - super->actionDelay = 0x78; + super->timer = 0x78; gScreen.lcd.displayControl = (gScreen.lcd.displayControl & 0xdfff) | 0x4800; SetLocalFlag(0x37); SoundReq(SFX_134); @@ -277,7 +277,7 @@ void Object8E_Type3(Object8EEntity* this) { } break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { (super->parent)->subAction = 1; DeleteThisEntity(); } @@ -291,8 +291,8 @@ void Object8E_Type4(Object8EEntity* this) { switch (super->action) { case 0: super->action = 1; - super->actionDelay = 0x3c; - super->field_0xf = 0x80; + super->timer = 0x3c; + super->subtimer = 0x80; gRoomControls.camera_target = super; gRoomControls.unk5 = 1; if (super->x.HALF.HI > gPlayerEntity.x.HALF.HI) { @@ -303,23 +303,23 @@ void Object8E_Type4(Object8EEntity* this) { gPlayerEntity.animationState = tmp; break; case 1: - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; } else { - if (--super->field_0xf != 0) { + if (--super->subtimer != 0) { if ((gRoomTransition.frameCount & 0x1fU) == 0) { SoundReq(SFX_133); } } else { super->action = 2; - super->actionDelay = 0x3c; + super->timer = 0x3c; gRoomControls.camera_target = &gPlayerEntity; SoundReq(SFX_134); } } break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { gRoomControls.unk5 = 4; (super->parent)->subAction = 1; DeleteThisEntity(); diff --git a/src/object/object9.c b/src/object/object9.c index a3286f79..b73f2b8c 100644 --- a/src/object/object9.c +++ b/src/object/object9.c @@ -71,7 +71,7 @@ void sub_080838DC(Entity* this) { this->spriteOrientation.flipY = 1; this->spriteRendering.b3 = 0; this->spritePriority.b0 = 0; - this->actionDelay = 4; + this->timer = 4; this->child = NULL; this->action = 0; } @@ -93,8 +93,8 @@ void Object9_Init(Entity* this) { } void Object9_Action1(Entity* this) { - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; } else { if ((*(Entity**)(gUnk_03003DF0.unk_4 + 8) != NULL) && ((u8)(gUnk_03003DF0.unk_4[3] - 1) < 100)) { this->child = *(Entity**)(gUnk_03003DF0.unk_4 + 8); diff --git a/src/object/object96.c b/src/object/object96.c index 2ffac509..fde07cb0 100644 --- a/src/object/object96.c +++ b/src/object/object96.c @@ -24,7 +24,7 @@ typedef struct _struct_gUnk_08123FB0 { s16 speed; s16 y; u16 flag; - u8 actionDelay; + u8 timer; u8 unk1f; } struct_gUnk_08123FB0; @@ -77,7 +77,7 @@ void Object96_Init(Entity* this, const struct_gUnk_08123FB0* param_2) { this->speed = param_2->speed; this->y.HALF.HI -= param_2->y; this->z.WORD = 0; - this->actionDelay = param_2->actionDelay; + this->timer = param_2->timer; if ((this->direction & 0x80)) { dir = this->direction; if (dir == 0x81) { @@ -114,8 +114,8 @@ void Object96_Action2(Entity* this, const struct_gUnk_08123FB0* param_2) { LinearMoveUpdate(this); if (sub_080044EC(this, param_2->unk14) < 2) { - if (this->actionDelay) { - this->actionDelay--; + if (this->timer) { + this->timer--; this->zVelocity = param_2->unk14 << 3; } else { this->action++; diff --git a/src/object/object98.c b/src/object/object98.c index 798836dc..d39d7ea2 100644 --- a/src/object/object98.c +++ b/src/object/object98.c @@ -30,14 +30,14 @@ void sub_0809E360(Object98Entity* this) { Entity* projEnt; u32 index; - if (8 < super->actionDelay) { - super->actionDelay = 8; + if (8 < super->timer) { + super->timer = 8; } - if (0x48 - super->actionDelay > gEntCount) { - for (index = 0; index < super->actionDelay; index++) { + if (0x48 - super->timer > gEntCount) { + for (index = 0; index < super->timer; index++) { projEnt = CreateProjectile(GURUGURU_BAR_PROJECTILE); - projEnt->actionDelay = 14 + 12 * index; + projEnt->timer = 14 + 12 * index; projEnt->parent = super; } diff --git a/src/object/object99.c b/src/object/object99.c index e8bf6a33..e333f535 100644 --- a/src/object/object99.c +++ b/src/object/object99.c @@ -1,5 +1,5 @@ #include "entity.h" -#include "coord.h" +#include "physics.h" void Object99(Entity* this) { Entity* parent; diff --git a/src/object/object9B.c b/src/object/object9B.c index 82b7eebf..8bb9c2cc 100644 --- a/src/object/object9B.c +++ b/src/object/object9B.c @@ -1,6 +1,6 @@ #define NENT_DEPRECATED #include "entity.h" -#include "coord.h" +#include "physics.h" void sub_0809E7C0(Entity*); void sub_0809E7E0(Entity*); diff --git a/src/object/objectA2.c b/src/object/objectA2.c index 8091c484..68a79fe4 100644 --- a/src/object/objectA2.c +++ b/src/object/objectA2.c @@ -51,20 +51,20 @@ void sub_0809F374(Entity* this) { InitializeAnimation(this, 1); SoundReq(SFX_186); } else { - this->actionDelay++; + this->timer++; } } else { #endif switch (sub_080044EC(this, 0x2000)) { default: - this->actionDelay++; + this->timer++; break; case 0: this->action = 2; InitializeAnimation(this, 1); // fall through case 1: - this->actionDelay = 0; + this->timer = 0; sub_0809F448(this); SoundReq(SFX_186); } @@ -96,8 +96,8 @@ void sub_0809F408(Entity* this) { void sub_0809F448(Entity* this) { s32 tmp; int rand = Random(); - const struct_08124708* tmp2 = &gUnk_08124708[this->field_0xf]; - this->field_0xf++; + const struct_08124708* tmp2 = &gUnk_08124708[this->subtimer]; + this->subtimer++; tmp = 0x280000 - this->x.WORD; switch (tmp2->unk_0) { case 0: diff --git a/src/object/objectA6.c b/src/object/objectA6.c index fc77a54e..bea33868 100644 --- a/src/object/objectA6.c +++ b/src/object/objectA6.c @@ -29,7 +29,7 @@ void sub_0809F920(ObjectA6Entity* this) { super->action = 1; COLLISION_ON(super); - super->field_0x3c = 7; + super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = 1; super->flags2 = 2; @@ -39,7 +39,7 @@ void sub_0809F920(ObjectA6Entity* this) { void sub_0809F964(ObjectA6Entity* this) { Entity* fxEnt; - if (super->bitfield == 0xa1) { + if (super->contactFlags == 0xa1) { fxEnt = CreateFx(super, FX_MAGIC_STORM, 0); if (fxEnt != NULL) { fxEnt->spritePriority.b0 = 3; diff --git a/src/object/objectA8.c b/src/object/objectA8.c index 008a8d10..4f2c0c13 100644 --- a/src/object/objectA8.c +++ b/src/object/objectA8.c @@ -39,8 +39,8 @@ void ObjectA8(ObjectA8Entity* this) { ObjectA8_Init, ObjectA8_Action1, ObjectA8_Action2, ObjectA8_Action3, ObjectA8_Action4, ObjectA8_Action5, ObjectA8_Action6, }; - if ((super->bitfield & 0x80) != 0) { - switch (super->bitfield & 0x7f) { + if ((super->contactFlags & 0x80) != 0) { + switch (super->contactFlags & 0x7f) { case 0: case 1: case 4: @@ -74,12 +74,12 @@ void ObjectA8_Init(ObjectA8Entity* this) { return; } super->collisionLayer = 3; - super->field_0x3c = 0x17; + super->collisionFlags = 0x17; super->hurtType = 0x48; super->hitType = 7; super->flags2 = 0x17; super->hitbox = (Hitbox*)&gUnk_080FD1A8; - super->field_0x1c = 1; + super->gustJarFlags = 1; this->unk_74 = super->x.HALF.HI; this->unk_76 = super->y.HALF.HI; SetDefaultPriority(super, 3); @@ -89,13 +89,13 @@ void ObjectA8_Init(ObjectA8Entity* this) { void ObjectA8_Action1(ObjectA8Entity* this) { super->z.WORD -= 0xe000; if (super->frame != 0) { - if (super->actionDelay != 0) { - super->actionDelay *= 0x1e; + if (super->timer != 0) { + super->timer *= 0x1e; } else { - super->actionDelay = 0xf0; + super->timer = 0xf0; } super->action = 3; - super->field_0xf = 1; + super->subtimer = 1; super->speed = 0x80; } } @@ -111,12 +111,12 @@ void ObjectA8_Action2(ObjectA8Entity* this) { void ObjectA8_Action2Subaction0(ObjectA8Entity* this) { super->subAction = 1; - super->field_0x1d = 1; + super->gustJarTolerance = 1; super->spriteSettings.draw = 1; } void ObjectA8_Action2Subaction1(ObjectA8Entity* this) { - if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->bitfield & 0x7f) != 0x13) { + if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->contactFlags & 0x7f) != 0x13) { super->action = 3; } else { sub_0806F4E8(super); @@ -124,7 +124,7 @@ void ObjectA8_Action2Subaction1(ObjectA8Entity* this) { } void ObjectA8_Action2Subaction2(ObjectA8Entity* this) { - if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->bitfield & 0x7f) != 0x13) { + if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->contactFlags & 0x7f) != 0x13) { super->action = 3; } else { if (sub_0806F3E4(super)) { @@ -143,10 +143,10 @@ void ObjectA8_Action3(ObjectA8Entity* this) { 0, 0, }; - if (--super->field_0xf == 0) { + if (--super->subtimer == 0) { u32 rand = Random(); super->flags |= ENT_COLLIDE; - super->field_0xf = 0x20; + super->subtimer = 0x20; super->speed = gUnk_0812484C[rand >> 8 & 1]; if (sub_0809FE9C(this)) { super->direction = rand & 0x1f; @@ -159,10 +159,10 @@ void ObjectA8_Action3(ObjectA8Entity* this) { } ProcessMovement1(super); if ((AnyPrioritySet() == 0) && (super->type == 0)) { - if (((gRoomTransition.frameCount & 1) != 0) && (--super->actionDelay == 0)) { + if (((gRoomTransition.frameCount & 1) != 0) && (--super->timer == 0)) { sub_08081404(super, 0); } - if (super->actionDelay < 0x3c) { + if (super->timer < 0x3c) { super->spriteSettings.draw ^= 1; } } @@ -183,8 +183,8 @@ void ObjectA8_Action4(ObjectA8Entity* this) { void ObjectA8_Action5(ObjectA8Entity* this) { super->action = 6; - super->actionDelay = 0x80; - super->field_0xf = 6; + super->timer = 0x80; + super->subtimer = 6; super->flags &= ~ENT_COLLIDE; super->spriteSettings.draw = 1; super->spritePriority.b1 = 2; @@ -195,27 +195,27 @@ void ObjectA8_Action5(ObjectA8Entity* this) { void ObjectA8_Action6(ObjectA8Entity* this) { s32 tmp; Entity* child = super->child; - tmp = gSineTable[super->actionDelay] * 0xa00; + tmp = gSineTable[super->timer] * 0xa00; if (tmp < 0) { tmp += 0xffff; } super->x.HALF.HI = (s16)(tmp >> 0x10) + child->x.HALF.HI; - tmp = gSineTable[super->actionDelay + 0x40] * 0x500; + tmp = gSineTable[super->timer + 0x40] * 0x500; if (tmp < 0) { tmp += 0xffff; } super->y.HALF.HI = super->child->y.HALF.HI - (tmp >> 0x10); - super->actionDelay += 8; + super->timer += 8; super->z.HALF.HI = super->child->z.HALF.HI; super->spriteOrientation.flipY = super->child->spriteOrientation.flipY; super->spriteRendering.b3 = super->child->spriteRendering.b3; - if ((u8)(super->actionDelay - 0x41) < 0x7f) { + if ((u8)(super->timer - 0x41) < 0x7f) { super->spritePriority.b0 = 3; } else { super->spritePriority.b0 = 5; } - if (--super->field_0xf == 0) { - super->field_0xf = 6; + if (--super->subtimer == 0) { + super->subtimer = 6; if (((--super->spriteOffsetY) * 0x1000000) >> 0x18 < -0x16) { sub_08081404(super, 1); } diff --git a/src/object/objectA9.c b/src/object/objectA9.c index 6d9981ba..825aac96 100644 --- a/src/object/objectA9.c +++ b/src/object/objectA9.c @@ -30,8 +30,8 @@ void sub_0809FF28(Entity* this) { if (this->frame & 0x80) { this->action = 2; pEVar1 = this->parent; - pEVar1->flags = this->actionDelay; - pEVar1->spriteSettings.draw = this->field_0xf; + pEVar1->flags = this->timer; + pEVar1->spriteSettings.draw = this->subtimer; ((GenericEntity*)pEVar1)->field_0x6c.HALF.HI &= 0xef; } } diff --git a/src/object/objectAB.c b/src/object/objectAB.c index 767c5238..4a35930f 100644 --- a/src/object/objectAB.c +++ b/src/object/objectAB.c @@ -3,7 +3,7 @@ #include "flags.h" #include "asm.h" #include "player.h" -#include "coord.h" +#include "physics.h" extern void sub_0805B390(u32); diff --git a/src/object/objectAD.c b/src/object/objectAD.c index ca73277e..f128cb2f 100644 --- a/src/object/objectAD.c +++ b/src/object/objectAD.c @@ -19,7 +19,7 @@ void ObjectAD(Entity* this) { void sub_080A04A4(Entity* this) { this->action = 1; this->frameIndex = 4; - this->actionDelay = 0; + this->timer = 0; this->spriteRendering.b3 = 3; this->spritePriority.b0 = 7; this->z.WORD = 0; diff --git a/src/object/objectAF.c b/src/object/objectAF.c index cd7ebe6a..e0771380 100644 --- a/src/object/objectAF.c +++ b/src/object/objectAF.c @@ -1,6 +1,6 @@ #include "global.h" #include "entity.h" -#include "coord.h" +#include "physics.h" extern void sub_080A0640(Entity*); diff --git a/src/object/objectB.c b/src/object/objectB.c index fbf4ef50..a970a016 100644 --- a/src/object/objectB.c +++ b/src/object/objectB.c @@ -58,7 +58,7 @@ void ObjectB_Action1(ObjectBEntity* this) { return; } super->action = 2; - switch (super->actionDelay) { + switch (super->timer) { case 0: case 1: this->unk_68 = GiveItem(super->type, super->type2); @@ -69,14 +69,14 @@ void ObjectB_Action1(ObjectBEntity* this) { case 0x43: break; default: - SoundReq(SFX_109); + SoundReq(SFX_ITEM_GET); break; } break; case 2: GiveItem(super->type, super->type2); this->unk_68 = gUnk_080FD964[super->type].unk_6; - SoundReq(SFX_109); + SoundReq(SFX_ITEM_GET); break; case 5: tmp = GetInventoryValue((u32)super->type); @@ -98,7 +98,7 @@ void ObjectB_Action2(ObjectBEntity* this) { u32 messageIndex; if ((super->parent)->frame == 0x42) { super->action = 3; - switch (super->actionDelay) { + switch (super->timer) { case 1: case 3: case 4: @@ -135,7 +135,7 @@ void ObjectB_Action3(ObjectBEntity* this) { if ((super->parent)->action == 8) { return; } - switch (super->actionDelay) { + switch (super->timer) { case 0: case 1: case 2: diff --git a/src/object/objectB2.c b/src/object/objectB2.c index bd2c58b5..a791b9fb 100644 --- a/src/object/objectB2.c +++ b/src/object/objectB2.c @@ -10,7 +10,7 @@ void ObjectB2(Entity* this) { if (this->action == 0) { this->action = 1; - this->actionDelay = 0x10; + this->timer = 0x10; this->direction = this->type << 3; if (this->collisionLayer == 2) { layer = gUnk_0200D654; @@ -28,7 +28,7 @@ void ObjectB2(Entity* this) { if (this->speed < 0x41) { this->spriteSettings.draw ^= 1; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteThisEntity(); } } diff --git a/src/object/objectB4.c b/src/object/objectB4.c index 90c3b287..4e3cd462 100644 --- a/src/object/objectB4.c +++ b/src/object/objectB4.c @@ -1,7 +1,7 @@ #define NENT_DEPRECATED #include "entity.h" #include "menu.h" -#include "coord.h" +#include "physics.h" #include "object.h" extern void sub_0806FB00(Entity*, u32, u32, u32); @@ -33,23 +33,23 @@ void ObjectB4_Type0(Entity* this) { this->action = 1; this->spriteSettings.draw = 2; this->frameIndex = 9; - this->actionDelay = 8; - this->field_0xf = 0; + this->timer = 8; + this->subtimer = 0; this->spriteRendering.b3 = 1; this->spritePriority.b0 = 4; this->spriteOrientation.flipY = 1; sub_0806FB00(this, 0xbf, 0x48, 0x1e); break; case 1: - if ((this->field_0xf < 7) && (--this->actionDelay == 0)) { - this->actionDelay = 1; - pEVar3 = CreateObject(OBJECT_B4, 1, this->field_0xf); + if ((this->subtimer < 7) && (--this->timer == 0)) { + this->timer = 1; + pEVar3 = CreateObject(OBJECT_B4, 1, this->subtimer); if (pEVar3 != NULL) { CopyPosition(this, pEVar3); pEVar3->y.HALF.HI = 0x68; SortEntityBelow(this, pEVar3); } - this->field_0xf++; + this->subtimer++; } if (sub_0806FB38(this) || (1 < gMenu.menuType)) { @@ -57,14 +57,14 @@ void ObjectB4_Type0(Entity* this) { this->y.HALF.HI = 0x48; this->frameIndex = 10; this->action = 2; - while (this->field_0xf < 7) { - pEVar3 = CreateObject(OBJECT_B4, 1, this->field_0xf); + while (this->subtimer < 7) { + pEVar3 = CreateObject(OBJECT_B4, 1, this->subtimer); if (pEVar3 != NULL) { CopyPosition(this, pEVar3); pEVar3->y.HALF.HI = 0x68; SortEntityBelow(this, pEVar3); } - this->field_0xf++; + this->subtimer++; } pEVar3 = CreateObject(OBJECT_B4, 2, 0); @@ -112,16 +112,16 @@ void ObjectB4_Type2(Entity* this) { this->spritePriority.b0 = 0; this->spriteOrientation.flipY = 1; this->frameIndex = 11; - this->actionDelay = (Random() & 0x3f) + 0x40; - this->field_0xf = 0; + this->timer = (Random() & 0x3f) + 0x40; + this->subtimer = 0; } - if (--this->actionDelay == 0) { - this->actionDelay = 4; - this->frameIndex = gUnk_08124B30[this->field_0xf++] + 2; - if (gUnk_08124B30[this->field_0xf] == 0xff) { - this->actionDelay = (Random() & 0x3f) + 0x40; - this->field_0xf = 0; + if (--this->timer == 0) { + this->timer = 4; + this->frameIndex = gUnk_08124B30[this->subtimer++] + 2; + if (gUnk_08124B30[this->subtimer] == 0xff) { + this->timer = (Random() & 0x3f) + 0x40; + this->subtimer = 0; } } } diff --git a/src/object/objectB5.c b/src/object/objectB5.c index e23779b2..74605a68 100644 --- a/src/object/objectB5.c +++ b/src/object/objectB5.c @@ -1,7 +1,7 @@ #include "entity.h" #include "room.h" #include "player.h" -#include "coord.h" +#include "physics.h" void ObjectB5(Entity* this) { if (this->action == 0) { diff --git a/src/object/objectB6.c b/src/object/objectB6.c index aac1f103..0e2828b6 100644 --- a/src/object/objectB6.c +++ b/src/object/objectB6.c @@ -1,6 +1,6 @@ #define NENT_DEPRECATED #include "entity.h" -#include "coord.h" +#include "physics.h" void ObjectB6(Entity* this) { if (this->parent->subAction > 3) { diff --git a/src/object/objectBD.c b/src/object/objectBD.c index 6e12c57c..714eac33 100644 --- a/src/object/objectBD.c +++ b/src/object/objectBD.c @@ -68,8 +68,8 @@ NONMATCH("asm/non_matching/objectBD/sub_080A22C4.inc", void sub_080A22C4(Entity* switch (this->action) { case 0: sub_080A2340(this); - this->actionDelay = 8; - this->field_0xf = 0; + this->timer = 8; + this->subtimer = 0; this->subAction = this->frameIndex; this->speed = (Random() & 3) * 0x10 + 0x1e; break; @@ -81,11 +81,11 @@ NONMATCH("asm/non_matching/objectBD/sub_080A22C4.inc", void sub_080A22C4(Entity* this->action = 2; break; default: - if (--this->actionDelay != 0) { + if (--this->timer != 0) { return; } - this->actionDelay = 8; - this->field_0xf = tmp2 = (this->field_0xf + 1) & 3; + this->timer = 8; + this->subtimer = tmp2 = (this->subtimer + 1) & 3; tmp3 = this->subAction; tmp1 = tmp3 + tmp2; this->frameIndex = tmp1; diff --git a/src/object/objectBlockingStairs.c b/src/object/objectBlockingStairs.c index aa2108e0..b1274661 100644 --- a/src/object/objectBlockingStairs.c +++ b/src/object/objectBlockingStairs.c @@ -59,9 +59,9 @@ void ObjectBlockingStairs_Init(ObjectBlockingStairsEntity* this) { default: super->action = 1; super->speed = 0x80; - super->field_0x16 = 1; - super->actionDelay = 0; - super->field_0xf = 0; + super->carryFlags = 1; + super->timer = 0; + super->subtimer = 0; this->unk7a = 0x20; this->unk7b = 0x80; if (super->type == 0) { @@ -114,7 +114,7 @@ void ObjectBlockingStairs_Action1(ObjectBlockingStairsEntity* this) { super->action = 3; super->direction = Direction8FromAnimationState(gPlayerEntity.animationState); super->speed = 0x80; - super->actionDelay = 0x40; + super->timer = 0x40; RequestPriorityDuration(super, 0x50); EnqueueSFX(SFX_10F); sub_08093248(this); @@ -151,24 +151,24 @@ void ObjectBlockingStairs_Action1(ObjectBlockingStairsEntity* this) { } void ObjectBlockingStairs_Action2(ObjectBlockingStairsEntity* this) { - if (super->actionDelay) { + if (super->timer) { sub_08093280(this); } else { if (gPlayerState.heldObject == 0x12) { - if ((gPlayerEntity.frame & 2) != 0 && ++super->field_0xf > 8) { + if ((gPlayerEntity.frame & 2) != 0 && ++super->subtimer > 8) { gPlayerState.queued_action = 16; gPlayerState.field_0x38 = 0x40; gPlayerState.flags |= PL_BUSY; gPlayerEntity.x.HALF.LO = 0; gPlayerEntity.y.HALF.LO = 0; super->direction = (gPlayerEntity.animationState ^ 4) << 2; - super->actionDelay = 0x40; + super->timer = 0x40; EnqueueSFX(SFX_10F); sub_08093248(this); } } else if (super->subAction == 6) { super->action = 1; - super->field_0xf = 0; + super->subtimer = 0; } } } @@ -176,7 +176,7 @@ void ObjectBlockingStairs_Action2(ObjectBlockingStairsEntity* this) { void ObjectBlockingStairs_Action3(ObjectBlockingStairsEntity* this) { sub_0800445C(super); LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_08093334(this); } sub_08093364(this); @@ -255,7 +255,7 @@ void sub_08093248(ObjectBlockingStairsEntity* this) { void sub_08093280(ObjectBlockingStairsEntity* this) { sub_0800445C(super); LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { sub_08093334(this); } sub_08093364(this); @@ -328,7 +328,7 @@ void sub_08093364(ObjectBlockingStairsEntity* this) { s32 sVar1; Entity* dashEffectEnt; - if ((super->actionDelay & 3) == 0) { + if ((super->timer & 3) == 0) { dashEffectEnt = CreateObject(SPECIAL_FX, FX_DASH, 0); if (dashEffectEnt != NULL) { dashEffectEnt->parent = super; @@ -340,7 +340,7 @@ void sub_08093364(ObjectBlockingStairsEntity* this) { } sVar1 = dashEffectEnt->y.HALF.HI; - if (super->actionDelay & 8) { + if (super->timer & 8) { dashEffectEnt->y.HALF.HI = sVar1 + 8; } else { dashEffectEnt->y.HALF.HI = sVar1 - 8; diff --git a/src/object/objectD.c b/src/object/objectD.c index 89b72fa2..dc164b85 100644 --- a/src/object/objectD.c +++ b/src/object/objectD.c @@ -36,7 +36,7 @@ void sub_0808434C(ObjectDEntity* this) { super->action = 1; super->flags |= 0x80; super->spriteSettings.draw = 1; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hitType = 1; super->hurtType = 0x47; super->flags2 = 2; @@ -52,7 +52,7 @@ void sub_0808434C(ObjectDEntity* this) { } void sub_080843F8(ObjectDEntity* this) { - if (super->bitfield == 0x9c) { + if (super->contactFlags == 0x9c) { super->action = 2; super->flags &= 0x7f; CreateFx(super, FX_ICE, 0); diff --git a/src/object/objectE.c b/src/object/objectE.c index e7cee6bc..c5b05304 100644 --- a/src/object/objectE.c +++ b/src/object/objectE.c @@ -13,10 +13,10 @@ void ObjectE(Entity* this) { if (this->action == 0) { this->action = 1; - this->actionDelay = 0x14; + this->timer = 0x14; sub_08004168(this); } else { - if (this->actionDelay-- == 0) { + if (this->timer-- == 0) { sub_0807B7D8(0x35, COORD_TO_TILE(this), this->collisionLayer); CreateFx(this, FX_FALL_DOWN, 0x40); SoundReq(SFX_126); diff --git a/src/object/objectOnPillar.c b/src/object/objectOnPillar.c index 0433a93d..7f0456c8 100644 --- a/src/object/objectOnPillar.c +++ b/src/object/objectOnPillar.c @@ -80,7 +80,7 @@ void ObjectOnPillar_Init(ObjectOnPillarEntity* this) { super->spriteSettings.shadow = 1; super->spriteOffsetY = 4; super->hitbox = (Hitbox*)&gUnk_080FD1F4; - super->field_0x16 = 1; + super->carryFlags = 1; this->unk_72 = 0; super->collisionLayer = this->unk_7d >> 4; UpdateSpriteForCollisionLayer(super); diff --git a/src/object/objectOnSpinyBeetle.c b/src/object/objectOnSpinyBeetle.c index faba73b0..fe046591 100644 --- a/src/object/objectOnSpinyBeetle.c +++ b/src/object/objectOnSpinyBeetle.c @@ -55,14 +55,14 @@ void ObjectOnSpinyBeetle_Init(ObjectOnSpinyBeetleEntity* this) { super->flags |= ENT_COLLIDE; super->spritePriority.b0 = 6; super->spriteRendering.b3 = 2; - super->field_0xf = 0; + super->subtimer = 0; super->hitType = 0x6e; super->flags2 = 0x86; - super->field_0x16 = 0; + super->carryFlags = 0; if (super->type != 0) { - super->field_0x1c = 2; + super->gustJarFlags = 2; } else { - super->field_0x1c = 1; + super->gustJarFlags = 1; } SortEntityBelow(super, super->parent); sub_08098918(this); @@ -75,8 +75,8 @@ void ObjectOnSpinyBeetle_Action1(ObjectOnSpinyBeetleEntity* this) { sub_080989C0(this); return; } - if ((super->bitfield & 0x80) != 0) { - switch (super->bitfield & 0x3f) { + if ((super->contactFlags & 0x80) != 0) { + switch (super->contactFlags & 0x3f) { case 0x13: super->action = 3; super->subAction = 0; @@ -139,7 +139,7 @@ void ObjectOnSpinyBeetle_Action2(ObjectOnSpinyBeetleEntity* this) { void ObjectOnSpinyBeetle_Action2Subaction0(ObjectOnSpinyBeetleEntity* this) { super->flags |= ENT_COLLIDE; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hitType = 1; super->flags2 = gPlayerEntity.flags2; super->spriteOffsetY = 0; @@ -202,12 +202,12 @@ void ObjectOnSpinyBeetle_Action3(ObjectOnSpinyBeetleEntity* this) { void ObjectOnSpinyBeetle_Action3Subaction0(ObjectOnSpinyBeetleEntity* this) { super->subAction = 1; - super->field_0x1d = 0x30; - super->actionDelay = 0; + super->gustJarTolerance = 0x30; + super->timer = 0; } void ObjectOnSpinyBeetle_Action3Subaction1(ObjectOnSpinyBeetleEntity* this) { - if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->bitfield & 0x7f) != 0x13) { + if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->contactFlags & 0x7f) != 0x13) { super->spriteOffsetX = 0; super->action = 1; } else { @@ -216,13 +216,13 @@ void ObjectOnSpinyBeetle_Action3Subaction1(ObjectOnSpinyBeetleEntity* this) { } void ObjectOnSpinyBeetle_Action3Subaction2(ObjectOnSpinyBeetleEntity* this) { - if (super->actionDelay == 0) { - super->actionDelay = 1; + if (super->timer == 0) { + super->timer = 1; super->spriteOffsetX = 0; super->spriteOffsetY = -2; (super->parent)->child = NULL; } - if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->bitfield & 0x7f) != 0x13) { + if ((gPlayerState.field_0x1c & 0xf) != 1 || (super->contactFlags & 0x7f) != 0x13) { sub_080989C0(this); } else { if ((sub_0806F3E4(super) != 0) && (super->type == 0)) { @@ -269,16 +269,16 @@ void sub_08098918(ObjectOnSpinyBeetleEntity* this) { CopyPosition(parent, super); tmp = parent->flags & 0x80; if ((parent->flags & ENT_COLLIDE) != 0) { - if (super->field_0xf == 0) { - super->field_0xf += 1; + if (super->subtimer == 0) { + super->subtimer += 1; super->spritePriority.b0 = 3; SortEntityBelow(super, super->parent); } super->z.HALF.HI = gUnk_08123558[parent->frame & 0xf] - 8; super->spriteOffsetY = 0; } else { - if (super->field_0xf != 0) { - super->field_0xf = tmp; + if (super->subtimer != 0) { + super->subtimer = tmp; super->spritePriority.b0 = 6; SortEntityBelow(super, super->parent); } diff --git a/src/object/octorokBossObject.c b/src/object/octorokBossObject.c index b7316b8c..7d47d15d 100644 --- a/src/object/octorokBossObject.c +++ b/src/object/octorokBossObject.c @@ -11,7 +11,7 @@ bool32 sub_0809A6F8(u32, u32, u32, u32); bool32 sub_0809A758(u32, u32); typedef struct HelperStruct { - u8 field_0x0; // [0,1,2,4] is later stored in this->field_0xf + u8 field_0x0; // [0,1,2,4] is later stored in this->subtimer u8 tailCount; u8 field_0x2; // [0,1] u8 field_0x3; // relates to this->field_0x7a.HALF.HI @@ -48,8 +48,8 @@ void OctorokBossObject_Init(Entity* this) { switch (this->type) { case 0: this->field_0x78.HALF.HI = 0x96; - this->actionDelay = 0; - this->field_0xf = 0x1e; + this->timer = 0; + this->subtimer = 0x1e; case 1: InitializeAnimation(this, 0); EnqueueSFX(SFX_124); @@ -115,14 +115,14 @@ void OctorokBossObject_Init(Entity* this) { InitializeAnimation(this, 7); break; case 7: - this->actionDelay = 0; + this->timer = 0; InitializeAnimation(this, 8); CopyPosition(this->parent, this); break; case 8: this->type2 = this->parent->field_0x7c.BYTES.byte0; - this->actionDelay = 4; - this->field_0xf = 0; + this->timer = 4; + this->subtimer = 0; this->field_0x82.HWORD = (this->x.HALF.HI - (gRoomControls.origin_x)) & 0x1f0; this->field_0x80.HWORD = (this->y.HALF.HI - ((u32)gRoomControls.origin_y)) & 0x1f0; *(int*)&this->cutsceneBeh = @@ -153,8 +153,8 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc", case 0: if (this->field_0x78.HALF.HI != 0) { this->field_0x78.HALF.HI--; - if (this->field_0xf-- == 0) { - this->field_0xf = 5; + if (this->subtimer-- == 0) { + this->subtimer = 5; this->child = CreateObjectWithParent(this, OCTOROK_BOSS_OBJECT, 1, this->type2); if (this->child != NULL) { this->child->parent = this->parent; @@ -166,18 +166,18 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc", return; } case 1: - this->direction = sub_080045DA(GET_HELPER(this)->tailObjects[this->actionDelay]->x.WORD - this->x.WORD, - GET_HELPER(this)->tailObjects[this->actionDelay]->y.WORD - this->y.WORD); + this->direction = sub_080045DA(GET_HELPER(this)->tailObjects[this->timer]->x.WORD - this->x.WORD, + GET_HELPER(this)->tailObjects[this->timer]->y.WORD - this->y.WORD); LinearMoveAngle(this, this->speed, this->direction); - if (EntityInRectRadius(this, GET_HELPER(this)->tailObjects[this->actionDelay], 2, 2) == 0) { + if (EntityInRectRadius(this, GET_HELPER(this)->tailObjects[this->timer], 2, 2) == 0) { return; } if (this->type == 0) { - GET_HELPER(this)->tailObjects[this->actionDelay]->spriteSettings.draw &= -2; + GET_HELPER(this)->tailObjects[this->timer]->spriteSettings.draw &= -2; } - if ((u32)this->actionDelay == GET_HELPER(this)->tailCount - 1) { + if ((u32)this->timer == GET_HELPER(this)->tailCount - 1) { this->action = 2; - this->actionDelay = 0xf0; + this->timer = 0xf0; 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) { @@ -187,7 +187,7 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc", this->parent->subAction = 0; return; } - this->actionDelay += 1; + this->timer += 1; return; case 2: if (this->parent->type2 == 3) { @@ -250,25 +250,25 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc", (u32)gUnk_0812388C[(u32)this->type2 * 2]); return; case 7: - if (this->actionDelay == 0) { + if (this->timer == 0) { CopyPosition(this->parent, this); return; } DeleteThisEntity(); break; case 8: - if (this->actionDelay-- != 0) { + if (this->timer-- != 0) { return; } - this->actionDelay = 4; - this->field_0xf++; - t2 = t1 = (*(int*)&this->cutsceneBeh) - this->field_0xf * 0x1f; + this->timer = 4; + this->subtimer++; + t2 = t1 = (*(int*)&this->cutsceneBeh) - this->subtimer * 0x1f; this->field_0x7c.HALF_U.HI = this->field_0x82.HWORD; this->field_0x7a.HWORD = this->field_0x82.HWORD; - this->field_0x7c.HALF_U.LO = this->field_0x80.HWORD - this->field_0xf * 0x10; + this->field_0x7c.HALF_U.LO = this->field_0x80.HWORD - this->subtimer * 0x10; this->field_0x78.HWORD = this->field_0x7c.HALF.LO; tmp_c = sub_0809A6F8(this->field_0x7a.HWORD, this->field_0x78.HWORD, t1, this->type2); - for (loop_var = this->field_0xf; loop_var != 0; loop_var--) { + for (loop_var = this->subtimer; loop_var != 0; loop_var--) { this->field_0x7a.HWORD -= 0x10; this->field_0x78.HWORD += 0x10; t1 += 0x1e; @@ -278,13 +278,13 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc", t2 += 0x20; tmp_c += sub_0809A6F8(this->field_0x7c.HALF_U.HI, this->field_0x7c.HALF_U.LO, t2, this->type2); } - t2 = t1 = (*(int*)&this->cutsceneBeh) + this->field_0xf * 0x1f; + t2 = t1 = (*(int*)&this->cutsceneBeh) + this->subtimer * 0x1f; this->field_0x7c.HALF.HI = this->field_0x82.HWORD; this->field_0x7a.HWORD = this->field_0x82.HWORD; - this->field_0x7c.HALF.LO = this->field_0xf * 0x10 + this->field_0x80.HWORD; + this->field_0x7c.HALF.LO = this->subtimer * 0x10 + this->field_0x80.HWORD; this->field_0x78.HWORD = this->field_0x7c.HALF.LO; tmp_c += sub_0809A6F8(this->field_0x7a.HWORD, this->field_0x78.HWORD, t1, this->type2); - for (loop_var = this->field_0xf - 1; loop_var != 0; loop_var--) { + for (loop_var = this->subtimer - 1; loop_var != 0; loop_var--) { this->field_0x7a.HWORD -= 0x10; this->field_0x78.HWORD -= 0x10; t1 -= 0x20; @@ -314,7 +314,7 @@ void OctorokBossObject_Action2(Entity* this) { s32 radius; GetNextFrame(this); - if (this->actionDelay-- != 0) { + if (this->timer-- != 0) { tmp = (0x10000 / this->parent->field_0x74.HWORD); radius = (this->speed * tmp) >> 8; this->field_0x7a.HALF.HI = -this->parent->field_0x7a.HALF.HI + this->direction; diff --git a/src/object/picoBloom.c b/src/object/picoBloom.c index de912b8a..37b6a751 100644 --- a/src/object/picoBloom.c +++ b/src/object/picoBloom.c @@ -26,14 +26,14 @@ void PicoBloom_Init(Entity* this) { nextAction = 2; } this->action = nextAction; - this->actionDelay = (Random() & 0x7f) + 0x7f; + this->timer = (Random() & 0x7f) + 0x7f; this->collisionLayer = 1; UpdateSpriteForCollisionLayer(this); InitializeAnimation(this, typeAnimationStates[this->type] + this->type2); } void PicoBloom_Action1(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action++; } } diff --git a/src/object/playerClone.c b/src/object/playerClone.c index 3e7eadab..29ecc16e 100644 --- a/src/object/playerClone.c +++ b/src/object/playerClone.c @@ -66,7 +66,7 @@ void PlayerClone_Action1(PlayerCloneEntity* this) { super->action = 2; super->updatePriority = 6; super->hitbox = (Hitbox*)&PlayerCloneHitbox; - super->field_0xf = (super->type + 1) * 15; + super->subtimer = (super->type + 1) * 15; this->unk78 = super->x.HALF.HI - gPlayerEntity.x.HALF.HI; this->unk7a = super->y.HALF.HI - gPlayerEntity.y.HALF.HI; if ((this->unk78 != 0) && (this->unk7a != 0)) { @@ -92,11 +92,11 @@ void PlayerClone_Action1(PlayerCloneEntity* this) { void PlayerClone_Action2(PlayerCloneEntity* this) { u32 index; - if (super->field_0xf == 1) { + if (super->subtimer == 1) { SoundReq(SFX_PLY_VO2); - super->field_0xf--; - } else if (super->field_0xf != 0) { - super->field_0xf--; + super->subtimer--; + } else if (super->subtimer != 0) { + super->subtimer--; } if (gPlayerState.chargeState.action == 5 && gPlayerClones[super->type] != NULL && gPlayerState.framestate != 19 && @@ -119,17 +119,17 @@ void PlayerClone_Action2(PlayerCloneEntity* this) { } if (index == 4) { - super->actionDelay = 0; + super->timer = 0; super->spriteSettings.draw = 1; return; } else { - if (super->actionDelay != 0) { - if (--super->actionDelay != 0) { + if (super->timer != 0) { + if (--super->timer != 0) { super->spriteSettings.draw ^= 1; return; } } else { - super->actionDelay = 30; + super->timer = 30; return; } } @@ -160,7 +160,7 @@ void sub_08084B1C(PlayerCloneEntity* this) { super->collisionLayer = gPlayerEntity.collisionLayer; super->flags2 = gPlayerEntity.flags2; super->hitType = gPlayerEntity.hitType; - super->field_0x3c = gPlayerEntity.field_0x3c; + super->collisionFlags = gPlayerEntity.collisionFlags; super->hurtType = gPlayerEntity.hurtType; CopyPosition(super, super->child); if (gPlayerState.field_0x3[1] != 0) { diff --git a/src/object/pot.c b/src/object/pot.c index b75999d6..18f69ed2 100644 --- a/src/object/pot.c +++ b/src/object/pot.c @@ -21,7 +21,7 @@ extern void sub_08016A6C(Entity*); void Pot(Entity* this) { gUnk_0811F090[this->action](this); - this->bitfield = 0; + this->contactFlags = 0; } void sub_0808222C(Entity* this) { @@ -33,13 +33,13 @@ void sub_0808222C(Entity* this) { this->hitbox = (Hitbox*)&gHitbox_18; this->speed = 0x80; this->y.HALF.HI += 3; - this->field_0x16 = 0; + this->carryFlags = 0; COLLISION_ON(this); this->health = 1; - this->field_0x3c = 7; + this->collisionFlags = 7; this->hitType = 0x6E; this->flags2 = 0x84; - this->field_0x1c = 0x12; + this->gustJarFlags = 0x12; if (this->collisionLayer == 0) { ResolveCollisionLayer(this); } @@ -55,7 +55,7 @@ void sub_0808222C(Entity* this) { void sub_08082310(Entity* this) { u32 tileType; - u32 var0 = this->bitfield & 0x7F; + u32 var0 = this->contactFlags & 0x7F; switch (var0) { case 0x13: this->action = 3; @@ -80,11 +80,11 @@ void sub_08082310(Entity* this) { case 0x4002: case 0x4001: this->direction = (tileType - 0x4001) * 8; - this->actionDelay = 32; + this->timer = 32; this->action = 4; if (gPlayerState.flags & PL_MINISH) { this->speed >>= 1; - this->actionDelay = 64; + this->timer = 64; } SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); EnqueueSFX(SFX_10F); @@ -117,7 +117,7 @@ void sub_080824F8(Entity* this) { void sub_08082510(Entity* this) { COLLISION_ON(this); this->hitbox = (Hitbox*)&gUnk_080FD340; - this->field_0x3c = 7; + this->collisionFlags = 7; this->hitType = 1; this->flags2 = gPlayerEntity.flags2; this->spriteOffsetY = 0; @@ -170,7 +170,7 @@ void sub_08082614(Entity* this) { u32 tileType; sub_0800445C(this); - if (this->actionDelay-- != 0) { + if (this->timer-- != 0) { LinearMoveUpdate(this); sub_08016A6C(this); return; @@ -205,12 +205,12 @@ void sub_080826E4(Entity* this) { void sub_080826FC(Entity* this) { this->subAction = 1; - this->field_0x1d = 48; - this->actionDelay = 0; + this->gustJarTolerance = 48; + this->timer = 0; } void sub_0808270C(Entity* this) { - if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (this->bitfield & 0x7F) != 0x13) { + if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (this->contactFlags & 0x7F) != 0x13) { this->spriteOffsetX = 0; this->action = 1; SetTile(0x4000, COORD_TO_TILE(this), this->collisionLayer); @@ -220,14 +220,14 @@ void sub_0808270C(Entity* this) { } void sub_08082778(Entity* this) { - if (this->actionDelay == 0) { - this->actionDelay = 1; + if (this->timer == 0) { + this->timer = 1; this->spriteOffsetX = 0; this->spriteOffsetY = -2; SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); } - if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (this->bitfield & 0x7F) != 0x13) { + if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (this->contactFlags & 0x7F) != 0x13) { sub_08082850(this, NULL); } else { sub_0806F3E4(this); @@ -285,10 +285,10 @@ u32 sub_0808288C(Entity* this, u32 form, u32 arg2, u32 arg3) { entity = CreateObjectWithParent(this, GROUND_ITEM, form, arg2); if (entity != NULL) { if (arg3 == 2) { - entity->actionDelay = 5; + entity->timer = 5; entity->field_0x86.HWORD = this->field_0x86.HWORD; } else { - entity->actionDelay = 0; + entity->timer = 0; } } break; diff --git a/src/object/pressurePlate.c b/src/object/pressurePlate.c index b3231615..4536eeda 100644 --- a/src/object/pressurePlate.c +++ b/src/object/pressurePlate.c @@ -33,8 +33,8 @@ void PressurePlate(PressurePlateEntity* this) { sub_080888F4, }; - if (super->field_0xf) { - if (--super->field_0xf == 0) { + if (super->subtimer) { + if (--super->subtimer == 0) { this->dir = super->animationState; InitializeAnimation(super, super->animationState); } @@ -57,7 +57,7 @@ void sub_0808886C(PressurePlateEntity* this) { weight = sub_08088938(this) + get_standing_count(this); if (super->type + 2 <= weight) { super->action = 2; - super->field_0xf = 0; + super->subtimer = 0; super->animationState = 4; super->z.HALF.HI = 0; InitializeAnimation(super, 4); @@ -66,7 +66,7 @@ void sub_0808886C(PressurePlateEntity* this) { } else { if (weight > super->animationState) { if (super->type + 1 == weight) { - super->field_0xf = 4; + super->subtimer = 4; InitializeAnimation(super, weight + 1); } else { InitializeAnimation(super, weight); diff --git a/src/object/pullableLever.c b/src/object/pullableLever.c index 98b62c82..e3c762e4 100644 --- a/src/object/pullableLever.c +++ b/src/object/pullableLever.c @@ -17,7 +17,7 @@ typedef struct { /*0x68*/ u8 unk_68[8]; /*0x70*/ u16 pullLength; /*0x72*/ u16 leverPart; // lever part number? [0,1,2] - /*0x74*/ u8 actionDelay; + /*0x74*/ u8 timer; /*0x75*/ u8 unk_75; /*0x76*/ u16 necessaryPullLength; /*0x78*/ u8 unk_78[6]; @@ -49,7 +49,7 @@ void PullableLever(PullableLeverEntity* this) { case HANDLE: PullableLever_HandleActions[super->action](this); sub_0800445C(super); - gUnk_02021F00[this->actionDelay] = this->pullLength; + gUnk_02021F00[this->timer] = this->pullLength; break; case MIDDLE: PullableLever_MiddleActions[super->action](this); @@ -79,14 +79,14 @@ void PullableLever_HandleInit(PullableLeverEntity* this) { } else { super->hitbox = (Hitbox*)&gUnk_080FD270; } - super->field_0x16 = 1; + super->carryFlags = 1; super->x.HALF.HI += PullableLever_InitialOffsets[super->type2 * 2]; this->initialX = super->x.HALF.HI; super->y.HALF.HI += PullableLever_InitialOffsets[super->type2 * 2 + 1]; this->initialY = super->y.HALF.HI; CopyPosition(super, &entity1->base); this->necessaryPullLength = this->unk_7e; - this->actionDelay = super->actionDelay; + this->timer = super->timer; InitializeAnimation(super, super->type2); } } @@ -120,7 +120,7 @@ void PullableLever_HandleSubAction0(PullableLeverEntity* this) { } } this->unk_75 = 1; - super->field_0xf = 2; + super->subtimer = 2; } if (player->animationState >> 1 == super->type2) { if (gPlayerState.framestate == PL_STATE_PULL) { @@ -228,8 +228,8 @@ void sub_0809153C(PullableLeverEntity* this) { EnqueueSFX(SFX_BUTTON_PRESS); SetFlag(this->pulledFlag); } else { - if (--super->field_0xf == 0) { - super->field_0xf = 0x10; + if (--super->subtimer == 0) { + super->subtimer = 0x10; EnqueueSFX(SFX_10F); } } diff --git a/src/object/pullableMushroom.c b/src/object/pullableMushroom.c index 80d2c605..f4b1d794 100644 --- a/src/object/pullableMushroom.c +++ b/src/object/pullableMushroom.c @@ -49,7 +49,7 @@ void PullableMushroom(PullableMushroomEntity* this) { PullableMushroom_Action3, }; PullableMushroom_Actions[super->action](this); - super->bitfield = 0; + super->contactFlags = 0; } void PullableMushroom_Init(PullableMushroomEntity* this) { @@ -61,13 +61,13 @@ void PullableMushroom_Init(PullableMushroomEntity* this) { case 0: super->spritePriority.b0 = 4; super->hitbox = (Hitbox*)&gUnk_080FD224; - super->field_0x16 = 1; + super->carryFlags = 1; SetTile(0x4022, COORD_TO_TILE(super), super->collisionLayer); super->health = 1; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hitType = 0x6e; super->flags2 = 0x0e; - super->field_0x1c = 1; + super->gustJarFlags = 1; super->flags |= 0x80; super->spriteOffsetY = 4; break; @@ -77,10 +77,10 @@ void PullableMushroom_Init(PullableMushroomEntity* this) { super->hitbox = (Hitbox*)&gUnk_080FD224; super->flags |= 0x80; super->health = 1; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hitType = 0x6e; super->flags2 = 4; - super->field_0x1c = 1; + super->gustJarFlags = 1; super->action = 3; } InitializeAnimation(super, super->animationState + 9); @@ -135,7 +135,7 @@ void sub_0808ACEC(PullableMushroomEntity* this) { InitializeAnimation(super, 0); } - switch (super->bitfield & 0x7f) { + switch (super->contactFlags & 0x7f) { case 0x4: case 0x5: case 0x6: @@ -153,15 +153,15 @@ void sub_0808ACEC(PullableMushroomEntity* this) { COLLISION_OFF(super); super->animationState = sub_0806F5A4(super->knockbackDirection); super->subAction = 2; - super->actionDelay = 2; + super->timer = 2; break; case 0x13: super->action = 3; super->subAction = 0; break; default: - super->field_0xf = 0; - super->actionDelay = 0; + super->subtimer = 0; + super->timer = 0; RegisterCarryEntity(super); break; } @@ -170,7 +170,7 @@ void sub_0808ACEC(PullableMushroomEntity* this) { void sub_0808ADA0(PullableMushroomEntity* this) { if ((sub_0808B1F0(this, super->child) < 8) || (super->child == NULL)) { super->subAction += 1; - super->actionDelay = 2; + super->timer = 2; super->flags |= ENT_COLLIDE; super->animationState ^= 2; super->spritePriority.b0 = 4; @@ -199,7 +199,7 @@ void sub_0808ADF0(PullableMushroomEntity* this) { SoundReq(SFX_12E); } else { GetNextFrame(super); - if (((super->frame & ANIM_DONE) != 0) && (super->actionDelay-- == 0)) { + if (((super->frame & ANIM_DONE) != 0) && (super->timer-- == 0)) { InitializeAnimation(super, super->animationState + 0xd); } } @@ -220,7 +220,7 @@ void PullableMushroom_Action2(PullableMushroomEntity* this) { void sub_0808AEB0(PullableMushroomEntity* this) { static const u16 gUnk_081211E4[] = { 1024, 256, 2048, 512 }; u32 uVar1; - if (super->actionDelay != 0) { + if (super->timer != 0) { uVar1 = sub_0808B1F0(this, super->child); if ((gPlayerState.field_0x90 & gUnk_081211E4[super->animationState]) != 0) { GetNextFrame(super); @@ -231,10 +231,10 @@ void sub_0808AEB0(PullableMushroomEntity* this) { SoundReq(SFX_12F); } } - super->field_0xf = 1; + super->subtimer = 1; } else { - if (((super->field_0xf != 0) && (gPlayerEntity.action == 1)) && (gPlayerState.swim_state == 0)) { + if (((super->subtimer != 0) && (gPlayerEntity.action == 1)) && (gPlayerState.swim_state == 0)) { gPlayerState.queued_action = 0x1b; gPlayerState.field_0x38 = uVar1; gPlayerState.field_0x39 = super->direction ^ 0x10; @@ -243,7 +243,7 @@ void sub_0808AEB0(PullableMushroomEntity* this) { } } } else { - super->actionDelay = 1; + super->timer = 1; this->unk_7c = 1; super->animationState = AnimationStateFlip90(gPlayerEntity.animationState >> 1); super->direction = (super->animationState << 3); @@ -275,7 +275,7 @@ void PullableMushroom_Action3(PullableMushroomEntity* this) { }; funcs[super->subAction](this); - if ((((gPlayerState.field_0x1c & 0xf) != 1) || ((super->bitfield & 0x7f) != 0x13)) && (super->type == 1)) { + if ((((gPlayerState.field_0x1c & 0xf) != 1) || ((super->contactFlags & 0x7f) != 0x13)) && (super->type == 1)) { (super->parent)->action = 1; (super->parent)->subAction = 1; super->direction = DirectionTurnAround(super->parent->direction); diff --git a/src/object/pushableFurniture.c b/src/object/pushableFurniture.c index 70213732..4b9c269c 100644 --- a/src/object/pushableFurniture.c +++ b/src/object/pushableFurniture.c @@ -68,7 +68,7 @@ void PushableFurniture_Action1(PushableFurnitureEntity* this) { sub_0808FB68(this); } } else { - if (super->actionDelay != 0 && --super->actionDelay == 0) { + if (super->timer != 0 && --super->timer == 0) { EnqueueSFX(SFX_BUTTON_PRESS); } } @@ -79,11 +79,11 @@ void PushableFurniture_Action1(PushableFurnitureEntity* this) { case 0: if (sub_0808FECC(this)) { super->subAction = 1; - super->actionDelay = 0xc; + super->timer = 0xc; } break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->frameIndex = 1; super->subAction = 2; EnqueueSFX(SFX_80); @@ -146,7 +146,7 @@ bool32 sub_0808FC5C(PushableFurnitureEntity* this) { u8* puVar5; LinearMoveUpdate(super); - if (--super->actionDelay == 0) { + if (--super->timer == 0) { if ((super->type == 2) || (super->type == 4)) { super->spriteOffsetY = 0xfe; } else { @@ -155,7 +155,7 @@ bool32 sub_0808FC5C(PushableFurnitureEntity* this) { if (sub_080B1B0C(super)) { return 0; } - if (super->field_0xf == 0) { + if (super->subtimer == 0) { sub_0808FF50(this); return TRUE; } @@ -187,12 +187,12 @@ bool32 sub_0808FC5C(PushableFurnitureEntity* this) { } } if (this->unk_80 == 0) { - super->actionDelay = 4; + super->timer = 4; } else { - super->actionDelay = 0x18; + super->timer = 0x18; } if ((gPlayerState.flags & 0x80) == 0) { - super->actionDelay += 0x10; + super->timer += 0x10; } sub_0808FF50(this); return TRUE; @@ -215,19 +215,19 @@ void sub_0808FD44(PushableFurnitureEntity* this, u32 param_2) { } if ((gPlayerState.flags & 0x80) != 0) { super->speed = 0x40; - super->actionDelay = 0x20; + super->timer = 0x20; } else { super->speed = 0x80; - super->actionDelay = 0x10; + super->timer = 0x10; } } else { tmp = this->unk_7c; if ((gPlayerState.flags & 0x80) != 0) { super->speed = 0x40; - super->actionDelay = 0x40; + super->timer = 0x40; } else { super->speed = 0x80; - super->actionDelay = 0x20; + super->timer = 0x20; } } EnqueueSFX(SFX_10F); diff --git a/src/object/pushableGrave.c b/src/object/pushableGrave.c index 5e882fd7..f84681ea 100644 --- a/src/object/pushableGrave.c +++ b/src/object/pushableGrave.c @@ -86,23 +86,23 @@ void PushableGrave_Init(PushableGraveEntity* this) { void PushableGrave_Action1(PushableGraveEntity* this) { if (sub_0809785C(this)) { - RequestPriorityDuration(super, super->actionDelay); + RequestPriorityDuration(super, super->timer); } } void PushableGrave_Action2(PushableGraveEntity* this) { if (super->subAction == 0) { - if (--super->field_0xf == 0) { + if (--super->subtimer == 0) { super->subAction = 1; - super->field_0xf = 0x78; + super->subtimer = 0x78; gRoomControls.camera_target = super; gRoomControls.unk5 = 2; } } else { - if (--super->field_0xf == 0) { + if (--super->subtimer == 0) { super->action = 3; - super->actionDelay = 0x60; - super->field_0xf = 0x14; + super->timer = 0x60; + super->subtimer = 0x14; RequestPriorityDuration(super, 0x60); SoundReq(SFX_10F); } @@ -110,13 +110,13 @@ void PushableGrave_Action2(PushableGraveEntity* this) { } void PushableGrave_Action3(PushableGraveEntity* this) { - if (super->actionDelay != 0) { - super->actionDelay--; + if (super->timer != 0) { + super->timer--; LinearMoveUpdate(super); sub_0800445C(super); } else { - if (super->field_0xf != 0) { - super->field_0xf--; + if (super->subtimer != 0) { + super->subtimer--; } else { EnqueueSFX(SFX_SECRET); sub_080977F4(this); @@ -152,8 +152,8 @@ 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->actionDelay = 0x40; - super->field_0xf = 0; + super->timer = 0x40; + super->subtimer = 0; super->direction = 0; super->speed = 0x40; tilePosition = this->unk_68; @@ -177,8 +177,8 @@ bool32 sub_0809785C(PushableGraveEntity* this) { if (CheckFlags(this->pushedFlag) != 0) { super->action = 2; super->subAction = 0; - super->actionDelay = 0xf0; - super->field_0xf = 0x3c; + super->timer = 0xf0; + super->subtimer = 0x3c; super->direction = 0; super->speed = 0x40; RestorePrevTileEntity(this->unk_68, super->collisionLayer); diff --git a/src/object/pushableStatue.c b/src/object/pushableStatue.c index 3074fcff..c94f81fb 100644 --- a/src/object/pushableStatue.c +++ b/src/object/pushableStatue.c @@ -50,7 +50,7 @@ void PushableStatue_Init(PushableStatueEntity* this) { super->speed = 0x80; super->updatePriority = 3; super->hitbox = (Hitbox*)&gUnk_080FD1F4; - super->field_0x16 = 1; + super->carryFlags = 1; this->unk_86 = 0; sub_08089454(this); sub_080894C8(this); @@ -153,7 +153,7 @@ void PushableStatue_Action3(PushableStatueEntity* this) { } void PushableStatue_Action4(PushableStatueEntity* this) { - if (--super->actionDelay != 0) { + if (--super->timer != 0) { super->spriteSettings.draw ^= 1; } else { super->spriteSettings.draw = 1; @@ -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->actionDelay = 0x3c; + super->timer = 0x3c; } sub_0800445C(super); return FALSE; diff --git a/src/object/railtrack.c b/src/object/railtrack.c index cb6fb550..e021ac7e 100644 --- a/src/object/railtrack.c +++ b/src/object/railtrack.c @@ -47,7 +47,7 @@ void sub_080851AC(Entity* this) { void sub_08085264(Entity* this) { if (CheckFlags(this->field_0x86.HWORD)) { this->action = 2; - this->field_0xf = 8; + this->subtimer = 8; if (this->type == 1) { ClearFlag(this->field_0x86.HWORD); } @@ -59,9 +59,9 @@ void sub_08085264(Entity* this) { } void sub_080852B4(Entity* this) { - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->action = 3; - this->field_0xf = this->actionDelay; + this->subtimer = this->timer; this->field_0x7a.HWORD = CheckFlags(this->field_0x86.HWORD); this->animationState = (this->animationState + *(u8*)&this->field_0x7c) & 3; InitializeAnimation(this, this->animationState); @@ -84,15 +84,15 @@ void sub_08085308(Entity* this) { break; case 3: if (CheckFlags(this->field_0x86.HWORD) == *(u16*)&this->field_0x7a) { - this->field_0xf = 0xff; + this->subtimer = 0xff; } else { - this->field_0xf = 1; + this->subtimer = 1; } } - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->action = 2; - this->field_0xf = 8; + this->subtimer = 8; this->animationState = (this->animationState + *(u8*)&this->field_0x7c) & 3; InitializeAnimation(this, this->animationState); sub_0808543C(this); diff --git a/src/object/rupee.c b/src/object/rupee.c index 5bf774e2..f511f652 100644 --- a/src/object/rupee.c +++ b/src/object/rupee.c @@ -17,10 +17,10 @@ void sub_080869DC(Entity* ent) { ent->action = 1; ent->spriteSettings.draw = 0; ent->hitbox = (Hitbox*)&gUnk_080FD1A8; - ent->field_0x3c |= 16; + ent->collisionFlags |= 16; itemEntity = CreateObject(GROUND_ITEM, ent->type, 0); if (itemEntity != NULL) { - itemEntity->actionDelay = 10; + itemEntity->timer = 10; itemEntity->parent = ent; ent->child = itemEntity; CopyPosition(ent, itemEntity); diff --git a/src/object/smallIceBlock.c b/src/object/smallIceBlock.c index e9689baf..6ba2940f 100644 --- a/src/object/smallIceBlock.c +++ b/src/object/smallIceBlock.c @@ -60,7 +60,7 @@ void SmallIceBlock_Init(SmallIceBlockEntity* this) { super->action = 1; super->flags |= 0x80; super->updatePriority = 3; - super->field_0x3c = 7; + super->collisionFlags = 7; super->hurtType = 0x48; super->hitType = 1; super->flags2 = 0x80; @@ -79,7 +79,7 @@ void SmallIceBlock_Action1(SmallIceBlockEntity* this) { if (sub_0809963C(this)) { super->action = 3; - super->actionDelay = 0; + super->timer = 0; EnqueueSFX(SFX_ICE_BLOCK_MELT); SmallIceBlock_Action3(this); if (super->type == 0) { @@ -92,7 +92,7 @@ void SmallIceBlock_Action1(SmallIceBlockEntity* this) { switch (sub_08099618(tileType)) { case 1: super->action = 2; - super->actionDelay = 0x16; + super->timer = 0x16; super->direction = ((tileType - 0x5b) & 3) << 3; super->speed = 0x20; sub_080994B8(this); @@ -125,20 +125,20 @@ void SmallIceBlock_Action2(SmallIceBlockEntity* this) { void SmallIceBlock_Action3(SmallIceBlockEntity* this) { if (sub_0809963C(this) == 0) { - if (super->actionDelay >= 2) { - super->actionDelay -= 2; + if (super->timer >= 2) { + super->timer -= 2; } else { - super->actionDelay = 0; + super->timer = 0; } - if (super->actionDelay == 0) { + if (super->timer == 0) { super->action = 1; sub_0805EC60(super); return; } } else { - super->actionDelay++; + super->timer++; } - SetAffineInfo(super, 0x100, gUnk_08123748[super->actionDelay >> 5], 0); + SetAffineInfo(super, 0x100, gUnk_08123748[super->timer >> 5], 0); if (super->type == 1) { CreateGroundItemWithFlags(super, ITEM_SMALL_KEY, 0, this->unk_86); SoundReq(SFX_SECRET); @@ -147,7 +147,7 @@ void SmallIceBlock_Action3(SmallIceBlockEntity* this) { SoundReq(SFX_SECRET); } super->action = 4; - super->actionDelay = 0x3c; + super->timer = 0x3c; super->flags &= 0x7f; } @@ -157,14 +157,14 @@ void SmallIceBlock_Action4(SmallIceBlockEntity* this) { s32 x; s32 y; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { DeleteThisEntity(); } else { - if (super->actionDelay == 0x30) { + if (super->timer == 0x30) { SetTile(this->unk_6c, this->unk_70, super->collisionLayer); } - SetAffineInfo(super, 0x100, (0x3c - super->actionDelay) * 0x20 + 0x100, 0); - if ((super->actionDelay & 1) != 0) { + SetAffineInfo(super, 0x100, (0x3c - super->timer) * 0x20 + 0x100, 0); + if ((super->timer & 1) != 0) { obj = CreateObject(SPECIAL_FX, 0x11, 0x40); if (obj != NULL) { rand = Random(); @@ -209,9 +209,9 @@ bool32 sub_0809953C(SmallIceBlockEntity* this) { } ProcessMovement2(super); sub_0800445C(super); - if (super->actionDelay != 0) { + if (super->timer != 0) { super->speed += 0x10; - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->speed = 0x200; } } @@ -284,7 +284,7 @@ bool32 sub_0809963C(SmallIceBlockEntity* this) { } } } - if (super->bitfield == 0x87) { + if (super->contactFlags == 0x87) { return TRUE; } return FALSE; diff --git a/src/object/smoke.c b/src/object/smoke.c index 4ce9b8c4..a33cf5b3 100644 --- a/src/object/smoke.c +++ b/src/object/smoke.c @@ -14,10 +14,10 @@ void sub_0808A40C(Entity* this) { if (this->action == 0) { this->action = 1; - this->actionDelay = 0x28; + this->timer = 0x28; } - if (--this->actionDelay == 0) { - this->actionDelay = 0x40 - (Random() & 0x1f); + if (--this->timer == 0) { + this->timer = 0x40 - (Random() & 0x1f); ent = CreateObject(SMOKE, 1, 0); if (ent != NULL) { CopyPosition(this, ent); diff --git a/src/object/specialFx.c b/src/object/specialFx.c index dc51b4c4..9f00d303 100644 --- a/src/object/specialFx.c +++ b/src/object/specialFx.c @@ -228,20 +228,20 @@ void sub_08084694(SpecialFxObject* this) { void sub_080846B0(SpecialFxObject* this) { s32 tmp; - if (super->actionDelay != 0) { + if (super->timer != 0) { if (super->speed != 0) { super->speed -= 0x10; } LinearMoveUpdate(super); sub_080845DC(this); } else { - super->actionDelay = 1; + super->timer = 1; if ((super->animationState | 2) == 2) { super->direction = 0x1e; } else { super->direction = 2; } - if (super->field_0xf != 0) { + if (super->subtimer != 0) { super->spriteVramOffset++; tmp = (super->direction > 0x17 ? -1 : 1); super->direction += tmp; diff --git a/src/object/steam.c b/src/object/steam.c index eaf2938e..393888b5 100644 --- a/src/object/steam.c +++ b/src/object/steam.c @@ -22,8 +22,8 @@ void Steam(Entity* _this) { super->action = 1; super->spriteSettings.draw = 1; super->spriteRendering.alphaBlend = 1; - super->actionDelay = 1; - super->field_0xf = Random() & 0xf; + super->timer = 1; + super->subtimer = Random() & 0xf; this->unk_0x68 = action; super->collisionLayer = 2; ResolveCollisionLayer(super); @@ -49,13 +49,13 @@ void Steam(Entity* _this) { } } - if (--super->actionDelay == 0) { - super->actionDelay = 8; - super->field_0xf = (super->field_0xf + 1) & 0xf; + if (--super->timer == 0) { + super->timer = 8; + super->subtimer = (super->subtimer + 1) & 0xf; } - super->spriteOffsetX = gUnk_08123484[super->field_0xf]; - super->spriteOffsetY = gUnk_08123484[super->field_0xf] + *ptr; + super->spriteOffsetX = gUnk_08123484[super->subtimer]; + super->spriteOffsetY = gUnk_08123484[super->subtimer] + *ptr; } const u8 gUnk_08123484[] = { diff --git a/src/object/thoughtBubble.c b/src/object/thoughtBubble.c index 57ba5cae..0a622628 100644 --- a/src/object/thoughtBubble.c +++ b/src/object/thoughtBubble.c @@ -13,8 +13,8 @@ void ThoughtBubble(Entity* this) { void ThoughtBubble_Init(Entity* this) { this->action = 1; this->spriteSettings.draw = 1; - if (this->actionDelay == 0) { - this->actionDelay = 0x2d; + if (this->timer == 0) { + this->timer = 0x2d; } this->spriteOrientation.flipY = 1; InitializeAnimation(this, this->type2); @@ -28,7 +28,7 @@ void ThoughtBubble_Update(Entity* this) { this->z.HALF.HI = this->parent->z.HALF.HI; } if (this->type2 != 2) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteThisEntity(); } } diff --git a/src/object/treeHidingPortal.c b/src/object/treeHidingPortal.c index c4a0518a..696f469e 100644 --- a/src/object/treeHidingPortal.c +++ b/src/object/treeHidingPortal.c @@ -45,15 +45,15 @@ void sub_0809E86C(Entity* this) { } if (sub_0809E9A0() == 0x54) { this->action = 2; - this->actionDelay = 0xf; + this->timer = 0xf; SetPlayerControl(1); } } void sub_0809E8BC(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; - this->actionDelay = 0x3c; + this->timer = 0x3c; this->spriteSettings.draw = 0; sub_0809E96C(this); sub_0809E918(this); @@ -61,7 +61,7 @@ void sub_0809E8BC(Entity* this) { } void sub_0809E8EC(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { SetFlag(this->field_0x86.HWORD); SetPlayerControl(0); SoundReq(SFX_SECRET_BIG); diff --git a/src/object/treeThorns.c b/src/object/treeThorns.c index d6516f80..32602e48 100644 --- a/src/object/treeThorns.c +++ b/src/object/treeThorns.c @@ -1,6 +1,6 @@ #include "global.h" #include "entity.h" -#include "coord.h" +#include "physics.h" #include "room.h" #include "object.h" #include "hitbox.h" @@ -18,7 +18,7 @@ void TreeThorns(Entity* this) { this->frameIndex = 1; layer = &this->collisionLayer; *layer = 1; - this->field_0x3c = 7; + this->collisionFlags = 7; this->hurtType = 0x48; this->hitType = 0x7a; this->flags2 = 1; diff --git a/src/object/warpPoint.c b/src/object/warpPoint.c index a5f9e0ec..84949f45 100644 --- a/src/object/warpPoint.c +++ b/src/object/warpPoint.c @@ -34,7 +34,7 @@ void WarpPoint(Entity* this) { void sub_0808B474(Entity* this) { u32 tmp; this->action = 1; - this->field_0xf = 0; + this->subtimer = 0; tmp = gUnk_08121380[this->type]; this->palette.b.b0 = tmp; this->spritePriority.b0 = 6; @@ -51,12 +51,12 @@ void sub_0808B474(Entity* this) { if (!sub_0808B7C8(this)) return; this->action = 4; - this->field_0xf = 0x60; + this->subtimer = 0x60; 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->field_0xf + 0x10); + RequestPriorityDuration(this, this->subtimer + 0x10); } void sub_0808B530(Entity* this) { @@ -66,66 +66,66 @@ void sub_0808B530(Entity* this) { sub_0807CAC8(this->type); } this->action = 2; - this->field_0xf = 60; + this->subtimer = 60; EnqueueSFX(SFX_112); } } void sub_0808B564(Entity* this) { - if (!--this->field_0xf) { + if (!--this->subtimer) { this->action = 3; } else { - this->spriteSettings.draw = this->field_0xf & 2 ? 0 : 1; + this->spriteSettings.draw = this->subtimer & 2 ? 0 : 1; } } void sub_0808B590(Entity* this) { GetNextFrame(this); if (sub_0808B7C8(this)) { - if (this->actionDelay) + if (this->timer) return; this->action = 5; - this->field_0xf = 0x60; + this->subtimer = 0x60; 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->field_0xf + 0x10); + RequestPriorityDuration(this, this->subtimer + 0x10); SoundReq(SFX_113); } else { - this->actionDelay = 0; + this->timer = 0; } } void sub_0808B5E8(Entity* this) { u32 tmp; - if (!--this->field_0xf) { + if (!--this->subtimer) { this->action = 3; - this->actionDelay = 1; + this->timer = 1; gPlayerEntity.animationState = 4; gPlayerEntity.direction = DirectionSouth; return; } tmp = 0; - switch (this->field_0xf & 0x60) { + switch (this->subtimer & 0x60) { case 0x40: - if (this->field_0xf == 0x58) { + if (this->subtimer == 0x58) { SoundReq(SFX_114); } - if (!(this->field_0xf & 1)) { + if (!(this->subtimer & 1)) { tmp = 1; } break; case 0x20: - if (!(this->field_0xf & 3)) { + if (!(this->subtimer & 3)) { tmp = 1; } break; case 0: - if (!(this->field_0xf & 7)) { + if (!(this->subtimer & 7)) { if (gPlayerEntity.animationState == 4) { - if (this->field_0xf > 0x18) { + if (this->subtimer > 0x18) { tmp = 1; } } else { @@ -142,7 +142,7 @@ void sub_0808B5E8(Entity* this) { void sub_0808B684(Entity* this) { u32 tmp; - if (!--this->field_0xf) { + if (!--this->subtimer) { gRoomTransition.transitioningOut = 1; gRoomTransition.type = TRANSITION_DEFAULT; gRoomTransition.player_status.area_next = this->field_0x7c.BYTES.byte0; @@ -158,20 +158,20 @@ void sub_0808B684(Entity* this) { return; } tmp = 0; - switch (this->field_0xf & 0x60) { + switch (this->subtimer & 0x60) { case 0x40: - if (!(this->field_0xf & 7)) { + if (!(this->subtimer & 7)) { tmp = 1; } break; case 0x20: - if (!(this->field_0xf & 3)) { + if (!(this->subtimer & 3)) { tmp = 1; } break; case 0: - if (this->field_0xf > 0x10) { - if (!(this->field_0xf & 1)) { + if (this->subtimer > 0x10) { + if (!(this->subtimer & 1)) { tmp = 1; } } else { @@ -206,7 +206,7 @@ void sub_0808B73C(Entity* this) { u32 sub_0808B7C8(Entity* this) { if (!(gPlayerState.flags & PL_MINISH) && gPlayerState.framestate != PL_STATE_DIE && gPlayerEntity.health != 0 && sub_08079F8C() && EntityInRectRadius(this, &gPlayerEntity, 5, 5) && gPlayerEntity.z.HALF.HI == 0) { - if (this->actionDelay == 0 && gPlayerEntity.action == PLAYER_08072C9C) { + if (this->timer == 0 && gPlayerEntity.action == PLAYER_08072C9C) { ResetPlayerAnimationAndAction(); } return 1; @@ -217,7 +217,7 @@ u32 sub_0808B7C8(Entity* this) { void sub_0808B830(Entity* this) { Entity* tmp; this->action = 3; - this->actionDelay = 0; + this->timer = 0; this->spriteSettings.draw = 1; tmp = CreateObject(WARP_POINT, 0, 0); if (tmp) { diff --git a/src/object/waterfallOpening.c b/src/object/waterfallOpening.c index 34216c0d..b8f5d650 100644 --- a/src/object/waterfallOpening.c +++ b/src/object/waterfallOpening.c @@ -18,8 +18,8 @@ void sub_080A00B0(WaterfallOpeningEntity*); void WaterfallOpening(Entity* this) { if (this->action == 0) { this->action = 1; - this->actionDelay = 8; - this->field_0xf = 0; + this->timer = 8; + this->subtimer = 0; this->spriteRendering.b3 = 3; this->spritePriority.b0 = 7; this->frameIndex = WaterfallOpening_FrameIndices[this->type]; @@ -32,8 +32,8 @@ void WaterfallOpening(Entity* this) { case 0: if (--((WaterfallOpeningEntity*)this)->unk68 == 0) { ((WaterfallOpeningEntity*)this)->unk68 = 0x20; - this->actionDelay = 1; - this->field_0xf = 0; + this->timer = 1; + this->subtimer = 0; this->subAction = 1; this->type = 1; UnloadGFXSlots(this); @@ -46,7 +46,7 @@ void WaterfallOpening(Entity* this) { case 1: if (--((WaterfallOpeningEntity*)this)->unk68 == 0) { ((WaterfallOpeningEntity*)this)->unk68 = 0x2d; - this->actionDelay = 1; + this->timer = 1; this->subAction = 2; this->type = 2; UnloadGFXSlots(this); @@ -80,9 +80,9 @@ void WaterfallOpening(Entity* this) { } void sub_080A00B0(WaterfallOpeningEntity* this) { - if (--super->actionDelay == 0) { - super->actionDelay = 8; - super->frameIndex = super->field_0xf + WaterfallOpening_FrameIndices[super->type]; - super->field_0xf = (super->field_0xf + 1) & 3; + if (--super->timer == 0) { + super->timer = 8; + super->frameIndex = super->subtimer + WaterfallOpening_FrameIndices[super->type]; + super->subtimer = (super->subtimer + 1) & 3; } } diff --git a/src/object/whirlwind.c b/src/object/whirlwind.c index 7a843ab1..6017bbe7 100644 --- a/src/object/whirlwind.c +++ b/src/object/whirlwind.c @@ -34,7 +34,7 @@ void Whirlwind_Init(Entity* this) { this->hitbox = (Hitbox*)&gUnk_080FD320; this->flags |= ENT_COLLIDE; this->hitType = 1; - this->field_0x3c = 0x47; + this->collisionFlags = 0x47; this->hurtType = 0x44; this->flags2 = 0x80; this->spriteOrientation.flipY = 1; diff --git a/src/object/windTribeTeleporter.c b/src/object/windTribeTeleporter.c index 7dd0e600..c76a6190 100644 --- a/src/object/windTribeTeleporter.c +++ b/src/object/windTribeTeleporter.c @@ -75,19 +75,19 @@ void WindTribeTeleporter_Action1(WindTribeTeleporterEntity* this) { void WindTribeTeleporter_Action2(WindTribeTeleporterEntity* this) { switch (super->subAction) { case 0: - super->actionDelay = 0x1e; + super->timer = 0x1e; super->subAction++; break; case 1: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction++; - super->actionDelay = 0x1e; + super->timer = 0x1e; } break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction++; - super->actionDelay = 0x1e; + super->timer = 0x1e; SoundReq(SFX_113); } else { if ((gRoomTransition.frameCount & 7) == 0) { @@ -96,9 +96,9 @@ void WindTribeTeleporter_Action2(WindTribeTeleporterEntity* this) { } break; case 3: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction++; - super->actionDelay = 0x1e; + super->timer = 0x1e; } else { if ((gRoomTransition.frameCount & 3) == 0) { gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6; @@ -106,7 +106,7 @@ void WindTribeTeleporter_Action2(WindTribeTeleporterEntity* this) { } break; default: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { #if defined(DEMO_JP) || defined(JP) || defined(EU) #ifdef DEMO_JP SetLocalFlag(0xfc); @@ -131,23 +131,23 @@ void WindTribeTeleporter_Action3(WindTribeTeleporterEntity* this) { switch (super->subAction) { case 0: super->subAction = 1; - super->actionDelay = 0x1e; + super->timer = 0x1e; SoundReq(SFX_114); break; case 1: - if (--super->actionDelay != 0) { + if (--super->timer != 0) { if ((gRoomTransition.frameCount & 1) == 0) { gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6; } } else { super->subAction++; - super->actionDelay = 0x1e; + super->timer = 0x1e; } break; case 2: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction++; - super->actionDelay = 0x1e; + super->timer = 0x1e; } else { if ((gRoomTransition.frameCount & 3) == 0) { gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6; @@ -155,7 +155,7 @@ void WindTribeTeleporter_Action3(WindTribeTeleporterEntity* this) { } break; case 3: - if (--super->actionDelay == 0) { + if (--super->timer == 0) { super->subAction++; } else { if ((gRoomTransition.frameCount & 7) == 0) { diff --git a/src/objectUtils.c b/src/objectUtils.c index 247dc648..2640c180 100644 --- a/src/objectUtils.c +++ b/src/objectUtils.c @@ -1,6 +1,6 @@ #include "global.h" #include "entity.h" -#include "coord.h" +#include "physics.h" #include "room.h" #include "object.h" #include "functions.h" @@ -156,7 +156,7 @@ Entity* CreateGroundItem(Entity* parent, u32 form, u32 subtype) { ent = CreateObjectWithParent(parent, GROUND_ITEM, form, subtype); if (ent != NULL) { - ent->actionDelay = 5; + ent->timer = 5; } return ent; } @@ -166,7 +166,7 @@ Entity* CreateGroundItemWithFlags(Entity* parent, u32 form, u32 subtype, u32 fla ent = CreateObjectWithParent(parent, GROUND_ITEM, form, subtype); if (ent != NULL) { - ent->actionDelay = 5; + ent->timer = 5; ent->field_0x86.HWORD = flags; } return ent; diff --git a/src/coord.c b/src/physics.c similarity index 99% rename from src/coord.c rename to src/physics.c index fae242a2..9cc3b53b 100644 --- a/src/coord.c +++ b/src/physics.c @@ -3,7 +3,7 @@ #include "area.h" #include "player.h" #include "new_player.h" -#include "coord.h" +#include "physics.h" #include "common.h" #include "sound.h" #include "room.h" @@ -76,7 +76,7 @@ bool32 sub_0806F3E4(Entity* ent) { tmp_ent.base.y.HALF.HI = p[1] + gPlayerEntity.y.HALF.HI; LinearMoveDirection(ent, ent->knockbackSpeed, GetFacingDirection(ent, &tmp_ent.base)); if (sub_0800419C(&tmp_ent.base, ent, 4, 4)) { - u32 state = ent->field_0x1c & 0xF; + u32 state = ent->gustJarFlags & 0xF; if (state == 2) { Entity* item; ent->subAction = 3; @@ -98,7 +98,7 @@ bool32 sub_0806F3E4(Entity* ent) { } void sub_0806F4E8(Entity* ent) { - switch (ent->field_0x1d & 3) { + switch (ent->gustJarTolerance & 3) { case 2: ent->spriteOffsetX = -2; break; @@ -115,9 +115,9 @@ void sub_0806F4E8(Entity* ent) { } bool32 sub_0806F520(Entity* ent) { - if (ent->bitfield == 0x93) + if (ent->contactFlags == 0x93) return 1; - ent->field_0x3a &= ~4; + ent->gustJarState &= ~4; ent->spriteOffsetY = 0; return 0; } diff --git a/src/player.c b/src/player.c index 7ff0703a..835d7ec3 100644 --- a/src/player.c +++ b/src/player.c @@ -348,7 +348,7 @@ static void PlayerInit(Entity* this) { this->spritePriority.b0 = 0xc; this->spritePriority.b1 = 1; this->spriteSettings.shadow = 1; - this->field_0x16 = 0x20; + this->carryFlags = 0x20; this->flags2 = 8; this->hitType = 0x79; this->hitbox = (Hitbox*)&gPlayerHitbox; @@ -480,7 +480,7 @@ static void PlayerNormal(Entity* this) { } } - this->field_0x3c = 0; + this->collisionFlags = 0; this->spritePriority.b0 = 4; if (sub_0807AC54(this)) { return; @@ -645,7 +645,7 @@ static void PlayerBounceInit(Entity* this) { this->speed = BOUNCE_SPEED_FWD; this->knockbackDuration = 0; this->subAction++; - this->actionDelay = gPlayerState.field_0x38; + this->timer = gPlayerState.field_0x38; this->spriteIndex = 1; if ((gPlayerState.flags & PL_MINISH) == 0) { @@ -683,7 +683,7 @@ static void PlayerBounceUpdate(Entity* this) { return; } - if (this->actionDelay-- != 0) { + if (this->timer-- != 0) { this->zVelocity = Q_16_16(1.0); return; } @@ -698,7 +698,7 @@ static void PlayerBounceUpdate(Entity* this) { } this->spriteIndex = 1; - this->actionDelay = 8; + this->timer = 8; this->subAction++; if ((gPlayerState.flags & PL_MINISH) == 0) @@ -706,7 +706,7 @@ static void PlayerBounceUpdate(Entity* this) { } static void sub_08070E7C(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { gPlayerState.jump_status = 0; ResetPlayerAnimationAndAction(); } @@ -908,7 +908,7 @@ static void sub_08071130(Entity* this) { return; } - this->actionDelay = 6; + this->timer = 6; if (((gPlayerState.heldObject | gPlayerState.keepFacing) == 0) && ((gPlayerState.flags & PL_MINISH) == 0)) { if (gPlayerState.flags & PL_NO_CAP) { @@ -932,7 +932,7 @@ static void sub_08071208(Entity* this) { } } - if (this->actionDelay-- == 0) { + if (this->timer-- == 0) { gPlayerState.jump_status = 0; ResetPlayerAnimationAndAction(); } @@ -955,7 +955,7 @@ static void PlayerDrownInit(Entity* this) { this->spritePriority.b1 = 0; if (gPlayerState.flags & PL_MINISH) { - this->actionDelay = 0x3c; + this->timer = 0x3c; gPlayerState.animation = 0xc19; SoundReq(SFX_WATER_SPLASH); } else { @@ -980,7 +980,7 @@ static void sub_080712F0(Entity* this) { temp = FALSE; if ((gPlayerState.flags & PL_MINISH) != 0) { - if (--this->actionDelay == 0) + if (--this->timer == 0) temp = TRUE; } else if ((this->frame & ANIM_DONE) != 0) { if (this->animIndex != 0xce) @@ -1021,7 +1021,7 @@ static void PlayerUsePortal(Entity* this) { if (AreaIsDungeon() || gArea.portal_type == 3) { this->subAction = 7; - this->actionDelay = 30; + this->timer = 30; SetFade(7, 16); SoundReq(SFX_F8); } else { @@ -1058,7 +1058,7 @@ static void PortalJumpOnUpdate(Entity* this) { } } - this->actionDelay = 8; + this->timer = 8; if (gArea.portal_type != 3) { this->spritePriority.b0 = 3; @@ -1075,23 +1075,23 @@ static void PortalStandUpdate(Entity* this) { if ((gPlayerState.field_0xd & 0x84) == 0) { if (this->direction != gPlayerState.field_0xd) { - this->actionDelay = 8; + this->timer = 8; } - if (this->actionDelay-- == 0) { + if (this->timer-- == 0) { this->direction = gPlayerState.field_0xd; this->animationState = Direction8ToAnimationState(this->direction); this->zVelocity = Q_16_16(2.0); this->speed = JUMP_SPEED_FWD; this->action = PLAYER_MINISH; this->subAction = 7; - this->field_0xf = 0; + this->subtimer = 0; gPlayerState.animation = (gPlayerState.flags & PL_NO_CAP) ? 0x41C : 0x80C; gPlayerState.flags &= ~PL_USE_PORTAL; return; } this->direction = gPlayerState.field_0xd; } else { - this->actionDelay = 8; + this->timer = 8; } if (gArea.portal_type == 4) { @@ -1109,7 +1109,7 @@ static void PortalActivateInit(Entity* this) { gRoomControls.camera_target = NULL; gPauseMenuOptions.disabled = 1; this->subAction = 3; - this->field_0xf = 30; + this->subtimer = 30; gPlayerState.animation = 0x738; CreateObjectWithParent(this, EZLO_CAP, 1, 0); PutAwayItems(); @@ -1117,7 +1117,7 @@ static void PortalActivateInit(Entity* this) { } static void PortalActivateUpdate(Entity* this) { - if (this->field_0xf) + if (this->subtimer) return; UpdateAnimationSingleFrame(this); @@ -1129,7 +1129,7 @@ static void PortalActivateUpdate(Entity* this) { static void PortalShrinkInit(Entity* this) { this->subAction = 5; this->spritePriority.b1 = 0; - this->field_0xf = 0; + this->subtimer = 0; this->spriteRendering.b0 = 3; *(u32*)&this->field_0x80.HWORD = 0x100; *(u32*)&this->cutsceneBeh = 0x100; @@ -1200,8 +1200,8 @@ static void PortalShrinkUpdate(Entity* this) { *(u32*)&this->field_0x80 += uVar7; } if (*(u32*)&this->cutsceneBeh >= 0x340) { - this->actionDelay = 8; - this->field_0xf = 0x1e; + this->timer = 8; + this->subtimer = 0x1e; this->subAction = 6; } else { *(u32*)&this->cutsceneBeh += uVar5 * 2; @@ -1215,14 +1215,14 @@ static void PortalShrinkUpdate(Entity* this) { } static void PortalEnterUpdate(Entity* this) { - if (this->actionDelay == 0) { + if (this->timer == 0) { if (GravityUpdate(this, GRAVITY_RATE)) return; this->spriteSettings.draw = FALSE; if (gArea.portal_type == 3) { - if (--this->field_0xf == 0) + if (--this->subtimer == 0) sub_080717F8(this); return; } @@ -1233,15 +1233,15 @@ static void PortalEnterUpdate(Entity* this) { return; } - this->actionDelay--; + this->timer--; } static void PortalUnknownUpdate(Entity* this) { if (gFadeControl.active) return; - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; return; } @@ -1359,7 +1359,7 @@ static void PlayerTalkEzlo_MessageIdle(Entity* this) { else temp = 0; - if (this->child->actionDelay != 0) { + if (this->child->timer != 0) { if ((u8)(temp + 200) != this->animIndex) { gPlayerState.animation = temp + 0x3c8; return; @@ -1403,8 +1403,8 @@ static void PlayerPushInit(Entity* this) { if (this->type == 1) { // scripted push? this->speed = 0; - this->actionDelay = 0; - this->field_0xf = 1; + this->timer = 0; + this->subtimer = 1; } else { this->speed = (gPlayerState.flags & PL_MINISH) ? PUSH_SPEED / 2 : PUSH_SPEED; } @@ -1438,11 +1438,11 @@ static void PlayerPushUpdate(Entity* this) { gPlayerState.speed_modifier = 0; UpdateAnimationSingleFrame(this); if (this->type == 1) { - if (--this->field_0xf == 0) { - if (sPushFrames[this->actionDelay].frame != 0xff) { - this->field_0xf = sPushFrames[this->actionDelay].frame; - this->speed = sPushFrames[this->actionDelay].speed; - this->actionDelay++; + if (--this->subtimer == 0) { + if (sPushFrames[this->timer].frame != 0xff) { + this->subtimer = sPushFrames[this->timer].frame; + this->speed = sPushFrames[this->timer].speed; + this->timer++; } else { this->subAction++; return; @@ -1464,7 +1464,7 @@ static void sub_08071B60(Entity* this) { this->knockbackDuration = 0; PlayerWaitForScroll(this); // Final push? - this->field_0xf = 6; + this->subtimer = 6; if ((gPlayerState.flags & PL_MINISH) == 0) { gPlayerState.animation = 0x104; this->spriteIndex = 3; @@ -1537,7 +1537,7 @@ static void sub_08071CAC(Entity* this) { gPlayerState.animation = temp; this->subAction = 2; - this->actionDelay = 0xf0; + this->timer = 0xf0; SoundReq(SFX_PLY_VO7); } } @@ -1596,7 +1596,7 @@ static void sub_08071DB8(Entity* this) { } static void sub_08071DD0(Entity* this) { - this->actionDelay = gPlayerState.field_0x38; + this->timer = gPlayerState.field_0x38; if (gPlayerState.field_0x39 != 0) { gPlayerState.field_0x39 = 0; this->subAction = 2; @@ -1626,11 +1626,11 @@ static void sub_08071E04(Entity* this) { sub_080792D8(); if (sub_0807953C()) - this->actionDelay -= 2; + this->timer -= 2; else - this->actionDelay -= 1; + this->timer -= 1; - if ((s8)this->actionDelay < 1) + if ((s8)this->timer < 1) SetPlayerActionNormal(); } @@ -1639,7 +1639,7 @@ static void sub_08071E74(Entity* this) { GravityUpdate(this, GRAVITY_RATE); UpdatePlayerMovement(); - temp = this->actionDelay--; + temp = this->timer--; if (temp == 0) SetPlayerActionNormal(); } @@ -1695,7 +1695,7 @@ static void PlayerFrozen(Entity* this) { static void PlayerFrozenInit(Entity* this) { COLLISION_OFF(this); - this->actionDelay = 120; + this->timer = 120; this->subAction++; gPlayerState.animation = 0x294; PutAwayItems(); @@ -1718,12 +1718,12 @@ static void PlayerFrozenUpdate(Entity* this) { } else { if (gPlayerState.flags & PL_FROZEN) { if (sub_0807953C() != 0) { - this->actionDelay -= 3; + this->timer -= 3; this->spriteOffsetX = 2; } else { this->spriteOffsetX = 0; } - if ((s8)this->actionDelay > 0) { + if ((s8)this->timer > 0) { return; } } @@ -1753,15 +1753,15 @@ static void sub_0807204C(Entity* this) { static void sub_08072064(Entity* this) { this->subAction = 1; COLLISION_OFF(this); - this->actionDelay = gPlayerState.field_0x3a; + this->timer = gPlayerState.field_0x3a; gPlayerState.animation = gPlayerState.field_0x38 | (gPlayerState.field_0x39 << 8); ResetPlayerItem(); } static void sub_08072098(Entity* this) { UpdateAnimationSingleFrame(this); - if (this->actionDelay != 0) - if (this->actionDelay-- != 0) + if (this->timer != 0) + if (this->timer-- != 0) return; else ; @@ -1787,7 +1787,7 @@ static void sub_08072100(Entity* this) { this->spriteSettings.draw = 3; this->speed = 0x140; this->hitbox = (Hitbox*)&gPlayerHitbox; - this->actionDelay = gPlayerState.field_0x38; + this->timer = gPlayerState.field_0x38; this->subAction = 1; COLLISION_OFF(this); if (gPlayerState.field_0x39) @@ -1815,7 +1815,7 @@ static void sub_08072168(Entity* this) { } gPlayerState.field_0xd = this->direction; UpdatePlayerCollision(); - if (this->actionDelay-- == 0) { + if (this->timer-- == 0) { this->knockbackDuration = 0; COLLISION_ON(this); UpdateSpriteForCollisionLayer(this); @@ -1837,7 +1837,7 @@ static void PlayerPull(Entity* this) { static void sub_08072214(Entity* this) { this->subAction = 1; this->speed = PULL_SPEED; - this->actionDelay = gPlayerState.field_0x38; + this->timer = gPlayerState.field_0x38; this->direction = Direction8FromAnimationState(AnimationStateFlip180(this->animationState)); if ((gPlayerState.flags & PL_NO_CAP) == 0) { gPlayerState.animation = 0x34c; @@ -1852,7 +1852,7 @@ static void sub_08072260(Entity* this) { gPlayerState.speed_modifier = 0; UpdatePlayerMovement(); UpdateAnimationSingleFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { gPlayerState.flags &= ~PL_BUSY; if ((gPlayerState.flags & PL_NO_CAP) == 0) { gPlayerState.animation = 0x34c; @@ -1909,7 +1909,7 @@ static void sub_08072354(Entity* this) { this->spritePriority.b1 = 0; this->knockbackDuration = 0; this->subAction = 2; - this->actionDelay = 0x3c; + this->timer = 0x3c; gPlayerState.animation = 0x2c1; gPlayerState.flags &= ~PL_BURNING; UpdateSpriteForCollisionLayer(this); @@ -1919,7 +1919,7 @@ static void sub_08072354(Entity* this) { static void sub_080723D0(Entity* this) { UpdateAnimationSingleFrame(this); - if (this->actionDelay-- == 0) { + if (this->timer-- == 0) { this->spritePriority.b1 = 1; this->iframes = 20; ModHealth(-2); @@ -1948,13 +1948,13 @@ static void sub_08072454(Entity* this) { static void sub_0807246C(Entity* this) { this->subAction = 1; - this->actionDelay = gPlayerState.field_0x38; + this->timer = gPlayerState.field_0x38; gPlayerState.animation = 0x3c0; SoundReq(SFX_PLY_VO7); } static void sub_08072490(Entity* this) { - if (this->actionDelay-- != 0) { + if (this->timer-- != 0) { UpdateAnimationSingleFrame(this); UpdatePlayerMovement(); } else { @@ -2041,7 +2041,7 @@ static void PlayerRollInit(Entity* this) { this->direction = Direction8FromAnimationState(this->animationState); } this->subAction = 1; - this->actionDelay = 0; + this->timer = 0; ResetPlayerItem(); temp = gPlayerState.flags; if (gPlayerState.flags & PL_MINISH) { @@ -2066,7 +2066,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->bitfield & 0x80))) { + ((gPlayerState.flags & PL_MOLDWORM_RELEASED) == 0 && (this->iframes != 0) && (this->contactFlags & 0x80))) { gPlayerState.flags &= ~PL_ROLLING; if (CheckQueuedAction()) return; @@ -2076,9 +2076,9 @@ static void PlayerRollUpdate(Entity* this) { } this->direction = Direction8FromAnimationState(AnimationStateIdle(this->animationState)); - if (((gPlayerState.flags & PL_MINISH) == 0) && (this->actionDelay-- == 0)) { + if (((gPlayerState.flags & PL_MINISH) == 0) && (this->timer-- == 0)) { CreateFx(&gPlayerEntity, FX_DASH, 0x40); - this->actionDelay = 4; + this->timer = 4; } if ((gPlayerState.flags & PL_FLAGS2) == 0) { UpdateFloorType(); @@ -2183,14 +2183,14 @@ static void PlayerInHoleInit(Entity* this) { COLLISION_OFF(this); this->spritePriority.b0 = 7; this->spritePriority.b1 = 0; - this->actionDelay = 0; + this->timer = 0; gPlayerState.flags |= PL_IN_HOLE; if (gPlayerState.flags & PL_NO_CAP) { gPlayerState.animation = 0x950; } else { gPlayerState.animation = 0x61c; if (GetTileIndex(COORD_TO_TILE(this), this->collisionLayer) == 0x4020) { - this->actionDelay = 1; + this->timer = 1; } } SetTile(0x4070, COORD_TO_TILE(this), this->collisionLayer); @@ -2202,9 +2202,9 @@ static void PlayerInHoleInit(Entity* this) { static void PlayerInHoleUpdate(Entity* this) { if (this->frame & ANIM_DONE) { - if (this->actionDelay == 1) { + if (this->timer == 1) { this->subAction = 3; - this->actionDelay = 0x28; + this->timer = 0x28; this->spritePriority.b1 = 1; gPlayerState.animation = 0x624; return; @@ -2223,8 +2223,8 @@ static void PlayerInHoleUpdate(Entity* this) { static void sub_08072ACC(Entity* this) { if (gPlayerState.field_0xd == 0xff) { - this->field_0xf = 0; - } else if (this->field_0xf > 7) { + this->subtimer = 0; + } else if (this->subtimer > 7) { COLLISION_ON(this); this->direction = gPlayerState.field_0xd; this->zVelocity = JUMP_SPEED_HOLE_Z; @@ -2236,17 +2236,17 @@ static void sub_08072ACC(Entity* this) { RestorePrevTileEntity(COORD_TO_TILE(this), this->collisionLayer); } else { this->animationState = Direction8ToAnimationState(gPlayerState.field_0xd); - this->field_0xf++; + this->subtimer++; } } static void sub_08072B5C(Entity* this) { u32 temp; - sub_080042BA(this, ((0x28 - this->actionDelay) >> 4) + 1); + sub_080042BA(this, ((0x28 - this->timer) >> 4) + 1); sub_0806F948(this); - if (this->actionDelay != 0) { - this->actionDelay--; + if (this->timer != 0) { + this->timer--; return; } @@ -2311,7 +2311,7 @@ static void sub_08072C9C(Entity* this) { static void sub_08072CC0(Entity* this) { this->subAction = 1; COLLISION_OFF(this); - this->field_0xf = (gPlayerState.field_0x3a >> 2) + 1; + this->subtimer = (gPlayerState.field_0x3a >> 2) + 1; this->direction = gPlayerState.field_0x39; this->speed = 0x400; gPlayerState.animation = 0x524; @@ -2320,7 +2320,7 @@ static void sub_08072CC0(Entity* this) { static void sub_08072CFC(Entity* this) { sub_080042BA(this, 2); - if (this->field_0xf-- != 0) { + if (this->subtimer-- != 0) { LinearMoveUpdate(this); return; } @@ -2332,8 +2332,8 @@ static void sub_08072CFC(Entity* this) { this->zVelocity = gPlayerState.field_0x38 << 0xc; this->speed = 0x200; gPlayerState.animation = 0x810; - this->actionDelay = 5; - this->field_0xf = 0; + this->timer = 5; + this->subtimer = 0; ResetPlayerItem(); } @@ -2353,50 +2353,50 @@ static void sub_08072D54(Entity* this) { UpdateAnimationSingleFrame(this); sub_0806F854(this, 0, -12); - if (this->actionDelay != 0) { + if (this->timer != 0) { LinearMoveUpdate(this); - this->actionDelay--; + this->timer--; } else { uVar2 = GetTileType(sub_0806F730(this), this->collisionLayer); - switch (this->field_0xf) { + switch (this->subtimer) { case 0: if (sub_08007DD6(uVar2, sTileTable[gPlayerEntity.animationState >> 1])) { - this->actionDelay = 1; - this->field_0xf = 1; + this->timer = 1; + this->subtimer = 1; } break; case 1: if (sub_08007DD6(uVar2, sTileTable[gPlayerEntity.animationState >> 1])) { - this->actionDelay = 1; + this->timer = 1; } else { - this->field_0xf = 2; + this->subtimer = 2; } break; case 2: this->animationState ^= 4; if (sub_08007DD6(uVar2, sTileTable[gPlayerEntity.animationState >> 1]) != 0) { - this->actionDelay = 1; - this->field_0xf = 3; + this->timer = 1; + this->subtimer = 3; } this->animationState ^= 4; break; case 3: this->animationState ^= 4; if (sub_08007DD6(uVar2, sTileTable[gPlayerEntity.animationState >> 1])) { - this->actionDelay = 1; + this->timer = 1; } else { - this->field_0xf = 4; + this->subtimer = 4; } this->animationState ^= 4; break; } - if (this->actionDelay != 0) { + if (this->timer != 0) { LinearMoveUpdate(this); } else { UpdatePlayerMovement(); } - this->actionDelay = 0; + this->timer = 0; } if (!GravityUpdate(this, GRAVITY_RATE)) { @@ -2420,7 +2420,7 @@ static void sub_08072D54(Entity* this) { } else { gPlayerState.animation = 0x820; } - this->actionDelay = 6; + this->timer = 6; this->subAction = 3; this->knockbackDuration = 0; SoundReq(SFX_PLY_LAND); @@ -2429,7 +2429,7 @@ static void sub_08072D54(Entity* this) { } static void sub_08072F14(Entity* this) { - if (this->actionDelay-- != 0) { + if (this->timer-- != 0) { PlayerSetNormalAndCollide(); } else { UpdateAnimationSingleFrame(this); @@ -2738,7 +2738,7 @@ static void sub_08073504(Entity* this) { COLLISION_OFF(this); this->subAction = 6; this->speed = 16; - this->actionDelay = 30; + this->timer = 30; SoundReq(SFX_NEAR_PORTAL); } } @@ -2902,9 +2902,9 @@ static void sub_0807380C(Entity* this) { if (this->z.HALF.HI < -16) { GravityUpdate(this, GRAVITY_RATE / 16); } else { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->subAction = 7; - this->actionDelay = 60; + this->timer = 60; this->zVelocity = Q_16_16(2.0); } } @@ -2925,7 +2925,7 @@ void sub_08073884(Entity* this) { this->direction = 4 * tmp; } gPlayerState.animation = sAnims[this->animationState >> 1]; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { if (gPlayerState.field_0x39 != 0xff) DoExitTransition(&gUnk_0813AD88[gPlayerState.field_0x39]); else @@ -2999,7 +2999,7 @@ static void sub_080739EC(Entity* this) { if ((gPlayerState.jump_status & 0xC0) == 0) { if ((gPlayerState.jump_status & 0x20) && this->zVelocity == 0) { this->zVelocity = Q_16_16(2.5); - this->actionDelay = 10; + this->timer = 10; this->direction = 0xff; gPlayerState.jump_status += 2; gPlayerState.animation = 372; @@ -3067,8 +3067,8 @@ void sub_08073B8C(Entity* this) { if ((this->frame & 1) == 0) UpdateAnimationSingleFrame(this); COLLISION_OFF(this); - if (this->actionDelay != 0) { - --this->actionDelay; + if (this->timer != 0) { + --this->timer; return; } GravityUpdate(this, GRAVITY_RATE * 2); @@ -3079,14 +3079,14 @@ void sub_08073B8C(Entity* this) { return; } gPlayerState.jump_status++; - this->actionDelay = 15; + this->timer = 15; InitScreenShake(0x10, 0); SoundReq(SFX_14C); } } void sub_08073C30(Entity* this) { - if (!gPlayerState.field_0x3[1] || this->actionDelay-- == 0) { + if (!gPlayerState.field_0x3[1] || this->timer-- == 0) { sub_08073B60(this); } else { COLLISION_ON(this); @@ -3111,8 +3111,8 @@ static void sub_08073C80(Entity* this) { this->spriteSettings.shadow = 0; this->spriteRendering.b0 = 0; this->hitbox = (Hitbox*)&sMinishHitbox; - this->actionDelay = 0; - this->field_0xf = 2; + this->timer = 0; + this->subtimer = 2; this->knockbackDuration = 0; this->subAction = 1; LoadSwapGFX(this, 1, 2); @@ -3145,7 +3145,7 @@ static void sub_08073D20(Entity* this) { gPlayerState.framestate = PL_STATE_CAPE; if (gPlayerState.floor_type != SURFACE_SHALLOW_WATER && gPlayerState.floor_type != SURFACE_WATER) { gPlayerState.swim_state = 0; - this->field_0x3c &= ~4; + this->collisionFlags &= ~4; } if (!CheckQueuedAction() && this->subAction != 2) { if ((gPlayerState.flags & PL_HIDDEN) == 0) { @@ -3222,7 +3222,7 @@ static void sub_08073F4C(Entity* this) { LinearMoveUpdate(this); } else { COLLISION_OFF(this); - this->actionDelay = 30; + this->timer = 30; this->subAction++; this->spriteSettings.flipX = 0; *(u32*)&this->field_0x80.HWORD = 1152; @@ -3234,8 +3234,8 @@ static void sub_08073F4C(Entity* this) { } static void sub_08073FD0(Entity* this) { - if (this->actionDelay != 0) { - if (--this->actionDelay != 0) { + if (this->timer != 0) { + if (--this->timer != 0) { return; } if (this->spriteSettings.draw == 0) { @@ -3269,7 +3269,7 @@ static void sub_08074060(Entity* this) { this->speed = 0x100; this->spritePriority.b1 = 1; this->spriteSettings.shadow = 1; - this->field_0xf = 0; + this->subtimer = 0; this->subAction++; this->zVelocity = Q_16_16(2.0); gPlayerState.animation = 2060; @@ -3285,7 +3285,7 @@ void sub_080740D8(Entity* this) { u32 dir; UpdateAnimationSingleFrame(this); - if (!this->field_0xf) + if (!this->subtimer) dir = this->direction; else dir = DirectionTurnAround(this->direction); @@ -3311,7 +3311,7 @@ void sub_080740D8(Entity* this) { if (sub_080086B4(x, y, gUnk_080082DC)) LinearMoveUpdate(this); else - this->field_0xf = 1; + this->subtimer = 1; if (!GravityUpdate(this, GRAVITY_RATE)) PlayerSetNormalAndCollide(); } @@ -3369,7 +3369,7 @@ void SurfaceAction_6(Entity* this) { gPlayerState.swim_state = 0; } this->spritePriority.b0 = 4; - this->field_0x3c &= ~4; + this->collisionFlags &= ~4; } void SurfaceAction_7(Entity* this) { @@ -3514,7 +3514,7 @@ void SurfaceAction_ShallowWater(Entity* this) { } else { if (gPlayerState.swim_state) { COLLISION_ON(this); - this->field_0x3c &= ~4; + this->collisionFlags &= ~4; this->spritePriority.b0 = 4; gPlayerState.swim_state = 0; } @@ -3527,7 +3527,7 @@ void SurfaceAction_ShallowWater(Entity* this) { void SurfaceAction_SlopeGndWater(Entity* this) { if (gPlayerState.swim_state) { COLLISION_ON(this); - this->field_0x3c &= ~4; + this->collisionFlags &= ~4; this->spritePriority.b0 = 4; gPlayerState.swim_state = 0; } @@ -3588,7 +3588,7 @@ void SurfaceAction_Water(Entity* this) { } else { gPlayerState.swim_state = 0; this->spritePriority.b0 = 4; - this->field_0x3c &= ~4; + this->collisionFlags &= ~4; } if ((gPlayerState.swim_state & 0xF) || sub_08079C30(this)) { sub_08074808(this); @@ -3686,7 +3686,7 @@ void SurfaceAction_AutoLadder(Entity* this) { this->animationState = IdleNorth; this->collisionLayer = 3; gPlayerState.swim_state = 0; - this->field_0x3c &= ~4; + this->collisionFlags &= ~4; if ((this->y.HALF.HI & 0xF) <= 7) { gPlayerState.animation = 723; this->direction = DirectionSouth; @@ -3702,7 +3702,7 @@ void SurfaceAction_20(Entity* this) { if (gPlayerState.swim_state & 0x80) { Entity* e = CreateObjectWithParent(&gPlayerEntity, GROUND_ITEM, ITEM_RUPEE1, 0); if (e != NULL) { - e->actionDelay = 1; + e->timer = 1; UpdateSpriteForCollisionLayer(e); CloneTile(57, gPlayerState.field_0x22[0], this->collisionLayer); } @@ -3947,7 +3947,7 @@ void sub_08074F8C(Entity* this) { } if (this->frame & ANIM_DONE) { this->field_0x68.HALF.LO++; - this->actionDelay = 8; + this->timer = 8; this->animationState = IdleSouth; if (!gPlayerState.field_0x39) { gPlayerState.animation = 1024; @@ -3959,15 +3959,15 @@ void sub_08074F8C(Entity* this) { void sub_08074FEC(Entity* this) { UpdateAnimationSingleFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x68.HALF.LO++; - this->actionDelay = 4; + this->timer = 4; this->animationState = gPlayerState.field_0x3a; } } void sub_0807501C(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->animationState = gPlayerState.field_0x3a; if (!gPlayerState.field_0x39) { gPlayerState.animation = 1052; @@ -3978,7 +3978,7 @@ void sub_0807501C(Entity* this) { this->direction = Direction8FromAnimationState(this->animationState); this->speed = 200; this->zVelocity = 0x20000; - this->actionDelay = 8; + this->timer = 8; this->field_0x68.HALF.LO++; SoundReq(SFX_PLY_JUMP); } @@ -3995,7 +3995,7 @@ void sub_0807508C(Entity* this) { gPlayerState.flags &= ~PL_NO_CAP; gPlayerState.animation = DEFAULT_ANIM; } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->animationState = IdleSouth; this->subAction = 1; this->field_0x68.HALF.LO = 0; @@ -4016,7 +4016,7 @@ void sub_080750F4(Entity* this) { void sub_08075110(Entity* this) { this->field_0x68.HALF.LO++; - this->field_0xf = this->animationState; + this->subtimer = this->animationState; this->animationState = 0; gPlayerState.animation = 1844; gPlayerState.flags &= ~PL_NO_CAP; @@ -4035,12 +4035,12 @@ void sub_0807513C(Entity* this) { } if (this->frame & ANIM_DONE) { this->field_0x68.HALF.LO++; - this->actionDelay = 60; + this->timer = 60; } } void sub_0807518C(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->field_0x68.HALF.LO++; gPlayerState.animation = 969; } diff --git a/src/playerItem.c b/src/playerItem.c index 7ea36d9e..2c61016e 100644 --- a/src/playerItem.c +++ b/src/playerItem.c @@ -73,7 +73,7 @@ void ItemUpdate(Entity* this) { if (!EntityIsDeleted(this)) { gPlayerItemFunctions[this->id](this); - this->bitfield &= ~0x80; + this->contactFlags &= ~0x80; if (this->iframes != 0) { if (this->iframes > 0) this->iframes--; diff --git a/src/playerItem/playerItemBomb.c b/src/playerItem/playerItemBomb.c index 8d3e83e4..5eeafe7e 100644 --- a/src/playerItem/playerItemBomb.c +++ b/src/playerItem/playerItemBomb.c @@ -25,25 +25,25 @@ void PlayerItemBomb(PlayerItemBombEntity* this) { GetNextFrame(super); uVar2 = uVar1 = super->action; if (uVar1 != 0x03) { - if (super->actionDelay != 0) { + if (super->timer != 0) { if (*(u8*)&this->unk_68 == 7) { - super->actionDelay -= 1; + super->timer -= 1; } - if (super->actionDelay == 0) { - super->field_0xf = 0x50; + if (super->timer == 0) { + super->subtimer = 0x50; this->unk_68 = 0; super->spriteRendering.b0 = 3; SetAffineInfo(super, 0x100, 0x100, 0); } } else { - if (super->field_0xf != 0) { - if (super->field_0xf-- == 0x01) { + if (super->subtimer != 0) { + if (super->subtimer-- == 0x01) { if ((uVar1 == 0x02) && (super->subAction == 1)) { gPlayerState.heldObject = 0; } super->action = 0x03; super->spritePriority.b1 = 2; - super->actionDelay = 0x0f; + super->timer = 0x0f; super->spriteSettings.draw = 0; sub_0805EC60(super); FreeCarryEntity(super); @@ -63,15 +63,15 @@ void sub_0801B250(PlayerItemBombEntity* this) { super->spritePriority.b1 = 3; super->flags &= 0x7f; if (super->type == 0xff) { - super->actionDelay = 0x3c; + super->timer = 0x3c; } else if (super->type == 0xfe) { - super->actionDelay = 0x0f; + super->timer = 0x0f; super->type = 0xff; } else { - super->actionDelay = 0x96; + super->timer = 0x96; } super->hitbox = (Hitbox*)&gUnk_080B77F4; - super->field_0x16 = 0; + super->carryFlags = 0; if (*(u8*)&this->unk_68 == 7) { InitializeAnimation(super, 5); } else { @@ -97,8 +97,8 @@ void sub_0801B2CC(PlayerItemBombEntity* this) { break; } if ((unaff_r5 & gPlayerState.field_0x92) != 0) { - super->actionDelay = 0; - super->field_0xf = 1; + super->timer = 0; + super->subtimer = 1; } } @@ -122,8 +122,8 @@ void sub_0801B354(Entity* this) { void sub_0801B368(Entity* this) { this->action -= 1; this->subAction = 0; - if (0x3c < this->actionDelay) { - this->actionDelay = 0x3c; + if (0x3c < this->timer) { + this->timer = 0x3c; } } @@ -132,14 +132,14 @@ void sub_0801B384(Entity* this) { } void sub_0801B38C(Entity* this) { - if (this->actionDelay-- == 0) { + if (this->timer-- == 0) { DeleteThisEntity(); } } void sub_0801B3A4(PlayerItemBombEntity* this) { u32 tmp; - if (super->field_0xf >= 0x29) { + if (super->subtimer >= 0x29) { tmp = 8; } else { tmp = 4; @@ -153,7 +153,7 @@ void sub_0801B3A4(PlayerItemBombEntity* this) { } SetAffineInfo(super, 0x130 - (this->unk_68 & 0xf0), 0x130 - (this->unk_68 & 0xf0), 0); } - if ((super->field_0xf & tmp) == 0) { + if ((super->subtimer & tmp) == 0) { super->palette.b.b0 = 0; } else { super->palette.b.b0 = super->palette.b.b4; diff --git a/src/playerItem/playerItemBoomerang.c b/src/playerItem/playerItemBoomerang.c index dabceb37..5f8d95ce 100644 --- a/src/playerItem/playerItemBoomerang.c +++ b/src/playerItem/playerItemBoomerang.c @@ -37,8 +37,8 @@ void PlayerItemBoomerang(Entity* this) { SetAffineInfo(this, 0x100, 0x100, this->field_0x86.HWORD); } - this->field_0xf--; - if ((this->field_0xf & 0xf) == 0) { + this->subtimer--; + if ((this->subtimer & 0xf) == 0) { EnqueueSFX(SFX_FB); } } @@ -67,7 +67,7 @@ void PlayerItemBoomerang_Init(Entity* this) { this->speed = 0x200; uVar1 = 30; } - this->actionDelay = uVar1; + this->timer = uVar1; if (((s8)gPlayerState.field_0xd) >= 0) { this->direction = gPlayerState.field_0xd; } else { @@ -113,7 +113,7 @@ void sub_0801B584(Entity* this) { this->action = 2; this->spriteVramOffset = 0xd5; COLLISION_ON(this); - this->field_0x3c |= 1; + this->collisionFlags |= 1; this->flags2 = gPlayerEntity.flags2; this->spriteIndex = 0xa6; this->spriteSettings.flipX = 0; @@ -159,25 +159,25 @@ void sub_0801B680(Entity* this) { } if (uVar6 == 0) { - if (--this->actionDelay < 0xc) { + if (--this->timer < 0xc) { this->speed = this->speed + -0x10; } - if (this->actionDelay == 0) { + if (this->timer == 0) { uVar6 = 1; } - if (this->bitfield & 0x80) { + if (this->contactFlags & 0x80) { uVar6 = 1; } if (uVar6 == 0) { return; } if (this->field_0x68.HALF.LO == 12) { - this->actionDelay = 30; + this->timer = 30; } else { - this->actionDelay = 12; + this->timer = 12; } } else { - this->actionDelay = 1; + this->timer = 1; } if (uVar6) { @@ -188,8 +188,8 @@ void sub_0801B680(Entity* this) { void sub_0801B7A8(Entity* this) { sub_0801B804(this); - if (this->actionDelay != 0) { - this->actionDelay -= 1; + if (this->timer != 0) { + this->timer -= 1; } else { sub_0801B864(this); if (this->speed < 0x280) { diff --git a/src/playerItem/playerItemBottle.c b/src/playerItem/playerItemBottle.c index f4363c31..ad27462f 100644 --- a/src/playerItem/playerItemBottle.c +++ b/src/playerItem/playerItemBottle.c @@ -40,13 +40,13 @@ void PlayerItemBottle_Init(Entity* this) { return; } COLLISION_ON(this); - this->field_0x3c = (gPlayerEntity.field_0x3c + 1) | 0x20; + this->collisionFlags = (gPlayerEntity.collisionFlags + 1) | 0x20; this->flags2 = gPlayerEntity.flags2; this->hurtType = 0x1f; this->type = 1; this->type2 = ITEM_BOTTLE_EMPTY; - this->actionDelay = 0x52; - this->field_0xf = 0x1b; + this->timer = 0x52; + this->subtimer = 0x1b; sub_0801766C(this); SoundReq(SFX_1DC); break; @@ -61,15 +61,15 @@ void PlayerItemBottle_Init(Entity* this) { case ITEM_BOTTLE_PICOLYTE_GREEN: case ITEM_BOTTLE_PICOLYTE_BLUE: case ITEM_BOTTLE_PICOLYTE_WHITE: - this->actionDelay = 0xd5; - this->field_0xf = 0x3c; + this->timer = 0xd5; + this->subtimer = 0x3c; break; case BOTTLE_CHARM_NAYRU: case BOTTLE_CHARM_FARORE: case BOTTLE_CHARM_DIN: default: - this->actionDelay = 0x37; - this->field_0xf = 0; + this->timer = 0x37; + this->subtimer = 0; } this->action = 1; this->frameIndex = 0xff; @@ -90,7 +90,7 @@ void PlayerItemBottle_Action1(Entity* this) { #else InitItemGetSequence(this->type2, iVar1, 5); #endif - SoundReq(SFX_109); + SoundReq(SFX_ITEM_GET); } DeleteThisEntity(); } @@ -212,7 +212,7 @@ void sub_0801BDE8(Entity* this, Entity* ent2) { u32 flipX; u32 animationState; - uVar1 = (ent2->frameIndex - this->actionDelay) + this->field_0xf; + uVar1 = (ent2->frameIndex - this->timer) + this->subtimer; if (uVar1 != this->frameIndex) { this->frameIndex = uVar1; sub_080042D0(this, this->frameIndex, (u16)this->spriteIndex); @@ -240,9 +240,9 @@ void PlayerItemBottle_UseEmptyBottle(Entity* this) { const u8* ptr; const s8* ptr2; - switch (this->bitfield & 0x7f) { + switch (this->contactFlags & 0x7f) { default: - this->bitfield = 0; + this->contactFlags = 0; break; case 0x49: this->type2 = ITEM_BOTTLE_FAIRY; diff --git a/src/playerItem/playerItemBow.c b/src/playerItem/playerItemBow.c index 7d2d5b93..98449501 100644 --- a/src/playerItem/playerItemBow.c +++ b/src/playerItem/playerItemBow.c @@ -65,7 +65,7 @@ void sub_08018FE4(PlayerItemBowEntity* this) { super->speed = 0x300; } super->direction = super->animationState << 2; - super->field_0x3c = gPlayerEntity.field_0x3c + 1; + super->collisionFlags = gPlayerEntity.collisionFlags + 1; super->flags2 = gPlayerEntity.flags2; if (super->collisionLayer == 2) { super->type2 = 1; @@ -134,8 +134,8 @@ void sub_0801917C(PlayerItemBowEntity* this) { tmp2 = FALSE; } if (super->hurtType == 0x0e) { - super->actionDelay++; - if ((super->actionDelay & 7) == 0) { + super->timer++; + if ((super->timer & 7) == 0) { CreateFx(super, FX_SPARKLE2, 0); } } @@ -144,7 +144,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->actionDelay = 0x1e; + super->timer = 0x1e; super->action++; if (super->hurtType == 0x0e) { sub_08019468(this); @@ -167,12 +167,12 @@ void sub_0801917C(PlayerItemBowEntity* this) { super->y.WORD = tmp3; SoundReq(SFX_18A); } - if ((super->bitfield != 0) && (!tmp2)) { + if ((super->contactFlags != 0) && (!tmp2)) { if (super->hurtType == 0x0e) { sub_08019468(this); } sub_08017744(super); - if ((super->bitfield & 0x3f) == 0x42) { + if ((super->contactFlags & 0x3f) == 0x42) { super->spriteSettings.draw = 1; super->action = 3; super->direction ^= 0x10; @@ -182,7 +182,7 @@ void sub_0801917C(PlayerItemBowEntity* this) { InitializeAnimation(super, 6); } else { super->action++; - super->actionDelay = 1; + super->timer = 1; super->spriteSettings.draw = 0; } } @@ -222,12 +222,12 @@ void sub_0801917C(PlayerItemBowEntity* this) { } void sub_08019410(Entity* this) { - if (this->actionDelay < 0xf) { + if (this->timer < 0xf) { InitializeAnimation(this, this->animIndex); } else { GetNextFrame(this); } - if (this->actionDelay-- == 0) { + if (this->timer-- == 0) { DeleteThisEntity(); } } diff --git a/src/playerItem/playerItemDashSword.c b/src/playerItem/playerItemDashSword.c index fccbf329..5b86a216 100644 --- a/src/playerItem/playerItemDashSword.c +++ b/src/playerItem/playerItemDashSword.c @@ -45,7 +45,7 @@ void sub_0801B8FC(Entity* this) { DeleteThisEntity(); } else { pbVar1->flags |= ENT_COLLIDE; - pbVar1->field_0x3c = 0x21; + pbVar1->collisionFlags = 0x21; sub_0801B938(pbVar1); } } diff --git a/src/playerItem/playerItemFireRodProjectile.c b/src/playerItem/playerItemFireRodProjectile.c index 800acaa1..9e29cf46 100644 --- a/src/playerItem/playerItemFireRodProjectile.c +++ b/src/playerItem/playerItemFireRodProjectile.c @@ -2,7 +2,7 @@ #include "asm.h" #include "entity.h" #include "sound.h" -#include "coord.h" +#include "physics.h" #include "functions.h" #include "effects.h" @@ -29,7 +29,7 @@ void sub_080A3084(FireRodProjectileEntity* this) { super->action = 0x01; CopyPosition(super->parent, super); if (super->type == 0) { - super->field_0x3c = gPlayerEntity.field_0x3c + 1; + super->collisionFlags = gPlayerEntity.collisionFlags + 1; super->hitbox = &gUnk_08127278; super->speed = 0x400; if (super->collisionLayer == 0x02) { @@ -41,7 +41,7 @@ void sub_080A3084(FireRodProjectileEntity* this) { LinearMoveUpdate(super); SoundReq(SFX_ITEM_SWORD_BEAM); } else { - super->actionDelay = 6; + super->timer = 6; } InitializeAnimation(super, 0x18); sub_080A310C(this); @@ -49,7 +49,7 @@ void sub_080A3084(FireRodProjectileEntity* this) { void sub_080A310C(FireRodProjectileEntity* this) { if (super->type != 0) { - if (super->actionDelay-- == 0) { + if (super->timer-- == 0) { DeleteThisEntity(); } } else { @@ -57,7 +57,7 @@ void sub_080A310C(FireRodProjectileEntity* this) { if (this->unk6c-- != 0) { GetNextFrame(super); LinearMoveUpdate(super); - super->actionDelay++; + super->timer++; if (super->type2 == 0) { sub_0800451C(super); } @@ -66,7 +66,7 @@ void sub_080A310C(FireRodProjectileEntity* this) { CreateFx(super, FX_SWORD_MAGIC, 0); DeleteThisEntity(); } - if (super->bitfield != 0) { + if (super->contactFlags != 0) { CreateFx(super, FX_SWORD_MAGIC, 0); DeleteThisEntity(); } diff --git a/src/playerItem/playerItemGust.c b/src/playerItem/playerItemGust.c index ad0a1a12..82fe51ff 100644 --- a/src/playerItem/playerItemGust.c +++ b/src/playerItem/playerItemGust.c @@ -29,7 +29,7 @@ static void sub_080ACECC(GustEntity*); typedef struct { u16 bits; u8 type2; - u8 actionDelay; + u8 timer; u8 _4; u8 type; u16 tileID; @@ -66,7 +66,7 @@ static void PlayerItemGust_Init(GustEntity* this) { super->direction = super->animationState << 2; super->speed = 0x200; super->flags |= ENT_COLLIDE | ENT_PERSIST; - super->field_0x3c = 2; + super->collisionFlags = 2; super->hitbox = (Hitbox*)sHitboxes[super->type]; this->timer = 16; sub_080ACDB0(this); @@ -97,7 +97,7 @@ static void sub_080ACC78(GustEntity* this) { if (o != NULL) { child = CreateObject(OBJECT_11, o->type, o->type2); if (child != NULL) { - child->actionDelay = o->actionDelay; + child->timer = o->timer; child->x.HALF.HI = child_offsets[this->offset_iter] + super->x.HALF.HI; child->y.HALF.HI = child_offsets[this->offset_iter + 1] + super->y.HALF.HI; } diff --git a/src/playerItem/playerItemGustBig.c b/src/playerItem/playerItemGustBig.c index f357fb97..8430cbcf 100644 --- a/src/playerItem/playerItemGustBig.c +++ b/src/playerItem/playerItemGustBig.c @@ -39,13 +39,13 @@ void sub_08018CBC(Entity* this) { this->direction = (u8)(uVar2 << 2); this->speed = 0x400; this->hitType = 0x96; - this->field_0x3c = (gPlayerEntity.field_0x3c + 1) | 0x80; + this->collisionFlags = (gPlayerEntity.collisionFlags + 1) | 0x80; this->flags2 = gPlayerEntity.flags2; pEVar3 = this->child; if (pEVar3 != NULL) { this->action = 1; COLLISION_OFF(this); - this->actionDelay = 0x56; + this->timer = 0x56; this->hurtType = 0x1c; this->damage = 6; this->hitbox = &gUnk_080B3E18; @@ -61,7 +61,7 @@ void sub_08018CBC(Entity* this) { this->palette.raw = 0x33; this->spriteVramOffset = 0; this->type = gPlayerState.gustJarSpeed - 1; - this->actionDelay = gUnk_080B3DE0[this->type * 2]; + this->timer = gUnk_080B3DE0[this->type * 2]; this->damage = gUnk_080B3DE0[this->type * 2 + 1]; this->hurtType = 0x1b; this->hitbox = gUnk_080B3DE8[this->type]; @@ -77,7 +77,7 @@ void sub_08018CBC(Entity* this) { void sub_08018DE8(Entity* this) { u8 bVar1; - bVar1 = this->child->field_0x3a & 4; + bVar1 = this->child->gustJarState & 4; if (bVar1 == 0) { gPlayerState.field_0x1c = bVar1; DeleteThisEntity(); @@ -105,15 +105,15 @@ void sub_08018E68(Entity* this) { GetNextFrame(this); sub_08008790(this, 5); } else { - if ((this->child->field_0x3a & 4) == 0) { + if ((this->child->gustJarState & 4) == 0) { DeleteThisEntity(); } - if ((this->bitfield & 0x80) != 0) { + if ((this->contactFlags & 0x80) != 0) { sub_08018F6C(this); return; } } - if (this->actionDelay-- != 0) { + if (this->timer-- != 0) { LinearMoveUpdate(this); switch (this->direction) { diff --git a/src/playerItem/playerItemGustJar.c b/src/playerItem/playerItemGustJar.c index 6c550694..e140d3a3 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->field_0xf = 0xf; + this->subtimer = 0xf; this->hitbox = &gUnk_08132B28; this->hitbox->unk2[2] = 3; this->hitbox->unk2[1] = 3; @@ -64,11 +64,11 @@ void PlayerItemGustJar_Action2(Entity* this) { if (this->type != 0) { if (this->type == 1) { sub_080ADCA0(this, 4); - this->actionDelay = 24; + this->timer = 24; this->type = 2; } else { sub_080ADCDC(this, 1); - if (this->actionDelay-- == 0) { + if (this->timer-- == 0) { sub_080ADCA0(this, 0); this->type = 0; } @@ -103,13 +103,13 @@ void PlayerItemGustJar_Action2(Entity* this) { windSound = SFX_EE; in_r2 = 1; } - this->field_0xf = this->field_0xf - in_r2; + this->subtimer = this->subtimer - in_r2; } - if ((s8)this->field_0xf < 0) { + if ((s8)this->subtimer < 0) { if (windSound) { SoundReq(windSound); } - this->field_0xf = 15; + this->subtimer = 15; } this->frameIndex = gPlayerEntity.frameIndex - (gPlayerEntity.frame & 0x7f); } diff --git a/src/playerItem/playerItemHeldObject.c b/src/playerItem/playerItemHeldObject.c index 2eec6a4a..1f8ea7fc 100644 --- a/src/playerItem/playerItemHeldObject.c +++ b/src/playerItem/playerItemHeldObject.c @@ -68,7 +68,7 @@ void sub_080AD040(PlayerItemHeldObjectEntity* this) { if ((child->base).action != 2) { DeleteThisEntity(); } - if ((super->bitfield & 0x80) != 0) { + if ((super->contactFlags & 0x80) != 0) { super->z.WORD = 0; } if (super->speed != 0) { @@ -125,15 +125,15 @@ void sub_080AD040(PlayerItemHeldObjectEntity* this) { if (super->child == super) { if (super->type2 != 0xff) { if (super->type2 == 0x0f) { - CreateFx(super, super->actionDelay, 0x80); + CreateFx(super, super->timer, 0x80); } else { - CreateObjectWithParent(super, super->type2, super->actionDelay, 0); + CreateObjectWithParent(super, super->type2, super->timer, 0); } } DeleteThisEntity(); } else { - if (super->actionDelay != 0 || sub_080AD32C(child)) { - if (super->actionDelay == 1) { + if (super->timer != 0 || sub_080AD32C(child)) { + if (super->timer == 1) { SoundReq(SFX_PLACE_OBJ); } UpdateSpriteForCollisionLayer(super); @@ -144,7 +144,7 @@ void sub_080AD040(PlayerItemHeldObjectEntity* this) { DeleteThisEntity(); } else { SoundReq(SFX_PLACE_OBJ); - super->actionDelay++; + super->timer++; super->zVelocity = 0x10000; super->speed /= 2; return; @@ -192,7 +192,7 @@ void sub_080AD27C(PlayerItemHeldObjectEntity* this) { super->spritePriority.b1 = 3; } super->hitbox = (child->base).hitbox; - tmp = super->field_0x16 >> 4; + tmp = super->carryFlags >> 4; super->speed = gUnk_081320CC[tmp]; super->zVelocity = gUnk_081320D4[tmp]; (child->base).z.HALF.HI += 8; @@ -200,7 +200,7 @@ void sub_080AD27C(PlayerItemHeldObjectEntity* this) { super->collisionLayer = (child->base).collisionLayer; super->y.HALF.HI = gPlayerEntity.y.HALF.HI; super->x.HALF.HI = gPlayerEntity.x.HALF.HI; - super->field_0x3c = gPlayerEntity.field_0x3c; + super->collisionFlags = gPlayerEntity.collisionFlags; super->flags |= 0x80; sub_0801766C(super); } else { @@ -211,7 +211,7 @@ void sub_080AD27C(PlayerItemHeldObjectEntity* this) { bool32 sub_080AD32C(PlayerItemHeldObjectEntity* this) { bool32 result = FALSE; - if (((super->field_0x16 & 0xf0) == 0x10) || + if (((super->carryFlags & 0xf0) == 0x10) || ((super->kind == OBJECT && ((super->id == 5 || (super->id == 0x7d)))))) { result = TRUE; } diff --git a/src/playerItem/playerItemLantern.c b/src/playerItem/playerItemLantern.c index 2d7c01d4..cdaee553 100644 --- a/src/playerItem/playerItemLantern.c +++ b/src/playerItem/playerItemLantern.c @@ -12,17 +12,17 @@ extern const s8 gUnk_080FEEB0[]; void PlayerItemLantern(Entity* this) { gUnk_080FEEA8[this->action](this); - this->bitfield = 0; + this->contactFlags = 0; } void sub_08054A60(Entity* this) { this->flags |= (ENT_PERSIST | ENT_COLLIDE); this->action = 0x01; - this->actionDelay = 0x04; + this->timer = 0x04; this->frameIndex = -1; // TODO regalloc and mov 6 too early this->updatePriority = 6; - this->field_0x3c = 7; + this->collisionFlags = 7; this->flags2 = -0x80; this->animationState = gPlayerEntity.animationState & 0xe; if (AllocMutableHitbox(this) == NULL) { @@ -55,8 +55,8 @@ void sub_08054AC8(Entity* this) { this->frameSpriteSettings = gPlayerEntity.frameSpriteSettings; } if (IsItemEquipped(ITEM_LANTERN_ON) < 2) { - if (((this->frameIndex != 0xff) && (gPlayerEntity.spriteSettings.draw != 0)) && (this->actionDelay-- == 0)) { - this->actionDelay = 4; + if (((this->frameIndex != 0xff) && (gPlayerEntity.spriteSettings.draw != 0)) && (this->timer-- == 0)) { + this->timer = 4; object = CreateObject(OBJECT_45, 0, 0x10); if (object != NULL) { PositionRelative(this, object, 0, 0x20000); diff --git a/src/playerItem/playerItemPacciCaneProjectile.c b/src/playerItem/playerItemPacciCaneProjectile.c index eee2bec5..08109fbe 100644 --- a/src/playerItem/playerItemPacciCaneProjectile.c +++ b/src/playerItem/playerItemPacciCaneProjectile.c @@ -55,7 +55,7 @@ void PlayerItemPacciCaneProjectile_Init(Entity* this) { *(u32*)&this->field_0x78 = 0x1e0; this->x.HALF.HI = gPlayerEntity.x.HALF.HI + gUnk_0811B9A0[this->animationState]; this->y.HALF.HI = gPlayerEntity.y.HALF.HI + gUnk_0811B9A0[this->animationState + 1]; - this->field_0x3c = 7; + this->collisionFlags = 7; this->flags2 = 0x8a; this->hitbox = (Hitbox*)&gUnk_0811B9D0; if (this->collisionLayer == 2) { @@ -90,7 +90,7 @@ void sub_080701F8(Entity* this) { if (iVar3) { pEVar4 = CreateObject(OBJECT_53, iVar3[5], iVar3[2]); if (pEVar4) { - pEVar4->actionDelay = iVar3[3]; + pEVar4->timer = iVar3[3]; pEVar4->x.HALF.HI = this->x.HALF.HI + cVar1; pEVar4->y.HALF.HI = this->y.HALF.HI + cVar2; } @@ -124,7 +124,7 @@ void sub_080701F8(Entity* this) { sub_08070458(this); } } - if (this->bitfield != 0) { + if (this->contactFlags != 0) { sub_08070458(this); } } @@ -161,10 +161,10 @@ void sub_080703BC(Entity* this) { if (--(*(int*)&this->field_0x78) == -1) { sub_08070458(this); } else { - if (this->bitfield == 0) { + if (this->contactFlags == 0) { return; } - if (((this->bitfield & 0x7f) == 0) && (this->action != 0x1a)) { + if (((this->contactFlags & 0x7f) == 0) && (this->action != 0x1a)) { return; } sub_08070458(this); diff --git a/src/playerItem/playerItemSpiralBeam.c b/src/playerItem/playerItemSpiralBeam.c index bbd501b3..af4c0eae 100644 --- a/src/playerItem/playerItemSpiralBeam.c +++ b/src/playerItem/playerItemSpiralBeam.c @@ -18,7 +18,7 @@ void sub_0805FBE8(Entity* this) { CopyPosition(&gPlayerEntity, this); this->action++; this->spriteSettings.draw = TRUE; - this->field_0x3c = gPlayerEntity.field_0x3c + 1; + this->collisionFlags = gPlayerEntity.collisionFlags + 1; this->hitbox = &gUnk_08109AD0; this->speed = 0x380; this->animationState = this->animationState & 0x7f; @@ -40,7 +40,7 @@ void sub_0805FC74(Entity* this) { if (--*(int*)&this->field_0x6c != -1) { GetNextFrame(this); LinearMoveUpdate(this); - this->actionDelay++; + this->timer++; if (this->type2 == 0) { sub_0800451C(this); } @@ -49,7 +49,7 @@ void sub_0805FC74(Entity* this) { CreateFx(this, FX_SWORD_MAGIC, 0); DeleteThisEntity(); } - if (this->bitfield != 0) { + if (this->contactFlags != 0) { CreateFx(this, FX_SWORD_MAGIC, 0); DeleteThisEntity(); } diff --git a/src/playerItem/playerItemSword.c b/src/playerItem/playerItemSword.c index 7bfded63..21b2ee13 100644 --- a/src/playerItem/playerItemSword.c +++ b/src/playerItem/playerItemSword.c @@ -89,7 +89,7 @@ void sub_080A78B8(PlayerItemSwordEntity* this, Entity* param_2) { } super->spriteSettings.flipX = flipX; } - if ((super->bitfield & 0x80) != 0) { + if ((super->contactFlags & 0x80) != 0) { if ((param_2->iframes == 0) || ((u8)param_2->iframes == 0x81)) { param_2->iframes = super->iframes; param_2->knockbackDirection = super->knockbackDirection; @@ -101,7 +101,7 @@ void sub_080A78B8(PlayerItemSwordEntity* this, Entity* param_2) { if ((gPlayerState.flags & 0x8000000) != 0) { gPlayerState.sword_state |= 0x80; } else if (gPlayerState.sword_state != 0) { - switch (super->bitfield & 0x7f) { + switch (super->contactFlags & 0x7f) { case 0x44: break; case 0x43: diff --git a/src/playerItem/playerItemSwordBeam.c b/src/playerItem/playerItemSwordBeam.c index 6bdc04eb..34ee2993 100644 --- a/src/playerItem/playerItemSwordBeam.c +++ b/src/playerItem/playerItemSwordBeam.c @@ -1,6 +1,6 @@ #include "entity.h" #include "player.h" -#include "coord.h" +#include "physics.h" #include "functions.h" #include "sound.h" #include "effects.h" @@ -26,7 +26,7 @@ void sub_08019498(Entity* this) { CopyPosition(&gPlayerEntity, this); this->action += 0x01; this->spriteSettings.draw = 1; - this->field_0x3c = gPlayerEntity.field_0x3c + 1; + this->collisionFlags = gPlayerEntity.collisionFlags + 1; this->hitbox = &gUnk_080B4408; this->speed = 0x380; *(u32*)&this->field_0x74 = 2; @@ -67,7 +67,7 @@ void sub_08019580(Entity* this) { if (--*(int*)&this->field_0x6c != -1) { GetNextFrame(this); LinearMoveUpdate(this); - this->actionDelay += 0x01; + this->timer += 0x01; if (this->type2 == 0) { sub_0800451C(this); } @@ -76,7 +76,7 @@ void sub_08019580(Entity* this) { CreateFx(this, FX_SWORD_MAGIC, 0); DeleteThisEntity(); } - if (this->bitfield != 0) { + if (this->contactFlags != 0) { CreateFx(this, FX_SWORD_MAGIC, 0); DeleteThisEntity(); } diff --git a/src/playerItemUtils.c b/src/playerItemUtils.c index 094128cb..6bd45d51 100644 --- a/src/playerItemUtils.c +++ b/src/playerItemUtils.c @@ -39,7 +39,7 @@ static Entity* GiveItemWithCutscene(u32 type, u32 type2, u32 delay) { if (e != NULL) { e->type = type; e->type2 = type2; - e->actionDelay = delay; + e->timer = delay; e->id = OBJECT_B; e->kind = OBJECT; AppendEntityToList(e, 6); diff --git a/src/playerUtils.c b/src/playerUtils.c index 5c80261b..00c8902d 100644 --- a/src/playerUtils.c +++ b/src/playerUtils.c @@ -1040,12 +1040,12 @@ void sub_080790E4(Entity* this) { } if (gPlayerState.pushedObject == 0) { if (sub_080793E4(1)) { - if (this->field_0xf <= 5) { - this->field_0xf++; + if (this->subtimer <= 5) { + this->subtimer++; return; } } else { - this->field_0xf = 0; + this->subtimer = 0; return; } } else { @@ -1077,7 +1077,7 @@ void PlayerResetStateFromFusion(void) { void SetPlayerActionNormal(void) { gPlayerEntity.action = PLAYER_NORMAL; gPlayerEntity.subAction = 0; - gPlayerEntity.field_0xf = 0; + gPlayerEntity.subtimer = 0; } void ResetPlayerAnimationAndAction(void) { @@ -1109,7 +1109,7 @@ void PlayerMinishSetNormalAndCollide(void) { } gPlayerEntity.action = PLAYER_MINISH; gPlayerEntity.subAction = 1; - gPlayerEntity.field_0x3c &= 0xfb; + gPlayerEntity.collisionFlags &= 0xfb; gPlayerState.animation = 0xc18; gPlayerState.flags &= ~(PL_BUSY | PL_DROWNING | PL_DISABLE_ITEMS | PL_IN_HOLE | PL_MOLDWORM_RELEASED | PL_PARACHUTE); @@ -1558,11 +1558,11 @@ void sub_0807B1A8(PlayerEntity* this) { void sub_0807B1DC(PlayerEntity* this) { this->unk_6e++; - super->actionDelay = 0x1e; + super->timer = 0x1e; } void sub_0807B1EC(PlayerEntity* this) { - if (--super->actionDelay == 0) { + if (--super->timer == 0) { this->unk_6e++; super->zVelocity = 0x10000; gPlayerState.animation = 0x2c2; @@ -1577,8 +1577,8 @@ void sub_0807B21C(PlayerEntity* this) { GravityUpdate(super, 0x800); } if (super->zVelocity < -0x8000) { - super->actionDelay = 0x78; - super->field_0xf = 0; + super->timer = 0x78; + super->subtimer = 0; this->unk_6e++; this->unk_68 = super->z.WORD; } @@ -1587,13 +1587,13 @@ void sub_0807B21C(PlayerEntity* this) { void sub_0807B264(PlayerEntity* this) { s32 tmp; UpdateAnimationSingleFrame(super); - super->field_0xf += 2; - tmp = gSineTable[super->field_0xf]; + super->subtimer += 2; + tmp = gSineTable[super->subtimer]; tmp >>= 7; tmp <<= 0x10; super->z.WORD = this->unk_68 + tmp; - if (--super->actionDelay == 0) { - super->actionDelay = 0x50; + if (--super->timer == 0) { + super->timer = 0x50; super->zVelocity = 0x8000; this->unk_6e++; #ifndef EU @@ -1605,7 +1605,7 @@ void sub_0807B264(PlayerEntity* this) { void sub_0807B2B8(PlayerEntity* this) { GravityUpdate(super, -0x2000); UpdateAnimationSingleFrame(super); - if (super->actionDelay != 0 && --super->actionDelay == 0) { + if (super->timer != 0 && --super->timer == 0) { DoExitTransition(&gUnk_0813AD88[this->unk_6d]); } } diff --git a/src/projectile/arrowProjectile.c b/src/projectile/arrowProjectile.c index 755ee6f8..a5284759 100644 --- a/src/projectile/arrowProjectile.c +++ b/src/projectile/arrowProjectile.c @@ -28,8 +28,8 @@ void ArrowProjectile_OnTick(Entity* this) { } void sub_080A9334(Entity* this) { - if ((this->bitfield & 0x80) != 0) { - if ((this->bitfield & 0x3f) != 0) { + if ((this->contactFlags & 0x80) != 0) { + if ((this->contactFlags & 0x3f) != 0) { ModHealth(-2); sub_080A9488(this); this->knockbackDuration = 0; @@ -44,8 +44,8 @@ void ArrowProjectile_Init(Entity* this) { this->action = 1; this->spriteSettings.draw = 1; COLLISION_OFF(this); - this->actionDelay = 0x6a; - this->field_0xf = 0; + this->timer = 0x6a; + this->subtimer = 0; this->zVelocity = 0xa00; sub_080A94C0(this, this->type); } @@ -55,10 +55,10 @@ void ArrowProjectile_Action1(Entity* this) { if ((parent == NULL) || (parent->next == NULL)) { DeleteThisEntity(); } - if (this->field_0xf != 0) { + if (this->subtimer != 0) { DeleteThisEntity(); } - if (parent->field_0xf != 0) { + if (parent->subtimer != 0) { this->action = 2; COLLISION_ON(this); parent->child = NULL; @@ -70,18 +70,18 @@ void ArrowProjectile_Action2(Entity* this) { if (this->collisions != COL_NONE) { this->action = 3; COLLISION_OFF(this); - this->actionDelay = 0x20; + this->timer = 0x20; InitializeAnimation(this, this->animIndex + 2); EnqueueSFX(SFX_18A); LinearMoveUpdate(this); - } else if (--this->actionDelay == 0) { + } else if (--this->timer == 0) { DeleteThisEntity(); } ProcessMovement3(this); } void ArrowProjectile_Action3(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteThisEntity(); } GetNextFrame(this); @@ -92,8 +92,8 @@ void ArrowProjectile_Action4(Entity* this) { CreateDust(this); DeleteThisEntity(); } else { - if (--this->actionDelay == 0) { - this->actionDelay = 2; + if (--this->timer == 0) { + this->timer = 2; this->animationState = (this->animationState + 1) & 3; sub_080A94C0(this, this->animationState); } @@ -103,7 +103,7 @@ void ArrowProjectile_Action4(Entity* this) { void sub_080A9488(Entity* this) { this->action = 4; COLLISION_OFF(this); - this->actionDelay = 2; + this->timer = 2; this->zVelocity = 0x18000; this->animationState = (this->knockbackDirection & 0x18) >> 3; EnqueueSFX(SFX_METAL_CLINK); diff --git a/src/projectile/ballAndChain.c b/src/projectile/ballAndChain.c index bc206a8f..110c80a0 100644 --- a/src/projectile/ballAndChain.c +++ b/src/projectile/ballAndChain.c @@ -123,13 +123,13 @@ void sub_080AB170(Entity* this) { void sub_080AB26C(Entity* this) { if (this->action == 0) { this->action = 1; - this->actionDelay = 5; + this->timer = 5; this->frameIndex = 0; #ifndef EU this->spritePriority.b1 = 0; #endif } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteThisEntity(); } else { this->frameIndex += 1; diff --git a/src/projectile/boneProjectile.c b/src/projectile/boneProjectile.c index 429a94c9..88c5bc75 100644 --- a/src/projectile/boneProjectile.c +++ b/src/projectile/boneProjectile.c @@ -17,7 +17,7 @@ void BoneProjectile_OnTick(Entity* this) { } void sub_080A81C4(Entity* this) { - if (this->bitfield == 0x80) { + if (this->contactFlags == 0x80) { DeleteEntity(this); } else { sub_080A82D8(this); @@ -26,7 +26,7 @@ void sub_080A81C4(Entity* this) { void BoneProjectile_Init(Entity* this) { this->action = 1; - this->actionDelay = 60; + this->timer = 60; this->z.HALF.HI = -2; InitializeAnimation(this, 0); } @@ -39,7 +39,7 @@ void BoneProjectile_Action1(Entity* this) { DeleteEntity(this); } else { sub_08016AD2(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; this->speed = 0x120; } diff --git a/src/projectile/cannonballProjectile.c b/src/projectile/cannonballProjectile.c index 18e79a67..0276947b 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]->actionDelay = 0x1e; + entities[i]->timer = 0x1e; entities[i]->spriteSettings.draw = 0; CreateFx(entities[i], FX_WHITE_ROCK, 0); } diff --git a/src/projectile/darkNutSwordSlash.c b/src/projectile/darkNutSwordSlash.c index 20b968db..e0f3d3af 100644 --- a/src/projectile/darkNutSwordSlash.c +++ b/src/projectile/darkNutSwordSlash.c @@ -1,6 +1,6 @@ #include "entity.h" #include "player.h" -#include "coord.h" +#include "physics.h" extern const u8 DarkNutSwordSlash_hitTypes[]; extern void (*const DarkNutSwordSlash_UpdatesForType[])(Entity*); @@ -24,10 +24,10 @@ void DarkNutSwordSlash(Entity* this) { if ((this->parent == NULL) || (this->parent->health == 0)) { DeleteThisEntity(); } - if (((this->bitfield & 0x80) != 0) && (this->field_0x4c == &gPlayerEntity)) { + if (((this->contactFlags & 0x80) != 0) && (this->contactedEntity == &gPlayerEntity)) { this->iframes = -0x2d; } - this->bitfield = 0; + this->contactFlags = 0; CopyPositionAndSpriteOffset(this->parent, this); DarkNutSwordSlash_OnTick(this); if (this->type == 3) { diff --git a/src/projectile/dekuSeedProjectile.c b/src/projectile/dekuSeedProjectile.c index 86fce52a..588ad284 100644 --- a/src/projectile/dekuSeedProjectile.c +++ b/src/projectile/dekuSeedProjectile.c @@ -17,14 +17,14 @@ void DekuSeedProjectile_OnTick(Entity* this) { } void sub_080A8470(Entity* this) { - if (this->bitfield == 0x80) { + if (this->contactFlags == 0x80) { if (this->hitType == 0x68) { EnqueueSFX(SFX_86); } DeleteEntity(this); } else { this->direction = DirectionRoundUp(this->knockbackDirection); - if ((u8)(this->bitfield + 0x7e) < 2) { + if ((u8)(this->contactFlags + 0x7e) < 2) { sub_080A8680(this); } else { InitializeAnimation(this, 0x19); @@ -35,8 +35,8 @@ void sub_080A8470(Entity* this) { void DekuSeedProjectile_Init(Entity* this) { this->action = 1; - this->actionDelay = 0x30; - this->field_0xf = 0; + this->timer = 0x30; + this->subtimer = 0; this->z.HALF.HI -= 4; if (CheckGlobalFlag(TABIDACHI) == 0) { this->hitType = 0x68; @@ -54,7 +54,7 @@ void DekuSeedProjectile_Action1(Entity* this) { DeleteThisEntity(); } sub_08016AD2(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 4; } } else { @@ -63,17 +63,17 @@ void DekuSeedProjectile_Action1(Entity* this) { InitializeAnimation(this, 0x19); sub_080A86A0(this); } - if (this->field_0xf != 0) { + if (this->subtimer != 0) { parent = this->parent; if ((parent->next != NULL) && (IsColliding(this, parent) != 0)) { this->iframes = 0x10; this->knockbackDirection = -this->direction; - this->bitfield = 0x80; + this->contactFlags = 0x80; this->knockbackDuration = 0xc; this->knockbackSpeed = 0; parent->iframes = 0x10; parent->knockbackDirection = this->direction; - parent->bitfield = 0xc2; + parent->contactFlags = 0xc2; parent->knockbackDuration = 0xc; parent->knockbackSpeed = 0; } @@ -86,7 +86,7 @@ void DekuSeedProjectile_Action2(Entity* this) { if (IsProjectileOffScreen(this)) { DeleteThisEntity(); } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 1; COLLISION_ON(this); } @@ -126,8 +126,8 @@ void DekuSeedProjectile_Action4(Entity* this) { void sub_080A8680(Entity* this) { this->action = 2; COLLISION_OFF(this); - this->actionDelay = 3; - this->field_0xf = 1; + this->timer = 3; + this->subtimer = 1; EnqueueSFX(SFX_ITEM_SHIELD_BOUNCE); } diff --git a/src/projectile/dirtBallProjectile.c b/src/projectile/dirtBallProjectile.c index 843bdafa..97d7c34e 100644 --- a/src/projectile/dirtBallProjectile.c +++ b/src/projectile/dirtBallProjectile.c @@ -2,7 +2,7 @@ #include "entity.h" #include "enemy.h" #include "player.h" -#include "coord.h" +#include "physics.h" #include "functions.h" extern void (*const DirtBallProjectile_Functions[])(Entity*); @@ -29,7 +29,7 @@ void sub_080A881C(Entity* this) { this->knockbackSpeed = 0; if (this->type == 0) { this->parent->child = NULL; - if (this->bitfield == 0x80) { + if (this->contactFlags == 0x80) { gPlayerState.hurtBlinkSpeed = 0xf0; ModHealth(-2); } @@ -48,14 +48,14 @@ void DirtBallProjectile_Init(Entity* this) { this->spriteSettings.shadow = 1; this->zVelocity = Q_16_16(0.5); this->hitbox = (Hitbox*)&gUnk_08129764; - this->field_0x3c |= 0x10; + this->collisionFlags |= 0x10; switch (this->type) { case 0: InitializeAnimation(this, 0); break; case 1: - this->actionDelay = 0; - this->field_0xf = 0; + this->timer = 0; + this->subtimer = 0; break; case 2: InitializeAnimation(this, 5); @@ -83,11 +83,11 @@ void DirtBallProjectile_Action1(Entity* this) { this->z.HALF.HI += Q_8_8(1.0 / 16.0 - 1.0 / 128.0); FreeCarryEntity(this->child); CopyPosition(this, this->child); - if ((0xf < (u8)(this->actionDelay++ + 1)) && (entity = this->child, entity->actionDelay == 0)) { - if ((this->actionDelay & 2) != 0) { - entity->field_0xf += 1; + if ((0xf < (u8)(this->timer++ + 1)) && (entity = this->child, entity->timer == 0)) { + if ((this->timer & 2) != 0) { + entity->subtimer += 1; } - if ((this->child->field_0xf < 0x20) && ((this->child->field_0xf & 3) == 3)) { + if ((this->child->subtimer < 0x20) && ((this->child->subtimer & 3) == 3)) { parent->field_0x82.HALF.HI = 0xc0; this->action = 2; } diff --git a/src/projectile/fireProjectile.c b/src/projectile/fireProjectile.c index 85c06766..5aec66d8 100644 --- a/src/projectile/fireProjectile.c +++ b/src/projectile/fireProjectile.c @@ -34,10 +34,10 @@ void FireProjectile_Action1(Entity* this) { } else { if (this->spriteSettings.draw == 1) { CopyPosition(parent, this); - if (this->actionDelay != 0) { + if (this->timer != 0) { direction = parent->direction & 0x18; this->direction = direction; - this->actionDelay = 0; + this->timer = 0; InitializeAnimation(this, direction >> 3); } } diff --git a/src/projectile/gleerokProjectile.c b/src/projectile/gleerokProjectile.c index a3c82267..e852e92b 100644 --- a/src/projectile/gleerokProjectile.c +++ b/src/projectile/gleerokProjectile.c @@ -17,7 +17,7 @@ void GleerokProjectile(Entity* this) { } void GleerokProjectile_OnTick(Entity* this) { - if (((this->type != 3) && ((this->bitfield & 0x80) != 0)) && ((this->bitfield & 0x7f) != 0x1e)) { + if (((this->type != 3) && ((this->contactFlags & 0x80) != 0)) && ((this->contactFlags & 0x7f) != 0x1e)) { this->action = 3; COLLISION_OFF(this); InitializeAnimation(this, 0x53); @@ -58,7 +58,7 @@ void GleerokProjectile_Init(Entity* this) { iVar2 = 0x400; } this->zVelocity = this->z.WORD / (iVar2 << 8) << 0xd; - this->field_0xf = 0x1e; + this->subtimer = 0x1e; break; case 2: this->zVelocity = (this->z.WORD / 0x18000) << 0xc; @@ -91,15 +91,15 @@ void GleerokProjectile_Action1(Entity* this) { } else { GetNextFrame(this); LinearMoveUpdate(this); - if ((this->type != 2) && (this->field_0xf-- == 0)) { - this->field_0xf = 0x1e; + if ((this->type != 2) && (this->subtimer-- == 0)) { + this->subtimer = 0x1e; sub_08004596(this, GetFacingDirection(this, &gPlayerEntity)); } if (GravityUpdate(this, 0) == 0) { this->action = 2; sub_080A90D8(this); if (this->type == 2) { - this->actionDelay = 0xf; + this->timer = 0xf; InitializeAnimation(this, 0x54); } else { InitializeAnimation(this, 0x52); @@ -111,7 +111,7 @@ void GleerokProjectile_Action1(Entity* this) { void GleerokProjectile_Action2(Entity* this) { GetNextFrame(this); if (this->type == 2) { - if (this->actionDelay-- == 0) { + if (this->timer-- == 0) { COLLISION_OFF(this); this->action = 3; InitializeAnimation(this, 0x55); diff --git a/src/projectile/guardLineOfSight.c b/src/projectile/guardLineOfSight.c index 128052fb..9fc3a49f 100644 --- a/src/projectile/guardLineOfSight.c +++ b/src/projectile/guardLineOfSight.c @@ -1,6 +1,6 @@ #include "entity.h" #include "asm.h" -#include "coord.h" +#include "physics.h" #include "functions.h" #include "projectile.h" #include "hitbox.h" @@ -17,26 +17,26 @@ void GuardLineOfSight(Entity* this) { if (this->type == 0) { if (this->action == 0) { this->action = 1; - this->actionDelay = Random(); + this->timer = Random(); this->spriteSettings.draw = 0; } - if (this->bitfield == 0x80) { + if (this->contactFlags == 0x80) { if (this->parent != NULL) { this->parent->type = 0xff; } DeleteThisEntity(); } CopyPosition(this->parent, this); - if (this->field_0xf != 0) { - this->field_0xf -= 1; + if (this->subtimer != 0) { + this->subtimer -= 1; } else { if (sub_080644C8(this) != 0) { - if (((this->actionDelay++) & 3) == 0) { + if (((this->timer++) & 3) == 0) { entity = CreateProjectile(GUARD_LINE_OF_SIGHT); if (entity != NULL) { entity->type = 1; tmp = this->parent->knockbackDirection; - entity->direction = (gUnk_081299C8[(this->actionDelay >> 2 & 7)] + (tmp << 3)) & 0x1f; + entity->direction = (gUnk_081299C8[(this->timer >> 2 & 7)] + (tmp << 3)) & 0x1f; entity->parent = this->parent; CopyPosition(this, entity); } @@ -46,19 +46,19 @@ void GuardLineOfSight(Entity* this) { } else { if (this->action == 0) { this->action = 1; - this->actionDelay = 0x12; + this->timer = 0x12; this->spriteSettings.draw = 0; this->speed = 0x800; this->hitbox = (Hitbox*)&gUnk_080FD1E4; InitializeAnimation(this, 0); } - if (this->bitfield == 0x80) { + if (this->contactFlags == 0x80) { if (this->parent != NULL) { this->parent->type = 0xff; } DeleteThisEntity(); } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { DeleteThisEntity(); } LinearMoveUpdate(this); diff --git a/src/projectile/guruguruBarProjectile.c b/src/projectile/guruguruBarProjectile.c index fc88e2cf..b0c9eeb1 100644 --- a/src/projectile/guruguruBarProjectile.c +++ b/src/projectile/guruguruBarProjectile.c @@ -1,6 +1,6 @@ #include "entity.h" -#include "coord.h" +#include "physics.h" void sub_080AABB0(Entity*); @@ -22,7 +22,7 @@ void sub_080AABB0(Entity* this) { CopyPosition(parent, this); tmp = &gSineTable[parent->animationState]; - factor = this->actionDelay << 8; + factor = this->timer << 8; this->x.WORD += tmp[0] * factor; this->y.WORD -= tmp[0x40] * factor; } diff --git a/src/projectile/gyorgMaleEnergyProjectile.c b/src/projectile/gyorgMaleEnergyProjectile.c index 69c0aa73..4fb25abe 100644 --- a/src/projectile/gyorgMaleEnergyProjectile.c +++ b/src/projectile/gyorgMaleEnergyProjectile.c @@ -1,6 +1,6 @@ #include "entity.h" #include "enemy.h" -#include "coord.h" +#include "physics.h" #include "player.h" #include "functions.h" @@ -18,7 +18,7 @@ void GyorgMaleEnergyProjectile_OnTick(Entity* this) { } void sub_080AC8DC(Entity* this) { - switch ((s8)(this->bitfield & 0x7f)) { + switch ((s8)(this->contactFlags & 0x7f)) { case 0: case 1: case 2: @@ -44,7 +44,7 @@ void sub_080AC8DC(Entity* this) { void GyorgMaleEnergyProjectile_Init(Entity* this) { this->action = 1; - this->actionDelay = 0x3c; + this->timer = 0x3c; this->collisionLayer = 2; UpdateSpriteForCollisionLayer(this); InitializeAnimation(this, 0); @@ -61,7 +61,7 @@ void GyorgMaleEnergyProjectile_Action1(Entity* this) { PositionRelative(this->parent, this, gSineTable[animationState] * Q_16_16(5.0 / 32.0), gSineTable[animationState + 0x40] * Q_16_16(-5.0 / 32.0)); GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; COLLISION_ON(this); this->direction = GetFacingDirection(this, &gPlayerEntity); @@ -75,7 +75,7 @@ void GyorgMaleEnergyProjectile_Action2(Entity* this) { if (IsProjectileOffScreen(this)) { DeleteThisEntity(); } - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; COLLISION_OFF(this); this->speed = this->speed >> 1; diff --git a/src/projectile/gyorgTail.c b/src/projectile/gyorgTail.c index c9dc6a8b..d743cf40 100644 --- a/src/projectile/gyorgTail.c +++ b/src/projectile/gyorgTail.c @@ -1,6 +1,6 @@ #include "entity.h" #include "asm.h" -#include "coord.h" +#include "physics.h" #include "sound.h" #include "functions.h" #include "projectile.h" @@ -64,18 +64,18 @@ void GyorgTail_Init(Entity* this) { ASM_FUNC("asm/non_matching/gyorgTail/sub_080AC388.inc", void sub_080AC388(Entity* this)) void sub_080AC480(Entity* this) { - if (this->actionDelay != 0) { + if (this->timer != 0) { if (this->parent->health == 0) { this->action = 1; this->hitType = 0x1d; } else { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->hitType = 0x1c; SoundReq(SFX_116); } } } else { - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { this->action = 1; this->hitType = 0x1d; } @@ -220,8 +220,8 @@ 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->actionDelay = 0x3c; - this->field_0xf = 0x56; + this->timer = 0x3c; + this->subtimer = 0x56; } } diff --git a/src/projectile/iceProjectile.c b/src/projectile/iceProjectile.c index 2b5b6b34..c3e0e6ca 100644 --- a/src/projectile/iceProjectile.c +++ b/src/projectile/iceProjectile.c @@ -36,10 +36,10 @@ void IceProjectile_Action1(Entity* this) { } else { if (this->spriteSettings.draw == 1) { CopyPosition(parent, this); - if (this->actionDelay != 0) { + if (this->timer != 0) { direction = parent->direction & 0x18; this->direction = direction; - this->actionDelay = 0; + this->timer = 0; InitializeAnimation(this, direction >> 3); } } diff --git a/src/projectile/keatonDagger.c b/src/projectile/keatonDagger.c index 8c9bc2f1..53a61687 100644 --- a/src/projectile/keatonDagger.c +++ b/src/projectile/keatonDagger.c @@ -1,6 +1,6 @@ #include "entity.h" #include "player.h" -#include "coord.h" +#include "physics.h" extern void sub_0803C0AC(Entity*); @@ -14,7 +14,7 @@ void KeatonDagger(Entity* this) { } parent = this->parent; if (((parent == NULL) || (parent->health == 0)) || (parent->next == NULL)) { - if (((this->bitfield & 0x80) != 0) && (this->field_0x4c == &gPlayerEntity)) { + if (((this->contactFlags & 0x80) != 0) && (this->contactedEntity == &gPlayerEntity)) { sub_0803C0AC(this); } DeleteEntity(this); diff --git a/src/projectile/lakituLightning.c b/src/projectile/lakituLightning.c index 171be05c..6e1e93f7 100644 --- a/src/projectile/lakituLightning.c +++ b/src/projectile/lakituLightning.c @@ -17,7 +17,7 @@ void LakituLightning_OnTick(Entity* this) { } void sub_080A9DD8(Entity* this) { - if ((this->health == 0) || (this->bitfield == 0x80)) { + if ((this->health == 0) || (this->contactFlags == 0x80)) { DeleteThisEntity(); } LakituLightning_OnTick(this); @@ -25,7 +25,7 @@ void sub_080A9DD8(Entity* this) { void LakituLightning_Init(Entity* this) { this->action = 1; - this->actionDelay = 0xb4; + this->timer = 0xb4; this->health = 1; InitializeAnimation(this, 0); } @@ -33,7 +33,7 @@ void LakituLightning_Init(Entity* this) { void LakituLightning_Action1(Entity* this) { GetNextFrame(this); ProcessMovement3(this); - if ((this->collisions != COL_NONE) || (--this->actionDelay == 0)) { + if ((this->collisions != COL_NONE) || (--this->timer == 0)) { CreateFx(this, FX_BLUE_EFC, 0); DeleteThisEntity(); } diff --git a/src/projectile/mandiblesProjectile.c b/src/projectile/mandiblesProjectile.c index 1bc2c36e..a468d8a1 100644 --- a/src/projectile/mandiblesProjectile.c +++ b/src/projectile/mandiblesProjectile.c @@ -1,6 +1,6 @@ #include "entity.h" #include "enemy.h" -#include "coord.h" +#include "physics.h" #include "functions.h" #include "game.h" #include "hitbox.h" @@ -40,10 +40,10 @@ void MandiblesProjectile_OnTick(Entity* this) { void sub_080A9EBC(Entity* this) { Entity* parent; - if ((this->bitfield & 0x80) != 0) { + if ((this->contactFlags & 0x80) != 0) { switch (this->action) { case 4: - this->field_0xf = 0; + this->subtimer = 0; ModHealth(-2); ProcessMovement3(this); UpdateAnimationSingleFrame(this); @@ -53,7 +53,7 @@ void sub_080A9EBC(Entity* this) { this->field_0x82.HALF.LO = 2; this->animationState = 0xff; sub_080AA270(this); - this->field_0xf = 0x20; + this->subtimer = 0x20; } break; default: @@ -84,7 +84,7 @@ void MandiblesProjectile_Action1(Entity* this) { if (this->field_0x80.HWORD != 0) { this->field_0x80.HWORD -= 1; } else { - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { sub_080AA270(this); } else { if (sub_080AA2E0(this) != 0) { @@ -127,14 +127,14 @@ void MandiblesProjectile_Action3(Entity* this) { } } if (entity->confusedTime == 0) { - if (this->field_0xf != 0) { - this->field_0xf -= 1; + if (this->subtimer != 0) { + this->subtimer -= 1; } else { UpdateAnimationSingleFrame(this); if ((this->frame & ANIM_DONE) != 0) { this->action = 4; this->field_0x82.HALF.LO = 3; - this->field_0xf = 0x40; + this->subtimer = 0x40; uVar1 = entity->animationState; this->direction = uVar1 << 2; this->animationState = uVar1 << 0x1a >> 0x1a; @@ -163,8 +163,8 @@ void MandiblesProjectile_Action4(Entity* this) { if (entity->next == NULL) { this->child = NULL; } - if (this->field_0xf != 0) { - this->field_0xf -= 1; + if (this->subtimer != 0) { + this->subtimer -= 1; } else { if (sub_080AA374(this) != 0) { if (entity->health == 0) { @@ -174,7 +174,7 @@ void MandiblesProjectile_Action4(Entity* this) { this->action = 1; this->animationState = 0xff; this->field_0x82.HALF.LO = 0; - this->actionDelay = 0; + this->timer = 0; this->field_0x80.HWORD = 0x20; this->spriteOrientation.flipY = 2; this->parent = this->child; @@ -185,8 +185,8 @@ void MandiblesProjectile_Action4(Entity* this) { entity->direction = entity->animationState << 2; entity->speed = 0; entity->field_0x82.HALF.LO = 1; - entity->actionDelay = 0; - entity->field_0xf = 0x78; + entity->timer = 0; + entity->subtimer = 0x78; entity->field_0x80.HWORD = 0x20; sub_080AA3E0(entity, 1); } @@ -235,7 +235,7 @@ void sub_080AA270(Entity* this) { u32 animationState; Entity* parent; parent = this->parent; - this->field_0xf = gUnk_08129CA4[Random() & 7]; + this->subtimer = gUnk_08129CA4[Random() & 7]; animationState = parent->animationState; if (this->animationState == 0xff) { this->animationState = animationState; @@ -278,9 +278,9 @@ void sub_080AA320(Entity* this) { parent = this->parent; this->action = 2; this->field_0x82.HALF.LO = 1; - this->field_0xf = 0; + this->subtimer = 0; parent->action = 2; - parent->field_0xf = 0x30; + parent->subtimer = 0x30; parent->field_0x80.HWORD = 0x50; parent->speed = 0; parent->direction = sub_08049F84(parent, 0); diff --git a/src/projectile/mazaalEnergyBeam.c b/src/projectile/mazaalEnergyBeam.c index 095f8e45..1584348c 100644 --- a/src/projectile/mazaalEnergyBeam.c +++ b/src/projectile/mazaalEnergyBeam.c @@ -1,6 +1,6 @@ #include "entity.h" #include "sound.h" -#include "coord.h" +#include "physics.h" extern void (*const MazaalEnergyBeam_Actions[])(Entity*); @@ -10,7 +10,7 @@ void MazaalEnergyBeam(Entity* this) { void MazaalEnergyBeam_Init(Entity* this) { this->action = 1; - this->actionDelay = 10; + this->timer = 10; this->z.HALF.HI -= 2; this->y.HALF.HI += 2; InitializeAnimation(this, 0); @@ -20,7 +20,7 @@ void MazaalEnergyBeam_Init(Entity* this) { void MazaalEnergyBeam_Action1(Entity* this) { const s16* tmp; - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; COLLISION_OFF(this); this->spritePriority.b0 = 7; diff --git a/src/projectile/moblinSpear.c b/src/projectile/moblinSpear.c index 039eaa1d..0cf5f0c6 100644 --- a/src/projectile/moblinSpear.c +++ b/src/projectile/moblinSpear.c @@ -1,6 +1,6 @@ #include "entity.h" #include "enemy.h" -#include "coord.h" +#include "physics.h" typedef struct { s8 offsetX; @@ -32,11 +32,11 @@ void MoblinSpear_OnTick(Entity* this) { void sub_080A832C(Entity* this) { u8 tmp; - if (this->bitfield == 0x80) { + if (this->contactFlags == 0x80) { this->iframes = 0x10; this->knockbackDuration = 0xc; this->knockbackSpeed = 0x180; - this->parent->bitfield = this->bitfield; + this->parent->contactFlags = this->contactFlags; } tmp = this->iframes; if ((tmp & 0x80) != 0) { diff --git a/src/projectile/octorokBossProjectile.c b/src/projectile/octorokBossProjectile.c index 54331d1c..0f67d14f 100644 --- a/src/projectile/octorokBossProjectile.c +++ b/src/projectile/octorokBossProjectile.c @@ -35,8 +35,8 @@ void OctorokBossProjectile_Init(Entity* this) { case 0: LinearMoveAngle(this, 0x4800, this->direction); this->speed = 0x200; - this->actionDelay = 0; - this->field_0xf = this->direction; + this->timer = 0; + this->subtimer = this->direction; this->field_0x78.HWORD = 300; InitAnimationForceUpdate(this, 0); break; @@ -58,7 +58,7 @@ void OctorokBossProjectile_Init(Entity* this) { this->direction = this->direction - (Random() & 7); } this->speed = 0x200; - this->actionDelay = 0x30; + this->timer = 0x30; LinearMoveAngle(this, 0x5000, this->direction); InitializeAnimation(this, 5); break; @@ -85,14 +85,14 @@ void OctorokBossProjectile_Action1(Entity* this) { if (this->parent->action == 2) { DeleteThisEntity(); } - if ((this->type2 == 0) && ((this->bitfield & 0x80) != 0)) { - if ((this->bitfield & 0x7f) == 0) { + if ((this->type2 == 0) && ((this->contactFlags & 0x80) != 0)) { + if ((this->contactFlags & 0x7f) == 0) { OctorokBossProjectile_Action2(this); } this->direction = this->knockbackDirection << 3; this->speed = 0x400; this->type2 = 1; - this->actionDelay = 0; + this->timer = 0; COLLISION_OFF(this); } if (sub_0806FC80(this, this->parent, 0x40) != 0) { @@ -121,18 +121,18 @@ void OctorokBossProjectile_Action1(Entity* this) { if ((this->collisions & (COL_NORTH_ANY | COL_SOUTH_ANY)) != COL_NONE) { this->direction = -this->direction ^ 0x80; } - if (this->direction == this->field_0xf) { + if (this->direction == this->subtimer) { return; } SoundReq(SFX_164); if (this->field_0x78.HWORD == 0) { - this->actionDelay = 4; + this->timer = 4; } else { - this->actionDelay++; + this->timer++; } - this->field_0xf = this->direction; - if (this->actionDelay < 2) { + this->subtimer = this->direction; + if (this->timer < 2) { return; } for (index = 0; index < 3; ++index) { @@ -168,19 +168,19 @@ void OctorokBossProjectile_Action1(Entity* this) { if (--*(u32*)&this->field_0x78 == -1) { OctorokBossProjectile_Action2(this); } - if ((this->bitfield & 0x80) == 0) { + if ((this->contactFlags & 0x80) == 0) { return; } OctorokBossProjectile_Action2(this); break; case 2: GetNextFrame(this); - if (this->actionDelay-- != 0) { + if (this->timer-- != 0) { LinearMoveAngle(this, this->speed, this->direction); return; } if (this->child != NULL) { - this->child->actionDelay = 1; + this->child->timer = 1; } DeleteThisEntity(); break; diff --git a/src/projectile/projectile5.c b/src/projectile/projectile5.c index 84004de0..142c0590 100644 --- a/src/projectile/projectile5.c +++ b/src/projectile/projectile5.c @@ -2,7 +2,7 @@ #include "enemy.h" #include "player.h" #include "room.h" -#include "coord.h" +#include "physics.h" extern u32 sub_080B1B44(u32, u32); @@ -29,7 +29,7 @@ void sub_080A86F0(Entity* this) { if ((this->parent->field_0x82.HALF.HI & 0x3f) == 3) { if (gPlayerState.hurtBlinkSpeed != 0) { if (sub_080B1B44(TILE(this->x.HALF.HI, this->y.HALF.HI), gPlayerEntity.collisionLayer) == 0) { - if (this->bitfield == 0x80) { + if (this->contactFlags == 0x80) { *pbVar2 = *pbVar2 & 0x7f; DeleteThisEntity(); } @@ -43,7 +43,7 @@ void sub_080A86F0(Entity* this) { void Projectile5_Init(Entity* this) { this->action = 1; - this->field_0x3c |= 0x10; + this->collisionFlags |= 0x10; this->hitbox = (Hitbox*)&gUnk_08129734; } diff --git a/src/projectile/removableDust.c b/src/projectile/removableDust.c index 0822b00e..2c188926 100644 --- a/src/projectile/removableDust.c +++ b/src/projectile/removableDust.c @@ -1,6 +1,6 @@ #include "entity.h" #include "enemy.h" -#include "coord.h" +#include "physics.h" #include "functions.h" #include "object.h" @@ -27,7 +27,7 @@ void RemovableDust_OnTick(Entity* this) { if (this->action == 0) { this->action = 1; this->frameIndex = this->type; - this->field_0x1c = 1; + this->gustJarFlags = 1; this->speed = this->field_0x86.HWORD; if (this->type == 0) { sub_080AA494(this); @@ -38,7 +38,7 @@ void RemovableDust_OnTick(Entity* this) { } void sub_080AA450(Entity* this) { - if (this->bitfield == 0x96) { + if (this->contactFlags == 0x96) { sub_080AA464(this); } } diff --git a/src/projectile/rockProjectile.c b/src/projectile/rockProjectile.c index 53266767..dff50413 100644 --- a/src/projectile/rockProjectile.c +++ b/src/projectile/rockProjectile.c @@ -16,7 +16,7 @@ void RockProjectile_OnTick(Entity* this) { } void sub_080A8064(Entity* this) { - if (this->bitfield == 0x80) { + if (this->contactFlags == 0x80) { DeleteEntity(this); } else { this->direction = this->knockbackDirection; @@ -26,7 +26,7 @@ void sub_080A8064(Entity* this) { void RockProjectile_Init(Entity* this) { this->action = 1; - this->actionDelay = 0x30; + this->timer = 0x30; this->zVelocity = Q_16_16(0.625); InitializeAnimation(this, 0); } @@ -38,7 +38,7 @@ void RockProjectile_Action1(Entity* this) { DeleteEntity(this); } else { sub_08016AD2(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 3; } } diff --git a/src/projectile/spiderWeb.c b/src/projectile/spiderWeb.c index 52df2d19..14909320 100644 --- a/src/projectile/spiderWeb.c +++ b/src/projectile/spiderWeb.c @@ -45,9 +45,9 @@ void sub_080AA6C0(Entity* this) { }; Entity* object; - if (this->bitfield == 0x87) { + if (this->contactFlags == 0x87) { this->action = 3; - this->actionDelay = 90; + this->timer = 90; COLLISION_OFF(this); InitAnimationForceUpdate(this, this->type + 0x10); object = CreateObject(OBJECT_2A, 3, 0); @@ -78,7 +78,7 @@ void sub_080AA78C(Entity* this) { if (this->subAction == 0) { animationState = (gPlayerEntity.animationState >> 1); if (animationState != this->type) { - this->field_0x3a &= 0xfb; + this->gustJarState &= 0xfb; if (AnimationStateFlip90(animationState) != this->type) { return; } @@ -118,8 +118,8 @@ void SpiderWeb_Init(Entity* this) { DeleteThisEntity(); } this->action = 1; - this->field_0x1c = 1; - this->field_0x16 = 1; + this->gustJarFlags = 1; + this->carryFlags = 1; this->hitbox = (Hitbox*)typeHitboxes[this->type]; this->cutsceneBeh.HALF.LO = 0; InitAnimationForceUpdate(this, this->type); @@ -164,7 +164,7 @@ void SpiderWeb_SubAction0(Entity* this) { } } this->cutsceneBeh.HALF.LO = 1; - this->field_0xf = 2; + this->subtimer = 2; InitAnimationForceUpdate(this, this->type + 4); } if ((entity->animationState >> 1 == this->type) && (gPlayerState.framestate == PL_STATE_PULL) && @@ -186,7 +186,7 @@ void SpiderWeb_SubAction1(Entity* this) { void SpiderWeb_Action3(Entity* this) { GetNextFrame(this); - if (--this->actionDelay == 0) { + if (--this->timer == 0) { sub_080AAAA8(this); } } diff --git a/src/projectile/stalfosProjectile.c b/src/projectile/stalfosProjectile.c index 3f8f679d..0d317738 100644 --- a/src/projectile/stalfosProjectile.c +++ b/src/projectile/stalfosProjectile.c @@ -29,7 +29,7 @@ void StalfosProjectile_OnTick(Entity* this) { } void sub_080A9A34(Entity* this) { - if (this->bitfield == 0x9d) { + if (this->contactFlags == 0x9d) { this->action = 3; COLLISION_OFF(this); this->zVelocity = Q_16_16(2.625); @@ -84,7 +84,7 @@ void StalfosProjectile_Init(Entity* this) { break; } - this->field_0x1c = 2; + this->gustJarFlags = 2; if (this->type == 0) { InitializeAnimation(this, 5); } else { diff --git a/src/projectile/torchTrapProjectile.c b/src/projectile/torchTrapProjectile.c index 38503e89..402dc60a 100644 --- a/src/projectile/torchTrapProjectile.c +++ b/src/projectile/torchTrapProjectile.c @@ -20,14 +20,14 @@ void sub_080AAB1C(Entity* this) { void TorchTrapProjectile_Init(Entity* this) { this->action = 1; - this->actionDelay = 0x1e; + this->timer = 0x1e; InitializeAnimation(this, 0); } void TorchTrapProjectile_Action1(Entity* this) { GetNextFrame(this); - if (this->actionDelay != 0) { - this->actionDelay -= 1; + if (this->timer != 0) { + this->timer -= 1; } else { if (ProcessMovement3(this) == 0) { LinearMoveUpdate(this); diff --git a/src/projectile/v1DarkMagicProjectile.c b/src/projectile/v1DarkMagicProjectile.c index 188fed6e..00c1366d 100644 --- a/src/projectile/v1DarkMagicProjectile.c +++ b/src/projectile/v1DarkMagicProjectile.c @@ -1,6 +1,6 @@ #include "entity.h" #include "enemy.h" -#include "coord.h" +#include "physics.h" #include "player.h" #include "functions.h" @@ -25,9 +25,9 @@ void V1DarkMagicProjectile_OnTick(Entity* this) { } void sub_080AAC44(Entity* this) { - if ((this->bitfield & 0x80) != 0) { + if ((this->contactFlags & 0x80) != 0) { if (this->type2 == 0) { - if ((this->bitfield & 0x3f) == 0) { + if ((this->contactFlags & 0x3f) == 0) { this->action = 2; COLLISION_OFF(this); if (this->type == 0) { @@ -117,8 +117,8 @@ void V1DarkMagicProjectile_Init(Entity* this) { SortEntityAbove(this->parent, this); } if (this->type == 0) { - this->actionDelay = 0; - this->field_0xf = 4; + this->timer = 0; + this->subtimer = 4; this->field_0x80.HALF.LO = 0; this->field_0x80.HALF.HI = 0; this->health = 0x10; @@ -149,8 +149,8 @@ void V1DarkMagicProjectile_Action1(Entity* this) { switch (this->type) { case 0: - if (--this->field_0xf == 0) { - this->field_0xf = 4; + if (--this->subtimer == 0) { + this->subtimer = 4; uVar2 = GetFacingDirection(this, &gPlayerEntity); sub_08004596(this, uVar2); } @@ -199,8 +199,8 @@ void sub_080AAF74(Entity* this) { if (sub_0807953C() != 0) { this->field_0x80.HALF.LO += (Random() & 1) + 1; } - if (++this->actionDelay == 0x3c) { - this->actionDelay = 0x1e; + if (++this->timer == 0x3c) { + this->timer = 0x1e; gPlayerEntity.iframes = 8; ModHealth(-4); SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6); diff --git a/src/projectile/v1EyeLaser.c b/src/projectile/v1EyeLaser.c index 19966321..52115d4f 100644 --- a/src/projectile/v1EyeLaser.c +++ b/src/projectile/v1EyeLaser.c @@ -27,8 +27,8 @@ void V1EyeLaser_Init(Entity* this) { InitializeAnimation(this, 0); } else { this->action = 2; - this->field_0xf = 4; - InitializeAnimation(this, this->actionDelay); + this->subtimer = 4; + InitializeAnimation(this, this->timer); } } @@ -46,7 +46,7 @@ void V1EyeLaser_Action2(Entity* this) { this->x.WORD += (this->parent->x.WORD - *(u32*)&this->field_0x74); *(u32*)&this->field_0x74 = this->parent->x.WORD; sub_080AB888(this); - if (this->parent->field_0xf == 0) { + if (this->parent->subtimer == 0) { DeleteThisEntity(); } } @@ -97,7 +97,7 @@ void sub_080AB844(Entity* this, s32 param_1, s32 param_2) { entity = CreateProjectile(V1_EYE_LASER); if (entity != NULL) { entity->type = 1; - entity->actionDelay = param_1; + entity->timer = param_1; entity->parent = this->parent; PositionRelative(this, entity, 0, Q_16_16(param_2)); if (param_1 != 1) { @@ -111,14 +111,14 @@ void sub_080AB844(Entity* this, s32 param_1, s32 param_2) { void sub_080AB888(Entity* this) { s32 index; - this->field_0xf -= 1; + this->subtimer -= 1; index = 0; - switch (this->actionDelay) { + switch (this->timer) { case 3: index = 1; case 4: - this->hitbox = (Hitbox*)gUnk_0812A5F4[this->field_0xf * 2 + index]; + this->hitbox = (Hitbox*)gUnk_0812A5F4[this->subtimer * 2 + index]; break; case 0: case 1: @@ -127,8 +127,8 @@ void sub_080AB888(Entity* this) { break; } - if (this->field_0xf == 0) { - this->field_0xf = 4; + if (this->subtimer == 0) { + this->subtimer = 4; } } diff --git a/src/projectile/v1FireProjectile.c b/src/projectile/v1FireProjectile.c index 8c2e0729..022b48f4 100644 --- a/src/projectile/v1FireProjectile.c +++ b/src/projectile/v1FireProjectile.c @@ -19,11 +19,11 @@ void V1FireProjectile_OnTick(Entity* this) { } void sub_080AB2DC(Entity* this) { - if ((this->bitfield & 0x80) != 0) { + if ((this->contactFlags & 0x80) != 0) { this->action = 3; COLLISION_OFF(this); InitializeAnimation(this, 0x53); - if ((this->bitfield & 0x7f) == 0) { + if ((this->contactFlags & 0x7f) == 0) { ModHealth(-4); } } @@ -73,11 +73,11 @@ void V1FireProjectile_Action1(Entity* this) { LinearMoveUpdate(this); if (GravityUpdate(this, 0) == 0) { this->action = 2; - this->actionDelay = 0xf; + this->timer = 0xf; InitializeAnimation(this, 0x54); sub_080AB4A4(this); } else { - if (++this->actionDelay > 0xe0) { + if (++this->timer > 0xe0) { DeleteThisEntity(); } } @@ -117,7 +117,7 @@ void sub_080AB4A4(Entity* this) { } s8* sub_080AB4F8(Entity* this) { - return (s8*)&gUnk_0812A4EC[this->type << 5 | this->field_0xf << 1]; + return (s8*)&gUnk_0812A4EC[this->type << 5 | this->subtimer << 1]; } void (*const V1FireProjectile_Functions[])(Entity*) = { diff --git a/src/projectile/v2Projectile.c b/src/projectile/v2Projectile.c index e2c86b53..2d30f43b 100644 --- a/src/projectile/v2Projectile.c +++ b/src/projectile/v2Projectile.c @@ -31,12 +31,12 @@ void sub_080ABBA8(Entity* this) { } void sub_080ABBF4(Entity* this) { - if ((this->bitfield & 0x80) == 0) + if ((this->contactFlags & 0x80) == 0) return; switch (this->type) { case 2: { - switch ((this->bitfield & 0x3f)) { + switch ((this->contactFlags & 0x3f)) { case 0: { ModHealth(-4); // fallthrough @@ -52,7 +52,7 @@ void sub_080ABBF4(Entity* this) { } case 0: case 1: { - if ((this->bitfield & 0x3f) == 0) { + if ((this->contactFlags & 0x3f) == 0) { ModHealth(-2); DeleteThisEntity(); } @@ -88,8 +88,8 @@ void sub_080ABC90(Entity* this) { void sub_080ABCC4(Entity* this) { this->action = 1; - this->actionDelay = (Random() & 0x3f) + 0x30; - this->field_0xf = 0; + this->timer = (Random() & 0x3f) + 0x30; + this->subtimer = 0; this->direction = Random() & 0x1f; this->field_0x74.HWORD = TILE(this->x.HALF.HI, this->y.HALF.HI); this->field_0x76.HWORD = GetTileType(this->field_0x74.HWORD, 2); @@ -99,7 +99,7 @@ void sub_080ABCC4(Entity* this) { } void sub_080ABD44(Entity* this) { - if (--this->actionDelay == 0) { + if (--this->timer == 0) { this->action = 2; InitializeAnimation(this, 1); } @@ -159,9 +159,9 @@ void sub_080ABE88(Entity* this) { void sub_080ABEA8(Entity* this) { this->action = 1; - this->actionDelay = 0x60; + this->timer = 0x60; this->spritePriority.b0 = 2; - this->field_0x1c = 1; + this->gustJarFlags = 1; if (this->type2 == 0) { this->direction = (Random() & 0xf) << 1; } else { diff --git a/src/projectile/v3ElectricProjectile.c b/src/projectile/v3ElectricProjectile.c index 77308f1e..697113dd 100644 --- a/src/projectile/v3ElectricProjectile.c +++ b/src/projectile/v3ElectricProjectile.c @@ -2,7 +2,7 @@ #include "collision.h" #include "enemy.h" #include "player.h" -#include "coord.h" +#include "physics.h" #include "functions.h" extern void (*const V3ElectricProjectile_Functions[])(Entity*); @@ -30,8 +30,8 @@ void sub_080ABFEC(Entity* this) { switch (this->type) { case 0: { this->action = 1; - this->actionDelay = 0; - this->field_0xf = 0x7; + this->timer = 0; + this->subtimer = 0x7; this->cutsceneBeh.HALF.HI = 0x18; this->damage = 0x88; CopyPositionAndSpriteOffset(this->parent, this); @@ -50,8 +50,8 @@ void sub_080ABFEC(Entity* this) { } default: { this->action = 2; - this->actionDelay = 0; - this->field_0xf = 0xff; + this->timer = 0; + this->subtimer = 0xff; 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->actionDelay = 0x10; + this->timer = 0x10; } this->z.HALF.HI -= 0x28; } @@ -104,25 +104,25 @@ void V3ElectricProjectile_Action2(Entity* this) { if (IsProjectileOffScreen(this)) { DeleteThisEntity(); } - if (this->actionDelay < 0x1e) { - if (((++this->actionDelay) & this->field_0xf) == 0) { + if (this->timer < 0x1e) { + if (((++this->timer) & this->subtimer) == 0) { sub_08004596(this, GetFacingDirection(this, &gPlayerEntity)); } } } void sub_080AC168(Entity* this) { - u8 actionDelay; + u8 timer; GetNextFrame(this); this->z.WORD += 0xffff8000; - actionDelay = --this->actionDelay; - if (actionDelay == 0) { + timer = --this->timer; + if (timer == 0) { u32 rand; u32 dir; this->action = 4; - this->actionDelay = 4; + this->timer = 4; rand = Random() & 0x7; - this->field_0xf = gUnk_0812A982[rand]; + this->subtimer = gUnk_0812A982[rand]; dir = GetFacingDirection(this, &gPlayerEntity); if (this->parent->cutsceneBeh.HALF.LO == 3) { dir -= projectileDirections[rand]; @@ -143,10 +143,10 @@ void sub_080AC200(Entity* this) { Entity* proj; GetNextFrame(this); - if (--this->actionDelay) + if (--this->timer) return; - this->actionDelay = 0x10; + this->timer = 0x10; proj = CreateProjectile(V3_ELECTRIC_PROJECTILE); if (proj) { @@ -157,7 +157,7 @@ void sub_080AC200(Entity* this) { CopyPosition(this, proj); } - if (--this->field_0xf == 0) { + if (--this->subtimer == 0) { DeleteThisEntity(); } diff --git a/src/projectile/v3TennisBallProjectile.c b/src/projectile/v3TennisBallProjectile.c index c487be01..51d78082 100644 --- a/src/projectile/v3TennisBallProjectile.c +++ b/src/projectile/v3TennisBallProjectile.c @@ -18,7 +18,7 @@ void V3TennisBallProjectile_OnTick(Entity* this) { } void sub_080ACA68(Entity* this) { - switch (this->bitfield & 0x7f) { + switch (this->contactFlags & 0x7f) { case 0x1a: case 0xa: case 0xb: @@ -27,7 +27,7 @@ void sub_080ACA68(Entity* this) { this->action = 2; this->flags &= ~ENT_COLLIDE; this->speed += 0x80 * 2; - this->child = this->field_0x4c; + this->child = this->contactedEntity; if (sub_080ACB40(this)) { this->direction = 0; } else { @@ -106,7 +106,7 @@ bool32 sub_080ACB40(Entity* this) { void sub_080ACB90(Entity* this) { Entity* parent = this->parent; if ((this->x.HALF.HI == parent->x.HALF.HI) && (this->y.HALF.HI <= parent->y.HALF.HI)) { - parent->field_0xf = 1; + parent->subtimer = 1; CreateFx(this, FX_REFLECT2, 0x40); EnqueueSFX(SFX_ITEM_GLOVES_KNOCKBACK); DeleteThisEntity(); diff --git a/src/projectile/windProjectile.c b/src/projectile/windProjectile.c index 8232bf91..c8d0bfad 100644 --- a/src/projectile/windProjectile.c +++ b/src/projectile/windProjectile.c @@ -34,10 +34,10 @@ void WindProjectile_Action1(Entity* this) { if (this->spriteSettings.draw == 1) { CopyPosition(parent, this); direction = (parent->direction + 4) & 0x18; - if (this->actionDelay != 0) { + if (this->timer != 0) { this->direction = direction; this->animationState = direction >> 2; - this->actionDelay = 0; + this->timer = 0; InitializeAnimation(this, direction >> 3); } else { if (direction >> 2 != this->animationState) { diff --git a/src/projectileUtils.c b/src/projectileUtils.c index 31bac370..56dc2a66 100644 --- a/src/projectileUtils.c +++ b/src/projectileUtils.c @@ -34,7 +34,7 @@ bool32 ProjectileInit(Entity* this) { if (this->speed == 0) { this->speed = definition->speed; } - this->field_0x3c = (definition->field0x3c << 4) | 7; + this->collisionFlags = (definition->field0x3c << 4) | 7; this->flags2 = definition->flags2; this->hitType = definition->damageType; this->hurtType = definition->field0x40; diff --git a/src/room.c b/src/room.c index babc3f02..339c238d 100644 --- a/src/room.c +++ b/src/room.c @@ -64,7 +64,7 @@ NONMATCH("asm/non_matching/LoadRoomEntity.inc", Entity* LoadRoomEntity(EntityDat RegisterRoomEntity(v4, dat); if ((dat->flags & 0xF0) != 16) { v5->type2 = dat->type2; - v5->actionDelay = (dat->type2 & 0xFF00) >> 8; + v5->timer = (dat->type2 & 0xFF00) >> 8; if (kind == 9) return v5; sub_0804AF0C(v5, dat); diff --git a/src/script.c b/src/script.c index cbcab29d..64692f23 100644 --- a/src/script.c +++ b/src/script.c @@ -230,7 +230,7 @@ UNUSED ScriptExecutionContext* StartCutscene2(Entity* entity, u16* script) { context = CreateScriptExecutionContext(); if (context) { entity->flags |= ENT_SCRIPTED; - *(ScriptExecutionContext**)&entity->field_0x3c = context; + *(ScriptExecutionContext**)&entity->collisionFlags = context; context->scriptInstructionPointer = script; } return context; @@ -321,7 +321,7 @@ void sub_0807DD50(Entity* entity) { } void sub_0807DD64(Entity* entity) { - entity->field_0xf = entity->animationState; + entity->subtimer = entity->animationState; entity->animIndex = 0xff; entity->field_0x80.HWORD = 0; entity->field_0x82.HWORD = 0; @@ -374,9 +374,9 @@ void HandleEntity0x82Actions(Entity* entity) { break; case 1 << 3: if (gRoomTransition.frameCount % 4 == 0) { - temp = (entity->field_0xf + 2) & 7; + temp = (entity->subtimer + 2) & 7; entity->animationState = temp; - entity->field_0xf = temp; + entity->subtimer = temp; } break; case 1 << 4: @@ -403,14 +403,14 @@ void sub_0807DE80(Entity* entity) { if (entity->field_0x82.HWORD & 1) { u32 t1, t2; t1 = local2 & 0xfc; - t2 = entity->field_0xf >> 1; + t2 = entity->subtimer >> 1; local2 = t1 + t2; } else { u32 t1, t2; t1 = local2 & 0xfc; t2 = entity->animationState >> 1; local2 = t1 + t2; - entity->field_0xf = entity->animationState; + entity->subtimer = entity->animationState; } } if (local2 != entity->animIndex) { @@ -1654,7 +1654,7 @@ void WaitForAnimDone(Entity* entity, ScriptExecutionContext* context) { } } -void WaitForPlayerFrameHiBit(Entity* entity, ScriptExecutionContext* context) { +void WaitForPlayerAnim(Entity* entity, ScriptExecutionContext* context) { if ((gPlayerEntity.frame & ANIM_DONE) != 0) { gActiveScriptInfo.flags |= 1; } else { @@ -1664,7 +1664,7 @@ void WaitForPlayerFrameHiBit(Entity* entity, ScriptExecutionContext* context) { void DeleteHitbox(Entity* entity, ScriptExecutionContext* context) { entity->hitbox = NULL; - entity->field_0x17 &= ~1; + entity->followerFlag &= ~1; } void SetPriorityMessage(Entity* entity, ScriptExecutionContext* context) { @@ -2095,7 +2095,7 @@ void sub_0807FB64(Entity* entity, ScriptExecutionContext* context) { void sub_0807FB74(Entity* entity, ScriptExecutionContext* context) { gPlayerState.swim_state = 0; - gPlayerEntity.field_0x3c &= ~4; + gPlayerEntity.collisionFlags &= ~4; } void sub_0807FB94(Entity* entity, ScriptExecutionContext* context) { diff --git a/src/sound.c b/src/sound.c index bc152269..532d964f 100644 --- a/src/sound.c +++ b/src/sound.c @@ -1091,7 +1091,7 @@ const Song gSongTable[] = { [SFX_106] = { &sfx106, MUSIC_PLAYER_0B, MUSIC_PLAYER_0B }, [SFX_107] = { &sfx107, MUSIC_PLAYER_0A, MUSIC_PLAYER_0A }, [SFX_108] = { &sfx108, MUSIC_PLAYER_09, MUSIC_PLAYER_09 }, - [SFX_109] = { &sfx109, MUSIC_PLAYER_1E, MUSIC_PLAYER_1E }, + [SFX_ITEM_GET] = { &sfx109, MUSIC_PLAYER_1E, MUSIC_PLAYER_1E }, [SFX_10A] = { &sfx10A, MUSIC_PLAYER_08, MUSIC_PLAYER_08 }, [SFX_10B] = { &sfx10B, MUSIC_PLAYER_07, MUSIC_PLAYER_07 }, [SFX_BUTTON_PRESS] = { &sfxButtonPress, MUSIC_PLAYER_06, MUSIC_PLAYER_06 }, diff --git a/src/staffroll.c b/src/staffroll.c index 2a9077b4..d2813369 100644 --- a/src/staffroll.c +++ b/src/staffroll.c @@ -56,12 +56,12 @@ extern void (*const gUnk_08127D10[])(void); void sub_080A3954(void); void StaffrollTask(void) { - gRoomTransition.frameCount += 1; + gRoomTransition.frameCount++; gUnk_08127D00[gMain.state](); } void StaffrollTask_State0(void) { - gSave.unk6 = 1; + gSave.saw_staffroll = TRUE; SetGlobalFlag(GAMECLEAR); gMain.state = 1; gStaffrollMenu.base.menuType = 0;