A few more

This commit is contained in:
Elliptic Ellipsis
2022-03-25 13:52:16 +00:00
parent 2d37348cb6
commit dbbf77d76a
6 changed files with 36 additions and 35 deletions
+13 -17
View File
@@ -15,11 +15,9 @@ void Book(Entity* this) {
}
void sub_0809B3C4(Entity* this) {
u32 obtained;
obtained = GetInventoryValue(this->type + ITEM_QST_BOOK1);
u32 obtained = GetInventoryValue(this->type + ITEM_QST_BOOK1);
if (this->type2 != 3) {
if (obtained) {
if (obtained != 0) {
DeleteThisEntity();
}
} else {
@@ -55,22 +53,23 @@ void sub_0809B3C4(Entity* this) {
case 1: {
u32 scroll;
u32 height;
this->action = 3;
scroll = (u16)gRoomControls.scroll_y - 0x10;
height = (u16)this->y.HALF.HI - scroll;
this->z.HALF.HI -= height;
return;
break;
}
case 2:
this->action = 4;
return;
break;
case 3:
this->action = 5;
this->subAction = 0;
this->spritePriority.b0 = 3;
break;
default:
return;
break;
}
}
@@ -92,7 +91,7 @@ void sub_0809B4A8(Entity* this) {
this->speed = 64;
this->direction = 16;
gPlayerState.pushedObject = 0x9e;
gPlayerState.pushedObject = TREE_THORNS;
gPlayerState.queued_action = PLAYER_PUSH;
gPlayerState.flags |= PL_BUSY;
@@ -134,7 +133,7 @@ void sub_0809B56C(Entity* this) {
SetFlag(this->field_0x86.HWORD);
fx = CreateFx(this, FX_DEATH, 0);
if (fx) {
if (fx != NULL) {
SortEntityAbove(this, fx);
}
}
@@ -152,9 +151,8 @@ void sub_0809B5EC(Entity* this) {
if (this->spriteSettings.draw == 1) {
switch (this->subAction) {
case 0: {
Entity* parent;
parent = FindEntityByID(NPC, STURGEON, 7);
if (!parent) {
Entity* parent = FindEntityByID(NPC, STURGEON, 7);
if (parent == NULL) {
return;
}
if (parent->x.HALF.HI < this->x.HALF.HI) {
@@ -170,7 +168,7 @@ void sub_0809B5EC(Entity* this) {
break;
}
case 1: {
if (!this->parent || !this->parent->next) {
if ((this->parent == NULL) || (this->parent->next == NULL)) {
DeleteThisEntity();
return;
}
@@ -206,9 +204,8 @@ void sub_0809B5EC(Entity* this) {
}
u32 sub_0809B688(Entity* this) {
u32 ret;
u32 ret = EntityInRectRadius(this, &gPlayerEntity, 6, 12);
ret = EntityInRectRadius(this, &gPlayerEntity, 6, 12);
if (ret == 1 && gPlayerState.field_0xd != 16) {
ret = 0;
}
@@ -217,8 +214,7 @@ u32 sub_0809B688(Entity* this) {
}
void sub_0809B6B0(Entity* parent, Entity* this) {
s32 offset;
offset = (s32)gUnk_08123D94[parent->animationState >> 1] << 16;
s32 offset = (s32)gUnk_08123D94[parent->animationState >> 1] << 16;
PositionRelative(parent, this, 0, offset);
+7 -3
View File
@@ -144,6 +144,7 @@ void sub_080844E0(SpecialFxObject* this) {
static const u8 gUnk_0811FAC8[] = { 0x03, 0x37, 0x38, 0x39 };
static const u8 gUnk_0811FACC[] = { 0x17, 0x3e, 0x3f, 0x40 };
const struct_0811F960* ptr;
super->action = 1;
super->flags &= ~0x80;
super->spriteSettings.draw = 1;
@@ -219,7 +220,7 @@ void sub_08084680(SpecialFxObject* this) {
}
void sub_08084694(SpecialFxObject* this) {
if (!super->parent || !super->parent->next) {
if ((super->parent == NULL) || (super->parent->next == NULL)) {
DeleteThisEntity();
}
GetNextFrame(super);
@@ -253,12 +254,15 @@ void sub_080846B0(SpecialFxObject* this) {
void sub_0808471C(SpecialFxObject* this) {
static const s8 gUnk_0811FB08[] = { -8, -8, 8, -8, -8, 8, 8, 8 };
GetNextFrame(super);
if (super->frame & ANIM_DONE) {
u32 i;
for (i = 0; i < 4; i++) {
Entity* fx = CreateFx(super, 0x24, 0);
if (fx) {
if (fx != NULL) {
const s8* ptr = &gUnk_0811FB08[2 * i];
fx->x.HALF.HI += ptr[0];
fx->y.HALF.HI += ptr[1];
@@ -280,7 +284,7 @@ void sub_08084784(SpecialFxObject* this) {
void sub_08084798(SpecialFxObject* this) {
GetNextFrame(super);
if ((super->frame & ANIM_DONE) || !super->child->next) {
if ((super->frame & ANIM_DONE) || (super->child->next == NULL)) {
DeleteThisEntity();
}
}