mirror of
https://github.com/zeldaret/tmc
synced 2026-07-28 15:18:23 -04:00
Merge branch 'master' into asset-extraction
This commit is contained in:
-536
@@ -1,536 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "audio.h"
|
||||
#include "main.h"
|
||||
#include "player.h"
|
||||
#include "structures.h"
|
||||
#include "save.h"
|
||||
#include "textbox.h"
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "manager.h"
|
||||
#include "utils.h"
|
||||
#include "npc.h"
|
||||
#include "effects.h"
|
||||
|
||||
extern u8 gUnk_03003DE0;
|
||||
extern u8 gUnk_03000C30;
|
||||
|
||||
extern u16* gUnk_02025EB0;
|
||||
extern u16* gUnk_0200B650;
|
||||
extern u8 gUnk_02000070;
|
||||
extern u8 gUnk_03003DF0[];
|
||||
extern u8 gUnk_03003BE0;
|
||||
extern Entity* gUnk_03004040[3];
|
||||
extern u8 gUnk_020342F8;
|
||||
extern u8 gCollidableCount;
|
||||
extern void gDoCollision(void);
|
||||
|
||||
extern void sub_080ADD70();
|
||||
extern void sub_0801C25C();
|
||||
extern void UpdateDisplayControls();
|
||||
extern void LoadResources();
|
||||
extern void FadeMain();
|
||||
extern u32 sub_0805E3B0();
|
||||
extern void HandlePlayerLife();
|
||||
extern void DoPlayerAction();
|
||||
extern void sub_080171F0();
|
||||
extern void sub_08078FB0();
|
||||
extern void DrawEntity();
|
||||
extern void sub_0807A050();
|
||||
extern u32 sub_08079B24();
|
||||
extern void sub_08079708();
|
||||
extern void CreateSparkle();
|
||||
extern void sub_080028E0(Entity*);
|
||||
extern void sub_08078180(void);
|
||||
extern void sub_0807B0C8(void);
|
||||
extern void sub_0807A8D8(Entity*);
|
||||
extern void sub_08077FEC(u32);
|
||||
extern void ItemInit(Entity*);
|
||||
extern void ObjectInit(Entity*);
|
||||
extern u32 ReadBit(void*, u32);
|
||||
extern void NPCInit(Entity*);
|
||||
|
||||
typedef struct {
|
||||
u8 unk0;
|
||||
u8 unk1;
|
||||
u8 unk2;
|
||||
u8 unk3;
|
||||
u8 unk4;
|
||||
u8 unk5;
|
||||
u16 unk6;
|
||||
} ItemFrame;
|
||||
extern ItemFrame gPlayerItemDefinitions[];
|
||||
extern ItemFrame* gUnk_08126ED8[3];
|
||||
|
||||
typedef struct {
|
||||
u16 unk0;
|
||||
u16 unk1;
|
||||
u16 x;
|
||||
u16 y;
|
||||
} NPCStruct;
|
||||
extern NPCStruct gUnk_02031EC0[100];
|
||||
|
||||
typedef struct {
|
||||
void* last;
|
||||
void* first;
|
||||
void* node;
|
||||
u8 flags;
|
||||
} LinkedList2;
|
||||
|
||||
extern LinkedList2 gUnk_03003C70[16];
|
||||
extern LinkedList2* gUnk_02018EA0;
|
||||
|
||||
// Load any resources that were requested with LoadResourceAsync
|
||||
void LoadResources(void) {
|
||||
if (gUnk_03003DE0 != 0) {
|
||||
u8* buf = &gUnk_03000C30;
|
||||
s32 i = gUnk_03003DE0;
|
||||
gUnk_03003DE0 = 0;
|
||||
do {
|
||||
switch (*buf) {
|
||||
case 0:
|
||||
DmaCopy32(3, *(u32*)(buf + 4), *(u32*)(buf + 8), *(u16*)(buf + 2));
|
||||
break;
|
||||
case 1:
|
||||
LZ77UnCompVram(*(void**)(buf + 4), *(u8**)(buf + 8));
|
||||
break;
|
||||
case 2:
|
||||
DmaFill32(3, *(u32*)(buf + 4), *(u32*)(buf + 8), *(u16*)(buf + 2));
|
||||
break;
|
||||
}
|
||||
buf += 12;
|
||||
i--;
|
||||
} while (0 < i);
|
||||
}
|
||||
}
|
||||
|
||||
void PrepNextFrame(void) {
|
||||
gMain.interruptFlag = 0;
|
||||
VBlankIntrWait();
|
||||
do {
|
||||
// Our VBlankIntr will set this flag
|
||||
} while (gMain.interruptFlag == 0);
|
||||
|
||||
sub_080ADD70();
|
||||
sub_0801C25C();
|
||||
UpdateDisplayControls();
|
||||
LoadResources();
|
||||
|
||||
if (gUnk_02000070) {
|
||||
gUnk_02000070 = 0;
|
||||
if (gUnk_02025EB0 != NULL)
|
||||
// sizeof(BGBuffer) = 0x800, what are we omitting?
|
||||
DmaCopy32(3, &gBG1Buffer, VRAM + (*gUnk_02025EB0 & 0x1f00) * 8, 0x5C0);
|
||||
if (gUnk_0200B650 != NULL)
|
||||
DmaCopy32(3, &gBG2Buffer, VRAM + (*gUnk_0200B650 & 0x1f00) * 8, 0x5C0);
|
||||
}
|
||||
FadeMain();
|
||||
}
|
||||
|
||||
void PlayerUpdate(Entity* this) {
|
||||
if (gSave.stats.effect != 0)
|
||||
gPlayerState.flags |= 0x4000;
|
||||
else
|
||||
gPlayerState.flags &= ~0x4000;
|
||||
|
||||
if (sub_0805E3B0(this) == 0) {
|
||||
if ((gPlayerState.flags & 0x80000) != 0) {
|
||||
sub_08077B20();
|
||||
if ((gPlayerState.flags & 0x200000) != 0) {
|
||||
gPlayerState.playerAction = 0x18;
|
||||
gPlayerState.flags &= ~0x80000;
|
||||
gPlayerState.hurtBlinkSpeed = 0xf0;
|
||||
this->flags |= 0x80;
|
||||
} else {
|
||||
this->flags &= ~0x80;
|
||||
gPlayerState.field_0xa8 = 0xf;
|
||||
}
|
||||
}
|
||||
HandlePlayerLife(this);
|
||||
DoPlayerAction(this);
|
||||
if ((this->height.WORD == 0) && (this->action == 1 || this->action == 9))
|
||||
sub_08008790(this, 8);
|
||||
sub_080171F0();
|
||||
}
|
||||
sub_08078FB0(this);
|
||||
DrawEntity(this);
|
||||
sub_0807A050();
|
||||
}
|
||||
|
||||
// Responsible for some life things like low health beep and initiating the death sequence
|
||||
#ifdef EU
|
||||
ASM_FUNC("asm/non_matching/eu/HandlePlayerLife.inc", void HandlePlayerLife(Entity* this));
|
||||
#else
|
||||
void HandlePlayerLife(Entity* this) {
|
||||
u32 temp;
|
||||
|
||||
gUnk_0200AF00.filler25[10] = 0;
|
||||
gUnk_0200AF00.filler25[8] = 0;
|
||||
gUnk_0200AF00.filler25[9] = 0;
|
||||
|
||||
if ((gPlayerEntity.bitfield & 0x80) && (gPlayerEntity.iframes > 0))
|
||||
SoundReq(SFX_86);
|
||||
|
||||
gPlayerState.flags &= ~(0x2000000 | 0x200);
|
||||
if (gPlayerState.flags & 0x400)
|
||||
ResetPlayer();
|
||||
if ((gPlayerState.flags & 0x400000) && !gPlayerState.field_0xa0[0])
|
||||
sub_0807A108();
|
||||
if (sub_08079B24() == 0)
|
||||
sub_08079708(this);
|
||||
|
||||
gUnk_03003DF0[0] = 0;
|
||||
if (gPlayerState.field_0x27[0] != 0)
|
||||
gPlayerState.field_0x27[0]--;
|
||||
|
||||
gPlayerState.field_0xa9 = gPlayerState.field_0xa8;
|
||||
gPlayerState.field_0xa8 = 0;
|
||||
if (gPlayerState.field_0x40[0x4a] != 0) {
|
||||
gPlayerState.field_0x40[0x4a]--;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((gPlayerState.field_0x8b != 0) || (gMessage.doTextBox & 0x7f))
|
||||
return;
|
||||
|
||||
gRoomVars.unk2 = gMessage.doTextBox & 0x7f;
|
||||
temp = gSave.stats.maxHealth / 4;
|
||||
if (temp > 24)
|
||||
temp = 24;
|
||||
if (temp < 8)
|
||||
temp = 8;
|
||||
|
||||
if (gSave.stats.health <= temp) {
|
||||
gRoomVars.unk2 = 1;
|
||||
if ((gUnk_0200AF00.filler0[1] == 0) && gScreenTransition.frameCount % 90 == 0) {
|
||||
EnqueueSFX(SFX_LOW_HEALTH);
|
||||
}
|
||||
}
|
||||
|
||||
if (gSave.stats.charm == 0) {
|
||||
gSave.stats.charmTimer = 0;
|
||||
} else if ((gSave.stats.charmTimer == 0) || --gSave.stats.charmTimer == 0) {
|
||||
gSave.stats.charm = 0;
|
||||
SoundReq(SFX_ICE_BLOCK_MELT);
|
||||
}
|
||||
|
||||
if (gSave.stats.unkB == 0) {
|
||||
gSave.stats.unkTimer = 0;
|
||||
} else if ((gSave.stats.unkTimer == 0) || (--gSave.stats.unkTimer == 0)) {
|
||||
gSave.stats.unkB = 0;
|
||||
SoundReq(SFX_140);
|
||||
} else if ((gSave.stats.unkTimer & 0xf) == 0) {
|
||||
CreateSparkle(this);
|
||||
}
|
||||
|
||||
if (gSave.stats.effect == 0) {
|
||||
gSave.stats.effectTimer = 0;
|
||||
} else if ((gSave.stats.effectTimer == 0) || --gSave.stats.effectTimer == 0) {
|
||||
gSave.stats.effect = 0;
|
||||
} else if ((gSave.stats.effectTimer & 0x3f) == 0) {
|
||||
CreateFx(this, FX_AURA_BASE + gSave.stats.effect, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void sub_080171F0(void) {
|
||||
if (gPlayerState.field_0x1a[0] != 0)
|
||||
ResetPlayer();
|
||||
if (gPlayerState.field_0x14 != 0)
|
||||
gPlayerState.field_0x14--;
|
||||
if (gPlayerEntity.field_0x7a.HWORD != 0)
|
||||
gPlayerEntity.field_0x7a.HWORD--;
|
||||
|
||||
gPlayerEntity.bitfield &= ~0x80;
|
||||
if (gPlayerEntity.action != 0x14)
|
||||
gPlayerState.flags = (gPlayerState.flags & ~0x10000) | (0x10000 * (gPlayerState.flags & 2) / 2);
|
||||
|
||||
gPlayerState.flags &= ~2;
|
||||
sub_080028E0(&gPlayerEntity);
|
||||
|
||||
if (gPlayerState.flags & 0x400000)
|
||||
gUnk_0200AF00.filler25[10] = 1;
|
||||
|
||||
sub_08078180();
|
||||
gPlayerState.field_0x7 &= ~0x80;
|
||||
gPlayerState.field_0xa &= 0xf;
|
||||
gPlayerState.keepFacing &= ~0x80;
|
||||
gPlayerState.field_0x1a[0] = 0;
|
||||
gPlayerState.field_0x80 = 0;
|
||||
gPlayerState.field_0xaa = 0;
|
||||
MemClear(&gUnk_03003BE0, 0x8c);
|
||||
gPlayerEntity.spriteOffsetY = gPlayerState.field_0x3f;
|
||||
gPlayerState.field_0x3f = 0;
|
||||
sub_0807B0C8();
|
||||
|
||||
if (gPlayerState.flags & 0x400000)
|
||||
gUnk_03004040[0]->spriteOffsetY = gUnk_03004040[1]->spriteOffsetY = gUnk_03004040[2]->spriteOffsetY = 0;
|
||||
|
||||
if (gPlayerEntity.action == 0x1d)
|
||||
gPlayerState.flags |= 0x20000000;
|
||||
else
|
||||
gPlayerState.flags &= ~0x20000000;
|
||||
|
||||
sub_0807A8D8(&gPlayerEntity);
|
||||
if (gPlayerState.jumpStatus & 0xc0)
|
||||
gPlayerEntity.iframes = 0xfe;
|
||||
|
||||
if (gPlayerEntity.action != 0x17) {
|
||||
sub_08077FEC(gPlayerEntity.action);
|
||||
}
|
||||
}
|
||||
|
||||
void ItemUpdate(Entity* this) {
|
||||
if ((this->flags & 1) == 0 && this->action == 0 && this->subAction == 0)
|
||||
ItemInit(this);
|
||||
|
||||
if (!sub_0805E3B0(this)) {
|
||||
gPlayerItemFunctions[this->id](this);
|
||||
this->bitfield &= ~0x80;
|
||||
if (this->iframes != 0) {
|
||||
if (this->iframes > 0)
|
||||
this->iframes--;
|
||||
else
|
||||
this->iframes++;
|
||||
}
|
||||
}
|
||||
DrawEntity(this);
|
||||
}
|
||||
|
||||
// tiny regalloc
|
||||
NONMATCH("asm/non_matching/arm_proxy/ItemInit.inc", void ItemInit(Entity* this)) {
|
||||
ItemFrame* entry;
|
||||
|
||||
entry = &gPlayerItemDefinitions[this->id];
|
||||
if (entry->unk0 == 0xff) {
|
||||
u32 temp = entry->unk2;
|
||||
ItemFrame* temp2 = gUnk_08126ED8[entry->unk1];
|
||||
entry = &temp2[this->field_0x68.HALF.LO - temp];
|
||||
}
|
||||
|
||||
this->palette.raw = ((entry->unk0 & 0xf) << 4) | entry->unk0;
|
||||
this->field_0x44 = entry->unk1;
|
||||
this->field_0x40 = entry->unk3;
|
||||
this->damageType = entry->unk4;
|
||||
this->spriteIndex = entry->unk5;
|
||||
if (entry->unk6 == 0)
|
||||
this->spriteVramOffset = gPlayerEntity.spriteVramOffset;
|
||||
else
|
||||
this->spriteVramOffset = entry->unk6 & 0x3ff;
|
||||
|
||||
if (this->animationState == 0)
|
||||
this->animationState = gPlayerEntity.animationState & 6;
|
||||
|
||||
this->collisionLayer = gPlayerEntity.collisionLayer;
|
||||
this->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
|
||||
this->spritePriority.b0 = gPlayerEntity.spritePriority.b0;
|
||||
this->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
|
||||
this->currentHealth = 1;
|
||||
this->flags |= 1;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void ObjectUpdate(Entity* this) {
|
||||
int iVar1;
|
||||
|
||||
if (((this->flags & 1) == 0) && (this->action == 0))
|
||||
ObjectInit(this);
|
||||
if (this->iframes != 0)
|
||||
this->iframes++;
|
||||
if (!sub_0805E3B0(this)) {
|
||||
gObjectFunctions[this->id](this);
|
||||
this->bitfield &= ~0x80;
|
||||
}
|
||||
DrawEntity(this);
|
||||
}
|
||||
|
||||
void ManagerUpdate(Entity* this) {
|
||||
if (!sub_0805E3B0(this))
|
||||
gManagerFunctions[this->id](this);
|
||||
}
|
||||
|
||||
// regalloc
|
||||
NONMATCH("asm/non_matching/arm_proxy/NPCUpdate.inc", void NPCUpdate(Entity* this)) {
|
||||
if ((this->currentHealth & 0x7f) && !ReadBit(&gUnk_020342F8, this->currentHealth - 1))
|
||||
DeleteThisEntity();
|
||||
if ((this->action == 0) && ((this->flags & 1) == 0))
|
||||
NPCInit(this);
|
||||
if (!sub_0805E3B0(this))
|
||||
gNPCFunctions[this->id][0](this);
|
||||
if (this->next != NULL) {
|
||||
if (gNPCFunctions[this->id][1] != NULL)
|
||||
gNPCFunctions[this->id][1](this);
|
||||
if ((this->currentHealth & 0x7f) != 0) {
|
||||
u32 temp = this->currentHealth & 0x7f;
|
||||
gUnk_02031EC0[temp * 2 - 2].x = this->x.HALF.HI - gRoomControls.roomOriginX;
|
||||
gUnk_02031EC0[temp * 2 - 2].y = this->y.HALF.HI - gRoomControls.roomOriginY;
|
||||
}
|
||||
DrawEntity(this);
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void ClearHitboxList(void) {
|
||||
gCollidableCount = 0;
|
||||
}
|
||||
|
||||
void CollisionMain(void) {
|
||||
void (*doCollision)(void);
|
||||
u32 flags;
|
||||
u32 temp;
|
||||
|
||||
temp = gUnk_03003DC0.unk0;
|
||||
if (gUnk_03003DC0.unk0 <= gUnk_03003DC0.unk1)
|
||||
temp = gUnk_03003DC0.unk1;
|
||||
if (temp != 0)
|
||||
return;
|
||||
|
||||
doCollision = &gDoCollision;
|
||||
// Check to see if we should disable collision this frame
|
||||
if (gPlayerState.field_0x8b != 0) {
|
||||
u32 temp = gPlayerEntity.flags;
|
||||
gPlayerEntity.flags &= ~0x80;
|
||||
doCollision();
|
||||
gPlayerEntity.flags = temp; // reset collision to before
|
||||
} else {
|
||||
doCollision();
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterPlayerHitbox(void) {
|
||||
MemClear(&gUnk_03003C70, sizeof(gUnk_03003C70));
|
||||
gUnk_02018EA0 = (LinkedList2*)&gUnk_03003C70[0].last;
|
||||
gUnk_03003C70[0].last = &gUnk_03003C70[0].last;
|
||||
gUnk_03003C70[0].first = &gUnk_03003C70[0].last;
|
||||
gUnk_03003C70[0].node = &gPlayerEntity;
|
||||
}
|
||||
|
||||
// Loop declaration seems wrong
|
||||
NONMATCH("asm/non_matching/arm_proxy/sub_0801766C.inc", u32 sub_0801766C(Entity* this)) {
|
||||
u32 uVar1;
|
||||
LinkedList2* puVar3;
|
||||
LinkedList2* puVar2;
|
||||
LinkedList2* pLVar2;
|
||||
LinkedList2* i;
|
||||
u8* pbVar4;
|
||||
|
||||
if (this->spritePriority.b2 != 0) {
|
||||
return 1;
|
||||
} else {
|
||||
for (i = &gUnk_03003C70[0]; i < &gUnk_03003C70[16]; ++i) {
|
||||
if (i->node == NULL) {
|
||||
i->node = this;
|
||||
i->flags = 0;
|
||||
this->spritePriority.b2 = 1;
|
||||
pLVar2 = gUnk_02018EA0;
|
||||
if (gUnk_02018EA0->flags != 0) {
|
||||
do {
|
||||
pLVar2 = pLVar2->first;
|
||||
} while (pLVar2->flags != 0);
|
||||
i->first = pLVar2;
|
||||
puVar3 = pLVar2->last;
|
||||
i->last = puVar3;
|
||||
puVar3->first = i;
|
||||
pLVar2->last = i;
|
||||
} else {
|
||||
i->first = gUnk_02018EA0;
|
||||
puVar2 = gUnk_02018EA0->last;
|
||||
i->last = puVar2;
|
||||
puVar2->first = i;
|
||||
gUnk_02018EA0->last = i;
|
||||
gUnk_02018EA0 = i;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
// same loop issue
|
||||
NONMATCH("asm/non_matching/arm_proxy/sub_080176E4.inc", u32 sub_080176E4(Entity* this)) {
|
||||
u32 uVar1;
|
||||
LinkedList2* j;
|
||||
LinkedList2* i;
|
||||
u8* pbVar4;
|
||||
|
||||
if (this->spritePriority.b2 != 0) {
|
||||
return 1;
|
||||
} else {
|
||||
for (i = &gUnk_03003C70[0]; i < &gUnk_03003C70[16]; ++i) {
|
||||
if (i->node == NULL) {
|
||||
i->node = this;
|
||||
i->flags = 1;
|
||||
this->spritePriority.b2 = 1;
|
||||
i->first = gUnk_02018EA0;
|
||||
j = gUnk_02018EA0->last;
|
||||
i->last = j;
|
||||
j->first = i;
|
||||
gUnk_02018EA0->last = i;
|
||||
gUnk_02018EA0 = i;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
// you guessed it
|
||||
NONMATCH("asm/non_matching/arm_proxy/sub_08017744.inc", void sub_08017744(Entity* this)) {
|
||||
LinkedList2* i;
|
||||
for (i = &gUnk_03003C70[0]; i < &gUnk_03003C70[16]; ++i) {
|
||||
if (i->node == this) {
|
||||
if (this->spritePriority.b2 != 0) {
|
||||
this->spritePriority.b2 = 0;
|
||||
i->node = NULL;
|
||||
((LinkedList2*)i->last)->first = i->first;
|
||||
((LinkedList2*)i->first)->last = i->last;
|
||||
if (i != gUnk_02018EA0)
|
||||
return;
|
||||
gUnk_02018EA0 = i->first;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
// regalloc
|
||||
NONMATCH("asm/non_matching/arm_proxy/sub_080177A0.inc", bool32 sub_080177A0(Entity* this, Entity* that)) {
|
||||
u32 this_d;
|
||||
u32 depth;
|
||||
|
||||
if ((that->collisionLayer & this->collisionLayer) != 0) {
|
||||
Hitbox* bb_this = this->hitbox;
|
||||
Hitbox* bb_that = that->hitbox;
|
||||
u32 this_w = bb_this->width;
|
||||
u32 that_w = bb_that->width;
|
||||
if ((((this->x.HALF.HI - that->x.HALF.HI) + bb_this->offset_x) - bb_that->offset_x) + this_w + that_w <=
|
||||
(this_w + that_w) * 2) {
|
||||
u32 this_h = bb_this->height;
|
||||
u32 that_h = bb_that->height;
|
||||
if ((((this->y.HALF.HI - that->y.HALF.HI) + bb_this->offset_y) - bb_that->offset_y) + this_h + that_h <=
|
||||
(this_h + that_h) * 2) {
|
||||
if ((this->field_0x3c & 0x10) != 0)
|
||||
this_d = ((Hitbox3D*)bb_this)->depth;
|
||||
else
|
||||
this_d = 5;
|
||||
if ((that->field_0x3c & 0x10) != 0)
|
||||
depth = this_d + ((Hitbox3D*)bb_that)->depth;
|
||||
else
|
||||
depth = this_d + 5;
|
||||
if ((this->height.HALF.HI - that->height.HALF.HI) + depth <= depth * 2)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
bool32 sub_08017850(Entity* this) {
|
||||
if (sub_08079F8C())
|
||||
return sub_080177A0(this, &gPlayerEntity);
|
||||
return FALSE;
|
||||
}
|
||||
+1
-1
@@ -45,7 +45,7 @@ void sub_0804AAD4(void) {
|
||||
}
|
||||
|
||||
void sub_0804AB04(void) {
|
||||
sub_0805E5C0();
|
||||
UpdateEntities();
|
||||
if (gArea.field_0x10 != 0) {
|
||||
FlushSprites();
|
||||
sub_080AD9B0();
|
||||
|
||||
+2
-2
@@ -251,11 +251,11 @@ u32 CreateItemDrop(Entity* arg0, u32 itemID, u32 itemParameter) {
|
||||
}
|
||||
if (arg0->kind == 6) {
|
||||
if (arg0->id == 99) {
|
||||
arg0->attachedEntity = itemEntity;
|
||||
arg0->child = itemEntity;
|
||||
} else if (arg0->id == 0x1e) {
|
||||
itemEntity->direction = arg0->animationState << 3 | 0x80;
|
||||
itemEntity->speed = 0xc0;
|
||||
itementity->hVelocity = 0x18000;
|
||||
itementity->zVelocity = 0x18000;
|
||||
}
|
||||
}
|
||||
CopyPosition(arg0, itemEntity);
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ void sub_08077E54(ItemBehavior* beh) {
|
||||
ent->action = gPlayerEntity.animIndex;
|
||||
*(u8*)&ent->spriteIndex = gPlayerEntity.frameIndex;
|
||||
ent->subAction = gPlayerEntity.frameDuration;
|
||||
ent->actionDelay = gPlayerEntity.frames.all;
|
||||
ent->actionDelay = gPlayerEntity.frame;
|
||||
}
|
||||
|
||||
void sub_08077E78(ItemBehavior* arg0, u32 bits) {
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@ extern void sub_08080BC4(void);
|
||||
|
||||
extern u32 gUnk_0200B650;
|
||||
extern u32 gUnk_02025EB0;
|
||||
extern u8 gUnk_02000070;
|
||||
extern u8 gUpdateVisibleTiles;
|
||||
|
||||
void sub_080808D8(void) {
|
||||
gScreenTransition.transitionType = 0;
|
||||
@@ -89,7 +89,7 @@ void sub_08080974(u32 arg0, u32 arg1) {
|
||||
}
|
||||
|
||||
sub_080809D4();
|
||||
gUnk_02000070 = 1;
|
||||
gUpdateVisibleTiles = 1;
|
||||
}
|
||||
|
||||
void sub_080809D4(void) {
|
||||
@@ -128,5 +128,5 @@ void sub_080809D4(void) {
|
||||
}
|
||||
|
||||
sub_08080BC4();
|
||||
gUnk_02000070 = 1;
|
||||
gUpdateVisibleTiles = 1;
|
||||
}
|
||||
|
||||
+759
@@ -0,0 +1,759 @@
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "player.h"
|
||||
#include "save.h"
|
||||
#include "random.h"
|
||||
#include "utils.h"
|
||||
#include "functions.h"
|
||||
#include "enemy.h"
|
||||
#include "effects.h"
|
||||
|
||||
extern u8 gCollidableCount;
|
||||
extern u8 gUnk_080B3740[];
|
||||
|
||||
typedef struct {
|
||||
u8 _0;
|
||||
u8 _1;
|
||||
u8 _2;
|
||||
u8 _3;
|
||||
u8 _4;
|
||||
u8 _5;
|
||||
s8 _6;
|
||||
u8 _7;
|
||||
u8 _8;
|
||||
u8 _9;
|
||||
u8 _a;
|
||||
u8 _b;
|
||||
} ColSettings;
|
||||
|
||||
extern ColSettings gCollisionMtx[173 * 34];
|
||||
|
||||
extern void gDoCollision(void);
|
||||
u32 sub_08081420(Entity*);
|
||||
extern void sub_0800449C(Entity*, u32);
|
||||
s32 sub_08018308(Entity*, Entity*, u32, ColSettings*);
|
||||
void sub_08079D84(void);
|
||||
void sub_080180BC(Entity*, Entity*);
|
||||
void sub_0807AFE8(void);
|
||||
|
||||
typedef struct {
|
||||
void* last;
|
||||
void* first;
|
||||
void* node;
|
||||
u8 flags;
|
||||
} LinkedList2;
|
||||
|
||||
extern LinkedList2 gUnk_03003C70[16];
|
||||
extern LinkedList2* gUnk_02018EA0;
|
||||
|
||||
void ClearHitboxList(void) {
|
||||
gCollidableCount = 0;
|
||||
}
|
||||
|
||||
void CollisionMain(void) {
|
||||
void (*doCollision)(void);
|
||||
u32 temp;
|
||||
|
||||
temp = gUnk_03003DC0.unk0;
|
||||
if (gUnk_03003DC0.unk0 <= gUnk_03003DC0.unk1)
|
||||
temp = gUnk_03003DC0.unk1;
|
||||
if (temp != 0)
|
||||
return;
|
||||
|
||||
doCollision = &gDoCollision;
|
||||
// Check to see if we should disable collision this frame
|
||||
if (gPlayerState.field_0x8b != 0) {
|
||||
u32 flags = gPlayerEntity.flags;
|
||||
COLLISION_OFF(&gPlayerEntity);
|
||||
doCollision();
|
||||
gPlayerEntity.flags = flags; // reset collision to before
|
||||
} else {
|
||||
doCollision();
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterPlayerHitbox(void) {
|
||||
MemClear(&gUnk_03003C70, sizeof(gUnk_03003C70));
|
||||
gUnk_02018EA0 = (LinkedList2*)&gUnk_03003C70[0].last;
|
||||
gUnk_03003C70[0].last = &gUnk_03003C70[0].last;
|
||||
gUnk_03003C70[0].first = &gUnk_03003C70[0].last;
|
||||
gUnk_03003C70[0].node = &gPlayerEntity;
|
||||
}
|
||||
|
||||
// Loop declaration seems wrong
|
||||
NONMATCH("asm/non_matching/arm_proxy/sub_0801766C.inc", u32 sub_0801766C(Entity* this)) {
|
||||
u32 uVar1;
|
||||
LinkedList2* puVar3;
|
||||
LinkedList2* puVar2;
|
||||
LinkedList2* pLVar2;
|
||||
LinkedList2* i;
|
||||
u8* pbVar4;
|
||||
|
||||
if (this->spritePriority.b2 != 0) {
|
||||
return 1;
|
||||
} else {
|
||||
for (i = &gUnk_03003C70[0]; i < &gUnk_03003C70[16]; ++i) {
|
||||
if (i->node == NULL) {
|
||||
i->node = this;
|
||||
i->flags = 0;
|
||||
this->spritePriority.b2 = 1;
|
||||
pLVar2 = gUnk_02018EA0;
|
||||
if (gUnk_02018EA0->flags != 0) {
|
||||
do {
|
||||
pLVar2 = pLVar2->first;
|
||||
} while (pLVar2->flags != 0);
|
||||
i->first = pLVar2;
|
||||
puVar3 = pLVar2->last;
|
||||
i->last = puVar3;
|
||||
puVar3->first = i;
|
||||
pLVar2->last = i;
|
||||
} else {
|
||||
i->first = gUnk_02018EA0;
|
||||
puVar2 = gUnk_02018EA0->last;
|
||||
i->last = puVar2;
|
||||
puVar2->first = i;
|
||||
gUnk_02018EA0->last = i;
|
||||
gUnk_02018EA0 = i;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
// same loop issue
|
||||
NONMATCH("asm/non_matching/arm_proxy/sub_080176E4.inc", u32 sub_080176E4(Entity* this)) {
|
||||
u32 uVar1;
|
||||
LinkedList2* j;
|
||||
LinkedList2* i;
|
||||
u8* pbVar4;
|
||||
|
||||
if (this->spritePriority.b2 != 0) {
|
||||
return 1;
|
||||
} else {
|
||||
for (i = &gUnk_03003C70[0]; i < &gUnk_03003C70[16]; ++i) {
|
||||
if (i->node == NULL) {
|
||||
i->node = this;
|
||||
i->flags = 1;
|
||||
this->spritePriority.b2 = 1;
|
||||
i->first = gUnk_02018EA0;
|
||||
j = gUnk_02018EA0->last;
|
||||
i->last = j;
|
||||
j->first = i;
|
||||
gUnk_02018EA0->last = i;
|
||||
gUnk_02018EA0 = i;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
// you guessed it
|
||||
NONMATCH("asm/non_matching/arm_proxy/sub_08017744.inc", void sub_08017744(Entity* this)) {
|
||||
LinkedList2* i;
|
||||
for (i = &gUnk_03003C70[0]; i < &gUnk_03003C70[16]; ++i) {
|
||||
if (i->node == this) {
|
||||
if (this->spritePriority.b2 != 0) {
|
||||
this->spritePriority.b2 = 0;
|
||||
i->node = NULL;
|
||||
((LinkedList2*)i->last)->first = i->first;
|
||||
((LinkedList2*)i->first)->last = i->last;
|
||||
if (i != gUnk_02018EA0)
|
||||
return;
|
||||
gUnk_02018EA0 = i->first;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
// regalloc
|
||||
NONMATCH("asm/non_matching/arm_proxy/sub_080177A0.inc", bool32 sub_080177A0(Entity* this, Entity* that)) {
|
||||
u32 this_d;
|
||||
u32 depth;
|
||||
|
||||
if ((that->collisionLayer & this->collisionLayer) != 0) {
|
||||
Hitbox* bb_this = this->hitbox;
|
||||
Hitbox* bb_that = that->hitbox;
|
||||
u32 this_w = bb_this->width;
|
||||
u32 that_w = bb_that->width;
|
||||
if ((((this->x.HALF.HI - that->x.HALF.HI) + bb_this->offset_x) - bb_that->offset_x) + this_w + that_w <=
|
||||
(this_w + that_w) * 2) {
|
||||
u32 this_h = bb_this->height;
|
||||
u32 that_h = bb_that->height;
|
||||
if ((((this->y.HALF.HI - that->y.HALF.HI) + bb_this->offset_y) - bb_that->offset_y) + this_h + that_h <=
|
||||
(this_h + that_h) * 2) {
|
||||
if ((this->field_0x3c & 0x10) != 0)
|
||||
this_d = ((Hitbox3D*)bb_this)->depth;
|
||||
else
|
||||
this_d = 5;
|
||||
if ((that->field_0x3c & 0x10) != 0)
|
||||
depth = this_d + ((Hitbox3D*)bb_that)->depth;
|
||||
else
|
||||
depth = this_d + 5;
|
||||
if ((this->z.HALF.HI - that->z.HALF.HI) + depth <= depth * 2)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
bool32 sub_08017850(Entity* this) {
|
||||
if (sub_08079F8C())
|
||||
return sub_080177A0(this, &gPlayerEntity);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 sub_08017874(Entity* a, Entity* b) {
|
||||
s32 newDmg;
|
||||
s32 v5;
|
||||
s32 v6;
|
||||
|
||||
asm("" ::: "r1");
|
||||
if (a->kind == 1) {
|
||||
newDmg = b->damage;
|
||||
switch (gSave.stats.charm) {
|
||||
case 47:
|
||||
newDmg /= 4;
|
||||
break;
|
||||
case 48:
|
||||
newDmg /= 2;
|
||||
break;
|
||||
}
|
||||
if (newDmg <= 0)
|
||||
newDmg = 1;
|
||||
v5 = ModHealth(-newDmg);
|
||||
sub_0800449C(a, 122);
|
||||
} else {
|
||||
v6 = b->damage;
|
||||
if (b->kind == 8) {
|
||||
switch (gSave.stats.charm) {
|
||||
case 48:
|
||||
v6 = 3 * v6 / 2;
|
||||
break;
|
||||
case 49:
|
||||
v6 *= 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
v5 = a->health - v6;
|
||||
if (a->kind == 3) {
|
||||
if ((a->field_0x6c.HALF.HI & 1) != 0)
|
||||
sub_0800449C(a, 295);
|
||||
else
|
||||
sub_0800449C(a, 254);
|
||||
}
|
||||
}
|
||||
if (v5 <= 0) {
|
||||
COLLISION_OFF(a);
|
||||
return 0;
|
||||
}
|
||||
return v5;
|
||||
}
|
||||
|
||||
void sub_08017940(Entity* org, Entity* tgt) {
|
||||
Entity* e;
|
||||
u32 r1;
|
||||
|
||||
e = CreateFx(tgt, FX_REFECT3, 0);
|
||||
if (e != NULL) {
|
||||
e->spritePriority.b0 = 2;
|
||||
e->x.HALF.HI = (org->x.HALF.HI + org->hitbox->offset_x + tgt->x.HALF.HI + tgt->hitbox->offset_x) >> 1;
|
||||
e->y.HALF.HI = (org->y.HALF.HI + org->hitbox->offset_y + tgt->y.HALF.HI + tgt->hitbox->offset_y) >> 1;
|
||||
e->z.HALF.HI = (org->z.HALF.HI + tgt->z.HALF.HI) >> 1;
|
||||
e->collisionLayer = org->collisionLayer;
|
||||
UpdateSpriteForCollisionLayer(e);
|
||||
}
|
||||
|
||||
r1 = 0;
|
||||
|
||||
r1 = (u32)(org == &gPlayerEntity ? gPlayerEntity.knockbackDuration
|
||||
: (tgt == &gPlayerEntity ? tgt->knockbackDuration : 0)) >>
|
||||
3;
|
||||
|
||||
// Anything requiring the evaluation of r1 could be written here.
|
||||
// The compiler is not smart enough to know that r1 has no side effects,
|
||||
// so the above code will still generate.
|
||||
r1 = !r1 ? !!r1 : !!!r1;
|
||||
}
|
||||
|
||||
void sub_080179EC(Entity* a1, Entity* a2) {
|
||||
const u8* p = (const u8[]){ FX_27, FX_32, FX_33, FX_34 };
|
||||
u32 rand = Random();
|
||||
Entity* e = CreateFx(a2, p[rand & 3], 0);
|
||||
if (e != NULL) {
|
||||
PositionRelative(a2, e, a2->hitbox->offset_x << 16, a2->hitbox->offset_y << 16);
|
||||
e->spritePriority.b0 = 2;
|
||||
e->spriteOffsetX = (a1->x.HALF.HI + a1->hitbox->offset_x - (a2->x.HALF.HI + a2->hitbox->offset_x)) >> 1;
|
||||
e->spriteOffsetY = (a1->y.HALF.HI + a1->hitbox->offset_y - (a2->y.HALF.HI + a2->hitbox->offset_y)) >> 1;
|
||||
e->child = a2;
|
||||
}
|
||||
}
|
||||
|
||||
Entity* sub_08017A90(Entity* a1, Entity* parent) {
|
||||
Entity* e;
|
||||
|
||||
e = (Entity*)CreateObject(153, 0, 0);
|
||||
if (e != NULL) {
|
||||
e->animationState = (a1->direction >> 3) & 3;
|
||||
e->spriteOffsetX = a1->x.HALF.HI - parent->x.HALF.HI;
|
||||
e->spriteOffsetY = a1->y.HALF.HI - parent->y.HALF.HI;
|
||||
e->parent = parent;
|
||||
return e;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
typedef s32 (*CollisionHandler)(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_08018308(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 CollisionNoOp(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 CollisionGroundItem(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_08017B58(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_08017EB0(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_08017F3C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_08017F40(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_0801802C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_08017DD4(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_080180E8(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_08017BBC(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_08017C40(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_08017D6C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_08017D28(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_08018168(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_08018228(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_08018250(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_08018288(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_080182A8(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_08017B1C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_08017CBC(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
s32 sub_08017E88(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
|
||||
|
||||
const CollisionHandler gUnk_080B3744[] = {
|
||||
sub_08018308, CollisionNoOp, CollisionNoOp, CollisionGroundItem, sub_08017B58, sub_08017EB0,
|
||||
sub_08017F3C, sub_08017F40, sub_0801802C, sub_08017DD4, sub_080180E8, sub_08017BBC,
|
||||
sub_08017C40, sub_08017D6C, sub_08017D28, sub_08018168, sub_08018228, sub_08018250,
|
||||
sub_08018288, sub_080182A8, sub_08017B1C, sub_08017CBC, sub_08017E88,
|
||||
};
|
||||
|
||||
s32 CollisionNoOp(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// origin: player or sword
|
||||
// target: item
|
||||
s32 CollisionGroundItem(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
COLLISION_OFF(tgt);
|
||||
tgt->bitfield = org->hurtType | 0x80;
|
||||
if ((tgt->type == 0x5F || tgt->type == 0x60) && sub_08081420(tgt))
|
||||
tgt->health = 0;
|
||||
return 2;
|
||||
}
|
||||
|
||||
s32 sub_08017B1C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
if ((gPlayerState.field_0x1d[1] & 0x60) != 0) {
|
||||
COLLISION_OFF(tgt);
|
||||
} else {
|
||||
org->knockbackDuration = 0x10;
|
||||
org->iframes = -20;
|
||||
org->field_0x46 = 640;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
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.field_0x1d[0];
|
||||
if (x << 24 <= 0) {
|
||||
tgt->field_0x1d = 0;
|
||||
tgt->subAction = 2;
|
||||
tgt->field_0x46 = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
tgt->subAction = 0;
|
||||
tgt->field_0x3a |= 4u;
|
||||
}
|
||||
if (tgt->iframes == 0)
|
||||
tgt->iframes = -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08017BBC(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
if ((gPlayerState.flags & (0x1 | 0x80 | 0x400 | 0x1000)) == 0) {
|
||||
Entity* e = CreateObject(66, 1, 0);
|
||||
if (e != NULL) {
|
||||
e->child = org;
|
||||
gPlayerState.flags |= 0x400;
|
||||
org->animationState = (direction ^ 0x10) >> 2;
|
||||
}
|
||||
}
|
||||
tgt->damage = 4;
|
||||
org->health = sub_08017874(org, tgt);
|
||||
org->knockbackDuration = 12;
|
||||
org->iframes = 30;
|
||||
org->field_0x46 = 384;
|
||||
if (tgt->iframes == 0)
|
||||
tgt->iframes = -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08017C40(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
if ((gPlayerState.flags & (0x1 | 0x80 | 0x800 | 0x1000)) == 0 && gPlayerState.playerAction == 0) {
|
||||
if (org->action == 1 || org->action == 24) {
|
||||
tgt->damage = 4;
|
||||
org->health = sub_08017874(org, tgt);
|
||||
gPlayerState.flags = 0x800;
|
||||
gPlayerState.playerAction = 13;
|
||||
}
|
||||
}
|
||||
org->knockbackDuration = 12;
|
||||
org->iframes = 16;
|
||||
org->field_0x46 = 640;
|
||||
if (tgt->iframes == 0)
|
||||
tgt->iframes = -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/collision/sub_08017CBC.inc",
|
||||
s32 sub_08017CBC(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)) {
|
||||
if (((-(((direction ^ 0x10) - 0xc) & 0x1f) + tgt->direction) & 0x1f) < 0x19) {
|
||||
org->iframes = -12;
|
||||
tgt->iframes = -12;
|
||||
sub_08017940(org, tgt);
|
||||
} else {
|
||||
tgt->knockbackDuration = 12;
|
||||
tgt->iframes = 16;
|
||||
tgt->field_0x43 = -16;
|
||||
tgt->field_0x46 = 768;
|
||||
if (org->iframes == 0)
|
||||
org->iframes = -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
s32 sub_08017D28(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
gPlayerState.field_0x1a[0] = 1;
|
||||
org->field_0x7a.HWORD = 600;
|
||||
org->knockbackDuration = 12;
|
||||
org->iframes = 16;
|
||||
org->field_0x46 = 640;
|
||||
if (tgt->iframes == 0)
|
||||
tgt->iframes = -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08017D6C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
u32 x;
|
||||
u32 y;
|
||||
ColSettings* p;
|
||||
|
||||
if (((-(((direction ^ 0x10) - 5) & 0x1f) + (tgt->animationState << 3)) & 0x1f) >= 0xb) {
|
||||
x = org->hurtType;
|
||||
y = 0xac2;
|
||||
} else {
|
||||
tgt->bitfield = 0xcb;
|
||||
tgt->field_0x78.HALF.HI = org->hurtType;
|
||||
x = org->hurtType;
|
||||
y = 0xae4;
|
||||
}
|
||||
p = &gCollisionMtx[x + y];
|
||||
return sub_08018308(org, tgt, direction, p);
|
||||
}
|
||||
|
||||
int sub_08017DD4(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
org->bitfield = 0;
|
||||
if (tgt->damage & 0x80)
|
||||
tgt->damage &= ~0x80;
|
||||
else
|
||||
tgt->damage = 4;
|
||||
gPlayerEntity.health = sub_08017874(&gPlayerEntity, tgt);
|
||||
tgt->iframes = -12;
|
||||
if ((gPlayerState.flags & 0x80) == 0) {
|
||||
sub_08079D84();
|
||||
org->iframes = 90;
|
||||
} else {
|
||||
gPlayerEntity.bitfield = tgt->hurtType | 0x80;
|
||||
gPlayerEntity.iframes = 12;
|
||||
gPlayerEntity.knockbackDuration = 16;
|
||||
gPlayerEntity.knockbackDirection = DirectionTurnAround(direction);
|
||||
gPlayerEntity.field_0x46 = 640;
|
||||
}
|
||||
if (tgt->iframes == 0)
|
||||
tgt->iframes = -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08017E88(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
org->knockbackDuration = 2;
|
||||
org->field_0x46 = 640;
|
||||
if (tgt->iframes == 0)
|
||||
tgt->iframes = -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08017EB0(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
if (tgt->damage == 0)
|
||||
return 0;
|
||||
if (org == &gPlayerEntity) {
|
||||
u32 temp = tgt->damage;
|
||||
tgt->damage = 8;
|
||||
gPlayerEntity.health = sub_08017874(&gPlayerEntity, tgt);
|
||||
tgt->damage = temp;
|
||||
gPlayerEntity.knockbackDuration = 12;
|
||||
gPlayerEntity.iframes = 16;
|
||||
gPlayerEntity.field_0x46 = 384;
|
||||
} else if (org->kind == 8 && org->id == 5) {
|
||||
org->knockbackDuration = 8;
|
||||
org->iframes = -6;
|
||||
org->field_0x46 = 384;
|
||||
gPlayerEntity.iframes = 0x80;
|
||||
}
|
||||
if (tgt->iframes == 0)
|
||||
tgt->iframes = -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08017F3C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08017F40(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
if (tgt->field_0x43 == 0) {
|
||||
if (org == &gPlayerEntity) {
|
||||
if (sub_08079F8C() &&
|
||||
#ifdef EU
|
||||
(gPlayerState.flags & 0x81) == 0 &&
|
||||
#else
|
||||
(gPlayerState.flags & 0x80) == 0 &&
|
||||
#endif
|
||||
!gPlayerState.swimState) {
|
||||
gPlayerState.field_0x1a[0] |= 0x80u;
|
||||
gPlayerState.field_0xa |= 0x80u;
|
||||
gPlayerState.flags |= 0x10u;
|
||||
gPlayerState.jumpStatus = 0;
|
||||
if (tgt->kind == ENEMY && (tgt->id == GHINI || tgt->id == ENEMY_50)) {
|
||||
org->z.HALF.HI = 0;
|
||||
PositionRelative(org, tgt, 0, 0x10000);
|
||||
} else {
|
||||
PositionRelative(tgt, org, 0, 0x10000);
|
||||
}
|
||||
COLLISION_OFF(org);
|
||||
org->spriteRendering.b3 = tgt->spriteRendering.b3;
|
||||
org->spriteOrientation.flipY = tgt->spriteOrientation.flipY;
|
||||
org->iframes = -1;
|
||||
tgt->iframes = -8;
|
||||
ResetPlayer();
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
org->health = 0;
|
||||
}
|
||||
} else if (tgt->kind == 3 && org == &gPlayerEntity) {
|
||||
sub_08004484(tgt, org);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// inverted branch
|
||||
NONMATCH("asm/non_matching/collision/sub_0801802C.inc",
|
||||
s32 sub_0801802C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)) {
|
||||
int kind;
|
||||
ColSettings* p;
|
||||
u32 x;
|
||||
|
||||
kind = org->kind;
|
||||
if (kind == 1) {
|
||||
if (sub_08079F8C() && (((direction ^ 0x10) - 4 * tgt->animationState + 5) & 0x1Fu) <= 0xA)
|
||||
goto _0801807A;
|
||||
} else if (kind == 8) {
|
||||
if ((((org->direction ^ 0x10) - 4 * tgt->animationState + 5) & 0x1Fu) <= 0xA) {
|
||||
org->health = 0;
|
||||
_0801807A:
|
||||
sub_080180BC(org, tgt);
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
org->health = 0;
|
||||
return 0;
|
||||
}
|
||||
x = 0x11aa;
|
||||
return sub_08018308(org, tgt, direction, &gCollisionMtx[x + org->hurtType]);
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_080180BC(Entity* org, Entity* tgt) {
|
||||
if (org->iframes == 0)
|
||||
org->iframes = -30;
|
||||
if (tgt->iframes == 0)
|
||||
tgt->iframes = -1;
|
||||
tgt->subAction = -1;
|
||||
}
|
||||
|
||||
s32 sub_080180E8(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
u32 v3;
|
||||
u32 x;
|
||||
|
||||
v3 = DirectionNormalize(DirectionTurnAround(direction) - 0xc);
|
||||
if (DirectionNormalize(tgt->direction - v3) <= 0x18) {
|
||||
org->knockbackDuration = 12;
|
||||
org->iframes = -16;
|
||||
org->field_0x46 = 640;
|
||||
tgt->knockbackDuration = 12;
|
||||
tgt->iframes = -16;
|
||||
tgt->field_0x46 = 768;
|
||||
sub_08017940(org, tgt);
|
||||
return 1;
|
||||
}
|
||||
x = 0x352;
|
||||
return sub_08018308(org, tgt, v3, &gCollisionMtx[org->hurtType + x]);
|
||||
}
|
||||
|
||||
s32 sub_08018168(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
if (tgt->field_0x43 == 0) {
|
||||
if (org == &gPlayerEntity) {
|
||||
if (((sub_08079F8C() != 0) &&
|
||||
#ifdef EU
|
||||
((gPlayerState.flags & 0x81) == 0)) &&
|
||||
#else
|
||||
((gPlayerState.flags & 0x40080) == 0)) &&
|
||||
#endif
|
||||
(gPlayerState.swimState == 0)) {
|
||||
gPlayerState.field_0x1a[0] |= 0x80;
|
||||
gPlayerState.field_0xa |= 0x80;
|
||||
gPlayerState.flags |= 0x100;
|
||||
gPlayerState.jumpStatus = 0;
|
||||
gPlayerEntity.flags &= ~0x80;
|
||||
gPlayerEntity.spriteRendering.b3 = tgt->spriteRendering.b3;
|
||||
gPlayerEntity.spriteOrientation.flipY = tgt->spriteOrientation.flipY;
|
||||
gPlayerEntity.iframes = 0xff;
|
||||
tgt->iframes = -8;
|
||||
sub_08077B20();
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
org->health = 0;
|
||||
}
|
||||
} else if ((tgt->kind == 3) && (org == &gPlayerEntity)) {
|
||||
sub_08004484(tgt, &gPlayerEntity);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 sub_08018228(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
if (org == &gPlayerEntity && sub_08079F8C())
|
||||
sub_08004484(tgt, org);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 sub_08018250(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
org->iframes = -1;
|
||||
if (org->direction == 0) {
|
||||
tgt->iframes = 16;
|
||||
sub_08017A90(org, tgt);
|
||||
} else {
|
||||
tgt->iframes = -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08018288(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
if (org == &gPlayerEntity)
|
||||
sub_0807AFE8();
|
||||
else
|
||||
org->health = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_080182A8(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
if (tgt->field_0x43 == 0) {
|
||||
if (org->iframes == 0)
|
||||
org->iframes = -1;
|
||||
if (tgt->iframes == 0)
|
||||
tgt->iframes = -1;
|
||||
} else {
|
||||
u32 x = 0x92a;
|
||||
return sub_08018308(org, tgt, direction, &gCollisionMtx[org->hurtType + x]);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08018308(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
u32 temp = 0;
|
||||
if (tgt->field_0x43 && tgt->kind == 3 && org == &gPlayerEntity) {
|
||||
sub_08004484(tgt, org);
|
||||
temp = 1;
|
||||
}
|
||||
if ((org->kind == 8 && org->id == 0x5) && gPlayerEntity.animationState == ((((direction + 4) & 0x18) >> 2) ^ 4)) {
|
||||
return 0;
|
||||
}
|
||||
if (!temp) {
|
||||
u32 tmp2;
|
||||
org->field_0x46 = 16 * settings->_0;
|
||||
org->iframes = settings->_1;
|
||||
if (org->iframes == 0)
|
||||
org->iframes = -1;
|
||||
org->knockbackDuration = settings->_2;
|
||||
tgt->damage = settings->_3;
|
||||
tmp2 = 0xFF;
|
||||
if (settings->_3 != 0)
|
||||
org->health = sub_08017874(org, tgt);
|
||||
if (settings->_4 > org->field_0x43)
|
||||
org->field_0x43 = settings->_4;
|
||||
tgt->field_0x46 = 16 * settings->_5;
|
||||
tgt->iframes = settings->_6;
|
||||
if (settings->_6 == 0)
|
||||
tgt->iframes = -1;
|
||||
tgt->knockbackDuration = settings->_7;
|
||||
tmp2 &= org->damage = settings->_8;
|
||||
if (tmp2 != 0)
|
||||
tgt->health = sub_08017874(tgt, org);
|
||||
if (settings->_9 > tgt->field_0x43)
|
||||
tgt->field_0x43 = settings->_9;
|
||||
}
|
||||
if (settings->_a & 1)
|
||||
sub_08017940(org, tgt);
|
||||
if (settings->_a & 2)
|
||||
org->bitfield = 0xca;
|
||||
if (settings->_a & 4) {
|
||||
Entity* parent = tgt->parent;
|
||||
if (parent != NULL) {
|
||||
parent->bitfield = 0xcc;
|
||||
parent->iframes = tgt->iframes;
|
||||
parent->knockbackDirection = direction;
|
||||
parent->knockbackDuration = tgt->knockbackDuration;
|
||||
if (parent->field_0x43 == 0)
|
||||
parent->field_0x43 = tgt->field_0x43;
|
||||
parent->field_0x46 = tgt->field_0x46;
|
||||
parent->field_0x4c = org;
|
||||
}
|
||||
}
|
||||
if (org->kind == 8) {
|
||||
if (org->id == 1) {
|
||||
if (settings->_8) {
|
||||
sub_080179EC(org, tgt);
|
||||
}
|
||||
} else if (org->id == 4) {
|
||||
if (org->damage || (settings->_a & 8)) {
|
||||
sub_08017A90(org, tgt);
|
||||
}
|
||||
} else if (org->id == 3) {
|
||||
if (settings->_9) {
|
||||
sub_0800449C(tgt, 254);
|
||||
}
|
||||
} else if (org->id == 5) {
|
||||
gPlayerEntity.iframes = 0x80;
|
||||
}
|
||||
}
|
||||
if (tgt->kind == 8 && org->id == 5) {
|
||||
gPlayerEntity.iframes = 0x80;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
+1
-1
@@ -39,7 +39,7 @@ void PositionRelative(Entity* source, Entity* target, s32 offsetX, s32 offsetY)
|
||||
y = source->y.WORD;
|
||||
target->y.WORD = y + offsetY;
|
||||
|
||||
target->height = source->height; // ldr
|
||||
target->z = source->z; // ldr
|
||||
target->collisionLayer = source->collisionLayer;
|
||||
UpdateSpriteForCollisionLayer(target);
|
||||
}
|
||||
|
||||
+11
-11
@@ -18,12 +18,12 @@ void sub_0805FA04(void) {
|
||||
MemClear(&gBG0Buffer, sizeof(gBG0Buffer));
|
||||
MemClear(&gBG3Buffer, sizeof(gBG3Buffer));
|
||||
gScreen.lcd.displayControl = 0x940;
|
||||
gScreen.bg.bg0xOffset = 0;
|
||||
gScreen.bg.bg0yOffset = 0;
|
||||
gScreen.affine.bg3xOffset = 0;
|
||||
gScreen.affine.bg3yOffset = 0;
|
||||
gScreen.affine.bg3Control = 0x1e0f;
|
||||
gScreen.affine.bg3Updated = 1;
|
||||
gScreen.bg0.xOffset = 0;
|
||||
gScreen.bg0.yOffset = 0;
|
||||
gScreen.bg3.xOffset = 0;
|
||||
gScreen.bg3.yOffset = 0;
|
||||
gScreen.bg3.control = 0x1e0f;
|
||||
gScreen.bg3.updated = 1;
|
||||
MessageInitialize();
|
||||
MemClear((void*)&gUnk_02032EC0, sizeof(UI));
|
||||
MemClear((void*)&gMenu, sizeof(Menu));
|
||||
@@ -48,11 +48,11 @@ void sub_0805FA98(void) {
|
||||
case 0x200:
|
||||
gMenu.focusCoords[0] ^= 1;
|
||||
if (gMenu.focusCoords[0] == 0) {
|
||||
gScreen.bg.bg0Control = 0x1f0c;
|
||||
gScreen.affine.bg3Control = 0x1e0f;
|
||||
gScreen.bg0.control = 0x1f0c;
|
||||
gScreen.bg3.control = 0x1e0f;
|
||||
} else {
|
||||
gScreen.bg.bg0Control = 0x1f0f;
|
||||
gScreen.affine.bg3Control = 0x1e0c;
|
||||
gScreen.bg0.control = 0x1f0f;
|
||||
gScreen.bg3.control = 0x1e0c;
|
||||
}
|
||||
break;
|
||||
case 0x100:
|
||||
@@ -87,7 +87,7 @@ void sub_0805FA98(void) {
|
||||
}
|
||||
}
|
||||
gMenu.focusCoords[1] = (gMenu.focusCoords[1] + 3) % 3;
|
||||
gScreen.affine.bg3Updated = 1;
|
||||
gScreen.bg3.updated = 1;
|
||||
}
|
||||
|
||||
void sub_0805FBC4() {
|
||||
|
||||
+6
-6
@@ -49,12 +49,12 @@ void sub_080A2E40(void) {
|
||||
MemCopy(&gUnk_08A05751, &gBG1Buffer, 0x800);
|
||||
MemCopy(&gUnk_08A05751[0x800], &gBG2Buffer, 0x800);
|
||||
gScreen.lcd.displayControl = 0x1f00;
|
||||
gScreen.bg.bg1Control = 0x1c81;
|
||||
gScreen.affine.bg2Control = 0x1d82;
|
||||
gScreen.affine.bg3Control = 0x1e0b;
|
||||
gScreen.bg.bg1Updated = 1;
|
||||
gScreen.affine.bg2Updated = 1;
|
||||
gScreen.affine.bg3Updated = 1;
|
||||
gScreen.bg1.control = 0x1c81;
|
||||
gScreen.bg2.control = 0x1d82;
|
||||
gScreen.bg3.control = 0x1e0b;
|
||||
gScreen.bg1.updated = 1;
|
||||
gScreen.bg2.updated = 1;
|
||||
gScreen.bg3.updated = 1;
|
||||
gScreen.controls.layerFXControl = 0x1044;
|
||||
gScreen.controls.alphaBlend = 0xb04;
|
||||
{
|
||||
|
||||
+74
-75
@@ -53,7 +53,7 @@ void sub_080318DC(Entity* this) {
|
||||
if (this->bitfield != 0x80 && this->bitfield != 0x81) {
|
||||
if (this->type == 1) {
|
||||
if (this->action < 7 && this->knockbackDuration != 0) {
|
||||
brother = this->attachedEntity;
|
||||
brother = this->child;
|
||||
if (brother) {
|
||||
brother->parent = this->parent;
|
||||
do {
|
||||
@@ -61,42 +61,42 @@ void sub_080318DC(Entity* this) {
|
||||
brother->spritePriority.b1 = 1;
|
||||
if (brother->iframes == 0)
|
||||
brother->iframes = -12;
|
||||
} while (brother = brother->attachedEntity, brother != NULL);
|
||||
} while (brother = brother->child, brother != NULL);
|
||||
}
|
||||
if (this->parent) {
|
||||
this->parent->attachedEntity = this->attachedEntity;
|
||||
this->parent->child = this->child;
|
||||
} else {
|
||||
if (this->attachedEntity)
|
||||
if (this->child)
|
||||
this->parent = this;
|
||||
}
|
||||
|
||||
this->action = 9;
|
||||
this->spritePriority.b1 = 1;
|
||||
if (this->knockbackDirection < 0x10) {
|
||||
this->spriteSettings.b.flipX = 0;
|
||||
this->spriteSettings.flipX = 0;
|
||||
} else {
|
||||
this->spriteSettings.b.flipX = 1;
|
||||
this->spriteSettings.flipX = 1;
|
||||
}
|
||||
InitializeAnimation(this, 14);
|
||||
}
|
||||
|
||||
if (this->currentHealth == 0) {
|
||||
if (this->health == 0) {
|
||||
this->knockbackDirection = ((this->knockbackDirection + (7 & Random())) - 4) & 0x1f;
|
||||
this->knockbackDuration += this->type2 * 3;
|
||||
sub_08032338(this);
|
||||
}
|
||||
}
|
||||
|
||||
if (this->knockbackDuration != 0 && this->frames.all & 0x10) {
|
||||
if (this->knockbackDuration != 0 && this->frame & 0x10) {
|
||||
if (this->type == 0) {
|
||||
this->action = 8;
|
||||
} else {
|
||||
this->action = 9;
|
||||
}
|
||||
if (this->knockbackDirection < 0x10) {
|
||||
this->spriteSettings.b.flipX = 0;
|
||||
this->spriteSettings.flipX = 0;
|
||||
} else {
|
||||
this->spriteSettings.b.flipX = 1;
|
||||
this->spriteSettings.flipX = 1;
|
||||
}
|
||||
this->spritePriority.b1 = 1;
|
||||
InitializeAnimation(this, 14);
|
||||
@@ -147,7 +147,7 @@ void sub_08031AC8(Entity* this)
|
||||
y = this->field_0x76.HWORD + ((s32)(rand >> 4) % 5) * 0x10 - 0x20;
|
||||
if (sub_080002D4(x, y, this->collisionLayer) == 0) {
|
||||
this->action = 2;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->x.HALF.HI = x;
|
||||
this->y.HALF.HI = y;
|
||||
InitializeAnimation(this, 0);
|
||||
@@ -158,11 +158,11 @@ void sub_08031AC8(Entity* this)
|
||||
|
||||
void sub_08031B48(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.b.f0) {
|
||||
this->frames.all = 0;
|
||||
this->flags |= 0x80;
|
||||
if (this->frame & 1) {
|
||||
this->frame = 0;
|
||||
COLLISION_ON(this);
|
||||
} else {
|
||||
if (this->frames.b.f3) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 0x3;
|
||||
this->actionDelay = gUnk_080CE5B0[Random() & 7];
|
||||
InitializeAnimation(this, 1);
|
||||
@@ -174,21 +174,20 @@ void sub_08031B98(Entity* this) {
|
||||
if (sub_08031E04(this)) {
|
||||
this->action = 5;
|
||||
if (this->x.HALF.HI > gUnk_020000B0->x.HALF.HI) {
|
||||
this->spriteSettings.b.flipX = 0;
|
||||
this->spriteSettings.flipX = 0;
|
||||
} else {
|
||||
this->spriteSettings.b.flipX = 1;
|
||||
this->spriteSettings.flipX = 1;
|
||||
}
|
||||
InitializeAnimation(this, 3);
|
||||
} else {
|
||||
if (this->frames.b.f0 && this->actionDelay) {
|
||||
// this->frames.b.f0 = 0;
|
||||
this->frames.all &= 0xfe;
|
||||
if ((this->frame & 1) && this->actionDelay) {
|
||||
this->frame &= 0xfe;
|
||||
this->actionDelay--;
|
||||
}
|
||||
GetNextFrame(this);
|
||||
if (this->actionDelay == 0) {
|
||||
this->action = 4;
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, 2);
|
||||
}
|
||||
}
|
||||
@@ -196,10 +195,10 @@ void sub_08031B98(Entity* this) {
|
||||
|
||||
void sub_08031C1C(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.b.f3) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = '\x01';
|
||||
this->actionDelay = gUnk_080CE5B8[Random() & 7];
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,7 +206,7 @@ void sub_08031C58(Entity* this) {
|
||||
Entity *a, *b;
|
||||
|
||||
GetNextFrame(this);
|
||||
if (this->frames.b.f3) {
|
||||
if (this->frame & 0x80) {
|
||||
if (gEntCount < 0x43) {
|
||||
u32 tmp = Random();
|
||||
tmp &= 3;
|
||||
@@ -217,33 +216,33 @@ void sub_08031C58(Entity* this) {
|
||||
a->parent = NULL;
|
||||
a->field_0x74.HALF.LO = tmp;
|
||||
sub_08031E48(this, a);
|
||||
a->attachedEntity = CreateEnemy(ACRO_BANDIT, 1);
|
||||
a->child = CreateEnemy(ACRO_BANDIT, 1);
|
||||
|
||||
b = a->attachedEntity;
|
||||
b = a->child;
|
||||
b->type2 = 1;
|
||||
b->parent = a;
|
||||
b->field_0x74.HALF.LO = tmp;
|
||||
sub_08031E48(this, b);
|
||||
b->attachedEntity = CreateEnemy(ACRO_BANDIT, 1);
|
||||
b->child = CreateEnemy(ACRO_BANDIT, 1);
|
||||
|
||||
a = b->attachedEntity;
|
||||
a = b->child;
|
||||
a->type2 = 2;
|
||||
a->parent = b;
|
||||
a->field_0x74.HALF.LO = tmp;
|
||||
sub_08031E48(this, a);
|
||||
a->attachedEntity = CreateEnemy(ACRO_BANDIT, 1);
|
||||
a->child = CreateEnemy(ACRO_BANDIT, 1);
|
||||
|
||||
b = a->attachedEntity;
|
||||
b = a->child;
|
||||
b->type2 = 3;
|
||||
b->parent = a;
|
||||
b->field_0x74.HALF.LO = tmp;
|
||||
sub_08031E48(this, b);
|
||||
b->attachedEntity = CreateEnemy(ACRO_BANDIT, 1);
|
||||
b->child = CreateEnemy(ACRO_BANDIT, 1);
|
||||
|
||||
a = b->attachedEntity;
|
||||
a = b->child;
|
||||
a->type2 = 4;
|
||||
a->parent = b;
|
||||
a->attachedEntity = NULL;
|
||||
a->child = NULL;
|
||||
a->field_0x74.HALF.LO = tmp;
|
||||
sub_08031E48(this, a);
|
||||
|
||||
@@ -253,9 +252,9 @@ void sub_08031C58(Entity* this) {
|
||||
InitializeAnimation(this, 7);
|
||||
}
|
||||
} else {
|
||||
if (this->frames.b.f0) {
|
||||
this->frames.all = 0;
|
||||
this->flags &= 0x7f;
|
||||
if (this->frame & 1) {
|
||||
this->frame = 0;
|
||||
COLLISION_OFF(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -264,9 +263,9 @@ void sub_08031D70(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (--this->actionDelay == '\0') {
|
||||
this->action = 7;
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->actionDelay = 5;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,14 +281,14 @@ void sub_08031DA0(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08031DC4(Entity* this) {
|
||||
if (this->frames.b.f3) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0xb4;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
} else {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0xf) == 2) {
|
||||
this->flags &= 0x7f;
|
||||
if ((this->frame & 0xf) == 2) {
|
||||
COLLISION_OFF(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -302,7 +301,7 @@ u32 sub_08031E04(Entity* this) {
|
||||
if (ent == NULL)
|
||||
return 0;
|
||||
|
||||
tmp = &gUnk_080CE5C0[this->frames.all & 6];
|
||||
tmp = &gUnk_080CE5C0[this->frame & 6];
|
||||
return sub_0806FCB8(this, ent->x.HALF.HI + tmp[0], ent->y.HALF.HI + tmp[1], 0x50);
|
||||
}
|
||||
|
||||
@@ -323,8 +322,8 @@ void sub_08031E90(Entity* this) {
|
||||
void sub_08031EA8(Entity* this) {
|
||||
this->action = 1;
|
||||
this->spritePriority.b1 = 1;
|
||||
this->hVelocity = 0x40000;
|
||||
this->height.HALF.HI = (4 - this->type2) * 0xe;
|
||||
this->zVelocity = 0x40000;
|
||||
this->z.HALF.HI = (4 - this->type2) * 0xe;
|
||||
this->field_0x78.HALF.HI = Random();
|
||||
InitializeAnimation(this, 4);
|
||||
}
|
||||
@@ -332,34 +331,34 @@ void sub_08031EA8(Entity* this) {
|
||||
void sub_08031EE8(Entity* this) {
|
||||
int draw;
|
||||
|
||||
this->height.WORD -= this->hVelocity;
|
||||
this->hVelocity -= 0x1800;
|
||||
this->z.WORD -= this->zVelocity;
|
||||
this->zVelocity -= 0x1800;
|
||||
|
||||
if (this->height.HALF.HI < 1) {
|
||||
draw = this->spriteSettings.b.draw;
|
||||
if (this->z.HALF.HI < 1) {
|
||||
draw = this->spriteSettings.draw;
|
||||
if (!draw)
|
||||
EnqueueSFX(299);
|
||||
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
}
|
||||
|
||||
draw = this->spriteSettings.b.draw;
|
||||
draw = this->spriteSettings.draw;
|
||||
if (draw == 1)
|
||||
GetNextFrame(this);
|
||||
|
||||
if (this->hVelocity < 1) {
|
||||
if (this->zVelocity < 1) {
|
||||
this->action = 2;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
InitializeAnimation(this, 5);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08031F54(Entity* this) {
|
||||
sub_08003FC4(this, gUnk_080CE5F0[this->type2]);
|
||||
if (this->type2 * -0xe <= this->height.HALF.HI) {
|
||||
if (this->type2 * -0xe <= this->z.HALF.HI) {
|
||||
this->action = 3;
|
||||
this->actionDelay = 20;
|
||||
this->height.HALF.HI = this->type2 * -0xe;
|
||||
this->z.HALF.HI = this->type2 * -0xe;
|
||||
if (this->parent != NULL)
|
||||
this->spritePriority.b1 = 0;
|
||||
InitializeAnimation(this, 6);
|
||||
@@ -368,11 +367,11 @@ void sub_08031F54(Entity* this) {
|
||||
|
||||
void sub_08031FB0(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.b.f3 && (this->parent || --this->actionDelay == 0)) {
|
||||
if ((this->frame & 0x80) && (this->parent || --this->actionDelay == 0)) {
|
||||
this->action = 4;
|
||||
this->direction = sub_08049F84(this, 1);
|
||||
*(u8*)&this->field_0x76 = 0;
|
||||
if (this->attachedEntity) {
|
||||
if (this->child) {
|
||||
InitializeAnimation(this, 9);
|
||||
} else {
|
||||
InitializeAnimation(this, 8);
|
||||
@@ -406,7 +405,7 @@ void sub_08032008(Entity* this) {
|
||||
}
|
||||
|
||||
if (this->direction & 0xf)
|
||||
this->spriteSettings.b.flipX = (this->direction >> 4 ^ 1);
|
||||
this->spriteSettings.flipX = (this->direction >> 4 ^ 1);
|
||||
|
||||
ProcessMovement(this);
|
||||
} else {
|
||||
@@ -445,19 +444,19 @@ void sub_08032160(Entity* this) {
|
||||
dir = gUnk_080CE5FA[this->field_0x74.HALF.LO * 5 + this->type2];
|
||||
this->direction = dir;
|
||||
if (dir >= 0x10) {
|
||||
this->spriteSettings.b.flipX = 1;
|
||||
this->spriteSettings.flipX = 1;
|
||||
} else {
|
||||
this->spriteSettings.b.flipX = 0;
|
||||
this->spriteSettings.flipX = 0;
|
||||
}
|
||||
this->speed = 0xf0;
|
||||
this->hVelocity = 0x12000;
|
||||
this->zVelocity = 0x12000;
|
||||
this->spritePriority.b1 = 1;
|
||||
InitializeAnimation(this, 12);
|
||||
}
|
||||
|
||||
if (this->attachedEntity == NULL) {
|
||||
if (this->child == NULL) {
|
||||
for (tmp = this->parent; tmp != NULL; tmp = tmp->parent) {
|
||||
if (tmp->currentHealth != 0)
|
||||
if (tmp->health != 0)
|
||||
tmp->actionDelay = 0;
|
||||
}
|
||||
this->actionDelay = 0;
|
||||
@@ -473,11 +472,11 @@ void sub_080321E8(Entity* this) {
|
||||
|
||||
void sub_08032204(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 1) {
|
||||
this->frames.all = 0;
|
||||
if (this->frame & 1) {
|
||||
this->frame = 0;
|
||||
this->frameDuration = (Random() & 0x30) + 30;
|
||||
} else {
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 9;
|
||||
InitializeAnimation(this, 13);
|
||||
}
|
||||
@@ -486,15 +485,15 @@ void sub_08032204(Entity* this) {
|
||||
|
||||
void sub_08032248(Entity* this) {
|
||||
if (sub_08003FC4(this, 0x1800) == 0) {
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
((Entity*)this->field_0x7c.WORD)->actionDelay--;
|
||||
|
||||
DeleteEntity(this);
|
||||
} else {
|
||||
GetNextFrame(this);
|
||||
|
||||
if ((this->frames.all & 0xf) == 2)
|
||||
this->flags &= 0x7f;
|
||||
if ((this->frame & 0xf) == 2)
|
||||
COLLISION_OFF(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -506,10 +505,10 @@ void sub_08032290(Entity* this) {
|
||||
}
|
||||
|
||||
u32 sub_080322A4(Entity* this) {
|
||||
if (this->attachedEntity != NULL && (this->attachedEntity->height.HALF.HI + 8) >= this->height.HALF.HI) {
|
||||
if (this->height.HALF.HI) {
|
||||
if (this->child != NULL && (this->child->z.HALF.HI + 8) >= this->z.HALF.HI) {
|
||||
if (this->z.HALF.HI) {
|
||||
this->action = 5;
|
||||
this->height.HALF.HI = this->attachedEntity->height.HALF.HI + 8;
|
||||
this->z.HALF.HI = this->child->z.HALF.HI + 8;
|
||||
InitializeAnimation(this, 11);
|
||||
return 1;
|
||||
} else {
|
||||
@@ -524,15 +523,15 @@ void sub_080322E8(Entity* this) {
|
||||
u8 tmp;
|
||||
if (this->field_0x78.HALF.LO) {
|
||||
if (--this->field_0x78.HALF.LO == 0) {
|
||||
u32 flipX = this->spriteSettings.b.flipX;
|
||||
this->spriteSettings.b.flipX = flipX ^ 1;
|
||||
u32 flipX = this->spriteSettings.flipX;
|
||||
this->spriteSettings.flipX = flipX ^ 1;
|
||||
}
|
||||
} else {
|
||||
tmp = this->direction;
|
||||
if (tmp & 0xF) {
|
||||
tmp >>= 4;
|
||||
tmp ^= 1;
|
||||
if (tmp != this->spriteSettings.b.flipX) {
|
||||
if (tmp != this->spriteSettings.flipX) {
|
||||
this->field_0x78.HALF.LO = 6;
|
||||
}
|
||||
}
|
||||
|
||||
+23
-23
@@ -34,10 +34,10 @@ void sub_08021780(Entity* this) {
|
||||
this->action = 5;
|
||||
this->actionDelay = 0xb4;
|
||||
this->field_0xf = 0;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->spritePriority.b0 = 3;
|
||||
CopyPositionAndSpriteOffset(&gPlayerEntity, this);
|
||||
this->height.HALF.HI = -1;
|
||||
this->z.HALF.HI = -1;
|
||||
((u8*)&this->field_0x86)[1] = 1;
|
||||
InitializeAnimation(this, 6);
|
||||
}
|
||||
@@ -47,7 +47,7 @@ void sub_08021780(Entity* this) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (this->currentHealth == 0)
|
||||
if (this->health == 0)
|
||||
this->knockbackDuration = 0;
|
||||
|
||||
sub_0804AA30(this, gUnk_080CB590);
|
||||
@@ -71,7 +71,7 @@ void sub_08021848(Entity* this) {
|
||||
gUnk_080CB5C8[this->subAction](this);
|
||||
} else {
|
||||
this->action = 3;
|
||||
this->height.HALF.HI = 0;
|
||||
this->z.HALF.HI = 0;
|
||||
InitializeAnimation(this, 2);
|
||||
}
|
||||
}
|
||||
@@ -102,24 +102,24 @@ void sub_080218B4(Entity* this) {
|
||||
void sub_080218CC(Entity* this) {
|
||||
if (this->subAction == 0) {
|
||||
this->subAction = 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->direction = ((sub_08049F84(this, 1) ^ 0x10) + gUnk_080CB5DC[Random() & 7]) & 0x1f;
|
||||
this->speed = 0x100;
|
||||
this->hVelocity = 0x12000;
|
||||
this->zVelocity = 0x12000;
|
||||
}
|
||||
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 1) {
|
||||
if (this->frame & 1) {
|
||||
sub_080AEFE0(this);
|
||||
if (sub_080044EC(this, 0x1c00) == 0)
|
||||
this->frameDuration = 1;
|
||||
}
|
||||
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 2;
|
||||
this->actionDelay = (Random() & 0x38) + 8;
|
||||
this->field_0xf = 1;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->speed = 0x180;
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
@@ -128,9 +128,9 @@ void sub_080218CC(Entity* this) {
|
||||
void sub_08021984(Entity* this) {
|
||||
if (this->subAction == 0) {
|
||||
this->subAction = 1;
|
||||
this->flags |= 0x80;
|
||||
this->spriteSettings.b.draw = 3;
|
||||
this->height.HALF.HI = -0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spriteSettings.draw = 3;
|
||||
this->z.HALF.HI = -0x80;
|
||||
this->spriteRendering.b3 = 1;
|
||||
this->spriteOrientation.flipY = 1;
|
||||
EnqueueSFX(0x12d);
|
||||
@@ -140,7 +140,7 @@ void sub_08021984(Entity* this) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 16;
|
||||
this->field_0xf = 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->speed = 0x180;
|
||||
((u8*)&this->field_0x86)[0] = 60;
|
||||
InitializeAnimation(this, 0);
|
||||
@@ -187,7 +187,7 @@ void sub_08021A64(Entity* this) {
|
||||
|
||||
void sub_08021AD8(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 1) {
|
||||
if (this->frame & 1) {
|
||||
if (this->actionDelay) {
|
||||
u32 tmp;
|
||||
|
||||
@@ -207,7 +207,7 @@ void sub_08021AD8(Entity* this) {
|
||||
this->frameDuration = 1;
|
||||
}
|
||||
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 20;
|
||||
((u8*)&this->field_0x86)[0] = 60;
|
||||
@@ -218,7 +218,7 @@ void sub_08021AD8(Entity* this) {
|
||||
void sub_08021B64(Entity* this) {
|
||||
if (gPlayerState.flags & 4) {
|
||||
this->action = 3;
|
||||
this->height.WORD = 0;
|
||||
this->z.WORD = 0;
|
||||
InitializeAnimation(this, 2);
|
||||
} else {
|
||||
int iVar4 = 1;
|
||||
@@ -238,7 +238,7 @@ void sub_08021B64(Entity* this) {
|
||||
|
||||
if (iVar4 == 0) {
|
||||
this->action = 6;
|
||||
this->hVelocity = 0x10000;
|
||||
this->zVelocity = 0x10000;
|
||||
((u8*)&this->field_0x86)[1] = 0;
|
||||
if (gPlayerEntity.direction != 0xff) {
|
||||
this->direction = 0x10 ^ gPlayerEntity.direction;
|
||||
@@ -252,7 +252,7 @@ void sub_08021B64(Entity* this) {
|
||||
gPlayerState.field_0xaa++;
|
||||
CopyPositionAndSpriteOffset(&gPlayerEntity, this);
|
||||
this->x.HALF.HI += gUnk_080CB5E4[(this->field_0xf++ & 0xe) >> 1];
|
||||
this->height.HALF.HI--;
|
||||
this->z.HALF.HI--;
|
||||
GetNextFrame(this);
|
||||
}
|
||||
}
|
||||
@@ -260,17 +260,17 @@ void sub_08021B64(Entity* this) {
|
||||
|
||||
void sub_08021C58(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 1) {
|
||||
if (this->frame & 1) {
|
||||
sub_080AEFE0(this);
|
||||
if (sub_08003FC4(this, 0x1800) == 0)
|
||||
this->frameDuration = 1;
|
||||
}
|
||||
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 60;
|
||||
this->field_0xf = 1;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spritePriority.b0 = 4;
|
||||
((u8*)&this->field_0x86)[0] = 60;
|
||||
InitializeAnimation(this, 0);
|
||||
@@ -278,7 +278,7 @@ void sub_08021C58(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08021CD0(Entity* this) {
|
||||
if ((this->frames.all & 0x80) == 0)
|
||||
if ((this->frame & 0x80) == 0)
|
||||
GetNextFrame(this);
|
||||
|
||||
if (sub_08049F84(this, 1) == 0xff)
|
||||
@@ -299,7 +299,7 @@ u32 sub_08021D00(Entity* this) {
|
||||
} else {
|
||||
this->action = 4;
|
||||
this->actionDelay = 1;
|
||||
this->hVelocity = 0x18000;
|
||||
this->zVelocity = 0x18000;
|
||||
InitializeAnimation(this, 4);
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ extern void sub_080A2CC0();
|
||||
void BladeTrap(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->attachedEntity = GetCurrentRoomProperty(this->type);
|
||||
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74);
|
||||
this->child = GetCurrentRoomProperty(this->type);
|
||||
sub_080A2CC0(this, &this->child, &this->field_0x74);
|
||||
}
|
||||
if (!(this->direction & 0x80)) {
|
||||
sub_0806F69C(this);
|
||||
@@ -19,6 +19,6 @@ void BladeTrap(Entity* this) {
|
||||
if (!(this->direction & 0x80)) {
|
||||
EnqueueSFX(0x74);
|
||||
}
|
||||
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74.HWORD);
|
||||
sub_080A2CC0(this, &this->child, &this->field_0x74.HWORD);
|
||||
}
|
||||
}
|
||||
|
||||
+20
-20
@@ -52,9 +52,9 @@ void sub_0802C688(Entity* this) {
|
||||
break;
|
||||
case 2:
|
||||
this->action = 3;
|
||||
this->damageType = 0x6e;
|
||||
this->hitType = 0x6e;
|
||||
this->field_0xf = 1;
|
||||
this->hVelocity = 0x18000;
|
||||
this->zVelocity = 0x18000;
|
||||
this->speed = 0;
|
||||
this->field_0x80.HALF.HI = 1;
|
||||
InitializeAnimation(this, this->direction >> 4 | 6);
|
||||
@@ -68,15 +68,15 @@ void sub_0802C7AC(Entity* this) {
|
||||
if (this->subAction < 3 && !sub_0806F520(this)) {
|
||||
this->subAction = 0;
|
||||
this->field_0xf = 1;
|
||||
this->height.HALF.HI = 0;
|
||||
this->z.HALF.HI = 0;
|
||||
if (this->field_0x82.HALF.LO != 2) {
|
||||
this->speed = this->field_0x82.HALF.LO ? 0x200 : 0x80;
|
||||
}
|
||||
this->hVelocity = 0x18000;
|
||||
this->zVelocity = 0x18000;
|
||||
this->field_0x82.HALF.HI = 0;
|
||||
this->field_0x80.HALF.HI = 0;
|
||||
} else {
|
||||
this->height.HALF.HI = -1;
|
||||
this->z.HALF.HI = -1;
|
||||
gUnk_080CD600[this->subAction](this);
|
||||
if (this->actionDelay != 0) {
|
||||
GetNextFrame(this);
|
||||
@@ -112,15 +112,15 @@ void sub_0802C83C(Entity* this) {
|
||||
sub_0802CBC4(this);
|
||||
} else {
|
||||
sub_0802CC18(this);
|
||||
this->flags &= ~0x80;
|
||||
this->damageType = 0x6e;
|
||||
COLLISION_OFF(this);
|
||||
this->hitType = 0x6e;
|
||||
}
|
||||
} else {
|
||||
this->field_0x82.HALF.LO = 2;
|
||||
this->actionDelay = 120;
|
||||
InitializeAnimation(this, (this->direction >> 4) | 6);
|
||||
this->flags &= ~0x80;
|
||||
this->damageType = 0x6e;
|
||||
COLLISION_OFF(this);
|
||||
this->hitType = 0x6e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ void sub_0802C8B8(Entity* this) {
|
||||
|
||||
void sub_0802C8C4(Entity* this) {
|
||||
sub_0804A7D4(this);
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
}
|
||||
|
||||
void sub_0802C8D8(Entity* this) {
|
||||
@@ -187,7 +187,7 @@ void sub_0802C9B8(Entity* this) {
|
||||
|
||||
void sub_0802C9D0(Entity* this) {
|
||||
this->subAction = 1;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->spritePriority.b1 = 0;
|
||||
this->field_0x82.HALF.HI = 1;
|
||||
sub_0802CC18(this);
|
||||
@@ -222,10 +222,10 @@ void sub_0802CA6C(Entity* this) {
|
||||
|
||||
void sub_0802CA94(Entity* this) {
|
||||
this->action = 3;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->field_0xf = 1;
|
||||
this->spritePriority.b1 = 1;
|
||||
this->hVelocity = 0x18000;
|
||||
this->zVelocity = 0x18000;
|
||||
this->speed = 0;
|
||||
this->field_0x82.HALF.HI = 0;
|
||||
this->field_0x80.HALF.HI = 0;
|
||||
@@ -242,10 +242,10 @@ void sub_0802CAF8(Entity* this) {
|
||||
}
|
||||
sub_0802CC18(this);
|
||||
sub_08078930(this);
|
||||
if (this->field_0xf && this->height.HALF.HI == 0) {
|
||||
if (this->field_0xf && this->z.HALF.HI == 0) {
|
||||
this->field_0xf = 0;
|
||||
this->flags = this->flags | 0x80;
|
||||
this->damageType = 0x6e;
|
||||
COLLISION_ON(this);
|
||||
this->hitType = 0x6e;
|
||||
}
|
||||
GetNextFrame(this);
|
||||
}
|
||||
@@ -260,7 +260,7 @@ void sub_0802CB68(Entity* this) {
|
||||
this->subAction = 0;
|
||||
this->direction = Random() & 0x18;
|
||||
this->direction |= 4;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
if (this->field_0x82.HALF.LO) {
|
||||
this->actionDelay = 200;
|
||||
this->speed = 0x200;
|
||||
@@ -276,9 +276,9 @@ void sub_0802CBC4(Entity* this) {
|
||||
Entity* ent;
|
||||
|
||||
this->action = 4;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->flags &= ~0x80;
|
||||
this->currentHealth = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
COLLISION_OFF(this);
|
||||
this->health = 0;
|
||||
if (this->field_0x82.HALF.HI) {
|
||||
sub_08079184();
|
||||
}
|
||||
|
||||
+28
-28
@@ -87,7 +87,7 @@ void sub_0802A8F4(Entity* this) {
|
||||
|
||||
void sub_0802A8FC(Entity* this) {
|
||||
if ((gPlayerState.field_0x1c & 0xf) == 0) {
|
||||
this->currentHealth = gPlayerState.field_0x1c & 0xf;
|
||||
this->health = gPlayerState.field_0x1c & 0xf;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ void nullsub_143(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802A91C(Entity* this) {
|
||||
this->currentHealth = 0;
|
||||
this->health = 0;
|
||||
}
|
||||
|
||||
void sub_0802A924(Entity* this) {
|
||||
@@ -108,7 +108,7 @@ void sub_0802A924(Entity* this) {
|
||||
#ifdef EU
|
||||
this->field_0x3c |= 0x10;
|
||||
#endif
|
||||
this->height.HALF.HI = -0x30;
|
||||
this->z.HALF.HI = -0x30;
|
||||
this->field_0x80.HALF.LO = Random() & 1;
|
||||
this->field_0x82.HWORD = 0;
|
||||
this->field_0x7a.HALF.HI = 0;
|
||||
@@ -140,7 +140,7 @@ void sub_0802A9A8(Entity* this) {
|
||||
if (gRoomControls.unk2 != 0) {
|
||||
return;
|
||||
}
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->field_0x82.HWORD = 1;
|
||||
if (this->field_0x80.HALF.LO) {
|
||||
this->x.HALF.HI = gRoomControls.roomScrollX - 0x10;
|
||||
@@ -166,10 +166,10 @@ void sub_0802AA40(Entity* this) {
|
||||
if (this->actionDelay) {
|
||||
this->actionDelay--;
|
||||
} else {
|
||||
Entity* ent = this->attachedEntity;
|
||||
Entity* ent = this->child;
|
||||
if (ent) {
|
||||
if (ent->next == NULL) {
|
||||
this->attachedEntity = NULL;
|
||||
this->child = NULL;
|
||||
} else {
|
||||
u32 direction = DirectionRound(this->field_0x80.HALF.LO * 0x10 + 0x18);
|
||||
|
||||
@@ -198,12 +198,12 @@ void sub_0802AAC0(Entity* this) {
|
||||
}
|
||||
|
||||
if (this->field_0x80.HALF.HI) {
|
||||
Entity* ent = this->attachedEntity;
|
||||
Entity* ent = this->child;
|
||||
if (ent == NULL) {
|
||||
this->field_0x80.HALF.HI = 0;
|
||||
} else if (ent->next == NULL) {
|
||||
this->field_0x80.HALF.HI = 0;
|
||||
this->attachedEntity = NULL;
|
||||
this->child = NULL;
|
||||
} else if (ent->actionDelay == 0 && ent->field_0xf < 0x51) {
|
||||
this->field_0x80.HALF.HI = 0;
|
||||
}
|
||||
@@ -227,10 +227,10 @@ void sub_0802AB40(Entity* this) {
|
||||
sub_0802AC40(this);
|
||||
switch (this->field_0x78.HALF.LO) {
|
||||
case 0:
|
||||
if (this->height.HALF.HI) {
|
||||
if (this->z.HALF.HI) {
|
||||
if (--this->field_0x78.HALF.HI == 0) {
|
||||
this->field_0x78.HALF.HI = 4;
|
||||
this->height.HALF.HI++;
|
||||
this->z.HALF.HI++;
|
||||
}
|
||||
} else {
|
||||
this->field_0x78.HALF.LO = 1;
|
||||
@@ -247,10 +247,10 @@ void sub_0802AB40(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (-0x30 < this->height.HALF.HI) {
|
||||
if (-0x30 < this->z.HALF.HI) {
|
||||
if (--this->field_0x78.HALF.HI == 0) {
|
||||
this->field_0x78.HALF.HI = 4;
|
||||
this->height.HALF.HI--;
|
||||
this->z.HALF.HI--;
|
||||
sub_0802ACDC(this, 4);
|
||||
}
|
||||
} else {
|
||||
@@ -264,7 +264,7 @@ void sub_0802AB40(Entity* this) {
|
||||
#endif
|
||||
|
||||
void sub_0802AC08(Entity* this) {
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 2;
|
||||
this->subAction = 0;
|
||||
this->actionDelay = 0x40;
|
||||
@@ -286,7 +286,7 @@ void sub_0802AC40(Entity* this) {
|
||||
this->field_0x7a.HALF.LO = 0;
|
||||
this->spritePriority.b1 = 0;
|
||||
} else {
|
||||
if (this->height.HALF.HI == 0) {
|
||||
if (this->z.HALF.HI == 0) {
|
||||
if (this->spritePriority.b1 != 1) {
|
||||
this->spritePriority.b1 = 1;
|
||||
}
|
||||
@@ -299,7 +299,7 @@ void sub_0802AC40(Entity* this) {
|
||||
} else {
|
||||
if (sub_0802B234(this)) {
|
||||
this->field_0x7a.HALF.LO = 1;
|
||||
if (this->height.HALF.HI == 0) {
|
||||
if (this->z.HALF.HI == 0) {
|
||||
this->spritePriority.b1 = 1;
|
||||
} else {
|
||||
this->spritePriority.b1 = 3;
|
||||
@@ -335,19 +335,19 @@ void sub_0802AD1C(Entity* this, u32 param_2) {
|
||||
void sub_0802AD54(Entity* this) {
|
||||
if (this->field_0x82.HWORD != 0) {
|
||||
if (gRoomControls.unk2 != 0) {
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
DeleteEntity(this);
|
||||
return;
|
||||
}
|
||||
if (gRoomControls.roomOriginY > this->y.HALF.HI ||
|
||||
(gRoomControls.roomOriginY + gRoomControls.height + 0x20) < this->y.HALF.HI) {
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
} else {
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
}
|
||||
}
|
||||
if (this->field_0x80.HALF.HI) {
|
||||
if (this->attachedEntity == NULL || this->attachedEntity->next == NULL) {
|
||||
if (this->child == NULL || this->child->next == NULL) {
|
||||
this->action = 4;
|
||||
this->actionDelay = 0xc0;
|
||||
this->field_0xf = 4;
|
||||
@@ -365,10 +365,10 @@ void sub_0802ADDC(Entity* this) {
|
||||
if (ent != NULL) {
|
||||
ent->type2 = !!sub_0802B234(this);
|
||||
ent->parent = this;
|
||||
this->attachedEntity = ent;
|
||||
this->child = ent;
|
||||
CopyPosition(this, ent);
|
||||
/*#ifdef EU
|
||||
this->height.HALF.HI += 8;
|
||||
this->z.HALF.HI += 8;
|
||||
#endif*/
|
||||
this->field_0x80.HALF.HI = 1;
|
||||
if (this->type == 0) {
|
||||
@@ -381,7 +381,7 @@ void sub_0802ADDC(Entity* this) {
|
||||
void sub_0802AE24(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0xf0;
|
||||
this->hVelocity = 0x8000;
|
||||
this->zVelocity = 0x8000;
|
||||
this->hitbox = (Hitbox*)&gUnk_080CD174;
|
||||
this->field_0x3c = 3;
|
||||
this->field_0x16 = 0;
|
||||
@@ -403,7 +403,7 @@ void sub_0802AE68(Entity* this) {
|
||||
} else {
|
||||
if (ent->field_0x80.HALF.HI) {
|
||||
CopyPosition(ent, this);
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
} else {
|
||||
this->action = 3;
|
||||
this->field_0x80.HALF.LO = 1;
|
||||
@@ -507,9 +507,9 @@ void sub_0802B048(Entity* this) {
|
||||
if (this->field_0x7a.HALF.HI) {
|
||||
if (gRoomControls.roomOriginY > this->y.HALF.HI ||
|
||||
(gRoomControls.roomOriginY + gRoomControls.height + 0x20) < this->y.HALF.HI) {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
} else {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -539,8 +539,8 @@ void sub_0802B048(Entity* this) {
|
||||
this->action = 4;
|
||||
this->hitbox = (Hitbox*)&gUnk_080CD17C;
|
||||
this->actionDelay = 0xf;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->flags |= 0x80;
|
||||
this->spriteSettings.draw = 0;
|
||||
COLLISION_ON(this);
|
||||
this->field_0x7a.HALF.HI = 0;
|
||||
sub_08078954(this);
|
||||
if (this->parent->next) {
|
||||
@@ -621,7 +621,7 @@ Entity* sub_0802B250(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802B264(Entity* this) {
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
if (sub_0802B234(this)) {
|
||||
this->spritePriority.b1 = 3;
|
||||
} else {
|
||||
|
||||
@@ -26,7 +26,7 @@ void sub_0803C198(Entity* this) {
|
||||
sub_0804AA30(this, gUnk_080CFF78);
|
||||
if ((this->bitfield & 0x80) != 0) {
|
||||
sub_0803C5F0(this);
|
||||
pEVar1 = this->attachedEntity;
|
||||
pEVar1 = this->child;
|
||||
if (pEVar1 != NULL) {
|
||||
pEVar1->field_0xf++;
|
||||
}
|
||||
|
||||
+14
-14
@@ -55,15 +55,15 @@ void sub_0802891C(Entity* this) {
|
||||
void sub_08028934(Entity* this) {
|
||||
Entity* pEVar1;
|
||||
|
||||
if (this->damageType == 1 && (this->bitfield & 0x7f) == 0x42) {
|
||||
if (this->hitType == 1 && (this->bitfield & 0x7f) == 0x42) {
|
||||
this->action = 3;
|
||||
this->subAction = 0;
|
||||
this->actionDelay = 0x28;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
sub_080290E0(this, 4);
|
||||
pEVar1 = CreateFx(this, FX_BUSH, 0);
|
||||
if (pEVar1 != NULL) {
|
||||
pEVar1->height.HALF.HI -= 8;
|
||||
pEVar1->z.HALF.HI -= 8;
|
||||
}
|
||||
EnqueueSFX(0x1bb);
|
||||
}
|
||||
@@ -90,7 +90,7 @@ void sub_08028994(Entity* this) {
|
||||
this->actionDelay = 0;
|
||||
this->field_0x76.HWORD = COORD_TO_TILE(this);
|
||||
this->field_0x74.HWORD = sub_080001DA(this->field_0x76.HWORD, this->collisionLayer);
|
||||
this->field_0x40 = 0x41;
|
||||
this->hurtType = 0x41;
|
||||
sub_08028FFC(this);
|
||||
}
|
||||
}
|
||||
@@ -112,7 +112,7 @@ void sub_08028A74(Entity* this) {
|
||||
switch (this->subAction) {
|
||||
case 0:
|
||||
unk = 1;
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->subAction = 1;
|
||||
this->actionDelay = 0x3c;
|
||||
this->field_0xf = 0x10;
|
||||
@@ -138,19 +138,19 @@ void sub_08028A74(Entity* this) {
|
||||
case 2:
|
||||
unk = 1;
|
||||
sub_080290FC(this);
|
||||
if (this->frames.all & 1) {
|
||||
if (this->frame & 1) {
|
||||
Entity* ent = CreateProjectileWithParent(this, 4, 0);
|
||||
if (ent != NULL) {
|
||||
ent->parent = this;
|
||||
ent->direction = this->direction;
|
||||
this->frames.all &= ~1;
|
||||
this->frame &= ~1;
|
||||
this->subAction = 3;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
unk = 2;
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->subAction = 4;
|
||||
this->actionDelay = 0x50;
|
||||
sub_080290E0(this, 1);
|
||||
@@ -189,7 +189,7 @@ void sub_08028BC4(Entity* this) {
|
||||
switch (this->subAction) {
|
||||
case 0:
|
||||
if (this->actionDelay == 0) {
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->subAction = 1;
|
||||
sub_08028FDC(this);
|
||||
sub_080290E0(this, 5);
|
||||
@@ -200,7 +200,7 @@ void sub_08028BC4(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 4;
|
||||
this->subAction = 0;
|
||||
this->actionDelay = 0x1e;
|
||||
@@ -209,7 +209,7 @@ void sub_08028BC4(Entity* this) {
|
||||
iVar1 = sub_0804A9FC(this, 0x1c);
|
||||
if (iVar1 != NULL) {
|
||||
iVar1->spritePriority.b0 = 3;
|
||||
iVar1->height.HALF.HI -= 12;
|
||||
iVar1->z.HALF.HI -= 12;
|
||||
sub_0805E3A0(iVar1, 2);
|
||||
}
|
||||
SetFlag(this->field_0x86.HWORD);
|
||||
@@ -417,7 +417,7 @@ bool32 sub_08028FDC(Entity* this) {
|
||||
|
||||
void sub_08028FFC(Entity* this) {
|
||||
this->action = 1;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->spritePriority.b1 = 0;
|
||||
sub_080AE068(this);
|
||||
UnloadOBJPalette(this);
|
||||
@@ -433,7 +433,7 @@ void sub_08028FFC(Entity* this) {
|
||||
|
||||
void sub_08029078(Entity* this) {
|
||||
this->action = 2;
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spritePriority.b1 = 1;
|
||||
if (LoadFixedGFX(this, 0x72) == 0) {
|
||||
DeleteEntity(this);
|
||||
@@ -549,7 +549,7 @@ void sub_0802925C(Entity* this) {
|
||||
void sub_08029270(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action++;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
InitializeAnimation(this, 0xe);
|
||||
} else {
|
||||
GetNextFrame(this);
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ void sub_0802B56C(Entity* this) {
|
||||
|
||||
void sub_0802B5C8(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 30;
|
||||
InitializeAnimation(this, 0);
|
||||
|
||||
+63
-63
@@ -52,11 +52,11 @@ void Chuchu(Entity* this) {
|
||||
if (index != this->field_0x80.HALF.HI) {
|
||||
switch (this->type) {
|
||||
case 0:
|
||||
if (this->flags & 0x80) {
|
||||
if (this->flags & ENT_COLLIDE) {
|
||||
this->action = 6;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->speed = 0x20;
|
||||
this->damageType = 0x5c;
|
||||
this->hitType = 0x5c;
|
||||
InitializeAnimation(this, 5);
|
||||
}
|
||||
break;
|
||||
@@ -100,12 +100,12 @@ void sub_0801EF40(Entity* this) {
|
||||
|
||||
if (this->type == 2) {
|
||||
if (this->bitfield == 0x8e || this->bitfield == 0x95) {
|
||||
this->flags &= ~0x80;
|
||||
this->currentHealth = 0;
|
||||
COLLISION_OFF(this);
|
||||
this->health = 0;
|
||||
}
|
||||
}
|
||||
|
||||
health = this->currentHealth;
|
||||
health = this->health;
|
||||
if (health) {
|
||||
if (this->bitfield == 0x94) {
|
||||
sub_0801FB68(this);
|
||||
@@ -117,10 +117,10 @@ void sub_0801EF40(Entity* this) {
|
||||
}
|
||||
} else {
|
||||
sub_0804AA1C(this);
|
||||
this->hVelocity = 0;
|
||||
this->zVelocity = 0;
|
||||
InitializeAnimation(this, 9);
|
||||
}
|
||||
this->field_0x80.HALF.LO = this->currentHealth;
|
||||
this->field_0x80.HALF.LO = this->health;
|
||||
sub_0804AA30(this, gUnk_080CA21C);
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ void sub_0801F048(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0801F084(Entity* this) {
|
||||
if ((this->frames.all & 0x80) == 0)
|
||||
if ((this->frame & 0x80) == 0)
|
||||
GetNextFrame(this);
|
||||
sub_08001242(this);
|
||||
}
|
||||
@@ -165,7 +165,7 @@ void sub_0801F084(Entity* this) {
|
||||
void sub_0801F0A4(Entity* this) {
|
||||
sub_0804A720(this);
|
||||
this->action = 1;
|
||||
this->field_0x80.HALF.LO = this->currentHealth;
|
||||
this->field_0x80.HALF.LO = this->health;
|
||||
this->field_0x82.HALF.LO = 0;
|
||||
}
|
||||
|
||||
@@ -175,12 +175,12 @@ void nullsub_4(Entity* this) {
|
||||
|
||||
void sub_0801F0C8(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 3;
|
||||
this->actionDelay = (Random() & 3) + 0xc;
|
||||
this->field_0xf = Random();
|
||||
this->direction = sub_08049F84(this, 1);
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spritePriority.b0 = 4;
|
||||
this->spritePriority.b1 = 3;
|
||||
InitializeAnimation(this, 2);
|
||||
@@ -210,10 +210,10 @@ void sub_0801F12C(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0801F1B0(Entity* this) {
|
||||
if (this->frames.all & 0x10) {
|
||||
if (this->frames.all & 1) {
|
||||
this->frames.all ^= 1;
|
||||
this->damageType = 90;
|
||||
if (this->frame & 0x10) {
|
||||
if (this->frame & 1) {
|
||||
this->frame ^= 1;
|
||||
this->hitType = 90;
|
||||
EnqueueSFX(299);
|
||||
}
|
||||
sub_080AEFE0(this);
|
||||
@@ -223,7 +223,7 @@ void sub_0801F1B0(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
}
|
||||
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
if (sub_0801FBD0(this)) {
|
||||
sub_0801F328(this);
|
||||
} else {
|
||||
@@ -242,7 +242,7 @@ void sub_0801F228(Entity* this) {
|
||||
|
||||
void sub_0801F250(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80)
|
||||
if (this->frame & 0x80)
|
||||
sub_0801F360(this);
|
||||
}
|
||||
|
||||
@@ -269,9 +269,9 @@ void sub_0801F270(Entity* this) {
|
||||
|
||||
void sub_0801F2CC(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
InitializeAnimation(this, 4);
|
||||
}
|
||||
}
|
||||
@@ -279,7 +279,7 @@ void sub_0801F2CC(Entity* this) {
|
||||
void sub_0801F2F8(Entity* this) {
|
||||
sub_08003FC4(this, 0x1800);
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
sub_0801F340(this);
|
||||
sub_0804AA1C(this);
|
||||
}
|
||||
@@ -287,7 +287,7 @@ void sub_0801F2F8(Entity* this) {
|
||||
|
||||
void sub_0801F328(Entity* this) {
|
||||
this->action = 6;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, 5);
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ void sub_0801F340(Entity* this) {
|
||||
this->action = 5;
|
||||
this->actionDelay = 60;
|
||||
this->speed = 0x20;
|
||||
this->damageType = 92;
|
||||
this->hitType = 92;
|
||||
InitializeAnimation(this, 2);
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ void sub_0801F3AC(Entity* this) {
|
||||
if (this->field_0x82.HALF.LO || PlayerInRange(this, 1, 0x48)) {
|
||||
if (this->action == 1) {
|
||||
this->action = 2;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->field_0x82.HALF.LO = 1;
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
@@ -339,16 +339,16 @@ void sub_0801F428(Entity* this) {
|
||||
sub_0804A720(this);
|
||||
this->action = 1;
|
||||
this->actionDelay = Random();
|
||||
this->field_0x80.HALF.LO = this->currentHealth;
|
||||
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->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spritePriority.b1 = 3;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
InitializeAnimation(this, 2);
|
||||
}
|
||||
#endif
|
||||
@@ -359,11 +359,11 @@ void sub_0801F48C(Entity* this) {
|
||||
|
||||
void sub_0801F494(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 3;
|
||||
this->field_0xf = 30;
|
||||
this->direction = sub_08049F84(this, 1);
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spritePriority.b0 = 4;
|
||||
this->spritePriority.b1 = 3;
|
||||
InitializeAnimation(this, 2);
|
||||
@@ -401,10 +401,10 @@ void sub_0801F508(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0801F584(Entity* this) {
|
||||
if (this->frames.all & 0x10) {
|
||||
if (this->frames.all & 0x1) {
|
||||
this->frames.all ^= 1;
|
||||
this->damageType = 91;
|
||||
if (this->frame & 0x10) {
|
||||
if (this->frame & 0x1) {
|
||||
this->frame ^= 1;
|
||||
this->hitType = 91;
|
||||
EnqueueSFX(299);
|
||||
}
|
||||
sub_080AEFE0(this);
|
||||
@@ -415,7 +415,7 @@ void sub_0801F584(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
}
|
||||
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
if (sub_0801FBD0(this)) {
|
||||
this->field_0x82.HALF.HI = 0;
|
||||
sub_0801F730(this);
|
||||
@@ -423,7 +423,7 @@ void sub_0801F584(Entity* this) {
|
||||
this->action = 6;
|
||||
this->field_0xf = 60;
|
||||
this->speed = 0x20;
|
||||
this->damageType = 92;
|
||||
this->hitType = 92;
|
||||
InitializeAnimation(this, 2);
|
||||
}
|
||||
}
|
||||
@@ -437,7 +437,7 @@ void sub_0801F61C(Entity* this) {
|
||||
|
||||
void sub_0801F638(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 8;
|
||||
this->field_0xf = 30;
|
||||
this->direction = sub_08049F84(this, 1);
|
||||
@@ -462,9 +462,9 @@ void sub_0801F688(Entity* this) {
|
||||
|
||||
void sub_0801F6CC(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
InitializeAnimation(this, 4);
|
||||
}
|
||||
}
|
||||
@@ -472,7 +472,7 @@ void sub_0801F6CC(Entity* this) {
|
||||
void sub_0801F6F8(Entity* this) {
|
||||
sub_08003FC4(this, 0x1800);
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 4;
|
||||
this->speed = 0x20;
|
||||
sub_0804AA1C(this);
|
||||
@@ -482,13 +482,13 @@ void sub_0801F6F8(Entity* this) {
|
||||
|
||||
void sub_0801F730(Entity* this) {
|
||||
this->action = 7;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, 5);
|
||||
}
|
||||
|
||||
void sub_0801F748(Entity* this) {
|
||||
this->action = 2;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
InitializeAnimation(this, 4);
|
||||
}
|
||||
|
||||
@@ -500,7 +500,7 @@ void sub_0801F764(Entity* this) {
|
||||
if (this->action == 1) {
|
||||
if (this->field_0x82.HALF.LO || PlayerInRange(this, 1, 0x48)) {
|
||||
this->action = 2;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->field_0x82.HALF.LO = 1;
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
@@ -517,7 +517,7 @@ void sub_0801F7D8(Entity* this) {
|
||||
sub_0804A720(this);
|
||||
this->action = 1;
|
||||
this->actionDelay = Random();
|
||||
this->field_0x80.HALF.LO = this->currentHealth;
|
||||
this->field_0x80.HALF.LO = this->health;
|
||||
this->field_0x82.HALF.LO = 0;
|
||||
}
|
||||
|
||||
@@ -527,7 +527,7 @@ void sub_0801F7FC(Entity* this) {
|
||||
|
||||
if (this->field_0x82.HALF.LO || PlayerInRange(this, 1, 0x48)) {
|
||||
this->action = 2;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->field_0x82.HALF.LO = 1;
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
@@ -535,9 +535,9 @@ void sub_0801F7FC(Entity* this) {
|
||||
|
||||
void sub_0801F840(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
sub_0801FB14(this);
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spritePriority.b0 = 4;
|
||||
this->spritePriority.b1 = 3;
|
||||
}
|
||||
@@ -552,7 +552,7 @@ void sub_0801F884(Entity* this) {
|
||||
if (ent) {
|
||||
ent->type2 = 64;
|
||||
this->action = 4;
|
||||
this->damageType = 165;
|
||||
this->hitType = 165;
|
||||
EnqueueSFX(0x193);
|
||||
}
|
||||
}
|
||||
@@ -579,9 +579,9 @@ void sub_0801F8C0(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0801F940(Entity* this) {
|
||||
if (this->frames.all & 0x10) {
|
||||
if (this->frames.all & 1) {
|
||||
this->frames.all ^= 1;
|
||||
if (this->frame & 0x10) {
|
||||
if (this->frame & 1) {
|
||||
this->frame ^= 1;
|
||||
EnqueueSFX(299);
|
||||
}
|
||||
sub_080AEFE0(this);
|
||||
@@ -591,7 +591,7 @@ void sub_0801F940(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
}
|
||||
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
if (sub_0801FBD0(this)) {
|
||||
sub_0801FAE0(this);
|
||||
} else {
|
||||
@@ -611,7 +611,7 @@ void sub_0801F9C4(Entity* this) {
|
||||
|
||||
void sub_0801F9E0(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 8;
|
||||
this->field_0xf = 30;
|
||||
this->direction = sub_08049F84(this, 1);
|
||||
@@ -636,9 +636,9 @@ void sub_0801FA30(Entity* this) {
|
||||
|
||||
void sub_0801FA78(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
InitializeAnimation(this, 4);
|
||||
sub_0804AA1C(this);
|
||||
}
|
||||
@@ -647,7 +647,7 @@ void sub_0801FA78(Entity* this) {
|
||||
void sub_0801FAAC(Entity* this) {
|
||||
sub_08003FC4(this, 0x1800);
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
sub_0801FB14(this);
|
||||
this->speed = 0x20;
|
||||
sub_0804AA1C(this);
|
||||
@@ -656,13 +656,13 @@ void sub_0801FAAC(Entity* this) {
|
||||
|
||||
void sub_0801FAE0(Entity* this) {
|
||||
this->action = 7;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, 5);
|
||||
}
|
||||
|
||||
void sub_0801FAF8(Entity* this) {
|
||||
this->action = 2;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
InitializeAnimation(this, 4);
|
||||
}
|
||||
|
||||
@@ -675,7 +675,7 @@ void sub_0801FB14(Entity* this) {
|
||||
|
||||
void sub_0801FB34(Entity* this) {
|
||||
if (*(Entity**)&this->field_0x68) {
|
||||
sub_0806FA90(this, *(Entity**)&this->field_0x68, gUnk_080CA2B4[this->frames.all & 0xf], 1);
|
||||
sub_0806FA90(this, *(Entity**)&this->field_0x68, gUnk_080CA2B4[this->frame & 0xf], 1);
|
||||
(*(Entity**)&this->field_0x68)->spriteOffsetY--;
|
||||
}
|
||||
}
|
||||
@@ -687,18 +687,18 @@ void sub_0801FB68(Entity* this) {
|
||||
break;
|
||||
case 1:
|
||||
this->action = 10;
|
||||
this->flags |= 0x80;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
COLLISION_ON(this);
|
||||
this->spriteSettings.draw = 1;
|
||||
this->spritePriority.b1 = 3;
|
||||
break;
|
||||
case 2:
|
||||
this->action = 10;
|
||||
this->damageType = 92;
|
||||
this->hitType = 92;
|
||||
sub_0804AA1C(this);
|
||||
break;
|
||||
}
|
||||
|
||||
this->hVelocity = 0;
|
||||
this->zVelocity = 0;
|
||||
}
|
||||
|
||||
u32 sub_0801FBD0(Entity* this) {
|
||||
@@ -711,7 +711,7 @@ u32 sub_0801FBD0(Entity* this) {
|
||||
|
||||
void Chuchu_JumpAtPlayer(Entity* this) {
|
||||
this->speed = 0x180;
|
||||
this->hVelocity = 0x20000;
|
||||
this->zVelocity = 0x20000;
|
||||
this->direction = sub_08049F84(this, 1);
|
||||
InitializeAnimation(this, 3);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ void sub_08022970(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08022988(Entity* this) {
|
||||
if (this->height.HALF.HI == 0 && sub_08022B20(this)) {
|
||||
if (this->z.HALF.HI == 0 && sub_08022B20(this)) {
|
||||
sub_08022B0C(this);
|
||||
} else {
|
||||
if (this->field_0xf) {
|
||||
@@ -49,7 +49,7 @@ void sub_08022988(Entity* this) {
|
||||
return;
|
||||
|
||||
this->frameIndex = 1;
|
||||
this->hVelocity = 0x10000;
|
||||
this->zVelocity = 0x10000;
|
||||
EnqueueSFX(0xd6);
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ void sub_080229F8(Entity* this) {
|
||||
this->speed = 0xc0;
|
||||
sub_08022B44(this);
|
||||
} else {
|
||||
this->hVelocity = 0x10000;
|
||||
this->zVelocity = 0x10000;
|
||||
EnqueueSFX(0xd6);
|
||||
}
|
||||
}
|
||||
@@ -120,7 +120,7 @@ void sub_08022AA4(Entity* this) {
|
||||
}
|
||||
|
||||
if (this->direction & 0xf)
|
||||
this->spriteSettings.b.flipX = (this->direction >> 4) ^ 1;
|
||||
this->spriteSettings.flipX = (this->direction >> 4) ^ 1;
|
||||
}
|
||||
|
||||
void sub_08022B0C(Entity* this) {
|
||||
@@ -138,11 +138,11 @@ u32 sub_08022B20(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08022B44(Entity* this) {
|
||||
this->hVelocity = 0xc000;
|
||||
this->zVelocity = 0xc000;
|
||||
this->direction = GetFacingDirection(this, &gPlayerEntity);
|
||||
|
||||
if (this->direction & 0xf)
|
||||
this->spriteSettings.b.flipX = (this->direction >> 4) ^ 1;
|
||||
this->spriteSettings.flipX = (this->direction >> 4) ^ 1;
|
||||
|
||||
EnqueueSFX(0xd6);
|
||||
}
|
||||
|
||||
+54
-55
@@ -63,7 +63,7 @@ void sub_08020BB8(Entity* this) {
|
||||
case 0x1c:
|
||||
this->action = 11;
|
||||
this->actionDelay = gUnk_080CAB0C[this->type];
|
||||
this->damageType = 81;
|
||||
this->hitType = 81;
|
||||
sub_08021218(this, 8, DirectionToAnimationState(this->knockbackDirection ^ 0x10));
|
||||
sub_08021588(this);
|
||||
sub_0804A9FC(this, 0x1c);
|
||||
@@ -71,7 +71,7 @@ void sub_08020BB8(Entity* this) {
|
||||
case 0x16:
|
||||
this->action = 11;
|
||||
this->actionDelay = gUnk_080CAB10[this->type];
|
||||
this->damageType = 81;
|
||||
this->hitType = 81;
|
||||
sub_08021218(this, 8, DirectionToAnimationState(this->knockbackDirection ^ 0x10));
|
||||
sub_08021588(this);
|
||||
sub_0804A9FC(this, 0x1c);
|
||||
@@ -98,8 +98,8 @@ void sub_08020BB8(Entity* this) {
|
||||
case 0x4c:
|
||||
if (this->action == 15) {
|
||||
u8 bVar3 = 0xff;
|
||||
if (this->attachedEntity != NULL) {
|
||||
bVar3 = this->attachedEntity->bitfield & 0x7f;
|
||||
if (this->child != NULL) {
|
||||
bVar3 = this->child->bitfield & 0x7f;
|
||||
}
|
||||
if (bVar3 == 2) {
|
||||
sub_080213D0(this, gUnk_080CAB08[this->type]);
|
||||
@@ -109,14 +109,14 @@ void sub_08020BB8(Entity* this) {
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (this->currentHealth != this->field_0x78.HALF.LO) {
|
||||
if (this->health != this->field_0x78.HALF.LO) {
|
||||
sub_08021588(this);
|
||||
sub_08021390(this);
|
||||
sub_0804AA1C(this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
this->field_0x78.HALF.LO = this->currentHealth;
|
||||
this->field_0x78.HALF.LO = this->health;
|
||||
sub_0804AA30(this, gUnk_080CAA98);
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ void sub_08020D70(Entity* this) {
|
||||
sub_0804A720(this);
|
||||
this->action = 1;
|
||||
this->field_0x74.HALF.HI = 0;
|
||||
this->field_0x78.HALF.LO = this->currentHealth;
|
||||
this->field_0x78.HALF.LO = this->health;
|
||||
this->animationState = -1;
|
||||
sub_08021218(this, 0, 2);
|
||||
}
|
||||
@@ -139,7 +139,7 @@ void sub_08020D9C(Entity* this) {
|
||||
|
||||
void sub_08020DB4(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (this->frames.all & 0x80)
|
||||
if (this->frame & 0x80)
|
||||
sub_08021390(this);
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ void sub_08020DD4(Entity* this) {
|
||||
|
||||
void sub_08020E28(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (this->frames.all & 0x80)
|
||||
if (this->frame & 0x80)
|
||||
sub_080213B0(this);
|
||||
}
|
||||
|
||||
@@ -168,14 +168,14 @@ void sub_08020E48(Entity* this) {
|
||||
sub_080213F0(this);
|
||||
} else {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (this->frames.all & 0x80)
|
||||
if (this->frame & 0x80)
|
||||
sub_080213B0(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08020E78(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (this->frames.all & 0x80)
|
||||
if (this->frame & 0x80)
|
||||
sub_08021390(this);
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ void sub_08020E98(Entity* this) {
|
||||
|
||||
void sub_08020F28(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (this->frames.all & 0x80)
|
||||
if (this->frame & 0x80)
|
||||
sub_08021400(this);
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ void sub_08020F48(Entity* this) {
|
||||
pEVar3 = CreateProjectileWithParent(this, 0, 1);
|
||||
if (pEVar3) {
|
||||
pEVar3->parent = this;
|
||||
this->attachedEntity = pEVar3;
|
||||
this->child = pEVar3;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -239,7 +239,7 @@ void sub_08020F48(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08020FAC(Entity* this) {
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
if (this->field_0x7a.HALF.LO) {
|
||||
this->field_0x7a.HALF.LO--;
|
||||
} else {
|
||||
@@ -262,23 +262,23 @@ void sub_08020FE4(Entity* this) {
|
||||
|
||||
void sub_08021010(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
this->damageType = 0x56;
|
||||
if (this->frame & 0x80) {
|
||||
this->hitType = 0x56;
|
||||
sub_080213F0(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08021038(Entity* this) {
|
||||
if (this->attachedEntity == NULL && this->frames.all) {
|
||||
if (this->child == NULL && this->frame) {
|
||||
Entity* pEVar2 = (Entity*)CreateProjectileWithParent(this, 0, 0);
|
||||
if (pEVar2) {
|
||||
pEVar2->parent = this;
|
||||
this->attachedEntity = pEVar2;
|
||||
this->child = pEVar2;
|
||||
}
|
||||
EnqueueSFX(270);
|
||||
}
|
||||
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
sub_08021588(this);
|
||||
if (this->field_0x7c.BYTES.byte0) {
|
||||
this->field_0x7c.BYTES.byte0--;
|
||||
@@ -287,40 +287,39 @@ void sub_08021038(Entity* this) {
|
||||
}
|
||||
} else {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (this->frames.all == 4)
|
||||
this->damageType = 81;
|
||||
if (this->frame == 4)
|
||||
this->hitType = 81;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080210A8(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (this->frames.all & 1) {
|
||||
this->frames.all = 0;
|
||||
if (this->frame & 1) {
|
||||
this->frame = 0;
|
||||
sub_08021588(this);
|
||||
EnqueueSFX(349);
|
||||
} else if (this->frames.all & 0x80) {
|
||||
} else if (this->frame & 0x80) {
|
||||
sub_08021390(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080210E4(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (this->frames.all & 1) {
|
||||
if (this->frame & 1) {
|
||||
Entity* ent;
|
||||
|
||||
this->frames.all &= ~1;
|
||||
this->frame &= ~1;
|
||||
ent = CreateProjectileWithParent(this, 0, 2);
|
||||
if (ent) {
|
||||
ent->parent = this;
|
||||
this->attachedEntity = ent;
|
||||
this->child = ent;
|
||||
}
|
||||
|
||||
EnqueueSFX(270);
|
||||
}
|
||||
|
||||
sub_08021644(this);
|
||||
if ((this->frames.all & 0x10) &&
|
||||
(!ProcessMovement(this) || (this->attachedEntity && (this->attachedEntity->bitfield & 0x80)))) {
|
||||
if ((this->frame & 0x10) && (!ProcessMovement(this) || (this->child && (this->child->bitfield & 0x80)))) {
|
||||
sub_080213D0(this, 0);
|
||||
} else {
|
||||
if (--this->field_0x76.HWORD == 0)
|
||||
@@ -329,7 +328,7 @@ void sub_080210E4(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08021170(Entity* this) {
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
if (this->field_0x7a.HALF.HI) {
|
||||
this->field_0x7a.HALF.HI--;
|
||||
} else {
|
||||
@@ -345,7 +344,7 @@ void sub_080211A0(Entity* this) {
|
||||
sub_08021390(this);
|
||||
} else {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (this->frames.all & 0x80)
|
||||
if (this->frame & 0x80)
|
||||
sub_080213B0(this);
|
||||
}
|
||||
}
|
||||
@@ -356,7 +355,7 @@ void sub_080211D0(Entity* this)
|
||||
UpdateAnimationSingleFrame(this);
|
||||
sub_0802159C(this);
|
||||
|
||||
if (this->frames.all & 0x80)
|
||||
if (this->frame & 0x80)
|
||||
sub_08021390(this);
|
||||
}
|
||||
|
||||
@@ -364,7 +363,7 @@ void sub_080211F4(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
sub_08021600(this);
|
||||
|
||||
if (this->frames.all & 0x80)
|
||||
if (this->frame & 0x80)
|
||||
sub_08021390(this);
|
||||
}
|
||||
|
||||
@@ -414,7 +413,7 @@ void sub_080212B0(Entity* this) {
|
||||
if (this->type < 2 && tmp == 2)
|
||||
tmp = gUnk_080CAB52[Random() & 3];
|
||||
|
||||
this->attachedEntity = NULL;
|
||||
this->child = NULL;
|
||||
gUnk_080CAB58[tmp](this);
|
||||
}
|
||||
|
||||
@@ -445,7 +444,7 @@ void sub_08021380(Entity* this) {
|
||||
void sub_08021390(Entity* this) {
|
||||
this->action = 7;
|
||||
this->speed = 0x200;
|
||||
this->damageType = 0x56;
|
||||
this->hitType = 0x56;
|
||||
sub_08021218(this, 6, this->animationState);
|
||||
}
|
||||
|
||||
@@ -530,7 +529,7 @@ u32 sub_080214FC(Entity* this) {
|
||||
return 0;
|
||||
|
||||
direction = GetFacingDirection(this, gUnk_020000B0);
|
||||
if (4 < (direction - (this->frames.all & 0x1f)) - 2)
|
||||
if (4 < (direction - (this->frame & 0x1f)) - 2)
|
||||
return 0;
|
||||
|
||||
this->animationState = DirectionToAnimationState(direction);
|
||||
@@ -557,54 +556,54 @@ void sub_08021540(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08021588(Entity* this) {
|
||||
if (this->attachedEntity) {
|
||||
this->attachedEntity->parent = NULL;
|
||||
this->attachedEntity = NULL;
|
||||
if (this->child) {
|
||||
this->child->parent = NULL;
|
||||
this->child = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0802159C(Entity* this) {
|
||||
if (this->frames.all == 1) {
|
||||
if (this->frame == 1) {
|
||||
Entity* ent;
|
||||
|
||||
this->frames.all = 0;
|
||||
this->damageType = 0x51;
|
||||
this->frame = 0;
|
||||
this->hitType = 0x51;
|
||||
ent = CreateProjectileWithParent(this, 0, 3);
|
||||
if (ent) {
|
||||
ent->parent = this;
|
||||
this->attachedEntity = ent;
|
||||
this->child = ent;
|
||||
}
|
||||
EnqueueSFX(0x116);
|
||||
} else if (this->frames.all == 2) {
|
||||
this->frames.all = 0;
|
||||
} else if (this->frame == 2) {
|
||||
this->frame = 0;
|
||||
sub_08021588(this);
|
||||
} else if (this->frames.all & 0x20) {
|
||||
this->frames.all &= ~0x20;
|
||||
} else if (this->frame & 0x20) {
|
||||
this->frame &= ~0x20;
|
||||
EnqueueSFX(0x115);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08021600(Entity* this) {
|
||||
if (this->frames.all == 1) {
|
||||
if (this->frame == 1) {
|
||||
Entity* ent;
|
||||
|
||||
this->frames.all = 0;
|
||||
this->damageType = 0x51;
|
||||
this->frame = 0;
|
||||
this->hitType = 0x51;
|
||||
ent = CreateProjectileWithParent(this, 0, 4);
|
||||
if (ent) {
|
||||
ent->parent = this;
|
||||
this->attachedEntity = ent;
|
||||
this->child = ent;
|
||||
}
|
||||
EnqueueSFX(0x10e);
|
||||
} else if (this->frames.all == 2) {
|
||||
this->frames.all = 0;
|
||||
} else if (this->frame == 2) {
|
||||
this->frame = 0;
|
||||
sub_08021588(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08021644(Entity* this) {
|
||||
if (this->frames.all & 0x20) {
|
||||
this->frames.all &= ~0x20;
|
||||
if (this->frame & 0x20) {
|
||||
this->frame &= ~0x20;
|
||||
EnqueueSFX(0x7d);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,13 +71,13 @@ void sub_080220D8(Entity* this) {
|
||||
|
||||
void sub_080220F0(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
const PosOffset* off;
|
||||
u32 i;
|
||||
|
||||
this->action = 4;
|
||||
this->actionDelay = 0x78;
|
||||
this->field_0x44 = 0;
|
||||
this->damage = 0;
|
||||
off = gUnk_080CB76C[this->type2];
|
||||
for (i = 0; i < 6; i++, off++) {
|
||||
Entity* fx = CreateFx(this, FX_DASH, 0);
|
||||
@@ -87,8 +87,8 @@ void sub_080220F0(Entity* this) {
|
||||
}
|
||||
}
|
||||
EnqueueSFX(260);
|
||||
} else if (this->frames.all & 1) {
|
||||
this->field_0x44 = 4;
|
||||
} else if (this->frame & 1) {
|
||||
this->damage = 4;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ void sub_08022174(Entity* this) {
|
||||
void sub_08022198(Entity* this) {
|
||||
sub_0800445C(this);
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0x5a;
|
||||
}
|
||||
|
||||
+3
-3
@@ -39,9 +39,9 @@ void sub_0803EB44(Entity* this) {
|
||||
pEVar1 = CreateProjectileWithParent(this, 0x19, 0);
|
||||
if (pEVar1 != NULL) {
|
||||
pEVar1->parent = this;
|
||||
this->attachedEntity = pEVar1;
|
||||
this->flags |= 0x80;
|
||||
this->spriteSettings.b.draw = TRUE;
|
||||
this->child = pEVar1;
|
||||
COLLISION_ON(this);
|
||||
this->spriteSettings.draw = TRUE;
|
||||
this->animationState = 2;
|
||||
*((u8*)&this->field_0x7a + 1) = 0;
|
||||
*(u8*)&this->field_0x7c = 0;
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ void nullsub_133(Entity* this) {
|
||||
|
||||
void sub_08022FD0(Entity* this) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
sub_08023000(this, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ void sub_0802C254(Entity* this) {
|
||||
|
||||
void sub_0802C258(Entity* this) {
|
||||
sub_0804A720(this);
|
||||
this->hVelocity = 0x20000;
|
||||
this->zVelocity = 0x20000;
|
||||
this->actionDelay = 2;
|
||||
this->field_0x7a.HWORD = Random() & 0x70;
|
||||
switch (this->type) {
|
||||
@@ -45,7 +45,7 @@ void sub_0802C258(Entity* this) {
|
||||
}
|
||||
this->field_0x80.HWORD = this->x.HALF.HI;
|
||||
this->field_0x82.HWORD = this->y.HALF.HI;
|
||||
this->height.HALF.HI = -0x10;
|
||||
this->z.HALF.HI = -0x10;
|
||||
this->collisionLayer = 3;
|
||||
this->spriteRendering.b3 = 1;
|
||||
this->spritePriority.b0 = 2;
|
||||
@@ -70,13 +70,13 @@ NONMATCH("asm/non_matching/fallingBoulder/sub_0802C334.inc", void sub_0802C334(E
|
||||
return;
|
||||
}
|
||||
this->field_0x7c.HALF.LO = 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
}
|
||||
GetNextFrame(this);
|
||||
this->field_0x7c.HALF.HI = COORD_TO_TILE(this);
|
||||
if (sub_080044EC(this, *(u32*)&this->cutsceneBeh) == 1) {
|
||||
EnqueueSFX(0x14c);
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->field_0x7a.HWORD = 0xc;
|
||||
sub_0802C4B0(this);
|
||||
} else {
|
||||
@@ -86,7 +86,7 @@ NONMATCH("asm/non_matching/fallingBoulder/sub_0802C334.inc", void sub_0802C334(E
|
||||
u16 tmp = --this->field_0x7a.HWORD;
|
||||
switch (tmp) {
|
||||
case 0:
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
break;
|
||||
case 8:
|
||||
if (this->type2 != 0 && !sub_08049FA0(this)) {
|
||||
@@ -113,7 +113,7 @@ NONMATCH("asm/non_matching/fallingBoulder/sub_0802C334.inc", void sub_0802C334(E
|
||||
sub_080AEFB4(this);
|
||||
} else {
|
||||
sub_0806F69C(this);
|
||||
if (this->height.HALF.HI - y > 0x38) {
|
||||
if (this->z.HALF.HI - y > 0x38) {
|
||||
sub_0802C62C(this);
|
||||
this->field_0x7a.HWORD = (Random() & 0x7f) | 0x80;
|
||||
if (this->type == 3) {
|
||||
@@ -190,7 +190,7 @@ void sub_0802C4B0(Entity* this) {
|
||||
}
|
||||
|
||||
rand = Random() & 7;
|
||||
this->hVelocity = 0x20000;
|
||||
this->zVelocity = 0x20000;
|
||||
if (rand & 4) {
|
||||
if (rand & 3) {
|
||||
*(u32*)&this->cutsceneBeh = gUnk_080CD58C[offset | 1];
|
||||
@@ -210,8 +210,8 @@ void sub_0802C62C(Entity* this) {
|
||||
this->action = 1;
|
||||
this->y.HALF.HI = this->field_0x82.HWORD;
|
||||
this->x.HALF.HI = this->field_0x80.HWORD;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->flags &= ~0x80;
|
||||
this->spriteSettings.draw = 0;
|
||||
COLLISION_OFF(this);
|
||||
this->field_0x7c.HALF.LO = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ void sub_080453A4(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_080453BC(Entity* this) {
|
||||
if (this->currentHealth && this->cutsceneBeh.HALF.LO != this->currentHealth) {
|
||||
if (this->health && this->cutsceneBeh.HALF.LO != this->health) {
|
||||
this->action = 2;
|
||||
} else {
|
||||
sub_0804AA30(this, gUnk_080D17E8);
|
||||
@@ -41,9 +41,9 @@ void nullsub_172(void) {
|
||||
void sub_080453E8(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->speed = 0x80;
|
||||
this->cutsceneBeh.HALF.LO = this->currentHealth;
|
||||
this->cutsceneBeh.HALF.LO = this->health;
|
||||
this->field_0x3c |= 0x10;
|
||||
sub_0804A720(this);
|
||||
InitializeAnimation(this, 0);
|
||||
@@ -77,11 +77,11 @@ void sub_08045454(Entity* this) {
|
||||
off = gUnk_080D1810;
|
||||
for (i = 0; i < count; i++) {
|
||||
ent = entities[i];
|
||||
ent->attachedEntity = entities[(i + 1) % count];
|
||||
ent->child = entities[(i + 1) % count];
|
||||
ent->parent = entities[(i + count - 1) % count];
|
||||
tmp = 0;
|
||||
ent->type2 = 1;
|
||||
ent->height.HALF.HI = tmp;
|
||||
ent->z.HALF.HI = tmp;
|
||||
ent->iframes = -0x10;
|
||||
|
||||
/* Set MiniFireballGuy offset relative to killed slime. */
|
||||
@@ -101,7 +101,7 @@ u32 sub_0804A024(Entity*, u32, u32);
|
||||
void sub_08045524(Entity* this) {
|
||||
u32 tmp, tmp1, tmp2;
|
||||
|
||||
this->hVelocity = 0x1c000;
|
||||
this->zVelocity = 0x1c000;
|
||||
tmp = sub_0804A024(this, 1, 8);
|
||||
if (tmp != 0xff && (Random() & 3) == 0) {
|
||||
this->actionDelay = Random() & 3;
|
||||
|
||||
+12
-12
@@ -47,18 +47,18 @@ NONMATCH("asm/non_matching/gibdo/sub_080374A4.inc", void sub_080374A4(Entity* th
|
||||
}
|
||||
this->action = 0x8;
|
||||
this->actionDelay = 0x3c;
|
||||
this->flags &= 0x7F;
|
||||
COLLISION_OFF(this);
|
||||
sub_08037B48(this);
|
||||
} else {
|
||||
if (this->action != 0x6) {
|
||||
if (this->damageType == 0x27) {
|
||||
if (this->hitType == 0x27) {
|
||||
if (this->bitfield == 0x80) {
|
||||
sub_08037A14(this);
|
||||
}
|
||||
} else {
|
||||
if ((u8)(this->action - 1) < 2) {
|
||||
this->action = 1;
|
||||
x = DirectionTurnAround(this->knockbackDirection);
|
||||
x = DirectionTurnAround(DirectionRoundUp(this->knockbackDirection));
|
||||
this->direction = x;
|
||||
this->animationState = x >> 3;
|
||||
InitAnimationForceUpdate(this, this->animationState);
|
||||
@@ -148,12 +148,12 @@ void sub_08037624(Entity* this) {
|
||||
|
||||
void sub_08037690(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->field_0x76.HALF.HI = 0x14;
|
||||
sub_08037794(this);
|
||||
} else {
|
||||
if ((this->frames.all & 1) != 0) {
|
||||
this->damageType = 0x27;
|
||||
if ((this->frame & 1) != 0) {
|
||||
this->hitType = 0x27;
|
||||
ProcessMovement(this);
|
||||
}
|
||||
}
|
||||
@@ -167,7 +167,7 @@ NONMATCH("asm/non_matching/gibdo/sub_080376D0.inc", void sub_080376D0(Entity* th
|
||||
gPlayerState.field_0xa = gPlayerState.field_0xa | 0x80;
|
||||
CopyPositionAndSpriteOffset(&gPlayerEntity, this);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
x = &this->frames.all;
|
||||
x = &this->frame;
|
||||
if ((*x & 0x1) != 0) {
|
||||
if (!(--this->field_0x7c.BYTES.byte0)) {
|
||||
sub_08037A58(this);
|
||||
@@ -182,7 +182,7 @@ END_NONMATCH
|
||||
|
||||
void sub_0803773C(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
sub_08037794(this);
|
||||
}
|
||||
}
|
||||
@@ -202,7 +202,7 @@ void sub_0803775C(Entity* this) {
|
||||
void sub_08037794(Entity* this) {
|
||||
this->action = 1;
|
||||
this->field_0x74.HWORD = 0x1e;
|
||||
this->damageType = 0x26;
|
||||
this->hitType = 0x26;
|
||||
InitAnimationForceUpdate(this, this->animationState);
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ void sub_08037A58(Entity* this) {
|
||||
if (this->iframes == 0) {
|
||||
this->iframes = 0xec;
|
||||
}
|
||||
this->damageType = 0x26;
|
||||
this->hitType = 0x26;
|
||||
this->flags2 |= 1;
|
||||
this->iframes = 0xf4;
|
||||
this->knockbackDirection = DirectionFromAnimationState(this->animationState) ^ 0x10;
|
||||
@@ -396,7 +396,7 @@ NONMATCH("asm/non_matching/gibdo/sub_08037B48.inc", void sub_08037B48(Entity* th
|
||||
E->spriteOffsetY = 0xf5;
|
||||
E->parent = this;
|
||||
}
|
||||
this->attachedEntity = E;
|
||||
this->child = E;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
@@ -409,7 +409,7 @@ NONMATCH("asm/non_matching/gibdo/sub_08037C0C.inc", void sub_08037C0C(Entity* th
|
||||
this->actionDelay = 0xf;
|
||||
this->parent = that;
|
||||
}
|
||||
if (this->attachedEntity != 0) {
|
||||
if (this->child != 0) {
|
||||
this->actionDelay = 0xf;
|
||||
this->parent = that;
|
||||
}
|
||||
|
||||
+24
-24
@@ -93,7 +93,7 @@ void (*const gUnk_080D1AFC[8])(Entity*) = { sub_08046898, sub_08046910, sub_0804
|
||||
|
||||
void GyorgMale(Entity* this) {
|
||||
if (this->action) {
|
||||
this->spriteSettings.b.draw = this->field_0x7c.BYTES.byte1;
|
||||
this->spriteSettings.draw = this->field_0x7c.BYTES.byte1;
|
||||
}
|
||||
gUnk_080D1AFC[this->action](this);
|
||||
if (this->action != 7) {
|
||||
@@ -101,9 +101,9 @@ void GyorgMale(Entity* this) {
|
||||
}
|
||||
this->animationState = -(this->field_0x78.HWORD >> 8);
|
||||
sub_08048004(this);
|
||||
this->field_0x7c.BYTES.byte1 = this->spriteSettings.b.draw;
|
||||
if (this->spriteSettings.b.draw == 1 && (this->y.HALF.HI - gRoomControls.roomScrollY + 0x30) > 0x100u) {
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->field_0x7c.BYTES.byte1 = this->spriteSettings.draw;
|
||||
if (this->spriteSettings.draw == 1 && (this->y.HALF.HI - gRoomControls.roomScrollY + 0x30) > 0x100u) {
|
||||
this->spriteSettings.draw = 0;
|
||||
}
|
||||
this->cutsceneBeh.HWORD = gPlayerEntity.x.HALF.HI;
|
||||
this->field_0x86.HWORD = gPlayerEntity.y.HALF.HI;
|
||||
@@ -116,11 +116,11 @@ void sub_08046898(Entity* this) {
|
||||
return;
|
||||
tmp->type = 1;
|
||||
tmp->parent = this;
|
||||
this->attachedEntity = tmp;
|
||||
this->child = tmp;
|
||||
this->action = 1;
|
||||
this->subAction = 0;
|
||||
this->spriteRendering.b0 = 3;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->spriteOrientation.flipY = 2;
|
||||
this->spriteRendering.b3 = 2;
|
||||
this->field_0x3c |= 0x10;
|
||||
@@ -232,7 +232,7 @@ void (*const gUnk_080D1B38[5])(Entity*) = { sub_08046AE8, sub_08046B18, sub_0804
|
||||
|
||||
void sub_08046A9C(Entity* this) {
|
||||
if (this->animIndex == 1) {
|
||||
if (this->frames.all == 1) {
|
||||
if (this->frame == 1) {
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
}
|
||||
}
|
||||
@@ -315,7 +315,7 @@ void (*const gUnk_080D1B4C[5])(Entity*) = { sub_08046D44, sub_08046D98, sub_0804
|
||||
|
||||
void sub_08046CEC(Entity* this) {
|
||||
if (this->animIndex == 0) {
|
||||
if (this->frames.all == 1) {
|
||||
if (this->frame == 1) {
|
||||
InitAnimationForceUpdate(this, 1);
|
||||
}
|
||||
}
|
||||
@@ -418,7 +418,7 @@ void (*const gUnk_080D1B94[0xA])(Entity*) = { sub_08046FE8, sub_0804702C, sub_08
|
||||
|
||||
void sub_08046F64(Entity* this) {
|
||||
if (this->animIndex == 0) {
|
||||
if (this->frames.all == 1) {
|
||||
if (this->frame == 1) {
|
||||
InitAnimationForceUpdate(this, 1);
|
||||
}
|
||||
}
|
||||
@@ -580,13 +580,13 @@ void (*const gUnk_080D1BC0[7])(Entity*) = { sub_080473B8, sub_080473F0, sub_0804
|
||||
|
||||
void sub_0804736C(Entity* this) {
|
||||
if (this->animIndex == 1) {
|
||||
if (this->frames.all == 1) {
|
||||
if (this->frame == 1) {
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
}
|
||||
}
|
||||
gUnk_080D1BC0[this->subAction](this);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (this->currentHealth == 0) {
|
||||
if (this->health == 0) {
|
||||
this->action = 7;
|
||||
this->subAction = 0;
|
||||
}
|
||||
@@ -827,7 +827,7 @@ void sub_08047914(Entity* this) {
|
||||
|
||||
void sub_08047978(Entity* this) {
|
||||
sub_08047D88(this);
|
||||
if (this->currentHealth != 0) {
|
||||
if (this->health != 0) {
|
||||
if (--this->field_0x70.HALF_U.LO == 0) {
|
||||
this->field_0x70.HALF.HI = 1;
|
||||
if (this->type == 0) {
|
||||
@@ -858,9 +858,9 @@ void sub_08047978(Entity* this) {
|
||||
this->spriteRendering.b3 = 2;
|
||||
this->direction = this->animationState;
|
||||
}
|
||||
if (this->currentHealth != 0)
|
||||
if (this->health != 0)
|
||||
return;
|
||||
if (this->attachedEntity->action != 1)
|
||||
if (this->child->action != 1)
|
||||
return;
|
||||
this->subAction = 4;
|
||||
if (this->type == 0) {
|
||||
@@ -959,18 +959,18 @@ void sub_08047BF0(Entity* this) {
|
||||
} else {
|
||||
this->actionDelay--;
|
||||
if (this->actionDelay == 0x5A) {
|
||||
tmp = this->attachedEntity;
|
||||
tmp->spriteSettings.b.draw = 0;
|
||||
tmp = this->child;
|
||||
tmp->spriteSettings.draw = 0;
|
||||
CreateFx(tmp, FX_GIANT_EXPLOSION4, 0);
|
||||
} else {
|
||||
if (this->actionDelay == 0x3C) {
|
||||
tmp = this->attachedEntity->attachedEntity;
|
||||
tmp->spriteSettings.b.draw = 0;
|
||||
tmp = this->child->child;
|
||||
tmp->spriteSettings.draw = 0;
|
||||
CreateFx(tmp, FX_GIANT_EXPLOSION4, 0);
|
||||
} else {
|
||||
if (this->actionDelay == 0x1E) {
|
||||
tmp = this->attachedEntity->attachedEntity->attachedEntity;
|
||||
tmp->spriteSettings.b.draw = 0;
|
||||
tmp = this->child->child->child;
|
||||
tmp->spriteSettings.draw = 0;
|
||||
CreateFx(tmp, FX_GIANT_EXPLOSION4, 0);
|
||||
}
|
||||
}
|
||||
@@ -1012,7 +1012,7 @@ void sub_08047D88(Entity* this) {
|
||||
if (!sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x20))
|
||||
return;
|
||||
gPlayerState.field_0x14 = 1;
|
||||
if (gPlayerEntity.height.HALF.HI != 0)
|
||||
if (gPlayerEntity.z.HALF.HI != 0)
|
||||
return;
|
||||
this->field_0x7c.BYTES.byte0 |= 1;
|
||||
}
|
||||
@@ -1113,8 +1113,8 @@ void sub_08048004(Entity* this) {
|
||||
if (this->action == 0)
|
||||
return;
|
||||
if (this->animIndex == 0) {
|
||||
this->flags &= ~0x80;
|
||||
if (gPlayerEntity.height.HALF.HI != 0)
|
||||
COLLISION_OFF(this);
|
||||
if (gPlayerEntity.z.HALF.HI != 0)
|
||||
return;
|
||||
if (!sub_08079F8C())
|
||||
return;
|
||||
@@ -1151,7 +1151,7 @@ void sub_08048004(Entity* this) {
|
||||
this->field_0x7c.BYTES.byte0 = 0;
|
||||
}
|
||||
} else {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ void nullsub_7(Entity* this) {
|
||||
|
||||
void HangingSeed_Initialize(Entity* this) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->frameIndex = this->type;
|
||||
this->spriteRendering.b3 = 1;
|
||||
this->spritePriority.b0 = 3;
|
||||
|
||||
+12
-12
@@ -42,7 +42,7 @@ void sub_0802BBAC(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802BBC4(Entity* this) {
|
||||
if (this->damageType != 0x19) {
|
||||
if (this->hitType != 0x19) {
|
||||
switch (this->bitfield & 0x7f) {
|
||||
case 0:
|
||||
case 2:
|
||||
@@ -62,7 +62,7 @@ void sub_0802BBC4(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802BC20(Entity* this) {
|
||||
if (this->damageType != 0x19) {
|
||||
if (this->hitType != 0x19) {
|
||||
if (sub_0806F520(this)) {
|
||||
gUnk_080CD42C[this->subAction](this);
|
||||
}
|
||||
@@ -84,13 +84,13 @@ void sub_0802BCA0(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802BCA8(Entity* this) {
|
||||
if (this->damageType != 0x19) {
|
||||
if (this->hitType != 0x19) {
|
||||
Entity* ent;
|
||||
|
||||
this->action = 7;
|
||||
this->actionDelay = 0x5a;
|
||||
this->hVelocity = 0x18000;
|
||||
this->damageType = 0x19;
|
||||
this->zVelocity = 0x18000;
|
||||
this->hitType = 0x19;
|
||||
this->field_0x3a = this->field_0x3a & 0xfb;
|
||||
this->field_0x1c = 0x12;
|
||||
ent = CreateEnemy(HELMASAUR, 1);
|
||||
@@ -112,7 +112,7 @@ void sub_0802BD08(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802BD10(Entity* this) {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
UpdateAnimationVariableFrames(this, 2);
|
||||
}
|
||||
|
||||
@@ -121,11 +121,11 @@ void nullsub_145(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802BD28(Entity* this) {
|
||||
if (this->flags & 0x80) {
|
||||
this->flags |= 0x80;
|
||||
if (this->flags & ENT_COLLIDE) {
|
||||
COLLISION_ON(this);
|
||||
this->field_0x3a &= ~0x4;
|
||||
} else {
|
||||
this->currentHealth = 0;
|
||||
this->health = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ void sub_0802BF98(Entity* this) {
|
||||
} else {
|
||||
this->action = 2;
|
||||
this->actionDelay = 30;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ void sub_0802BFE0(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802BFF4(Entity* this) {
|
||||
this->spriteSettings.b.draw ^= 1;
|
||||
this->spriteSettings.draw ^= 1;
|
||||
if (--this->actionDelay == 0) {
|
||||
DeleteEntity(this);
|
||||
}
|
||||
@@ -369,7 +369,7 @@ void sub_0802C1CC(Entity* this) {
|
||||
void sub_0802C218(Entity* this) {
|
||||
this->action = 6;
|
||||
this->speed = 0xe0;
|
||||
this->hVelocity = 0x18000;
|
||||
this->zVelocity = 0x18000;
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
|
||||
+9
-9
@@ -40,7 +40,7 @@ void sub_080323F4(Entity* this) {
|
||||
if (this->action != 3 && this->action != 4) {
|
||||
this->action = 3;
|
||||
this->actionDelay = 0xC;
|
||||
this->direction = DirectionTurnAround(this->knockbackDirection);
|
||||
this->direction = DirectionTurnAround(DirectionRoundUp(this->knockbackDirection));
|
||||
InitAnimationForceUpdate(this, this->direction >> 3);
|
||||
} else if (this->bitfield == 0xCC) {
|
||||
if (this->field_0x43 == 0) {
|
||||
@@ -82,7 +82,7 @@ void sub_0803248C(Entity* this) {
|
||||
void sub_080324CC(Entity* this) {
|
||||
if (sub_080325E8(this) == 0) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
sub_080326FC(this);
|
||||
sub_08032740(this);
|
||||
}
|
||||
@@ -118,7 +118,7 @@ void sub_080324FC(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08032574(Entity* this) {
|
||||
if (this->attachedEntity && (this->attachedEntity->bitfield & 0x80)) {
|
||||
if (this->child && (this->child->bitfield & 0x80)) {
|
||||
sub_0803275C(this);
|
||||
return;
|
||||
}
|
||||
@@ -144,10 +144,10 @@ void sub_080325C4(Entity* this) {
|
||||
u32 sub_080325E8(Entity* this) {
|
||||
if (((sub_08049FA0(this) != 0) && (sub_08049FDC(this, 1) != 0)) &&
|
||||
(sub_080041A0(this, gUnk_020000B0, 0x68, 0x40) != 0)) {
|
||||
if (((GetFacingDirection(this, gUnk_020000B0) - (DirectionRound(this->frames.all)) + 2) & 0x1F) < 5) {
|
||||
if (((GetFacingDirection(this, gUnk_020000B0) - (DirectionRound(this->frame)) + 2) & 0x1F) < 5) {
|
||||
this->action = 3;
|
||||
this->actionDelay = 0xC;
|
||||
this->direction = DirectionRound(this->frames.all);
|
||||
this->direction = DirectionRound(this->frame);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -236,13 +236,13 @@ void sub_080327C8(Entity* this) {
|
||||
child = CreateProjectileWithParent(this, 11, 0);
|
||||
if (child != NULL) {
|
||||
child->parent = this;
|
||||
this->attachedEntity = child;
|
||||
this->child = child;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080327E0(Entity* this) {
|
||||
if (this->attachedEntity != NULL) {
|
||||
this->attachedEntity->parent = NULL;
|
||||
this->attachedEntity = NULL;
|
||||
if (this->child != NULL) {
|
||||
this->child->parent = NULL;
|
||||
this->child = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -59,7 +59,7 @@ void Keese_Initialize(Entity* this) {
|
||||
sub_0804A720(this);
|
||||
if (this->type != 0) {
|
||||
this->spritePriority.b1 = 1;
|
||||
this->height.HALF.HI = -0x10;
|
||||
this->z.HALF.HI = -0x10;
|
||||
}
|
||||
this->direction = Random() & 0x1f;
|
||||
this->field_0x1c = 1;
|
||||
@@ -77,12 +77,12 @@ void Keese_Fly(Entity* this) {
|
||||
this->field_0x7a.HWORD--;
|
||||
}
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.b.f3) != 0) {
|
||||
if (this->frame & 0x80) {
|
||||
sub_08021F24(this);
|
||||
} else {
|
||||
sub_080AEFB4(this);
|
||||
}
|
||||
this->spriteOffsetY = gKeeseSpriteOffsets[this->frames.all];
|
||||
this->spriteOffsetY = gKeeseSpriteOffsets[this->frame];
|
||||
}
|
||||
|
||||
void Keese_Rest(Entity* this) {
|
||||
|
||||
+26
-26
@@ -57,11 +57,11 @@ void Lakitu_DoAction(Entity* this) {
|
||||
|
||||
void sub_0803C784(Entity* this) {
|
||||
if ((this->bitfield & 0x7f) == 0x1d) {
|
||||
this->hVelocity = 0x20000;
|
||||
this->zVelocity = 0x20000;
|
||||
|
||||
sub_0803CBAC(this);
|
||||
} else {
|
||||
if (this->damageType == 0x43) {
|
||||
if (this->hitType == 0x43) {
|
||||
Entity* fx = CreateFx(this, FX_DEATH, 0);
|
||||
|
||||
if (fx != NULL) {
|
||||
@@ -104,7 +104,7 @@ void sub_0803C844(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0803C850(Entity* this) {
|
||||
Entity* cloud = this->attachedEntity;
|
||||
Entity* cloud = this->child;
|
||||
if (cloud != NULL) {
|
||||
cloud->spriteOffsetX = this->spriteOffsetX;
|
||||
}
|
||||
@@ -114,7 +114,7 @@ void sub_0803C850(Entity* this) {
|
||||
|
||||
void sub_0803C86C(Entity* this) {
|
||||
sub_0803CBAC(this);
|
||||
this->attachedEntity = NULL;
|
||||
this->child = NULL;
|
||||
}
|
||||
|
||||
void Lakitu_Initialize(Entity* this) {
|
||||
@@ -124,13 +124,13 @@ void Lakitu_Initialize(Entity* this) {
|
||||
}
|
||||
|
||||
cloud->parent = this;
|
||||
this->attachedEntity = cloud;
|
||||
this->child = cloud;
|
||||
|
||||
sub_0804A720(this);
|
||||
|
||||
this->action = HIDDEN;
|
||||
|
||||
this->height.HALF.HI = -2;
|
||||
this->z.HALF.HI = -2;
|
||||
|
||||
this->spriteOffsetY = 0xff;
|
||||
|
||||
@@ -143,18 +143,18 @@ void Lakitu_Hide(Entity* this) {
|
||||
|
||||
if (sub_0803CA4C(this)) {
|
||||
this->action = 2;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void Lakitu_EndHide(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
|
||||
if (this->frames.b.f3) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = IDLE;
|
||||
this->actionDelay = 0x3c;
|
||||
|
||||
this->damageType = 0x42;
|
||||
this->hitType = 0x42;
|
||||
|
||||
InitAnimationForceUpdate(this, this->animationState + 4);
|
||||
}
|
||||
@@ -168,7 +168,7 @@ void Lakitu_Idle(Entity* this) {
|
||||
if (!sub_0803CA4C(this)) {
|
||||
this->action = BEGIN_HIDE;
|
||||
|
||||
this->damageType = 0x43;
|
||||
this->hitType = 0x43;
|
||||
InitAnimationForceUpdate(this, this->animationState + 0xc);
|
||||
} else {
|
||||
sub_0803CA84(this, 4);
|
||||
@@ -178,9 +178,9 @@ void Lakitu_Idle(Entity* this) {
|
||||
void Lakitu_BeginHide(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
|
||||
if (this->frames.b.f3 != 0) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
|
||||
InitAnimationForceUpdate(this, this->animationState);
|
||||
}
|
||||
@@ -189,14 +189,14 @@ void Lakitu_BeginHide(Entity* this) {
|
||||
void Lakitu_Lightning(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
|
||||
if (this->frames.b.f3 == 0) {
|
||||
if (!(this->frame & 0x80)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Lakitu_SpawnLightning(this);
|
||||
|
||||
this->action = LIGHTNING_DELAY;
|
||||
this->damageType = 0x42;
|
||||
this->hitType = 0x42;
|
||||
|
||||
if ((Random() & 1) && !this->field_0x78.HALF.HI) {
|
||||
this->actionDelay = 0xf;
|
||||
@@ -207,7 +207,7 @@ void Lakitu_Lightning(Entity* this) {
|
||||
|
||||
this->field_0x78.HALF.HI = FALSE;
|
||||
|
||||
InitAnimationForceUpdate(this->attachedEntity, this->animationState);
|
||||
InitAnimationForceUpdate(this->child, this->animationState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ void sub_0803CA84(Entity* this, u32 unkParameter) {
|
||||
this->animationState = altAnimState;
|
||||
|
||||
InitAnimationForceUpdate(this, altAnimState + unkParameter);
|
||||
InitAnimationForceUpdate(this->attachedEntity, altAnimState);
|
||||
InitAnimationForceUpdate(this->child, altAnimState);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -284,7 +284,7 @@ bool32 sub_0803CB04(Entity* this) {
|
||||
sub_0803CB34(this);
|
||||
this->field_0x78.HALF.HI = delay;
|
||||
|
||||
InitAnimationForceUpdate(this->attachedEntity, this->animationState + 4);
|
||||
InitAnimationForceUpdate(this->child, this->animationState + 4);
|
||||
returnValue = 1;
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ bool32 sub_0803CB04(Entity* this) {
|
||||
|
||||
void sub_0803CB34(Entity* this) {
|
||||
this->action = LIGHTNING_THROW;
|
||||
this->damageType = 0xa6;
|
||||
this->hitType = 0xa6;
|
||||
|
||||
this->field_0x78.HALF.LO = GetFacingDirection(this, &gPlayerEntity);
|
||||
|
||||
@@ -322,20 +322,20 @@ void Lakitu_SpawnLightning(Entity* this) {
|
||||
void sub_0803CBAC(Entity* this) {
|
||||
Entity* cloud;
|
||||
|
||||
cloud = this->attachedEntity;
|
||||
cloud = this->child;
|
||||
if (cloud != NULL) {
|
||||
cloud->flags |= 0x80;
|
||||
cloud->damageType = 0x43;
|
||||
cloud->hitType = 0x43;
|
||||
}
|
||||
|
||||
this->action = CLOUDLESS;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
|
||||
this->spritePriority.b1 = 1;
|
||||
|
||||
this->flags2 &= 0x7b;
|
||||
|
||||
this->damageType = 0x42;
|
||||
this->hitType = 0x42;
|
||||
|
||||
InitAnimationForceUpdate(this, this->animationState + 16);
|
||||
}
|
||||
@@ -344,16 +344,16 @@ void sub_0803CC08(Entity* this) {
|
||||
Entity* cloud;
|
||||
Entity* fx;
|
||||
|
||||
cloud = this->attachedEntity;
|
||||
cloud = this->child;
|
||||
if (cloud == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((u32)(cloud->height.HALF.HI - this->height.HALF.HI) > 2) {
|
||||
if ((u32)(cloud->z.HALF.HI - this->z.HALF.HI) > 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->hVelocity >= 0) {
|
||||
if (this->zVelocity >= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@ void sub_0803CC08(Entity* this) {
|
||||
fx->y.HALF.HI -= 6;
|
||||
}
|
||||
|
||||
this->attachedEntity = NULL;
|
||||
this->child = NULL;
|
||||
DeleteEntity(cloud);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,11 +65,11 @@ void sub_0803CD6C(Entity* this) {
|
||||
Entity* lakitu;
|
||||
|
||||
this->action = 1;
|
||||
this->height.HALF.HI = -2;
|
||||
this->z.HALF.HI = -2;
|
||||
|
||||
// Set parent to lakitu
|
||||
lakitu = GetCurrentRoomProperty(this->type);
|
||||
this->attachedEntity = lakitu;
|
||||
this->child = lakitu;
|
||||
this->parent = lakitu;
|
||||
|
||||
this->field_0x78.HWORD = this->x.HALF.HI;
|
||||
@@ -96,25 +96,25 @@ void sub_0803CDD8(Entity* this) {
|
||||
u8 one;
|
||||
u8 draw;
|
||||
|
||||
draw = this->spriteSettings.b.draw;
|
||||
draw = this->spriteSettings.draw;
|
||||
one = 1;
|
||||
this->spriteSettings.b.draw = draw ^ one;
|
||||
this->spriteSettings.draw = draw ^ one;
|
||||
|
||||
this->actionDelay--;
|
||||
|
||||
if (this->actionDelay == 0) {
|
||||
this->action = 1;
|
||||
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
|
||||
this->spriteSettings.b.draw = one;
|
||||
this->spriteSettings.draw = one;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0803CE14(Entity* this) {
|
||||
u8 direction;
|
||||
|
||||
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74.HWORD);
|
||||
sub_080A2CC0(this, &this->child, &this->field_0x74.HWORD);
|
||||
|
||||
direction = this->direction;
|
||||
if (direction & 0x80) {
|
||||
@@ -132,14 +132,14 @@ void sub_0803CE3C(Entity* this) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 60;
|
||||
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
|
||||
this->field_0x3a &= 0xfb;
|
||||
|
||||
this->x.HALF.HI = this->field_0x78.HWORD;
|
||||
this->y.HALF.HI = this->field_0x7a.HWORD;
|
||||
|
||||
this->attachedEntity = this->parent;
|
||||
this->child = this->parent;
|
||||
|
||||
sub_0803CE14(this);
|
||||
}
|
||||
|
||||
+9
-9
@@ -69,7 +69,7 @@ void Leever_Idle(Entity* this) {
|
||||
if (--this->actionDelay == 0) {
|
||||
if (Leever_PlayerInRange(this, Random() & 0x1f)) {
|
||||
this->action = 2;
|
||||
this->spriteSettings.b.draw = TRUE;
|
||||
this->spriteSettings.draw = TRUE;
|
||||
this->direction = (GetFacingDirection(this, gUnk_020000B0) + gLeeverDrift[Random() & 1]) & 0x1f;
|
||||
InitializeAnimation(this, LeeverAnimation_DigUp);
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
@@ -82,7 +82,7 @@ void Leever_Idle(Entity* this) {
|
||||
void Leever_DigUp(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
|
||||
if (this->frames.b.f3 != 0) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 3;
|
||||
if (this->type == LeeverForm_Red) {
|
||||
this->field_0x74.HWORD = 180;
|
||||
@@ -90,9 +90,9 @@ void Leever_DigUp(Entity* this) {
|
||||
this->field_0x74.HWORD = 110;
|
||||
}
|
||||
InitializeAnimation(this, LeeverAnimation_Attack);
|
||||
} else if (this->frames.b.f0 != 0) {
|
||||
this->frames.all &= 0xfe;
|
||||
this->flags |= 0x80;
|
||||
} else if ((this->frame & 1) != 0) {
|
||||
this->frame &= 0xfe;
|
||||
COLLISION_ON(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ void Leever_Attack(Entity* this) {
|
||||
|
||||
if (--this->field_0x74.HWORD == 0) {
|
||||
this->action = 4;
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, LeeverAnimation_DigDown);
|
||||
}
|
||||
}
|
||||
@@ -110,10 +110,10 @@ void Leever_Attack(Entity* this) {
|
||||
void Leever_DigDown(Entity* this) {
|
||||
Leever_Move(this);
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.b.f3) != 0) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0xf0;
|
||||
this->spriteSettings.b.draw = FALSE;
|
||||
this->spriteSettings.draw = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ void Leever_Move(Entity* this) {
|
||||
this->field_0x74.HWORD = 1;
|
||||
}
|
||||
|
||||
this->speed = (this->frames.all & 0xf) * 0x20;
|
||||
this->speed = (this->frame & 0xf) * 0x20;
|
||||
if (this->type == LeeverForm_Red) {
|
||||
if ((this->field_0xf++ & 0xf) == 0) {
|
||||
sub_08004596(this, sub_0800132C(this, gUnk_020000B0));
|
||||
|
||||
+18
-18
@@ -26,10 +26,10 @@ void sub_08027D8C(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08027DA4(Entity* this) {
|
||||
if (this->damageType == 1) {
|
||||
if (this->hitType == 1) {
|
||||
this->action = 3;
|
||||
this->flags &= ~0x80;
|
||||
this->damageType = 0x8c;
|
||||
COLLISION_OFF(this);
|
||||
this->hitType = 0x8c;
|
||||
} else {
|
||||
if (this->action == 7) {
|
||||
sub_0802810C(this);
|
||||
@@ -45,7 +45,7 @@ void sub_08027DA4(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
if (this->currentHealth == 0) {
|
||||
if (this->health == 0) {
|
||||
this->actionDelay = 0x20;
|
||||
}
|
||||
|
||||
@@ -74,21 +74,21 @@ void sub_08027E70(Entity* this) {
|
||||
switch (this->type) {
|
||||
case 0:
|
||||
this->action = 3;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->flags = this->flags & 0x7f;
|
||||
this->spriteSettings.draw = 0;
|
||||
COLLISION_OFF(this);
|
||||
this->actionDelay = 0;
|
||||
break;
|
||||
case 1:
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->actionDelay = 8;
|
||||
InitializeAnimation(this, 1);
|
||||
break;
|
||||
case 2:
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
this->actionDelay = 0;
|
||||
this->damageType = 1;
|
||||
this->hitType = 1;
|
||||
InitializeAnimation(this, 0);
|
||||
break;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ void sub_08027E70(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08027EFC(Entity* this) {
|
||||
if (this->damageType == 1)
|
||||
if (this->hitType == 1)
|
||||
return;
|
||||
|
||||
if (sub_08049FDC(this, 1)) {
|
||||
@@ -120,7 +120,7 @@ void sub_08027EFC(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
} else {
|
||||
this->action = 6;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, 2);
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ void nullsub_12(Entity* this) {
|
||||
void sub_08027F84(Entity* this) {
|
||||
if (sub_08049FDC(this, 1)) {
|
||||
this->action = 5;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
InitializeAnimation(this, 0);
|
||||
CreateDust(this);
|
||||
}
|
||||
@@ -149,9 +149,9 @@ void sub_08027FB4(Entity* this) {
|
||||
|
||||
void sub_08027FE0(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 1) {
|
||||
if (this->frame & 1) {
|
||||
this->action = 1;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->direction = sub_08049F84(this, 1);
|
||||
this->actionDelay = 8;
|
||||
this->spritePriority.b1 = 1;
|
||||
@@ -161,9 +161,9 @@ void sub_08027FE0(Entity* this) {
|
||||
|
||||
void sub_0802802C(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 1) {
|
||||
if (this->frame & 1) {
|
||||
this->action = 3;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
this->direction = 0;
|
||||
this->actionDelay = 0;
|
||||
CreateDust(this);
|
||||
@@ -209,11 +209,11 @@ NONMATCH("asm/non_matching/likeLike/sub_0802810C.inc", void sub_0802810C(Entity*
|
||||
gPlayerState.field_0xa = 0;
|
||||
gPlayerState.flags &= 0xffffffef;
|
||||
gPlayerEntity.flags |= 0x80;
|
||||
gPlayerEntity.hVelocity = 0x18000;
|
||||
gPlayerEntity.zVelocity = 0x18000;
|
||||
gPlayerEntity.iframes = -60;
|
||||
gPlayerEntity.direction = gPlayerEntity.animationState << 2;
|
||||
gPlayerEntity.spritePriority.b1 = this->field_0x82.HALF.HI;
|
||||
gPlayerEntity.height.HALF.HI = gPlayerEntity.spriteOffsetY;
|
||||
gPlayerEntity.z.HALF.HI = gPlayerEntity.spriteOffsetY;
|
||||
gPlayerEntity.spriteOffsetY = 0;
|
||||
this->action = 4;
|
||||
this->actionDelay = 0x50;
|
||||
|
||||
+26
-26
@@ -55,11 +55,11 @@ void sub_080298A4(Entity* this) {
|
||||
default:
|
||||
this->action = 2;
|
||||
this->actionDelay = 0;
|
||||
this->damageType = 0x6b;
|
||||
this->hitType = 0x6b;
|
||||
this->field_0x76.HALF.HI = 0;
|
||||
sub_0801D2B4(this, 0x7f);
|
||||
EnqueueSFX(0xfe);
|
||||
this->attachedEntity->action = 2;
|
||||
this->child->action = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -86,36 +86,36 @@ void sub_0802999C(Entity* this) {
|
||||
ent1 = CreateEnemy(MADDERPILLAR, 1);
|
||||
ent1->parent = this;
|
||||
PositionRelative(this, ent1, 0, 5);
|
||||
this->attachedEntity = ent1;
|
||||
this->child = ent1;
|
||||
|
||||
ent2 = CreateEnemy(MADDERPILLAR, 2);
|
||||
ent2->parent = this;
|
||||
PositionRelative(this, ent2, 0, 4);
|
||||
ent1->attachedEntity = ent2;
|
||||
ent1->child = ent2;
|
||||
|
||||
ent3 = CreateEnemy(MADDERPILLAR, 3);
|
||||
ent3->parent = this;
|
||||
PositionRelative(this, ent3, 0, 3);
|
||||
ent2->attachedEntity = ent3;
|
||||
ent2->child = ent3;
|
||||
|
||||
ent4 = CreateEnemy(MADDERPILLAR, 4);
|
||||
ent4->parent = this;
|
||||
PositionRelative(this, ent4, 0, 2);
|
||||
ent3->attachedEntity = ent4;
|
||||
ent3->child = ent4;
|
||||
|
||||
ent5 = CreateEnemy(MADDERPILLAR, 5);
|
||||
ent5->parent = this;
|
||||
PositionRelative(this, ent5, 0, 1);
|
||||
ent4->attachedEntity = ent5;
|
||||
ent4->child = ent5;
|
||||
|
||||
ent6 = CreateEnemy(MADDERPILLAR, 6);
|
||||
ent6->attachedEntity = this;
|
||||
ent6->child = this;
|
||||
ent6->parent = this;
|
||||
PositionRelative(this, ent6, 0, 0);
|
||||
ent5->attachedEntity = ent6;
|
||||
ent5->child = ent6;
|
||||
|
||||
this->action = 1;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->direction = DirectionRound(Random());
|
||||
this->speed = 0xa0;
|
||||
this->animationState = 0xff;
|
||||
@@ -138,7 +138,7 @@ void sub_08029AA4(Entity* this) {
|
||||
if (this->field_0x76.HALF.HI != 0) {
|
||||
this->action = 3;
|
||||
this->speed = 0x108;
|
||||
this->damageType = 0x6a;
|
||||
this->hitType = 0x6a;
|
||||
this->field_0x7a.HWORD = 0x168;
|
||||
this->field_0x74.HALF.HI = 4;
|
||||
sub_08029EEC(this);
|
||||
@@ -168,7 +168,7 @@ void sub_08029B2C(Entity* this) {
|
||||
DeleteEntity(this);
|
||||
}
|
||||
} else {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->actionDelay = -(this->type * 15 - 90);
|
||||
this->field_0x86.HALF.LO = 1;
|
||||
}
|
||||
@@ -179,7 +179,7 @@ void sub_08029B2C(Entity* this) {
|
||||
|
||||
void sub_08029B90(Entity* this) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
sub_0802A058(this);
|
||||
if (this->type < 2) {
|
||||
InitializeAnimation(this, 0);
|
||||
@@ -210,8 +210,8 @@ void sub_08029BC4(Entity* this) {
|
||||
void sub_08029C08(Entity* this) {
|
||||
this->action = 3;
|
||||
this->actionDelay = gUnk_080CCDA0[this->type];
|
||||
this->damageType = 0x6b;
|
||||
this->attachedEntity->action = 2;
|
||||
this->hitType = 0x6b;
|
||||
this->child->action = 2;
|
||||
}
|
||||
|
||||
void sub_08029C2C(Entity* this) {
|
||||
@@ -225,7 +225,7 @@ void sub_08029C2C(Entity* this) {
|
||||
void sub_08029C50(Entity* this) {
|
||||
if (this->parent->field_0x76.HALF.HI != 0) {
|
||||
this->action = 5;
|
||||
this->damageType = 0x6a;
|
||||
this->hitType = 0x6a;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ void sub_08029C98(Entity* this) {
|
||||
|
||||
void sub_08029CCC(Entity* this) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
sub_0802A058(this);
|
||||
InitializeAnimation(this, 8);
|
||||
}
|
||||
@@ -276,10 +276,10 @@ void sub_08029D14(Entity* this) {
|
||||
}
|
||||
} else {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 4;
|
||||
this->actionDelay = 0x78;
|
||||
this->damageType = 0x6c;
|
||||
this->hitType = 0x6c;
|
||||
this->hitbox = &gUnk_080FD298;
|
||||
EnqueueSFX(0x6b);
|
||||
}
|
||||
@@ -290,7 +290,7 @@ void sub_08029D78(Entity* this) {
|
||||
sub_0802A0F8(this);
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 5;
|
||||
this->damageType = 0x6a;
|
||||
this->hitType = 0x6a;
|
||||
this->hitbox = (Hitbox*)&gUnk_080FD2A0;
|
||||
InitializeAnimation(this, this->animationState + 0x10);
|
||||
}
|
||||
@@ -298,7 +298,7 @@ void sub_08029D78(Entity* this) {
|
||||
|
||||
void sub_08029DAC(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 6;
|
||||
this->parent->field_0x76.HALF.HI = 1;
|
||||
InitializeAnimation(this, this->animationState + 8);
|
||||
@@ -378,7 +378,7 @@ bool32 sub_08029F48(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08029FB4(Entity* this, u32 x, u32 y) {
|
||||
u8* dst = (u8*)&this->attachedEntity->field_0x78;
|
||||
u8* dst = (u8*)&this->child->field_0x78;
|
||||
s32 unk = this->parent->field_0x7c.BYTES.byte2;
|
||||
u8 idx = unk % 0xe;
|
||||
dst[idx] = ((x + 8) & 0xf) | (((y + 8) & 0xf) << 4);
|
||||
@@ -458,18 +458,18 @@ void sub_0802A098(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802A0F8(Entity* this) {
|
||||
if (this->currentHealth != 0) {
|
||||
if (this->health != 0) {
|
||||
if ((this->bitfield & 0x80) && this->iframes != 0) {
|
||||
Entity* ent = this;
|
||||
u32 i;
|
||||
for (i = 0; i < 6; i++) {
|
||||
ent = ent->attachedEntity;
|
||||
ent = ent->child;
|
||||
ent->iframes = this->iframes;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->parent->flags &= ~0x80;
|
||||
this->parent->currentHealth = 0;
|
||||
this->parent->health = 0;
|
||||
this->parent->field_0xf = 0x69;
|
||||
}
|
||||
}
|
||||
@@ -477,7 +477,7 @@ void sub_0802A0F8(Entity* this) {
|
||||
bool32 sub_0802A14C(Entity* this) {
|
||||
u32 ret = FALSE;
|
||||
|
||||
if (this->parent->currentHealth == 0 || this->field_0x86.HALF.LO) {
|
||||
if (this->parent->health == 0 || this->field_0x86.HALF.LO) {
|
||||
ret = TRUE;
|
||||
} else {
|
||||
ret = FALSE;
|
||||
|
||||
+156
-156
@@ -143,21 +143,21 @@ NONMATCH("asm/non_matching/mazaal/sub_0803A188.inc", void sub_0803A188(Entity* t
|
||||
if (this->action != 0x2b) {
|
||||
if ((0 < this->iframes) && ((this->bitfield == 0x95 || (this->bitfield == 0x8e)))) {
|
||||
this->action = 0x28;
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
pEVar3 = this->parent;
|
||||
pEVar3->field_0x7c.BYTES.byte1 = pEVar3->field_0x7c.BYTES.byte1 | (this->type == 0 ? 1 : 2);
|
||||
pEVar3->field_0x80.HALF.LO = (this->type == 0 ? 1 : 2) | pEVar3->field_0x80.HALF.LO;
|
||||
this->attachedEntity->iframes = this->iframes;
|
||||
this->child->iframes = this->iframes;
|
||||
entity74 = *(Entity**)&this->field_0x74;
|
||||
entity74->iframes = this->iframes;
|
||||
SoundReq(SFX_BOSS_HIT);
|
||||
}
|
||||
} else {
|
||||
this->attachedEntity->iframes = this->iframes;
|
||||
this->child->iframes = this->iframes;
|
||||
entity74 = *(Entity**)&this->field_0x74;
|
||||
entity74->iframes = this->iframes;
|
||||
InitializeAnimation(this, 0x18);
|
||||
InitAnimationForceUpdate(this->attachedEntity, 9);
|
||||
InitAnimationForceUpdate(this->child, 9);
|
||||
SoundReq(SFX_BOSS_HIT);
|
||||
}
|
||||
}
|
||||
@@ -180,32 +180,32 @@ void sub_0803A274(Entity* this) {
|
||||
if (this->type == 0) {
|
||||
pEVar1 = CreateEnemy(MAZAAL_HAND, 0);
|
||||
pEVar1->parent = this;
|
||||
this->attachedEntity = pEVar1;
|
||||
this->child = pEVar1;
|
||||
pEVar1 = CreateEnemy(MAZAAL_BRACELET, 2);
|
||||
pEVar1->parent = this;
|
||||
*(Entity**)&this->field_0x74 = pEVar1;
|
||||
pEVar1 = CreateObject(OBJECT_7E, 1, 0);
|
||||
pEVar1->parent = this;
|
||||
pEVar1->attachedEntity = this->attachedEntity;
|
||||
pEVar1->child = this->child;
|
||||
PositionRelative(this->parent, this, 0x100000, 0x200000);
|
||||
} else {
|
||||
pEVar1 = CreateEnemy(MAZAAL_HAND, 1);
|
||||
pEVar1->parent = this;
|
||||
this->attachedEntity = pEVar1;
|
||||
this->child = pEVar1;
|
||||
pEVar1 = CreateEnemy(MAZAAL_BRACELET, 3);
|
||||
pEVar1->parent = this;
|
||||
*(Entity**)&this->field_0x74 = pEVar1;
|
||||
pEVar1 = CreateObject(OBJECT_7E, 2, 0);
|
||||
pEVar1->parent = this;
|
||||
pEVar1->attachedEntity = this->attachedEntity;
|
||||
this->spriteSettings.b.flipX = 1;
|
||||
pEVar1->child = this->child;
|
||||
this->spriteSettings.flipX = 1;
|
||||
PositionRelative(this->parent, this, -0x100000, 0x200000);
|
||||
}
|
||||
if (gScreenTransition.field_0x38 != 0) {
|
||||
this->action = 3;
|
||||
this->flags |= 0x80;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->attachedEntity->spriteSettings.b.draw = 1;
|
||||
COLLISION_ON(this);
|
||||
this->spriteSettings.draw = 1;
|
||||
this->child->spriteSettings.draw = 1;
|
||||
InitializeAnimation(this, 0x10);
|
||||
} else {
|
||||
this->action = 1;
|
||||
@@ -222,25 +222,25 @@ void sub_0803A364(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
switch (this->subAction & 0x7f) {
|
||||
case 0:
|
||||
case 2:
|
||||
break;
|
||||
case 1:
|
||||
this->subAction = 2;
|
||||
pEVar3 = this->attachedEntity;
|
||||
pEVar3->spriteSettings.b.draw = 1;
|
||||
pEVar3 = this->child;
|
||||
pEVar3->spriteSettings.draw = 1;
|
||||
pEVar3->spriteRendering.alphaBlend = 1;
|
||||
break;
|
||||
case 3:
|
||||
this->subAction = 4;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->attachedEntity->spriteRendering.alphaBlend = 0;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->child->spriteRendering.alphaBlend = 0;
|
||||
break;
|
||||
case 4:
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->subAction = 5;
|
||||
}
|
||||
break;
|
||||
@@ -263,16 +263,16 @@ void sub_0803A364(Entity* this) {
|
||||
break;
|
||||
case 7:
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->subAction = 8;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
InitAnimationForceUpdate(this->attachedEntity, 8);
|
||||
this->spriteSettings.draw = 0;
|
||||
InitAnimationForceUpdate(this->child, 8);
|
||||
SoundReq(SFX_16E);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
sub_0803B55C(this);
|
||||
if ((this->attachedEntity->frames.all & 0x80) == 0) {
|
||||
if ((this->child->frame & 0x80) == 0) {
|
||||
return;
|
||||
}
|
||||
uVar1 = 9;
|
||||
@@ -283,20 +283,20 @@ void sub_0803A364(Entity* this) {
|
||||
this->actionDelay--;
|
||||
if (this->actionDelay == 0) {
|
||||
this->subAction = 10;
|
||||
InitAnimationForceUpdate(this->attachedEntity, 6);
|
||||
InitAnimationForceUpdate(this->child, 6);
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
sub_0803B55C(this);
|
||||
if ((this->attachedEntity->frames.all & 0x80) != 0) {
|
||||
if ((this->child->frame & 0x80) != 0) {
|
||||
this->subAction = 0xb;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
InitializeAnimation(this, 4);
|
||||
}
|
||||
break;
|
||||
case 0xb:
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) == 0) {
|
||||
if ((this->frame & 0x80) == 0) {
|
||||
return;
|
||||
}
|
||||
if (this->type2 != 0) {
|
||||
@@ -312,7 +312,7 @@ void sub_0803A364(Entity* this) {
|
||||
default:
|
||||
this->actionDelay--;
|
||||
if (this->actionDelay == 0) {
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
sub_0803B4D4(this);
|
||||
}
|
||||
break;
|
||||
@@ -327,7 +327,7 @@ void sub_0803A548(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
if (sub_0803B4E4(this) == 0) {
|
||||
sub_0806F69C(this);
|
||||
}
|
||||
@@ -339,7 +339,7 @@ void sub_0803A58C(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
if (sub_0803B4E4(this) != 0) {
|
||||
sub_0803B59C(this);
|
||||
} else {
|
||||
@@ -352,10 +352,10 @@ void sub_0803A5D0(Entity* this) {
|
||||
s8* ptr;
|
||||
|
||||
this->action = 5;
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
InitializeAnimation(this, 5);
|
||||
}
|
||||
|
||||
@@ -365,12 +365,12 @@ void sub_0803A60C(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->action = 6;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
InitAnimationForceUpdate(this->attachedEntity, 8);
|
||||
this->spriteSettings.draw = 0;
|
||||
InitAnimationForceUpdate(this->child, 8);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -381,10 +381,10 @@ void sub_0803A660(Entity* this) {
|
||||
s8* ptr;
|
||||
u32 index;
|
||||
|
||||
pbVar3 = &this->attachedEntity->frames.all;
|
||||
pbVar3 = &this->child->frame;
|
||||
if ((*pbVar3 & 0x80) != 0) {
|
||||
if (this->height.HALF.HI > -0x50) {
|
||||
this->height.HALF.HI = this->height.HALF.HI - 2;
|
||||
if (this->z.HALF.HI > -0x50) {
|
||||
this->z.HALF.HI = this->z.HALF.HI - 2;
|
||||
} else {
|
||||
this->action = 7;
|
||||
this->actionDelay = 0;
|
||||
@@ -400,7 +400,7 @@ void sub_0803A660(Entity* this) {
|
||||
}
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -430,10 +430,10 @@ void sub_0803A720(Entity* this) {
|
||||
void sub_0803A740(Entity* this) {
|
||||
u16 height;
|
||||
|
||||
height = this->height.HALF.HI + 4;
|
||||
this->height.HALF.HI += 4;
|
||||
height = this->z.HALF.HI + 4;
|
||||
this->z.HALF.HI += 4;
|
||||
if (-1 < height * 0x10000) {
|
||||
this->height.HALF.HI = 0;
|
||||
this->z.HALF.HI = 0;
|
||||
this->action = 10;
|
||||
this->actionDelay = 10;
|
||||
this->parent->field_0x7c.BYTES.byte1 |= 0x40;
|
||||
@@ -454,8 +454,8 @@ void sub_0803A780(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0803A7AC(Entity* this) {
|
||||
if (this->height.HALF.HI > -6) {
|
||||
this->height.HALF.HI--;
|
||||
if (this->z.HALF.HI > -6) {
|
||||
this->z.HALF.HI--;
|
||||
} else {
|
||||
this->action = 0xc;
|
||||
}
|
||||
@@ -467,10 +467,10 @@ void sub_0803A7CC(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
if (sub_0803B4E4(this)) {
|
||||
this->action = 0xd;
|
||||
InitAnimationForceUpdate(this->attachedEntity, 6);
|
||||
InitAnimationForceUpdate(this->child, 6);
|
||||
} else {
|
||||
sub_0806F69C(this);
|
||||
}
|
||||
@@ -482,11 +482,11 @@ void sub_0803A814(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
sub_0803B55C(this);
|
||||
if ((this->attachedEntity->frames.all & 0x80) != 0) {
|
||||
if ((this->child->frame & 0x80) != 0) {
|
||||
this->action = 0xe;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
InitializeAnimation(this, 4);
|
||||
}
|
||||
}
|
||||
@@ -497,10 +497,10 @@ void sub_0803A86C(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->flags = this->flags | 0x80;
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
COLLISION_ON(this);
|
||||
sub_0803B59C(this);
|
||||
}
|
||||
}
|
||||
@@ -516,9 +516,9 @@ void sub_0803A8B8(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
InitializeAnimation(this, 6);
|
||||
InitAnimationForceUpdate(this->attachedEntity, 1);
|
||||
InitAnimationForceUpdate(this->child, 1);
|
||||
SoundReq(SFX_153);
|
||||
}
|
||||
|
||||
@@ -528,7 +528,7 @@ void sub_0803A90C(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
GetNextFrame(this);
|
||||
sub_0803B55C(this);
|
||||
sub_0806F69C(this);
|
||||
@@ -538,7 +538,7 @@ void sub_0803A90C(Entity* this) {
|
||||
this->direction = this->type * 0x10 + 8;
|
||||
this->speed = 0x200;
|
||||
InitializeAnimation(this, 7);
|
||||
InitAnimationForceUpdate(this->attachedEntity, 2);
|
||||
InitAnimationForceUpdate(this->child, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -548,7 +548,7 @@ void sub_0803A978(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
GetNextFrame(this);
|
||||
sub_0803B55C(this);
|
||||
if ((++this->actionDelay & 3) == 0) {
|
||||
@@ -558,10 +558,10 @@ void sub_0803A978(Entity* this) {
|
||||
if (this->direction == 0x10) {
|
||||
this->action = 0x12;
|
||||
this->actionDelay = 3;
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
*(u8*)(*(int*)&this->field_0x74 + 0x10) &= 0x7f;
|
||||
InitializeAnimation(this, 8);
|
||||
InitAnimationForceUpdate(this->attachedEntity, 3);
|
||||
InitAnimationForceUpdate(this->child, 3);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -572,7 +572,7 @@ void sub_0803AA00(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
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) {
|
||||
@@ -581,10 +581,10 @@ void sub_0803AA00(Entity* this) {
|
||||
sub_0806F69C(this);
|
||||
if ((this->direction == direction) || (this->y.HALF.HI >= gPlayerEntity.y.HALF.HI)) {
|
||||
this->action = 0x13;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
this->direction = direction;
|
||||
this->field_0x80.HWORD = gPlayerEntity.x.HALF.HI;
|
||||
InitAnimationForceUpdate(this->attachedEntity, 4);
|
||||
InitAnimationForceUpdate(this->child, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -596,7 +596,7 @@ NONMATCH("asm/non_matching/mazaal/sub_0803AA98.inc", void sub_0803AA98(Entity* t
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
if (sub_0803B870(this) == 0) {
|
||||
sub_0806F69C(this);
|
||||
if (sub_0803B6F4(this) != 0) {
|
||||
@@ -604,8 +604,8 @@ NONMATCH("asm/non_matching/mazaal/sub_0803AA98.inc", void sub_0803AA98(Entity* t
|
||||
this->speed = 0x40;
|
||||
InitializeAnimation(this, 10);
|
||||
(*(Entity**)&this->field_0x74)->flags |= 0x80;
|
||||
temp = this->attachedEntity;
|
||||
temp->damageType = 0x13;
|
||||
temp = this->child;
|
||||
temp->hitType = 0x13;
|
||||
InitAnimationForceUpdate(temp, 5);
|
||||
SoundReq(SFX_16E);
|
||||
}
|
||||
@@ -619,10 +619,10 @@ void sub_0803AB10(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
sub_0806F69C(this);
|
||||
sub_0803B55C(this);
|
||||
if ((this->attachedEntity->frames.all & 0x80) != 0) {
|
||||
if ((this->child->frame & 0x80) != 0) {
|
||||
this->action = 0x15;
|
||||
this->actionDelay = 0xf;
|
||||
}
|
||||
@@ -634,12 +634,12 @@ void sub_0803AB5C(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 0x16;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
InitializeAnimation(this, 0xb);
|
||||
InitAnimationForceUpdate(this->attachedEntity, 6);
|
||||
InitAnimationForceUpdate(this->child, 6);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -649,15 +649,15 @@ void sub_0803ABB4(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
GetNextFrame(this);
|
||||
sub_0803B55C(this);
|
||||
if ((this->attachedEntity->frames.all & 0x80) != 0) {
|
||||
if ((this->child->frame & 0x80) != 0) {
|
||||
this->action = 0x17;
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->speed = 0x180;
|
||||
InitializeAnimation(this, 0x10);
|
||||
InitAnimationForceUpdate(this->attachedEntity, 0);
|
||||
InitAnimationForceUpdate(this->child, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -667,7 +667,7 @@ void sub_0803AC1C(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
if (sub_0803B4E4(this)) {
|
||||
sub_0803B59C(this);
|
||||
} else {
|
||||
@@ -681,7 +681,7 @@ void sub_0803AC60(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
GetNextFrame(this);
|
||||
if (!this->actionDelay) {
|
||||
if (sub_0803B4E4(this) != 0) {
|
||||
@@ -707,14 +707,14 @@ void sub_0803ACC0(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (--this->height.HALF.HI * 0x10000 >> 0x10 < -0x20) {
|
||||
if (--this->z.HALF.HI * 0x10000 >> 0x10 < -0x20) {
|
||||
this->subAction = 2;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
uVar2 = this->height.HALF.HI += 4;
|
||||
uVar2 = this->z.HALF.HI += 4;
|
||||
if (-1 < (uVar2 * 0x10000)) {
|
||||
this->height.HALF.HI = 0;
|
||||
this->z.HALF.HI = 0;
|
||||
this->actionDelay = 0xc;
|
||||
this->subAction = 3;
|
||||
sub_08080964(8, 0);
|
||||
@@ -728,15 +728,15 @@ void sub_0803ACC0(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
uVar2 = this->height.HALF.HI -= 2;
|
||||
uVar2 = this->z.HALF.HI -= 2;
|
||||
if (uVar2 * 0x10000 >> 0x10 < -0x28) {
|
||||
this->subAction = 5;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
uVar2 = this->height.HALF.HI += 4;
|
||||
uVar2 = this->z.HALF.HI += 4;
|
||||
if (-1 < (uVar2 * 0x10000)) {
|
||||
this->height.HALF.HI = 0;
|
||||
this->z.HALF.HI = 0;
|
||||
this->action = 0x1a;
|
||||
this->actionDelay = 0x3c;
|
||||
sub_08080964(0x1e, 0);
|
||||
@@ -752,10 +752,10 @@ void sub_0803ACC0(Entity* this) {
|
||||
void sub_0803ADAC(Entity* this) {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 0x16;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
(*(Entity**)&this->field_0x74)->flags |= 0x80;
|
||||
InitializeAnimation(this, 0xb);
|
||||
InitAnimationForceUpdate(this->attachedEntity, 6);
|
||||
InitAnimationForceUpdate(this->child, 6);
|
||||
sub_0803B798();
|
||||
} else {
|
||||
sub_0803B824(this);
|
||||
@@ -768,13 +768,13 @@ void sub_0803ADF4(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
UpdateAnimationSingleFrame(this);
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->action = 0x1c;
|
||||
this->actionDelay = 0x1e;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -784,11 +784,11 @@ void sub_0803AE48(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
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)) {
|
||||
this->action = 0x1d;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
InitializeAnimation(this, 4);
|
||||
} else {
|
||||
if (sub_0803B4E4(this) == 0) {
|
||||
@@ -803,34 +803,34 @@ void sub_0803AEC4(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
UpdateAnimationSingleFrame(this);
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->flags |= 0x80;
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
COLLISION_ON(this);
|
||||
sub_0803B59C(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0803AF18(Entity* this) {
|
||||
this->action = 0x1f;
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, 5);
|
||||
this->height.HALF.HI = gUnk_080CED6C[(this->parent->field_0xf >> 4) & 7] + 4;
|
||||
this->z.HALF.HI = gUnk_080CED6C[(this->parent->field_0xf >> 4) & 7] + 4;
|
||||
}
|
||||
|
||||
void sub_0803AF50(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->action = 0x20;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
InitAnimationForceUpdate(this->attachedEntity, 8);
|
||||
this->spriteSettings.draw = 0;
|
||||
InitAnimationForceUpdate(this->child, 8);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0803AF7C(Entity* this) {
|
||||
sub_0803B55C(this);
|
||||
if ((this->attachedEntity->frames.all & 0x80) != 0) {
|
||||
if ((this->child->frame & 0x80) != 0) {
|
||||
this->action = 0x21;
|
||||
this->actionDelay = 0xf;
|
||||
}
|
||||
@@ -840,8 +840,8 @@ void sub_0803AF9C(Entity* this) {
|
||||
if (this->actionDelay != 0) {
|
||||
this->actionDelay--;
|
||||
} else {
|
||||
if (-0x20 < this->height.HALF.HI) {
|
||||
this->height.HALF.HI -= 2;
|
||||
if (-0x20 < this->z.HALF.HI) {
|
||||
this->z.HALF.HI -= 2;
|
||||
} else {
|
||||
this->action = 0x22;
|
||||
this->actionDelay = 10;
|
||||
@@ -856,13 +856,13 @@ void sub_0803AFC8(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0803AFE0(Entity* this) {
|
||||
if (this->height.HALF.HI < 0) {
|
||||
this->height.HALF.HI += 4;
|
||||
if (this->z.HALF.HI < 0) {
|
||||
this->z.HALF.HI += 4;
|
||||
} else {
|
||||
this->action = 0x24;
|
||||
this->actionDelay = 0xf0;
|
||||
*(u8*)&this->cutsceneBeh = 3;
|
||||
this->height.HALF.HI = 0;
|
||||
this->z.HALF.HI = 0;
|
||||
sub_08080964(0xa0, 0);
|
||||
SoundReq(SFX_158);
|
||||
}
|
||||
@@ -879,11 +879,11 @@ void sub_0803B01C(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0803B04C(Entity* this) {
|
||||
if (this->height.HALF.HI > -6) {
|
||||
this->height.HALF.HI--;
|
||||
if (this->z.HALF.HI > -6) {
|
||||
this->z.HALF.HI--;
|
||||
} else {
|
||||
this->action = 0x26;
|
||||
InitAnimationForceUpdate(this->attachedEntity, 6);
|
||||
InitAnimationForceUpdate(this->child, 6);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -893,21 +893,21 @@ void sub_0803B074(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
sub_0803B55C(this);
|
||||
if ((this->attachedEntity->frames.all & 0x80) != 0) {
|
||||
if ((this->child->frame & 0x80) != 0) {
|
||||
this->action = 0x27;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
InitializeAnimation(this, 4);
|
||||
InitAnimationForceUpdate(this->attachedEntity, 0);
|
||||
InitAnimationForceUpdate(this->child, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0803B0D4(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->flags |= 0x80;
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
COLLISION_ON(this);
|
||||
sub_0803B59C(this);
|
||||
}
|
||||
}
|
||||
@@ -916,7 +916,7 @@ void sub_0803B100(Entity* this) {
|
||||
Entity* temp;
|
||||
|
||||
this->action = 0x29;
|
||||
this->hVelocity = 0x14000;
|
||||
this->zVelocity = 0x14000;
|
||||
if (this->type == 0) {
|
||||
this->hitbox = &gUnk_080FD364;
|
||||
} else {
|
||||
@@ -925,12 +925,12 @@ void sub_0803B100(Entity* this) {
|
||||
temp = *(Entity**)&this->field_0x74;
|
||||
temp->action = 3;
|
||||
temp->field_0x74.HALF.LO = 0x20;
|
||||
InitAnimationForceUpdate(this->attachedEntity, 9);
|
||||
InitAnimationForceUpdate(this->child, 9);
|
||||
SoundReq(SFX_14F);
|
||||
}
|
||||
|
||||
void sub_0803B144(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this->attachedEntity);
|
||||
UpdateAnimationSingleFrame(this->child);
|
||||
if (sub_08003FC4(this, 0x2000) == 0) {
|
||||
this->action = 0x2a;
|
||||
InitializeAnimation(this, 0x16);
|
||||
@@ -941,11 +941,11 @@ void sub_0803B144(Entity* this) {
|
||||
|
||||
void sub_0803B17C(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->action = 0x2b;
|
||||
this->flags |= 0x80;
|
||||
this->damageType = 0x18;
|
||||
this->currentHealth = 0xff;
|
||||
COLLISION_ON(this);
|
||||
this->hitType = 0x18;
|
||||
this->health = 0xff;
|
||||
this->field_0x7c.HALF.HI = 600;
|
||||
}
|
||||
}
|
||||
@@ -954,15 +954,15 @@ void sub_0803B1B8(Entity* this) {
|
||||
Entity* temp;
|
||||
u16 val;
|
||||
|
||||
if ((this->frames.all & 0x80) == 0) {
|
||||
if ((this->frame & 0x80) == 0) {
|
||||
GetNextFrame(this);
|
||||
UpdateAnimationSingleFrame(this->attachedEntity);
|
||||
UpdateAnimationSingleFrame(this->child);
|
||||
}
|
||||
if (this->currentHealth < 0xf5) {
|
||||
if (this->health < 0xf5) {
|
||||
this->action = 0x32;
|
||||
this->field_0x7c.HALF.HI = 0x5dc;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->damageType = 0x14;
|
||||
this->spriteSettings.draw = 0;
|
||||
this->hitType = 0x14;
|
||||
temp = CreateFx(this, FX_GIANT_EXPLOSION4, 0);
|
||||
if (temp != (Entity*)0x0) {
|
||||
temp->x.HALF.HI += this->hitbox->offset_x;
|
||||
@@ -982,7 +982,7 @@ void sub_0803B1B8(Entity* this) {
|
||||
if ((temp->field_0x80.HALF.LO & 0xc) == 0xc) {
|
||||
temp->action = 0xb;
|
||||
temp->actionDelay = 0x78;
|
||||
temp->hVelocity = 0;
|
||||
temp->zVelocity = 0;
|
||||
(*(Entity**)&temp->field_0x74)->field_0x7c.HALF_U.HI = 0x708;
|
||||
(*(Entity**)&temp->field_0x78)->field_0x7c.HALF_U.HI = 0x708;
|
||||
}
|
||||
@@ -997,9 +997,9 @@ void sub_0803B2D0(Entity* this) {
|
||||
Entity* entity;
|
||||
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->action = 0x2d;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
entity = *(Entity**)&this->field_0x74;
|
||||
entity->action = 2;
|
||||
entity->field_0x74.HALF.LO = 0;
|
||||
@@ -1012,7 +1012,7 @@ void sub_0803B30C(Entity* this) {
|
||||
Entity* entity;
|
||||
|
||||
entity = *(Entity**)&this->field_0x74;
|
||||
if ((entity->frames.all & 0x80) != 0) {
|
||||
if ((entity->frame & 0x80) != 0) {
|
||||
this->action = 0x2e;
|
||||
sub_0803B8E8(this, 0x13);
|
||||
InitializeAnimation(entity, 0);
|
||||
@@ -1020,8 +1020,8 @@ void sub_0803B30C(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0803B338(Entity* this) {
|
||||
if (this->height.HALF.HI > -10) {
|
||||
this->height.HALF.HI--;
|
||||
if (this->z.HALF.HI > -10) {
|
||||
this->z.HALF.HI--;
|
||||
} else {
|
||||
this->action = 0x2f;
|
||||
this->actionDelay = 0xf;
|
||||
@@ -1034,7 +1034,7 @@ void sub_0803B35C(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 0x30;
|
||||
}
|
||||
@@ -1046,12 +1046,12 @@ void sub_0803B398(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
if (sub_0803B4E4(this) != 0) {
|
||||
this->action = 0x31;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
InitializeAnimation(this, 4);
|
||||
InitAnimationForceUpdate(this->attachedEntity, 0);
|
||||
InitAnimationForceUpdate(this->child, 0);
|
||||
} else {
|
||||
sub_0806F69C(this);
|
||||
}
|
||||
@@ -1065,10 +1065,10 @@ void sub_0803B3F4(Entity* this) {
|
||||
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->damageType = 0x17;
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->hitType = 0x17;
|
||||
if (this->type == 0) {
|
||||
this->hitbox = (Hitbox*)&gUnk_080FD35C;
|
||||
} else {
|
||||
@@ -1114,7 +1114,7 @@ u32 sub_0803B4E4(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0803B538(Entity* this) {
|
||||
PositionRelative(this, this->attachedEntity, 0, -0x10000);
|
||||
PositionRelative(this, this->child, 0, -0x10000);
|
||||
PositionRelative(this, *(Entity**)&this->field_0x74, 0, -0x20000);
|
||||
}
|
||||
|
||||
@@ -1123,9 +1123,9 @@ void sub_0803B55C(Entity* this) {
|
||||
Entity* pEVar1;
|
||||
|
||||
pEVar1 = *(Entity**)&this->field_0x74;
|
||||
entity = this->attachedEntity;
|
||||
entity = this->child;
|
||||
UpdateAnimationSingleFrame(entity);
|
||||
if ((entity->frames.all & 0x10) != 0) {
|
||||
if ((entity->frame & 0x10) != 0) {
|
||||
if (pEVar1->animIndex != 1) {
|
||||
InitializeAnimation(pEVar1, 1);
|
||||
}
|
||||
@@ -1157,7 +1157,7 @@ void sub_0803B5C0(Entity* this) {
|
||||
} else {
|
||||
temp = gUnk_080CFD0C[0x16 - direction];
|
||||
}
|
||||
if (this->frames.all != temp) {
|
||||
if (this->frame != temp) {
|
||||
InitializeAnimation(this, temp);
|
||||
}
|
||||
}
|
||||
@@ -1185,7 +1185,7 @@ void sub_0803B6A4(Entity* this) {
|
||||
Entity* temp;
|
||||
|
||||
this->action = 0x2c;
|
||||
this->damageType = 0x14;
|
||||
this->hitType = 0x14;
|
||||
temp = this->parent;
|
||||
temp->field_0x80.HALF.LO |= (this->type == 0) ? 0x10 : 0x20;
|
||||
temp->field_0x80.HALF.LO &= (this->type == 0) ? -5 : -9;
|
||||
@@ -1229,8 +1229,8 @@ void sub_0803B798(void) {
|
||||
gPlayerState.field_0xa = 0;
|
||||
gPlayerState.flags &= 0xffef;
|
||||
gPlayerEntity.flags |= 0x80;
|
||||
gPlayerEntity.hVelocity = 0x18000;
|
||||
gPlayerEntity.height.HALF.HI = -10;
|
||||
gPlayerEntity.zVelocity = 0x18000;
|
||||
gPlayerEntity.z.HALF.HI = -10;
|
||||
gPlayerEntity.direction = 0x10;
|
||||
gPlayerEntity.animationState = 4;
|
||||
gPlayerEntity.spritePriority.b1 = 1;
|
||||
@@ -1256,30 +1256,30 @@ void sub_0803B824(Entity* this) {
|
||||
u32 sub_0803B870(Entity* this) {
|
||||
Entity* entity;
|
||||
|
||||
entity = this->attachedEntity;
|
||||
entity = this->child;
|
||||
if ((entity->bitfield & 0x80) != 0 && (gPlayerState.flags & 0x10) != 0) {
|
||||
this->action = 0x18;
|
||||
this->actionDelay = 0x44;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
gPlayerEntity.flags = gPlayerEntity.flags & 0x7f;
|
||||
gPlayerEntity.iframes = -0x10;
|
||||
sub_0803B824(this);
|
||||
entity->damageType = 0x13;
|
||||
entity->hitType = 0x13;
|
||||
InitAnimationForceUpdate(entity, 7);
|
||||
SoundReq(SFX_16E);
|
||||
return 1;
|
||||
} else {
|
||||
entity->damageType = 0x15;
|
||||
entity->hitType = 0x15;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0803B8E8(Entity* this, u32 unk) {
|
||||
Entity* entity;
|
||||
entity = this->attachedEntity;
|
||||
entity->damageType = unk;
|
||||
entity = this->child;
|
||||
entity->hitType = unk;
|
||||
entity = (*(Entity**)&this->field_0x74);
|
||||
entity->damageType = unk;
|
||||
entity->hitType = unk;
|
||||
}
|
||||
|
||||
void sub_0803B8F8(Entity* this) {
|
||||
@@ -1289,14 +1289,14 @@ void sub_0803B8F8(Entity* this) {
|
||||
void sub_0803B910(Entity* this) {
|
||||
if (gScreenTransition.field_0x38 != 0) {
|
||||
this->action = 2;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
*(u8*)&this->field_0x74 = 0;
|
||||
sub_0803BA8C(this, 10);
|
||||
} else {
|
||||
this->action = 1;
|
||||
*(u8*)&this->field_0x74 = 0x80;
|
||||
}
|
||||
this->spriteSettings.b.flipX = (this->type - 2);
|
||||
this->spriteSettings.flipX = (this->type - 2);
|
||||
InitializeAnimation(this, 0);
|
||||
CopyPositionAndSpriteOffset(this->parent, this);
|
||||
}
|
||||
@@ -1334,7 +1334,7 @@ void sub_0803B978(Entity* this) {
|
||||
break;
|
||||
case 4:
|
||||
this->subAction = 5;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->spriteRendering.alphaBlend = 1;
|
||||
break;
|
||||
default:
|
||||
@@ -1393,7 +1393,7 @@ void sub_0803BA8C(Entity* this, u32 unk) {
|
||||
sub_0801D2B4(this, sVar2);
|
||||
(*(Entity**)&this->parent->field_0x78)->palette.b.b0 = this->palette.raw << 0x1c >> 0x1c;
|
||||
(*(Entity**)&this->parent->field_0x78)->palette.b.b4 = this->palette.b.b0;
|
||||
this->parent->attachedEntity->palette.b.b0 = this->palette.raw << 0x1c >> 0x1c;
|
||||
this->parent->attachedEntity->palette.b.b4 = this->palette.b.b0;
|
||||
this->parent->child->palette.b.b0 = this->palette.raw << 0x1c >> 0x1c;
|
||||
this->parent->child->palette.b.b4 = this->palette.b.b0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ const Hitbox* const gUnk_080CEF58[] = {
|
||||
void MazaalHand(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.flipX = this->type;
|
||||
this->spriteSettings.flipX = this->type;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
}
|
||||
sub_08035194(this);
|
||||
|
||||
+13
-13
@@ -132,7 +132,7 @@ void sub_08033F3C(Entity* this) {
|
||||
} else {
|
||||
this->action = 1;
|
||||
}
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->field_0x6c.HALF.HI |= 1;
|
||||
this->field_0x80.HALF.LO = 0;
|
||||
InitializeAnimation(this, 0);
|
||||
@@ -144,7 +144,7 @@ void sub_08033F3C(Entity* this) {
|
||||
this->action = 0xd;
|
||||
this->subAction = 0;
|
||||
this->actionDelay = 0xfc;
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
} else {
|
||||
pEVar2 = CreateEnemy(MAZAAL_BRACELET, 0);
|
||||
pEVar2->parent = this;
|
||||
@@ -183,8 +183,8 @@ void sub_08033FFC(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
this->height.WORD += -0x8000;
|
||||
if (this->height.HALF.HI == -10) {
|
||||
this->z.WORD += -0x8000;
|
||||
if (this->z.HALF.HI == -10) {
|
||||
this->subAction = 5;
|
||||
this->field_0x80.HALF.HI = 1;
|
||||
}
|
||||
@@ -335,8 +335,8 @@ void sub_08034348(Entity* this) {
|
||||
if (this->field_0x7c.HALF_U.HI != 0) {
|
||||
this->field_0x7c.HALF.HI--;
|
||||
} else {
|
||||
if (this->height.HALF.HI > -10) {
|
||||
this->height.HALF.HI--;
|
||||
if (this->z.HALF.HI > -10) {
|
||||
this->z.HALF.HI--;
|
||||
} else {
|
||||
if (sub_080349D8(this) != 0) {
|
||||
this->field_0x80.HALF.HI = 1;
|
||||
@@ -351,7 +351,7 @@ void sub_0803438C(Entity* this) {
|
||||
const s8* pVar;
|
||||
|
||||
if (this->actionDelay == 0) {
|
||||
this->currentHealth = 0;
|
||||
this->health = 0;
|
||||
} else {
|
||||
this->actionDelay--;
|
||||
if (this->actionDelay > 0xc0) {
|
||||
@@ -686,7 +686,7 @@ END_NONMATCH
|
||||
|
||||
void sub_0803499C(Entity* this) {
|
||||
if (((this->field_0x80.HALF.LO & 0xc) != 0xc) && (this->field_0x80.HALF.HI != 0)) {
|
||||
this->height.HALF.HI = gUnk_080CED6C[(++this->field_0xf >> 4) & 7];
|
||||
this->z.HALF.HI = gUnk_080CED6C[(++this->field_0xf >> 4) & 7];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -739,8 +739,8 @@ void sub_08034A84(Entity* this) {
|
||||
} else {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.b.flipX = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->spriteSettings.flipX = 1;
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
CopyPositionAndSpriteOffset(this->parent, this);
|
||||
@@ -764,7 +764,7 @@ void sub_08034B0C(Entity* this) {
|
||||
this->actionDelay--;
|
||||
} else {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) == 0) {
|
||||
if ((this->frame & 0x80) == 0) {
|
||||
return;
|
||||
}
|
||||
this->action = 2;
|
||||
@@ -797,7 +797,7 @@ END_NONMATCH
|
||||
|
||||
void sub_08034BA0(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->parent->field_0x7c.HALF.HI = 0xff;
|
||||
DeleteEntity(this);
|
||||
}
|
||||
@@ -810,7 +810,7 @@ void sub_08034BC8(Entity* this) {
|
||||
}
|
||||
sub_0806FA90(this->parent, this, 0, 1);
|
||||
sub_0800445C(this);
|
||||
if (this->height.HALF.HI == 0) {
|
||||
if (this->z.HALF.HI == 0) {
|
||||
sub_08034C00(this);
|
||||
}
|
||||
}
|
||||
|
||||
+11
-11
@@ -85,7 +85,7 @@ void sub_08034CC4(Entity* this) {
|
||||
SetTile(0x4022, COORD_TO_TILE(this), this->collisionLayer);
|
||||
entity = CreateEnemy(MAZAAL_MACRO, 2);
|
||||
if (entity != NULL) {
|
||||
this->attachedEntity = entity;
|
||||
this->child = entity;
|
||||
entity->parent = this;
|
||||
CopyPosition(this, entity);
|
||||
}
|
||||
@@ -137,8 +137,8 @@ void sub_08034E68(Entity* this) {
|
||||
ScriptExecutionContext* scriptExecutionContext;
|
||||
|
||||
if (this->parent->next == NULL) {
|
||||
if (this->spriteSettings.b.draw != 0) {
|
||||
this->spriteSettings.b.draw = 0;
|
||||
if (this->spriteSettings.draw != 0) {
|
||||
this->spriteSettings.draw = 0;
|
||||
sub_08035120(this);
|
||||
}
|
||||
if (gScreenTransition.field_0x39 == 0) {
|
||||
@@ -187,7 +187,7 @@ void sub_08034F58(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08034F70(Entity* this) {
|
||||
this->currentHealth = gScreenTransition.field_0x39;
|
||||
this->health = gScreenTransition.field_0x39;
|
||||
if (gScreenTransition.field_0x39 >= 0x3d) {
|
||||
this->type2 = 0;
|
||||
} else if (gScreenTransition.field_0x39 >= 0x1f) {
|
||||
@@ -199,38 +199,38 @@ void sub_08034F70(Entity* this) {
|
||||
|
||||
void sub_08034FA0(Entity* this) {
|
||||
if (0 < this->iframes) {
|
||||
this->attachedEntity->iframes = this->iframes;
|
||||
this->child->iframes = this->iframes;
|
||||
sub_08080964(0xc, 1);
|
||||
}
|
||||
switch (this->type2) {
|
||||
case 0:
|
||||
if (this->currentHealth < 0x3c) {
|
||||
if (this->health < 0x3c) {
|
||||
gScreenTransition.field_0x39 = 0x3c;
|
||||
sub_08035050(this);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (this->currentHealth < 0x1e) {
|
||||
if (this->health < 0x1e) {
|
||||
gScreenTransition.field_0x39 = 0x1e;
|
||||
sub_08035050(this);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (this->currentHealth == 0) {
|
||||
if (this->health == 0) {
|
||||
sub_0807BA8C(COORD_TO_TILE(this), this->collisionLayer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
gScreenTransition.field_0x39 = this->currentHealth;
|
||||
gScreenTransition.field_0x39 = this->health;
|
||||
}
|
||||
|
||||
void sub_08035050(Entity* this) {
|
||||
Entity* entity;
|
||||
|
||||
this->flags = this->flags & 0x7f;
|
||||
this->currentHealth = 0;
|
||||
COLLISION_OFF(this);
|
||||
this->health = 0;
|
||||
entity = CreateEnemy(VAATI_PROJECTILE, 0);
|
||||
if (entity != NULL) {
|
||||
entity->type2 = 1;
|
||||
|
||||
@@ -24,8 +24,8 @@ void sub_080455D4(Entity* this) {
|
||||
void sub_080455E4(Entity* this) {
|
||||
if ((this != this->parent) && (this->parent != NULL)) {
|
||||
this->field_0x6c.HALF.LO &= 0x7f;
|
||||
this->parent->attachedEntity = this->attachedEntity;
|
||||
this->attachedEntity->parent = this->parent;
|
||||
this->parent->child = this->child;
|
||||
this->child->parent = this->parent;
|
||||
}
|
||||
sub_0804A7D4(this);
|
||||
}
|
||||
@@ -35,7 +35,7 @@ void nullsub_23(Entity* this) {
|
||||
|
||||
void sub_08045618(Entity* this) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->speed = 0x80;
|
||||
this->field_0x3c = this->field_0x3c | 0x10;
|
||||
sub_0804A720(this);
|
||||
@@ -53,7 +53,7 @@ void sub_08045654(Entity* this) {
|
||||
|
||||
void sub_08045678(Entity* this) {
|
||||
|
||||
this->hVelocity = 0x1c000;
|
||||
this->zVelocity = 0x1c000;
|
||||
if (this->actionDelay != 0) {
|
||||
this->actionDelay--;
|
||||
} else {
|
||||
|
||||
@@ -32,8 +32,8 @@ void sub_0804525C(Entity* this) {
|
||||
Entity* parent = this->parent;
|
||||
if (this != parent && parent) {
|
||||
this->field_0x6c.HALF.LO &= 0x7f;
|
||||
this->parent->attachedEntity = this->attachedEntity;
|
||||
this->attachedEntity->parent = this->parent;
|
||||
this->parent->child = this->child;
|
||||
this->child->parent = this->parent;
|
||||
if (this->field_0x6c.HALF.HI & 0x40)
|
||||
ReplaceMonitoredEntity(this, parent);
|
||||
}
|
||||
@@ -45,7 +45,7 @@ void nullsub_22(void) {
|
||||
|
||||
void sub_080452A4(Entity* this) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->speed = 0x100;
|
||||
sub_0804A720(this);
|
||||
InitializeAnimation(this, 6);
|
||||
|
||||
+10
-10
@@ -31,17 +31,17 @@ void sub_08022BD4(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08022BEC(Entity* this) {
|
||||
if (this->field_0x7a.HALF.LO != this->currentHealth)
|
||||
if (this->field_0x7a.HALF.LO != this->health)
|
||||
this->field_0x7a.HALF.HI = 30;
|
||||
|
||||
this->field_0x7a.HALF.LO = this->currentHealth;
|
||||
this->field_0x7a.HALF.LO = this->health;
|
||||
this->actionDelay = 1;
|
||||
this->direction = this->knockbackDirection;
|
||||
|
||||
this->animationState = ((this->direction + 2) & 0x1c) >> 2;
|
||||
this->frameIndex = this->animationState;
|
||||
|
||||
this->attachedEntity->iframes = this->iframes;
|
||||
this->child->iframes = this->iframes;
|
||||
(*(Entity**)&this->field_0x7c)->iframes = this->iframes;
|
||||
(*(Entity**)&this->field_0x80)->iframes = this->iframes;
|
||||
sub_0804AA30(this, gUnk_080CBBA0);
|
||||
@@ -50,25 +50,25 @@ void sub_08022BEC(Entity* this) {
|
||||
void sub_08022C58(Entity* this) {
|
||||
Entity *tail0, *tail1, *tail2;
|
||||
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
|
||||
if (gEntCount >= 0x45)
|
||||
return;
|
||||
|
||||
tail0 = CreateEnemy(MOLDORM, 1);
|
||||
this->attachedEntity = tail0;
|
||||
this->child = tail0;
|
||||
tail0->spritePriority.b0 = 5;
|
||||
tail0->parent = this;
|
||||
CopyPosition(this, tail0);
|
||||
|
||||
tail1 = CreateEnemy(MOLDORM, 2);
|
||||
tail0->attachedEntity = tail1;
|
||||
tail0->child = tail1;
|
||||
tail1->spritePriority.b0 = 5;
|
||||
tail1->parent = this;
|
||||
CopyPosition(this, tail1);
|
||||
|
||||
tail2 = CreateEnemy(MOLDORM, 3);
|
||||
tail1->attachedEntity = tail2;
|
||||
tail1->child = tail2;
|
||||
tail2->spritePriority.b0 = 5;
|
||||
tail2->parent = this;
|
||||
CopyPosition(this, tail2);
|
||||
@@ -77,16 +77,16 @@ void sub_08022C58(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 1;
|
||||
this->field_0xf = 1;
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->parent = this;
|
||||
this->attachedEntity = tail0;
|
||||
this->child = tail0;
|
||||
*(Entity**)&this->field_0x7c = tail1;
|
||||
*(Entity**)&this->field_0x80 = tail2;
|
||||
|
||||
this->direction = Random() & 0x1f;
|
||||
this->animationState = ((this->direction + 2) & 0x1c) >> 2;
|
||||
this->frameIndex = this->animationState;
|
||||
this->field_0x7a.HALF.LO = this->currentHealth;
|
||||
this->field_0x7a.HALF.LO = this->health;
|
||||
}
|
||||
|
||||
void sub_08022D40(Entity* this) {
|
||||
|
||||
+55
-55
@@ -51,8 +51,8 @@ NONMATCH("asm/non_matching/moldworm/Moldworm.inc", void Moldworm(Entity* this))
|
||||
}
|
||||
}
|
||||
|
||||
if (this->parent->field_0x7c.BYTES.byte0 != this->parent->field_0x7c.BYTES.byte1 && this->attachedEntity) {
|
||||
((u8*)&this->attachedEntity->field_0x78)[(this->parent->field_0x7c.BYTES.byte0 - 1) & 0xf] =
|
||||
if (this->parent->field_0x7c.BYTES.byte0 != this->parent->field_0x7c.BYTES.byte1 && this->child) {
|
||||
((u8*)&this->child->field_0x78)[(this->parent->field_0x7c.BYTES.byte0 - 1) & 0xf] =
|
||||
(((this->x.HALF.HI - prevX + 8) & 0xf) << 4) | ((this->y.HALF.HI - prevY + 8U) & 0xf);
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,7 @@ void sub_080230E4(Entity* this) {
|
||||
this->action = 7;
|
||||
this->actionDelay = 1;
|
||||
this->subAction = 0;
|
||||
this->damageType = 0x85;
|
||||
this->hitType = 0x85;
|
||||
this->iframes = -8;
|
||||
this->field_0x7c.BYTES.byte3 = 0;
|
||||
this->field_0x7a.HALF.HI = 0;
|
||||
@@ -80,11 +80,11 @@ void sub_080230E4(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
if (this->currentHealth == 0 && this->field_0x7c.BYTES.byte3 == 0 && this->action == 7) {
|
||||
if (this->health == 0 && this->field_0x7c.BYTES.byte3 == 0 && this->action == 7) {
|
||||
CopyPosition(this, &gPlayerEntity);
|
||||
gPlayerEntity.flags = gPlayerEntity.flags | 0x80;
|
||||
gPlayerEntity.spriteSettings.b.draw = 1;
|
||||
gPlayerEntity.hVelocity = 0x18000;
|
||||
gPlayerEntity.spriteSettings.draw = 1;
|
||||
gPlayerEntity.zVelocity = 0x18000;
|
||||
gPlayerEntity.direction = 0xff;
|
||||
gPlayerEntity.iframes = -0x14;
|
||||
gPlayerState.jumpStatus = 0x41;
|
||||
@@ -106,32 +106,32 @@ void sub_080231BC(Entity* this) {
|
||||
if (gEntCount < 0x40) {
|
||||
Entity* ent;
|
||||
|
||||
ent = this->attachedEntity = CreateEnemy(MOLDWORM, 1);
|
||||
ent = this->child = CreateEnemy(MOLDWORM, 1);
|
||||
ent->parent = this;
|
||||
|
||||
ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 2);
|
||||
ent = ent->child = CreateEnemy(MOLDWORM, 2);
|
||||
ent->parent = this;
|
||||
|
||||
ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 3);
|
||||
ent = ent->child = CreateEnemy(MOLDWORM, 3);
|
||||
ent->parent = this;
|
||||
|
||||
ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 4);
|
||||
ent = ent->child = CreateEnemy(MOLDWORM, 4);
|
||||
ent->parent = this;
|
||||
|
||||
ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 5);
|
||||
ent = ent->child = CreateEnemy(MOLDWORM, 5);
|
||||
ent->parent = this;
|
||||
|
||||
ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 6);
|
||||
ent = ent->child = CreateEnemy(MOLDWORM, 6);
|
||||
ent->parent = this;
|
||||
|
||||
ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 7);
|
||||
ent = ent->child = CreateEnemy(MOLDWORM, 7);
|
||||
ent->parent = this;
|
||||
|
||||
ent->attachedEntity = CreateEnemy(MOLDWORM, 8);
|
||||
*(Entity**)&ent->attachedEntity->field_0x74 = ent;
|
||||
ent = ent->attachedEntity;
|
||||
ent->child = CreateEnemy(MOLDWORM, 8);
|
||||
*(Entity**)&ent->child->field_0x74 = ent;
|
||||
ent = ent->child;
|
||||
ent->parent = this;
|
||||
ent->attachedEntity = NULL;
|
||||
ent->child = NULL;
|
||||
sub_0804A720(this);
|
||||
this->action = 6;
|
||||
this->actionDelay = 0x1e;
|
||||
@@ -167,17 +167,17 @@ void sub_08023288(Entity* this) {
|
||||
|
||||
void sub_08023330(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 4;
|
||||
this->actionDelay = 0x19;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->field_0x78.HWORD = 600;
|
||||
this->direction = Random() & 0x1c;
|
||||
this->animationState = this->direction >> 2;
|
||||
this->field_0x7a.HALF.HI = 0;
|
||||
this->field_0x7c.BYTES.byte3 = 0;
|
||||
sub_08023A88(this, this->animationState);
|
||||
CopyPosition(this, this->attachedEntity);
|
||||
CopyPosition(this, this->child);
|
||||
CreateFx(this, FX_ROCK, 0);
|
||||
}
|
||||
}
|
||||
@@ -196,9 +196,9 @@ void sub_08023398(Entity* this) {
|
||||
if (sub_08023A38(GetTileTypeByEntity(this))) {
|
||||
this->action = 5;
|
||||
this->field_0x7c.BYTES.byte3 = 0;
|
||||
this->flags = this->flags & 0x7f;
|
||||
this->damageType = 0x85;
|
||||
this->attachedEntity->actionDelay = 1;
|
||||
COLLISION_OFF(this);
|
||||
this->hitType = 0x85;
|
||||
this->child->actionDelay = 1;
|
||||
sub_08023A68(this);
|
||||
CreateFx(this, FX_ROCK, 0);
|
||||
return;
|
||||
@@ -239,7 +239,7 @@ void sub_080234A4(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->field_0x7c.BYTES.byte3) {
|
||||
this->action = 6;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
this->field_0x78.HWORD = 300;
|
||||
}
|
||||
}
|
||||
@@ -257,9 +257,9 @@ void sub_080234D8(Entity* this) {
|
||||
void sub_0802351C(Entity* this) {
|
||||
if (this->actionDelay != 0 && (this->type2 == 1 || gPlayerEntity.frameIndex == 0xff)) {
|
||||
this->actionDelay = 0;
|
||||
this->attachedEntity->action = 3;
|
||||
this->attachedEntity->field_0xf = this->field_0x80.HALF.LO;
|
||||
InitializeAnimation(this->attachedEntity, this->attachedEntity->animationState + 1);
|
||||
this->child->action = 3;
|
||||
this->child->field_0xf = this->field_0x80.HALF.LO;
|
||||
InitializeAnimation(this->child, this->child->animationState + 1);
|
||||
InitializeAnimation(this, this->animationState);
|
||||
}
|
||||
|
||||
@@ -299,8 +299,8 @@ 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->flags |= 0x80;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
COLLISION_ON(this);
|
||||
this->spriteSettings.draw = 1;
|
||||
sub_08023644(this);
|
||||
}
|
||||
}
|
||||
@@ -311,9 +311,9 @@ void sub_08023644(Entity* this) {
|
||||
if (parent->animIndex == 0x17 && this->actionDelay != 0 && this->x.HALF.HI == parent->x.HALF.HI &&
|
||||
this->y.HALF.HI == parent->y.HALF.HI) {
|
||||
this->action = 1;
|
||||
this->flags &= ~0x80;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->attachedEntity->actionDelay = 1;
|
||||
COLLISION_OFF(this);
|
||||
this->spriteSettings.draw = 0;
|
||||
this->child->actionDelay = 1;
|
||||
sub_080239F0(this);
|
||||
}
|
||||
|
||||
@@ -330,9 +330,9 @@ void sub_08023644(Entity* this) {
|
||||
void sub_080236F8(Entity* parent) {
|
||||
if (--parent->field_0xf == 0) {
|
||||
parent->action = 2;
|
||||
parent->attachedEntity->action = 3;
|
||||
parent->attachedEntity->field_0xf = parent->parent->field_0x80.HALF.LO;
|
||||
InitializeAnimation(parent->attachedEntity, parent->attachedEntity->animationState + 1);
|
||||
parent->child->action = 3;
|
||||
parent->child->field_0xf = parent->parent->field_0x80.HALF.LO;
|
||||
InitializeAnimation(parent->child, parent->child->animationState + 1);
|
||||
InitializeAnimation(parent, parent->animationState);
|
||||
}
|
||||
}
|
||||
@@ -356,15 +356,15 @@ void sub_08023748(Entity* this) {
|
||||
void sub_0802376C(Entity* this) {
|
||||
Entity* parent = this->parent;
|
||||
|
||||
if (parent->spriteSettings.b.draw == 1 && parent->animIndex < 0x10) {
|
||||
this->spriteSettings.b.draw = 1;
|
||||
if (parent->spriteSettings.draw == 1 && parent->animIndex < 0x10) {
|
||||
this->spriteSettings.draw = 1;
|
||||
GetNextFrame(this);
|
||||
}
|
||||
|
||||
if (((u8*)&this->field_0x78)[parent->field_0x7c.BYTES.byte0 & 0xf] != 0x88) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 0;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->parent->field_0x7c.BYTES.byte3 = 1;
|
||||
sub_08023A88(this, 20);
|
||||
sub_080237D8(this);
|
||||
@@ -377,8 +377,8 @@ void sub_080237D8(Entity* this) {
|
||||
if (parent->animIndex == 0x17 && this->actionDelay != 0 && this->x.HALF.HI == parent->x.HALF.HI &&
|
||||
this->y.HALF.HI == parent->y.HALF.HI) {
|
||||
this->action = 1;
|
||||
this->flags &= ~0x80;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
COLLISION_OFF(this);
|
||||
this->spriteSettings.draw = 0;
|
||||
parent->field_0x7c.BYTES.byte3 = 1;
|
||||
sub_080239F0(this);
|
||||
sub_08023A68(this);
|
||||
@@ -415,33 +415,33 @@ void sub_08023894(Entity* this) {
|
||||
|
||||
void sub_0802390C(Entity* this) {
|
||||
if (this->bitfield & 0x80) {
|
||||
Entity* ent = this->attachedEntity;
|
||||
Entity* ent = this->child;
|
||||
do {
|
||||
ent->iframes = this->iframes;
|
||||
} while (ent = ent->attachedEntity, ent != NULL);
|
||||
} while (ent = ent->child, ent != NULL);
|
||||
} else {
|
||||
Entity* ent = this->attachedEntity;
|
||||
Entity* ent = this->child;
|
||||
do {
|
||||
if (ent->bitfield & 0x80) {
|
||||
u8 bVar2 = 0xff - ent->currentHealth;
|
||||
u8 bVar2 = 0xff - ent->health;
|
||||
if (bVar2 != 0) {
|
||||
u32 tmp;
|
||||
ent->currentHealth = 0xff;
|
||||
ent->health = 0xff;
|
||||
tmp = (u8)ent->iframes;
|
||||
if (this->currentHealth >= bVar2) {
|
||||
this->currentHealth -= bVar2;
|
||||
if (this->health >= bVar2) {
|
||||
this->health -= bVar2;
|
||||
} else {
|
||||
this->currentHealth = 0;
|
||||
this->health = 0;
|
||||
}
|
||||
|
||||
ent = this;
|
||||
do {
|
||||
ent->iframes = tmp;
|
||||
} while (ent = ent->attachedEntity, ent != NULL);
|
||||
} while (ent = ent->child, ent != NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while (ent = ent->attachedEntity, ent != NULL);
|
||||
} while (ent = ent->child, ent != NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -449,7 +449,7 @@ void sub_08023990(Entity* this, u32 param_2, u32 param_3) {
|
||||
Entity* ent;
|
||||
|
||||
this->action = 3;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->palette.b.b0 = 0x5;
|
||||
this->palette.b.b4 = 0x5;
|
||||
this->spritePriority.b0 = 7;
|
||||
@@ -459,11 +459,11 @@ void sub_08023990(Entity* this, u32 param_2, u32 param_3) {
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
InitializeAnimation(this, 0x16);
|
||||
|
||||
ent = this->attachedEntity;
|
||||
ent = this->child;
|
||||
do {
|
||||
sub_080239F0(ent);
|
||||
CopyPosition(this, ent);
|
||||
} while (ent = ent->attachedEntity, ent != NULL);
|
||||
} while (ent = ent->child, ent != NULL);
|
||||
}
|
||||
|
||||
/* TODO: fix struct */
|
||||
@@ -499,7 +499,7 @@ void sub_08023AB0(Entity* this) {
|
||||
if (this->field_0x7c.BYTES.byte2) {
|
||||
this->field_0x7c.BYTES.byte2--;
|
||||
} else if (!sub_08023B38(this) || 0x1d >= this->field_0x78.HWORD) {
|
||||
this->damageType = 0x85;
|
||||
this->hitType = 0x85;
|
||||
this->field_0x7a.HALF.HI = 0;
|
||||
this->field_0x7c.BYTES.byte2 = 30;
|
||||
InitializeAnimation(this, this->animationState);
|
||||
@@ -507,7 +507,7 @@ void sub_08023AB0(Entity* this) {
|
||||
} else if (this->field_0x7c.BYTES.byte2) {
|
||||
this->field_0x7c.BYTES.byte2--;
|
||||
} else if (this->field_0x78.HWORD >= 90 && sub_08023B38(this)) {
|
||||
this->damageType = 0x87;
|
||||
this->hitType = 0x87;
|
||||
this->field_0x7a.HALF.HI = 8;
|
||||
this->field_0x7c.BYTES.byte2 = 10;
|
||||
InitializeAnimation(this, this->animationState + 8);
|
||||
|
||||
+8
-8
@@ -71,7 +71,7 @@ void sub_0801EB7C(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0801EB84(Entity* this) {
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
UpdateAnimationVariableFrames(this, 2);
|
||||
}
|
||||
|
||||
@@ -80,11 +80,11 @@ void nullsub_3(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0801EB9C(Entity* this) {
|
||||
if (this->flags & 0x80) {
|
||||
this->flags |= 0x80;
|
||||
if (this->flags & ENT_COLLIDE) {
|
||||
COLLISION_ON(this);
|
||||
this->field_0x3a &= 0xfb;
|
||||
} else {
|
||||
this->currentHealth = 0;
|
||||
this->health = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ void Octorok_Move(Entity* this) {
|
||||
|
||||
void Octorok_ShootNut(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 1) {
|
||||
if (this->frame & 1) {
|
||||
Entity* ent = CreateProjectileWithParent(this, 1, 0);
|
||||
if (ent) {
|
||||
const s8* off;
|
||||
@@ -133,13 +133,13 @@ void Octorok_ShootNut(Entity* this) {
|
||||
off = &gOctorokNutOffset[this->direction / 4];
|
||||
ent->x.HALF.HI += off[0];
|
||||
ent->y.HALF.HI += off[1];
|
||||
ent->height.HALF.HI = -3;
|
||||
this->frames.all &= 0xfe;
|
||||
ent->z.HALF.HI = -3;
|
||||
this->frame &= 0xfe;
|
||||
EnqueueSFX(0x18d);
|
||||
}
|
||||
}
|
||||
|
||||
if (this->frames.all & 0x80)
|
||||
if (this->frame & 0x80)
|
||||
Octorok_Pause(this);
|
||||
}
|
||||
|
||||
|
||||
+23
-23
@@ -45,7 +45,7 @@ void Peahat(Entity* this) {
|
||||
void Peahat_OnTick(Entity* this) {
|
||||
gPeahatActions[this->action](this);
|
||||
if (this->field_0x80.HALF.HI)
|
||||
this->height.HALF.HI = gPeahatFlightHeights[(this->field_0xf++ & 0x30) >> 4];
|
||||
this->z.HALF.HI = gPeahatFlightHeights[(this->field_0xf++ & 0x30) >> 4];
|
||||
}
|
||||
|
||||
void sub_0801FFDC(Entity* this) {
|
||||
@@ -54,7 +54,7 @@ void sub_0801FFDC(Entity* this) {
|
||||
Entity* ent = CreateEnemy(PEAHAT, PeahatForm_Propeller);
|
||||
if (ent) {
|
||||
CopyPosition(this, ent);
|
||||
ent->height.HALF.HI -= 8;
|
||||
ent->z.HALF.HI -= 8;
|
||||
}
|
||||
this->field_0x82.HALF.LO = 0;
|
||||
this->animationState = PeahatAnimation_SlicedPropeller;
|
||||
@@ -101,7 +101,7 @@ void sub_080200B4(Entity* this) {
|
||||
if (this->animationState == PeahatAnimation_Flying) {
|
||||
this->animationState = PeahatAnimation_BrokenPropeller;
|
||||
this->action = 5;
|
||||
this->damageType = 0x71;
|
||||
this->hitType = 0x71;
|
||||
this->field_0x80.HALF.HI = 0;
|
||||
InitializeAnimation(this, this->animationState);
|
||||
}
|
||||
@@ -116,18 +116,18 @@ void sub_080200EC(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_080200F4(Entity* this) {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
}
|
||||
|
||||
void nullsub_5(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08020104(Entity* this) {
|
||||
if (this->flags & 0x80) {
|
||||
this->flags |= 0x80;
|
||||
if (this->flags & ENT_COLLIDE) {
|
||||
COLLISION_ON(this);
|
||||
this->field_0x3a &= 0xfb;
|
||||
} else {
|
||||
this->currentHealth = 0;
|
||||
this->health = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ void Peahat_Stunned(Entity* this) {
|
||||
this->action = 6;
|
||||
this->actionDelay = 240;
|
||||
this->field_0xf = 10;
|
||||
this->damageType = 0x71;
|
||||
this->hitType = 0x71;
|
||||
}
|
||||
|
||||
if (this->direction == 0xff)
|
||||
@@ -241,11 +241,11 @@ void Peahat_Stunned(Entity* this) {
|
||||
break;
|
||||
case PeahatAnimation_SlicedPropeller:
|
||||
sub_08003FC4(this, 0x1c00);
|
||||
if (this->height.HALF.HI == 0) {
|
||||
if (this->z.HALF.HI == 0) {
|
||||
this->action = 7;
|
||||
this->actionDelay = 150;
|
||||
this->field_0xf = 10;
|
||||
this->damageType = 0x71;
|
||||
this->hitType = 0x71;
|
||||
}
|
||||
break;
|
||||
};
|
||||
@@ -260,7 +260,7 @@ void Peahat_RepairPropeller(Entity* this) {
|
||||
return;
|
||||
|
||||
this->action = 9;
|
||||
this->hVelocity = 0x18000;
|
||||
this->zVelocity = 0x18000;
|
||||
this->direction = Random() & 0x1f;
|
||||
sub_0804AA1C(this);
|
||||
this->animationState = PeahatAnimation_RepairPropeller;
|
||||
@@ -284,9 +284,9 @@ void Peahat_Recover(Entity* this) {
|
||||
void Peahat_Hop(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (--this->actionDelay == 0) {
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 9;
|
||||
this->hVelocity = 0x18000;
|
||||
this->zVelocity = 0x18000;
|
||||
this->animationState = PeahatAnimation_NewPropeller;
|
||||
InitializeAnimation(this, this->animationState);
|
||||
} else {
|
||||
@@ -294,12 +294,12 @@ void Peahat_Hop(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
if (this->frames.all & 2) {
|
||||
this->frames.all &= ~2;
|
||||
if (this->frame & 2) {
|
||||
this->frame &= ~2;
|
||||
this->direction = Random() & 0x1f;
|
||||
}
|
||||
|
||||
if (this->frames.all & 1) {
|
||||
if (this->frame & 1) {
|
||||
sub_0800442E(this);
|
||||
} else {
|
||||
ProcessMovement(this);
|
||||
@@ -308,14 +308,14 @@ void Peahat_Hop(Entity* this) {
|
||||
|
||||
void Peahat_Takeoff(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 1;
|
||||
this->damageType = 0x70;
|
||||
this->hitType = 0x70;
|
||||
this->field_0x82.HALF.LO = 1;
|
||||
this->field_0x80.HALF.HI = 1;
|
||||
this->animationState = PeahatAnimation_Flying;
|
||||
InitializeAnimation(this, this->animationState);
|
||||
} else if (this->frames.all & 1) {
|
||||
} else if (this->frame & 1) {
|
||||
sub_0800442E(this);
|
||||
} else {
|
||||
sub_08003FC4(this, 0x1c00);
|
||||
@@ -327,10 +327,10 @@ void PeahatPropeller_Initialize(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 240;
|
||||
this->field_0xf = 40;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->spriteRendering.b3 = 1;
|
||||
this->spriteOrientation.flipY = 1;
|
||||
this->spriteSettings.b.shadow = 0;
|
||||
this->spriteSettings.shadow = 0;
|
||||
this->speed = 0x20;
|
||||
this->direction = (Random() & 0x10) + 8;
|
||||
InitializeAnimation(this, PeahatAnimation_Propeller);
|
||||
@@ -342,9 +342,9 @@ void PeahatPropeller_Fly(Entity* this) {
|
||||
DeleteEntity(this);
|
||||
} else {
|
||||
if (this->actionDelay < 60)
|
||||
this->spriteSettings.b.draw ^= 1;
|
||||
this->spriteSettings.draw ^= 1;
|
||||
|
||||
this->height.WORD -= 0xc000;
|
||||
this->z.WORD -= 0xc000;
|
||||
sub_0806F69C(this);
|
||||
if (--this->field_0xf == 0) {
|
||||
this->field_0xf = 40;
|
||||
|
||||
+47
-47
@@ -49,14 +49,14 @@ void sub_08023F44(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08023F5C(Entity* this) {
|
||||
if (this->damageType != 0x6e) {
|
||||
if (this->hitType != 0x6e) {
|
||||
if (this->bitfield == 0x80) {
|
||||
this->field_0x86.HALF.LO = 0x30;
|
||||
|
||||
if ((this->field_0x82.HALF.HI & 0xf) == 3 && this->action == 6) {
|
||||
switch (this->field_0x80.HALF.LO) {
|
||||
case 1:
|
||||
this->height.HALF.HI = -0x10;
|
||||
this->z.HALF.HI = -0x10;
|
||||
this->field_0x82.HALF.LO = 0;
|
||||
this->field_0x78.HWORD = -0x10;
|
||||
this->field_0x80.HALF.LO += 1;
|
||||
@@ -68,7 +68,7 @@ void sub_08023F5C(Entity* this) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->currentHealth = 0;
|
||||
this->health = 0;
|
||||
}
|
||||
|
||||
sub_0804AA30(this, gUnk_080CBEC4);
|
||||
@@ -83,8 +83,8 @@ void sub_08023FF0(Entity* this) {
|
||||
if (this->subAction < 3 && !sub_0806F520(this)) {
|
||||
this->action = 1;
|
||||
this->subAction = 0;
|
||||
this->flags |= 0x80;
|
||||
this->damageType = 0x77;
|
||||
COLLISION_ON(this);
|
||||
this->hitType = 0x77;
|
||||
this->actionDelay = 1;
|
||||
this->speed = 0x40;
|
||||
} else {
|
||||
@@ -108,9 +108,9 @@ void sub_08024058(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08024060(Entity* this) {
|
||||
if (this->damageType != 0x6e) {
|
||||
this->flags = this->flags & 0x7f;
|
||||
this->damageType = 0x6e;
|
||||
if (this->hitType != 0x6e) {
|
||||
COLLISION_OFF(this);
|
||||
this->hitType = 0x6e;
|
||||
this->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ void nullsub_138(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802409C(Entity* this) {
|
||||
this->currentHealth = 0;
|
||||
this->health = 0;
|
||||
InitializeAnimation(this, this->animationState);
|
||||
CreateDust(this);
|
||||
}
|
||||
@@ -142,11 +142,11 @@ void sub_080240B8(Entity* this) {
|
||||
switch (this->type) {
|
||||
case 0:
|
||||
this->field_0x78.HWORD = -0x10;
|
||||
this->height.HALF.HI = -0x10;
|
||||
this->z.HALF.HI = -0x10;
|
||||
break;
|
||||
case 1:
|
||||
this->field_0x78.HWORD = -0x30;
|
||||
this->height.HALF.HI = -0x30;
|
||||
this->z.HALF.HI = -0x30;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ void sub_080240B8(Entity* this) {
|
||||
this->field_0x82.HALF.HI = 0;
|
||||
ent = CreateProjectileWithParent(this, 6, this->field_0x82.HALF.HI);
|
||||
if (ent) {
|
||||
this->attachedEntity = ent;
|
||||
this->child = ent;
|
||||
ent->parent = this;
|
||||
ent->y.HALF.HI += 0x10;
|
||||
}
|
||||
@@ -274,7 +274,7 @@ void sub_080243B8(Entity* this) {
|
||||
switch (this->field_0x80.HALF.LO) {
|
||||
case 0:
|
||||
if (sub_08024C48(this, TRUE)) {
|
||||
if (this->attachedEntity == NULL || this->attachedEntity->next == NULL) {
|
||||
if (this->child == NULL || this->child->next == NULL) {
|
||||
this->field_0x80.HALF.LO = 2;
|
||||
this->actionDelay = 0x20;
|
||||
this->speed = 0x80;
|
||||
@@ -284,7 +284,7 @@ void sub_080243B8(Entity* this) {
|
||||
this->actionDelay = 0x1e;
|
||||
this->speed = 0x100;
|
||||
this->field_0x82.HALF.HI = 0x80;
|
||||
this->attachedEntity->action = 2;
|
||||
this->child->action = 2;
|
||||
} else if (--this->actionDelay) {
|
||||
if (--this->field_0xf == 0) {
|
||||
sub_08024A14(this, 2, (this->actionDelay >> 6) + 1);
|
||||
@@ -354,7 +354,7 @@ void sub_080244E8(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (++this->height.HALF.HI >= -0x10) {
|
||||
if (++this->z.HALF.HI >= -0x10) {
|
||||
this->field_0x82.HALF.LO = 0;
|
||||
this->field_0x78.HWORD = 0xfff0;
|
||||
if (sub_08024AD8(this)) {
|
||||
@@ -375,7 +375,7 @@ void sub_080244E8(Entity* this) {
|
||||
} else {
|
||||
sub_08024E1C(this);
|
||||
}
|
||||
this->direction = GetFacingDirection(this, this->attachedEntity);
|
||||
this->direction = GetFacingDirection(this, this->child);
|
||||
sub_08024E00(this, 0);
|
||||
sub_080249DC(this);
|
||||
} else if (--this->field_0xf == 0) {
|
||||
@@ -403,44 +403,44 @@ void sub_080244E8(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sub_080041A0(this, this->attachedEntity, 6, 6)) {
|
||||
if (sub_080041A0(this, this->child, 6, 6)) {
|
||||
Entity* ent;
|
||||
|
||||
this->field_0x80.HALF.LO += 1;
|
||||
this->actionDelay = 0xc;
|
||||
this->field_0x82.HALF.HI &= ~0x80;
|
||||
CopyPosition(this->attachedEntity, this);
|
||||
this->height.HALF.HI -= 0xe;
|
||||
CopyPosition(this->child, this);
|
||||
this->z.HALF.HI -= 0xe;
|
||||
this->field_0x78.HWORD -= 0xe;
|
||||
|
||||
ent = CreateProjectileWithParent(this, 6, this->field_0x82.HALF.HI);
|
||||
if (ent) {
|
||||
ent->parent = this;
|
||||
ent->height.HALF.HI += 0xe;
|
||||
ent->attachedEntity = this->attachedEntity;
|
||||
CopyPosition(ent, ent->attachedEntity);
|
||||
this->attachedEntity = ent;
|
||||
ent->z.HALF.HI += 0xe;
|
||||
ent->child = this->child;
|
||||
CopyPosition(ent, ent->child);
|
||||
this->child = ent;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (sub_080041A0(this, this->attachedEntity, 6, 6)) {
|
||||
if (sub_080041A0(this, this->child, 6, 6)) {
|
||||
Entity* ent;
|
||||
|
||||
this->field_0x80.HALF.LO += 1;
|
||||
this->actionDelay = 0xc;
|
||||
this->field_0x82.HALF.HI &= ~0x80;
|
||||
ent = this->attachedEntity;
|
||||
ent = this->child;
|
||||
SetTile((u16)ent->field_0x70.HALF.LO, COORD_TO_TILE(ent), ent->collisionLayer);
|
||||
DeleteEntity(ent);
|
||||
this->height.HALF.HI -= 0xe;
|
||||
this->z.HALF.HI -= 0xe;
|
||||
this->field_0x78.HWORD -= 0xe;
|
||||
|
||||
ent = CreateProjectileWithParent(this, 6, this->field_0x82.HALF.HI);
|
||||
if (ent) {
|
||||
ent->parent = this;
|
||||
ent->height.HALF.HI += 0xe;
|
||||
this->attachedEntity = ent;
|
||||
ent->z.HALF.HI += 0xe;
|
||||
this->child = ent;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -460,14 +460,14 @@ void sub_080244E8(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
this->height.HALF.HI -= 2;
|
||||
if (-60 > this->height.HALF.HI) {
|
||||
this->z.HALF.HI -= 2;
|
||||
if (-60 > this->z.HALF.HI) {
|
||||
this->field_0x80.HALF.LO++;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (this->height.HALF.HI < -0x30) {
|
||||
this->height.HALF.HI++;
|
||||
if (this->z.HALF.HI < -0x30) {
|
||||
this->z.HALF.HI++;
|
||||
} else {
|
||||
if (this->field_0x82.HALF.LO != 0) {
|
||||
this->field_0x82.HALF.LO = 0;
|
||||
@@ -511,7 +511,7 @@ void sub_080244E8(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (gPlayerEntity.height.HALF.HI == 0) {
|
||||
if (gPlayerEntity.z.HALF.HI == 0) {
|
||||
this->field_0x80.HALF.LO = 0;
|
||||
this->speed = 0x80;
|
||||
sub_08024B38(this);
|
||||
@@ -532,9 +532,9 @@ void sub_08024940(Entity* this) {
|
||||
}
|
||||
|
||||
if (this->field_0x82.HALF.LO == 0) {
|
||||
this->height.HALF.HI = this->field_0x78.HWORD;
|
||||
this->z.HALF.HI = this->field_0x78.HWORD;
|
||||
if (random)
|
||||
this->height.HALF.HI += 2;
|
||||
this->z.HALF.HI += 2;
|
||||
}
|
||||
|
||||
if (this->type2 != 0 || CheckIsDungeon()) {
|
||||
@@ -543,7 +543,7 @@ void sub_08024940(Entity* this) {
|
||||
sub_080249F4(this);
|
||||
}
|
||||
|
||||
if (this->height.HALF.HI < -0x20) {
|
||||
if (this->z.HALF.HI < -0x20) {
|
||||
this->spritePriority.b0 = 0;
|
||||
} else {
|
||||
this->spritePriority.b0 = 1;
|
||||
@@ -579,7 +579,7 @@ void sub_08024A14(Entity* this, u32 param_2, u32 param_3) {
|
||||
break;
|
||||
case 1:
|
||||
if (sub_08024C48(this, FALSE)) {
|
||||
sub_08004596(this, GetFacingDirection(this, this->attachedEntity));
|
||||
sub_08004596(this, GetFacingDirection(this, this->child));
|
||||
unk = TRUE;
|
||||
}
|
||||
break;
|
||||
@@ -614,8 +614,8 @@ bool32 sub_08024AD8(Entity* this) {
|
||||
u8 unk = FALSE;
|
||||
if ((this->field_0x82.HALF.HI & 0x3f) == 3) {
|
||||
if (gPlayerState.hurtBlinkSpeed == 0) {
|
||||
this->attachedEntity->parent = NULL;
|
||||
this->attachedEntity = NULL;
|
||||
this->child->parent = NULL;
|
||||
this->child = NULL;
|
||||
this->field_0x82.HALF.HI = 0xc0;
|
||||
return FALSE;
|
||||
}
|
||||
@@ -623,7 +623,7 @@ bool32 sub_08024AD8(Entity* this) {
|
||||
}
|
||||
|
||||
if (sub_08024C48(this, unk) == 0) {
|
||||
this->attachedEntity = NULL;
|
||||
this->child = NULL;
|
||||
this->field_0x82.HALF.HI = 0xc0;
|
||||
return FALSE;
|
||||
}
|
||||
@@ -649,13 +649,13 @@ bool32 sub_08024B38(Entity* this) {
|
||||
if (gPlayerState.hurtBlinkSpeed != 0) {
|
||||
if (sub_08024C48(this, 1) && sub_08049F1C(this, gUnk_020000B0, 0xa0)) {
|
||||
iVar4 = 1;
|
||||
this->attachedEntity = gUnk_020000B0;
|
||||
this->child = gUnk_020000B0;
|
||||
this->field_0x82.HALF.HI |= 3;
|
||||
this->field_0x82.HALF.HI &= ~0x40;
|
||||
}
|
||||
|
||||
if (iVar4 == 0) {
|
||||
this->attachedEntity = NULL;
|
||||
this->child = NULL;
|
||||
}
|
||||
return iVar4;
|
||||
}
|
||||
@@ -664,9 +664,9 @@ bool32 sub_08024B38(Entity* this) {
|
||||
ent = FindEntityByID(8, 2, 2);
|
||||
if (ent) {
|
||||
do {
|
||||
if (ent->action != 2 && ent->height.HALF.HI == 0 && sub_08049F1C(this, ent, 0xa0)) {
|
||||
if (ent->action != 2 && ent->z.HALF.HI == 0 && sub_08049F1C(this, ent, 0xa0)) {
|
||||
iVar4 = 1;
|
||||
this->attachedEntity = ent;
|
||||
this->child = ent;
|
||||
this->field_0x82.HALF.HI |= 1;
|
||||
this->field_0x82.HALF.HI &= ~0x40;
|
||||
break;
|
||||
@@ -683,7 +683,7 @@ bool32 sub_08024B38(Entity* this) {
|
||||
do {
|
||||
if (ent->action == 1 && sub_08049F1C(this, ent, 0xa0)) {
|
||||
iVar4 = 1;
|
||||
this->attachedEntity = ent;
|
||||
this->child = ent;
|
||||
this->field_0x82.HALF.HI |= 2;
|
||||
this->field_0x82.HALF.HI &= ~0x40;
|
||||
break;
|
||||
@@ -692,7 +692,7 @@ bool32 sub_08024B38(Entity* this) {
|
||||
}
|
||||
|
||||
if (iVar4 == 0) {
|
||||
this->attachedEntity = NULL;
|
||||
this->child = NULL;
|
||||
}
|
||||
|
||||
return iVar4;
|
||||
@@ -840,7 +840,7 @@ void sub_08024F50(Entity* this) {
|
||||
gPlayerEntity.direction = gPlayerEntity.animationState << 2;
|
||||
gPlayerEntity.speed = 0;
|
||||
gPlayerEntity.spritePriority.b1 = this->cutsceneBeh.HALF.HI;
|
||||
gPlayerEntity.height.HALF.HI = gPlayerEntity.spriteOffsetY;
|
||||
gPlayerEntity.z.HALF.HI = gPlayerEntity.spriteOffsetY;
|
||||
gPlayerEntity.spriteOffsetY = 0;
|
||||
this->flags2 |= 3;
|
||||
this->field_0x82.HALF.HI = 0xc0;
|
||||
|
||||
+19
-19
@@ -66,14 +66,14 @@ void sub_08025020(Entity* this) {
|
||||
this->field_0x82.HALF.LO -= gUnk_080CBFE8[(*(Entity**)&this->field_0x4c)->type];
|
||||
} else {
|
||||
this->cutsceneBeh.HWORD = 0x294;
|
||||
this->damageType = 0x83;
|
||||
this->hitType = 0x83;
|
||||
this->field_0x82.HALF.LO = 0;
|
||||
sub_0801D2B4(this, 0x7c);
|
||||
}
|
||||
this->action = 7;
|
||||
this->actionDelay = 0x3c;
|
||||
if (0 < this->hVelocity) {
|
||||
this->hVelocity = 0;
|
||||
if (0 < this->zVelocity) {
|
||||
this->zVelocity = 0;
|
||||
}
|
||||
this->iframes = -0xc;
|
||||
this->knockbackDuration = 0;
|
||||
@@ -85,7 +85,7 @@ void sub_08025020(Entity* this) {
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (this->damageType == 0x82 && this->iframes < 0) {
|
||||
if (this->hitType == 0x82 && this->iframes < 0) {
|
||||
Entity* ent = CreateObject(OBJECT_21, 2, 0);
|
||||
if (ent != NULL) {
|
||||
ent->spritePriority.b0 = 3;
|
||||
@@ -131,7 +131,7 @@ void sub_080251AC(Entity* this) {
|
||||
}
|
||||
} else {
|
||||
this->cutsceneBeh.HWORD = 0x294;
|
||||
this->damageType = 0x83;
|
||||
this->hitType = 0x83;
|
||||
this->field_0x82.HALF.LO = 0;
|
||||
sub_0801D2B4(this, 0x7c);
|
||||
}
|
||||
@@ -200,7 +200,7 @@ void sub_080252E0(Entity* this) {
|
||||
this->action = 3;
|
||||
this->actionDelay = 0x1e;
|
||||
this->field_0xf = 0;
|
||||
this->hVelocity = 0x18000;
|
||||
this->zVelocity = 0x18000;
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
}
|
||||
@@ -209,11 +209,11 @@ void sub_0802538C(Entity* this) {
|
||||
if (this->actionDelay) {
|
||||
this->actionDelay--;
|
||||
} else {
|
||||
if (this->frames.all == 0) {
|
||||
if (this->frame == 0) {
|
||||
GetNextFrame(this);
|
||||
} else {
|
||||
sub_08003FC4(this, 0x2000);
|
||||
if (this->hVelocity < 0x2000) {
|
||||
if (this->zVelocity < 0x2000) {
|
||||
this->action = 4;
|
||||
InitializeAnimation(this, 2);
|
||||
}
|
||||
@@ -239,16 +239,16 @@ void sub_080253D4(Entity* this) {
|
||||
|
||||
void sub_0802541C(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 3;
|
||||
this->field_0xf = 1;
|
||||
this->hVelocity = 0x20000;
|
||||
this->zVelocity = 0x20000;
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0802544C(Entity* this) {
|
||||
if (this->frames.all == 0) {
|
||||
if (this->frame == 0) {
|
||||
GetNextFrame(this);
|
||||
} else {
|
||||
if (--this->actionDelay == 0) {
|
||||
@@ -272,10 +272,10 @@ void sub_0802547C(Entity* this) {
|
||||
|
||||
void sub_080254B4(Entity* this) {
|
||||
sub_08003FC4(this, 0x2000);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->height.HALF.HI == 0) {
|
||||
if (this->frame & 0x80) {
|
||||
if (this->z.HALF.HI == 0) {
|
||||
if (this->cutsceneBeh.HWORD == 0) {
|
||||
this->damageType = 0x82;
|
||||
this->hitType = 0x82;
|
||||
this->field_0x82.HALF.LO = -0x10;
|
||||
sub_080256B4(this);
|
||||
} else {
|
||||
@@ -361,7 +361,7 @@ void sub_0802563C(Entity* this) {
|
||||
|
||||
if (--this->cutsceneBeh.HWORD == 0) {
|
||||
sub_0801D2B4(this, 0x28);
|
||||
this->damageType = 0x82;
|
||||
this->hitType = 0x82;
|
||||
this->field_0x82.HALF.LO = 240;
|
||||
sub_080256B4(this);
|
||||
sub_0804AA1C(this);
|
||||
@@ -552,18 +552,18 @@ void sub_08025B18(Entity* this) {
|
||||
ent->x.HALF.HI += 8;
|
||||
ent->y.HALF.HI &= -0x10;
|
||||
ent->y.HALF.HI += 8;
|
||||
ent->height.HALF.HI = -1;
|
||||
ent->z.HALF.HI = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08025BD4(Entity* this) {
|
||||
if (this->field_0x82.HALF.LO && (this->frames.all & 1) == 0) {
|
||||
if (this->field_0x82.HALF.LO && (this->frame & 1) == 0) {
|
||||
Entity* ent = CreateObject(OBJECT_21, 0, 0);
|
||||
if (ent) {
|
||||
PositionRelative(this, ent, gUnk_080CC0BA[this->animationState * 2 + 0] * 0x10000,
|
||||
gUnk_080CC0BA[this->animationState * 2 + 1] * 0x10000);
|
||||
ent->height.HALF.HI = -10;
|
||||
ent->z.HALF.HI = -10;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -575,7 +575,7 @@ void sub_08025C2C(Entity* this) {
|
||||
}
|
||||
|
||||
bool32 sub_08025C44(Entity* this) {
|
||||
if ((this->frames.all & 1) == 0) {
|
||||
if ((this->frame & 1) == 0) {
|
||||
return ProcessMovement(this);
|
||||
} else {
|
||||
return FALSE;
|
||||
|
||||
@@ -20,7 +20,7 @@ void sub_0802223C(Entity* this) {
|
||||
void sub_08022254(Entity* this) {
|
||||
Entity* ent;
|
||||
|
||||
if (this->currentHealth) {
|
||||
if (this->health) {
|
||||
switch (this->bitfield & 0x7f) {
|
||||
case 4:
|
||||
case 5:
|
||||
@@ -50,14 +50,14 @@ void sub_08022254(Entity* this) {
|
||||
#endif
|
||||
sub_0804A4E4(this, ent);
|
||||
this->action = 2;
|
||||
this->flags &= ~0x80;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
COLLISION_OFF(this);
|
||||
this->spriteSettings.draw = 0;
|
||||
this->direction = this->knockbackDirection;
|
||||
this->attachedEntity = ent;
|
||||
this->child = ent;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this->damageType != 0x94)
|
||||
if (this->hitType != 0x94)
|
||||
InitializeAnimation(this, 2);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ void sub_08022390(Entity* this) {
|
||||
void sub_080223E4(Entity* this) {
|
||||
Entity* ent;
|
||||
|
||||
ent = this->attachedEntity;
|
||||
ent = this->child;
|
||||
if (ent) {
|
||||
ent->bitfield = 0x94;
|
||||
ent->iframes = 0x10;
|
||||
|
||||
+23
-23
@@ -30,12 +30,12 @@ void Rollobite_OnTick(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08020668(Entity* this) {
|
||||
if (this->damageType == 34 && this->currentHealth != 0xff) {
|
||||
if (this->hitType == 34 && this->health != 0xff) {
|
||||
this->action = 4;
|
||||
this->hVelocity = 0x20000;
|
||||
this->zVelocity = 0x20000;
|
||||
this->direction = 0xff;
|
||||
this->currentHealth = 0xff;
|
||||
this->damageType = 35;
|
||||
this->health = 0xff;
|
||||
this->hitType = 35;
|
||||
InitializeAnimation(this, this->animationState + 8);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ void sub_080206E0(Entity* this) {
|
||||
void sub_08020734(Entity* this) {
|
||||
if (this->subAction < 3 && !sub_0806F520(this)) {
|
||||
this->action = 4;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->direction = 0xff;
|
||||
InitializeAnimation(this, this->animationState + 0x10);
|
||||
} else {
|
||||
@@ -89,7 +89,7 @@ void sub_08020790(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08020798(Entity* this) {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
}
|
||||
|
||||
void nullsub_6(Entity* this) {
|
||||
@@ -98,11 +98,11 @@ void nullsub_6(Entity* this) {
|
||||
|
||||
void sub_080207A8(Entity* this) {
|
||||
this->action = 4;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spritePriority.b0 = 4;
|
||||
this->field_0x3a &= 0xfb;
|
||||
this->direction ^= 0x10;
|
||||
this->hVelocity = 0x18000;
|
||||
this->zVelocity = 0x18000;
|
||||
this->speed = 0x80;
|
||||
InitializeAnimation(this, this->animationState + 0x10);
|
||||
}
|
||||
@@ -118,14 +118,14 @@ void Rollobite_Initialize(Entity* this) {
|
||||
|
||||
void Rollobite_Walk(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x1) {
|
||||
this->frames.all &= ~0x1;
|
||||
if (this->frame & 0x1) {
|
||||
this->frame &= ~0x1;
|
||||
if (!ProcessMovement(this))
|
||||
this->actionDelay = 1;
|
||||
}
|
||||
|
||||
if (this->frames.all & 0x10) {
|
||||
this->frames.all &= ~0x10;
|
||||
if (this->frame & 0x10) {
|
||||
this->frame &= ~0x10;
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 3;
|
||||
this->actionDelay = 60;
|
||||
@@ -139,7 +139,7 @@ void sub_08020874(Entity* this) {
|
||||
|
||||
void sub_0802088C(Entity* this) {
|
||||
this->subAction = 1;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->cutsceneBeh.HALF.HI = gPlayerEntity.animationState;
|
||||
this->spritePriority.b1 = 0;
|
||||
}
|
||||
@@ -159,7 +159,7 @@ void sub_080208F0(Entity* this) {
|
||||
|
||||
void sub_08020904(Entity* this) {
|
||||
this->action = 4;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->direction = -1;
|
||||
InitializeAnimation(this, this->animationState + 0x10);
|
||||
}
|
||||
@@ -172,7 +172,7 @@ void Rollobite_Turn(Entity* this) {
|
||||
void Rollobite_RolledUp(Entity* this) {
|
||||
u32 unk;
|
||||
|
||||
if ((this->frames.all & 0x80) == 0)
|
||||
if ((this->frame & 0x80) == 0)
|
||||
GetNextFrame(this);
|
||||
|
||||
unk = sub_080044EC(this, 0x2800);
|
||||
@@ -194,15 +194,15 @@ void Rollobite_RolledUp(Entity* this) {
|
||||
|
||||
void Rollobite_Unroll(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
this->flags |= 0x80;
|
||||
if (this->frame & 0x80) {
|
||||
COLLISION_ON(this);
|
||||
this->speed = 0x100;
|
||||
this->damageType = 34;
|
||||
this->hitType = 34;
|
||||
sub_08020A30(this);
|
||||
this->direction = DirectionFromAnimationState(this->animationState);
|
||||
InitializeAnimation(this, this->animationState);
|
||||
} else {
|
||||
if ((this->frames.all & 1) == 0)
|
||||
if ((this->frame & 1) == 0)
|
||||
sub_08078930(this);
|
||||
}
|
||||
}
|
||||
@@ -213,7 +213,7 @@ void Rollobite_LinedUp(Entity* this) {
|
||||
this->spritePriority.b0 = 7;
|
||||
}
|
||||
|
||||
if (this->frames.all == 0)
|
||||
if (this->frame == 0)
|
||||
GetNextFrame(this);
|
||||
}
|
||||
|
||||
@@ -252,17 +252,17 @@ void sub_08020A7C(Entity* this) {
|
||||
}
|
||||
|
||||
bool32 Rollobite_TryToHoleUp(Entity* this) {
|
||||
if (Rollobite_IsRolledUp(this) && this->height.HALF.HI == 0) {
|
||||
if (Rollobite_IsRolledUp(this) && this->z.HALF.HI == 0) {
|
||||
int tile = COORD_TO_TILE(this);
|
||||
int iVar1 = GetTileType(tile, this->collisionLayer);
|
||||
if ((iVar1 * 0x10000 - 0x710000U) >> 0x10 < 2) {
|
||||
this->action = 6;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->x.HALF.HI &= 0xfff0;
|
||||
this->x.HALF.HI += 8;
|
||||
this->y.HALF.HI &= 0xfff0;
|
||||
this->y.HALF.HI += 13;
|
||||
this->hVelocity = 0x20000;
|
||||
this->zVelocity = 0x20000;
|
||||
InitializeAnimation(this, this->animationState + 0x14);
|
||||
SetTile(0x4034, tile, this->collisionLayer);
|
||||
return TRUE;
|
||||
|
||||
+4
-4
@@ -67,8 +67,8 @@ void sub_08031434(Entity* this) {
|
||||
} else {
|
||||
this->action = 1;
|
||||
this->subAction = 0;
|
||||
this->spriteSettings.b.draw = (this->spriteSettings.b.draw & 0xfc);
|
||||
this->height.HALF.HI = -0x80;
|
||||
this->spriteSettings.draw = (this->spriteSettings.draw & 0xfc);
|
||||
this->z.HALF.HI = -0x80;
|
||||
this->frameIndex = 0xff;
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ void sub_08031480(Entity* this) {
|
||||
sub_08031600(this);
|
||||
this->action = 1;
|
||||
this->subAction = 1;
|
||||
this->spriteSettings.b.draw = 3;
|
||||
this->spriteSettings.draw = 3;
|
||||
this->spriteRendering.b3 = 1;
|
||||
this->spriteOrientation.flipY = 1;
|
||||
SoundReq(SFX_12D);
|
||||
@@ -90,7 +90,7 @@ void sub_08031480(Entity* this) {
|
||||
if (sub_08003FC4(this, 0x1800) == 0) {
|
||||
this->action = 2;
|
||||
this->field_0xf = 0xf;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
EnqueueSFX(0x84);
|
||||
}
|
||||
|
||||
+24
-24
@@ -47,7 +47,7 @@ void sub_08029300(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08029318(Entity* this) {
|
||||
if (this->damageType == 0x8e) {
|
||||
if (this->hitType == 0x8e) {
|
||||
sub_08029770(this);
|
||||
} else {
|
||||
if (this->action == 4) {
|
||||
@@ -56,7 +56,7 @@ void sub_08029318(Entity* this) {
|
||||
if (*(u8*)(*(u32*)&this->field_0x4c + 8) == 1) {
|
||||
if (this->action == 2) {
|
||||
InitializeAnimation(this, 0);
|
||||
InitializeAnimation(this->attachedEntity, 4);
|
||||
InitializeAnimation(this->child, 4);
|
||||
}
|
||||
this->action = 4;
|
||||
this->actionDelay = 0x3c;
|
||||
@@ -84,7 +84,7 @@ void nullsub_141() {
|
||||
void sub_080293DC(Entity* this) {
|
||||
CopyPositionAndSpriteOffset(this->parent, this);
|
||||
this->y.HALF.HI++;
|
||||
this->height.HALF.HI--;
|
||||
this->z.HALF.HI--;
|
||||
gUnk_080CCC3C[this->action](this);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ void sub_0802940C(Entity* this) {
|
||||
sub_0804A720(this);
|
||||
ent->parent = this;
|
||||
ent->type2 = 1;
|
||||
this->attachedEntity = ent;
|
||||
this->child = ent;
|
||||
this->field_0x80.HALF.HI = 0;
|
||||
this->cutsceneBeh.HALF.LO = 0;
|
||||
this->field_0x82.HALF.LO = this->palette.b.b0;
|
||||
@@ -115,18 +115,18 @@ void sub_08029474(Entity* this) {
|
||||
u32 bVar1;
|
||||
|
||||
sub_080296C8(this);
|
||||
if (this->frames.b.f3) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 3;
|
||||
this->actionDelay = 8;
|
||||
bVar1 = GetFacingDirection(this, &gPlayerEntity);
|
||||
this->direction = bVar1;
|
||||
this->animationState = (bVar1 << 0x18) >> 0x1c;
|
||||
InitializeAnimation(this, this->animationState);
|
||||
InitializeAnimation(this->attachedEntity, this->animationState + 4);
|
||||
InitializeAnimation(this->child, this->animationState + 4);
|
||||
} else {
|
||||
if (this->frames.all == 1) {
|
||||
this->frames.all = 0;
|
||||
this->flags |= 0x80;
|
||||
if (this->frame == 1) {
|
||||
this->frame = 0;
|
||||
COLLISION_ON(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -142,9 +142,9 @@ void sub_080294D4(Entity* this) {
|
||||
sub_080296C8(this);
|
||||
} else {
|
||||
this->action = 6;
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, 3);
|
||||
InitializeAnimation(this->attachedEntity, 7);
|
||||
InitializeAnimation(this->child, 7);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,9 +189,9 @@ void sub_08029610(Entity* this) {
|
||||
|
||||
void sub_08029630(Entity* this) {
|
||||
sub_080296C8(this);
|
||||
if ((this->frames.b.f3) != 0) {
|
||||
if (this->frame & 0x80) {
|
||||
this->field_0x80.HALF.HI = 1;
|
||||
this->attachedEntity->spriteSettings.b.draw = FALSE;
|
||||
this->child->spriteSettings.draw = FALSE;
|
||||
sub_080297F0(this);
|
||||
}
|
||||
}
|
||||
@@ -219,23 +219,23 @@ void sub_0802969C(Entity* this) {
|
||||
if (bVar1 != this->animationState) {
|
||||
this->animationState = bVar1;
|
||||
InitializeAnimation(this, bVar1);
|
||||
InitializeAnimation(this->attachedEntity, bVar1 + 4);
|
||||
InitializeAnimation(this->child, bVar1 + 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080296C8(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
GetNextFrame(this->attachedEntity);
|
||||
GetNextFrame(this->child);
|
||||
}
|
||||
|
||||
void sub_080296D8(Entity* this) {
|
||||
gPlayerState.jumpStatus = 0x41;
|
||||
gPlayerState.flags &= 0xffffffef;
|
||||
gPlayerEntity.flags |= 0x80;
|
||||
gPlayerEntity.hVelocity = 0x18000;
|
||||
gPlayerEntity.zVelocity = 0x18000;
|
||||
gPlayerEntity.iframes = 0xa6;
|
||||
gPlayerEntity.height.HALF.HI = -2;
|
||||
gPlayerEntity.z.HALF.HI = -2;
|
||||
gPlayerEntity.direction = gPlayerEntity.animationState << 2;
|
||||
gPlayerEntity.spritePriority.b1 = this->field_0x80.HALF.LO;
|
||||
gPlayerEntity.spriteOffsetY = 0;
|
||||
@@ -252,16 +252,16 @@ void sub_08029770(Entity* this) {
|
||||
u32 temp;
|
||||
if (LoadFixedGFX(this, 0x73) != 0) {
|
||||
this->action = 2;
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->spriteIndex = 0xd1;
|
||||
this->spritePriority.b1 = 3;
|
||||
temp = this->field_0x82.HALF.LO;
|
||||
this->palette.b.b0 = temp;
|
||||
this->damageType = 0x8d;
|
||||
this->hitType = 0x8d;
|
||||
this->hitbox = &gUnk_080FD260;
|
||||
InitializeAnimation(this, 2);
|
||||
this->attachedEntity->spriteSettings.b.draw = TRUE;
|
||||
InitializeAnimation(this->attachedEntity, 6);
|
||||
this->child->spriteSettings.draw = TRUE;
|
||||
InitializeAnimation(this->child, 6);
|
||||
CreateDust(this);
|
||||
}
|
||||
}
|
||||
@@ -270,9 +270,9 @@ void sub_080297F0(Entity* this) {
|
||||
u32 temp;
|
||||
this->action = 1;
|
||||
this->actionDelay = 0x78;
|
||||
this->flags = this->flags | 0x80;
|
||||
this->spriteSettings.b.draw = TRUE;
|
||||
this->damageType = 0x8e;
|
||||
COLLISION_ON(this);
|
||||
this->spriteSettings.draw = TRUE;
|
||||
this->hitType = 0x8e;
|
||||
sub_080AE068(this);
|
||||
#ifdef EU
|
||||
this->spriteIndex = 0x142;
|
||||
|
||||
+5
-5
@@ -33,7 +33,7 @@ void sub_08044F70(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08044F88(Entity* this) {
|
||||
if ((this->currentHealth != 0) && (this->cutsceneBeh.HALF.LO != this->currentHealth)) {
|
||||
if ((this->health != 0) && (this->cutsceneBeh.HALF.LO != this->health)) {
|
||||
this->action = 4;
|
||||
} else {
|
||||
sub_0804AA30(this, gUnk_080D16A4);
|
||||
@@ -49,7 +49,7 @@ void nullsub_171() {
|
||||
|
||||
void sub_08044FC8(Entity* this) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->speed = 128;
|
||||
sub_0804A720(this);
|
||||
InitializeAnimation(this, 0);
|
||||
@@ -59,7 +59,7 @@ void sub_08044FC8(Entity* this) {
|
||||
void sub_08044FF8(Entity* this) {
|
||||
this->action = 2;
|
||||
this->actionDelay = (Random() & 31) + 30;
|
||||
this->cutsceneBeh.HALF.LO = this->currentHealth;
|
||||
this->cutsceneBeh.HALF.LO = this->health;
|
||||
}
|
||||
|
||||
void sub_08045018(Entity* this) {
|
||||
@@ -105,10 +105,10 @@ void sub_080450A8(Entity* this) {
|
||||
off = gUnk_080D16D4;
|
||||
for (i = 0; i < count; i++) {
|
||||
ent = entities[i];
|
||||
ent->attachedEntity = entities[(i + 1) % count];
|
||||
ent->child = entities[(i + 1) % count];
|
||||
ent->parent = entities[(i + count - 1) % count];
|
||||
ent->type2 = 1;
|
||||
ent->height.HALF.HI = 0;
|
||||
ent->z.HALF.HI = 0;
|
||||
ent->iframes = -0x10;
|
||||
|
||||
/* Set MiniSlime offset relative to killed slime. */
|
||||
|
||||
+11
-11
@@ -27,7 +27,7 @@ void Sluggula(Entity* this) {
|
||||
|
||||
SetChildOffset(this, 0, 1, -0x10);
|
||||
} else if (this->type == 0) {
|
||||
if (this->height.HALF.HI == 0) {
|
||||
if (this->z.HALF.HI == 0) {
|
||||
u32 idx = sub_080012DC(this);
|
||||
if (idx != 0) {
|
||||
gUnk_080012C8[idx](this);
|
||||
@@ -75,7 +75,7 @@ void sub_08023C8C(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
sub_08023E54(this);
|
||||
if (--this->actionDelay == 0) {
|
||||
if (this->frames.all != 1) {
|
||||
if (this->frame != 1) {
|
||||
this->actionDelay = 8;
|
||||
} else {
|
||||
this->actionDelay = (Random() & 0x30) + 0xb4;
|
||||
@@ -95,11 +95,11 @@ void sub_08023CE0(Entity* this) {
|
||||
if (this->actionDelay == 0) {
|
||||
this->actionDelay = 1;
|
||||
}
|
||||
this->spriteSettings.b.draw = 3;
|
||||
this->spriteSettings.draw = 3;
|
||||
} else {
|
||||
this->action = 1;
|
||||
}
|
||||
this->height.HALF.HI = -0x80;
|
||||
this->z.HALF.HI = -0x80;
|
||||
this->spriteRendering.b3 = 1;
|
||||
this->spriteOrientation.flipY = 1;
|
||||
InitializeAnimation(this, 6);
|
||||
@@ -110,7 +110,7 @@ void sub_08023CE0(Entity* this) {
|
||||
if (this->actionDelay == 0) {
|
||||
this->actionDelay = 8;
|
||||
}
|
||||
this->spriteSettings.b.draw = 3;
|
||||
this->spriteSettings.draw = 3;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
@@ -121,23 +121,23 @@ void sub_08023CE0(Entity* this) {
|
||||
}
|
||||
} else if (!sub_08003FC4(this, 0x1800)) {
|
||||
this->action = 3;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
EnqueueSFX(0x84);
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all) {
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame) {
|
||||
if (this->frame & 0x80) {
|
||||
Entity* ent = CreateEnemy(SLUGGULA, 1);
|
||||
if (ent) {
|
||||
sub_0804A4E4(this, ent);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
} else {
|
||||
this->y.HALF.HI += gUnk_080CBDF4[this->frames.all - 1];
|
||||
this->frames.all = 0;
|
||||
this->y.HALF.HI += gUnk_080CBDF4[this->frame - 1];
|
||||
this->frame = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -152,7 +152,7 @@ void sub_08023E10(Entity* this) {
|
||||
}
|
||||
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80)
|
||||
if (this->frame & 0x80)
|
||||
DeleteEntity(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ void sub_0803169C(Entity* this) {
|
||||
if (iVar1 == 0) {
|
||||
this->action = 1;
|
||||
this->subAction = 0;
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->speed = 0x40;
|
||||
this->field_0xf = 1;
|
||||
} else {
|
||||
@@ -87,17 +87,17 @@ void sub_08031770(Entity* this) {
|
||||
if (--this->field_0x80.HWORD == 0) {
|
||||
sub_08031840(this);
|
||||
}
|
||||
} else if (this->attachedEntity == NULL) {
|
||||
} else if (this->child == NULL) {
|
||||
this->field_0x80.HWORD = (Random() & 0x7f) | (0x80 << 2);
|
||||
} else {
|
||||
if (this->attachedEntity->next == NULL) {
|
||||
this->attachedEntity = NULL;
|
||||
if (this->child->next == NULL) {
|
||||
this->child = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080317B4(Entity* this) {
|
||||
this->height.HALF.HI = ((Random() & 0x30) != 0) ? -0xc : -0xd;
|
||||
this->z.HALF.HI = ((Random() & 0x30) != 0) ? -0xc : -0xd;
|
||||
sub_0806F69C(this);
|
||||
GetNextFrame(this);
|
||||
}
|
||||
@@ -110,7 +110,7 @@ void sub_080317E0(Entity* this) {
|
||||
void sub_080317F8(Entity* this) {
|
||||
u8 newDirection = Random() & 0x18;
|
||||
this->action = 1;
|
||||
this->height.HALF.HI = 0x0000FFF4;
|
||||
this->z.HALF.HI = 0x0000FFF4;
|
||||
this->collisionLayer = 1;
|
||||
this->field_0x3c |= 0x10;
|
||||
this->field_0x1c = 1;
|
||||
@@ -126,7 +126,7 @@ void sub_08031840(Entity* this) {
|
||||
if (enemy != NULL) {
|
||||
CopyPosition(this, enemy);
|
||||
enemy->parent = this;
|
||||
this->attachedEntity = enemy;
|
||||
this->child = enemy;
|
||||
enemy->type2 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -20,13 +20,13 @@ void sub_0802B2E0(Entity* this) {
|
||||
|
||||
if (this->bitfield & 0x80) {
|
||||
if ((this->bitfield & 0x7f) == 0x14) {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->iframes = 0;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
this->action = 2;
|
||||
ent = CreateFx(this, FX_DEATH, 0);
|
||||
if (ent) {
|
||||
this->attachedEntity = ent;
|
||||
this->child = ent;
|
||||
this->actionDelay = 14;
|
||||
CopyPosition(this, ent);
|
||||
}
|
||||
|
||||
@@ -31,8 +31,8 @@ extern const Hitbox* const gUnk_080CC944[];
|
||||
void SpearMoblin(Entity* this) {
|
||||
EnemyFunctionHandler(this, gUnk_080CC790);
|
||||
SetChildOffset(this, 0, 1, -0x20);
|
||||
if (this->attachedEntity && this->attachedEntity->next) {
|
||||
CopyPosition(this, this->attachedEntity);
|
||||
if (this->child && this->child->next) {
|
||||
CopyPosition(this, this->child);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,13 +57,13 @@ void sub_08028284(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
this->attachedEntity->iframes = this->iframes;
|
||||
if (this->currentHealth == 0) {
|
||||
this->child->iframes = this->iframes;
|
||||
if (this->health == 0) {
|
||||
this->speed = 0;
|
||||
this->field_0x82.HALF.LO = 0;
|
||||
sub_080287E0(this);
|
||||
DeleteEntity(this->attachedEntity);
|
||||
this->attachedEntity = NULL;
|
||||
DeleteEntity(this->child);
|
||||
this->child = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ void sub_08028314(Entity* this) {
|
||||
pEVar2 = CreateProjectile(3);
|
||||
if (pEVar2 != NULL) {
|
||||
pEVar2->parent = this;
|
||||
this->attachedEntity = pEVar2;
|
||||
this->child = pEVar2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ bool32 sub_080288A4(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_080288C0(Entity* this) {
|
||||
Entity* ent = this->attachedEntity;
|
||||
Entity* ent = this->child;
|
||||
if (ent && (ent->bitfield & 0x80)) {
|
||||
this->knockbackDirection = ent->knockbackDirection;
|
||||
this->iframes = -ent->iframes;
|
||||
|
||||
@@ -49,12 +49,12 @@ void sub_0802B628(Entity* this) {
|
||||
case 0x1d:
|
||||
if (this->action < 6) {
|
||||
this->action = 6;
|
||||
this->hVelocity = 0x18000;
|
||||
this->zVelocity = 0x18000;
|
||||
this->speed = 0xc0;
|
||||
this->direction = this->knockbackDirection;
|
||||
this->knockbackDuration = 0;
|
||||
this->iframes = -8;
|
||||
this->damageType = 100;
|
||||
this->hitType = 100;
|
||||
InitializeAnimation(this, 9);
|
||||
}
|
||||
}
|
||||
@@ -166,9 +166,9 @@ void sub_0802B8E0(Entity* this) {
|
||||
}
|
||||
} else {
|
||||
this->action = 8;
|
||||
this->hVelocity = 0x10000;
|
||||
this->zVelocity = 0x10000;
|
||||
this->speed = 0x60;
|
||||
this->damageType = 99;
|
||||
this->hitType = 99;
|
||||
InitializeAnimation(this, this->animationState);
|
||||
EnqueueSFX(299);
|
||||
}
|
||||
|
||||
+26
-26
@@ -32,14 +32,14 @@ void sub_08022434(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802244C(Entity* this) {
|
||||
if (this->currentHealth) {
|
||||
if (this->damageType == 0x65) {
|
||||
if (this->health) {
|
||||
if (this->hitType == 0x65) {
|
||||
switch (this->bitfield & 0x7f) {
|
||||
case 2:
|
||||
case 3:
|
||||
this->action = 2;
|
||||
this->field_0xf = 0x3c;
|
||||
this->damageType = 0x5c;
|
||||
this->hitType = 0x5c;
|
||||
this->hitbox = &gHitbox_23;
|
||||
InitializeAnimation(this, 0);
|
||||
break;
|
||||
@@ -54,7 +54,7 @@ void sub_0802244C(Entity* this) {
|
||||
case 0x1a:
|
||||
sub_0804A9FC(this, 0x1c);
|
||||
this->action = 5;
|
||||
this->damageType = 0x5c;
|
||||
this->hitType = 0x5c;
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
} else if (this->bitfield == 0x94) {
|
||||
@@ -63,9 +63,9 @@ void sub_0802244C(Entity* this) {
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
|
||||
if (this->field_0x80.HALF.LO != this->currentHealth) {
|
||||
if (this->field_0x80.HALF.LO != this->health) {
|
||||
this->action = 5;
|
||||
this->damageType = 0x5c;
|
||||
this->hitType = 0x5c;
|
||||
InitializeAnimation(this, 1);
|
||||
} else {
|
||||
if (this->action == 3) {
|
||||
@@ -78,7 +78,7 @@ void sub_0802244C(Entity* this) {
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
|
||||
this->field_0x80.HALF.LO = this->currentHealth;
|
||||
this->field_0x80.HALF.LO = this->health;
|
||||
sub_0804AA30(this, gUnk_080CBA28);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ void sub_080225A0(Entity* this) {
|
||||
|
||||
void sub_080225BC(Entity* this) {
|
||||
sub_08003FC4(this, 0x1800);
|
||||
if (this->frames.all & 1) {
|
||||
if (this->frame & 1) {
|
||||
sub_0804A7D4(this);
|
||||
} else {
|
||||
GetNextFrame(this);
|
||||
@@ -102,7 +102,7 @@ void nullsub_9(Entity* this) {
|
||||
|
||||
void sub_080225EC(Entity* this) {
|
||||
sub_0804A720(this);
|
||||
this->field_0x80.HALF.LO = this->currentHealth;
|
||||
this->field_0x80.HALF.LO = this->health;
|
||||
this->field_0x80.HALF.HI = 0x5a;
|
||||
if (this->actionDelay == 0) {
|
||||
this->action = 2;
|
||||
@@ -110,10 +110,10 @@ void sub_080225EC(Entity* this) {
|
||||
} else {
|
||||
this->action = 1;
|
||||
this->field_0xf = 0x3c;
|
||||
this->spriteSettings.b.draw = 3;
|
||||
this->spriteSettings.draw = 3;
|
||||
this->spriteRendering.b3 = 1;
|
||||
this->spriteOrientation.flipY = 1;
|
||||
this->height.HALF.HI = -0x80;
|
||||
this->z.HALF.HI = -0x80;
|
||||
InitializeAnimation(this, 6);
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ void sub_08022654(Entity* this) {
|
||||
return;
|
||||
|
||||
this->subAction = 2;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
InitializeAnimation(this, 5);
|
||||
EnqueueSFX(0x7d);
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
@@ -141,7 +141,7 @@ void sub_08022654(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 3;
|
||||
this->damageType = 0x65;
|
||||
this->hitType = 0x65;
|
||||
InitializeAnimation(this, 2);
|
||||
}
|
||||
break;
|
||||
@@ -152,17 +152,17 @@ void sub_080226EC(Entity* this) {
|
||||
if (sub_08049FDC(this, 1)) {
|
||||
if (sub_080228CC(this)) {
|
||||
this->action = 3;
|
||||
this->damageType = 0x65;
|
||||
this->hitType = 0x65;
|
||||
InitializeAnimation(this, 2);
|
||||
return;
|
||||
}
|
||||
|
||||
if (sub_080228F0(this)) {
|
||||
this->action = 6;
|
||||
this->hVelocity = 0x12000;
|
||||
this->zVelocity = 0x12000;
|
||||
this->speed = 0x140;
|
||||
this->direction = GetFacingDirection(this, gUnk_020000B0);
|
||||
this->damageType = 0x5a;
|
||||
this->hitType = 0x5a;
|
||||
InitializeAnimation(this, 4);
|
||||
return;
|
||||
}
|
||||
@@ -179,7 +179,7 @@ void sub_080226EC(Entity* this) {
|
||||
|
||||
void sub_08022780(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 4;
|
||||
InitializeAnimation(this, 3);
|
||||
EnqueueSFX(0x194);
|
||||
@@ -188,18 +188,18 @@ void sub_08022780(Entity* this) {
|
||||
|
||||
void sub_080227AC(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 1) {
|
||||
if (this->frame & 1) {
|
||||
this->hitbox = &gHitbox_32;
|
||||
} else {
|
||||
this->hitbox = &gHitbox_23;
|
||||
}
|
||||
|
||||
if (this->frames.all & 2) {
|
||||
this->frames.all &= ~2;
|
||||
this->damageType = 0x5c;
|
||||
if (this->frame & 2) {
|
||||
this->frame &= ~2;
|
||||
this->hitType = 0x5c;
|
||||
}
|
||||
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 2;
|
||||
this->field_0xf = gUnk_080CBA60[Random() & 3];
|
||||
InitializeAnimation(this, 0);
|
||||
@@ -209,7 +209,7 @@ void sub_080227AC(Entity* this) {
|
||||
void sub_0802281C(Entity* this) {
|
||||
sub_08003FC4(this, 0x1800);
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 2;
|
||||
this->speed = 0x20;
|
||||
InitializeAnimation(this, 0);
|
||||
@@ -219,11 +219,11 @@ void sub_0802281C(Entity* this) {
|
||||
|
||||
void sub_08022854(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 1) {
|
||||
if (this->frame & 1) {
|
||||
sub_080AEFE0(this);
|
||||
if (sub_08003FC4(this, 0x1800) == 0) {
|
||||
this->action = 7;
|
||||
this->damageType = 0x5c;
|
||||
this->hitType = 0x5c;
|
||||
InitializeAnimation(this, 5);
|
||||
EnqueueSFX(0x7d);
|
||||
}
|
||||
@@ -232,7 +232,7 @@ void sub_08022854(Entity* this) {
|
||||
|
||||
void sub_0802289C(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 2;
|
||||
this->speed = 0x20;
|
||||
this->field_0x80.HALF.HI = 0x78;
|
||||
|
||||
+12
-12
@@ -38,16 +38,16 @@ void sub_0802F150(Entity* this) {
|
||||
}
|
||||
this->field_0xf = 0;
|
||||
*(u8*)&this->field_0x7c = 0;
|
||||
if (this->height.HALF.HI != 0) {
|
||||
this->hVelocity >>= 2;
|
||||
if (this->z.HALF.HI != 0) {
|
||||
this->zVelocity >>= 2;
|
||||
} else {
|
||||
this->hVelocity = 0;
|
||||
this->zVelocity = 0;
|
||||
}
|
||||
InitializeAnimation(this, 0);
|
||||
break;
|
||||
case 0xe:
|
||||
case 0x15:
|
||||
this->currentHealth = 0;
|
||||
this->health = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,7 @@ void nullsub_16(Entity* this) {
|
||||
|
||||
void sub_0802F1F0(Entity* this) {
|
||||
sub_08001242(this);
|
||||
if (this->height.HALF.HI != 0) {
|
||||
if (this->z.HALF.HI != 0) {
|
||||
sub_08003FC4(this, this->field_0x80.HWORD);
|
||||
}
|
||||
}
|
||||
@@ -91,15 +91,15 @@ void sub_0802F284(Entity* this) {
|
||||
if (this->actionDelay != 0) {
|
||||
this->actionDelay--;
|
||||
} else if (this->field_0xf != 0) {
|
||||
if ((this->frames.b.f3) != 0) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 0x10;
|
||||
this->field_0xf = this->type;
|
||||
this->hVelocity = this->field_0x82.HWORD << 4;
|
||||
this->zVelocity = this->field_0x82.HWORD << 4;
|
||||
sub_0802F45C(this);
|
||||
InitializeAnimation(this, 2);
|
||||
}
|
||||
} else if ((this->frames.b.f3) != 0) {
|
||||
} else if (this->frame & 0x80) {
|
||||
this->field_0xf = 0x40;
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
@@ -111,7 +111,7 @@ void sub_0802F300(Entity* this) {
|
||||
|
||||
GetNextFrame(this);
|
||||
ProcessMovement(this);
|
||||
temp = this->height.HALF.HI;
|
||||
temp = this->z.HALF.HI;
|
||||
rand = Random() & 0xf;
|
||||
|
||||
if (sub_080044EC(this, this->field_0x80.HWORD) == 1) {
|
||||
@@ -143,7 +143,7 @@ void sub_0802F300(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
if ((this->subAction == 0) && (temp < this->height.HALF.HI)) {
|
||||
if ((this->subAction == 0) && (temp < this->z.HALF.HI)) {
|
||||
InitializeAnimation(this, 4);
|
||||
this->subAction = 1;
|
||||
}
|
||||
@@ -161,12 +161,12 @@ void sub_0802F3F4(Entity* this) {
|
||||
|
||||
GetNextFrame(this);
|
||||
|
||||
if ((this->frames.b.f3) != 0) {
|
||||
if (this->frame & 0x80) {
|
||||
if ((*(u8*)&this->field_0x7c.HALF.LO < 2) && ((this->type % 2) != 0)) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 0x10;
|
||||
this->field_0xf = this->type;
|
||||
this->hVelocity = this->field_0x82.HWORD << 4;
|
||||
this->zVelocity = this->field_0x82.HWORD << 4;
|
||||
(*(u8*)&this->field_0x7c.HALF.LO)++;
|
||||
sub_0802F45C(this);
|
||||
InitializeAnimation(this, 2);
|
||||
|
||||
+11
-11
@@ -32,10 +32,10 @@ void sub_08037F00(Entity* this) {
|
||||
this->actionDelay = 0x14;
|
||||
this->field_0xf = 0;
|
||||
this->field_0x80.HALF.LO = 0;
|
||||
if (this->height.HALF.HI != 0) {
|
||||
this->hVelocity >>= 2;
|
||||
if (this->z.HALF.HI != 0) {
|
||||
this->zVelocity >>= 2;
|
||||
} else {
|
||||
this->hVelocity = 0;
|
||||
this->zVelocity = 0;
|
||||
}
|
||||
|
||||
InitializeAnimation(this, 0);
|
||||
@@ -58,7 +58,7 @@ void sub_08037F58(Entity* this) {
|
||||
|
||||
void sub_08037F84(Entity* this) {
|
||||
sub_08001242(this);
|
||||
if (this->height.HALF.HI != 0) {
|
||||
if (this->z.HALF.HI != 0) {
|
||||
sub_08003FC4(this, 0x3000);
|
||||
}
|
||||
}
|
||||
@@ -82,15 +82,15 @@ void sub_08037Fe0(Entity* this) {
|
||||
if (this->actionDelay != 0) {
|
||||
this->actionDelay--;
|
||||
} else if (this->field_0xf != 0) {
|
||||
if ((this->frames.b.f3) != 0) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 6;
|
||||
this->field_0xf = 0;
|
||||
this->hVelocity = 0x38000;
|
||||
this->zVelocity = 0x38000;
|
||||
sub_08038168(this);
|
||||
InitializeAnimation(this, 2);
|
||||
}
|
||||
} else if ((this->frames.b.f3) != 0) {
|
||||
} else if (this->frame & 0x80) {
|
||||
this->field_0xf = 0x40;
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
@@ -102,7 +102,7 @@ void sub_08038048(Entity* this) {
|
||||
|
||||
UpdateAnimationVariableFrames(this, 2);
|
||||
ProcessMovement(this);
|
||||
temp = this->height.HALF.HI;
|
||||
temp = this->z.HALF.HI;
|
||||
rand = Random() & 0xf;
|
||||
|
||||
if (sub_080044EC(this, 0x3000) == 1) {
|
||||
@@ -122,7 +122,7 @@ void sub_08038048(Entity* this) {
|
||||
sub_08038168(this);
|
||||
}
|
||||
|
||||
if ((this->subAction == 0) && (temp < this->height.HALF.HI)) {
|
||||
if ((this->subAction == 0) && (temp < this->z.HALF.HI)) {
|
||||
InitializeAnimation(this, 4);
|
||||
this->subAction = 1;
|
||||
}
|
||||
@@ -138,11 +138,11 @@ void sub_08038048(Entity* this) {
|
||||
|
||||
void sub_08038110(Entity* this) {
|
||||
UpdateAnimationVariableFrames(this, 2);
|
||||
if ((this->frames.b.f3) != 0) {
|
||||
if (this->frame & 0x80) {
|
||||
if (this->field_0x80.HALF.LO < 5) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 8;
|
||||
this->hVelocity = 0x38000;
|
||||
this->zVelocity = 0x38000;
|
||||
sub_08038168(this);
|
||||
InitializeAnimation(this, 2);
|
||||
} else {
|
||||
|
||||
@@ -47,7 +47,7 @@ void TreeItem(Entity* this) {
|
||||
if (itemEntity) {
|
||||
CopyPosition(this, itemEntity);
|
||||
itemEntity->y.HALF.HI += 16;
|
||||
itemEntity->height.HALF.HI = -32;
|
||||
itemEntity->z.HALF.HI = -32;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+60
-60
@@ -355,7 +355,7 @@ void sub_080428FC(Entity* this) {
|
||||
SoundReq(SFX_153);
|
||||
uVar2 = 0;
|
||||
do {
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[uVar2]->damageType = 0x3b;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[uVar2]->hitType = 0x3b;
|
||||
uVar2 = uVar2 + 1;
|
||||
} while (uVar2 < 5);
|
||||
}
|
||||
@@ -387,7 +387,7 @@ void sub_08042970(Entity* this) {
|
||||
this->actionDelay = 0x3c;
|
||||
uVar2 = 0;
|
||||
do {
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[uVar2]->damageType = 0x39;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[uVar2]->hitType = 0x39;
|
||||
uVar2 = uVar2 + 1;
|
||||
} while (uVar2 < 5);
|
||||
}
|
||||
@@ -425,7 +425,7 @@ void sub_08042A3C(Entity* this) {
|
||||
gUnk_080D12B8[this->subAction](this);
|
||||
sub_08043A10(this);
|
||||
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4];
|
||||
entity->height.HALF.HI += this->field_0x78.HALF.LO;
|
||||
entity->z.HALF.HI += this->field_0x78.HALF.LO;
|
||||
}
|
||||
|
||||
void sub_08042A6C(Entity* this) {
|
||||
@@ -460,9 +460,9 @@ void sub_08042AEC(Entity* this) {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->subAction = 3;
|
||||
this->actionDelay = 4;
|
||||
this->damageType = 0x3d;
|
||||
this->hitType = 0x3d;
|
||||
InitAnimationForceUpdate(this, 0xe);
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->damageType = 0x3d;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x3d;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -481,11 +481,11 @@ void sub_08042B20(Entity* this) {
|
||||
if (0x30 < ptr->unk04.HALF.HI) {
|
||||
ptr->unk00.HWORD += ptr->unk08;
|
||||
}
|
||||
if (((VaatiArm_HeapStruct*)this->myHeap)->entities[3]->spriteSettings.b.draw) {
|
||||
if (((VaatiArm_HeapStruct*)this->myHeap)->entities[3]->spriteSettings.draw) {
|
||||
sub_08043C40(this, ptr);
|
||||
for (i = 0; i < 4; i++) {
|
||||
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i];
|
||||
if ((-0xa <= entity->height.HALF.HI) && ((entity->spriteSettings.b.draw) == 1)) {
|
||||
if ((-0xa <= entity->z.HALF.HI) && ((entity->spriteSettings.draw) == 1)) {
|
||||
if (i == 0) {
|
||||
object = CreateObject(OBJECT_AF, 0, 0);
|
||||
if (object != NULL) {
|
||||
@@ -498,7 +498,7 @@ void sub_08042B20(Entity* this) {
|
||||
}
|
||||
}
|
||||
entity->flags &= 0x7f;
|
||||
entity->spriteSettings.b.draw = 0;
|
||||
entity->spriteSettings.draw = 0;
|
||||
SoundReq(SFX_161);
|
||||
}
|
||||
}
|
||||
@@ -508,8 +508,8 @@ void sub_08042B20(Entity* this) {
|
||||
this->action = 5;
|
||||
this->subAction = 0;
|
||||
this->actionDelay = 0x1e;
|
||||
this->damageType = 0x39;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->damageType = 0x39;
|
||||
this->hitType = 0x39;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x39;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -564,8 +564,8 @@ void sub_08042C34(Entity* this) {
|
||||
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i];
|
||||
entity->x.HALF.HI = x;
|
||||
entity->y.HALF.HI = y;
|
||||
entity->height.HALF.HI = 0x32;
|
||||
entity->damageType = 0x39;
|
||||
entity->z.HALF.HI = 0x32;
|
||||
entity->hitType = 0x39;
|
||||
ptr = &((VaatiArm_HeapStruct*)this->myHeap)->s1[i];
|
||||
ptr->unk00.HWORD = 0x80;
|
||||
ptr->unk04.HWORD = 0;
|
||||
@@ -582,8 +582,8 @@ void sub_08042D24(Entity* this) {
|
||||
|
||||
if (--this->actionDelay == 0) {
|
||||
this->subAction = 2;
|
||||
this->damageType = 0x3d;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->damageType = 0x3d;
|
||||
this->hitType = 0x3d;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x3d;
|
||||
entity = CreateObject(OBJECT_AF, 1, 0);
|
||||
if (entity != NULL) {
|
||||
entity->parent = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3];
|
||||
@@ -600,30 +600,30 @@ void sub_08042D6C(Entity* this) {
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i];
|
||||
if (entity->height.HALF.HI < 4) {
|
||||
if (entity->z.HALF.HI < 4) {
|
||||
if (i != 2) {
|
||||
entity->flags = entity->flags | 0x80;
|
||||
}
|
||||
if ((entity->spriteSettings.b.draw == 0u) && (object = CreateObject(OBJECT_AF, 2, 0), object != NULL)) {
|
||||
if ((entity->spriteSettings.draw == 0u) && (object = CreateObject(OBJECT_AF, 2, 0), object != NULL)) {
|
||||
CopyPosition(entity, object);
|
||||
SoundReq(SFX_166);
|
||||
}
|
||||
entity->spriteSettings.b.draw = 1;
|
||||
entity->spriteSettings.draw = 1;
|
||||
}
|
||||
}
|
||||
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3];
|
||||
if (entity->height.HALF.HI <= -3) {
|
||||
entity->height.HALF.HI = -5;
|
||||
if (entity->z.HALF.HI <= -3) {
|
||||
entity->z.HALF.HI = -5;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->s1[0].unk08 = gUnk_080D1300[this->type2];
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->s1[0].unk0a = 0xc0;
|
||||
this->subAction = 3;
|
||||
this->actionDelay = 0x1e;
|
||||
this->damageType = 0x39;
|
||||
this->hitType = 0x39;
|
||||
this->field_0x7c.BYTES.byte3 = 0x2d;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->damageType = 0x39;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x39;
|
||||
} else {
|
||||
entity->height.HALF.HI -= 2;
|
||||
entity->z.HALF.HI -= 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -710,15 +710,15 @@ void sub_08042FD8(Entity* this) {
|
||||
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (!sub_08043C98(this)) {
|
||||
if ((this->frames.all & 1) != 0) {
|
||||
if ((this->frame & 1) != 0) {
|
||||
entity = CreateProjectile(0x20);
|
||||
if (entity != NULL) {
|
||||
CopyPosition(this, entity);
|
||||
entity->height.HALF.HI -= 0x18;
|
||||
this->frames.all = 0;
|
||||
entity->z.HALF.HI -= 0x18;
|
||||
this->frame = 0;
|
||||
}
|
||||
} else {
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
if (--this->field_0xf == 0) {
|
||||
this->subAction = 8;
|
||||
this->actionDelay = 0x3c;
|
||||
@@ -742,7 +742,7 @@ void sub_08043048(Entity* this) {
|
||||
ptr[0].unk04.HWORD += 0x200;
|
||||
if (0x4f < ptr[0].unk04.HALF.HI) {
|
||||
for (i = 0; i < 5; i++) {
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->damageType = 0x3b;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->hitType = 0x3b;
|
||||
}
|
||||
SoundReq(SFX_153);
|
||||
}
|
||||
@@ -751,7 +751,7 @@ void sub_08043048(Entity* this) {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->subAction = 7;
|
||||
for (i = 0; i < 5; i++) {
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->damageType = 0x39;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->hitType = 0x39;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -802,18 +802,18 @@ void sub_08043130(Entity* this) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[3]->height.HALF.HI += 3;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[3]->z.HALF.HI += 3;
|
||||
for (i = 0; i < 4; i++) {
|
||||
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i];
|
||||
if (entity->height.HALF.HI > -4) {
|
||||
if (entity->z.HALF.HI > -4) {
|
||||
entity->flags = entity->flags & 0x7f;
|
||||
if (entity->spriteSettings.b.draw == 1) {
|
||||
if (entity->spriteSettings.draw == 1) {
|
||||
SoundReq(SFX_161);
|
||||
}
|
||||
entity->spriteSettings.b.draw = 0;
|
||||
entity->spriteSettings.draw = 0;
|
||||
}
|
||||
}
|
||||
if (this->spriteSettings.b.draw == 0) {
|
||||
if (this->spriteSettings.draw == 0) {
|
||||
this->subAction = 9;
|
||||
this->actionDelay = 0x3c;
|
||||
sub_0804AA1C(this);
|
||||
@@ -853,7 +853,7 @@ void sub_0804325C(Entity* this) {
|
||||
if (this->field_0x78.HALF.LO >= 3) {
|
||||
this->field_0x78.HALF.LO -= 2;
|
||||
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4];
|
||||
entity->height.HALF.HI += this->field_0x78.HALF.LO;
|
||||
entity->z.HALF.HI += this->field_0x78.HALF.LO;
|
||||
} else {
|
||||
this->field_0x78.HALF.LO = 0;
|
||||
}
|
||||
@@ -876,7 +876,7 @@ NONMATCH("asm/non_matching/vaati/sub_0804334C.inc", void sub_0804334C(Entity* th
|
||||
for (i = 0; i < 5; i++) {
|
||||
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i];
|
||||
entity->flags = entity->flags | 0x80;
|
||||
entity->spriteSettings.b.draw = 1;
|
||||
entity->spriteSettings.draw = 1;
|
||||
}
|
||||
}
|
||||
s = &((VaatiArm_HeapStruct*)this->myHeap)->s1[0];
|
||||
@@ -951,18 +951,18 @@ NONMATCH("asm/non_matching/vaati/sub_08043490.inc", void sub_08043490(Entity* th
|
||||
Entity* entity;
|
||||
|
||||
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4];
|
||||
if (entity->height.HALF.HI < -4) {
|
||||
entity->hVelocity = 0x18000;
|
||||
if (entity->z.HALF.HI < -4) {
|
||||
entity->zVelocity = 0x18000;
|
||||
this->subAction = 2;
|
||||
this->field_0x7c.BYTES.byte2 = 0;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->parent->subAction = 2;
|
||||
} else {
|
||||
entity->height.HALF.HI -= 2;
|
||||
if (entity->height.HALF.HI < 0) {
|
||||
entity->z.HALF.HI -= 2;
|
||||
if (entity->z.HALF.HI < 0) {
|
||||
entity->flags = entity->flags | 0x80;
|
||||
entity->spriteSettings.b.draw = 1;
|
||||
entity->spriteSettings.draw = 1;
|
||||
entity->field_0x3c = entity->field_0x3c & 0xef;
|
||||
entity->damageType = 0x3a;
|
||||
entity->hitType = 0x3a;
|
||||
entity->hitbox = (Hitbox*)&gUnk_080FD450;
|
||||
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[2];
|
||||
entity->flags = entity->flags | 0x80;
|
||||
@@ -979,8 +979,8 @@ void sub_08043520(Entity* this) {
|
||||
|
||||
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4];
|
||||
sub_08003FC4(entity, 0x1a00);
|
||||
if ((entity->hVelocity < 0) && (-6 < entity->height.HALF.HI)) {
|
||||
entity->height.HALF.HI = -6;
|
||||
if ((entity->zVelocity < 0) && (-6 < entity->z.HALF.HI)) {
|
||||
entity->z.HALF.HI = -6;
|
||||
this->subAction = 3;
|
||||
this->field_0x7a.HWORD = 900;
|
||||
}
|
||||
@@ -998,20 +998,20 @@ void sub_08043580(Entity* this) {
|
||||
Entity* entity;
|
||||
u32 i;
|
||||
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->height.HALF.HI += 3;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->z.HALF.HI += 3;
|
||||
for (i = 0; i < 5; i++) {
|
||||
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i];
|
||||
if (-4 < entity->height.HALF.HI) {
|
||||
if (-4 < entity->z.HALF.HI) {
|
||||
entity->flags = entity->flags & 0x7f;
|
||||
entity->spriteSettings.b.draw = 0;
|
||||
entity->spriteSettings.draw = 0;
|
||||
}
|
||||
}
|
||||
if ((this->spriteSettings.b.draw & 3) == 0) {
|
||||
if ((this->spriteSettings.draw & 3) == 0) {
|
||||
this->subAction = 5;
|
||||
this->actionDelay = 0x3c;
|
||||
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4];
|
||||
entity->field_0x3c = entity->field_0x3c | 0x10;
|
||||
entity->damageType = 0x39;
|
||||
entity->hitType = 0x39;
|
||||
entity->hitbox = (Hitbox*)&gUnk_080FD538;
|
||||
sub_0804AA1C(this);
|
||||
}
|
||||
@@ -1063,7 +1063,7 @@ static inline void deleteThing(Entity* this, const u32 index) {
|
||||
this->actionDelay = 0x14;
|
||||
this->subAction = index + 1;
|
||||
if (index == 1) {
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
}
|
||||
CreateFx(((VaatiArm_HeapStruct*)this->myHeap)->entities[index], FX_GIANT_EXPLOSION4, 0);
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[index]->myHeap = NULL;
|
||||
@@ -1099,7 +1099,7 @@ NONMATCH("asm/non_matching/vaati/sub_08043770.inc", void sub_08043770(Entity* th
|
||||
gScreenTransition.field_0x39 &= 0xfd;
|
||||
}
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->myHeap = NULL;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->currentHealth = 0;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->health = 0;
|
||||
(*(Entity**)&this->field_0x68)->parent = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4];
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -1170,7 +1170,7 @@ void sub_08043A10(Entity* this) {
|
||||
sub_08043B7C(this);
|
||||
sub_0804393C(((VaatiArm_HeapStruct*)this->myHeap)->entities[4]);
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->y.HALF.HI -= 8;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->height.HALF.HI -= 8;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->z.HALF.HI -= 8;
|
||||
sub_0804393C(((VaatiArm_HeapStruct*)this->myHeap)->entities[3]);
|
||||
sub_0804393C(((VaatiArm_HeapStruct*)this->myHeap)->entities[2]);
|
||||
sub_0804393C(((VaatiArm_HeapStruct*)this->myHeap)->entities[1]);
|
||||
@@ -1329,7 +1329,7 @@ void sub_08043D08(Entity* this) {
|
||||
InitAnimationForceUpdate(this, 0xd);
|
||||
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4];
|
||||
entity->flags &= 0x7f;
|
||||
entity->spriteSettings.b.draw = 0;
|
||||
entity->spriteSettings.draw = 0;
|
||||
InitializeAnimation(entity, 0x13);
|
||||
sub_0804AA1C(entity);
|
||||
fx = CreateFx(entity, FX_GIANT_EXPLOSION4, 0);
|
||||
@@ -1339,9 +1339,9 @@ void sub_08043D08(Entity* this) {
|
||||
fx->spritePriority.b0 = 3;
|
||||
}
|
||||
CopyPosition(((VaatiArm_HeapStruct*)this->myHeap)->entities[3], entity);
|
||||
entity->height.HALF.HI += ((VaatiArm_HeapStruct*)this->myHeap)->s1[3].unk0c;
|
||||
entity->z.HALF.HI += ((VaatiArm_HeapStruct*)this->myHeap)->s1[3].unk0c;
|
||||
for (i = 0; i < 5; i++) {
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->damageType = 0x39;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->hitType = 0x39;
|
||||
}
|
||||
EnqueueSFX(SFX_HIT);
|
||||
}
|
||||
@@ -1364,7 +1364,7 @@ void sub_08043DB0(Entity* this) {
|
||||
gScreenTransition.field_0x3d = 0x1e - (cVar1 / 0x3c);
|
||||
gScreenTransition.field_0x3c = this->type2;
|
||||
pEVar2 = ((VaatiArm_HeapStruct*)this->myHeap)->parent;
|
||||
gScreenTransition.field_0x40 = pEVar2->x.HALF.HI;
|
||||
gScreenTransition.hurtType = pEVar2->x.HALF.HI;
|
||||
gScreenTransition.field_0x42 = pEVar2->y.HALF.HI;
|
||||
pEVar4 = ((VaatiArm_HeapStruct*)pEVar2->myHeap)->parent;
|
||||
if (pEVar4 != NULL) {
|
||||
@@ -1391,7 +1391,7 @@ void sub_08043EB8(Entity* this) {
|
||||
Entity* pEVar4;
|
||||
VaatiArm_HeapStruct1* ptr;
|
||||
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spritePriority.b0 = 4;
|
||||
InitAnimationForceUpdate(this, 0xd);
|
||||
pEVar4 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[1];
|
||||
@@ -1402,17 +1402,17 @@ void sub_08043EB8(Entity* this) {
|
||||
pEVar4->spritePriority.b0 = 4;
|
||||
pEVar4 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3];
|
||||
pEVar4->flags = pEVar4->flags & 0x7f;
|
||||
pEVar4->spriteSettings.b.draw = 1;
|
||||
pEVar4->spriteSettings.draw = 1;
|
||||
pEVar4->spritePriority.b0 = 4;
|
||||
pEVar4 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4];
|
||||
pEVar4->flags = pEVar4->flags | 0x80;
|
||||
pEVar4->spriteSettings.b.draw = 1;
|
||||
pEVar4->spriteSettings.draw = 1;
|
||||
pEVar4->spritePriority.b0 = 4;
|
||||
pEVar4->x.HALF.HI = (this->type2 == 0) ? gScreenTransition.field_0x44 : gScreenTransition.field_0x48;
|
||||
pEVar4->y.HALF.HI = (this->type2 == 0) ? gScreenTransition.field_0x46 : gScreenTransition.field_0x4a;
|
||||
pEVar4->height.HALF.HI = 0;
|
||||
pEVar4->z.HALF.HI = 0;
|
||||
pEVar4->field_0x3c = pEVar4->field_0x3c & 0xef;
|
||||
pEVar4->damageType = 0x3a;
|
||||
pEVar4->hitType = 0x3a;
|
||||
pEVar4->hitbox = (Hitbox*)&gUnk_080FD450;
|
||||
pEVar4 = CreateObject(OBJECT_AF, 0, 0);
|
||||
if (pEVar4 != NULL) {
|
||||
|
||||
+34
-34
@@ -26,7 +26,7 @@ void VaatiBall(Entity* this) {
|
||||
gUnk_080D1604[this->action](this);
|
||||
|
||||
if (this->cutsceneBeh.HALF.LO) {
|
||||
this->currentHealth = -1;
|
||||
this->health = -1;
|
||||
}
|
||||
|
||||
if (this->bitfield & 0x80) {
|
||||
@@ -35,13 +35,13 @@ void VaatiBall(Entity* this) {
|
||||
}
|
||||
|
||||
#ifdef EU
|
||||
if (this->currentHealth < 0xfa) {
|
||||
if (this->health < 0xfa) {
|
||||
#else
|
||||
if (this->currentHealth < 0xfd) {
|
||||
if (this->health < 0xfd) {
|
||||
#endif
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->flags &= 0x7f;
|
||||
this->currentHealth = -1;
|
||||
this->spriteSettings.draw = 0;
|
||||
COLLISION_OFF(this);
|
||||
this->health = -1;
|
||||
parent->field_0x80.HALF.LO--;
|
||||
CreateDust(this);
|
||||
SoundReq(SFX_1C3);
|
||||
@@ -63,17 +63,17 @@ void sub_0804468C(Entity* this) {
|
||||
this->direction = (this->field_0x78.HALF.HI * 8) & 0x1f;
|
||||
this->field_0x78.HALF.LO = 0;
|
||||
this->field_0x82.HALF.HI = 0;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
off = &gUnk_080D1620[this->field_0x78.HALF.HI & 3];
|
||||
PositionRelative(this->parent, this, off->h << 0x10, (off->v - 0x10) * 0x10000);
|
||||
this->height.HALF.HI = this->parent->height.HALF.HI;
|
||||
this->z.HALF.HI = this->parent->z.HALF.HI;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
break;
|
||||
case 1:
|
||||
this->action = 3;
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->field_0x82.HALF.HI = 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
InitAnimationForceUpdate(this, 1);
|
||||
break;
|
||||
}
|
||||
@@ -99,7 +99,7 @@ void sub_0804474C(Entity* this) {
|
||||
case 2:
|
||||
this->action = 2;
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->damageType = 0;
|
||||
this->hitType = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -121,18 +121,18 @@ void sub_080447E0(Entity* this) {
|
||||
|
||||
if (vaati->action == 1) {
|
||||
this->action = 1;
|
||||
this->damageType = 43;
|
||||
this->hitType = 43;
|
||||
sub_08044E74(this, 0);
|
||||
if (this->flags & 0x80)
|
||||
this->spriteSettings.b.draw = 1;
|
||||
if (this->flags & ENT_COLLIDE)
|
||||
this->spriteSettings.draw = 1;
|
||||
} else {
|
||||
this->field_0x76.HALF.HI++;
|
||||
this->field_0x76.HALF.HI &= 7;
|
||||
if (this->flags & 0x80) {
|
||||
if (this->flags & ENT_COLLIDE) {
|
||||
if (this->field_0x76.HALF.HI & 1) {
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
} else {
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ void sub_08044868(Entity* this) {
|
||||
if (this->field_0x82.HALF.HI) {
|
||||
switch (this->field_0x74.HALF.LO) {
|
||||
case 0:
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
this->field_0x74.HALF.LO = 1;
|
||||
this->direction = sub_080045B4(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10);
|
||||
this->speed = 0x180;
|
||||
@@ -179,18 +179,18 @@ void sub_08044868(Entity* this) {
|
||||
case 1:
|
||||
if (this->field_0x82.HALF.HI == 0) {
|
||||
this->field_0x82.HALF.HI++;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
}
|
||||
sub_08044DEC(this);
|
||||
if (*(u8*)&vaati->field_0x86 > 1) {
|
||||
u8 draw = this->spriteSettings.b.draw;
|
||||
u8 draw = this->spriteSettings.draw;
|
||||
if (draw == 1 && this->cutsceneBeh.HALF.LO == 0) {
|
||||
vaati = CreateProjectileWithParent(this, 0x18, 0);
|
||||
if (vaati) {
|
||||
vaati->type2 = 1;
|
||||
vaati->parent = this;
|
||||
this->cutsceneBeh.HALF.LO = 1;
|
||||
this->damageType = 0;
|
||||
this->hitType = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -205,11 +205,11 @@ void sub_08044868(Entity* this) {
|
||||
u8 draw;
|
||||
|
||||
sub_08044E74(this, 1);
|
||||
draw = this->spriteSettings.b.draw;
|
||||
draw = this->spriteSettings.draw;
|
||||
if (draw == 1) {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
} else {
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -273,13 +273,13 @@ void sub_080449F8(Entity* this) {
|
||||
u8 draw;
|
||||
|
||||
this->field_0x74.HALF.LO++;
|
||||
draw = this->spriteSettings.b.draw;
|
||||
draw = this->spriteSettings.draw;
|
||||
if (draw) {
|
||||
vaati = CreateProjectileWithParent(this, 0x1c, 0);
|
||||
if (vaati) {
|
||||
vaati->y.HALF.HI += 4;
|
||||
vaati->parent = this;
|
||||
this->attachedEntity = vaati;
|
||||
this->child = vaati;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -390,10 +390,10 @@ void sub_08044B04(Entity* this) {
|
||||
case 3:
|
||||
this->field_0x74.HALF.LO = 1;
|
||||
this->actionDelay = 80;
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
PositionRelative(vaati, this, 0, -0x100000);
|
||||
if (this->field_0xf)
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
break;
|
||||
case 1:
|
||||
if (--this->actionDelay == 0) {
|
||||
@@ -427,11 +427,11 @@ void sub_08044B04(Entity* this) {
|
||||
u8 draw;
|
||||
|
||||
sub_08044E74(this, 1);
|
||||
draw = this->spriteSettings.b.draw;
|
||||
draw = this->spriteSettings.draw;
|
||||
if (draw == 1) {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
} else {
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
}
|
||||
vaati->actionDelay++;
|
||||
break;
|
||||
@@ -447,12 +447,12 @@ void sub_08044DEC(Entity* this) {
|
||||
u32 off;
|
||||
|
||||
if (this->parent->field_0x80.HALF.LO > this->field_0x78.HALF.HI) {
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->currentHealth = -1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->health = -1;
|
||||
} else {
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
}
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->field_0x78.HALF.LO = 0;
|
||||
this->speed = 0x300;
|
||||
off = this->parent->field_0x80.HALF.LO - 1;
|
||||
|
||||
+13
-13
@@ -62,27 +62,27 @@ void VaatiEyesMacroFunction0(Entity* this) {
|
||||
|
||||
void VaatiEyesMacroFunction1(Entity* this) {
|
||||
if (this->type == 0) {
|
||||
if (this->currentHealth == 0) {
|
||||
if (this->health == 0) {
|
||||
gScreenTransition.field_0x39 &= ~(1 << (gScreenTransition.field_0x3c + 2));
|
||||
}
|
||||
if (gRoomControls.roomID == 0) {
|
||||
gScreenTransition.field_0x3a = this->currentHealth;
|
||||
gScreenTransition.field_0x3a = this->health;
|
||||
} else {
|
||||
gScreenTransition.field_0x3b = this->currentHealth;
|
||||
gScreenTransition.field_0x3b = this->health;
|
||||
}
|
||||
if (this->field_0x78.HALF.HI != this->currentHealth) {
|
||||
if (this->field_0x78.HALF.HI != this->health) {
|
||||
EnqueueSFX(SFX_17A);
|
||||
}
|
||||
this->field_0x78.HALF.HI = this->currentHealth;
|
||||
this->field_0x78.HALF.HI = this->health;
|
||||
} else {
|
||||
if (this->type == 1) {
|
||||
if (0 < this->iframes) {
|
||||
this->iframes *= -1;
|
||||
}
|
||||
if (this->currentHealth != 0xff) {
|
||||
if (this->health != 0xff) {
|
||||
EnqueueSFX(SFX_BUTTON_DEPRESS);
|
||||
}
|
||||
this->currentHealth = 0xff;
|
||||
this->health = 0xff;
|
||||
}
|
||||
}
|
||||
if (this->field_0x43 != 0) {
|
||||
@@ -108,9 +108,9 @@ void VaatiEyesMacroFunction0Type0Action0(Entity* this) {
|
||||
enemy->parent = this;
|
||||
this->action = 1;
|
||||
if (gRoomControls.roomID == 0) {
|
||||
this->field_0x78.HALF.HI = this->currentHealth = gScreenTransition.field_0x3a;
|
||||
this->field_0x78.HALF.HI = this->health = gScreenTransition.field_0x3a;
|
||||
} else {
|
||||
this->field_0x78.HALF.HI = this->currentHealth = gScreenTransition.field_0x3b;
|
||||
this->field_0x78.HALF.HI = this->health = gScreenTransition.field_0x3b;
|
||||
}
|
||||
this->field_0x78.HALF.LO = Random();
|
||||
sub_0802EFB8(this);
|
||||
@@ -146,8 +146,8 @@ void VaatiEyesMacroFunction0Type1Action0(Entity* this) {
|
||||
|
||||
void VaatiEyesMacroFunction0Type1Action1(Entity* this) {
|
||||
if (this->parent->next == NULL) {
|
||||
this->flags &= 0x7f;
|
||||
this->currentHealth = 0;
|
||||
COLLISION_OFF(this);
|
||||
this->health = 0;
|
||||
} else {
|
||||
sub_0802F04C(this);
|
||||
GetNextFrame(this);
|
||||
@@ -192,7 +192,7 @@ void VaatiEyesMacroFunction0Type3(Entity* this) {
|
||||
this->spritePriority.b0 = 6;
|
||||
}
|
||||
CopyPositionAndSpriteOffset(this->parent, this);
|
||||
this->height.HALF.HI = 0;
|
||||
this->z.HALF.HI = 0;
|
||||
}
|
||||
|
||||
void sub_0802EF58(Entity* this) {
|
||||
@@ -212,7 +212,7 @@ void sub_0802EF58(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802EF90(Entity* this) {
|
||||
this->height.HALF.HI = gUnk_080CDE90[this->field_0x78.HALF.LO++ >> 3 & 7];
|
||||
this->z.HALF.HI = gUnk_080CDE90[this->field_0x78.HALF.LO++ >> 3 & 7];
|
||||
}
|
||||
|
||||
void sub_0802EFB8(Entity* this) {
|
||||
|
||||
+18
-18
@@ -42,8 +42,8 @@ void (*const vaatiProjectileFunction0Actions[])(Entity*) = {
|
||||
|
||||
void VaatiProjectile(Entity* this) {
|
||||
if (sub_0803E4A0(this)) {
|
||||
this->flags &= 0x7f;
|
||||
this->currentHealth = 0;
|
||||
COLLISION_OFF(this);
|
||||
this->health = 0;
|
||||
this->parent = NULL;
|
||||
}
|
||||
vaatiProjectileFunctions[GetNextFunction(this)](this);
|
||||
@@ -58,10 +58,10 @@ void VaatiProjectileFunction1(Entity* this) {
|
||||
|
||||
if (this->bitfield == 0x80) {
|
||||
#ifndef EU
|
||||
if (this->currentHealth != 0) {
|
||||
if (this->health != 0) {
|
||||
#endif
|
||||
this->action = 5;
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->spritePriority.b1 = 0;
|
||||
gPlayerEntity.flags &= 0x7f;
|
||||
gPlayerEntity.spriteOrientation.flipY = this->spriteOrientation.flipY;
|
||||
@@ -101,20 +101,20 @@ void VaatiProjectileFunction0Action0(Entity* this) {
|
||||
entity = CreateEnemy(VAATI_PROJECTILE, 1);
|
||||
if (entity != NULL) {
|
||||
entity->parent = this;
|
||||
this->attachedEntity = entity;
|
||||
this->child = entity;
|
||||
if (this->type2 == 0) {
|
||||
this->action = 1;
|
||||
this->height.HALF.HI = -0x18;
|
||||
this->z.HALF.HI = -0x18;
|
||||
} else {
|
||||
this->action = 9;
|
||||
this->height.HALF.HI = -0x80;
|
||||
this->z.HALF.HI = -0x80;
|
||||
this->flags2 = 1;
|
||||
}
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
} else {
|
||||
this->action = 8;
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->spriteOffsetY = 1;
|
||||
this->spriteOrientation.flipY = this->parent->spriteOrientation.flipY;
|
||||
this->spriteRendering.b3 = this->parent->spriteRendering.b3;
|
||||
@@ -129,7 +129,7 @@ void VaatiProjectileFunction0Action1(Entity* this) {
|
||||
if (PlayerInRange(this, 0, 8) != 0) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 10;
|
||||
InitializeAnimation(this->attachedEntity, 2);
|
||||
InitializeAnimation(this->child, 2);
|
||||
} else {
|
||||
if (gUnk_020000B0 != NULL) {
|
||||
sub_08004596(this, GetFacingDirection(this, gUnk_020000B0));
|
||||
@@ -143,7 +143,7 @@ void VaatiProjectileFunction0Action2(Entity* this) {
|
||||
if (this->actionDelay != 0) {
|
||||
this->actionDelay--;
|
||||
} else {
|
||||
if (++this->height.HALF.HI == 0) {
|
||||
if (++this->z.HALF.HI == 0) {
|
||||
this->action = 3;
|
||||
}
|
||||
}
|
||||
@@ -151,11 +151,11 @@ void VaatiProjectileFunction0Action2(Entity* this) {
|
||||
}
|
||||
|
||||
void VaatiProjectileFunction0Action3(Entity* this) {
|
||||
if ((this->attachedEntity->frames.b.f3) != 0) {
|
||||
if (--this->height.HALF.HI <= -0x18) {
|
||||
if (this->child->frame & 0x80) {
|
||||
if (--this->z.HALF.HI <= -0x18) {
|
||||
this->action = 4;
|
||||
this->actionDelay = (Random() & 0xf) + 0xf;
|
||||
InitializeAnimation(this->attachedEntity, 1);
|
||||
InitializeAnimation(this->child, 1);
|
||||
}
|
||||
GetNextFrame(this);
|
||||
}
|
||||
@@ -174,7 +174,7 @@ void VaatiProjectileFunction0Action5(Entity* this) {
|
||||
if (this->actionDelay != 0) {
|
||||
this->actionDelay--;
|
||||
} else {
|
||||
if (-0x18 < --this->height.HALF.HI) {
|
||||
if (-0x18 < --this->z.HALF.HI) {
|
||||
return;
|
||||
}
|
||||
this->action = 6;
|
||||
@@ -212,14 +212,14 @@ void VaatiProjectileFunction0Action8(Entity* this) {
|
||||
void VaatiProjectileFunction0Action9(Entity* this) {
|
||||
this->x.HALF.HI = gPlayerEntity.x.HALF.HI;
|
||||
this->y.HALF.HI = gPlayerEntity.y.HALF.HI;
|
||||
if (this->height.HALF.HI < -8) {
|
||||
if (this->z.HALF.HI < -8) {
|
||||
if (this->animIndex != 2) {
|
||||
this->actionDelay = 0;
|
||||
InitializeAnimation(this->attachedEntity, 2);
|
||||
InitializeAnimation(this->child, 2);
|
||||
}
|
||||
VaatiProjectileFunction0Action2(this);
|
||||
} else {
|
||||
this->height.HALF.HI += 8;
|
||||
this->z.HALF.HI += 8;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ bool32 sub_0803E4A0(Entity* this) {
|
||||
if (this->parent == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
if (this->parent->currentHealth == 0) {
|
||||
if (this->parent->health == 0) {
|
||||
return TRUE;
|
||||
} else {
|
||||
ret = this->parent->next == NULL;
|
||||
|
||||
@@ -104,10 +104,10 @@ void VaatiRebornEnemyType0Action0(Entity* this) {
|
||||
this->field_0x74.HALF.LO = -1;
|
||||
this->actionDelay = 0;
|
||||
this->field_0x76.HALF.LO = 0;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->direction = 0xff;
|
||||
this->spritePriority.b0 = 4;
|
||||
this->height.WORD = 0;
|
||||
this->z.WORD = 0;
|
||||
this->field_0x80.HALF.LO = 2;
|
||||
this->field_0x86.HALF.LO = 0;
|
||||
this->cutsceneBeh.HALF.HI = 0x30;
|
||||
@@ -119,7 +119,7 @@ void VaatiRebornEnemyType0Action0(Entity* this) {
|
||||
this->field_0x7c = this->y;
|
||||
entity = CreateEnemy(VAATI_REBORN_ENEMY, 1);
|
||||
entity->parent = this;
|
||||
this->attachedEntity = entity;
|
||||
this->child = entity;
|
||||
for (i = 0; i < 6; i++) {
|
||||
entity = CreateEnemy(VAATI_BALL, 0);
|
||||
entity->parent = this;
|
||||
@@ -133,7 +133,7 @@ void VaatiRebornEnemyType0Action0(Entity* this) {
|
||||
for (i = 0; i < 2; i++) {
|
||||
entity = CreateEnemy(VAATI_BALL, 1);
|
||||
entity->parent = this;
|
||||
entity->spriteSettings.b.flipX = i;
|
||||
entity->spriteSettings.flipX = i;
|
||||
ptr = &gUnk_080D04A8[i];
|
||||
PositionRelative(this, entity, ptr->x << 0x10, ptr->y << 0x10);
|
||||
}
|
||||
@@ -145,7 +145,7 @@ void VaatiRebornEnemyType0Action1(Entity* this) {
|
||||
if (this->actionDelay != 0) {
|
||||
if (--this->actionDelay == 0) {
|
||||
if ((this->field_0x74.HALF.LO & 0x70) == 0) {
|
||||
if (this->attachedEntity->actionDelay == 0) {
|
||||
if (this->child->actionDelay == 0) {
|
||||
sub_0803DD78(this);
|
||||
if (this->field_0x74.HALF.HI != 0) {
|
||||
this->action = 2;
|
||||
@@ -168,7 +168,7 @@ void VaatiRebornEnemyType0Action1(Entity* this) {
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->actionDelay = 0xc0;
|
||||
this->direction = 0xff;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
}
|
||||
}
|
||||
@@ -205,7 +205,7 @@ void VaatiRebornEnemyType0Action1(Entity* this) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (this->attachedEntity->actionDelay == 0) {
|
||||
if (this->child->actionDelay == 0) {
|
||||
this->cutsceneBeh.HALF.HI++;
|
||||
if ((this->cutsceneBeh.HALF.HI & 3) == 0) {
|
||||
switch (this->cutsceneBeh.HALF.HI & 0x30) {
|
||||
@@ -237,9 +237,9 @@ void VaatiRebornEnemyType0Action2(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->field_0x74.HALF.LO = 2;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
this->actionDelay = 0x10;
|
||||
}
|
||||
break;
|
||||
@@ -255,15 +255,15 @@ void VaatiRebornEnemyType0Action2(Entity* this) {
|
||||
this->x.HALF.HI = gRoomControls.roomOriginX + ptr->HALF.x + 0x10;
|
||||
this->y.HALF.HI = gRoomControls.roomOriginY + ptr->HALF.y + 0x10;
|
||||
}
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->actionDelay = 0x20;
|
||||
InitAnimationForceUpdate(this, 4);
|
||||
SoundReq(SFX_F5);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->spriteSettings.b.draw = 1;
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->spriteSettings.draw = 1;
|
||||
if (4 < this->field_0x80.HALF.HI) {
|
||||
this->x.HALF.HI = gPlayerEntity.x.HALF.HI;
|
||||
this->y.HALF.HI = gPlayerEntity.y.HALF.HI - 0x18;
|
||||
@@ -291,8 +291,8 @@ void VaatiRebornEnemyType0Action3(Entity* this) {
|
||||
this->actionDelay = 1;
|
||||
break;
|
||||
case 0xff:
|
||||
if (this->height.HALF.HI != -4) {
|
||||
this->height.WORD -= 0x2000;
|
||||
if (this->z.HALF.HI != -4) {
|
||||
this->z.WORD -= 0x2000;
|
||||
}
|
||||
if (this->actionDelay == 2) {
|
||||
this->field_0x74.HALF.LO = 0xfe;
|
||||
@@ -320,7 +320,7 @@ void VaatiRebornEnemyType0Action3(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->field_0x74.HALF.LO = 3;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
}
|
||||
@@ -345,8 +345,8 @@ void VaatiRebornEnemyType0Action4(Entity* this) {
|
||||
this->direction = (this->direction + 0x10) & 0x1f;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
} else {
|
||||
if ((this->frames.all & 0x10) != 0) {
|
||||
this->frames.all &= 0xef;
|
||||
if ((this->frame & 0x10) != 0) {
|
||||
this->frame &= 0xef;
|
||||
if (this->cutsceneBeh.HALF.LO == 0xff) {
|
||||
index = Direction8RoundUp(GetFacingDirection(this, &gPlayerEntity));
|
||||
this->cutsceneBeh.HALF.LO = gUnk_080D04C0[index >> 2];
|
||||
@@ -356,7 +356,7 @@ void VaatiRebornEnemyType0Action4(Entity* this) {
|
||||
(entity = CreateProjectileWithParent(this, 0x1a, this->cutsceneBeh.HALF.LO), entity != NULL)) {
|
||||
entity->field_0xf = this->field_0xf;
|
||||
entity->parent = this;
|
||||
entity->height.HALF.HI = this->height.HALF.HI;
|
||||
entity->z.HALF.HI = this->z.HALF.HI;
|
||||
this->field_0xf = this->field_0xf + 1;
|
||||
}
|
||||
}
|
||||
@@ -383,7 +383,7 @@ void VaatiRebornEnemyType0Action5(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if ((this->frames.all & 0x10) != 0) {
|
||||
if ((this->frame & 0x10) != 0) {
|
||||
this->field_0x74.HALF.LO = 2;
|
||||
this->field_0xf = (Random() & 0x3f) + 0x40;
|
||||
SoundReq(SFX_SUMMON);
|
||||
@@ -503,7 +503,7 @@ void VaatiRebornEnemyType1Action0(Entity* this) {
|
||||
PositionRelative(this->parent, this, 0, 0x10000);
|
||||
enemy = CreateEnemy(VAATI_REBORN_ENEMY, 2);
|
||||
enemy->parent = this;
|
||||
enemy->attachedEntity = this->parent;
|
||||
enemy->child = this->parent;
|
||||
InitAnimationForceUpdate(this, this->field_0x74.HALF.LO);
|
||||
}
|
||||
|
||||
@@ -514,20 +514,20 @@ void VaatiRebornEnemyType1Action1(Entity* this) {
|
||||
if (this->field_0x74.HALF.LO == 0) {
|
||||
if (parent->field_0x80.HALF.LO == 0) {
|
||||
this->field_0x74.HALF.LO = 1;
|
||||
this->damageType = 0x30;
|
||||
this->hitType = 0x30;
|
||||
InitAnimationForceUpdate(this, this->field_0x74.HALF.LO);
|
||||
}
|
||||
} else {
|
||||
if (parent->field_0x80.HALF.LO != 0) {
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->damageType = 0x2f;
|
||||
this->hitType = 0x2f;
|
||||
InitAnimationForceUpdate(this, this->field_0x74.HALF.LO);
|
||||
} else {
|
||||
if (((this->bitfield & 0x80) != 0) && (0 < this->iframes)) {
|
||||
parent->iframes = this->iframes;
|
||||
parent->bitfield = this->bitfield;
|
||||
}
|
||||
if ((this->frames.all & 0x40) != 0) {
|
||||
if ((this->frame & 0x40) != 0) {
|
||||
InitAnimationForceUpdate(this, 2);
|
||||
}
|
||||
}
|
||||
@@ -536,15 +536,15 @@ void VaatiRebornEnemyType1Action1(Entity* this) {
|
||||
if (this->field_0x74.HALF.HI == 0) {
|
||||
if (parent->action != 2) {
|
||||
this->field_0x74.HALF.HI = 1;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
}
|
||||
} else {
|
||||
if (parent->action == 2) {
|
||||
this->field_0x74.HALF.HI = 0;
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
}
|
||||
}
|
||||
this->spriteSettings.b.draw = parent->spriteSettings.b.draw;
|
||||
this->spriteSettings.draw = parent->spriteSettings.draw;
|
||||
this->spriteOffsetX = parent->spriteOffsetX;
|
||||
PositionRelative(this->parent, this, 0, 0x10000);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
@@ -593,7 +593,7 @@ void VaatiRebornEnemyType2Action1(Entity* this) {
|
||||
InitAnimationForceUpdate(this, 2);
|
||||
}
|
||||
}
|
||||
this->spriteSettings.b.draw = parent->spriteSettings.b.draw;
|
||||
this->spriteSettings.draw = parent->spriteSettings.draw;
|
||||
this->spriteOffsetX = parent->spriteOffsetX;
|
||||
PositionRelative(parent->parent, this, 0, 0x20000);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
@@ -635,7 +635,7 @@ void sub_0803DC0C(Entity* this) {
|
||||
|
||||
parent = this->parent;
|
||||
tmp = &gUnk_080D04C8[this->actionDelay];
|
||||
this->spriteSettings.b.draw = parent->spriteSettings.b.draw;
|
||||
this->spriteSettings.draw = parent->spriteSettings.draw;
|
||||
this->spriteOffsetX = parent->spriteOffsetX;
|
||||
PositionRelative(parent, this, tmp->x << 0x10, (tmp->y + 1) * 0x10000);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
@@ -644,15 +644,15 @@ void sub_0803DC0C(Entity* this) {
|
||||
void VaatiRebornEnemyType1PreAction(Entity* this) {
|
||||
Entity* parent;
|
||||
|
||||
if (this->damageType != 0x30) {
|
||||
if (this->hitType != 0x30) {
|
||||
return;
|
||||
}
|
||||
parent = this->parent;
|
||||
this->field_0x76.HALF.HI = 0;
|
||||
if ((this->bitfield & 0x80) != 0) {
|
||||
if (gUnk_080D04D0[parent->field_0x86.HALF.LO] > this->currentHealth) {
|
||||
if (gUnk_080D04D0[parent->field_0x86.HALF.LO] > this->health) {
|
||||
if (2 < ++parent->field_0x86.HALF.LO) {
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
parent->action = 7;
|
||||
parent->flags &= 0x7f;
|
||||
parent->actionDelay = 0x80;
|
||||
@@ -675,13 +675,13 @@ void VaatiRebornEnemyType1PreAction(Entity* this) {
|
||||
}
|
||||
if (this->actionDelay != 0) {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->damageType = 0x2f;
|
||||
this->hitType = 0x2f;
|
||||
this->field_0x74.HALF.LO = 1;
|
||||
if (this->field_0x76.HALF.HI == 0) {
|
||||
parent->field_0x74.HALF.LO = 0xf0;
|
||||
} else {
|
||||
parent->field_0x74.HALF.LO = 0x70;
|
||||
this->currentHealth = 0xff;
|
||||
this->health = 0xff;
|
||||
}
|
||||
parent->action = 1;
|
||||
parent->actionDelay = 1;
|
||||
|
||||
@@ -136,7 +136,7 @@ void VaatiTransfiguredType0Action0(Entity* this) {
|
||||
sub_0804A720(this);
|
||||
if ((CheckRoomFlag(0) != 0) && (gEntCount < 0x51)) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->spritePriority.b0 = 5;
|
||||
this->field_0x6c.HALF.HI |= 1;
|
||||
this->direction = (Random() & 0x17) + 4;
|
||||
@@ -210,7 +210,7 @@ void VaatiTransfiguredType0Action1(Entity* this) {
|
||||
break;
|
||||
case 3:
|
||||
if (--this->actionDelay == 0) {
|
||||
this->height.HALF.HI = 0;
|
||||
this->z.HALF.HI = 0;
|
||||
this->field_0x80.HALF.LO = 0;
|
||||
this->actionDelay = gUnk_080D0ABF[(u32)this->animationState * 2];
|
||||
switch (sub_08040934(this)) {
|
||||
@@ -269,17 +269,17 @@ void VaatiTransfiguredType0Action3(Entity* this) {
|
||||
break;
|
||||
this->field_0x80.HALF.LO = 1;
|
||||
this->actionDelay = 0xc0;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
SoundReq(SFX_14C);
|
||||
sub_08080964(0x14, 4);
|
||||
break;
|
||||
case 1:
|
||||
if (--this->actionDelay == 0) {
|
||||
this->field_0x80.HALF.LO = 2;
|
||||
this->damageType = 0x35;
|
||||
this->hitType = 0x35;
|
||||
this->spriteOffsetX = 0;
|
||||
}
|
||||
if (this->currentHealth < gUnk_080D0ABC[this->animationState]) {
|
||||
if (this->health < gUnk_080D0ABC[this->animationState]) {
|
||||
tmp = 1;
|
||||
this->actionDelay = 1;
|
||||
} else {
|
||||
@@ -287,7 +287,7 @@ void VaatiTransfiguredType0Action3(Entity* this) {
|
||||
}
|
||||
if (tmp) {
|
||||
this->field_0x80.HALF.LO = 2;
|
||||
this->damageType = 0x35;
|
||||
this->hitType = 0x35;
|
||||
this->spriteOffsetX = 0;
|
||||
this->animationState++;
|
||||
if (this->animationState > 2) {
|
||||
@@ -300,7 +300,7 @@ void VaatiTransfiguredType0Action3(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
this->attachedEntity->field_0x74.HALF.LO = 0x10;
|
||||
this->child->field_0x74.HALF.LO = 0x10;
|
||||
if (this->actionDelay) {
|
||||
this->field_0x80.HALF.LO = 3;
|
||||
this->actionDelay = 0x40;
|
||||
@@ -312,8 +312,8 @@ void VaatiTransfiguredType0Action3(Entity* this) {
|
||||
case 3:
|
||||
if (this->actionDelay != 0) {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->flags &= 0x7f;
|
||||
this->hVelocity = 0x38000;
|
||||
COLLISION_OFF(this);
|
||||
this->zVelocity = 0x38000;
|
||||
this->field_0xf = 0x10;
|
||||
}
|
||||
break;
|
||||
@@ -321,8 +321,8 @@ void VaatiTransfiguredType0Action3(Entity* this) {
|
||||
if (sub_08003FC4(this, 0x2800) == 0) {
|
||||
this->field_0x80.HALF.LO = 5;
|
||||
this->actionDelay = 0x10;
|
||||
this->flags |= 0x80;
|
||||
this->currentHealth = 0xff;
|
||||
COLLISION_ON(this);
|
||||
this->health = 0xff;
|
||||
this->field_0x86.HALF.LO = 0;
|
||||
sub_080408EC(this);
|
||||
SoundReq(SFX_14C);
|
||||
@@ -379,7 +379,7 @@ void VaatiTransfiguredType0Action4(Entity* this) {
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->actionDelay = 0x80;
|
||||
this->field_0xf = 0;
|
||||
this->hVelocity = 0x24000;
|
||||
this->zVelocity = 0x24000;
|
||||
SoundReq(SFX_12B);
|
||||
}
|
||||
break;
|
||||
@@ -424,7 +424,7 @@ void VaatiTransfiguredType0Action4(Entity* this) {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 1;
|
||||
this->field_0x80.HALF.LO = 0;
|
||||
this->height.HALF.HI = 0;
|
||||
this->z.HALF.HI = 0;
|
||||
sub_08040670(this);
|
||||
} else {
|
||||
sub_08040AD4(this);
|
||||
@@ -557,8 +557,8 @@ void VaatiTransfiguredType0Action7(Entity* this) {
|
||||
} else {
|
||||
if (this->field_0xf != 0) {
|
||||
if (--this->field_0xf == 0) {
|
||||
this->currentHealth = 0;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->health = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
}
|
||||
} else {
|
||||
sub_0804A7D4(this);
|
||||
@@ -594,7 +594,7 @@ void VaatiTransfiguredType1Action1(Entity* this) {
|
||||
Entity* parent;
|
||||
|
||||
parent = this->parent;
|
||||
if (parent->currentHealth == 0) {
|
||||
if (parent->health == 0) {
|
||||
this->field_0x6c.HALF.HI |= 2;
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -617,7 +617,7 @@ void VaatiTransfiguredType1Action1(Entity* this) {
|
||||
}
|
||||
}
|
||||
if (parent->action != 3) {
|
||||
this->height.HALF.HI = parent->height.HALF.HI;
|
||||
this->z.HALF.HI = parent->z.HALF.HI;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -645,7 +645,7 @@ void VaatiTransfiguredType2Action1(Entity* this) {
|
||||
|
||||
const xy* t;
|
||||
|
||||
if (this->parent->currentHealth == 0) {
|
||||
if (this->parent->health == 0) {
|
||||
this->field_0x6c.HALF.HI |= 2;
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -659,7 +659,7 @@ void VaatiTransfiguredType2Action1(Entity* this) {
|
||||
case 1:
|
||||
if (this->parent->frameIndex != 2) {
|
||||
this->action = 2;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
@@ -674,7 +674,7 @@ void VaatiTransfiguredType2Action1(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->field_0xf = (Random() & 0x7f) + 0x17;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
@@ -698,14 +698,14 @@ void VaatiTransfiguredType2Action1(Entity* this) {
|
||||
}
|
||||
|
||||
void VaatiTransfiguredType2Action2(Entity* this) {
|
||||
if (this->parent->currentHealth == 0) {
|
||||
if (this->parent->health == 0) {
|
||||
this->field_0x6c.HALF.HI |= 2;
|
||||
DeleteThisEntity();
|
||||
}
|
||||
CopyPosition(this->parent, this);
|
||||
if (this->parent->frameIndex == 2) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -716,7 +716,7 @@ void VaatiTransfiguredType3Action0(Entity* this) {
|
||||
}
|
||||
|
||||
void VaatiTransfiguredType3Action1(Entity* this) {
|
||||
if (this->parent->currentHealth == 0) {
|
||||
if (this->parent->health == 0) {
|
||||
this->field_0x6c.HALF.HI |= 2;
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -728,25 +728,25 @@ void VaatiTransfiguredType4Action0(Entity* this) {
|
||||
this->action = 1;
|
||||
this->field_0x80.HALF.LO = 0;
|
||||
this->actionDelay = 10;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
this->spritePriority.b0 = 7;
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
|
||||
void VaatiTransfiguredType4Action1(Entity* this) {
|
||||
if (this->parent->currentHealth == 0) {
|
||||
if (this->parent->health == 0) {
|
||||
this->field_0x6c.HALF.HI |= 2;
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (this->parent->action != 5) {
|
||||
if (this->field_0x80.HALF.LO != 0) {
|
||||
this->field_0x80.HALF.LO = 0;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
}
|
||||
} else {
|
||||
if (this->field_0x80.HALF.LO == 0) {
|
||||
this->field_0x80.HALF.LO += 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
}
|
||||
if (--this->actionDelay == 0) {
|
||||
this->actionDelay = 10;
|
||||
@@ -765,13 +765,13 @@ void VaatiTransfiguredType5Action0(Entity* this) {
|
||||
InitializeAnimation(this, 2);
|
||||
} else {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
this->spritePriority.b0 = 4;
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiTransfiguredType5Action1(Entity* this) {
|
||||
if (this->parent->currentHealth == 0) {
|
||||
if (this->parent->health == 0) {
|
||||
this->field_0x6c.HALF.HI |= 2;
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -781,16 +781,16 @@ void VaatiTransfiguredType5Action1(Entity* this) {
|
||||
return;
|
||||
}
|
||||
this->field_0x80.HALF.LO += 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
InitializeAnimation(this, 1);
|
||||
break;
|
||||
case 1:
|
||||
if (this->parent->action != 6) {
|
||||
this->field_0x80.HALF.LO = 0;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
} else {
|
||||
if (this->frames.b.f3 != 0) {
|
||||
this->frames.b.f3 = 0;
|
||||
if (this->frame & 0x80) {
|
||||
this->frame &= ~0x80;
|
||||
if (gEntCount < 0x47) {
|
||||
sub_08040648(this, this->type, 1);
|
||||
}
|
||||
@@ -807,19 +807,19 @@ void VaatiTransfiguredType5Action1(Entity* this) {
|
||||
}
|
||||
|
||||
void VaatiTransfiguredType5Action2(Entity* this) {
|
||||
if (this->parent->currentHealth == 0) {
|
||||
if (this->parent->health == 0) {
|
||||
this->field_0x6c.HALF.HI |= 2;
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (this->field_0x80.HALF.LO == 0) {
|
||||
if (this->parent->parent->action != 6) {
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->field_0x80.HALF.LO += 1;
|
||||
InitializeAnimation(this, 3);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
@@ -835,7 +835,7 @@ void sub_08040648(Entity* this, u32 type, u32 type2) {
|
||||
enemy->parent = this;
|
||||
CopyPosition(this, enemy);
|
||||
if ((type == 2) && (type2 == 0)) {
|
||||
this->attachedEntity = enemy;
|
||||
this->child = enemy;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1059,9 +1059,9 @@ void sub_080409B0(Entity* this) {
|
||||
this->action = 3;
|
||||
this->field_0x80.HALF.LO = 0;
|
||||
this->field_0x80.HALF.HI = 3;
|
||||
this->flags &= 0x7f;
|
||||
this->damageType = 0x36;
|
||||
this->hVelocity = 0x18000;
|
||||
COLLISION_OFF(this);
|
||||
this->hitType = 0x36;
|
||||
this->zVelocity = 0x18000;
|
||||
SoundReq(SFX_164);
|
||||
}
|
||||
}
|
||||
@@ -1078,7 +1078,7 @@ void sub_080409B0(Entity* this) {
|
||||
SoundReq(SFX_BOSS_HIT);
|
||||
}
|
||||
if ((this->bitfield == 0x8a) && (gPlayerState.field_0xa0[0] == 5)) {
|
||||
this->currentHealth = 0xc0;
|
||||
this->health = 0xc0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,8 +69,8 @@ void VaatiTransfiguredEyeFunction1(Entity* this) {
|
||||
SoundReq(SFX_ITEM_GLOVES_KNOCKBACK);
|
||||
}
|
||||
} else {
|
||||
if (this->currentHealth != 0xff) {
|
||||
this->currentHealth = 0xff;
|
||||
if (this->health != 0xff) {
|
||||
this->health = 0xff;
|
||||
if (this->actionDelay != 0 && (pEVar4->field_0x80.HALF.HI != 0)) {
|
||||
pEVar4->field_0x76.HALF.LO |= (1 << this->type2);
|
||||
if (this->cutsceneBeh.HALF.HI == 0) {
|
||||
@@ -96,7 +96,7 @@ void VaatiTransfiguredEyeFunction0Action0(Entity* this) {
|
||||
bVar2 = gMessage.doTextBox & 0x7f;
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
this->field_0x80.HALF.LO = bVar2;
|
||||
this->field_0x80.HALF.HI = bVar2;
|
||||
this->cutsceneBeh.HALF.HI = bVar2;
|
||||
@@ -108,7 +108,7 @@ void VaatiTransfiguredEyeFunction0Action0(Entity* this) {
|
||||
child = CreateEnemy(VAATI_TRANSFIGURED_EYE, 1);
|
||||
if (child != NULL) {
|
||||
child->parent = this;
|
||||
this->attachedEntity = child;
|
||||
this->child = child;
|
||||
child->actionDelay = this->actionDelay;
|
||||
child->type2 = this->type2;
|
||||
CopyPosition(this, child);
|
||||
@@ -123,16 +123,16 @@ void VaatiTransfiguredEyeFunction0Action0(Entity* this) {
|
||||
void VaatiTransfiguredEyeFunction0Action1(Entity* this) {
|
||||
sub_08045A28(this);
|
||||
if (this->field_0x82.HALF.LO == 0) {
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
if (this->type != 0) {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
}
|
||||
this->action = 2;
|
||||
InitializeAnimation(this, this->type << 3);
|
||||
}
|
||||
} else {
|
||||
if (--this->field_0x82.HALF.LO == 0) {
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,7 @@ void VaatiTransfiguredEyeFunction0Action2(Entity* this) {
|
||||
this->action = 4;
|
||||
this->field_0xf = 0;
|
||||
if (this->type != 0) {
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
if (this->actionDelay != 0) {
|
||||
InitializeAnimation(this, this->type << 3 | 5);
|
||||
InitializeAnimation(this->parent, this->parent->type << 3 | 5);
|
||||
@@ -163,14 +163,14 @@ void VaatiTransfiguredEyeFunction0Action2(Entity* this) {
|
||||
|
||||
void VaatiTransfiguredEyeFunction0Action3(Entity* this) {
|
||||
sub_08045A28(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->action = 2;
|
||||
if (this->type != 0) {
|
||||
if (this->actionDelay == 0) {
|
||||
this->damageType = 0x32;
|
||||
this->hitType = 0x32;
|
||||
} else {
|
||||
this->parent->parent->field_0x76.HALF.LO |= (1 << this->type2);
|
||||
this->damageType = 0x31;
|
||||
this->hitType = 0x31;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,7 +181,7 @@ void VaatiTransfiguredEyeFunction0Action4(Entity* this) {
|
||||
|
||||
sub_08045A28(this);
|
||||
if (this->field_0xf == 0) {
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->field_0xf = 0x20;
|
||||
}
|
||||
} else {
|
||||
@@ -195,7 +195,7 @@ void VaatiTransfiguredEyeFunction0Action4(Entity* this) {
|
||||
this->field_0x80.HALF.HI = 0;
|
||||
this->cutsceneBeh.HALF.HI = 0;
|
||||
if (this->type != 0) {
|
||||
this->damageType = 0x33;
|
||||
this->hitType = 0x33;
|
||||
}
|
||||
if ((parent->field_0x74.HALF.HI >> this->type2 & 1U) != 0) {
|
||||
this->actionDelay = 1;
|
||||
@@ -219,7 +219,7 @@ void sub_08045A28(Entity* this) {
|
||||
if (this->field_0x82.HALF.LO == 0) {
|
||||
GetNextFrame(this);
|
||||
}
|
||||
frames = this->frames.all & 0x70;
|
||||
frames = this->frame & 0x70;
|
||||
type = this->type;
|
||||
if (type == 0) {
|
||||
sub_08045A00(this);
|
||||
@@ -288,7 +288,7 @@ void sub_08045A28(Entity* this) {
|
||||
PositionRelative(this->parent, this, 0, -0x10000);
|
||||
switch (this->field_0x82.HALF.HI) {
|
||||
case 0:
|
||||
switch (this->frames.all & 0x70) {
|
||||
switch (this->frame & 0x70) {
|
||||
case 0x10:
|
||||
this->field_0x82.HALF.HI = 2;
|
||||
sub_0801D2B4(this, 0x13b);
|
||||
@@ -302,7 +302,7 @@ void sub_08045A28(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 1: {
|
||||
u32 temp = this->frames.all & 0x70;
|
||||
u32 temp = this->frame & 0x70;
|
||||
switch (temp) {
|
||||
case 0:
|
||||
this->field_0x82.HALF.HI = temp;
|
||||
@@ -317,9 +317,9 @@ void sub_08045A28(Entity* this) {
|
||||
}
|
||||
} break;
|
||||
case 2:
|
||||
switch (this->frames.all & 0x70) {
|
||||
switch (this->frame & 0x70) {
|
||||
case 0:
|
||||
this->field_0x82.HALF.HI = this->frames.all & 0x70;
|
||||
this->field_0x82.HALF.HI = this->frame & 0x70;
|
||||
sub_0801D2B4(this, 0x13f);
|
||||
break;
|
||||
default:
|
||||
|
||||
+38
-38
@@ -103,9 +103,9 @@ const s8 gUnk_080D0EB0[] = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x0
|
||||
0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd };
|
||||
|
||||
void VaatiWrath(Entity* this) {
|
||||
if (((this->type == 0) && ((this->bitfield & 0x80) != 0)) && (this->currentHealth == 0)) {
|
||||
this->flags |= 0x80;
|
||||
this->currentHealth = 0xff;
|
||||
if (((this->type == 0) && ((this->bitfield & 0x80) != 0)) && (this->health == 0)) {
|
||||
COLLISION_ON(this);
|
||||
this->health = 0xff;
|
||||
if (--this->cutsceneBeh.HALF.LO == 0) {
|
||||
this->action = 0xd;
|
||||
this->subAction = 0;
|
||||
@@ -138,7 +138,7 @@ void VaatiWrathType0Action0(Entity* this) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 0x3c;
|
||||
}
|
||||
this->x.HALF.HI = gScreenTransition.field_0x40;
|
||||
this->x.HALF.HI = gScreenTransition.hurtType;
|
||||
this->y.HALF.HI = gScreenTransition.field_0x42;
|
||||
sub_08042004(this);
|
||||
} else {
|
||||
@@ -149,11 +149,11 @@ void VaatiWrathType0Action0(Entity* this) {
|
||||
this->subAction = bVar1;
|
||||
this->actionDelay = 120;
|
||||
this->spritePriority.b1 = 0;
|
||||
this->height.HALF.HI = 0xffb0;
|
||||
this->z.HALF.HI = 0xffb0;
|
||||
gRoomControls.cameraTarget = this;
|
||||
sub_080809D4();
|
||||
}
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->field_0x6c.HALF.HI |= 1;
|
||||
this->field_0x78.HALF.HI = 0;
|
||||
this->field_0x7c.HALF.LO = 0x3c;
|
||||
@@ -169,11 +169,11 @@ void VaatiWrathType0Action1(Entity* this) {
|
||||
break;
|
||||
case 1:
|
||||
this->spritePriority.b1 = 1;
|
||||
this->height.WORD += 0x8000;
|
||||
if ((this->height.HALF.HI & 0x3f) == 0) {
|
||||
this->z.WORD += 0x8000;
|
||||
if ((this->z.HALF.HI & 0x3f) == 0) {
|
||||
SoundReq(SFX_1A9);
|
||||
}
|
||||
if (-6 < this->height.HALF.HI) {
|
||||
if (-6 < this->z.HALF.HI) {
|
||||
this->subAction = 2;
|
||||
SoundReq(SFX_1A9);
|
||||
}
|
||||
@@ -354,20 +354,20 @@ void VaatiWrathType0Action6(Entity* this) {
|
||||
if (this->actionDelay == 0) {
|
||||
type1 = ((VaatiWrathHeapStruct*)this->myHeap)->type1;
|
||||
GetNextFrame(type1);
|
||||
if (type1->frames.all == 1) {
|
||||
type1->frames.all &= 0xfe;
|
||||
if (type1->frame == 1) {
|
||||
type1->frame &= 0xfe;
|
||||
InitAnimationForceUpdate(this, 4);
|
||||
} else {
|
||||
if (type1->frames.all == 2) {
|
||||
if (type1->frame == 2) {
|
||||
Entity* type3 = CreateEnemy(VAATI_WRATH, 3);
|
||||
if (type3 != NULL) {
|
||||
type3->myHeap = this->myHeap;
|
||||
((VaatiWrathHeapStruct*)this->myHeap)->type3 = type3;
|
||||
InitializeAnimation(((VaatiWrathHeapStruct*)this->myHeap)->type2, 0x14);
|
||||
type1->frames.all &= 0xfd;
|
||||
type1->frame &= 0xfd;
|
||||
}
|
||||
} else {
|
||||
if ((type1->frames.all & 0x80) != 0) {
|
||||
if ((type1->frame & 0x80) != 0) {
|
||||
sub_0804235C(this);
|
||||
}
|
||||
}
|
||||
@@ -456,7 +456,7 @@ void VaatiWrathType0ActionA(Entity* this) {
|
||||
this->subAction = 0;
|
||||
this->direction = 0;
|
||||
this->speed = 0x100;
|
||||
this->hVelocity = 0x12000;
|
||||
this->zVelocity = 0x12000;
|
||||
sub_0801D2B4(this, 0x16b);
|
||||
InitAnimationForceUpdate(this, 5);
|
||||
type1 = ((VaatiWrathHeapStruct*)this->myHeap)->type1;
|
||||
@@ -479,8 +479,8 @@ void VaatiWrathType0ActionB(Entity* this) {
|
||||
if (sub_08003FC4(this, 0x2000) == 0) {
|
||||
this->subAction = 1;
|
||||
this->actionDelay = 0xf0;
|
||||
this->currentHealth = 8;
|
||||
this->damageType = 0x38;
|
||||
this->health = 8;
|
||||
this->hitType = 0x38;
|
||||
sub_08080964(0x14, 0);
|
||||
InitAnimationForceUpdate(this, 6);
|
||||
InitializeAnimation(((VaatiWrathHeapStruct*)this->myHeap)->type2, 0x16);
|
||||
@@ -492,8 +492,8 @@ void VaatiWrathType0ActionB(Entity* this) {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->subAction = 2;
|
||||
this->actionDelay = 0x3c;
|
||||
this->damageType = 0x39;
|
||||
this->currentHealth = 0xff;
|
||||
this->hitType = 0x39;
|
||||
this->health = 0xff;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -520,8 +520,8 @@ void VaatiWrathType0ActionC(Entity* this) {
|
||||
}
|
||||
switch (this->subAction) {
|
||||
case 0:
|
||||
this->height.WORD -= 0x8000;
|
||||
if (this->height.HALF.HI < -4) {
|
||||
this->z.WORD -= 0x8000;
|
||||
if (this->z.HALF.HI < -4) {
|
||||
this->subAction = 1;
|
||||
this->actionDelay = 120;
|
||||
this->direction = 0x10;
|
||||
@@ -545,11 +545,11 @@ void VaatiWrathType0ActionC(Entity* this) {
|
||||
default:
|
||||
sub_08042004(this);
|
||||
entity = ((VaatiWrathHeapStruct*)this->myHeap)->type1;
|
||||
if (entity->frames.b.f0) {
|
||||
entity->frames.all &= 0xfe;
|
||||
if (entity->frame & 1) {
|
||||
entity->frame &= 0xfe;
|
||||
InitAnimationForceUpdate(this, 9);
|
||||
} else {
|
||||
if (entity->frames.b.f3 != 0) {
|
||||
if (entity->frame & 0x80) {
|
||||
sub_0804235C(this);
|
||||
}
|
||||
}
|
||||
@@ -567,7 +567,7 @@ void sub_08041BE8(Entity* this) {
|
||||
if (sub_08079F8C() != 0) {
|
||||
this->subAction = 1;
|
||||
this->actionDelay = 120;
|
||||
this->scriptedScene = 3;
|
||||
this->updateConditions = 3;
|
||||
InitAnimationForceUpdate(this, 10);
|
||||
|
||||
entity = ((VaatiWrathHeapStruct*)this->myHeap)->type1;
|
||||
@@ -576,7 +576,7 @@ void sub_08041BE8(Entity* this) {
|
||||
((VaatiWrathHeapStruct*)this->myHeap)->type1 = NULL;
|
||||
|
||||
entity = ((VaatiWrathHeapStruct*)this->myHeap)->type2;
|
||||
entity->scriptedScene = 3;
|
||||
entity->updateConditions = 3;
|
||||
sub_080AE068(entity);
|
||||
LoadFixedGFX(entity, 0x1f5);
|
||||
sub_0801D2B4(entity, 0x16b);
|
||||
@@ -620,7 +620,7 @@ void sub_08041BE8(Entity* this) {
|
||||
|
||||
void sub_08041CD0(Entity* this) {
|
||||
GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2);
|
||||
if (this->frames.b.f3) {
|
||||
if (this->frame & 0x80) {
|
||||
if (this->actionDelay != 0) {
|
||||
this->actionDelay--;
|
||||
} else {
|
||||
@@ -644,13 +644,13 @@ void sub_08041D14(Entity* this) {
|
||||
if (gEntCount < 0x46) {
|
||||
pEVar1 = CreateObject(OBJECT_B6, 0, 0);
|
||||
pEVar1->parent = this;
|
||||
this->attachedEntity = pEVar1;
|
||||
this->child = pEVar1;
|
||||
pEVar1 = CreateObject(OBJECT_B6, 1, 0);
|
||||
pEVar1->parent = this;
|
||||
this->subAction = 3;
|
||||
this->actionDelay = 0x96;
|
||||
this->field_0xf = 0;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
SoundReq(SFX_1C4);
|
||||
}
|
||||
}
|
||||
@@ -666,14 +666,14 @@ void sub_08041D84(Entity* this) {
|
||||
if ((0xb7 < this->field_0xf) && ((this->field_0xf & 7) == 0)) {
|
||||
sub_0801D2B4(((VaatiWrathHeapStruct*)this->myHeap)->type2,
|
||||
gUnk_080D0E80[(this->field_0xf - 0xb8) >> 3]);
|
||||
sub_0801D2B4(this->attachedEntity, gUnk_080D0E80[(this->field_0xf - 0xb8) >> 3]);
|
||||
sub_0801D2B4(this->child, gUnk_080D0E80[(this->field_0xf - 0xb8) >> 3]);
|
||||
}
|
||||
if (this->field_0xf == 0xe6) {
|
||||
DoFade(7, 4);
|
||||
}
|
||||
} else {
|
||||
this->subAction = 4;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
sub_0801D2B4(this, 0x173);
|
||||
InitAnimationForceUpdate(this, 0xb);
|
||||
}
|
||||
@@ -802,7 +802,7 @@ u32 sub_08041FCC(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08042004(Entity* this) {
|
||||
this->height.HALF.HI = gUnk_080D0EA0[(++this->field_0x78.HALF.LO >> 4) & 7];
|
||||
this->z.HALF.HI = gUnk_080D0EA0[(++this->field_0x78.HALF.LO >> 4) & 7];
|
||||
}
|
||||
|
||||
void sub_08042028(Entity* this) {
|
||||
@@ -955,19 +955,19 @@ u32 sub_080422C0(Entity* this, u32 unk1) {
|
||||
GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2);
|
||||
type1 = ((VaatiWrathHeapStruct*)this->myHeap)->type1;
|
||||
GetNextFrame(type1);
|
||||
if (unk1 + 1 == (tmp = type1->frames.all)) {
|
||||
if (unk1 + 1 == (tmp = type1->frame)) {
|
||||
child = CreateProjectile(0x21);
|
||||
if (child != NULL) {
|
||||
child->type = unk1;
|
||||
child->parent = this;
|
||||
type1->frames.all &= ~tmp;
|
||||
type1->frame &= ~tmp;
|
||||
}
|
||||
} else {
|
||||
if (type1->frames.all == 4) {
|
||||
type1->frames.all &= 0xfb;
|
||||
if (type1->frame == 4) {
|
||||
type1->frame &= 0xfb;
|
||||
InitAnimationForceUpdate(this, 3);
|
||||
} else {
|
||||
if ((type1->frames.b.f3) != 0) {
|
||||
if (type1->frame & 0x80) {
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
type1->subAction = 0;
|
||||
InitializeAnimation(type1, 0xc);
|
||||
@@ -1009,7 +1009,7 @@ void VaatiWrathType0PreAction(Entity* this) {
|
||||
if (temp >= 0) {
|
||||
if (gPlayerState.field_0x2c == NULL) {
|
||||
if (gPlayerEntity.field_0x7a.HWORD == 0) {
|
||||
if ((gPlayerEntity.height.HALF.HI & 0x8000U) == 0 || (gPlayerState.field_0xa != 0)) {
|
||||
if ((gPlayerEntity.z.HALF.HI & 0x8000U) == 0 || (gPlayerState.field_0xa != 0)) {
|
||||
sub_08078AA8(0xb70, 0);
|
||||
gScreenTransition.field_0x38 |= 2;
|
||||
}
|
||||
|
||||
+16
-16
@@ -52,7 +52,7 @@ void VaatiWrathEyeAction0(Entity* this) {
|
||||
void VaatiWrathEyeAction1(Entity* this) {
|
||||
sub_080485D8(this);
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->action = 2;
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
@@ -62,7 +62,7 @@ void VaatiWrathEyeAction2(Entity* this) {
|
||||
sub_080485D8(this);
|
||||
if ((gScreenTransition.field_0x39 & 3) == 0) {
|
||||
this->action = 3;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->speed = 0x80;
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,7 @@ void VaatiWrathEyeAction3(Entity* this) {
|
||||
direction = sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, x, y);
|
||||
this->direction = direction;
|
||||
sub_0806F69C(this);
|
||||
this->height.HALF.HI = this->parent->height.HALF.HI;
|
||||
this->z.HALF.HI = this->parent->z.HALF.HI;
|
||||
if ((this->x.HALF.HI == x) && (this->y.HALF.HI == y)) {
|
||||
this->action = 4;
|
||||
this->actionDelay = 0x3c;
|
||||
@@ -101,7 +101,7 @@ void VaatiWrathEyeAction4(Entity* this) {
|
||||
}
|
||||
} else {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->action = 5;
|
||||
this->actionDelay = 0;
|
||||
}
|
||||
@@ -111,12 +111,12 @@ void VaatiWrathEyeAction4(Entity* this) {
|
||||
void VaatiWrathEyeAction5(Entity* this) {
|
||||
if (this->actionDelay != 0) {
|
||||
this->action = 6;
|
||||
if (this->parent->currentHealth >= 0x15) {
|
||||
if (this->parent->health >= 0x15) {
|
||||
this->actionDelay = 120;
|
||||
} else {
|
||||
this->actionDelay = 0x3c;
|
||||
}
|
||||
this->attachedEntity = NULL;
|
||||
this->child = NULL;
|
||||
InitializeAnimation(this, 5);
|
||||
SoundReq(SFX_19B);
|
||||
}
|
||||
@@ -133,17 +133,17 @@ void VaatiWrathEyeAction6(Entity* this) {
|
||||
InitializeAnimation(this, 6);
|
||||
}
|
||||
} else {
|
||||
if (this->frames.b.f3) {
|
||||
if (this->frame & 0x80) {
|
||||
this->action = 7;
|
||||
this->actionDelay = 120;
|
||||
this->field_0xf = 0;
|
||||
} else {
|
||||
if (this->frames.b.f0 != 0) {
|
||||
this->frames.all &= 0xfe;
|
||||
if (this->frame & 1) {
|
||||
this->frame &= 0xfe;
|
||||
pEVar3 = CreateProjectile(0x24);
|
||||
if (pEVar3 != NULL) {
|
||||
pEVar3->parent = this;
|
||||
this->attachedEntity = pEVar3;
|
||||
this->child = pEVar3;
|
||||
PositionRelative(this, pEVar3, 0, 0xc0000);
|
||||
}
|
||||
}
|
||||
@@ -157,8 +157,8 @@ void VaatiWrathEyeAction7(Entity* this) {
|
||||
if (this->field_0xf != 0) {
|
||||
this->action = 8;
|
||||
this->actionDelay = 0x3c;
|
||||
this->flags &= 0x7f;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
COLLISION_OFF(this);
|
||||
this->spriteSettings.draw = 0;
|
||||
CreateFx(this, FX_REFLECT2, 0x40);
|
||||
this->parent->field_0x7a.HALF.HI |= 0x10 << this->type;
|
||||
} else {
|
||||
@@ -177,8 +177,8 @@ void VaatiWrathEyeAction8(Entity* this) {
|
||||
} else {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 9;
|
||||
this->flags |= 0x80;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
COLLISION_ON(this);
|
||||
this->spriteSettings.draw = 1;
|
||||
InitializeAnimation(this, 0);
|
||||
sub_080485FC(this);
|
||||
SoundReq(SFX_166);
|
||||
@@ -189,7 +189,7 @@ void VaatiWrathEyeAction8(Entity* this) {
|
||||
void VaatiWrathEyeAction9(Entity* this) {
|
||||
sub_080485FC(this);
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((this->frame & 0x80) != 0) {
|
||||
this->action = 4;
|
||||
this->actionDelay = 1;
|
||||
this->parent->field_0x7a.HALF.HI = (this->parent->field_0x7a.HALF.HI & 0xf) | (1 << this->type);
|
||||
@@ -208,5 +208,5 @@ void sub_080485FC(Entity* this) {
|
||||
|
||||
ptr = &gUnk_080D1D98[this->type * 2];
|
||||
sub_0806FA90(this->parent, this, ptr[0], ptr[1]);
|
||||
this->height.HALF.HI = gUnk_080D1D78[this->type * 8 + (this->parent->field_0x78.HALF.LO >> 4 & 7)];
|
||||
this->z.HALF.HI = gUnk_080D1D78[this->type * 8 + (this->parent->field_0x78.HALF.LO >> 4 & 7)];
|
||||
}
|
||||
|
||||
+30
-30
@@ -26,12 +26,12 @@ void sub_0802A434(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802A454(Entity* this) {
|
||||
if (this->damageType != 0x75 && ((this->bitfield & 0x7f) == 0 || (this->bitfield & 0x7f) == 0x1e)) {
|
||||
if (this->hitType != 0x75 && ((this->bitfield & 0x7f) == 0 || (this->bitfield & 0x7f) == 0x1e)) {
|
||||
this->action = 5;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->field_0x7c.HALF.HI = gPlayerEntity.x.HALF.HI;
|
||||
this->field_0x80.HWORD = gPlayerEntity.y.HALF.HI;
|
||||
this->field_0x82.HWORD = gPlayerEntity.height.HALF.HI;
|
||||
this->field_0x82.HWORD = gPlayerEntity.z.HALF.HI;
|
||||
if (this->action != 3) {
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
@@ -72,13 +72,13 @@ void sub_0802A534(Entity* this) {
|
||||
if (ent != NULL) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 0x5a;
|
||||
this->flags |= 0x80;
|
||||
this->spriteSettings.b.draw = 3;
|
||||
COLLISION_ON(this);
|
||||
this->spriteSettings.draw = 3;
|
||||
this->x.HALF.HI = ent->x.HALF.HI;
|
||||
this->y.HALF.HI = ent->y.HALF.HI;
|
||||
this->height.HALF.HI = -0x80;
|
||||
this->z.HALF.HI = -0x80;
|
||||
this->spritePriority.b1 = 1;
|
||||
this->spriteSettings.b.shadow = 2;
|
||||
this->spriteSettings.shadow = 2;
|
||||
InitializeAnimation(this, 2);
|
||||
sub_0802A7D0(this);
|
||||
}
|
||||
@@ -93,11 +93,11 @@ void sub_0802A5B8(Entity* this) {
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
} else {
|
||||
this->height.HALF.HI += 3;
|
||||
if (-1 < this->height.HALF.HI) {
|
||||
this->z.HALF.HI += 3;
|
||||
if (-1 < this->z.HALF.HI) {
|
||||
this->action = 3;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->height.HALF.HI = 0;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->z.HALF.HI = 0;
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
}
|
||||
@@ -109,24 +109,24 @@ void sub_0802A610(Entity* this) {
|
||||
|
||||
GetNextFrame(this);
|
||||
sub_0802A7D0(this);
|
||||
flags = this->frames.all & 0x80;
|
||||
flags = this->frame & 0x80;
|
||||
if (flags) {
|
||||
this->action = 4;
|
||||
this->actionDelay = 0x1e;
|
||||
} else if (this->frames.all & 1) {
|
||||
this->frames.all = flags;
|
||||
this->damageType = 0x75;
|
||||
} else if (this->frame & 1) {
|
||||
this->frame = flags;
|
||||
this->hitType = 0x75;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0802A650(Entity* this) {
|
||||
sub_0802A7D0(this);
|
||||
this->height.HALF.HI -= 2;
|
||||
if (-0xa0 > this->height.HALF.HI) {
|
||||
this->z.HALF.HI -= 2;
|
||||
if (-0xa0 > this->z.HALF.HI) {
|
||||
this->action = 1;
|
||||
this->flags &= ~0x80;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->damageType = 0x74;
|
||||
COLLISION_OFF(this);
|
||||
this->spriteSettings.draw = 0;
|
||||
this->hitType = 0x74;
|
||||
this->field_0x78.HWORD = this->field_0x7c.BYTES.byte0 * 0x3c;
|
||||
}
|
||||
}
|
||||
@@ -139,26 +139,26 @@ void sub_0802A69C(Entity* this) {
|
||||
gPlayerState.field_0x1a[0] |= 0x80;
|
||||
gPlayerEntity.x.HALF.HI = this->field_0x7c.HALF.HI;
|
||||
gPlayerEntity.y.HALF.HI = this->field_0x80.HWORD;
|
||||
gPlayerEntity.height.HALF.HI = this->field_0x82.HWORD;
|
||||
gPlayerEntity.z.HALF.HI = this->field_0x82.HWORD;
|
||||
|
||||
if (gPlayerEntity.height.HALF.HI != this->height.HALF.HI) {
|
||||
if (gPlayerEntity.height.HALF.HI < this->height.HALF.HI) {
|
||||
this->height.HALF.HI--;
|
||||
if (gPlayerEntity.z.HALF.HI != this->z.HALF.HI) {
|
||||
if (gPlayerEntity.z.HALF.HI < this->z.HALF.HI) {
|
||||
this->z.HALF.HI--;
|
||||
} else {
|
||||
this->height.HALF.HI++;
|
||||
this->z.HALF.HI++;
|
||||
}
|
||||
}
|
||||
|
||||
/* sigh... */
|
||||
GetNextFrame(this);
|
||||
flags = this->frames.all & 0x80;
|
||||
flags = this->frame & 0x80;
|
||||
if (flags) {
|
||||
this->action = 6;
|
||||
this->actionDelay = 0x1e;
|
||||
} else if (this->frames.all & 0x1) {
|
||||
this->frames.all = flags;
|
||||
} else if (this->frame & 0x1) {
|
||||
this->frame = flags;
|
||||
this->spriteOffsetY = 3;
|
||||
gPlayerEntity.spriteSettings.b.draw = 0;
|
||||
gPlayerEntity.spriteSettings.draw = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ void sub_0802A734(Entity* this) {
|
||||
sub_0805E5A8();
|
||||
DoExitTransition(gUnk_0813AB1C[gArea.regret]);
|
||||
} else {
|
||||
this->height.WORD -= 0x20000;
|
||||
this->z.WORD -= 0x20000;
|
||||
gPlayerState.field_0xa |= 0x80;
|
||||
gPlayerState.field_0x1a[0] |= 0x80;
|
||||
}
|
||||
|
||||
+10
-10
@@ -33,7 +33,7 @@ void sub_0802CC80(Entity* this) {
|
||||
case 0 ... 1:
|
||||
case 0x1e:
|
||||
this->action = 3;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, 1);
|
||||
gPlayerEntity.flags &= ~0x80;
|
||||
break;
|
||||
@@ -55,9 +55,9 @@ void sub_0802CCE0(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 60;
|
||||
this->field_0xf = Random();
|
||||
this->spriteSettings.b.shadow = 2;
|
||||
this->spriteSettings.shadow = 2;
|
||||
this->animationState = 0xff;
|
||||
this->height.HALF.HI = -2;
|
||||
this->z.HALF.HI = -2;
|
||||
this->collisionLayer = 3;
|
||||
tmp = Random();
|
||||
this->field_0x7a.HALF.LO = tmp;
|
||||
@@ -125,13 +125,13 @@ void sub_0802CE68(Entity* this) {
|
||||
}
|
||||
sub_0802CFD8(this);
|
||||
GetNextFrame(this);
|
||||
frames = this->frames.all & 0x80;
|
||||
frames = this->frame & 0x80;
|
||||
if (frames) {
|
||||
this->action = 4;
|
||||
this->actionDelay = 30;
|
||||
} else if (this->frames.all & 1) {
|
||||
this->frames.all = frames;
|
||||
gPlayerEntity.spriteSettings.b.draw = 0;
|
||||
} else if (this->frame & 1) {
|
||||
this->frame = frames;
|
||||
gPlayerEntity.spriteSettings.draw = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,9 +141,9 @@ void sub_0802CEF4(Entity* this) {
|
||||
sub_0805E5A8();
|
||||
DoExitTransition(gUnk_0813AB1C[gArea.regret]);
|
||||
} else {
|
||||
this->height.WORD -= 0x20000;
|
||||
if (this->height.HALF.HI < -0x30) {
|
||||
this->spriteSettings.b.shadow = 1;
|
||||
this->z.WORD -= 0x20000;
|
||||
if (this->z.HALF.HI < -0x30) {
|
||||
this->spriteSettings.shadow = 1;
|
||||
}
|
||||
gPlayerState.field_0xa |= 0x80;
|
||||
gPlayerState.field_0x1a[0] |= 0x80;
|
||||
|
||||
+11
-11
@@ -22,7 +22,7 @@ void sub_0802A250(Entity* this) {
|
||||
|
||||
this->action = 1;
|
||||
this->actionDelay = 0;
|
||||
this->hVelocity = -0x30000;
|
||||
this->zVelocity = -0x30000;
|
||||
this->speed = gUnk_080CD03C[Random() & 3];
|
||||
this->direction = gUnk_080CD040[Random() & 3] + 0x18;
|
||||
this->collisionLayer = 2;
|
||||
@@ -45,25 +45,25 @@ void sub_0802A2B4(Entity* this) {
|
||||
}
|
||||
|
||||
sub_0802A39C(this);
|
||||
if (-8 < this->height.HALF.HI) {
|
||||
if (-8 < this->z.HALF.HI) {
|
||||
sub_0802A334(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0802A2FC(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->frame & 0x80) {
|
||||
DeleteEntity(this);
|
||||
} else if (this->frames.all & 1) {
|
||||
this->flags &= ~0x80;
|
||||
} else if (this->frame & 1) {
|
||||
COLLISION_OFF(this);
|
||||
} else {
|
||||
sub_0802A39C(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0802A334(Entity* this) {
|
||||
u32 x = (this->x.HALF.HI - gRoomControls.roomScrollX + gScreen.bg.bg1xOffset) >> 3;
|
||||
u32 y = (this->y.HALF.HI - gRoomControls.roomScrollY + gScreen.bg.bg1yOffset) >> 3;
|
||||
u32 x = (this->x.HALF.HI - gRoomControls.roomScrollX + gScreen.bg1.xOffset) >> 3;
|
||||
u32 y = (this->y.HALF.HI - gRoomControls.roomScrollY + gScreen.bg1.yOffset) >> 3;
|
||||
if (gBG3Buffer[(x & 0x1fU) + (y & 0x1fU) * 0x20 + 0x400]) {
|
||||
this->collisionLayer = 2;
|
||||
} else {
|
||||
@@ -73,12 +73,12 @@ void sub_0802A334(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802A39C(Entity* this) {
|
||||
u32 x = (gPlayerEntity.x.HALF.HI - gRoomControls.roomScrollX + gScreen.bg.bg1xOffset) >> 3;
|
||||
u32 y = (gPlayerEntity.y.HALF.HI - gRoomControls.roomScrollY + gScreen.bg.bg1yOffset - 10) >> 3;
|
||||
u32 x = (gPlayerEntity.x.HALF.HI - gRoomControls.roomScrollX + gScreen.bg1.xOffset) >> 3;
|
||||
u32 y = (gPlayerEntity.y.HALF.HI - gRoomControls.roomScrollY + gScreen.bg1.yOffset - 10) >> 3;
|
||||
if (gBG3Buffer[(x & 0x1fU) + (y & 0x1fU) * 0x20 + 0x400]) {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
} else {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+8
-8
@@ -34,8 +34,8 @@ void sub_08033564(Entity* this) {
|
||||
switch ((s32)bits & 0x3f) {
|
||||
case 0:
|
||||
this->action = 2;
|
||||
this->spriteSettings.b.draw = FALSE;
|
||||
this->flags &= 0x7f;
|
||||
this->spriteSettings.draw = FALSE;
|
||||
COLLISION_OFF(this);
|
||||
this->field_0x7c.HALF.LO = 0x27c;
|
||||
gPlayerState.flags |= 0x4000;
|
||||
gSave.stats.effect = this->type + 1;
|
||||
@@ -47,15 +47,15 @@ void sub_08033564(Entity* this) {
|
||||
break;
|
||||
case 0xe:
|
||||
case 0x15:
|
||||
this->currentHealth = 0;
|
||||
this->health = 0;
|
||||
break;
|
||||
case 0x14:
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->iframes = 0;
|
||||
this->spriteSettings.b.draw = FALSE;
|
||||
this->spriteSettings.draw = FALSE;
|
||||
ent = CreateFx(this, FX_DEATH, 0);
|
||||
if (ent != NULL) {
|
||||
this->attachedEntity = ent;
|
||||
this->child = ent;
|
||||
this->actionDelay = 0xe;
|
||||
CopyPosition(this, ent);
|
||||
}
|
||||
@@ -115,11 +115,11 @@ void sub_080336DC(Entity* this) {
|
||||
CreateDust(this);
|
||||
break;
|
||||
case 0xc:
|
||||
this->spriteSettings.b.draw = TRUE;
|
||||
this->spriteSettings.draw = TRUE;
|
||||
break;
|
||||
case 0x0:
|
||||
this->action = 1;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
sub_08033744(this);
|
||||
break;
|
||||
}
|
||||
|
||||
+9
-9
@@ -27,20 +27,20 @@ bool32 EnemyInit(Entity* this) {
|
||||
this->flags |= 0x80;
|
||||
}
|
||||
this->spriteIndex = definition->spriteIndex;
|
||||
if (this->spriteSettings.b.draw == 0) {
|
||||
this->spriteSettings.b.draw = definition->spriteFlags.draw;
|
||||
if (this->spriteSettings.draw == 0) {
|
||||
this->spriteSettings.draw = definition->spriteFlags.draw;
|
||||
}
|
||||
this->spritePriority.b1 = definition->spriteFlags.spritePriority;
|
||||
this->spriteSettings.b.shadow = definition->spriteFlags.shadow;
|
||||
this->spriteSettings.shadow = definition->spriteFlags.shadow;
|
||||
if (this->speed == 0) {
|
||||
this->speed = definition->speed;
|
||||
}
|
||||
this->flags2 = definition->flags2;
|
||||
this->damageType = definition->damageType;
|
||||
this->hitType = definition->damageType;
|
||||
this->hitbox = (Hitbox*)definition->ptr.hitbox;
|
||||
this->currentHealth = definition->health;
|
||||
if (this->field_0x40 == 0) {
|
||||
this->field_0x40 = 0x41;
|
||||
this->health = definition->health;
|
||||
if (this->hurtType == 0) {
|
||||
this->hurtType = 0x41;
|
||||
}
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
if ((this->field_0x6c.HALF.HI & 0x20) != 0) {
|
||||
@@ -49,12 +49,12 @@ bool32 EnemyInit(Entity* this) {
|
||||
Entity* object = CreateObject(0xa9, uVar4 - 1, 0);
|
||||
if (object != NULL) {
|
||||
object->actionDelay = this->flags;
|
||||
object->field_0xf = this->spriteSettings.b.draw;
|
||||
object->field_0xf = this->spriteSettings.draw;
|
||||
object->spritePriority.b0 = 3;
|
||||
object->parent = this;
|
||||
CopyPosition(this, object);
|
||||
this->flags &= 0x7f;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->spriteSettings.draw = 0;
|
||||
this->field_0x6c.HALF.HI |= 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
+248
-22
@@ -1,15 +1,234 @@
|
||||
#include "global.h"
|
||||
#include "area.h"
|
||||
#include "entity.h"
|
||||
#include "utils.h"
|
||||
#include "functions.h"
|
||||
#include "entity.h"
|
||||
#include "area.h"
|
||||
#include "room.h"
|
||||
#include "script.h"
|
||||
#include "textbox.h"
|
||||
|
||||
typedef struct OtherEntity {
|
||||
struct OtherEntity* prev;
|
||||
struct OtherEntity* next;
|
||||
Entity* field_0x8;
|
||||
u8 field_0xC[0x34];
|
||||
} OtherEntity;
|
||||
extern void sub_0805E3A0(void*, u32);
|
||||
extern u8 gUnk_081091F8[];
|
||||
extern u8 gUnk_081091EE[];
|
||||
extern u8 gUpdateVisibleTiles;
|
||||
extern u8 gEntCount;
|
||||
extern u8 gManagerCount;
|
||||
extern Manager gUnk_02033290;
|
||||
|
||||
void sub_0805E524(void);
|
||||
void sub_0805E510(u32);
|
||||
void sub_0805ED30(void);
|
||||
void ClearHitboxList(void);
|
||||
void sub_0806F0A4(void);
|
||||
void UpdateEntities_arm(u32);
|
||||
void sub_0805EE88(void);
|
||||
void ClearAllDeletedEntities(void);
|
||||
void DeleteAllEntities(void);
|
||||
void sub_0805E98C(void);
|
||||
|
||||
void sub_0805E248(void) {
|
||||
s32 v0;
|
||||
|
||||
v0 = gUnk_03004030.unk_00->unk_06;
|
||||
if (gRoomControls.areaID == 10 || gRoomControls.areaID == 22) {
|
||||
SetTileType(636, v0 - 65, 1);
|
||||
SetTileType(643, v0 - 65, 2);
|
||||
SetTileType(637, v0 - 64, 1);
|
||||
SetTileType(644, v0 - 64, 2);
|
||||
SetTileType(638, v0 - 63, 1);
|
||||
SetTileType(645, v0 - 63, 2);
|
||||
SetTileType(639, v0 - 1, 1);
|
||||
SetTileType(640, v0, 1);
|
||||
SetTileType(642, v0 + 1, 1);
|
||||
} else {
|
||||
SetTileType(620, v0 - 65, 1);
|
||||
SetTileType(627, v0 - 65, 2);
|
||||
SetTileType(621, v0 - 64, 1);
|
||||
SetTileType(628, v0 - 64, 2);
|
||||
SetTileType(622, v0 - 63, 1);
|
||||
SetTileType(629, v0 - 63, 2);
|
||||
SetTileType(623, v0 - 1, 1);
|
||||
SetTileType(624, v0, 1);
|
||||
SetTileType(626, v0 + 1, 1);
|
||||
}
|
||||
gUpdateVisibleTiles = 0;
|
||||
}
|
||||
|
||||
void sub_0805E374(Entity* param_1) {
|
||||
u8 r3 = gScreenTransition.field_0x24[8];
|
||||
u8* array = gUnk_081091F8;
|
||||
|
||||
if (r3 != 2) {
|
||||
array = gUnk_081091EE;
|
||||
}
|
||||
sub_0805E3A0(param_1, array[param_1->kind]);
|
||||
}
|
||||
|
||||
void sub_0805E3A0(void* ent, u32 param) {
|
||||
Entity* e = (Entity*)ent;
|
||||
e->updateConditions2 = param;
|
||||
e->updateConditions = param;
|
||||
}
|
||||
|
||||
bool32 CheckDontUpdate(Entity* this) {
|
||||
u32 value;
|
||||
|
||||
if (this->flags & ENT_ASLEEP)
|
||||
return TRUE;
|
||||
if (this->action == 0)
|
||||
return FALSE;
|
||||
|
||||
if (gUnk_03003DC0.unk0 > gUnk_03003DC0.unk1)
|
||||
value = gUnk_03003DC0.unk0;
|
||||
else
|
||||
value = gUnk_03003DC0.unk1;
|
||||
|
||||
if (gMessage.doTextBox & 0x7F)
|
||||
value = value < 2 ? 2 : value;
|
||||
return value > this->updateConditions;
|
||||
}
|
||||
|
||||
bool32 sub_0805E40C(void) {
|
||||
u32 v0 = gUnk_03003DC0.unk0;
|
||||
if (gUnk_03003DC0.unk0 <= gUnk_03003DC0.unk1)
|
||||
v0 = gUnk_03003DC0.unk1;
|
||||
return v0 != 0;
|
||||
}
|
||||
|
||||
s32 sub_0805E428() {
|
||||
s32 result;
|
||||
|
||||
sub_0805E524();
|
||||
if (gUnk_03003DC0.unk2) {
|
||||
result = 0;
|
||||
gUnk_03003DC0.unk1 = gUnk_03003DC0.unk2;
|
||||
gUnk_03003DC0.unk2 = 0;
|
||||
} else {
|
||||
result = gUnk_03003DC0.unk3;
|
||||
if (gUnk_03003DC0.unk3) {
|
||||
gUnk_03003DC0.unk1 = gUnk_03003DC0.unk3 = 0;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
s32 sub_0805E450(u32 a1) {
|
||||
if (a1 < gUnk_03003DC0.unk2 || a1 < gUnk_03003DC0.unk1)
|
||||
return 0;
|
||||
gUnk_03003DC0.unk2 = a1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void sub_0805E470(void) {
|
||||
gUnk_03003DC0.unk3 = 1;
|
||||
}
|
||||
|
||||
void sub_0805E47C(Entity* this) {
|
||||
this->updateConditions2 = this->updateConditions;
|
||||
this->updateConditions = 2;
|
||||
if (sub_0805E450(2))
|
||||
gUnk_03003DC0.unk4 = this;
|
||||
}
|
||||
|
||||
void sub_0805E4A0(Entity* this) {
|
||||
sub_08078A90(1);
|
||||
this->updateConditions2 = this->updateConditions;
|
||||
this->updateConditions = 3;
|
||||
if (sub_0805E450(1))
|
||||
gUnk_03003DC0.unk4 = this;
|
||||
}
|
||||
|
||||
void sub_0805E4CC(Entity* this) {
|
||||
sub_08078A90(0);
|
||||
sub_0805E584(this);
|
||||
}
|
||||
|
||||
void sub_0805E4E0(Entity* a1, u32 a2) {
|
||||
if (a1 != NULL) {
|
||||
a1->updateConditions2 = a1->updateConditions;
|
||||
a1->updateConditions = 3;
|
||||
}
|
||||
if (sub_0805E450(1u))
|
||||
gUnk_03003DC0.unk4 = a1;
|
||||
sub_0805E510(a2);
|
||||
}
|
||||
|
||||
void sub_0805E510(u32 a1) {
|
||||
if (gUnk_03003DC0.unk_0xc < a1)
|
||||
gUnk_03003DC0.unk_0xc = a1;
|
||||
}
|
||||
|
||||
void sub_0805E524(void) {
|
||||
if (gUnk_03003DC0.unk_0xc != 0) {
|
||||
if (--gUnk_03003DC0.unk_0xc << 16 == 0)
|
||||
sub_0805E470();
|
||||
}
|
||||
}
|
||||
|
||||
void FreezeTime(void) {
|
||||
gUnk_03003DC0.unk0 = 6;
|
||||
gPlayerEntity.updateConditions = 6;
|
||||
}
|
||||
|
||||
void UnfreezeTime() {
|
||||
gUnk_03003DC0.unk0 = 0;
|
||||
gPlayerEntity.updateConditions = 1;
|
||||
}
|
||||
|
||||
void sub_0805E584(Entity* e) {
|
||||
e->updateConditions = e->updateConditions2;
|
||||
sub_0805E470();
|
||||
}
|
||||
|
||||
void sub_0805E59C() {
|
||||
gUnk_03003DC0.unk0 = 6;
|
||||
}
|
||||
|
||||
void sub_0805E5A8() {
|
||||
gUnk_03003DC0.unk0 = 7;
|
||||
}
|
||||
|
||||
void sub_0805E5B4() {
|
||||
gUnk_03003DC0.unk0 = 0;
|
||||
}
|
||||
|
||||
void UpdateEntities() {
|
||||
void (*f)(u32);
|
||||
|
||||
gRoomVars.filler1[0] = gRoomVars.field_0x4;
|
||||
gRoomVars.field_0x4 = 0;
|
||||
sub_0805ED30();
|
||||
sub_0805E428();
|
||||
ClearHitboxList();
|
||||
sub_0806F0A4();
|
||||
f = UpdateEntities_arm;
|
||||
f(0);
|
||||
ClearAllDeletedEntities();
|
||||
sub_0805EE88();
|
||||
}
|
||||
|
||||
void UpdateManagers() {
|
||||
void (*f)(u32);
|
||||
f = UpdateEntities_arm;
|
||||
f(1);
|
||||
ClearAllDeletedEntities();
|
||||
}
|
||||
|
||||
void EraseAllEntities() {
|
||||
extern u8 gUnk_03000000[];
|
||||
DeleteAllEntities();
|
||||
MemClear(&gUnk_03003DC0, 12);
|
||||
MemClear(&gPlayerEntity, 10880);
|
||||
MemClear(&gUnk_02033290, 2048);
|
||||
sub_0805E98C();
|
||||
gEntCount = 0;
|
||||
gManagerCount = 0;
|
||||
gUnk_03000000[0x427] = 1;
|
||||
gUnk_03000000[0x426] = 1;
|
||||
gUnk_03000000[0x42e] = 1;
|
||||
}
|
||||
|
||||
ASM_FUNC("./asm/getEmptyEntity.s", Entity* GetEmptyEntity());
|
||||
|
||||
extern Entity gUnk_030011E8[7];
|
||||
|
||||
@@ -25,7 +244,7 @@ Entity* sub_0805E744(void) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OtherEntity* GetEmptyManager(void);
|
||||
Manager* GetEmptyManager(void);
|
||||
|
||||
typedef void* (*Getter)(void);
|
||||
|
||||
@@ -55,7 +274,7 @@ void DeleteThisEntity(void) {
|
||||
_call_via_r0((u32*)&_ClearAndUpdateEntities);
|
||||
}
|
||||
|
||||
void DeleteManager(OtherEntity*);
|
||||
void DeleteManager(Manager*);
|
||||
|
||||
typedef void (*Deleter)(void*);
|
||||
|
||||
@@ -98,12 +317,12 @@ void DeleteEntity(Entity* ent) {
|
||||
if (ent->kind == ENEMY) {
|
||||
sub_0804AA1C(ent);
|
||||
}
|
||||
ent->flags = ent->flags & 0x7f;
|
||||
ent->spriteSettings.b.draw = 0;
|
||||
COLLISION_OFF(ent);
|
||||
ent->spriteSettings.draw = 0;
|
||||
ent->field_0x3c = 0;
|
||||
ent->bitfield = 0;
|
||||
ent->knockbackDuration = 0;
|
||||
ent->currentHealth = 0;
|
||||
ent->health = 0;
|
||||
UnlinkEntity(ent);
|
||||
ent->next = NULL;
|
||||
ent->prev = (Entity*)0xffffffff;
|
||||
@@ -146,13 +365,20 @@ void DeleteAllEntities(void) {
|
||||
}
|
||||
}
|
||||
|
||||
extern OtherEntity gUnk_02033290;
|
||||
extern Manager gUnk_02033290;
|
||||
|
||||
OtherEntity* GetEmptyManager(void) {
|
||||
OtherEntity* it;
|
||||
for (it = &gUnk_02033290; it < (&gUnk_02033290 + 32); it++) {
|
||||
typedef struct Temp {
|
||||
void* prev;
|
||||
void* next;
|
||||
u8 _0[0x38];
|
||||
} Temp;
|
||||
|
||||
// fix this
|
||||
Manager* GetEmptyManager(void) {
|
||||
Temp* it;
|
||||
for (it = (Temp*)&gUnk_02033290; it < ((Temp*)&gUnk_02033290 + 32); it++) {
|
||||
if (it->prev == 0) {
|
||||
return it;
|
||||
return (Manager*)it;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
@@ -160,13 +386,13 @@ OtherEntity* GetEmptyManager(void) {
|
||||
|
||||
extern u8 gManagerCount;
|
||||
|
||||
void DeleteManager(OtherEntity* ent) {
|
||||
void DeleteManager(Manager* ent) {
|
||||
if (!ent->next)
|
||||
return;
|
||||
|
||||
sub_0805E92C(ent);
|
||||
UnlinkEntity(ent);
|
||||
MemClear(ent, sizeof(OtherEntity));
|
||||
MemClear(ent, sizeof(Temp));
|
||||
gManagerCount--;
|
||||
}
|
||||
|
||||
@@ -214,7 +440,7 @@ void sub_0805E9A8(void) {
|
||||
} while (++list < &gEntityLists[9]);
|
||||
}
|
||||
|
||||
void sub_0805E9F4(void) {
|
||||
void DeleteSleepingEntities(void) {
|
||||
Entity* ent;
|
||||
Entity* next;
|
||||
LinkedList* list;
|
||||
@@ -223,7 +449,7 @@ void sub_0805E9F4(void) {
|
||||
do {
|
||||
for (ent = list->first; (u32)ent != (u32)list; ent = next) {
|
||||
next = ent->next;
|
||||
if (ent->flags & 0x10)
|
||||
if (ent->flags & ENT_ASLEEP)
|
||||
DeleteEntityAny(ent);
|
||||
}
|
||||
} while (++list < &gEntityLists[9]);
|
||||
|
||||
+3
-3
@@ -38,9 +38,9 @@ void DoFade(u32 fadeType, u32 fadeSpeed) {
|
||||
}
|
||||
if ((fadeType & 8) != 0) {
|
||||
gUnk_03000000.spritesOffset = 1;
|
||||
gScreen.bg.bg1Control |= 0x40;
|
||||
gScreen.affine.bg2Control |= 0x40;
|
||||
gScreen.affine.bg3Control |= 0x40;
|
||||
gScreen.bg1.control |= 0x40;
|
||||
gScreen.bg2.control |= 0x40;
|
||||
gScreen.bg3.control |= 0x40;
|
||||
}
|
||||
if ((fadeType & 0x10) != 0) {
|
||||
sub_0801E1B8(gFadeControl.field_0x16, gFadeControl.field_0x18);
|
||||
|
||||
+15
-15
@@ -109,19 +109,19 @@ void CreateDialogBox(u32 arg0, u32 arg1) {
|
||||
if (sfx) {
|
||||
SoundReq(sfx);
|
||||
}
|
||||
gScreen.bg.bg0Updated = 1;
|
||||
gScreen.bg0.updated = 1;
|
||||
}
|
||||
|
||||
void sub_08050384(void) {
|
||||
RecoverUI(0, 0);
|
||||
MemClear(&gBG0Buffer, sizeof(gBG0Buffer));
|
||||
gScreen.bg.bg0Updated = 1;
|
||||
gScreen.bg0.updated = 1;
|
||||
}
|
||||
|
||||
void sub_080503A8(u32 gfxGroup) {
|
||||
LoadGfxGroup(gfxGroup);
|
||||
gScreen.bg.bg1Updated = 1;
|
||||
gScreen.affine.bg2Updated = 1;
|
||||
gScreen.bg1.updated = 1;
|
||||
gScreen.bg2.updated = 1;
|
||||
}
|
||||
|
||||
void SetFileSelectState(FileSelectState mode) {
|
||||
@@ -162,12 +162,12 @@ void HandleChooseFileScreen(void) {
|
||||
sScreenHandlers[gMain.funcIndex]();
|
||||
if (gUnk_02032EC0.lastState != gUnk_02032EC0.state) {
|
||||
gUnk_02032EC0.lastState = gUnk_02032EC0.state;
|
||||
gScreen.bg.bg0xOffset = 0;
|
||||
gScreen.bg.bg0yOffset = 0;
|
||||
gScreen.bg.bg1xOffset = 0;
|
||||
gScreen.bg.bg1yOffset = 0;
|
||||
gScreen.affine.bg2xOffset = 0;
|
||||
gScreen.affine.bg2yOffset = 0;
|
||||
gScreen.bg0.xOffset = 0;
|
||||
gScreen.bg0.yOffset = 0;
|
||||
gScreen.bg1.xOffset = 0;
|
||||
gScreen.bg1.yOffset = 0;
|
||||
gScreen.bg2.xOffset = 0;
|
||||
gScreen.bg2.yOffset = 0;
|
||||
MemClear(&gChooseFileState, sizeof(gChooseFileState));
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ void HandleChooseFileScreen(void) {
|
||||
sFileScreenSubHandlers[gUnk_02032EC0.lastState]();
|
||||
|
||||
gUnk_02019EE0.isTransitioning = FALSE;
|
||||
sub_0805E5C0();
|
||||
UpdateEntities();
|
||||
sub_0805066C();
|
||||
sub_0801C1D4();
|
||||
sub_0801C208();
|
||||
@@ -220,7 +220,7 @@ static void HandleFileScreenEnter(void) {
|
||||
sub_080A70AC(&gUnk_080FC8D0);
|
||||
HideButtonR();
|
||||
gScreen.lcd.displayControl |= DISPCNT_BG_ALL_ON | DISPCNT_OBJ_ON;
|
||||
gScreen.affine.bg3Control = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(2) | BGCNT_SCREENBASE(30);
|
||||
gScreen.bg3.control = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(2) | BGCNT_SCREENBASE(30);
|
||||
gScreen.controls.layerFXControl = BLDCNT_TGT1_BG2 | BLDCNT_TGT2_BG3 | BLDCNT_EFFECT_BLEND;
|
||||
gScreen.controls.alphaBlend = BLDALPHA_BLEND(15, 10);
|
||||
gUnk_02024490.unk0 = 1;
|
||||
@@ -525,7 +525,7 @@ void sub_08050AFC(u32 idx) {
|
||||
if (gUnk_02019EE0.saveStatus[idx] == SAVE_VALID) {
|
||||
sub_08050B3C(&gBG1Buffer[0x14E]);
|
||||
}
|
||||
gScreen.bg.bg1Updated = 1;
|
||||
gScreen.bg1.updated = 1;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
@@ -859,8 +859,8 @@ void sub_08051090(void) {
|
||||
sub_08050790();
|
||||
sub_0805070C();
|
||||
sub_08051458();
|
||||
gScreen.bg.bg1yOffset = 0xff;
|
||||
gScreen.affine.bg2yOffset = 0xff;
|
||||
gScreen.bg1.yOffset = 0xff;
|
||||
gScreen.bg2.yOffset = 0xff;
|
||||
sub_080A7114(1);
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -248,7 +248,7 @@ NONMATCH("asm/non_matching/game/sub_08052418.inc", void sub_08052418(int param_1
|
||||
// temp._0 = gBG1Buffer[gUnk_080FCAA4._8[param_1]][gUnk_080FCAA4._0[gSaveHeader->gameLanguage + i]] * 2;
|
||||
temp._13 = ((temp._13 & 0xfe) | gUnk_080FCAA4._8[i + 1]) & 1;
|
||||
sub_0805F46C(gUnk_080FCAA4._a[param_1], &temp);
|
||||
gScreen.bg.bg1xOffset = 1;
|
||||
gScreen.bg1.xOffset = 1;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
@@ -259,7 +259,7 @@ void InitializePlayer(void) {
|
||||
MemClear((void*)&gUnk_03000B80, sizeof(gUnk_03000B80));
|
||||
MemClear((void*)&gPlayerState, 0xb0);
|
||||
|
||||
MemFill32(0xffffffff, &gPlayerState.field_0x40, 0x40);
|
||||
MemFill32(0xffffffff, &gPlayerState.hurtType, 0x40);
|
||||
pl = &gPlayerEntity;
|
||||
MemClear((void*)pl, 0x88);
|
||||
gRoomControls.cameraTarget = pl;
|
||||
@@ -270,7 +270,7 @@ void InitializePlayer(void) {
|
||||
switch (gScreenTransition.field_0xf) {
|
||||
case 0x2:
|
||||
case 0x6:
|
||||
pl->height.HALF.HI = -0xc0;
|
||||
pl->z.HALF.HI = -0xc0;
|
||||
break;
|
||||
case 0x4:
|
||||
gPlayerState.field_0x34[4] = 0x10;
|
||||
@@ -295,7 +295,7 @@ void InitializePlayer(void) {
|
||||
pl->kind = 1;
|
||||
pl->flags |= 0xa0;
|
||||
pl->spritePriority.b0 = 4;
|
||||
pl->currentHealth = gSave.stats.health;
|
||||
pl->health = gSave.stats.health;
|
||||
pl->x.HALF.HI = gScreenTransition.playerStartPos.HALF.x;
|
||||
pl->y.HALF.HI = gScreenTransition.playerStartPos.HALF.y;
|
||||
pl->animationState = gScreenTransition.playerState;
|
||||
@@ -354,7 +354,7 @@ s32 ModHealth(s32 deltaHealth) {
|
||||
newHealth = (u32)gStats.maxHealth;
|
||||
}
|
||||
gStats.health = newHealth;
|
||||
gPlayerEntity.currentHealth = newHealth;
|
||||
gPlayerEntity.health = newHealth;
|
||||
return newHealth;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,333 @@
|
||||
#include "global.h"
|
||||
#include "audio.h"
|
||||
#include "main.h"
|
||||
#include "player.h"
|
||||
#include "structures.h"
|
||||
#include "save.h"
|
||||
#include "textbox.h"
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "utils.h"
|
||||
#include "npc.h"
|
||||
#include "effects.h"
|
||||
#include "screen.h"
|
||||
#include "gba/m4a.h"
|
||||
|
||||
extern u8 gUnk_03003DE0;
|
||||
extern u8 gUnk_03000C30;
|
||||
|
||||
extern u16* gUnk_02025EB0;
|
||||
extern u16* gUnk_0200B650;
|
||||
extern u8 gUpdateVisibleTiles;
|
||||
extern u8 gUnk_03003DF0[];
|
||||
extern u8 gUnk_03003BE0;
|
||||
extern Entity* gUnk_03004040[3];
|
||||
extern u16 gUnk_080B2CD8[];
|
||||
extern u32 gUnk_03000FBC;
|
||||
|
||||
extern void sub_080ADD70();
|
||||
extern void sub_0801C25C();
|
||||
extern void UpdateDisplayControls();
|
||||
extern void LoadResources();
|
||||
extern void FadeMain();
|
||||
extern void HandlePlayerLife();
|
||||
extern void DoPlayerAction();
|
||||
extern void sub_080171F0();
|
||||
extern void sub_08078FB0();
|
||||
extern u32 CheckDontUpdate();
|
||||
extern void DrawEntity();
|
||||
extern void sub_0807A050();
|
||||
extern u32 sub_08079B24();
|
||||
extern void sub_08079708();
|
||||
extern void CreateSparkle();
|
||||
extern void sub_080028E0(Entity*);
|
||||
extern void sub_08078180(void);
|
||||
extern void sub_0807B0C8(void);
|
||||
extern void sub_0807A8D8(Entity*);
|
||||
extern void sub_08077FEC(u32);
|
||||
|
||||
void gIntrMain(void);
|
||||
|
||||
struct {
|
||||
u8 update;
|
||||
u8 _0[0x1c];
|
||||
struct OamData oam[0x80];
|
||||
} extern gUnk_03000000;
|
||||
|
||||
struct {
|
||||
u8 ready;
|
||||
u16* src;
|
||||
u16* dest;
|
||||
u32 size;
|
||||
} extern gUnk_02022730;
|
||||
|
||||
void sub_08016CA8(BgSettings* bg);
|
||||
void sub_08016BF8(void);
|
||||
void DispCtrlSet(void);
|
||||
|
||||
void DummyIntr(void) {
|
||||
/* .. */
|
||||
}
|
||||
|
||||
void EnableVBlankIntr(void) {
|
||||
INTR_VECTOR = gIntrMain;
|
||||
REG_DISPSTAT = 0x5028;
|
||||
REG_IE = 0x2005;
|
||||
REG_IME = 1;
|
||||
}
|
||||
|
||||
void VBlankIntr(void) {
|
||||
DmaStop(0);
|
||||
m4aSoundVSync();
|
||||
if (gMain.interruptFlag == 0) {
|
||||
DispCtrlSet();
|
||||
DmaCopy32(0, &gUnk_03000FBC, &gUnk_02022730, 16);
|
||||
gMain.interruptFlag = 1;
|
||||
}
|
||||
sub_08016BF8();
|
||||
INTR_CHECK |= 1;
|
||||
}
|
||||
|
||||
void HBlankIntr(void) {
|
||||
REG_DISPSTAT = 0x5028;
|
||||
m4aSoundMain();
|
||||
}
|
||||
|
||||
void sub_08016BF8(void) {
|
||||
if (gUnk_02022730.ready) {
|
||||
const u16* src = gUnk_02022730.src;
|
||||
u16* dest = gUnk_02022730.dest;
|
||||
s32 size, i = size = gUnk_02022730.size;
|
||||
DmaSet(0, src, dest, size);
|
||||
|
||||
i = size & 0x3fff;
|
||||
if (i == 0) {
|
||||
i = 0x4000;
|
||||
}
|
||||
do {
|
||||
*dest++ = *src++;
|
||||
} while (--i > 0);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateDisplayControls(void) {
|
||||
if (gUnk_03000000.update && ((gScreen.lcd.displayControl & 0x1000) != 0)) {
|
||||
gUnk_03000000.update = 0;
|
||||
DmaCopy32(3, &gUnk_03000000.oam, 0x07000000, 0x400);
|
||||
}
|
||||
sub_08016CA8(&gScreen.bg0);
|
||||
sub_08016CA8(&gScreen.bg1);
|
||||
sub_08016CA8((BgSettings*)&gScreen.bg2);
|
||||
sub_08016CA8((BgSettings*)&gScreen.bg3);
|
||||
}
|
||||
|
||||
void sub_08016CA8(BgSettings* bg) {
|
||||
if (bg->updated && bg->tilemap != NULL) {
|
||||
u32 dest;
|
||||
bg->updated = 0;
|
||||
dest = bg->control;
|
||||
DmaCopy32(3, bg->tilemap, ((dest << 3) & 0xF800) + 0x06000000, gUnk_080B2CD8[dest >> 14]);
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/dispCtrlSet.s", void DispCtrlSet(void));
|
||||
|
||||
// Load any resources that were requested with LoadResourceAsync
|
||||
void LoadResources(void) {
|
||||
if (gUnk_03003DE0 != 0) {
|
||||
u8* buf = &gUnk_03000C30;
|
||||
s32 i = gUnk_03003DE0;
|
||||
gUnk_03003DE0 = 0;
|
||||
do {
|
||||
switch (*buf) {
|
||||
case 0:
|
||||
DmaCopy32(3, *(u32*)(buf + 4), *(u32*)(buf + 8), *(u16*)(buf + 2));
|
||||
break;
|
||||
case 1:
|
||||
LZ77UnCompVram(*(void**)(buf + 4), *(u8**)(buf + 8));
|
||||
break;
|
||||
case 2:
|
||||
DmaFill32(3, *(u32*)(buf + 4), *(u32*)(buf + 8), *(u16*)(buf + 2));
|
||||
break;
|
||||
}
|
||||
buf += 12;
|
||||
i--;
|
||||
} while (0 < i);
|
||||
}
|
||||
}
|
||||
|
||||
void PrepNextFrame(void) {
|
||||
gMain.interruptFlag = 0;
|
||||
VBlankIntrWait();
|
||||
do {
|
||||
// Our VBlankIntr will set this flag
|
||||
} while (gMain.interruptFlag == 0);
|
||||
|
||||
sub_080ADD70();
|
||||
sub_0801C25C();
|
||||
UpdateDisplayControls();
|
||||
LoadResources();
|
||||
|
||||
if (gUpdateVisibleTiles) {
|
||||
gUpdateVisibleTiles = 0;
|
||||
if (gUnk_02025EB0 != NULL)
|
||||
// sizeof(BGBuffer) = 0x800, what are we omitting?
|
||||
DmaCopy32(3, &gBG1Buffer, VRAM + (*gUnk_02025EB0 & 0x1f00) * 8, 0x5C0);
|
||||
if (gUnk_0200B650 != NULL)
|
||||
DmaCopy32(3, &gBG2Buffer, VRAM + (*gUnk_0200B650 & 0x1f00) * 8, 0x5C0);
|
||||
}
|
||||
FadeMain();
|
||||
}
|
||||
|
||||
void PlayerUpdate(Entity* this) {
|
||||
if (gSave.stats.effect != 0)
|
||||
gPlayerState.flags |= 0x4000;
|
||||
else
|
||||
gPlayerState.flags &= ~0x4000;
|
||||
|
||||
if (CheckDontUpdate(this) == 0) {
|
||||
if ((gPlayerState.flags & 0x80000) != 0) {
|
||||
sub_08077B20();
|
||||
if ((gPlayerState.flags & 0x200000) != 0) {
|
||||
gPlayerState.playerAction = 0x18;
|
||||
gPlayerState.flags &= ~0x80000;
|
||||
gPlayerState.hurtBlinkSpeed = 0xf0;
|
||||
COLLISION_ON(this);
|
||||
} else {
|
||||
COLLISION_OFF(this);
|
||||
gPlayerState.field_0xa8 = 0xf;
|
||||
}
|
||||
}
|
||||
HandlePlayerLife(this);
|
||||
DoPlayerAction(this);
|
||||
if ((this->z.WORD == 0) && (this->action == 1 || this->action == 9))
|
||||
sub_08008790(this, 8);
|
||||
sub_080171F0();
|
||||
}
|
||||
sub_08078FB0(this);
|
||||
DrawEntity(this);
|
||||
sub_0807A050();
|
||||
}
|
||||
|
||||
// Responsible for some life things like low health beep and initiating the death sequence
|
||||
#ifdef EU
|
||||
ASM_FUNC("asm/non_matching/eu/HandlePlayerLife.inc", void HandlePlayerLife(Entity* this));
|
||||
#else
|
||||
void HandlePlayerLife(Entity* this) {
|
||||
u32 temp;
|
||||
|
||||
gUnk_0200AF00.filler25[10] = 0;
|
||||
gUnk_0200AF00.filler25[8] = 0;
|
||||
gUnk_0200AF00.filler25[9] = 0;
|
||||
|
||||
if ((gPlayerEntity.bitfield & 0x80) && (gPlayerEntity.iframes > 0))
|
||||
SoundReq(SFX_86);
|
||||
|
||||
gPlayerState.flags &= ~(0x2000000 | 0x200);
|
||||
if (gPlayerState.flags & 0x400)
|
||||
ResetPlayer();
|
||||
if ((gPlayerState.flags & 0x400000) && !gPlayerState.field_0xa0[0])
|
||||
sub_0807A108();
|
||||
if (sub_08079B24() == 0)
|
||||
sub_08079708(this);
|
||||
|
||||
gUnk_03003DF0[0] = 0;
|
||||
if (gPlayerState.field_0x27[0] != 0)
|
||||
gPlayerState.field_0x27[0]--;
|
||||
|
||||
gPlayerState.field_0xa9 = gPlayerState.field_0xa8;
|
||||
gPlayerState.field_0xa8 = 0;
|
||||
if (gPlayerState.hurtType[0x4a] != 0) {
|
||||
gPlayerState.hurtType[0x4a]--;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((gPlayerState.field_0x8b != 0) || (gMessage.doTextBox & 0x7f))
|
||||
return;
|
||||
|
||||
gRoomVars.unk2 = gMessage.doTextBox & 0x7f;
|
||||
temp = gSave.stats.maxHealth / 4;
|
||||
if (temp > 24)
|
||||
temp = 24;
|
||||
if (temp < 8)
|
||||
temp = 8;
|
||||
|
||||
if (gSave.stats.health <= temp) {
|
||||
gRoomVars.unk2 = 1;
|
||||
if ((gUnk_0200AF00.filler0[1] == 0) && gScreenTransition.frameCount % 90 == 0) {
|
||||
EnqueueSFX(SFX_LOW_HEALTH);
|
||||
}
|
||||
}
|
||||
|
||||
if (gSave.stats.charm == 0) {
|
||||
gSave.stats.charmTimer = 0;
|
||||
} else if ((gSave.stats.charmTimer == 0) || --gSave.stats.charmTimer == 0) {
|
||||
gSave.stats.charm = 0;
|
||||
SoundReq(SFX_ICE_BLOCK_MELT);
|
||||
}
|
||||
|
||||
if (gSave.stats.unkB == 0) {
|
||||
gSave.stats.unkTimer = 0;
|
||||
} else if ((gSave.stats.unkTimer == 0) || (--gSave.stats.unkTimer == 0)) {
|
||||
gSave.stats.unkB = 0;
|
||||
SoundReq(SFX_140);
|
||||
} else if ((gSave.stats.unkTimer & 0xf) == 0) {
|
||||
CreateSparkle(this);
|
||||
}
|
||||
|
||||
if (gSave.stats.effect == 0) {
|
||||
gSave.stats.effectTimer = 0;
|
||||
} else if ((gSave.stats.effectTimer == 0) || --gSave.stats.effectTimer == 0) {
|
||||
gSave.stats.effect = 0;
|
||||
} else if ((gSave.stats.effectTimer & 0x3f) == 0) {
|
||||
CreateFx(this, (FX_RED_AURA - 1) + gSave.stats.effect, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void sub_080171F0(void) {
|
||||
if (gPlayerState.field_0x1a[0] != 0)
|
||||
ResetPlayer();
|
||||
if (gPlayerState.field_0x14 != 0)
|
||||
gPlayerState.field_0x14--;
|
||||
if (gPlayerEntity.field_0x7a.HWORD != 0)
|
||||
gPlayerEntity.field_0x7a.HWORD--;
|
||||
|
||||
gPlayerEntity.bitfield &= ~0x80;
|
||||
if (gPlayerEntity.action != 0x14)
|
||||
COPY_FLAG_FROM_TO(gPlayerState.flags, 0x2, 0x10000);
|
||||
|
||||
gPlayerState.flags &= ~2;
|
||||
sub_080028E0(&gPlayerEntity);
|
||||
|
||||
if (gPlayerState.flags & 0x400000)
|
||||
gUnk_0200AF00.filler25[10] = 1;
|
||||
|
||||
sub_08078180();
|
||||
gPlayerState.field_0x7 &= ~0x80;
|
||||
gPlayerState.field_0xa &= 0xf;
|
||||
gPlayerState.keepFacing &= ~0x80;
|
||||
gPlayerState.field_0x1a[0] = 0;
|
||||
gPlayerState.field_0x80 = 0;
|
||||
gPlayerState.field_0xaa = 0;
|
||||
MemClear(&gUnk_03003BE0, 0x8c);
|
||||
gPlayerEntity.spriteOffsetY = gPlayerState.field_0x3f;
|
||||
gPlayerState.field_0x3f = 0;
|
||||
sub_0807B0C8();
|
||||
|
||||
if (gPlayerState.flags & 0x400000)
|
||||
gUnk_03004040[0]->spriteOffsetY = gUnk_03004040[1]->spriteOffsetY = gUnk_03004040[2]->spriteOffsetY = 0;
|
||||
|
||||
if (gPlayerEntity.action == 0x1d)
|
||||
gPlayerState.flags |= 0x20000000;
|
||||
else
|
||||
gPlayerState.flags &= ~0x20000000;
|
||||
|
||||
sub_0807A8D8(&gPlayerEntity);
|
||||
if (gPlayerState.jumpStatus & 0xc0)
|
||||
gPlayerEntity.iframes = 0xfe;
|
||||
|
||||
if (gPlayerEntity.action != 0x17) {
|
||||
sub_08077FEC(gPlayerEntity.action);
|
||||
}
|
||||
}
|
||||
+14
-14
@@ -101,7 +101,7 @@ static void HandleNintendoCapcomLogos(void) {
|
||||
}
|
||||
LoadPaletteGroup(paletteGroup);
|
||||
gScreen.lcd.displayControl |= DISPCNT_BG2_ON;
|
||||
gScreen.bg.bg1Updated = 1;
|
||||
gScreen.bg1.updated = 1;
|
||||
DoFade(6, 8);
|
||||
advance = ADVANCE_NONE;
|
||||
#if defined(DEMO_USA)
|
||||
@@ -158,18 +158,18 @@ static void HandleTitlescreen(void) {
|
||||
// Blend first and second layer
|
||||
gScreen.controls.layerFXControl = BLDCNT_TGT1_BG2 | BLDCNT_TGT2_BG3 | BLDCNT_EFFECT_BLEND;
|
||||
gScreen.controls.alphaBlend = BLDALPHA_BLEND(9, 9);
|
||||
gScreen.bg.bg1Control = 0x1c09;
|
||||
gScreen.affine.bg2Control = BGCNT_SCREENBASE(29) | BGCNT_PRIORITY(2);
|
||||
gScreen.affine.bg3Control = BGCNT_SCREENBASE(30) | BGCNT_PRIORITY(3);
|
||||
gScreen.bg1.control = 0x1c09;
|
||||
gScreen.bg2.control = BGCNT_SCREENBASE(29) | BGCNT_PRIORITY(2);
|
||||
gScreen.bg3.control = BGCNT_SCREENBASE(30) | BGCNT_PRIORITY(3);
|
||||
gScreen.lcd.displayControl |= DISPCNT_BG1_ON | DISPCNT_BG2_ON | DISPCNT_BG3_ON | DISPCNT_OBJ_ON;
|
||||
gScreen.bg.bg1yOffset = 0xff60;
|
||||
gScreen.bg1.yOffset = 0xff60;
|
||||
} else {
|
||||
gScreen.controls.layerFXControl = BLDCNT_TGT1_BG0 | BLDCNT_TGT2_BG1 | BLDCNT_EFFECT_BLEND;
|
||||
gScreen.controls.alphaBlend = BLDALPHA_BLEND(9, 9);
|
||||
gScreen.bg.bg0Control = BGCNT_SCREENBASE(29) | BGCNT_PRIORITY(2);
|
||||
gScreen.bg.bg1Control = 0x1E03;
|
||||
gScreen.affine.bg2Control = BGCNT_PRIORITY(1) | BGCNT_CHARBASE(2) | BGCNT_256COLOR |
|
||||
BGCNT_SCREENBASE(28) | BGCNT_WRAP | BGCNT_TXT512x256;
|
||||
gScreen.bg0.control = BGCNT_SCREENBASE(29) | BGCNT_PRIORITY(2);
|
||||
gScreen.bg1.control = 0x1E03;
|
||||
gScreen.bg2.control = BGCNT_PRIORITY(1) | BGCNT_CHARBASE(2) | BGCNT_256COLOR | BGCNT_SCREENBASE(28) |
|
||||
BGCNT_WRAP | BGCNT_TXT512x256;
|
||||
gScreen.lcd.displayControl |= DISPCNT_MODE_1;
|
||||
gScreen.lcd.displayControl |= DISPCNT_BG0_ON | DISPCNT_BG1_ON | DISPCNT_OBJ_ON;
|
||||
gIntroState.swordBgScaleRatio = 0x10;
|
||||
@@ -245,7 +245,7 @@ static void HandleTitlescreen(void) {
|
||||
LoadGfxGroup(3);
|
||||
}
|
||||
UpdateLightRays();
|
||||
sub_0805E5C0();
|
||||
UpdateEntities();
|
||||
sub_080AD9B0();
|
||||
}
|
||||
|
||||
@@ -278,13 +278,13 @@ static void HandleJapaneseTitlescreenAnimationIntro(void) {
|
||||
case 0:
|
||||
if (!gFadeControl.active) {
|
||||
if ((gIntroState.counter & 1) == 0) {
|
||||
gScreen.bg.bg1yOffset++;
|
||||
gScreen.bg1.yOffset++;
|
||||
}
|
||||
|
||||
if (GetAdvanceState() == ADVANCE_KEY_PRESSED || gScreen.bg.bg1yOffset == 0) {
|
||||
if (GetAdvanceState() == ADVANCE_KEY_PRESSED || gScreen.bg1.yOffset == 0) {
|
||||
gIntroState.subState++;
|
||||
gScreen.bg.bg1yOffset = 0;
|
||||
gScreen.bg.bg1Control = 0xc09;
|
||||
gScreen.bg1.yOffset = 0;
|
||||
gScreen.bg1.control = 0xc09;
|
||||
gFadeControl.mask = 0x00000040;
|
||||
DoFade(6, 0x10);
|
||||
SoundReq(SFX_F8);
|
||||
|
||||
@@ -36,7 +36,7 @@ void sub_08077534(ItemBehavior* this, u32 arg1) {
|
||||
case 0x2e:
|
||||
this->stateID = 3;
|
||||
gPlayerEntity.animationState = 4;
|
||||
gPlayerEntity.spriteSettings.b.flipX = 0;
|
||||
gPlayerEntity.spriteSettings.flipX = 0;
|
||||
sub_08077DF4(this, 0x2df);
|
||||
break;
|
||||
case 0x2f:
|
||||
|
||||
@@ -69,7 +69,7 @@ void sub_080771C8(ItemBehavior* this, u32 arg1) {
|
||||
object->actionDelay = this->field_0x5[2];
|
||||
object->field_0xf = this->field_0x5[3];
|
||||
object->animationState = gPlayerEntity.animationState & 6;
|
||||
gPlayerEntity.frames.all = 0;
|
||||
gPlayerEntity.frame = 0;
|
||||
gPlayerEntity.frameDuration = gUnk_0811BE14[this->field_0x5[3]];
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -21,7 +21,7 @@ void OcarinaUse(ItemBehavior* this, u32 arg1) {
|
||||
} else {
|
||||
this->field_0x5[4] |= 0xf;
|
||||
gPlayerEntity.animationState = 0x04;
|
||||
gPlayerEntity.spriteSettings.b.flipX = 0;
|
||||
gPlayerEntity.spriteSettings.flipX = 0;
|
||||
gPlayerEntity.flags &= 0x7f;
|
||||
gPlayerEntity.field_0x7a.HWORD = 2;
|
||||
gPlayerState.flags |= 0x10000000;
|
||||
|
||||
@@ -17,12 +17,12 @@ extern bool32 sub_08077EFC(ItemBehavior*);
|
||||
if (((u8)(gPlayerState.field_0x1a[1] | gPlayerState.field_0xa | gPlayerState.field_0x3[1] |
|
||||
gPlayerState.heldObject | gPlayerState.field_0x1c | gPlayerState.field_0x3c[1]) == 0) &&
|
||||
((((1 < (u8)(gPlayerState.field_0x10[2] - 0x12) && (gPlayerState.field_0x10[2] != 1)) ||
|
||||
(gPlayerEntity.height.WORD != 0)) ||
|
||||
(gPlayerEntity.z.WORD != 0)) ||
|
||||
(gPlayerState.field_0x14 != 0)))) {
|
||||
if ((gPlayerState.jumpStatus != 0) && ((gPlayerState.jumpStatus & 7) != 3))
|
||||
goto _08076710;
|
||||
if (-1 < gPlayerEntity.height.WORD) {
|
||||
gPlayerEntity.hVelocity = 0x20000;
|
||||
if (-1 < gPlayerEntity.z.WORD) {
|
||||
gPlayerEntity.zVelocity = 0x20000;
|
||||
gPlayerState.jumpStatus = 1;
|
||||
gPlayerState.field_0x2c = NULL;
|
||||
this->stateID += 1;
|
||||
@@ -32,20 +32,20 @@ extern bool32 sub_08077EFC(ItemBehavior*);
|
||||
} else {
|
||||
if (((gPlayerState.heldObject | gPlayerState.field_0x3[1]) == 0) &&
|
||||
(((gPlayerState.field_0x10[2] != 0x12 && (gPlayerState.field_0x10[2] != 1)) ||
|
||||
((gPlayerEntity.height.WORD != 0 || (gPlayerState.field_0x14 != 0)))))) {
|
||||
((gPlayerEntity.z.WORD != 0 || (gPlayerState.field_0x14 != 0)))))) {
|
||||
if ((gPlayerState.jumpStatus != 0) && ((gPlayerState.jumpStatus & 7) != 3)) {
|
||||
_08076710:
|
||||
sub_08076758(this, arg1);
|
||||
return;
|
||||
}
|
||||
if (-1 < gPlayerEntity.height.WORD) {
|
||||
if (-1 < gPlayerEntity.z.WORD) {
|
||||
gPlayerState.field_0x0[1] = 0;
|
||||
this->stateID += 1;
|
||||
gPlayerState.keepFacing = 0;
|
||||
gPlayerState.jumpStatus = 1;
|
||||
gPlayerState.field_0xe = -1;
|
||||
gPlayerState.field_0x2c = NULL;
|
||||
gPlayerEntity.hVelocity = 0x20000;
|
||||
gPlayerEntity.zVelocity = 0x20000;
|
||||
_0807673C:
|
||||
sub_08077F84();
|
||||
SoundReq(SFX_PLY_VO4);
|
||||
@@ -67,10 +67,10 @@ void sub_08076758(ItemBehavior* this, u32 arg1) {
|
||||
((gPlayerState.jumpStatus & 7) != 3)) {
|
||||
if (sub_08077EFC(this)) {
|
||||
if (this->stateID < 2) {
|
||||
if ((gPlayerEntity.hVelocity < 1) && ((gPlayerState.jumpStatus & 0x10) == 0)) {
|
||||
if ((gPlayerEntity.zVelocity < 1) && ((gPlayerState.jumpStatus & 0x10) == 0)) {
|
||||
this->stateID = 2;
|
||||
gPlayerEntity.field_0x7a.HWORD = 2;
|
||||
gPlayerEntity.hVelocity = 0x20000;
|
||||
gPlayerEntity.zVelocity = 0x20000;
|
||||
gPlayerState.jumpStatus |= 0x10;
|
||||
gPlayerState.field_0x8 = 0x288;
|
||||
SoundReq(SFX_172);
|
||||
|
||||
@@ -83,7 +83,7 @@ void sub_08075694(ItemBehavior* this, u32 arg1) {
|
||||
gPlayerState.field_0xa = (8 >> arg1) | gPlayerState.field_0xa;
|
||||
this->stateID = 4;
|
||||
this->field_0xf = 6;
|
||||
gPlayerEntity.field_0x40 = 0x1e;
|
||||
gPlayerEntity.hurtType = 0x1e;
|
||||
gPlayerState.field_0x1a[1] |= 0x40;
|
||||
gPlayerState.field_0x1a[1] &= 0xdf;
|
||||
if ((gPlayerState.field_0xa0[0] == 0x04) && ((gPlayerState.flags & 0x400000) == 0)) {
|
||||
@@ -122,7 +122,7 @@ ASM_FUNC("asm/non_matching/itemSword/sub_08075900.inc", void sub_08075900(ItemBe
|
||||
|
||||
void sub_080759B8(ItemBehavior* this, u32 arg1) {
|
||||
if ((gPlayerState.flags & 0x80) == 0) {
|
||||
gPlayerEntity.field_0x40 = 0;
|
||||
gPlayerEntity.hurtType = 0;
|
||||
}
|
||||
gPlayerState.flags &= 0xf7ffffff;
|
||||
gPlayerState.field_0x1a[1] = 0;
|
||||
|
||||
+139
-24
@@ -1,7 +1,9 @@
|
||||
#include "global.h"
|
||||
#include "area.h"
|
||||
#include "room.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "utils.h"
|
||||
|
||||
extern void sub_0804B058(EntityData* dat);
|
||||
extern void sub_0801AC98();
|
||||
@@ -9,11 +11,132 @@ extern u32 sub_08049D1C(u32);
|
||||
extern Entity* LoadRoomEntity(EntityData*);
|
||||
extern void* GetRoomProperty(u32, u32, u32);
|
||||
|
||||
extern u32 gUnk_02017654;
|
||||
extern u32* gAreaTable;
|
||||
extern void** gCurrentRoomProperties;
|
||||
extern void*** gAreaTable[];
|
||||
extern u8 gUnk_081091E4[];
|
||||
|
||||
extern void sub_080186EC();
|
||||
extern void sub_0804B16C();
|
||||
extern void sub_080A7C7C(void);
|
||||
extern Entity* GetEmptyEntityByKind(u32 kind);
|
||||
|
||||
void RegisterRoomEntity(Entity*, EntityData*);
|
||||
void sub_0804AF0C(Entity*, EntityData*);
|
||||
void sub_0804AFB0(void** properties);
|
||||
|
||||
void LoadRoomEntityList(EntityData* listPtr) {
|
||||
if (listPtr != NULL) {
|
||||
while (listPtr->kind != 0xFF) {
|
||||
LoadRoomEntity(listPtr++);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NONMATCH("asm/loadRoomEntity.s", Entity* LoadRoomEntity(EntityData* dat)) {
|
||||
int kind;
|
||||
Entity* v4;
|
||||
Entity* v5;
|
||||
|
||||
kind = dat->kind & 0xF;
|
||||
if ((dat->flags & 0xF0) == 0x50 && DeepFindEntityByID(kind, dat->id))
|
||||
return NULL;
|
||||
v4 = GetEmptyEntityByKind(kind);
|
||||
v5 = v4;
|
||||
if (v4 != NULL) {
|
||||
v4->kind = kind;
|
||||
v4->id = dat->id;
|
||||
v4->type = dat->type;
|
||||
RegisterRoomEntity(v4, dat);
|
||||
if ((dat->flags & 0xF0) != 16) {
|
||||
v5->type2 = dat->type2;
|
||||
v5->actionDelay = (dat->type2 & 0xFF00) >> 8;
|
||||
if (kind == 9)
|
||||
return v5;
|
||||
sub_0804AF0C(v5, dat);
|
||||
if (!v5->next)
|
||||
return v5;
|
||||
if ((dat->kind & 0x10) == 0) {
|
||||
if ((dat->kind & 0x20) != 0) {
|
||||
v5->collisionLayer = 2;
|
||||
return v5;
|
||||
}
|
||||
if ((gRoomControls.unk6 & 2) == 0) {
|
||||
sub_08016A30(v5);
|
||||
}
|
||||
}
|
||||
v5->collisionLayer = 1;
|
||||
}
|
||||
}
|
||||
return v5;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void RegisterRoomEntity(Entity* ent, EntityData* dat) {
|
||||
u32 list;
|
||||
u32 kind;
|
||||
void* offset;
|
||||
|
||||
list = dat->flags & 0xF;
|
||||
kind = dat->kind & 0xF;
|
||||
if (ent->prev == NULL) {
|
||||
if (list == 0xF) {
|
||||
AppendEntityToList(ent, gUnk_081091E4[kind]);
|
||||
} else if (list == 8) {
|
||||
AppendEntityToList(ent, 8);
|
||||
} else {
|
||||
AppendEntityToList(ent, list);
|
||||
}
|
||||
}
|
||||
offset = &ent->field_0x78;
|
||||
if (kind == MANAGER)
|
||||
offset = &ent->y;
|
||||
MemCopy(dat, offset, sizeof(EntityData));
|
||||
}
|
||||
|
||||
void sub_0804AF0C(Entity* ent, EntityData* dat) {
|
||||
switch (dat->flags & 0xf0) {
|
||||
case 0x0:
|
||||
ent->x.HALF.HI = dat->xPos + gRoomControls.roomOriginX;
|
||||
ent->y.HALF.HI = dat->yPos + gRoomControls.roomOriginY;
|
||||
break;
|
||||
case 0x20:
|
||||
ent->field_0x6c.HALF.HI |= 0x20;
|
||||
ent->x.HALF.HI = dat->xPos + gRoomControls.roomOriginX;
|
||||
ent->y.HALF.HI = dat->yPos + gRoomControls.roomOriginY;
|
||||
break;
|
||||
case 0x40:
|
||||
ent->x.HALF.HI = dat->xPos + gRoomControls.roomOriginX;
|
||||
ent->y.HALF.HI = dat->yPos + gRoomControls.roomOriginY;
|
||||
if (!StartCutscene(ent, (u16*)dat->spritePtr))
|
||||
DeleteEntity(ent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0804AF90(void) {
|
||||
sub_0804AFB0(gArea.field_0x85c[7]);
|
||||
sub_080A7C7C();
|
||||
}
|
||||
|
||||
void sub_0804AFB0(void** properties) {
|
||||
u32 i;
|
||||
|
||||
gCurrentRoomProperties = properties;
|
||||
for (i = 0; i < 8; ++i) {
|
||||
gRoomVars.field_0x6c[i] = gCurrentRoomProperties[i];
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_0804AFDC() {
|
||||
u32 result;
|
||||
u32 (*func)();
|
||||
|
||||
result = 1;
|
||||
func = (u32(*)())GetCurrentRoomProperty(6);
|
||||
if (func != NULL)
|
||||
result = func();
|
||||
return result;
|
||||
}
|
||||
|
||||
void sub_0804AFF4(void) {
|
||||
void (*func)();
|
||||
@@ -31,9 +154,6 @@ void sub_0804AFF4(void) {
|
||||
}
|
||||
|
||||
void LoadRoom(void) {
|
||||
s32 iVar1;
|
||||
s32* dat;
|
||||
|
||||
LoadRoomEntityList(GetCurrentRoomProperty(1));
|
||||
LoadRoomEntityList(GetCurrentRoomProperty(0));
|
||||
|
||||
@@ -48,10 +168,10 @@ void sub_0804B058(EntityData* dat) {
|
||||
Entity* ent;
|
||||
u32 uVar2;
|
||||
|
||||
if ((dat != NULL) && *(u8*)dat != 0xff) {
|
||||
if ((dat != NULL) && dat->kind != 0xff) {
|
||||
uVar2 = 0;
|
||||
do {
|
||||
if ((uVar2 < 0x20) && ((dat->kind) == 3)) {
|
||||
if ((uVar2 < 0x20) && ((dat->kind & 0xF) == 3)) {
|
||||
if (sub_08049D1C(uVar2) != 0) {
|
||||
ent = LoadRoomEntity(dat);
|
||||
if ((ent != NULL) && (ent->kind == 3)) {
|
||||
@@ -63,7 +183,7 @@ void sub_0804B058(EntityData* dat) {
|
||||
}
|
||||
uVar2++;
|
||||
dat++;
|
||||
} while (*(u8*)dat != 0xff);
|
||||
} while (dat->kind != 0xff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,11 +192,9 @@ void sub_0804B0B0(u32 arg0, u32 arg1) {
|
||||
}
|
||||
|
||||
void SetCurrentRoomPropertyList(u32 area, u32 room) {
|
||||
u32** arr;
|
||||
gUnk_02017654 = 0;
|
||||
arr = &gAreaTable;
|
||||
if (arr[area] != 0) {
|
||||
gUnk_02017654 = arr[area][room];
|
||||
gCurrentRoomProperties = NULL;
|
||||
if (gAreaTable[area] != NULL) {
|
||||
gCurrentRoomProperties = gAreaTable[area][room];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,17 +209,14 @@ void sub_0804B0E8(u32 arg0, u32 arg1) {
|
||||
}
|
||||
}
|
||||
|
||||
// returns multiple types of data?
|
||||
void* GetRoomProperty(u32 area, u32 room, u32 arg2) {
|
||||
u32 temp;
|
||||
u32** arr;
|
||||
temp = 0;
|
||||
arr = &gAreaTable;
|
||||
if (arr[area] != NULL) {
|
||||
temp = arr[area][room];
|
||||
if (temp != 0) {
|
||||
temp = *(u32*)(arg2 * 4 + temp);
|
||||
void* GetRoomProperty(u32 area, u32 room, u32 property) {
|
||||
void** temp;
|
||||
temp = NULL;
|
||||
if (gAreaTable[area] != NULL) {
|
||||
temp = gAreaTable[area][room];
|
||||
if (temp != NULL) {
|
||||
temp = temp[property];
|
||||
}
|
||||
}
|
||||
return (void*)temp;
|
||||
return temp;
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "room.h"
|
||||
|
||||
void extern LoadRoomEntity(EntityData*);
|
||||
|
||||
void LoadRoomEntityList(EntityData* listPtr) {
|
||||
if (listPtr != NULL) {
|
||||
while (*(u8*)listPtr != 0xFF) {
|
||||
LoadRoomEntity(listPtr++);
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -118,7 +118,7 @@ static void sub_08055F70(void) {
|
||||
}
|
||||
|
||||
DispReset(0);
|
||||
sub_08016B34();
|
||||
EnableVBlankIntr();
|
||||
}
|
||||
|
||||
#define SOFT_RESET_KEYS (A_BUTTON | B_BUTTON | SELECT_BUTTON | START_BUTTON)
|
||||
|
||||
@@ -12,3 +12,8 @@ void (*const gManagerFunctions[])() = {
|
||||
Manager31_Main, Manager32_Main, Manager33_Main, Manager34_Main, Manager35_Main, Manager36_Main, Manager37_Main,
|
||||
Manager38_Main, Manager39_Main
|
||||
};
|
||||
|
||||
void ManagerUpdate(Entity* this) {
|
||||
if (!CheckDontUpdate(this))
|
||||
gManagerFunctions[this->id](this);
|
||||
}
|
||||
|
||||
+12
-12
@@ -17,10 +17,10 @@ void Manager1_Main(Entity* this) {
|
||||
u8* pbVar2;
|
||||
|
||||
gUnk_08107C5C[this->action](this);
|
||||
gUnk_08107C48[((u8*)&this->hVelocity)[1]](this);
|
||||
bVar1 = gUnk_08107C40[((u8*)&this->hVelocity)[1]];
|
||||
if ((bVar1 != 0) && (*(u8*)&this->hVelocity != bVar1)) {
|
||||
((u8*)&this->hVelocity)[0] = bVar1;
|
||||
gUnk_08107C48[((u8*)&this->zVelocity)[1]](this);
|
||||
bVar1 = gUnk_08107C40[((u8*)&this->zVelocity)[1]];
|
||||
if ((bVar1 != 0) && (*(u8*)&this->zVelocity != bVar1)) {
|
||||
((u8*)&this->zVelocity)[0] = bVar1;
|
||||
LoadGfxGroup(bVar1);
|
||||
}
|
||||
}
|
||||
@@ -28,11 +28,11 @@ void Manager1_Main(Entity* this) {
|
||||
void sub_080570B8(Entity* this) {
|
||||
u8* pbVar1;
|
||||
|
||||
LoadGfxGroup(((u8*)&this->hVelocity)[0]);
|
||||
this->height.WORD = 0;
|
||||
pbVar1 = ((u8*)&this->hVelocity + 1);
|
||||
LoadGfxGroup(((u8*)&this->zVelocity)[0]);
|
||||
this->z.WORD = 0;
|
||||
pbVar1 = ((u8*)&this->zVelocity + 1);
|
||||
if (*pbVar1 == 3) {
|
||||
gScreen.affine.bg3Updated = 1;
|
||||
gScreen.bg3.updated = 1;
|
||||
} else {
|
||||
gUnk_08107C48[*pbVar1](this);
|
||||
}
|
||||
@@ -46,11 +46,11 @@ void sub_080570F8(void) {
|
||||
|
||||
void sub_08057118(Entity* this) {
|
||||
this->actionDelay = 0;
|
||||
*(u8*)&this->hVelocity = 0;
|
||||
((u8*)&this->hVelocity)[1] = 0;
|
||||
((u8*)&this->hVelocity)[2] = 0;
|
||||
*(u8*)&this->zVelocity = 0;
|
||||
((u8*)&this->zVelocity)[1] = 0;
|
||||
((u8*)&this->zVelocity)[2] = 0;
|
||||
this->action = 1;
|
||||
gScreen.affine.bg3Control = 0x1e04;
|
||||
gScreen.bg3.control = 0x1e04;
|
||||
gScreen.lcd.displayControl |= 0x800;
|
||||
gScreen.controls.layerFXControl = 0x3648;
|
||||
gScreen.controls.alphaBlend = 0x1000;
|
||||
|
||||
@@ -97,8 +97,8 @@ void sub_08059690(Manager10* this) {
|
||||
|
||||
void sub_080596E0(Manager10* this) {
|
||||
if ((gScreenTransition.frameCount & 7) == 0) {
|
||||
gScreen.bg.bg1xOffset += 8;
|
||||
gScreen.bg.bg1xOffset &= 0x1F;
|
||||
gScreen.bg1.xOffset += 8;
|
||||
gScreen.bg1.xOffset &= 0x1F;
|
||||
}
|
||||
if (sub_0805986C()) {
|
||||
if (this->unk_21 == 0 && this->unk_22 != 2) {
|
||||
@@ -142,7 +142,7 @@ void sub_080596E0(Manager10* this) {
|
||||
LoadResourceAsync(gBG3Buffer, 0x600e800, 0x800);
|
||||
break;
|
||||
case 5:
|
||||
gUnk_0200B650 = &gScreen.bg.bg1Control;
|
||||
gUnk_0200B650 = &gScreen.bg1.control;
|
||||
gScreen.lcd.displayControl |= 0x200;
|
||||
break;
|
||||
}
|
||||
|
||||
+15
-15
@@ -295,7 +295,7 @@ void sub_0805A758(Manager15* this) {
|
||||
}
|
||||
|
||||
void sub_0805A76C(Manager15* this) {
|
||||
if ((gPlayerEntity.currentHealth != 0) && (gPlayerEntity.height.HALF.HI == 0) && (!gPlayerState.field_0x2c)) {
|
||||
if ((gPlayerEntity.health != 0) && (gPlayerEntity.z.HALF.HI == 0) && (!gPlayerState.field_0x2c)) {
|
||||
switch (gPlayerState.field_0xa9) {
|
||||
case 1:
|
||||
case 0:
|
||||
@@ -397,9 +397,9 @@ void sub_0805A8EC(Manager15* this) {
|
||||
|
||||
void sub_0805A94C(Manager15* this) {
|
||||
int tmp1, tmp2;
|
||||
gScreen.affine.bg3xOffset = gRoomControls.roomScrollX - this->unk_24 + this->unk_34;
|
||||
gScreen.affine.bg3yOffset = gRoomControls.roomScrollY - this->unk_26 + this->unk_36;
|
||||
tmp1 = -gScreen.affine.bg3xOffset;
|
||||
gScreen.bg3.xOffset = gRoomControls.roomScrollX - this->unk_24 + this->unk_34;
|
||||
gScreen.bg3.yOffset = gRoomControls.roomScrollY - this->unk_26 + this->unk_36;
|
||||
tmp1 = -gScreen.bg3.xOffset;
|
||||
tmp2 = tmp1 + 0x100;
|
||||
if (tmp1 < 0)
|
||||
tmp1 = 0;
|
||||
@@ -410,7 +410,7 @@ void sub_0805A94C(Manager15* this) {
|
||||
if (tmp2 > 0xF0)
|
||||
tmp2 = 0xF0;
|
||||
gScreen.controls.window1HorizontalDimensions = (tmp1 << 8 | tmp2);
|
||||
tmp1 = -gScreen.affine.bg3yOffset;
|
||||
tmp1 = -gScreen.bg3.yOffset;
|
||||
tmp2 = tmp1 + 0x100;
|
||||
if (tmp1 < 0)
|
||||
tmp1 = 0;
|
||||
@@ -426,8 +426,8 @@ void sub_0805A94C(Manager15* this) {
|
||||
void sub_0805A9CC(Manager15* this) {
|
||||
int tmp1, tmp2;
|
||||
void* tmp3;
|
||||
gScreen.affine.bg3xOffset = gRoomControls.roomScrollX - this->unk_24 + this->unk_34;
|
||||
tmp1 = -gScreen.affine.bg3xOffset;
|
||||
gScreen.bg3.xOffset = gRoomControls.roomScrollX - this->unk_24 + this->unk_34;
|
||||
tmp1 = -gScreen.bg3.xOffset;
|
||||
tmp2 = tmp1 + 0x100;
|
||||
if (tmp1 < 0)
|
||||
tmp1 = 0;
|
||||
@@ -439,14 +439,14 @@ void sub_0805A9CC(Manager15* this) {
|
||||
tmp2 = 0xF0;
|
||||
gScreen.controls.window1HorizontalDimensions = tmp1 << 8 | tmp2;
|
||||
tmp1 = gRoomControls.roomScrollY - this->unk_26 + this->unk_36;
|
||||
gScreen.affine.bg3yOffset = tmp1 & 0x3F;
|
||||
gScreen.bg3.yOffset = tmp1 & 0x3F;
|
||||
tmp3 = (&gBG3Buffer[((tmp1 / 0x40) << 8)]);
|
||||
gScreen.affine.bg3Tilemap = (u32*)tmp3;
|
||||
gScreen.bg3.tilemap = (u32*)tmp3;
|
||||
gScreen.controls.window1VerticalDimensions = 0xa0;
|
||||
if (this->unk_28 == tmp3)
|
||||
return;
|
||||
this->unk_28 = tmp3;
|
||||
gScreen.affine.bg3Updated = 1;
|
||||
gScreen.bg3.updated = 1;
|
||||
}
|
||||
|
||||
extern struct { u8 unk_00[0x20]; } gUnk_085A97A0[];
|
||||
@@ -483,11 +483,11 @@ void sub_0805AAF0(u32 unk0) {
|
||||
sub_0805AADC(unk0);
|
||||
gScreen.controls.layerFXControl = 0x3E48;
|
||||
gScreen.controls.alphaBlend = 0x1008;
|
||||
gScreen.affine.bg3Control = 0x1E04;
|
||||
gScreen.affine.bg3Tilemap = &gBG3Buffer;
|
||||
gScreen.affine.bg3xOffset = 0;
|
||||
gScreen.affine.bg3yOffset = 0;
|
||||
gScreen.affine.bg3Updated = 1;
|
||||
gScreen.bg3.control = 0x1E04;
|
||||
gScreen.bg3.tilemap = &gBG3Buffer;
|
||||
gScreen.bg3.xOffset = 0;
|
||||
gScreen.bg3.yOffset = 0;
|
||||
gScreen.bg3.updated = 1;
|
||||
gScreen.controls.windowInsideControl = 0x3F3F;
|
||||
gScreen.controls.windowOutsideControl = 0x37;
|
||||
gScreen.controls.window1HorizontalDimensions = 0xF0;
|
||||
|
||||
@@ -40,19 +40,19 @@ void Manager18_Main(Manager18* this) {
|
||||
}
|
||||
gRoomControls.bg3OffsetX.WORD -= 0x2000;
|
||||
gRoomControls.bg3OffsetY.WORD -= 0x1000;
|
||||
gScreen.affine.bg3xOffset = gRoomControls.roomScrollX + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.affine.bg3yOffset = gRoomControls.roomScrollY + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
gScreen.bg3.xOffset = gRoomControls.roomScrollX + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.bg3.yOffset = gRoomControls.roomScrollY + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805AEDC(Manager18* this) {
|
||||
gScreen.affine.bg3Control = 0x1e05;
|
||||
gScreen.bg3.control = 0x1e05;
|
||||
gScreen.lcd.displayControl |= 0x800;
|
||||
gScreen.controls.layerFXControl = 0x3648;
|
||||
gScreen.controls.alphaBlend = (this != NULL) ? this->field_0x20 : 0x1000;
|
||||
gScreen.affine.bg3xOffset = gRoomControls.roomScrollX + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.affine.bg3yOffset = gRoomControls.roomScrollY + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
gScreen.bg3.xOffset = gRoomControls.roomScrollX + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.bg3.yOffset = gRoomControls.roomScrollY + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
if (this != NULL) {
|
||||
Manager18_Main(this);
|
||||
}
|
||||
|
||||
@@ -23,15 +23,15 @@ void Manager19_Main(Manager* this) {
|
||||
}
|
||||
} else {
|
||||
gRoomControls.bg3OffsetX.WORD = gRoomControls.bg3OffsetX.WORD - 0x2000;
|
||||
gScreen.affine.bg3xOffset = gRoomControls.roomScrollX + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.affine.bg3yOffset = gRoomControls.roomScrollY + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
gScreen.bg3.xOffset = gRoomControls.roomScrollX + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.bg3.yOffset = gRoomControls.roomScrollY + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805AFFC(Manager* this) {
|
||||
gScreen.affine.bg3Control = 0x1e03;
|
||||
gScreen.bg3.control = 0x1e03;
|
||||
gScreen.lcd.displayControl |= 0x800;
|
||||
gScreen.affine.bg3xOffset = gRoomControls.roomScrollX + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.affine.bg3yOffset = gRoomControls.roomScrollY + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
gScreen.bg3.xOffset = gRoomControls.roomScrollX + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.bg3.yOffset = gRoomControls.roomScrollY + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
}
|
||||
|
||||
@@ -199,9 +199,9 @@ void sub_0805B2B0(Manager1A* this) {
|
||||
}
|
||||
gScreen.lcd.displayControl |= 0x800;
|
||||
gRoomControls.bg3OffsetX.HALF.HI = gRoomControls.roomScrollX + this->unk_34 + tmp;
|
||||
gScreen.affine.bg3xOffset = gRoomControls.roomScrollX + this->unk_34 + tmp;
|
||||
gScreen.bg3.xOffset = gRoomControls.roomScrollX + this->unk_34 + tmp;
|
||||
gRoomControls.bg3OffsetY.HALF.HI = gRoomControls.roomScrollY + this->unk_36 + tmp2;
|
||||
gScreen.affine.bg3yOffset = gRoomControls.roomScrollY + this->unk_36 + tmp2;
|
||||
gScreen.bg3.yOffset = gRoomControls.roomScrollY + this->unk_36 + tmp2;
|
||||
}
|
||||
|
||||
void sub_0805B328(Manager1A* this) {
|
||||
@@ -210,10 +210,10 @@ void sub_0805B328(Manager1A* this) {
|
||||
return;
|
||||
tmp = &gUnk_08108764[this->manager.unk_0a];
|
||||
LoadResourceAsync(&gGlobalGfxAndPalettes[tmp->unk_0c->unk_00], 0x0600F000, 0x800);
|
||||
gScreen.affine.bg3Control = 0x1E07;
|
||||
gScreen.bg3.control = 0x1E07;
|
||||
gScreen.lcd.displayControl |= 0x800;
|
||||
gScreen.affine.bg3xOffset = gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.affine.bg3yOffset = gRoomControls.bg3OffsetY.HALF.HI;
|
||||
gScreen.bg3.xOffset = gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.bg3.yOffset = gRoomControls.bg3OffsetY.HALF.HI;
|
||||
gScreen.controls.layerFXControl &= ~0x8;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,14 +46,14 @@ void Manager1B_Main(Manager1B* this) {
|
||||
}
|
||||
|
||||
void sub_0805B448(Manager1B* this) {
|
||||
gScreen.affine.bg3xOffset = (gRoomControls.roomScrollX - gRoomControls.roomOriginX) >> 2;
|
||||
gScreen.affine.bg3yOffset = ((gRoomControls.roomScrollY - gRoomControls.roomOriginY) >> 1) + this->field_0x20;
|
||||
gScreen.bg3.xOffset = (gRoomControls.roomScrollX - gRoomControls.roomOriginX) >> 2;
|
||||
gScreen.bg3.yOffset = ((gRoomControls.roomScrollY - gRoomControls.roomOriginY) >> 1) + this->field_0x20;
|
||||
}
|
||||
|
||||
void sub_0805B474(Manager1B* this) {
|
||||
s32 tmp = ((gRoomControls.roomScrollY - gRoomControls.roomOriginY) * 0x60) / (gRoomControls.height - 0xa0);
|
||||
gScreen.affine.bg3yOffset = gRoomControls.roomOriginY + tmp;
|
||||
gScreen.affine.bg3xOffset = gRoomControls.roomScrollX - ((gRoomControls.width - 0x100) / 2);
|
||||
gScreen.bg3.yOffset = gRoomControls.roomOriginY + tmp;
|
||||
gScreen.bg3.xOffset = gRoomControls.roomScrollX - ((gRoomControls.width - 0x100) / 2);
|
||||
}
|
||||
|
||||
void sub_0805B4B4(Manager1B* this) {
|
||||
@@ -69,14 +69,14 @@ void sub_0805B4D0(u32 param_1) {
|
||||
u32 uVar2;
|
||||
|
||||
LoadGfxGroup(gUnk_08108C5C[param_1]);
|
||||
gScreen.affine.bg3Control = 0x1e07;
|
||||
gScreen.bg3.control = 0x1e07;
|
||||
gScreen.lcd.displayControl |= 0x800;
|
||||
gScreen.affine.bg3xOffset = (gRoomControls.roomScrollX - gRoomControls.roomOriginX) >> 2;
|
||||
gScreen.bg3.xOffset = (gRoomControls.roomScrollX - gRoomControls.roomOriginX) >> 2;
|
||||
|
||||
uVar2 = (gRoomControls.roomScrollY - gRoomControls.roomOriginY) >> 1;
|
||||
iVar1 = 0x100 - gRoomControls.height;
|
||||
if (iVar1 < 0) {
|
||||
iVar1 = 0;
|
||||
}
|
||||
gScreen.affine.bg3yOffset = uVar2 + iVar1 + gUnk_08108C44[param_1];
|
||||
gScreen.bg3.yOffset = uVar2 + iVar1 + gUnk_08108C44[param_1];
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void sub_0805B55C(Manager* manager) {
|
||||
if (waterDrop != NULL) {
|
||||
waterDrop->x.HALF.HI = gRoomControls.roomScrollX + 0x78 + gUnk_08108C6C[Random() & 7];
|
||||
waterDrop->y.HALF.HI = gRoomControls.roomScrollY + 0x50 + gUnk_08108C7C[Random() & 3];
|
||||
waterDrop->height.HALF.HI = 0xff38;
|
||||
waterDrop->z.HALF.HI = 0xff38;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,19 +14,19 @@ void sub_0805B5E0(Manager* this) {
|
||||
this->action = 1;
|
||||
|
||||
gScreen.lcd.displayControl |= 0x800;
|
||||
gScreen.affine.bg3Control = gUnk_08108C88[this->unk_0a];
|
||||
gScreen.bg3.control = gUnk_08108C88[this->unk_0a];
|
||||
gRoomControls.bg3OffsetY.WORD = 0;
|
||||
gRoomControls.bg3OffsetX.WORD = 0;
|
||||
|
||||
switch (this->unk_0a) {
|
||||
case 0:
|
||||
default:
|
||||
gScreen.affine.bg3yOffset = 0;
|
||||
gScreen.affine.bg3xOffset = 0;
|
||||
gScreen.bg3.yOffset = 0;
|
||||
gScreen.bg3.xOffset = 0;
|
||||
break;
|
||||
case 1:
|
||||
gScreen.affine.bg3xOffset = gRoomControls.roomScrollX + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.affine.bg3yOffset = gRoomControls.roomScrollY + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
gScreen.bg3.xOffset = gRoomControls.roomScrollX + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.bg3.yOffset = gRoomControls.roomScrollY + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ void sub_0805B5E0(Manager* this) {
|
||||
void sub_0805B638(Manager* this) {
|
||||
if (this->unk_0a == 1) {
|
||||
gRoomControls.bg3OffsetX.WORD = gRoomControls.bg3OffsetX.WORD + 0x2000;
|
||||
gScreen.affine.bg3xOffset = gRoomControls.roomScrollX + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.affine.bg3yOffset = gRoomControls.roomScrollY + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
gScreen.bg3.xOffset = gRoomControls.roomScrollX + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.bg3.yOffset = gRoomControls.roomScrollY + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user