Merge pull request #675 from notyourav/d

clean up linkAnimation.c
This commit is contained in:
Theo 2023-12-28 19:09:44 -08:00 committed by GitHub
commit 56688ac226
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
95 changed files with 245 additions and 216 deletions

View File

@ -386,7 +386,7 @@ Entity* FindEntity(u32 kind, u32 id, u32 listIndex, u32 type, u32 type2);
* @param entity Entity to set the priority of. * @param entity Entity to set the priority of.
* @param prio #Priority level. * @param prio #Priority level.
*/ */
void SetDefaultPriority(Entity* entity, u32 prio); void SetEntityPriority(Entity* entity, u32 prio);
/** /**
* Check if entity will be deleted next frame. * Check if entity will be deleted next frame.

View File

@ -83,7 +83,7 @@ extern void sub_08030118(u32);
extern void sub_0803C0AC(Entity*); extern void sub_0803C0AC(Entity*);
extern void sub_08049CF4(Entity*); extern void sub_08049CF4(Entity*);
extern u32 sub_0804A024(Entity*, u32, u32); extern u32 sub_0804A024(Entity*, u32, u32);
extern u32 sub_080542AC(u32); extern u32 IsMinishItem(u32);
extern void DisableRandomDrops(); extern void DisableRandomDrops();
extern void EnableRandomDrops(void); extern void EnableRandomDrops(void);
extern s32 sub_08056338(void); extern s32 sub_08056338(void);

View File

@ -0,0 +1,23 @@
#ifndef LINKANIMATION_H
#define LINKANIMATION_H
#ifndef NENT_DEPRECATED
#error "linkAnimtion.h requires new entities"
#endif
#include "entity.h"
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 storeDrawFlags;
/*0x69*/ u8 storeFlags;
/*0x6a*/ u8 storeIFrames;
/*0x6b*/ u8 storeField7;
/*0x6c*/ u8 storeKeepFacing;
/*0x6d*/ u8 storeFieldA;
/*0x6e*/ u8 storeField27;
/*0x6f*/ u8 storeMobility;
/*0x70*/ u32 storeStateFlags;
/*0x74*/ u8 store8A;
} LinkAnimationEntity;
#endif // LINKANIMATION_H

View File

@ -263,7 +263,7 @@ typedef enum {
typedef struct { typedef struct {
/*0x0*/ u16 heldInput; /**< Input currently held @see PlayerInputState */ /*0x0*/ u16 heldInput; /**< Input currently held @see PlayerInputState */
/*0x2*/ u16 newInput; /**< New input this frame @see PlayerInputState */ /*0x2*/ u16 newInput; /**< New input this frame @see PlayerInputState */
/*0x4*/ u32 field_0x94; /*0x4*/ u32 unused;
/*0x8*/ u16 playerMacroWaiting; /*0x8*/ u16 playerMacroWaiting;
/*0xa*/ u16 playerMacroHeldKeys; /*0xa*/ u16 playerMacroHeldKeys;
/*0xc*/ PlayerMacroEntry* playerMacro; /*0xc*/ PlayerMacroEntry* playerMacro;

View File

@ -211,7 +211,7 @@ void BusinessScrub_Action3(Entity* this) {
if (iVar1 != NULL) { if (iVar1 != NULL) {
iVar1->spritePriority.b0 = 3; iVar1->spritePriority.b0 = 3;
iVar1->z.HALF.HI -= 12; iVar1->z.HALF.HI -= 12;
SetDefaultPriority(iVar1, PRIO_MESSAGE); SetEntityPriority(iVar1, PRIO_MESSAGE);
} }
SetFlag(this->field_0x86.HWORD); SetFlag(this->field_0x86.HWORD);
sub_0802925C(this); sub_0802925C(this);

View File

@ -54,7 +54,7 @@ void BusinessScrubPrologue_OnCollision(BusinessScrubPrologueEntity* this) {
gPlayerState.field_0x27[0] = 0xff; gPlayerState.field_0x27[0] = 0xff;
EnqueueSFX(SFX_EM_DEKUSCRUB_HIT); EnqueueSFX(SFX_EM_DEKUSCRUB_HIT);
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
} }
} }
} }
@ -189,7 +189,7 @@ void sub_08045E14(BusinessScrubPrologueEntity* this) {
if (ent != NULL) { if (ent != NULL) {
ent->spritePriority.b0 = 3; ent->spritePriority.b0 = 3;
ent->z.HALF.HI -= 0xc; ent->z.HALF.HI -= 0xc;
SetDefaultPriority(ent, PRIO_MESSAGE); SetEntityPriority(ent, PRIO_MESSAGE);
} }
} }
break; break;

View File

@ -73,7 +73,7 @@ void LikeLike_OnCollision(LikeLikeEntity* this) {
void LikeLike_OnDeath(LikeLikeEntity* this) { void LikeLike_OnDeath(LikeLikeEntity* this) {
if (super->timer == 2 && this->stolenItem != 0xff) { if (super->timer == 2 && this->stolenItem != 0xff) {
SetDefaultPriority(super, PRIO_NO_BLOCK); SetEntityPriority(super, PRIO_NO_BLOCK);
LikeLike_ReturnStolenItem(this->stolenItem); LikeLike_ReturnStolenItem(this->stolenItem);
} }
GenericDeath(super); GenericDeath(super);

View File

@ -195,7 +195,7 @@ void CreateDeathFx(GenericEntity* parent, u32 parentId, u32 fixedItem) {
gSave.enemies_killed++; gSave.enemies_killed++;
parent->base.gustJarState |= 2; parent->base.gustJarState |= 2;
parent->base.timer = 255; parent->base.timer = 255;
SetDefaultPriority(&(parent->base), 3); SetEntityPriority(&(parent->base), 3);
deathFx2 = (DeathFxObject*)CreateObject(DEATH_FX, parent->base.id, 0); deathFx2 = (DeathFxObject*)CreateObject(DEATH_FX, parent->base.id, 0);
if (deathFx2 != NULL) { if (deathFx2 != NULL) {
deathFx2->unk6c = tmp; deathFx2->unk6c = tmp;
@ -232,7 +232,7 @@ void CreateDeathFx(GenericEntity* parent, u32 parentId, u32 fixedItem) {
} else { } else {
if (--parent->base.timer == 0) { if (--parent->base.timer == 0) {
parent->base.spriteSettings.draw = 0; parent->base.spriteSettings.draw = 0;
SetDefaultPriority(&(parent->base), 0); SetEntityPriority(&(parent->base), 0);
} else { } else {
if (parent->base.timer < 9) { if (parent->base.timer < 9) {
if (parent->base.spriteSettings.draw) { if (parent->base.spriteSettings.draw) {

View File

@ -74,17 +74,17 @@ const u8 gUnk_081091F8[] = {
0, 3, 0, 3, 3, 0, 3, 3, 3, 3, 0, 3, 0, 3, 3, 0, 3, 3, 3, 3,
}; };
void SetDefaultPriorityForKind(Entity* e) { void SetEntityPriorityForKind(Entity* e) {
u8 r3 = gRoomTransition.entity_update_type; u8 r3 = gRoomTransition.entity_update_type;
const u8* array = gUnk_081091F8; const u8* array = gUnk_081091F8;
if (r3 != 2) { if (r3 != 2) {
array = gUnk_081091EE; array = gUnk_081091EE;
} }
SetDefaultPriority(e, array[e->kind]); SetEntityPriority(e, array[e->kind]);
} }
void SetDefaultPriority(Entity* ent, u32 prio) { void SetEntityPriority(Entity* ent, u32 prio) {
ent->updatePriorityPrev = prio; ent->updatePriorityPrev = prio;
ent->updatePriority = prio; ent->updatePriority = prio;
} }
@ -508,7 +508,7 @@ void AppendEntityToList(Entity* entity, u32 listIndex) {
} else { } else {
gManagerCount++; gManagerCount++;
} }
SetDefaultPriorityForKind(entity); SetEntityPriorityForKind(entity);
} }
void PrependEntityToList(Entity* entity, u32 listIndex) { void PrependEntityToList(Entity* entity, u32 listIndex) {

View File

@ -200,7 +200,7 @@ u32 getItemMetaDataGetTextIndex(s32 itemIndex) {
return ptr[2]; return ptr[2];
} }
u32 sub_080542AC(u32 param_1) { u32 IsMinishItem(u32 param_1) {
const ItemMetaData* ptr1 = gItemMetaData; const ItemMetaData* ptr1 = gItemMetaData;
u8* ptr = (u8*)&((ptr1)[param_1]); u8* ptr = (u8*)&((ptr1)[param_1]);
return ptr[3] & 1; return ptr[3] & 1;

View File

@ -27,7 +27,7 @@ void CloudOverlayManager_Main(CloudOverlayManager* this) {
super->timer = 0; super->timer = 0;
super->subtimer = 8; super->subtimer = 8;
this->field_0x20 = gUnk_0810865C[0]; this->field_0x20 = gUnk_0810865C[0];
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT); SetEntityPriority((Entity*)this, PRIO_PLAYER_EVENT);
if (gArea.onEnter == NULL) { if (gArea.onEnter == NULL) {
RegisterTransitionManager(this, sub_0805AEDC, sub_0805AF3C); RegisterTransitionManager(this, sub_0805AEDC, sub_0805AF3C);
} else { } else {

View File

@ -37,7 +37,7 @@ void DelayedEntityLoadManager_Main(DelayedEntityLoadManager* this) {
if (super->action == 0) { if (super->action == 0) {
super->action++; super->action++;
this->unk_20 = gArea.filler[1]; this->unk_20 = gArea.filler[1];
SetDefaultPriority((Entity*)this, 6); SetEntityPriority((Entity*)this, 6);
npcPtr = gNPCData; npcPtr = gNPCData;
npcPtr += (super->type2 + this->unk_20); npcPtr += (super->type2 + this->unk_20);
index1 = 0; index1 = 0;

View File

@ -45,7 +45,7 @@ void sub_0805E140(EnterRoomTextboxManager* this) {
this->unk_20 = gRoomControls.room; this->unk_20 = gRoomControls.room;
super->timer = 120; super->timer = 120;
super->subtimer = 60; super->subtimer = 60;
SetDefaultPriority((Entity*)this, PRIO_HIGHEST); SetEntityPriority((Entity*)this, PRIO_HIGHEST);
sub_0805E1F8(gUnk_08108DE8[gArea.locationIndex], AreaIsDungeon()); sub_0805E1F8(gUnk_08108DE8[gArea.locationIndex], AreaIsDungeon());
} }

View File

@ -35,7 +35,7 @@ static void EzloHintManager_Init(EzloHintManager* this) {
this->ry = this->ry_raw << 3; this->ry = this->ry_raw << 3;
this->x = this->rx + (this->x_raw << 4); this->x = this->rx + (this->x_raw << 4);
this->y = this->ry + (this->y_raw << 4); this->y = this->ry + (this->y_raw << 4);
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT); SetEntityPriority((Entity*)this, PRIO_PLAYER_EVENT);
if (this->flag2 == 0) { if (this->flag2 == 0) {
super->action = 2; super->action = 2;
} else { } else {

View File

@ -55,7 +55,7 @@ void FightManager_Init(FightManager* this) {
if (!this->fightStartFlag) { if (!this->fightStartFlag) {
FightManager_LoadFight(this); FightManager_LoadFight(this);
} }
SetDefaultPriority((Entity*)this, PRIO_NO_BLOCK); SetEntityPriority((Entity*)this, PRIO_NO_BLOCK);
} else { } else {
DeleteThisEntity(); DeleteThisEntity();
} }
@ -157,7 +157,7 @@ void FightManagerHelper_Main(FightManagerHelper* this) {
if (super->action == 0) { if (super->action == 0) {
super->action = 1; super->action = 1;
SetDefaultPriority((Entity*)this, PRIO_NO_BLOCK); SetEntityPriority((Entity*)this, PRIO_NO_BLOCK);
} }
// go through and check all monitored enemies. // go through and check all monitored enemies.
anyRemaining = FALSE; anyRemaining = FALSE;

View File

@ -57,7 +57,7 @@ void sub_0805B328(HoleManager*);
void sub_0805B048(HoleManager* this) { void sub_0805B048(HoleManager* this) {
struct_08108764* tmp; struct_08108764* tmp;
Entity* obj; Entity* obj;
SetDefaultPriority((Entity*)super, PRIO_PLAYER_EVENT); SetEntityPriority((Entity*)super, PRIO_PLAYER_EVENT);
MemClear(&this->unk_20, 0x20); MemClear(&this->unk_20, 0x20);
super->action = 1; super->action = 1;
this->unk_3f = gRoomControls.room; this->unk_3f = gRoomControls.room;

View File

@ -66,7 +66,7 @@ void HyruleTownTilesetManager_Main(HyruleTownTilesetManager* this) {
this->field_0x21 = 0xff; this->field_0x21 = 0xff;
this->field_0x20 = 0xff; this->field_0x20 = 0xff;
RegisterTransitionManager(this, sub_08059A2C, NULL); RegisterTransitionManager(this, sub_08059A2C, NULL);
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT); SetEntityPriority((Entity*)this, PRIO_PLAYER_EVENT);
} }
sub_08059A58(this); sub_08059A58(this);
} }

View File

@ -37,7 +37,7 @@ void LightManager_Main(LightManager* this) {
super->flags |= ENT_PERSIST; super->flags |= ENT_PERSIST;
super->timer = 17; super->timer = 17;
this->unk20 = 0; this->unk20 = 0;
SetDefaultPriority((Entity*)this, 6); SetEntityPriority((Entity*)this, 6);
sub_0801E120(); sub_0801E120();
sub_0801E154(super->timer); sub_0801E154(super->timer);
} }

View File

@ -111,7 +111,7 @@ void MinishVillageTilesetManager_Main(MinishVillageTilesetManager* this) {
super->timer = 8; super->timer = 8;
this->unk_20 = 0xFF; this->unk_20 = 0xFF;
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT); SetEntityPriority((Entity*)this, PRIO_PLAYER_EVENT);
RegisterTransitionManager(this, sub_08057E30, 0); RegisterTransitionManager(this, sub_08057E30, 0);
} }
if (sub_08057E40(this)) { if (sub_08057E40(this)) {

View File

@ -212,7 +212,7 @@ void MiscManager_Type3(MiscManager* this) {
void MiscManager_Type4(MiscManager* this) { void MiscManager_Type4(MiscManager* this) {
if (super->action == 0) { if (super->action == 0) {
super->action = 1; super->action = 1;
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT); SetEntityPriority((Entity*)this, PRIO_PLAYER_EVENT);
} }
if (CheckLocalFlag(0x6c)) { if (CheckLocalFlag(0x6c)) {
if (CheckLocalFlag(0x4b)) { if (CheckLocalFlag(0x4b)) {
@ -430,7 +430,7 @@ void MiscManager_TypeE(MiscManager* this) {
#if defined(USA) || defined(DEMO_USA) || defined(DEMO_JP) #if defined(USA) || defined(DEMO_USA) || defined(DEMO_JP)
void MiscManager_TypeF(MiscManager* this) { void MiscManager_TypeF(MiscManager* this) {
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT); SetEntityPriority((Entity*)this, PRIO_PLAYER_EVENT);
if (gPlayerEntity.action == PLAYER_TALKEZLO) { if (gPlayerEntity.action == PLAYER_TALKEZLO) {
DeleteThisEntity(); DeleteThisEntity();
} }

View File

@ -20,7 +20,7 @@ void PowBackgroundManager_Main(PowBackgroundManager* this) {
if (super->action == 0) { if (super->action == 0) {
super->action = 1; super->action = 1;
super->flags |= ENT_PERSIST; super->flags |= ENT_PERSIST;
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT); SetEntityPriority((Entity*)this, PRIO_PLAYER_EVENT);
if (gArea.onEnter == NULL) { if (gArea.onEnter == NULL) {
RegisterTransitionManager(this, sub_0805AFFC, NULL); RegisterTransitionManager(this, sub_0805AFFC, NULL);
} else { } else {

View File

@ -37,7 +37,7 @@ void CreateRepeatedSoundManager(Entity* entity, ScriptExecutionContext* context)
manager->id = REPEATED_SOUND_MANAGER; manager->id = REPEATED_SOUND_MANAGER;
manager->type = context->intVariable; manager->type = context->intVariable;
AppendEntityToList((Entity*)manager, 6); AppendEntityToList((Entity*)manager, 6);
SetDefaultPriority((Entity*)manager, PRIO_PLAYER_EVENT); SetEntityPriority((Entity*)manager, PRIO_PLAYER_EVENT);
} }
} }

View File

@ -51,7 +51,7 @@ void SecretManager_Type0_Init(SecretManager* this) {
if (super->timer == 0) { if (super->timer == 0) {
super->timer = 30; super->timer = 30;
} }
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT); SetEntityPriority((Entity*)this, PRIO_PLAYER_EVENT);
} }
void SecretManager_Type0_Action1(SecretManager* this) { void SecretManager_Type0_Action1(SecretManager* this) {
@ -94,7 +94,7 @@ void SecretManager_Type1_Init(SecretManager* this) {
super->timer = 30; super->timer = 30;
} }
super->subtimer = super->timer; super->subtimer = super->timer;
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT); SetEntityPriority((Entity*)this, PRIO_PLAYER_EVENT);
} }
void SecretManager_Type1_Action1(SecretManager* this) { void SecretManager_Type1_Action1(SecretManager* this) {

View File

@ -35,7 +35,7 @@ void StaticBackgroundManager_Main(StaticBackgroundManager* this) {
if (super->action == 0) { if (super->action == 0) {
super->action = 1; super->action = 1;
super->flags |= ENT_PERSIST; super->flags |= ENT_PERSIST;
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT); SetEntityPriority((Entity*)this, PRIO_PLAYER_EVENT);
if (super->type != 0) { if (super->type != 0) {
RegisterTransitionManager(this, sub_0805B4B4, NULL); RegisterTransitionManager(this, sub_0805B4B4, NULL);
} }

View File

@ -370,7 +370,7 @@ void TempleOfDropletsManager_Type7(TempleOfDropletsManager* this) {
} }
super->subAction = 1; super->subAction = 1;
super->flags |= ENT_PERSIST; super->flags |= ENT_PERSIST;
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT); SetEntityPriority((Entity*)this, PRIO_PLAYER_EVENT);
break; break;
case 1: case 1:
if (CheckLocalFlag(this->unk_3e)) if (CheckLocalFlag(this->unk_3e))
@ -402,7 +402,7 @@ void TempleOfDropletsManager_Type7(TempleOfDropletsManager* this) {
void sub_0805AAC8(TempleOfDropletsManager*); void sub_0805AAC8(TempleOfDropletsManager*);
void sub_0805A89C(TempleOfDropletsManager* this) { void sub_0805A89C(TempleOfDropletsManager* this) {
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT); SetEntityPriority((Entity*)this, PRIO_PLAYER_EVENT);
super->action = 1; super->action = 1;
super->flags |= ENT_PERSIST; super->flags |= ENT_PERSIST;
super->timer = 8; super->timer = 8;

View File

@ -22,7 +22,7 @@ void Vaati3BackgroundManager_Main(Vaati3BackgroundManager* this) {
if (super->action == 0) { if (super->action == 0) {
super->action = 1; super->action = 1;
super->flags |= ENT_PERSIST; super->flags |= ENT_PERSIST;
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT); SetEntityPriority((Entity*)this, PRIO_PLAYER_EVENT);
if (gArea.onEnter == NULL) { if (gArea.onEnter == NULL) {
RegisterTransitionManager(this, sub_0805D470, NULL); RegisterTransitionManager(this, sub_0805D470, NULL);
} else { } else {

View File

@ -81,7 +81,7 @@ void sub_0806CF30(BigGoronEntity* this) {
super->action = 1; super->action = 1;
super->subAction = 1; super->subAction = 1;
this->originalX = super->x.HALF.HI; this->originalX = super->x.HALF.HI;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
sub_0806D0B0(super); sub_0806D0B0(super);
sub_0807DD64(super); sub_0807DD64(super);
} else { } else {
@ -215,7 +215,7 @@ void sub_0806D1D0(BigGoronEntity* this) {
super->spriteSettings.draw = 3; super->spriteSettings.draw = 3;
super->frameIndex = 0; super->frameIndex = 0;
super->timer = 30; super->timer = 30;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
} }
switch (super->subAction) { switch (super->subAction) {
@ -256,7 +256,7 @@ void sub_0806D274(BigGoronEntity* this) {
super->spritePriority.b0 = 7; super->spritePriority.b0 = 7;
super->frameIndex = 2; super->frameIndex = 2;
super->timer = 8; super->timer = 8;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
npc = CreateNPC(BIG_GORON, 3, 0); npc = CreateNPC(BIG_GORON, 3, 0);
if (npc != NULL) { if (npc != NULL) {
npc->child = super; npc->child = super;
@ -303,7 +303,7 @@ void sub_0806D348(BigGoronEntity* this) {
super->spritePriority.b0 = 6; super->spritePriority.b0 = 6;
super->spriteSettings.draw = 0; super->spriteSettings.draw = 0;
super->frameIndex = 5; super->frameIndex = 5;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
} }
if (super->child->frameIndex == 4) { if (super->child->frameIndex == 4) {
super->spriteSettings.draw = 3; super->spriteSettings.draw = 3;
@ -321,7 +321,7 @@ void sub_0806D3C0(BigGoronEntity* this) {
} }
super->action = 1; super->action = 1;
super->hitbox = (Hitbox*)&gHitbox_3; super->hitbox = (Hitbox*)&gHitbox_3;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
sub_0807DD64(super); sub_0807DD64(super);
} else { } else {
super->x.HALF.HI = super->parent->x.HALF.HI; super->x.HALF.HI = super->parent->x.HALF.HI;
@ -344,7 +344,7 @@ void sub_0806D41C(BigGoronEntity* this) {
sub_0806D4C0(this, 1); sub_0806D4C0(this, 1);
sub_0806D4C0(this, 2); sub_0806D4C0(this, 2);
sub_0806D4C0(this, 3); sub_0806D4C0(this, 3);
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
} else { } else {
ExecuteScriptForEntity(super, NULL); ExecuteScriptForEntity(super, NULL);
HandleEntity0x82Actions(super); HandleEntity0x82Actions(super);
@ -368,7 +368,7 @@ void sub_0806D4C0(BigGoronEntity* this, u32 type) {
npc->parent = super; npc->parent = super;
CopyPosition(super, npc); CopyPosition(super, npc);
SortEntityAbove(super, npc); SortEntityAbove(super, npc);
SetDefaultPriority(npc, PRIO_MESSAGE); SetEntityPriority(npc, PRIO_MESSAGE);
} }
} }

View File

@ -35,7 +35,7 @@ void Carpenter(CarpenterEntity* this) {
break; break;
super->action = 1; super->action = 1;
this->animIndex = 0; this->animIndex = 0;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
sub_0807DD64(super); sub_0807DD64(super);
case 1: case 1:
@ -115,7 +115,7 @@ void Carpenter_Fusion(Entity* this) {
if (LoadExtraSpriteData(this, &gUnk_08110CA8[this->type * 4])) { if (LoadExtraSpriteData(this, &gUnk_08110CA8[this->type * 4])) {
this->action++; this->action++;
this->spriteSettings.draw = 1; this->spriteSettings.draw = 1;
SetDefaultPriority(this, PRIO_MESSAGE); SetEntityPriority(this, PRIO_MESSAGE);
InitializeAnimation(this, (u32)this->type * 8 + 2); InitializeAnimation(this, (u32)this->type * 8 + 2);
} }
} else { } else {

View File

@ -221,7 +221,7 @@ void sub_0806799C(CatEntity* this) {
UpdateAnimationSingleFrame(super); UpdateAnimationSingleFrame(super);
if ((gMessage.doTextBox & 0x7f) == 0) { if ((gMessage.doTextBox & 0x7f) == 0) {
sub_08067B08(this); sub_08067B08(this);
SetDefaultPriority(super, PRIO_PLAYER); SetEntityPriority(super, PRIO_PLAYER);
} }
} }
@ -409,7 +409,7 @@ void sub_08067C44(CatEntity* this) {
} else { } else {
super->action = 4; super->action = 4;
sub_08067790(super); sub_08067790(super);
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
} }
super->interactType = INTERACTION_NONE; super->interactType = INTERACTION_NONE;
SoundReq(SFX_VO_CAT); SoundReq(SFX_VO_CAT);

View File

@ -30,7 +30,7 @@ void Cucco_Init(CuccoEntity* this) {
super->action++; super->action++;
this->fusionOffer = GetFusionToOffer(super); this->fusionOffer = GetFusionToOffer(super);
AddInteractableAsMinishFuser(super, this->fusionOffer); AddInteractableAsMinishFuser(super, this->fusionOffer);
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
super->subAction = 0; super->subAction = 0;
sub_0806E4EC(this); sub_0806E4EC(this);
} }

View File

@ -37,7 +37,7 @@ void CuccoChick_Init(CuccoChickEntity* this) {
super->action++; super->action++;
this->fusionOffer = GetFusionToOffer(super); this->fusionOffer = GetFusionToOffer(super);
AddInteractableAsMinishFuser(super, this->fusionOffer); AddInteractableAsMinishFuser(super, this->fusionOffer);
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
super->subAction = 0; super->subAction = 0;
sub_0806E764(this); sub_0806E764(this);
} }

View File

@ -23,7 +23,7 @@ void Dampe(Entity* this) {
case 0: case 0:
this->action = 1; this->action = 1;
this->spriteSettings.draw = 1; this->spriteSettings.draw = 1;
SetDefaultPriority(this, PRIO_MESSAGE); SetEntityPriority(this, PRIO_MESSAGE);
InitScriptForNPC(this); InitScriptForNPC(this);
return; return;
case 1: case 1:

View File

@ -226,7 +226,7 @@ void sub_08069B44(DogEntity* this) {
super->animationState = 2; super->animationState = 2;
this->unk_6a = 0xff; this->unk_6a = 0xff;
this->unk_74 = GetFusionToOffer(super); this->unk_74 = GetFusionToOffer(super);
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
InitAnimationForceUpdate(super, 10); InitAnimationForceUpdate(super, 10);
if ((super->flags & ENT_SCRIPTED) != 0) { if ((super->flags & ENT_SCRIPTED) != 0) {
InitScriptForNPC(super); InitScriptForNPC(super);
@ -525,7 +525,7 @@ void Dog_Fusion(DogEntity* this) {
if (sub_08069EF0(this)) { if (sub_08069EF0(this)) {
super->action++; super->action++;
super->spriteSettings.draw = 1; super->spriteSettings.draw = 1;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
InitializeAnimation(super, 0x23); InitializeAnimation(super, 0x23);
} }
} else { } else {

View File

@ -15,7 +15,7 @@ void DrLeft(Entity* this) {
if (this->type == 0) { if (this->type == 0) {
if (this->action == 0) { if (this->action == 0) {
this->action++; this->action++;
SetDefaultPriority(this, PRIO_MESSAGE); SetEntityPriority(this, PRIO_MESSAGE);
InitScriptForNPC(this); InitScriptForNPC(this);
} }
ExecuteScriptForEntity(this, NULL); ExecuteScriptForEntity(this, NULL);

View File

@ -13,7 +13,7 @@
void Emma(Entity* this) { void Emma(Entity* this) {
if (this->action == 0) { if (this->action == 0) {
this->action++; this->action++;
SetDefaultPriority(this, PRIO_MESSAGE); SetEntityPriority(this, PRIO_MESSAGE);
InitScriptForNPC(this); InitScriptForNPC(this);
} else { } else {
ExecuteScriptAndHandleAnimation(this, NULL); ExecuteScriptAndHandleAnimation(this, NULL);

View File

@ -101,7 +101,7 @@ void sub_08065AA4(EponaEntity* this) {
InitializeNPCFusion(super); InitializeNPCFusion(super);
} else { } else {
super->action = 3; super->action = 3;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
sub_08065A50(this); sub_08065A50(this);
} }
InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity))); InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));

View File

@ -14,7 +14,7 @@ const u8 gUnk_08114144[];
void Ezlo(Entity* this) { void Ezlo(Entity* this) {
if (this->action == 0) { if (this->action == 0) {
this->action++; this->action++;
SetDefaultPriority(this, PRIO_MESSAGE); SetEntityPriority(this, PRIO_MESSAGE);
InitScriptForNPC(this); InitScriptForNPC(this);
} }
ExecuteScriptForEntity(this, NULL); ExecuteScriptForEntity(this, NULL);

View File

@ -38,7 +38,7 @@ void Farmers(Entity* this) {
} }
void sub_0806BC58(Entity* this) { void sub_0806BC58(Entity* this) {
SetDefaultPriority(this, PRIO_MESSAGE); SetEntityPriority(this, PRIO_MESSAGE);
} }
void Farmers_Head(Entity* this) { void Farmers_Head(Entity* this) {

View File

@ -35,7 +35,7 @@ void Festari(FestariEntity* this) {
void sub_0805FE10(FestariEntity* this) { void sub_0805FE10(FestariEntity* this) {
super->action = 1; super->action = 1;
super->spriteSettings.draw = TRUE; super->spriteSettings.draw = TRUE;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
this->fusionOffer = GetFusionToOffer(super); this->fusionOffer = GetFusionToOffer(super);
AddInteractableWhenBigFuser(super, this->fusionOffer); AddInteractableWhenBigFuser(super, this->fusionOffer);
InitScriptForNPC(super); InitScriptForNPC(super);
@ -127,7 +127,7 @@ void Festari_Fusion(FestariEntity* this) {
if (super->action == 0) { if (super->action == 0) {
super->action++; super->action++;
super->spriteSettings.draw = 1; super->spriteSettings.draw = 1;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
InitAnimationForceUpdate(super, 8); InitAnimationForceUpdate(super, 8);
} else { } else {
UpdateAnimationSingleFrame(super); UpdateAnimationSingleFrame(super);

View File

@ -526,7 +526,7 @@ void ForestMinish(ForestMinishEntity* this) {
super->spriteSettings.draw = TRUE; super->spriteSettings.draw = TRUE;
this->animIndex = super->animationState = super->timer << 1; this->animIndex = super->animationState = super->timer << 1;
super->timer = 0; super->timer = 0;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
StartCutscene(super, (u16*)gUnk_08109D18[super->type2]); StartCutscene(super, (u16*)gUnk_08109D18[super->type2]);
InitScriptForNPC(super); InitScriptForNPC(super);
} }
@ -755,7 +755,7 @@ void ForestMinish_Fusion(Entity* this) {
if (LoadExtraSpriteData(this, gUnk_0810A348)) { if (LoadExtraSpriteData(this, gUnk_0810A348)) {
this->action++; this->action++;
this->spriteSettings.draw = TRUE; this->spriteSettings.draw = TRUE;
SetDefaultPriority(this, PRIO_MESSAGE); SetEntityPriority(this, PRIO_MESSAGE);
InitializeAnimation(this, 6); InitializeAnimation(this, 6);
} }
} else { } else {

View File

@ -18,7 +18,7 @@ void Gentari(GentariEntity* this) {
case 0: case 0:
super->action = 1; super->action = 1;
super->spriteSettings.draw = TRUE; super->spriteSettings.draw = TRUE;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
this->fusionOffer = GetFusionToOffer(super); this->fusionOffer = GetFusionToOffer(super);
AddInteractableWhenBigFuser(super, this->fusionOffer); AddInteractableWhenBigFuser(super, this->fusionOffer);
InitScriptForNPC(super); InitScriptForNPC(super);
@ -45,7 +45,7 @@ void Gentari_Fusion(Entity* this) {
if (this->action == 0) { if (this->action == 0) {
this->action++; this->action++;
this->spriteSettings.draw = TRUE; this->spriteSettings.draw = TRUE;
SetDefaultPriority(this, PRIO_MESSAGE); SetEntityPriority(this, PRIO_MESSAGE);
InitAnimationForceUpdate(this, 10); InitAnimationForceUpdate(this, 10);
} else { } else {
UpdateAnimationSingleFrame(this); UpdateAnimationSingleFrame(this);

View File

@ -136,7 +136,7 @@ void sub_08065D18(GhostBrothersEntity* this) {
super->spriteSettings.draw = 1; super->spriteSettings.draw = 1;
super->spriteRendering.alphaBlend = 1; super->spriteRendering.alphaBlend = 1;
this->unk_6c = gUnk_08110188; this->unk_6c = gUnk_08110188;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
InitAnimationForceUpdate(super, 2); InitAnimationForceUpdate(super, 2);
gScreen.controls.layerFXControl = 0x3f40; gScreen.controls.layerFXControl = 0x3f40;
gScreen.controls.alphaBlend = 0x1000; gScreen.controls.alphaBlend = 0x1000;

View File

@ -41,7 +41,7 @@ void sub_0806CAF4(GregalEntity* this) {
if (super->action == 0) { if (super->action == 0) {
super->action++; super->action++;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
npc = CreateNPC(GREGAL, 1, 0); npc = CreateNPC(GREGAL, 1, 0);
if (npc != NULL) { if (npc != NULL) {
npc->parent = super; npc->parent = super;
@ -68,7 +68,7 @@ void sub_0806CB80(GregalEntity* this) {
super->action++; super->action++;
super->animationState = 2; super->animationState = 2;
super->frameIndex = 0; super->frameIndex = 0;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
} }
if (super->parent != NULL) { if (super->parent != NULL) {
super->frameIndex = (super->parent->frame & 3) + 0x21; super->frameIndex = (super->parent->frame & 3) + 0x21;
@ -79,7 +79,7 @@ void sub_0806CBB4(GregalEntity* this) {
if (super->action == 0) { if (super->action == 0) {
super->action++; super->action++;
super->animationState = 2; super->animationState = 2;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
InitializeAnimation(super, 0x11); InitializeAnimation(super, 0x11);
} }
GetNextFrame(super); GetNextFrame(super);
@ -96,7 +96,7 @@ void sub_0806CC08(GregalEntity* this) {
case 0: case 0:
super->action = 1; super->action = 1;
super->spriteSettings.draw = 1; super->spriteSettings.draw = 1;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
sub_0807DD64(super); sub_0807DD64(super);
case 1: case 1:
if (super->interactType == INTERACTION_FUSE) { if (super->interactType == INTERACTION_FUSE) {
@ -177,7 +177,7 @@ void Gregal_Fusion(Entity* this) {
if (this->action == 0) { if (this->action == 0) {
this->action++; this->action++;
this->spriteSettings.draw = 1; this->spriteSettings.draw = 1;
SetDefaultPriority(this, PRIO_MESSAGE); SetEntityPriority(this, PRIO_MESSAGE);
InitAnimationForceUpdate(this, 6); InitAnimationForceUpdate(this, 6);
} else { } else {
UpdateAnimationSingleFrame(this); UpdateAnimationSingleFrame(this);

View File

@ -29,7 +29,7 @@ void HurdyGurdyMan(HurdyGurdyManEntity* this) {
if (LoadExtraSpriteData(super, gUnk_081144F0)) { if (LoadExtraSpriteData(super, gUnk_081144F0)) {
super->action = 1; super->action = 1;
this->unk_69 = 0; this->unk_69 = 0;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
InitScriptForNPC(super); InitScriptForNPC(super);
} }
break; break;
@ -123,7 +123,7 @@ void HurdyGurdyMan_Fusion(Entity* this) {
if (LoadExtraSpriteData(this, gUnk_081144F0)) { if (LoadExtraSpriteData(this, gUnk_081144F0)) {
this->action++; this->action++;
this->spriteSettings.draw = 1; this->spriteSettings.draw = 1;
SetDefaultPriority(this, PRIO_MESSAGE); SetEntityPriority(this, PRIO_MESSAGE);
InitializeAnimation(this, 10); InitializeAnimation(this, 10);
} }
} else { } else {

View File

@ -16,7 +16,7 @@ void KingGustaf(Entity* this) {
this->action++; this->action++;
this->spriteRendering.alphaBlend = 1; this->spriteRendering.alphaBlend = 1;
this->collisionLayer = 2; this->collisionLayer = 2;
SetDefaultPriority(this, PRIO_MESSAGE); SetEntityPriority(this, PRIO_MESSAGE);
InitScriptForNPC(this); InitScriptForNPC(this);
gScreen.controls.layerFXControl = 0x3f40; gScreen.controls.layerFXControl = 0x3f40;
gScreen.controls.alphaBlend = 0x1000; gScreen.controls.alphaBlend = 0x1000;

View File

@ -22,7 +22,7 @@ void Librari(LibrariEntity* this) {
super->animationState = super->timer; super->animationState = super->timer;
this->fusionOffer = GetFusionToOffer(super); this->fusionOffer = GetFusionToOffer(super);
AddInteractableWhenBigFuser(super, this->fusionOffer); AddInteractableWhenBigFuser(super, this->fusionOffer);
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
InitScriptForNPC(super); InitScriptForNPC(super);
break; break;
case 1: case 1:

View File

@ -62,7 +62,7 @@ bool32 sub_0806C454(Entity* this) {
if (!LoadExtraSpriteData(this, gUnk_08113754)) { if (!LoadExtraSpriteData(this, gUnk_08113754)) {
return FALSE; return FALSE;
} else { } else {
SetDefaultPriority(this, PRIO_MESSAGE); SetEntityPriority(this, PRIO_MESSAGE);
return TRUE; return TRUE;
} }
} }

View File

@ -14,7 +14,7 @@
void Marcy(Entity* this) { void Marcy(Entity* this) {
if (this->action == 0) { if (this->action == 0) {
this->action++; this->action++;
SetDefaultPriority(this, PRIO_MESSAGE); SetEntityPriority(this, PRIO_MESSAGE);
sub_0807DD64(this); sub_0807DD64(this);
} }
ExecuteScriptAndHandleAnimation(this, NULL); ExecuteScriptAndHandleAnimation(this, NULL);

View File

@ -24,7 +24,7 @@ void MayorHagen(MayorHagenEntity* this) {
super->action = 1; super->action = 1;
this->animIndex = 0; this->animIndex = 0;
this->fusionOffer = GetFusionToOffer(super); this->fusionOffer = GetFusionToOffer(super);
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
InitScriptForNPC(super); InitScriptForNPC(super);
break; break;
case 1: case 1:

View File

@ -78,7 +78,7 @@ void sub_08068780(Entity* this) {
this->action = 1; this->action = 1;
this->spriteSettings.draw = TRUE; this->spriteSettings.draw = TRUE;
this->animationState = this->type; this->animationState = this->type;
SetDefaultPriority(this, PRIO_MESSAGE); SetEntityPriority(this, PRIO_MESSAGE);
InitScriptForNPC(this); InitScriptForNPC(this);
break; break;
case 1: case 1:

View File

@ -33,7 +33,7 @@ void MinishEzlo(Entity* this) {
} }
this->action++; this->action++;
this->animationState = this->timer * 2; this->animationState = this->timer * 2;
SetDefaultPriority(this, PRIO_MESSAGE); SetEntityPriority(this, PRIO_MESSAGE);
InitScriptForNPC(this); InitScriptForNPC(this);
} }
ExecuteScriptForEntity(this, NULL); ExecuteScriptForEntity(this, NULL);

View File

@ -126,7 +126,7 @@ void sub_08067EF0(MountainMinishEntity* this) {
super->spriteSettings.draw = 1; super->spriteSettings.draw = 1;
super->animationState = super->type; super->animationState = super->type;
this->animIndex = 0; this->animIndex = 0;
SetDefaultPriority(super, 2); SetEntityPriority(super, 2);
InitScriptForNPC(super); InitScriptForNPC(super);
InitializeAnimation(super, gUnk_08111304[super->type2]); InitializeAnimation(super, gUnk_08111304[super->type2]);
break; break;

View File

@ -36,7 +36,7 @@ void Mutoh(MutohEntity* this) {
if (LoadExtraSpriteData(super, gUnk_08110C00)) { if (LoadExtraSpriteData(super, gUnk_08110C00)) {
super->action = 1; super->action = 1;
super->spriteSettings.draw = TRUE; super->spriteSettings.draw = TRUE;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
InitScriptForNPC(super); InitScriptForNPC(super);
} }
break; break;

View File

@ -28,7 +28,7 @@ void Pita(PitaEntity* this) {
}; };
if (super->action == 0) { if (super->action == 0) {
super->action++; super->action++;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
SortEntityAbove(super, super); SortEntityAbove(super, super);
super->hitbox = (Hitbox*)&gUnk_0810C428; super->hitbox = (Hitbox*)&gUnk_0810C428;
sub_0807DD64(super); sub_0807DD64(super);

View File

@ -234,7 +234,7 @@ void sub_080604DC(Entity* this) {
ent = CreateFx(this, FX_DASH, 0x40); ent = CreateFx(this, FX_DASH, 0x40);
if (ent != NULL) { if (ent != NULL) {
ent->y.HALF.HI++; ent->y.HALF.HI++;
SetDefaultPriority(ent, 3); SetEntityPriority(ent, 3);
} }
} }
} }

View File

@ -76,7 +76,7 @@ void sub_0806a370(RemEntity* this) {
void sub_0806A3D8(RemEntity* this) { void sub_0806A3D8(RemEntity* this) {
super->action = 1; super->action = 1;
super->timer = 180; super->timer = 180;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
sub_0806A8C8(super); sub_0806A8C8(super);
this->context = StartCutscene(super, &script_Rem); this->context = StartCutscene(super, &script_Rem);
ExecuteScriptAndHandleAnimation(super, NULL); ExecuteScriptAndHandleAnimation(super, NULL);
@ -297,7 +297,7 @@ void sub_0806A830(RemEntity* this) {
if (super->action == 0) { if (super->action == 0) {
super->action = 1; super->action = 1;
InitializeAnimation(super, 0x14); InitializeAnimation(super, 0x14);
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
} }
if ((gActiveScriptInfo.syncFlags & 0x200) != 0) { if ((gActiveScriptInfo.syncFlags & 0x200) != 0) {
DeleteThisEntity(); DeleteThisEntity();
@ -316,7 +316,7 @@ void sub_0806A890(RemEntity* this) {
if (super->action == 0) { if (super->action == 0) {
super->action = 1; super->action = 1;
InitializeAnimation(super, 0x15); InitializeAnimation(super, 0x15);
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
} }
GetNextFrame(super); GetNextFrame(super);
if ((super->frame & ANIM_DONE) != 0) { if ((super->frame & ANIM_DONE) != 0) {

View File

@ -59,7 +59,7 @@ void sub_08065080(StockwellEntity* this) {
super->action = 1; super->action = 1;
super->spriteSettings.draw = 1; super->spriteSettings.draw = 1;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
InitializeAnimation(super, 4); InitializeAnimation(super, 4);
AddInteractableWhenBigObject(super); AddInteractableWhenBigObject(super);
#ifndef EU #ifndef EU

View File

@ -48,7 +48,7 @@ void sub_0806A1F8(SyrupEntity* this) {
if (LoadExtraSpriteData(super, paVar2)) { if (LoadExtraSpriteData(super, paVar2)) {
super->action = 1; super->action = 1;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
InitScriptForNPC(super); InitScriptForNPC(super);
InitializeAnimation(super, 0); InitializeAnimation(super, 0);
} }

View File

@ -30,7 +30,7 @@ void Teachers(TeachersEntity* this) {
super->spriteSettings.draw = TRUE; super->spriteSettings.draw = TRUE;
super->animationState = super->timer; super->animationState = super->timer;
this->animIndex = 0; this->animIndex = 0;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
InitScriptForNPC(super); InitScriptForNPC(super);
} }
break; break;

View File

@ -42,7 +42,7 @@ void VaatiAction0(VaatiEntity* this) {
super->spriteSettings.draw = 1; super->spriteSettings.draw = 1;
this->unk_68 = 0; this->unk_68 = 0;
this->unk_69 = 0; this->unk_69 = 0;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
sub_0807DD64(super); sub_0807DD64(super);
VaatiAction1(this); VaatiAction1(this);
} }

View File

@ -12,7 +12,7 @@ void Wheaton(Entity* this) {
if (this->action == 0) { if (this->action == 0) {
this->action++; this->action++;
SetDefaultPriority(this, PRIO_MESSAGE); SetEntityPriority(this, PRIO_MESSAGE);
SortEntityAbove(this, this); SortEntityAbove(this, this);
this->hitbox = (Hitbox*)&gUnk_0810C3C0; this->hitbox = (Hitbox*)&gUnk_0810C3C0;
this->spriteOffsetY = 0xfe; this->spriteOffsetY = 0xfe;

View File

@ -31,7 +31,7 @@ void sub_08066CCC(Entity* this) {
this->action = 1; this->action = 1;
this->spriteSettings.draw = 1; this->spriteSettings.draw = 1;
PrependEntityToList(this, 7); PrependEntityToList(this, 7);
SetDefaultPriority(this, PRIO_MESSAGE); SetEntityPriority(this, PRIO_MESSAGE);
InitScriptForNPC(this); InitScriptForNPC(this);
} }

View File

@ -51,7 +51,7 @@ void ZeldaFollower(ZeldaFollowerEntity* this) {
super->animationState = 4; super->animationState = 4;
this->unk_68 = 0; this->unk_68 = 0;
this->unk_69 = 0; this->unk_69 = 0;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
InitAnimationForceUpdate(super, 0); InitAnimationForceUpdate(super, 0);
sub_0806854C(this, NULL); sub_0806854C(this, NULL);
} }

View File

@ -67,7 +67,7 @@ void Beanstalk_Init(BeanstalkEntity* this) {
super->spriteRendering.b3 = 2; super->spriteRendering.b3 = 2;
super->spriteOrientation.flipY = 1; super->spriteOrientation.flipY = 1;
SetDefaultPriority(super, 4); SetEntityPriority(super, 4);
if (super->type == 7) { if (super->type == 7) {
#ifndef EU #ifndef EU
if ((super->flags & ENT_DID_INIT) == 0) { if ((super->flags & ENT_DID_INIT) == 0) {

View File

@ -208,7 +208,7 @@ void BigBarrel_Type2(BigBarrelEntity* this) {
super->spriteSettings.draw = 1; super->spriteSettings.draw = 1;
super->frameIndex = super->type2 * 4 + 6; super->frameIndex = super->type2 * 4 + 6;
super->collisionLayer = 2; super->collisionLayer = 2;
SetDefaultPriority(super, 3); SetEntityPriority(super, 3);
super->type2 = super->type2 == 0 ? 0x15 : 0x16; super->type2 = super->type2 == 0 ? 0x15 : 0x16;
UpdateSpriteForCollisionLayer(super); UpdateSpriteForCollisionLayer(super);
break; break;
@ -346,7 +346,7 @@ void sub_08089094(BigBarrelEntity* this) {
void sub_080890EC(BigBarrelEntity* this, const s16* offsets, s32 yOffset) { void sub_080890EC(BigBarrelEntity* this, const s16* offsets, s32 yOffset) {
Entity* pEVar1 = CreateObject(BIG_BARREL, 3, 0); Entity* pEVar1 = CreateObject(BIG_BARREL, 3, 0);
if (pEVar1) { if (pEVar1) {
SetDefaultPriority(pEVar1, 3); SetEntityPriority(pEVar1, 3);
pEVar1->x.HALF.HI = super->x.HALF.HI; pEVar1->x.HALF.HI = super->x.HALF.HI;
pEVar1->y.HALF.HI = super->y.HALF.HI + yOffset; pEVar1->y.HALF.HI = super->y.HALF.HI + yOffset;
pEVar1->parent = super; pEVar1->parent = super;

View File

@ -49,7 +49,7 @@ void BigVortex_Init(BigVortexEntity* this) {
super->spriteSettings.draw = TRUE; super->spriteSettings.draw = TRUE;
sub_08098E88(super); sub_08098E88(super);
} }
SetDefaultPriority(super, PRIO_PLAYER_EVENT); SetEntityPriority(super, PRIO_PLAYER_EVENT);
InitAnimationForceUpdate(super, 0); InitAnimationForceUpdate(super, 0);
} }

View File

@ -214,7 +214,7 @@ void Bird_Type8(BirdEntity* this) {
super->x.HALF.HI = gRoomControls.scroll_x; super->x.HALF.HI = gRoomControls.scroll_x;
super->y.HALF.HI = gPlayerEntity.y.HALF.HI; super->y.HALF.HI = gPlayerEntity.y.HALF.HI;
super->child = NULL; super->child = NULL;
SetDefaultPriority(super, 6); SetEntityPriority(super, 6);
InitAnimationForceUpdate(super, 0); InitAnimationForceUpdate(super, 0);
SoundReq(0x123); SoundReq(0x123);
break; break;
@ -307,7 +307,7 @@ void Bird_Type9(BirdEntity* this) {
super->spritePriority.b0 = 0; super->spritePriority.b0 = 0;
super->spriteRendering.b3 = 0; super->spriteRendering.b3 = 0;
super->spriteOrientation.flipY = 1; super->spriteOrientation.flipY = 1;
SetDefaultPriority(super, 6); SetEntityPriority(super, 6);
super->x.HALF.HI = gRoomControls.scroll_x; super->x.HALF.HI = gRoomControls.scroll_x;
super->y.HALF.HI = gPlayerEntity.y.HALF.HI; super->y.HALF.HI = gPlayerEntity.y.HALF.HI;
SoundReq(SFX_123); SoundReq(SFX_123);
@ -364,7 +364,7 @@ void Bird_Type10(BirdEntity* this) {
super->spritePriority.b0 = 0; super->spritePriority.b0 = 0;
super->spriteRendering.b3 = 0; super->spriteRendering.b3 = 0;
super->spriteOrientation.flipY = 1; super->spriteOrientation.flipY = 1;
SetDefaultPriority(super, 6); SetEntityPriority(super, 6);
InitAnimationForceUpdate(super, 0xe0); InitAnimationForceUpdate(super, 0xe0);
case 1: case 1:
UpdateAnimationSingleFrame(super); UpdateAnimationSingleFrame(super);
@ -400,7 +400,7 @@ void sub_0809D738(void) {
pEVar1 = CreateObject(BIRD, 9, 0); pEVar1 = CreateObject(BIRD, 9, 0);
if (pEVar1 != NULL) { if (pEVar1 != NULL) {
gRoomControls.camera_target = NULL; gRoomControls.camera_target = NULL;
SetDefaultPriority(pEVar1, 6); SetEntityPriority(pEVar1, 6);
SetPlayerEventPriority(); SetPlayerEventPriority();
pEVar2 = CreateObject(BIRD, 10, 0); pEVar2 = CreateObject(BIRD, 10, 0);
if (pEVar2 != NULL) { if (pEVar2 != NULL) {

View File

@ -96,7 +96,7 @@ void CameraTarget_Init(Entity* this) {
} }
this->action = 1; this->action = 1;
this->flags |= ENT_PERSIST; this->flags |= ENT_PERSIST;
SetDefaultPriority(this, 6); SetEntityPriority(this, 6);
} }
void CameraTarget_Action1(Entity* this) { void CameraTarget_Action1(Entity* this) {

View File

@ -100,7 +100,7 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) {
break; break;
case 1: case 1:
super->spriteRendering.b0 = 3; super->spriteRendering.b0 = 3;
SetDefaultPriority(super, 6); SetEntityPriority(super, 6);
break; break;
case 2: case 2:
if (CheckLocalFlag((u32)super->type2) == 0) { if (CheckLocalFlag((u32)super->type2) == 0) {

View File

@ -212,7 +212,7 @@ void CutsceneMiscObject_Type2(CutsceneMiscObjectEntity* this) {
DeleteThisEntity(); DeleteThisEntity();
if (super->action == 0) { if (super->action == 0) {
super->action++; super->action++;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
super->spriteRendering.b3 = gUnk_08114F30[p->spriteRendering.b3]; super->spriteRendering.b3 = gUnk_08114F30[p->spriteRendering.b3];
InitAnimationForceUpdate(super, 1); InitAnimationForceUpdate(super, 1);
} }
@ -231,7 +231,7 @@ void CutsceneMiscObject_Type3(CutsceneMiscObjectEntity* this) {
} else { } else {
super->action++; super->action++;
super->spriteSettings.draw = 1; super->spriteSettings.draw = 1;
SetDefaultPriority(super, PRIO_NO_BLOCK); SetEntityPriority(super, PRIO_NO_BLOCK);
switch (super->type2) { switch (super->type2) {
case 0x40: case 0x40:
case 0x41: case 0x41:
@ -290,7 +290,7 @@ void CutsceneMiscObject_Type4(CutsceneMiscObjectEntity* this) {
} else { } else {
super->action++; super->action++;
super->spriteSettings.draw = 1; super->spriteSettings.draw = 1;
SetDefaultPriority(super, PRIO_NO_BLOCK); SetEntityPriority(super, PRIO_NO_BLOCK);
InitAnimationForceUpdate(super, 0); InitAnimationForceUpdate(super, 0);
} }
UpdateAnimationSingleFrame(super); UpdateAnimationSingleFrame(super);
@ -330,7 +330,7 @@ void CutsceneMiscObject_Type5(CutsceneMiscObjectEntity* this) {
super->action++; super->action++;
super->z.WORD = Q_16_16(-160.0); super->z.WORD = Q_16_16(-160.0);
super->zVelocity = 0; super->zVelocity = 0;
SetDefaultPriority(super, PRIO_PLAYER_EVENT); SetEntityPriority(super, PRIO_PLAYER_EVENT);
InitializeAnimation(super, 0); InitializeAnimation(super, 0);
if (GetTileUnderEntity(super) == 13) { if (GetTileUnderEntity(super) == 13) {
super->action = 3; super->action = 3;
@ -472,7 +472,7 @@ void CutsceneMiscObject_Type7(CutsceneMiscObjectEntity* this) {
void CutsceneMiscObject_Type8(CutsceneMiscObjectEntity* this) { void CutsceneMiscObject_Type8(CutsceneMiscObjectEntity* this) {
if (super->action == 0) { if (super->action == 0) {
super->action = 1; super->action = 1;
SetDefaultPriority(super, PRIO_NO_BLOCK); SetEntityPriority(super, PRIO_NO_BLOCK);
SortEntityBelow(super, super); SortEntityBelow(super, super);
sub_0807DD64(super); sub_0807DD64(super);
InitAnimationForceUpdate(super, 2); InitAnimationForceUpdate(super, 2);
@ -492,7 +492,7 @@ void sub_08095164(CutsceneMiscObjectEntity* this) {
void CutsceneMiscObject_Type9(CutsceneMiscObjectEntity* this) { void CutsceneMiscObject_Type9(CutsceneMiscObjectEntity* this) {
if (super->action == 0) { if (super->action == 0) {
super->action = 1; super->action = 1;
SetDefaultPriority(super, PRIO_NO_BLOCK); SetEntityPriority(super, PRIO_NO_BLOCK);
SortEntityBelow(super, super); SortEntityBelow(super, super);
sub_0807DD64(super); sub_0807DD64(super);
InitAnimationForceUpdate(super, 0); InitAnimationForceUpdate(super, 0);
@ -547,7 +547,7 @@ void CutsceneMiscObject_Type11(CutsceneMiscObjectEntity* this) {
if (super->action == 0) { if (super->action == 0) {
super->action++; super->action++;
super->subAction = 0; super->subAction = 0;
SetDefaultPriority(super, PRIO_NO_BLOCK); SetEntityPriority(super, PRIO_NO_BLOCK);
InitAnimationForceUpdate(super, 0); InitAnimationForceUpdate(super, 0);
} }
if (super->subAction != 0) { if (super->subAction != 0) {
@ -607,7 +607,7 @@ void CutsceneMiscObject_Type12(CutsceneMiscObjectEntity* this) {
if (super->action == 0) { if (super->action == 0) {
super->action++; super->action++;
super->z.HALF.HI = -16; super->z.HALF.HI = -16;
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
super->spriteRendering.b3 = gUnk_08114F30[super->spriteRendering.b3]; super->spriteRendering.b3 = gUnk_08114F30[super->spriteRendering.b3];
SortEntityAbove(super, super); SortEntityAbove(super, super);
sub_0807DD64(super); sub_0807DD64(super);
@ -844,7 +844,7 @@ void CutsceneMiscObject_Type19(CutsceneMiscObjectEntity* this) {
void CutsceneMiscObject_Type20(CutsceneMiscObjectEntity* this) { void CutsceneMiscObject_Type20(CutsceneMiscObjectEntity* this) {
if (super->action == 0) { if (super->action == 0) {
super->action++; super->action++;
SetDefaultPriority(super, PRIO_PLAYER_EVENT); SetEntityPriority(super, PRIO_PLAYER_EVENT);
sub_0807DD64(super); sub_0807DD64(super);
InitializeAnimation(super, 0); InitializeAnimation(super, 0);
} }
@ -879,7 +879,7 @@ void CutsceneMiscObject_Type22(CutsceneMiscObjectEntity* this) {
if (super->action == 0) { if (super->action == 0) {
super->action++; super->action++;
super->spriteSettings.draw = 0; super->spriteSettings.draw = 0;
SetDefaultPriority(super, PRIO_NO_BLOCK); SetEntityPriority(super, PRIO_NO_BLOCK);
sub_0807DD64(super); sub_0807DD64(super);
} }
ExecuteScriptForEntity(super, 0); ExecuteScriptForEntity(super, 0);
@ -1035,7 +1035,7 @@ void CutsceneMiscObject_Type28(CutsceneMiscObjectEntity* this) {
if (super->action == 0) { if (super->action == 0) {
super->action++; super->action++;
super->spriteSettings.draw = 0; super->spriteSettings.draw = 0;
SetDefaultPriority(super, PRIO_PLAYER_EVENT); SetEntityPriority(super, PRIO_PLAYER_EVENT);
sub_0807DD64(super); sub_0807DD64(super);
} }
ExecuteScriptForEntity(super, 0); ExecuteScriptForEntity(super, 0);

View File

@ -81,7 +81,7 @@ void DeathFx_Action0(DeathFxObject* this) {
super->action = 1; super->action = 1;
EnqueueSFX(SFX_FF); EnqueueSFX(SFX_FF);
} }
SetDefaultPriority(super, 3); SetEntityPriority(super, 3);
} }
void DeathFx_Action1(DeathFxObject* this) { void DeathFx_Action1(DeathFxObject* this) {

View File

@ -110,7 +110,7 @@ void Fairy_Init(FairyEntity* this) {
super->gustJarFlags = 1; super->gustJarFlags = 1;
this->unk_74 = super->x.HALF.HI; this->unk_74 = super->x.HALF.HI;
this->unk_76 = super->y.HALF.HI; this->unk_76 = super->y.HALF.HI;
SetDefaultPriority(super, 6); SetEntityPriority(super, 6);
EnqueueSFX(SFX_136); EnqueueSFX(SFX_136);
switch (super->type2) { switch (super->type2) {

View File

@ -102,7 +102,7 @@ void FigurineDevice_Init(FigurineDeviceEntity* this) {
case 2: case 2:
this->unk_7a = 0; this->unk_7a = 0;
SetDefaultPriority(super, 7); SetEntityPriority(super, 7);
InitializeAnimation(super, 1); InitializeAnimation(super, 1);
break; break;
case 3: case 3:
@ -113,7 +113,7 @@ void FigurineDevice_Init(FigurineDeviceEntity* this) {
this->unk_7b = 0; this->unk_7b = 0;
this->unk_80 = 0; this->unk_80 = 0;
sub_0808804C(this); sub_0808804C(this);
SetDefaultPriority(super, 6); SetEntityPriority(super, 6);
break; break;
} }
} }

View File

@ -108,7 +108,7 @@ void FourElements_Action3(FourElementsEntity* this) {
if (super->timer != 0) { if (super->timer != 0) {
sub_080A0424(this); sub_080A0424(this);
if (--super->timer == 0) { if (--super->timer == 0) {
SetDefaultPriority(&gPlayerEntity, 0); SetEntityPriority(&gPlayerEntity, 0);
} }
} else { } else {
RequestPriorityDuration(NULL, 60); RequestPriorityDuration(NULL, 60);

View File

@ -64,7 +64,7 @@ void FrozenOctorok_Init(FrozenOctorokEntity* this) {
super->action = 1; super->action = 1;
switch (super->type) { switch (super->type) {
case 0: case 0:
SetDefaultPriority(super, 6); SetEntityPriority(super, 6);
this->unk_7e = 0; this->unk_7e = 0;
case 6: case 6:
super->timer = 1; super->timer = 1;

View File

@ -497,7 +497,7 @@ void GreatFairy_InitializeAnimation(GreatFairyEntity* this) {
super->type2 = super->type % temp; super->type2 = super->type % temp;
super->collisionLayer = 2; super->collisionLayer = 2;
InitializeAnimation(super, super->type2); InitializeAnimation(super, super->type2);
SetDefaultPriority(super, PRIO_MESSAGE); SetEntityPriority(super, PRIO_MESSAGE);
} }
Entity* GreatFairy_CreateForm(GreatFairyEntity* this, u32 curForm, u32 parameter) { Entity* GreatFairy_CreateForm(GreatFairyEntity* this, u32 curForm, u32 parameter) {
@ -544,7 +544,7 @@ void sub_08087424(GreatFairyEntity* this, ScriptExecutionContext* context) {
if (ent != NULL) { if (ent != NULL) {
ent->parent = &gPlayerEntity; ent->parent = &gPlayerEntity;
CopyPosition(&gPlayerEntity, ent); CopyPosition(&gPlayerEntity, ent);
SetDefaultPriority(ent, PRIO_MESSAGE); SetEntityPriority(ent, PRIO_MESSAGE);
} }
switch (context->intVariable) { switch (context->intVariable) {

View File

@ -52,7 +52,7 @@ void GuruguruBar_Init(GuruguruBarEntity* this) {
bVar1 = this->unk7e; bVar1 = this->unk7e;
this->unk76 = bVar1 << 8; this->unk76 = bVar1 << 8;
super->animationState = bVar1 << 6; super->animationState = bVar1 << 6;
SetDefaultPriority(super, 0); SetEntityPriority(super, 0);
if (super->type != 0) { if (super->type != 0) {
super->child = (Entity*)GetCurrentRoomProperty(super->type); super->child = (Entity*)GetCurrentRoomProperty(super->type);
UpdateRailMovement(super, (u16**)&super->child, &this->unk74); UpdateRailMovement(super, (u16**)&super->child, &this->unk74);

View File

@ -62,7 +62,7 @@ void HouseDoorExterior_Type0(HouseDoorExteriorEntity* this) {
super->action = 1; super->action = 1;
*((u32*)(&this->unk_68)) = 0; *((u32*)(&this->unk_68)) = 0;
this->unk_6c = super->timer; this->unk_6c = super->timer;
SetDefaultPriority(super, PRIO_PLAYER_EVENT); SetEntityPriority(super, PRIO_PLAYER_EVENT);
} }
prop = GetCurrentRoomProperty(this->unk_6c); prop = GetCurrentRoomProperty(this->unk_6c);

View File

@ -66,7 +66,7 @@ void ItemForSale_Init(ItemForSaleEntity* this) {
super->spritePriority.b1 = 0; super->spritePriority.b1 = 0;
super->carryFlags = 0; super->carryFlags = 0;
#ifdef EU #ifdef EU
SetDefaultPriority(super, 6); SetEntityPriority(super, 6);
#endif #endif
super->child = super; super->child = super;
ItemForSale_MakeInteractable(this); ItemForSale_MakeInteractable(this);

View File

@ -143,7 +143,7 @@ void ItemOnGround_Init(ItemOnGroundEntity* this) {
this->unk_6c = 0; this->unk_6c = 0;
this->unk_68 = 0; this->unk_68 = 0;
super->timer = 0; super->timer = 0;
SetDefaultPriority(super, PRIO_NO_BLOCK); SetEntityPriority(super, PRIO_NO_BLOCK);
super->gustJarFlags = sub_0808147C(super->type); super->gustJarFlags = sub_0808147C(super->type);
gUnk_0811E7E8[this->unk_69](this); gUnk_0811E7E8[this->unk_69](this);
} else { } else {
@ -370,7 +370,7 @@ void sub_08081404(ItemOnGroundEntity* this, u32 arg1) {
bool32 sub_08081420(ItemOnGroundEntity* this) { bool32 sub_08081420(ItemOnGroundEntity* this) {
if (CheckShouldPlayItemGetCutscene(this)) { if (CheckShouldPlayItemGetCutscene(this)) {
SetDefaultPriority(super, PRIO_PLAYER_EVENT); SetEntityPriority(super, PRIO_PLAYER_EVENT);
CreateItemEntity(super->type, super->type2, 0); CreateItemEntity(super->type, super->type2, 0);
return TRUE; return TRUE;
} else { } else {

View File

@ -2,126 +2,122 @@
* @file linkAnimation.c * @file linkAnimation.c
* @ingroup Objects * @ingroup Objects
* *
* @brief Link Animation object * @brief Link Animation object. This is used during "item get" sequences and
* replaces the player entity for the duration.
*/ */
#define NENT_DEPRECATED #define NENT_DEPRECATED
#include "functions.h" #include "functions.h"
#include "message.h" #include "message.h"
#include "object.h" #include "object.h"
#include "object/linkAnimation.h"
typedef struct { typedef enum {
/*0x00*/ Entity base; ITEMGET_INIT,
/*0x68*/ u8 unk_68; ITEMGET_UPDATE,
/*0x69*/ u8 unk_69; ITEMGET_WAIT,
/*0x6a*/ u8 unk_6a; } ItemGetState;
/*0x6b*/ u8 unk_6b;
/*0x6c*/ u8 unk_6c;
/*0x6d*/ u8 unk_6d;
/*0x6e*/ u8 unk_6e;
/*0x6f*/ u8 unk_6f;
/*0x70*/ u32 unk_70;
/*0x74*/ u8 unk_74;
} LinkAnimationEntity;
void LinkAnimation_Init(LinkAnimationEntity*); void LinkAnimation_Init(LinkAnimationEntity*);
void LinkAnimation_Action1(LinkAnimationEntity*); void LinkAnimation_Default(LinkAnimationEntity*);
void LinkAnimation_Action8(LinkAnimationEntity*); void LinkAnimation_ItemGet(LinkAnimationEntity*);
void LinkAnimation(LinkAnimationEntity* this) { void LinkAnimation(LinkAnimationEntity* this) {
static void (*const LinkAnimation_Actions[])(LinkAnimationEntity*) = { static void (*const LinkAnimation_Actions[])(LinkAnimationEntity*) = {
LinkAnimation_Init, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Init, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default,
LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default,
LinkAnimation_Action8, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_ItemGet, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default,
LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default,
LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default,
LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default,
LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default,
LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Action1, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default, LinkAnimation_Default,
}; };
LinkAnimation_Actions[super->action](this); LinkAnimation_Actions[super->action](this);
} }
void LinkAnimation_Init(LinkAnimationEntity* this) { void LinkAnimation_Init(LinkAnimationEntity* this) {
super->action = 8; super->action = PLAYER_ITEMGET;
LinkAnimation_Action8(this); LinkAnimation_ItemGet(this);
} }
void LinkAnimation_Action1(LinkAnimationEntity* this) { void LinkAnimation_Default(LinkAnimationEntity* this) {
ResetPlayerEventPriority(); ResetPlayerEventPriority();
gPauseMenuOptions.disabled = 0; gPauseMenuOptions.disabled = 0;
DeleteThisEntity(); DeleteThisEntity();
} }
void LinkAnimation_Action8(LinkAnimationEntity* this) { void LinkAnimation_ItemGet(LinkAnimationEntity* this) {
u32 one; u32 one;
u32 tmp; u32 sprite;
Entity* parent; Entity* held_obj;
u8* ptr; u8* ptr;
// hide player entity
gPlayerEntity.flags &= ~ENT_COLLIDE; gPlayerEntity.flags &= ~ENT_COLLIDE;
gPlayerEntity.spriteSettings.draw = 0; gPlayerEntity.spriteSettings.draw = 0;
super->palette.b.b0 = gPlayerEntity.palette.b.b0; super->palette.b.b0 = gPlayerEntity.palette.b.b0;
switch (super->subAction) { switch (super->subAction) {
case 0: case ITEMGET_INIT:
one = 1; one = 1;
super->subAction = one; super->subAction = one;
super->spriteSettings.draw = one; super->spriteSettings.draw = one;
super->collisionLayer = gPlayerEntity.collisionLayer; super->collisionLayer = gPlayerEntity.collisionLayer;
super->spritePriority.b0 = gPlayerEntity.spritePriority.b0; super->spritePriority.b0 = gPlayerEntity.spritePriority.b0;
super->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3; super->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
super->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY; super->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
super->spriteSettings.flipX = 0; super->spriteSettings.flipX = 0;
super->animationState = 4; super->animationState = 4;
SetDefaultPriority(super, 6); SetEntityPriority(super, PRIO_PLAYER_EVENT);
if ((gPlayerState.flags & PL_NO_CAP) != 0) { if (gPlayerState.flags & PL_NO_CAP) {
if (sub_080542AC(super->type)) { if (IsMinishItem(super->type)) {
tmp = 0x45e; sprite = ANIM_GET_ITEM_SMALL_NOCAP;
} else { } else {
tmp = 0x45b; sprite = ANIM_GET_ITEM_BIG_NOCAP;
} }
} else { } else {
if (sub_080542AC(super->type)) { if (IsMinishItem(super->type)) {
tmp = 0x2e0; sprite = ANIM_GET_ITEM_SMALL;
} else { } else {
tmp = 0x1b9; sprite = ANIM_GET_ITEM_BIG;
} }
} }
super->spriteIndex = (tmp >> 8); super->spriteIndex = (sprite >> 8);
InitAnimationForceUpdate(super, tmp & 0xff); InitAnimationForceUpdate(super, sprite & 0xff);
break; break;
case 1: case ITEMGET_UPDATE:
UpdateAnimationSingleFrame(super); UpdateAnimationSingleFrame(super);
if (super->frame != 0) { if (super->frame != 0) {
super->subAction++; super->subAction++;
} }
break; break;
case 2: case ITEMGET_WAIT:
UpdateAnimationSingleFrame(super); UpdateAnimationSingleFrame(super);
if ((gMessage.doTextBox & 0x7f) != 0) { if ((gMessage.doTextBox & 0x7f) != 0) {
return; return;
} }
if ((super->frame & ANIM_DONE) != 0) { if (super->frame & ANIM_DONE) {
super->action = 1; super->action = PLAYER_NORMAL;
gPlayerEntity.flags = this->unk_69; // restore player state
gPlayerEntity.spriteSettings.draw = this->unk_68; gPlayerEntity.flags = this->storeFlags;
gPlayerEntity.iframes = this->unk_6a; gPlayerEntity.spriteSettings.draw = this->storeDrawFlags;
gPlayerState.field_0x7 = this->unk_6b; gPlayerEntity.iframes = this->storeIFrames;
gPlayerState.keepFacing = this->unk_6c; gPlayerState.field_0x7 = this->storeField7;
gPlayerState.field_0xa = this->unk_6d; gPlayerState.keepFacing = this->storeKeepFacing;
gPlayerState.field_0x27[0] = this->unk_6e; gPlayerState.field_0xa = this->storeFieldA;
gPlayerState.mobility = this->unk_6f; gPlayerState.field_0x27[0] = this->storeField27;
gPlayerState.flags = this->unk_70; gPlayerState.mobility = this->storeMobility;
gPlayerState.field_0x8a = this->unk_74; gPlayerState.flags = this->storeStateFlags;
gPlayerState.field_0x8a = this->store8A;
} }
break; break;
} }
parent = super->parent; held_obj = super->parent;
if (parent != NULL) { if (held_obj != NULL) {
PositionEntityOnTop(super, parent); PositionEntityOnTop(super, held_obj);
ptr = GetSpriteSubEntryOffsetDataPointer((u16)super->spriteIndex, super->frameIndex); ptr = GetSpriteSubEntryOffsetDataPointer((u16)super->spriteIndex, super->frameIndex);
parent->spriteOffsetX = *ptr; held_obj->spriteOffsetX = ptr[0];
parent->spriteOffsetY = ptr[1]; held_obj->spriteOffsetY = ptr[1];
} }
} }

View File

@ -38,7 +38,7 @@ void LinkHoldingItem(LinkHoldingItemEntity* this) {
} }
void LinkHoldingItem_Init(LinkHoldingItemEntity* this) { void LinkHoldingItem_Init(LinkHoldingItemEntity* this) {
SetDefaultPriority(super, 6); SetEntityPriority(super, 6);
super->action = 1; super->action = 1;
} }

View File

@ -127,7 +127,7 @@ void sub_0808D2CC(void) {
Entity* obj = FindEntity(6, MINISH_VILLAGE_OBJECT, 6, 1, 0); Entity* obj = FindEntity(6, MINISH_VILLAGE_OBJECT, 6, 1, 0);
if (obj != NULL) { if (obj != NULL) {
obj->type = 9; obj->type = 9;
SetDefaultPriority(obj, 2); SetEntityPriority(obj, 2);
} }
} }

View File

@ -63,7 +63,7 @@ void MoleMittsParticle_Init(Entity* this) {
break; break;
} }
} }
SetDefaultPriority(this, 3); SetEntityPriority(this, 3);
InitializeAnimation(this, this->type2 * 4 + this->animationState); InitializeAnimation(this, this->type2 * 4 + this->animationState);
} }

View File

@ -106,6 +106,6 @@ void sub_0808A968(Object30Entity* this) {
super->spriteSettings.shadow = 0; super->spriteSettings.shadow = 0;
super->collisionFlags |= 0x10; super->collisionFlags |= 0x10;
super->hitbox = (Hitbox*)&gUnk_08121C58; super->hitbox = (Hitbox*)&gUnk_08121C58;
SetDefaultPriority(super, 2); SetEntityPriority(super, 2);
this->gravity = Q_8_8(40.0); this->gravity = Q_8_8(40.0);
} }

View File

@ -45,7 +45,7 @@ void ObjectA2_Init(Entity* this) {
this->spriteOrientation.flipY = 2; this->spriteOrientation.flipY = 2;
this->action = 1; this->action = 1;
ChangeObjPalette(this, gUnk_08124704[this->type]); ChangeObjPalette(this, gUnk_08124704[this->type]);
SetDefaultPriority(this, PRIO_HIGHEST); SetEntityPriority(this, PRIO_HIGHEST);
} }
void ObjectA2_Action1(Entity* this) { void ObjectA2_Action1(Entity* this) {

View File

@ -83,7 +83,7 @@ void ObjectA8_Init(ObjectA8Entity* this) {
super->gustJarFlags = 1; super->gustJarFlags = 1;
this->unk_74 = super->x.HALF.HI; this->unk_74 = super->x.HALF.HI;
this->unk_76 = super->y.HALF.HI; this->unk_76 = super->y.HALF.HI;
SetDefaultPriority(super, 3); SetEntityPriority(super, 3);
EnqueueSFX(SFX_136); EnqueueSFX(SFX_136);
} }

View File

@ -34,7 +34,7 @@ void ParallaxRoomView(ParallaxRoomViewEntity* this) {
} }
this->unk_68 = super->x.HALF.HI; this->unk_68 = super->x.HALF.HI;
this->unk_6a = super->y.HALF.HI; this->unk_6a = super->y.HALF.HI;
SetDefaultPriority(super, 6); SetEntityPriority(super, 6);
} }
if ((super->flags & 0x10) == 0) { if ((super->flags & 0x10) == 0) {
iVar4 = super->x.HALF.HI - gRoomControls.scroll_x; iVar4 = super->x.HALF.HI - gRoomControls.scroll_x;

View File

@ -52,7 +52,7 @@ void ShrinkingHieroglyphs_Init(ShrinkingHieroglyphsEntity* this) {
super->subtimer = 30; super->subtimer = 30;
this->objDir.HALF.HI = ShrinkingHieroglyphs_Directions[super->type]; this->objDir.HALF.HI = ShrinkingHieroglyphs_Directions[super->type];
this->unk74 = 0x2000; this->unk74 = 0x2000;
SetDefaultPriority(super, 6); SetEntityPriority(super, 6);
if (super->type == 0) { if (super->type == 0) {
this->unk7e = 0x40; this->unk7e = 0x40;
LoadSwapGFX(super, 1, 0); LoadSwapGFX(super, 1, 0);

View File

@ -153,7 +153,7 @@ void SpecialFx_Init(SpecialFxObject* this) {
super->action = 1; super->action = 1;
super->flags &= ~0x80; super->flags &= ~0x80;
super->spriteSettings.draw = 1; super->spriteSettings.draw = 1;
SetDefaultPriority(super, 6); SetEntityPriority(super, 6);
if (super->collisionLayer == 0) { if (super->collisionLayer == 0) {
ResolveCollisionLayer(super); ResolveCollisionLayer(super);
} }

View File

@ -39,7 +39,7 @@ void WindTribeTeleporter_Init(WindTribeTeleporterEntity* this) {
super->frameDuration = 8; super->frameDuration = 8;
super->spritePriority.b0 = 7; super->spritePriority.b0 = 7;
super->hitbox = (Hitbox*)&gHitbox_22; super->hitbox = (Hitbox*)&gHitbox_22;
SetDefaultPriority(super, 6); SetEntityPriority(super, 6);
if (sub_080A11C0(this)) { if (sub_080A11C0(this)) {
gPlayerEntity.x.HALF.HI = super->x.HALF.HI; gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
gPlayerEntity.y.HALF.HI = super->y.HALF.HI; gPlayerEntity.y.HALF.HI = super->y.HALF.HI;

View File

@ -1,3 +1,5 @@
#define NENT_DEPRECATED
#include "global.h" #include "global.h"
#include "entity.h" #include "entity.h"
#include "physics.h" #include "physics.h"
@ -5,6 +7,8 @@
#include "object.h" #include "object.h"
#include "functions.h" #include "functions.h"
#include "definitions.h" #include "definitions.h"
#include "object/linkAnimation.h"
#include "object/itemOnGround.h"
extern const Hitbox* const gObjectHitboxes[]; extern const Hitbox* const gObjectHitboxes[];
@ -29,6 +33,7 @@ const s8 gUnk_08126EEC[] = {
Entity* CreateLinkAnimation(Entity* parent, u32 type, u32 type2) { Entity* CreateLinkAnimation(Entity* parent, u32 type, u32 type2) {
Entity* e = CreateItemGetEntity(); Entity* e = CreateItemGetEntity();
if (e != NULL) { if (e != NULL) {
LinkAnimationEntity* this = (LinkAnimationEntity*)e;
e->id = LINK_ANIMATION; e->id = LINK_ANIMATION;
e->kind = OBJECT; e->kind = OBJECT;
e->type = type; e->type = type;
@ -39,16 +44,20 @@ Entity* CreateLinkAnimation(Entity* parent, u32 type, u32 type2) {
CopyPosition(&gPlayerEntity, e); CopyPosition(&gPlayerEntity, e);
gPriorityHandler.sys_priority = 6; gPriorityHandler.sys_priority = 6;
gPauseMenuOptions.disabled = 1; gPauseMenuOptions.disabled = 1;
e->field_0x68.HALF.HI = gPlayerEntity.flags;
e->field_0x68.HALF.LO = gPlayerEntity.spriteSettings.draw; // store player state
e->field_0x6a.HALF.LO = gPlayerEntity.iframes; this->storeFlags = gPlayerEntity.flags;
e->field_0x6a.HALF.HI = gPlayerState.field_0x7; this->storeDrawFlags = gPlayerEntity.spriteSettings.draw;
e->field_0x6c.HALF.LO = gPlayerState.keepFacing; this->storeIFrames = gPlayerEntity.iframes;
e->field_0x6c.HALF.HI = gPlayerState.field_0xa; this->storeField7 = gPlayerState.field_0x7;
e->field_0x6e.HALF.LO = gPlayerState.field_0x27[0]; this->storeKeepFacing = gPlayerState.keepFacing;
e->field_0x6e.HALF.HI = gPlayerState.mobility; this->storeFieldA = gPlayerState.field_0xa;
e->field_0x70.WORD = gPlayerState.flags; this->storeField27 = gPlayerState.field_0x27[0];
e->field_0x74.HALF.LO = gPlayerState.field_0x8a; this->storeMobility = gPlayerState.mobility;
this->storeStateFlags = gPlayerState.flags;
this->store8A = gPlayerState.field_0x8a;
// redundant, this is done by the LinkAnimation object
gPlayerEntity.flags &= ~ENT_COLLIDE; gPlayerEntity.flags &= ~ENT_COLLIDE;
gPlayerEntity.spriteSettings.draw = 0; gPlayerEntity.spriteSettings.draw = 0;
} }
@ -179,8 +188,9 @@ Entity* CreateGroundItemWithFlags(Entity* parent, u32 form, u32 subtype, u32 fla
ent = CreateObjectWithParent(parent, GROUND_ITEM, form, subtype); ent = CreateObjectWithParent(parent, GROUND_ITEM, form, subtype);
if (ent != NULL) { if (ent != NULL) {
ItemOnGroundEntity* this = (ItemOnGroundEntity*)ent;
ent->timer = 5; ent->timer = 5;
ent->field_0x86.HWORD = flags; this->unk_86 = flags;
} }
return ent; return ent;
} }
@ -352,7 +362,7 @@ static Entity* CreateSpeechBubble(Entity* parent, u32 type2, s32 xOffset, s32 yO
obj->parent = parent; obj->parent = parent;
obj->spriteOffsetX = xOffset; obj->spriteOffsetX = xOffset;
obj->spriteOffsetY = yOffset; obj->spriteOffsetY = yOffset;
SetDefaultPriority(obj, parent->updatePriority); SetEntityPriority(obj, parent->updatePriority);
} }
return obj; return obj;
} }

View File

@ -778,13 +778,13 @@ static void PlayerItemGetInit(Entity* this) {
if ((gPlayerState.flags & PL_MINISH) == 0) { if ((gPlayerState.flags & PL_MINISH) == 0) {
u32 anim; u32 anim;
if (gPlayerState.flags & PL_NO_CAP) { if (gPlayerState.flags & PL_NO_CAP) {
if (sub_080542AC(gPlayerState.field_0x38)) { if (IsMinishItem(gPlayerState.field_0x38)) {
anim = ANIM_GET_ITEM_SMALL_NOCAP; anim = ANIM_GET_ITEM_SMALL_NOCAP;
} else { } else {
anim = ANIM_GET_ITEM_BIG_NOCAP; anim = ANIM_GET_ITEM_BIG_NOCAP;
} }
} else { } else {
if (sub_080542AC(gPlayerState.field_0x38)) { if (IsMinishItem(gPlayerState.field_0x38)) {
anim = ANIM_GET_ITEM_SMALL; anim = ANIM_GET_ITEM_SMALL;
} else { } else {
anim = ANIM_GET_ITEM_BIG; anim = ANIM_GET_ITEM_BIG;
@ -4094,7 +4094,7 @@ void sub_080751E8(u32 a1, u32 a2, void* script) {
e2 = CreateSpeechBubbleSleep(&gPlayerEntity, -14, -28); e2 = CreateSpeechBubbleSleep(&gPlayerEntity, -14, -28);
*(Entity**)&gPlayerEntity.field_0x6c.HWORD = e2; *(Entity**)&gPlayerEntity.field_0x6c.HWORD = e2;
if (e2 != NULL) { if (e2 != NULL) {
SetDefaultPriority(e2, PRIO_NO_BLOCK); SetEntityPriority(e2, PRIO_NO_BLOCK);
} }
} }

View File

@ -23,7 +23,7 @@
static void sub_08077E54(ItemBehavior* beh); static void sub_08077E54(ItemBehavior* beh);
extern void sub_0800857C(Entity*); extern void sub_0800857C(Entity*);
extern void SetDefaultPriorityForKind(Entity*); extern void SetEntityPriorityForKind(Entity*);
extern void sub_0809D738(Entity*); extern void sub_0809D738(Entity*);
extern s32 Mod(s32, s32); extern s32 Mod(s32, s32);
extern u32 sub_08003FDE(Entity*, Entity*, u32, u32); extern u32 sub_08003FDE(Entity*, Entity*, u32, u32);
@ -1853,7 +1853,7 @@ void PlayerSetNormalAndCollide(void) {
PL_MOLDWORM_RELEASED | PL_PARACHUTE); PL_MOLDWORM_RELEASED | PL_PARACHUTE);
ResolvePlayerAnimation(); ResolvePlayerAnimation();
SetPlayerActionNormal(); SetPlayerActionNormal();
SetDefaultPriorityForKind(&gPlayerEntity); SetEntityPriorityForKind(&gPlayerEntity);
} }
void PlayerMinishSetNormalAndCollide(void) { void PlayerMinishSetNormalAndCollide(void) {
@ -1869,7 +1869,7 @@ void PlayerMinishSetNormalAndCollide(void) {
~(PL_BUSY | PL_DROWNING | PL_DISABLE_ITEMS | PL_IN_HOLE | PL_MOLDWORM_RELEASED | PL_PARACHUTE); ~(PL_BUSY | PL_DROWNING | PL_DISABLE_ITEMS | PL_IN_HOLE | PL_MOLDWORM_RELEASED | PL_PARACHUTE);
gPlayerState.swim_state = 0; gPlayerState.swim_state = 0;
gPlayerState.queued_action = PLAYER_INIT; gPlayerState.queued_action = PLAYER_INIT;
SetDefaultPriorityForKind(&gPlayerEntity); SetEntityPriorityForKind(&gPlayerEntity);
} }
void sub_080792BC(s32 speed, u32 direction, u32 field_0x38) { void sub_080792BC(s32 speed, u32 direction, u32 field_0x38) {

View File

@ -1671,15 +1671,15 @@ void DeleteHitbox(Entity* entity, ScriptExecutionContext* context) {
} }
void SetPriorityMessage(Entity* entity, ScriptExecutionContext* context) { void SetPriorityMessage(Entity* entity, ScriptExecutionContext* context) {
SetDefaultPriority(entity, PRIO_MESSAGE); SetEntityPriority(entity, PRIO_MESSAGE);
} }
void SetPriorityPlayerEvent(Entity* entity, ScriptExecutionContext* context) { void SetPriorityPlayerEvent(Entity* entity, ScriptExecutionContext* context) {
SetDefaultPriority(entity, PRIO_PLAYER_EVENT); SetEntityPriority(entity, PRIO_PLAYER_EVENT);
} }
void SetPriorityHighest(Entity* entity, ScriptExecutionContext* context) { void SetPriorityHighest(Entity* entity, ScriptExecutionContext* context) {
SetDefaultPriority(entity, PRIO_NO_BLOCK); SetEntityPriority(entity, PRIO_NO_BLOCK);
} }
void sub_0807F36C(Entity* entity, ScriptExecutionContext* context) { void sub_0807F36C(Entity* entity, ScriptExecutionContext* context) {