mirror of
https://github.com/zeldaret/tmc
synced 2026-07-29 23:48:33 -04:00
Merge remote-tracking branch 'upstream/master' into enumasm
This commit is contained in:
@@ -1,12 +1,112 @@
|
||||
#include "entity.h"
|
||||
#include "area.h"
|
||||
#include "main.h"
|
||||
#include "sound.h"
|
||||
#include "object.h"
|
||||
|
||||
void sub_0808C964(Entity*);
|
||||
void sub_0808CA10(Entity*);
|
||||
|
||||
void MacroMushromStalks(Entity* this) {
|
||||
static const s16 gUnk_08121648[] = { 264, 252, 256, 256, 248, 260, 240, 264, 248, 260, 256, 256, 264, 252, 272, 248 };
|
||||
|
||||
void MacroMushroomStalks(Entity* this) {
|
||||
static void (*const actionFuncs[])(Entity*) = {
|
||||
sub_0808C964,
|
||||
sub_0808CA10,
|
||||
};
|
||||
actionFuncs[this->action](this);
|
||||
}
|
||||
|
||||
void Object75(Entity* this) {
|
||||
static void (*const actionFuncs[])(Entity*) = {
|
||||
sub_0808C964,
|
||||
sub_0808CA10,
|
||||
};
|
||||
|
||||
actionFuncs[this->action](this);
|
||||
}
|
||||
|
||||
void Object76(Entity* this) {
|
||||
static void (*const actionFuncs[])(Entity*) = {
|
||||
sub_0808C964,
|
||||
sub_0808CA10,
|
||||
};
|
||||
|
||||
actionFuncs[this->action](this);
|
||||
}
|
||||
|
||||
void sub_0808C964(Entity* this) {
|
||||
u32 uVar1;
|
||||
|
||||
this->frameIndex = this->type;
|
||||
if ((this->id == OBJECT_76) && (gUI.roomControls.area != AREA_HYRULE_TOWN)) {
|
||||
this->type -= 9;
|
||||
}
|
||||
if (4 < this->type) {
|
||||
if (gArea.portal_exit_dir != this->type2) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
this->action = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->spriteOrientation.flipY = 2;
|
||||
this->spriteRendering.b3 = 2;
|
||||
;
|
||||
this->spritePriority.b0 = this->type2;
|
||||
if (this->id != OBJECT_75 && (u8)(this->type - 1) < 3) {
|
||||
this->spriteRendering.b0 = 3;
|
||||
if (this->type == 1) {
|
||||
uVar1 = 0xe0;
|
||||
} else {
|
||||
uVar1 = 0x100;
|
||||
}
|
||||
SetAffineInfo(this, uVar1, uVar1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0808CA10(Entity* this) {
|
||||
s32 sVar3;
|
||||
s32 sVar5;
|
||||
|
||||
switch (this->type) {
|
||||
case 1:
|
||||
if (gUnk_02018EB0.unk_18 != 0) {
|
||||
this->timer = 0x20;
|
||||
gUnk_02018EB0.unk_18 = 0;
|
||||
SoundReq(SFX_12E);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (gUnk_02018EB0.unk_19 != 0) {
|
||||
this->timer = 0x20;
|
||||
gUnk_02018EB0.unk_19 = 0;
|
||||
SoundReq(SFX_12E);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (gUnk_02018EB0.unk_1a != 0) {
|
||||
this->timer = 0x20;
|
||||
gUnk_02018EB0.unk_1a = 0;
|
||||
SoundReq(SFX_12E);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ((this->id != OBJECT_75 && ((u8)(this->type - 1) < 3)) && this->timer != 0) {
|
||||
this->timer--;
|
||||
this->subtimer++;
|
||||
if (this->timer != 0) {
|
||||
sVar5 = gUnk_08121648[this->subtimer & 0xe];
|
||||
sVar3 = gUnk_08121648[(this->subtimer & 0xe) + 1];
|
||||
} else {
|
||||
sVar3 = 0x100;
|
||||
sVar5 = sVar3;
|
||||
}
|
||||
|
||||
if (this->type == 1) {
|
||||
sVar5 = sVar5 - 0x20;
|
||||
sVar3 = sVar3 - 0x20;
|
||||
}
|
||||
SetAffineInfo(this, sVar5, sVar3, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,5 +160,3 @@ void sub_0808C8B8(Object3AEntity* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
const u16 gUnk_08121648[] = { 264, 252, 256, 256, 248, 260, 240, 264, 248, 260, 256, 256, 264, 252, 272, 248 };
|
||||
|
||||
@@ -808,7 +808,7 @@ void sub_0809584C(Object6AEntity* this) {
|
||||
u32 tmp, idx;
|
||||
|
||||
idx = super->health;
|
||||
if ((idx & 0x7F) != 0 && !ReadBit((u32*)gArea.filler5, idx - 1))
|
||||
if ((idx & 0x7F) != 0 && !ReadBit((u32*)gArea.filler6, idx - 1))
|
||||
DeleteThisEntity();
|
||||
if (super->timer != 0 && CheckKinstoneFused(super->type2))
|
||||
DeleteThisEntity();
|
||||
@@ -1178,9 +1178,9 @@ void sub_08095F38(Object6AEntity* this) {
|
||||
|
||||
void sub_08096028(Object6AEntity* this) {
|
||||
u32 type2 = 6;
|
||||
if (!CheckLocalFlagByBank(768, 123))
|
||||
if (!CheckLocalFlagByBank(FLAG_BANK_3, 123))
|
||||
type2 = 4;
|
||||
if (!CheckLocalFlagByBank(768, 122))
|
||||
if (!CheckLocalFlagByBank(FLAG_BANK_3, 122))
|
||||
type2 = 3;
|
||||
CreateObject(OBJECT_6A, 0x1F, type2);
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
|
||||
extern void sub_0808C964(Entity*);
|
||||
extern void sub_0808CA10(Entity*);
|
||||
|
||||
void Object75(Entity* this) {
|
||||
static void (*const actionFuncs[])(Entity*) = {
|
||||
sub_0808C964,
|
||||
sub_0808CA10,
|
||||
};
|
||||
|
||||
actionFuncs[this->action](this);
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
|
||||
extern void sub_0808C964(Entity*);
|
||||
extern void sub_0808CA10(Entity*);
|
||||
|
||||
void Object76(Entity* this) {
|
||||
static void (*const actionFuncs[])(Entity*) = {
|
||||
sub_0808C964,
|
||||
sub_0808CA10,
|
||||
};
|
||||
|
||||
actionFuncs[this->action](this);
|
||||
}
|
||||
@@ -283,8 +283,8 @@ typedef struct {
|
||||
} struct_gUnk_08122898;
|
||||
|
||||
const struct_gUnk_08122898 gUnk_08122898[] = {
|
||||
{ 0x200, 0xa1, 0xa2 },
|
||||
{ 0x8c0, 0x6f, 0x70 },
|
||||
{ FLAG_BANK_2, 0xa1, 0xa2 },
|
||||
{ FLAG_BANK_10, 0x6f, 0x70 },
|
||||
};
|
||||
|
||||
u32 sub_080932D8(u32 param_1) {
|
||||
|
||||
@@ -294,9 +294,9 @@ void sub_080971E0(ObjectOnPillarEntity* this) {
|
||||
bool32 sub_08097348(u32 tilePosition) {
|
||||
u32 index;
|
||||
TileEntity* tileEntity = gSmallChests;
|
||||
for (index = 0; index < 8; index++, tileEntity++) {
|
||||
if (tileEntity->_4 == tilePosition) {
|
||||
return CheckLocalFlag(tileEntity->_1);
|
||||
for (index = 0; index < ARRAY_COUNT(gSmallChests); index++, tileEntity++) {
|
||||
if (tileEntity->tilePos == tilePosition) {
|
||||
return CheckLocalFlag(tileEntity->localFlag);
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
@@ -23,7 +23,7 @@ void Whirlwind(Entity* this) {
|
||||
Whirlwind_Action2,
|
||||
};
|
||||
u32 tmp = this->health;
|
||||
if (((tmp & 0x7f) != 0) && (ReadBit(gArea.filler5, tmp - 1) == 0)) {
|
||||
if (((tmp & 0x7f) != 0) && (ReadBit(gArea.filler6, tmp - 1) == 0)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
Whirlwind_Actions[this->action](this);
|
||||
|
||||
Reference in New Issue
Block a user