Merge pull request #477 from notyourav/mas

Name rest of entity fields
This commit is contained in:
notyourav
2022-03-28 20:15:08 -07:00
committed by GitHub
386 changed files with 3976 additions and 3987 deletions
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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
+10 -10
View File
@@ -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
@@ -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
@@ -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
@@ -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
+1 -1
View File
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
+1 -1
View File
@@ -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
+19 -19
View File
@@ -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;
+1 -1
View File
@@ -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"
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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"
+1 -1
View File
@@ -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"
+1 -1
View File
@@ -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];
+1 -1
View File
@@ -297,7 +297,7 @@ typedef enum {
SFX_106,
SFX_107,
SFX_108,
SFX_109,
SFX_ITEM_GET,
SFX_10A,
SFX_10B,
SFX_BUTTON_PRESS,
+2 -2
View File
@@ -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);
+14 -14
View File
@@ -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) {
+1 -1
View File
@@ -6,7 +6,7 @@
#include "global.h"
#include "fileselect.h"
#include "main.h"
#include "coord.h"
#include "physics.h"
extern Palette gUnk_02001A3C;
+2 -2
View File
@@ -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);
}
+26 -26
View File
@@ -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;
}
+10 -10
View File
@@ -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) {
+10 -10
View File
@@ -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);
}
+25 -25
View File
@@ -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;
+24 -24
View File
@@ -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);
}
+54 -54
View File
@@ -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);
+3 -3
View File
@@ -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) {
+30 -30
View File
@@ -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;
+44 -44
View File
@@ -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;
}
}
}
+27 -27
View File
@@ -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];
}
}
}
+4 -4
View File
@@ -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);
}
}
+31 -31
View File
@@ -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);
}
+18 -18
View File
@@ -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);
+22 -22
View File
@@ -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));
+13 -13
View File
@@ -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;
+16 -16
View File
@@ -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);
}
+8 -8
View File
@@ -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);
}
}
+9 -9
View File
@@ -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) {
+7 -7
View File
@@ -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;
}
}
+10 -10
View File
@@ -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);
}
+17 -17
View File
@@ -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;
+30 -30
View File
@@ -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();
+2 -2
View File
@@ -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();
}
+12 -12
View File
@@ -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];
+5 -5
View File
@@ -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) {
+6 -6
View File
@@ -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;
+11 -11
View File
@@ -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;
}
}
+12 -12
View File
@@ -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;
}
}
+15 -15
View File
@@ -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 {
+27 -27
View File
@@ -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;
}
}
+76 -76
View File
@@ -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) {
+7 -7
View File
@@ -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();
+7 -7
View File
@@ -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;
+2 -2
View File
@@ -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 =
+20 -20
View File
@@ -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);
+2 -2
View File
@@ -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);
+1 -1
View File
@@ -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();
}
+25 -25
View File
@@ -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) {
+18 -18
View File
@@ -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);
+6 -6
View File
@@ -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) {
+9 -9
View File
@@ -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 {
+5 -5
View File
@@ -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;
+7 -7
View File
@@ -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));
}
}
+23 -23
View File
@@ -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);
+17 -17
View File
@@ -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:
+85 -85
View File
@@ -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;
+25 -25
View File
@@ -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));
+4 -4
View File
@@ -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) {
+4 -4
View File
@@ -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 {
+6 -6
View File
@@ -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;
}
+8 -8
View File
@@ -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];
}
+22 -22
View File
@@ -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;
+41 -41
View File
@@ -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) {
+7 -7
View File
@@ -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) {
+15 -15
View File
@@ -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;
}
}
}
+8 -8
View File
@@ -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);
+43 -43
View File
@@ -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) {
+68 -68
View File
@@ -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);
+39 -39
View File
@@ -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 {
+8 -8
View File
@@ -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;
+15 -15
View File
@@ -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;
}
+13 -13
View File
@@ -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;
+7 -7
View File
@@ -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;
+14 -14
View File
@@ -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;
+17 -17
View File
@@ -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;
+5 -5
View File
@@ -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;
}
}
+12 -12
View File
@@ -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];
+9 -9
View File
@@ -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) {
+8 -8
View File
@@ -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;
+26 -26
View File
@@ -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;
+22 -22
View File
@@ -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);
}
+21 -21
View File
@@ -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);
+11 -11
View File
@@ -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;
}

Some files were not shown because too many files have changed in this diff Show More