Various documentations

This commit is contained in:
Tal Hayon
2022-08-08 20:03:12 +03:00
parent 22cbdd2fd6
commit 79bae9cd8a
83 changed files with 297 additions and 275 deletions
+1 -1
View File
@@ -613,7 +613,7 @@ void sub_08026414(ChuchuBossEntity* this) {
Entity* child;
if (this->unk_7c-- == 0) {
super->z.HALF.HI = 0xff40;
super->z.HALF.HI = -192;
child = super->child;
parent = super->parent;
this->unk_68->base.spriteSettings.draw = 1;
+50 -33
View File
@@ -29,13 +29,6 @@ typedef struct {
extern void sub_08047EA4(Entity*, u32); // gyorgMale
extern void (*const Enemy64_Actions[])(Enemy64Entity*);
extern void (*const Enemy64_Action1_SubActions[])(Enemy64Entity*);
extern void (*const Enemy64_Action2_SubActions[])(Enemy64Entity*);
extern void (*const Enemy64_Action3_SubActions[])(Enemy64Entity*);
extern const u8 gUnk_080D29B8[];
extern void (*const Enemy64_Action4_SubActions[])(Enemy64Entity*);
void sub_080499F0(Enemy64Entity*);
void sub_08049998(Enemy64Entity*, u32);
void Enemy64_Action2_SubAction1(Enemy64Entity*);
@@ -43,8 +36,36 @@ void sub_08049944(Enemy64Entity*);
bool32 sub_08049A8C(Enemy64Entity*);
void sub_08049AB0(Enemy64Entity*);
void sub_08049B20(Enemy64Entity*);
void Enemy64_Init(Enemy64Entity* this);
void Enemy64_Action1(Enemy64Entity* this);
void Enemy64_Action2(Enemy64Entity* this);
void Enemy64_Action3(Enemy64Entity* this);
void Enemy64_Action4(Enemy64Entity* this);
void Enemy64_Action1_SubAction0(Enemy64Entity* this);
void Enemy64_Action1_SubAction1(Enemy64Entity* this);
void Enemy64_Action2_SubAction0(Enemy64Entity* this);
void Enemy64_Action2_SubAction1(Enemy64Entity* this);
void Enemy64_Action2_SubAction2(Enemy64Entity* this);
void Enemy64_Action2_SubAction3(Enemy64Entity* this);
void Enemy64_Action2_SubAction4(Enemy64Entity* this);
void Enemy64_Action2_SubAction5(Enemy64Entity* this);
void Enemy64_Action3_SubAction0(Enemy64Entity* this);
void Enemy64_Action3_SubAction1(Enemy64Entity* this);
void Enemy64_Action3_SubAction2(Enemy64Entity* this);
void Enemy64_Action3_SubAction3(Enemy64Entity* this);
void Enemy64_Action4_SubAction0(Enemy64Entity* this);
void Enemy64_Action4_SubAction1(Enemy64Entity* this);
void Enemy64_Action4_SubAction2(Enemy64Entity* this);
void Enemy64_Action4_SubAction3(Enemy64Entity* this);
void Enemy64_Action4_SubAction4(Enemy64Entity* this);
void Enemy64_Action4_SubAction5(Enemy64Entity* this);
void Enemy64_Action4_SubAction6(Enemy64Entity* this);
void Enemy64_Action4_SubAction7(Enemy64Entity* this);
void Enemy64(Enemy64Entity* this) {
static void (*const Enemy64_Actions[])(Enemy64Entity*) = {
Enemy64_Init, Enemy64_Action1, Enemy64_Action2, Enemy64_Action3, Enemy64_Action4,
};
if (super->action != 0) {
super->spriteSettings.draw = this->unk_7d;
}
@@ -102,6 +123,10 @@ void Enemy64_Init(Enemy64Entity* this) {
}
void Enemy64_Action1(Enemy64Entity* this) {
static void (*const Enemy64_Action1_SubActions[])(Enemy64Entity*) = {
Enemy64_Action1_SubAction0,
Enemy64_Action1_SubAction1,
};
Enemy64_Action1_SubActions[super->subAction](this);
UpdateAnimationSingleFrame(super);
}
@@ -133,6 +158,10 @@ void Enemy64_Action1_SubAction1(Enemy64Entity* this) {
}
void Enemy64_Action2(Enemy64Entity* this) {
static void (*const Enemy64_Action2_SubActions[])(Enemy64Entity*) = {
Enemy64_Action2_SubAction0, Enemy64_Action2_SubAction1, Enemy64_Action2_SubAction2,
Enemy64_Action2_SubAction3, Enemy64_Action2_SubAction4, Enemy64_Action2_SubAction5,
};
Enemy64_Action2_SubActions[super->subAction](this);
UpdateAnimationSingleFrame(super);
}
@@ -253,6 +282,12 @@ void Enemy64_Action2_SubAction5(Enemy64Entity* this) {
}
void Enemy64_Action3(Enemy64Entity* this) {
static void (*const Enemy64_Action3_SubActions[])(Enemy64Entity*) = {
Enemy64_Action3_SubAction0,
Enemy64_Action3_SubAction1,
Enemy64_Action3_SubAction2,
Enemy64_Action3_SubAction3,
};
Enemy64_Action3_SubActions[super->subAction](this);
UpdateAnimationSingleFrame(super);
}
@@ -275,10 +310,13 @@ void Enemy64_Action3_SubAction0(Enemy64Entity* this) {
}
void Enemy64_Action3_SubAction1(Enemy64Entity* this) {
static const s8 gUnk_080D29B8[] = {
144, 112, 56, 200, 0, 0, 0, 0,
};
if (EntityWithinDistance(super, gRoomControls.origin_x + 0xa8, gRoomControls.origin_y + 0x80, 0x28)) {
super->subAction = 2;
super->timer = 45;
this->unk_74 = gUnk_080D29B8[Random() & 7] << 0x18 >> 0x18;
this->unk_74 = gUnk_080D29B8[Random() & 7];
this->unk_76 = super->direction << 8;
}
sub_08049998(this, ((0x100 - super->direction) & 0xff) << 8);
@@ -303,6 +341,10 @@ void Enemy64_Action3_SubAction3(Enemy64Entity* this) {
}
void Enemy64_Action4(Enemy64Entity* this) {
static void (*const Enemy64_Action4_SubActions[])(Enemy64Entity*) = {
Enemy64_Action4_SubAction0, Enemy64_Action4_SubAction1, Enemy64_Action4_SubAction2, Enemy64_Action4_SubAction3,
Enemy64_Action4_SubAction4, Enemy64_Action4_SubAction5, Enemy64_Action4_SubAction6, Enemy64_Action4_SubAction7,
};
Enemy64_Action4_SubActions[super->subAction](this);
UpdateAnimationSingleFrame(super);
}
@@ -497,28 +539,3 @@ void sub_08049B20(Enemy64Entity* this) {
gPlayerEntity.y.HALF.HI = (super->y.HALF.HI - tmpY) + gPlayerEntity.y.HALF.HI;
}
}
void (*const Enemy64_Actions[])(Enemy64Entity*) = {
Enemy64_Init, Enemy64_Action1, Enemy64_Action2, Enemy64_Action3, Enemy64_Action4,
};
void (*const Enemy64_Action1_SubActions[])(Enemy64Entity*) = {
Enemy64_Action1_SubAction0,
Enemy64_Action1_SubAction1,
};
void (*const Enemy64_Action2_SubActions[])(Enemy64Entity*) = {
Enemy64_Action2_SubAction0, Enemy64_Action2_SubAction1, Enemy64_Action2_SubAction2,
Enemy64_Action2_SubAction3, Enemy64_Action2_SubAction4, Enemy64_Action2_SubAction5,
};
void (*const Enemy64_Action3_SubActions[])(Enemy64Entity*) = {
Enemy64_Action3_SubAction0,
Enemy64_Action3_SubAction1,
Enemy64_Action3_SubAction2,
Enemy64_Action3_SubAction3,
};
const u8 gUnk_080D29B8[] = {
144, 112, 56, 200, 0, 0, 0, 0,
};
void (*const Enemy64_Action4_SubActions[])(Enemy64Entity*) = {
Enemy64_Action4_SubAction0, Enemy64_Action4_SubAction1, Enemy64_Action4_SubAction2, Enemy64_Action4_SubAction3,
Enemy64_Action4_SubAction4, Enemy64_Action4_SubAction5, Enemy64_Action4_SubAction6, Enemy64_Action4_SubAction7,
};
+2 -2
View File
@@ -261,11 +261,11 @@ bool32 LikeLike_StealItem(u32 item) {
bool32 ret = FALSE;
if (GetInventoryValue(item) == 1) {
if (ItemIsShield(gSave.stats.itemButtons[SLOT_A])) {
gSave.stats.itemButtons[SLOT_A] = 0;
gSave.stats.itemButtons[SLOT_A] = ITEM_NONE;
}
if (ItemIsShield(gSave.stats.itemButtons[SLOT_B])) {
gSave.stats.itemButtons[SLOT_B] = 0;
gSave.stats.itemButtons[SLOT_B] = ITEM_NONE;
}
SetInventoryValue(item, 0);
+1 -1
View File
@@ -272,7 +272,7 @@ void OctorokBoss_Hit_SubAction6(OctorokBossEntity* this) {
if ((this->unk_80 & 0x80) != 0) {
this->unk_80 -= (Random() & 3);
if ((this->unk_80 & 0x80) == 0) {
this->unk_80 = ((this->unk_80 & 0x80) << 0x18) >> 0x18;
this->unk_80 = 0;
}
} else {
this->unk_80 += (Random() & 3);
+1 -1
View File
@@ -1362,7 +1362,7 @@ static void sub_08043DB0(Entity* this) {
gRoomTransition.field_0x3d = 0x1e - (cVar1 / 0x3c);
gRoomTransition.field_0x3c = this->type2;
pEVar2 = ((VaatiArm_HeapStruct*)this->myHeap)->parent;
gRoomTransition.hurtType = pEVar2->x.HALF.HI;
gRoomTransition.field_0x40 = pEVar2->x.HALF.HI;
gRoomTransition.field_0x42 = pEVar2->y.HALF.HI;
pEVar4 = ((VaatiArm_HeapStruct*)pEVar2->myHeap)->parent;
if (pEVar4 != NULL) {
+2 -2
View File
@@ -136,7 +136,7 @@ void VaatiWrathType0Action0(Entity* this) {
this->action = 2;
this->timer = 60;
}
this->x.HALF.HI = gRoomTransition.hurtType;
this->x.HALF.HI = gRoomTransition.field_0x40;
this->y.HALF.HI = gRoomTransition.field_0x42;
sub_08042004(this);
} else {
@@ -147,7 +147,7 @@ void VaatiWrathType0Action0(Entity* this) {
this->subAction = bVar1;
this->timer = 120;
this->spritePriority.b1 = 0;
this->z.HALF.HI = 0xffb0;
this->z.HALF.HI = -80;
gRoomControls.camera_target = this;
sub_080809D4();
}