mirror of
https://github.com/zeldaret/tmc
synced 2026-09-02 02:02:30 -04:00
Merge branch 'master' into tilemap-docs
This commit is contained in:
+2
-3
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Anju NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "npc.h"
|
||||
#include "player.h"
|
||||
@@ -26,8 +25,8 @@ void Anju(AnjuEntity* this) {
|
||||
if (super->interactType == INTERACTION_FUSE) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
InitializeAnimation(super, (super->animIndex & -4) + GetAnimationStateForDirection4(
|
||||
GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitializeAnimation(super, (super->animIndex & -4) + GetAnimationStateForDirection4(GetFacingDirection(
|
||||
super, &gPlayerEntity.base)));
|
||||
InitializeNPCFusion(super);
|
||||
} else {
|
||||
ExecuteScriptAndHandleAnimation(super, NULL);
|
||||
|
||||
+4
-5
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Beedle NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "game.h"
|
||||
@@ -94,7 +93,7 @@ void Beedle_Action1(Entity* this) {
|
||||
}
|
||||
|
||||
void Beedle_Action2(Entity* this) {
|
||||
if ((gMessage.doTextBox & 0x7F) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
this->action++;
|
||||
InitializeAnimation(this, 8);
|
||||
}
|
||||
@@ -196,8 +195,8 @@ void sub_0806346C(Entity* this) {
|
||||
s32 iVar2;
|
||||
s32 iVar3;
|
||||
|
||||
iVar3 = (gPlayerEntity.x.HALF.HI - this->x.HALF.HI);
|
||||
iVar2 = (gPlayerEntity.y.HALF.HI - this->y.HALF.HI);
|
||||
iVar3 = (gPlayerEntity.base.x.HALF.HI - this->x.HALF.HI);
|
||||
iVar2 = (gPlayerEntity.base.y.HALF.HI - this->y.HALF.HI);
|
||||
|
||||
iVar3 += 0x30;
|
||||
iVar2 += 0x18;
|
||||
@@ -217,7 +216,7 @@ void sub_0806346C(Entity* this) {
|
||||
iVar3 >>= 4;
|
||||
iVar2 >>= 4;
|
||||
|
||||
bVar1 = gUnk_0810C8F0[iVar2][iVar3][gPlayerEntity.animationState >> 1];
|
||||
bVar1 = gUnk_0810C8F0[iVar2][iVar3][gPlayerEntity.base.animationState >> 1];
|
||||
if (bVar1 != this->type2) {
|
||||
const InteractCollisionData* data = &gBeedleCollisionData[bVar1];
|
||||
SetInteractableObjectCollision(this, 1, data->interactDirections, data);
|
||||
|
||||
+14
-15
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief BigGoron NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "hitbox.h"
|
||||
#include "item.h"
|
||||
@@ -81,7 +80,7 @@ void sub_0806CF30(BigGoronEntity* this) {
|
||||
super->action = 1;
|
||||
super->subAction = 1;
|
||||
this->originalX = super->x.HALF.HI;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
sub_0806D0B0(super);
|
||||
sub_0807DD64(super);
|
||||
} else {
|
||||
@@ -93,10 +92,10 @@ void sub_0806CF30(BigGoronEntity* this) {
|
||||
case 0:
|
||||
case 1:
|
||||
if (gRoomTransition.frameCount % 4 == 0) {
|
||||
if (gPlayerEntity.x.HALF.HI < super->x.HALF.HI && this->originalX - 32 < super->x.HALF.HI) {
|
||||
if (gPlayerEntity.base.x.HALF.HI < super->x.HALF.HI && this->originalX - 32 < super->x.HALF.HI) {
|
||||
super->x.HALF.HI--;
|
||||
}
|
||||
if (gPlayerEntity.x.HALF.HI > super->x.HALF.HI && this->originalX + 32 > super->x.HALF.HI) {
|
||||
if (gPlayerEntity.base.x.HALF.HI > super->x.HALF.HI && this->originalX + 32 > super->x.HALF.HI) {
|
||||
super->x.HALF.HI++;
|
||||
}
|
||||
}
|
||||
@@ -215,7 +214,7 @@ void sub_0806D1D0(BigGoronEntity* this) {
|
||||
super->spriteSettings.draw = 3;
|
||||
super->frameIndex = 0;
|
||||
super->timer = 30;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
}
|
||||
|
||||
switch (super->subAction) {
|
||||
@@ -256,7 +255,7 @@ void sub_0806D274(BigGoronEntity* this) {
|
||||
super->spritePriority.b0 = 7;
|
||||
super->frameIndex = 2;
|
||||
super->timer = 8;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
npc = CreateNPC(BIG_GORON, 3, 0);
|
||||
if (npc != NULL) {
|
||||
npc->child = super;
|
||||
@@ -266,7 +265,7 @@ void sub_0806D274(BigGoronEntity* this) {
|
||||
case 0:
|
||||
case 1:
|
||||
default:
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
super->frameIndex = 2;
|
||||
break;
|
||||
}
|
||||
@@ -303,7 +302,7 @@ void sub_0806D348(BigGoronEntity* this) {
|
||||
super->spritePriority.b0 = 6;
|
||||
super->spriteSettings.draw = 0;
|
||||
super->frameIndex = 5;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
}
|
||||
if (super->child->frameIndex == 4) {
|
||||
super->spriteSettings.draw = 3;
|
||||
@@ -321,7 +320,7 @@ void sub_0806D3C0(BigGoronEntity* this) {
|
||||
}
|
||||
super->action = 1;
|
||||
super->hitbox = (Hitbox*)&gHitbox_3;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
sub_0807DD64(super);
|
||||
} else {
|
||||
super->x.HALF.HI = super->parent->x.HALF.HI;
|
||||
@@ -344,7 +343,7 @@ void sub_0806D41C(BigGoronEntity* this) {
|
||||
sub_0806D4C0(this, 1);
|
||||
sub_0806D4C0(this, 2);
|
||||
sub_0806D4C0(this, 3);
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
} else {
|
||||
ExecuteScriptForEntity(super, NULL);
|
||||
HandleEntity0x82Actions(super);
|
||||
@@ -368,7 +367,7 @@ void sub_0806D4C0(BigGoronEntity* this, u32 type) {
|
||||
npc->parent = super;
|
||||
CopyPosition(super, npc);
|
||||
SortEntityAbove(super, npc);
|
||||
SetDefaultPriority(npc, PRIO_MESSAGE);
|
||||
SetEntityPriority(npc, PRIO_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -434,7 +433,7 @@ void sub_0806D5D4(void) {
|
||||
InitBiggoronTimer();
|
||||
equipSlot = IsItemEquipped(ITEM_SHIELD);
|
||||
if (equipSlot != EQUIP_SLOT_NONE) {
|
||||
gSave.stats.itemButtons[equipSlot] = ITEM_NONE;
|
||||
gSave.stats.equipped[equipSlot] = ITEM_NONE;
|
||||
}
|
||||
SetInventoryValue(ITEM_SHIELD, 0);
|
||||
}
|
||||
@@ -543,8 +542,8 @@ void sub_0806D788(void) {
|
||||
void sub_0806D7C4(Entity* this, ScriptExecutionContext* context) {
|
||||
Entity* entity;
|
||||
|
||||
this->x.HALF.HI = gPlayerEntity.x.HALF.HI;
|
||||
this->y.HALF.HI = gPlayerEntity.y.HALF.HI - 0x18;
|
||||
this->x.HALF.HI = gPlayerEntity.base.x.HALF.HI;
|
||||
this->y.HALF.HI = gPlayerEntity.base.y.HALF.HI - 0x18;
|
||||
entity = FindEntity(NPC, BIG_GORON, 7, 2, 0);
|
||||
if (entity != NULL) {
|
||||
LookAt(this, context, entity->x.HALF.HI, entity->y.HALF.HI);
|
||||
@@ -558,7 +557,7 @@ void sub_0806D804(Entity* this, ScriptExecutionContext* context) {
|
||||
this->y.HALF.HI = entity->y.HALF.HI - 0x10;
|
||||
this->spritePriority.b1 = 0;
|
||||
}
|
||||
LookAt(this, context, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI - 0x10);
|
||||
LookAt(this, context, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI - 0x10);
|
||||
}
|
||||
|
||||
void sub_0806D858(Entity* this) {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Blade Brothers NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
@@ -322,7 +321,7 @@ void sub_08068b2c(BladeBrothersEntity* this) {
|
||||
if (super->interactType == INTERACTION_FUSE) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
animationState = GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity));
|
||||
animationState = GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base));
|
||||
InitAnimationForceUpdate(super, animationState);
|
||||
InitializeNPCFusion(super);
|
||||
} else {
|
||||
@@ -347,10 +346,10 @@ void BladeBrothers_StartPlayerDemonstration(Entity* this, ScriptExecutionContext
|
||||
}
|
||||
|
||||
void sub_08068BB4(BladeBrothersEntity* this) {
|
||||
u32 item = gSave.stats.itemButtons[SLOT_A];
|
||||
u32 item = gSave.stats.equipped[SLOT_A];
|
||||
|
||||
this->itemSlotA = item;
|
||||
item = gSave.stats.itemButtons[SLOT_B];
|
||||
item = gSave.stats.equipped[SLOT_B];
|
||||
this->itemSlotB = item;
|
||||
}
|
||||
|
||||
|
||||
+3
-4
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Brocco NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "message.h"
|
||||
#include "npc.h"
|
||||
@@ -72,7 +71,7 @@ void sub_08063584(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08063608(Entity* this) {
|
||||
u8 tmp = gMessage.doTextBox & 0x7f;
|
||||
u8 tmp = gMessage.state & MESSAGE_ACTIVE;
|
||||
if (tmp == 0) {
|
||||
this->action = 1;
|
||||
this->subtimer = tmp;
|
||||
@@ -92,8 +91,8 @@ void sub_0806362C(BroccoEntity* this) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
this->animIndex = super->animIndex;
|
||||
InitAnimationForceUpdate(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)) + 4);
|
||||
InitAnimationForceUpdate(
|
||||
super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)) + 4);
|
||||
InitializeNPCFusion(super);
|
||||
} else {
|
||||
ExecuteScriptForEntity(super, NULL);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Carlov NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "npc.h"
|
||||
#include "room.h"
|
||||
|
||||
+5
-5
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Carpenter NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "item.h"
|
||||
#include "npc.h"
|
||||
@@ -35,7 +34,7 @@ void Carpenter(CarpenterEntity* this) {
|
||||
break;
|
||||
super->action = 1;
|
||||
this->animIndex = 0;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
sub_0807DD64(super);
|
||||
|
||||
case 1:
|
||||
@@ -43,8 +42,9 @@ void Carpenter(CarpenterEntity* this) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
this->animIndex = super->animIndex;
|
||||
InitializeAnimation(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)) +
|
||||
4 + (super->type * 8));
|
||||
InitializeAnimation(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)) + 4 +
|
||||
(super->type * 8));
|
||||
InitializeNPCFusion(super);
|
||||
} else {
|
||||
ExecuteScriptForEntity(super, 0);
|
||||
@@ -115,7 +115,7 @@ void Carpenter_Fusion(Entity* this) {
|
||||
if (LoadExtraSpriteData(this, &gUnk_08110CA8[this->type * 4])) {
|
||||
this->action++;
|
||||
this->spriteSettings.draw = 1;
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
SetEntityPriority(this, PRIO_MESSAGE);
|
||||
InitializeAnimation(this, (u32)this->type * 8 + 2);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Castle Maid NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
@@ -92,14 +91,15 @@ void sub_08064570(CastleMaidEntity* this) {
|
||||
if (super->interactType != INTERACTION_NONE) {
|
||||
super->action++;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
InitializeAnimation(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitializeAnimation(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
if (this->dialogFunc != NULL) {
|
||||
this->dialogFunc();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if ((gMessage.doTextBox & 0x7f) != 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) != 0) {
|
||||
return;
|
||||
}
|
||||
super->action = 1;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Castor Wilds Statue NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "effects.h"
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
|
||||
+8
-9
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Cat NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "enemy.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
@@ -143,7 +142,7 @@ void sub_080677EC(CatEntity* this) {
|
||||
super->hitType = -0x58;
|
||||
super->flags2 = 1;
|
||||
this->unk_69 = 0xff;
|
||||
if (super->x.HALF.HI < gPlayerEntity.x.HALF.HI) {
|
||||
if (super->x.HALF.HI < gPlayerEntity.base.x.HALF.HI) {
|
||||
super->spriteSettings.flipX = 1;
|
||||
} else {
|
||||
super->spriteSettings.flipX = 0;
|
||||
@@ -219,9 +218,9 @@ void sub_0806797C(CatEntity* this) {
|
||||
|
||||
void sub_0806799C(CatEntity* this) {
|
||||
UpdateAnimationSingleFrame(super);
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
sub_08067B08(this);
|
||||
SetDefaultPriority(super, PRIO_PLAYER);
|
||||
SetEntityPriority(super, PRIO_PLAYER);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,7 +321,7 @@ void sub_08067B80(CatEntity* this, u32 animIndex) {
|
||||
this->unk_74 = (Random() & 0x7f) + 0x1e;
|
||||
InitAnimationForceUpdate(super, animIndex);
|
||||
sub_08067DDC(super);
|
||||
if (super->x.HALF.HI < gPlayerEntity.x.HALF.HI) {
|
||||
if (super->x.HALF.HI < gPlayerEntity.base.x.HALF.HI) {
|
||||
super->spriteSettings.flipX = 1;
|
||||
} else {
|
||||
super->spriteSettings.flipX = 0;
|
||||
@@ -331,11 +330,11 @@ void sub_08067B80(CatEntity* this, u32 animIndex) {
|
||||
|
||||
void sub_08067BD4(Entity* this) {
|
||||
if (this->spriteSettings.flipX > 0) {
|
||||
if (this->x.HALF.HI - 4 > gPlayerEntity.x.HALF.HI) {
|
||||
if (this->x.HALF.HI - 4 > gPlayerEntity.base.x.HALF.HI) {
|
||||
this->spriteSettings.flipX = 0;
|
||||
}
|
||||
} else {
|
||||
if (this->x.HALF.HI + 4 < gPlayerEntity.x.HALF.HI) {
|
||||
if (this->x.HALF.HI + 4 < gPlayerEntity.base.x.HALF.HI) {
|
||||
this->spriteSettings.flipX = 1;
|
||||
}
|
||||
}
|
||||
@@ -377,7 +376,7 @@ void sub_08067C44(CatEntity* this) {
|
||||
return;
|
||||
}
|
||||
|
||||
iVar4 = sub_0806FCA0(super, &gPlayerEntity);
|
||||
iVar4 = sub_0806FCA0(super, &gPlayerEntity.base);
|
||||
switch (super->animIndex) {
|
||||
case 0:
|
||||
default:
|
||||
@@ -409,7 +408,7 @@ void sub_08067C44(CatEntity* this) {
|
||||
} else {
|
||||
super->action = 4;
|
||||
sub_08067790(super);
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
}
|
||||
super->interactType = INTERACTION_NONE;
|
||||
SoundReq(SFX_VO_CAT);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Clothes Rack NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "npc.h"
|
||||
#include "tiles.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Cow NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "npc.h"
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Cucco NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "kinstone.h"
|
||||
#include "npc.h"
|
||||
@@ -30,7 +29,7 @@ void Cucco_Init(CuccoEntity* this) {
|
||||
super->action++;
|
||||
this->fusionOffer = GetFusionToOffer(super);
|
||||
AddInteractableAsMinishFuser(super, this->fusionOffer);
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
super->subAction = 0;
|
||||
sub_0806E4EC(this);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Cucco Chick NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "npc.h"
|
||||
|
||||
@@ -37,7 +36,7 @@ void CuccoChick_Init(CuccoChickEntity* this) {
|
||||
super->action++;
|
||||
this->fusionOffer = GetFusionToOffer(super);
|
||||
AddInteractableAsMinishFuser(super, this->fusionOffer);
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
super->subAction = 0;
|
||||
sub_0806E764(this);
|
||||
}
|
||||
|
||||
+3
-4
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Dampe NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "item.h"
|
||||
@@ -25,15 +24,15 @@ void Dampe(Entity* this) {
|
||||
case 0:
|
||||
this->action = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
SetEntityPriority(this, PRIO_MESSAGE);
|
||||
InitScriptForNPC(this);
|
||||
return;
|
||||
case 1:
|
||||
if (this->interactType == INTERACTION_FUSE) {
|
||||
this->action = 2;
|
||||
this->interactType = INTERACTION_NONE;
|
||||
InitAnimationForceUpdate(this,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(this, &gPlayerEntity)) + 4);
|
||||
InitAnimationForceUpdate(
|
||||
this, GetAnimationStateForDirection4(GetFacingDirection(this, &gPlayerEntity.base)) + 4);
|
||||
InitializeNPCFusion(this);
|
||||
} else {
|
||||
ExecuteScriptAndHandleAnimation(this, NULL);
|
||||
|
||||
+2
-3
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Din NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "kinstone.h"
|
||||
#include "npc.h"
|
||||
@@ -27,8 +26,8 @@ void Din(DinEntity* this) {
|
||||
super->interactType = INTERACTION_NONE;
|
||||
InitializeNPCFusion(super);
|
||||
this->animIndex = super->animIndex;
|
||||
InitAnimationForceUpdate(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitAnimationForceUpdate(
|
||||
super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
} else {
|
||||
ExecuteScriptAndHandleAnimation(super, NULL);
|
||||
}
|
||||
|
||||
+4
-5
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Dog NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "collision.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
@@ -227,7 +226,7 @@ void sub_08069B44(DogEntity* this) {
|
||||
super->animationState = 2;
|
||||
this->unk_6a = 0xff;
|
||||
this->unk_74 = GetFusionToOffer(super);
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
InitAnimationForceUpdate(super, 10);
|
||||
if ((super->flags & ENT_SCRIPTED) != 0) {
|
||||
InitScriptForNPC(super);
|
||||
@@ -267,7 +266,7 @@ void sub_08069CB8(DogEntity* this) {
|
||||
u32 direction;
|
||||
u32 animState;
|
||||
|
||||
direction = GetFacingDirection(super, &gPlayerEntity);
|
||||
direction = GetFacingDirection(super, &gPlayerEntity.base);
|
||||
animState = gUnk_08111DB0[direction + super->animationState * 0x20];
|
||||
super->animationState = animState >> 6;
|
||||
this->unk_6b = animState & 0x3f;
|
||||
@@ -431,7 +430,7 @@ bool32 sub_08069F90(DogEntity* this) {
|
||||
if ((super->type == 2) && (CheckLocalFlag(MACHI_02_DOG) == 0)) {
|
||||
return TRUE;
|
||||
} else {
|
||||
return EntityInRectRadius(super, &gPlayerEntity, 0x14, 0x14);
|
||||
return EntityInRectRadius(super, &gPlayerEntity.base, 0x14, 0x14);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,7 +525,7 @@ void Dog_Fusion(DogEntity* this) {
|
||||
if (sub_08069EF0(this)) {
|
||||
super->action++;
|
||||
super->spriteSettings.draw = 1;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
InitializeAnimation(super, 0x23);
|
||||
}
|
||||
} else {
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Dr Left NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
#include "npc.h"
|
||||
@@ -15,7 +14,7 @@ void DrLeft(Entity* this) {
|
||||
if (this->type == 0) {
|
||||
if (this->action == 0) {
|
||||
this->action++;
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
SetEntityPriority(this, PRIO_MESSAGE);
|
||||
InitScriptForNPC(this);
|
||||
}
|
||||
ExecuteScriptForEntity(this, NULL);
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Emma NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "screenTransitions.h"
|
||||
@@ -13,7 +12,7 @@
|
||||
void Emma(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action++;
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
SetEntityPriority(this, PRIO_MESSAGE);
|
||||
InitScriptForNPC(this);
|
||||
} else {
|
||||
ExecuteScriptAndHandleAnimation(this, NULL);
|
||||
|
||||
+4
-4
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Epona NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "message.h"
|
||||
@@ -54,7 +53,7 @@ void sub_08065A00(EponaEntity* this) {
|
||||
}
|
||||
|
||||
void sub_08065A10(EponaEntity* this) {
|
||||
if ((gMessage.doTextBox & 0x7F) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
super->action = 1;
|
||||
InitAnimationForceUpdate(super, super->animationState / 2);
|
||||
}
|
||||
@@ -101,10 +100,11 @@ void sub_08065AA4(EponaEntity* this) {
|
||||
InitializeNPCFusion(super);
|
||||
} else {
|
||||
super->action = 3;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
sub_08065A50(this);
|
||||
}
|
||||
InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitAnimationForceUpdate(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
} else {
|
||||
sub_08065A50(this);
|
||||
ResetPlayerAnimationAndAction();
|
||||
|
||||
+10
-11
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Ezlo NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "npc.h"
|
||||
|
||||
const u8 gUnk_08114134[];
|
||||
@@ -14,7 +13,7 @@ const u8 gUnk_08114144[];
|
||||
void Ezlo(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action++;
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
SetEntityPriority(this, PRIO_MESSAGE);
|
||||
InitScriptForNPC(this);
|
||||
}
|
||||
ExecuteScriptForEntity(this, NULL);
|
||||
@@ -33,8 +32,8 @@ void sub_0806D8A0(Entity* this, ScriptExecutionContext* context) {
|
||||
if (this->spriteSettings.flipX) {
|
||||
xOffset = -xOffset;
|
||||
}
|
||||
xOffset += gPlayerEntity.x.HALF.HI;
|
||||
yOffset = gPlayerEntity.y.HALF.HI + 2;
|
||||
xOffset += gPlayerEntity.base.x.HALF.HI;
|
||||
yOffset = gPlayerEntity.base.y.HALF.HI + 2;
|
||||
context->x.HALF.HI = xOffset;
|
||||
context->y.HALF.HI = yOffset;
|
||||
|
||||
@@ -44,15 +43,15 @@ void sub_0806D8A0(Entity* this, ScriptExecutionContext* context) {
|
||||
}
|
||||
|
||||
void sub_0806D908(Entity* this) {
|
||||
this->direction =
|
||||
CalculateDirectionTo(this->x.HALF.HI, this->y.HALF.HI, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI);
|
||||
this->direction = CalculateDirectionTo(this->x.HALF.HI, this->y.HALF.HI, gPlayerEntity.base.x.HALF.HI,
|
||||
gPlayerEntity.base.y.HALF.HI);
|
||||
this->animationState = (this->animationState & 0x80) | gUnk_08114144[this->direction >> 0x1];
|
||||
}
|
||||
|
||||
// called when talk to ezlo, also when ezlo moves after you
|
||||
void sub_0806D944(Entity* this) {
|
||||
this->spriteSettings.flipX = 0;
|
||||
if (this->x.WORD <= gPlayerEntity.x.WORD) {
|
||||
if (this->x.WORD <= gPlayerEntity.base.x.WORD) {
|
||||
this->spriteSettings.flipX = 1;
|
||||
}
|
||||
}
|
||||
@@ -67,12 +66,12 @@ void sub_0806D96C(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0806D9A4(Entity* this) {
|
||||
if (this->x.WORD <= gPlayerEntity.x.WORD) {
|
||||
gPlayerEntity.spriteSettings.flipX = 0;
|
||||
if (this->x.WORD <= gPlayerEntity.base.x.WORD) {
|
||||
gPlayerEntity.base.spriteSettings.flipX = 0;
|
||||
} else {
|
||||
gPlayerEntity.spriteSettings.flipX = 1;
|
||||
gPlayerEntity.base.spriteSettings.flipX = 1;
|
||||
}
|
||||
gPlayerEntity.animationState = 4;
|
||||
gPlayerEntity.base.animationState = 4;
|
||||
}
|
||||
|
||||
// animation states
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Farmers NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "npc.h"
|
||||
@@ -38,7 +37,7 @@ void Farmers(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0806BC58(Entity* this) {
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
SetEntityPriority(this, PRIO_MESSAGE);
|
||||
}
|
||||
|
||||
void Farmers_Head(Entity* this) {
|
||||
|
||||
+2
-3
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Farore NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "npc.h"
|
||||
#include "kinstone.h"
|
||||
@@ -27,8 +26,8 @@ void Farore(FaroreEntity* this) {
|
||||
super->interactType = INTERACTION_NONE;
|
||||
InitializeNPCFusion(super);
|
||||
this->animIndex = super->animIndex;
|
||||
InitAnimationForceUpdate(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitAnimationForceUpdate(
|
||||
super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
} else {
|
||||
ExecuteScriptAndHandleAnimation(super, NULL);
|
||||
}
|
||||
|
||||
+3
-4
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Festari NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "npc.h"
|
||||
@@ -35,7 +34,7 @@ void Festari(FestariEntity* this) {
|
||||
void sub_0805FE10(FestariEntity* this) {
|
||||
super->action = 1;
|
||||
super->spriteSettings.draw = TRUE;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
this->fusionOffer = GetFusionToOffer(super);
|
||||
AddInteractableWhenBigFuser(super, this->fusionOffer);
|
||||
InitScriptForNPC(super);
|
||||
@@ -47,7 +46,7 @@ void sub_0805FE48(FestariEntity* this) {
|
||||
if (super->interactType == INTERACTION_FUSE) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
InitializeNPCFusion(super);
|
||||
} else {
|
||||
ExecuteScript(super, this->context);
|
||||
@@ -127,7 +126,7 @@ void Festari_Fusion(FestariEntity* this) {
|
||||
if (super->action == 0) {
|
||||
super->action++;
|
||||
super->spriteSettings.draw = 1;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
InitAnimationForceUpdate(super, 8);
|
||||
} else {
|
||||
UpdateAnimationSingleFrame(super);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Forest Minish NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
#include "kinstone.h"
|
||||
@@ -526,7 +525,7 @@ void ForestMinish(ForestMinishEntity* this) {
|
||||
super->spriteSettings.draw = TRUE;
|
||||
this->animIndex = super->animationState = super->timer << 1;
|
||||
super->timer = 0;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
StartCutscene(super, (u16*)gUnk_08109D18[super->type2]);
|
||||
InitScriptForNPC(super);
|
||||
}
|
||||
@@ -755,7 +754,7 @@ void ForestMinish_Fusion(Entity* this) {
|
||||
if (LoadExtraSpriteData(this, gUnk_0810A348)) {
|
||||
this->action++;
|
||||
this->spriteSettings.draw = TRUE;
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
SetEntityPriority(this, PRIO_MESSAGE);
|
||||
InitializeAnimation(this, 6);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
*
|
||||
* Representation for the NPCs in the fusion menu.
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "npc.h"
|
||||
|
||||
|
||||
+4
-5
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Gentari NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "npc.h"
|
||||
|
||||
@@ -18,7 +17,7 @@ void Gentari(GentariEntity* this) {
|
||||
case 0:
|
||||
super->action = 1;
|
||||
super->spriteSettings.draw = TRUE;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
this->fusionOffer = GetFusionToOffer(super);
|
||||
AddInteractableWhenBigFuser(super, this->fusionOffer);
|
||||
InitScriptForNPC(super);
|
||||
@@ -27,8 +26,8 @@ void Gentari(GentariEntity* this) {
|
||||
if (super->interactType == INTERACTION_FUSE) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
InitAnimationForceUpdate(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitAnimationForceUpdate(
|
||||
super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
InitializeNPCFusion(super);
|
||||
} else {
|
||||
ExecuteScriptAndHandleAnimation(super, NULL);
|
||||
@@ -45,7 +44,7 @@ void Gentari_Fusion(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action++;
|
||||
this->spriteSettings.draw = TRUE;
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
SetEntityPriority(this, PRIO_MESSAGE);
|
||||
InitAnimationForceUpdate(this, 10);
|
||||
} else {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Ghost Brothers NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "message.h"
|
||||
@@ -81,8 +80,8 @@ void sub_08065C0C(GhostBrothersEntity* this) {
|
||||
if (super->interactType == INTERACTION_FUSE) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
InitAnimationForceUpdate(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitAnimationForceUpdate(
|
||||
super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
InitializeNPCFusion(super);
|
||||
} else {
|
||||
ExecuteScriptAndHandleAnimation(super, NULL);
|
||||
@@ -136,7 +135,7 @@ void sub_08065D18(GhostBrothersEntity* this) {
|
||||
super->spriteSettings.draw = 1;
|
||||
super->spriteRendering.alphaBlend = 1;
|
||||
this->unk_6c = gUnk_08110188;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
InitAnimationForceUpdate(super, 2);
|
||||
gScreen.controls.layerFXControl = 0x3f40;
|
||||
gScreen.controls.alphaBlend = 0x1000;
|
||||
@@ -162,7 +161,7 @@ void sub_08065D74(GhostBrothersEntity* this) {
|
||||
void sub_08065DB8(GhostBrothersEntity* this) {
|
||||
switch (super->subAction) {
|
||||
case 0: {
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
super->subAction++;
|
||||
super->timer = 60;
|
||||
InitAnimationForceUpdate(super, 4);
|
||||
@@ -188,7 +187,7 @@ void sub_08065DB8(GhostBrothersEntity* this) {
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
super->subAction++;
|
||||
super->timer = 30;
|
||||
this->unk_6c = gUnk_0811022E;
|
||||
|
||||
+2
-3
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Gina NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "npc.h"
|
||||
#include "player.h"
|
||||
@@ -28,8 +27,8 @@ void Gina(GinaEntity* this) {
|
||||
if (super->interactType == INTERACTION_FUSE) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
InitAnimationForceUpdate(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitAnimationForceUpdate(
|
||||
super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
InitializeNPCFusion(super);
|
||||
} else {
|
||||
ExecuteScriptAndHandleAnimation(super, NULL);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Gorman NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "npc.h"
|
||||
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Goron NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "effects.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
@@ -72,7 +71,7 @@ void sub_08069328(Entity* this) {
|
||||
|
||||
void sub_08069390(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if ((gMessage.doTextBox & 0x7F) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
this->action = 1;
|
||||
this->interactType = INTERACTION_NONE;
|
||||
RevokePriority(this);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Goron Merchant NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
@@ -57,9 +56,9 @@ void sub_080695AC(Entity* this) {
|
||||
|
||||
void sub_080695E8(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
this->action = 1;
|
||||
this->interactType = gMessage.doTextBox & 0x7f;
|
||||
this->interactType = gMessage.state & MESSAGE_ACTIVE;
|
||||
RevokePriority(this);
|
||||
InitAnimationForceUpdate(this, this->animationState);
|
||||
}
|
||||
|
||||
+7
-8
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Gregal NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "npc.h"
|
||||
@@ -41,7 +40,7 @@ void sub_0806CAF4(GregalEntity* this) {
|
||||
|
||||
if (super->action == 0) {
|
||||
super->action++;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
npc = CreateNPC(GREGAL, 1, 0);
|
||||
if (npc != NULL) {
|
||||
npc->parent = super;
|
||||
@@ -68,7 +67,7 @@ void sub_0806CB80(GregalEntity* this) {
|
||||
super->action++;
|
||||
super->animationState = 2;
|
||||
super->frameIndex = 0;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
}
|
||||
if (super->parent != NULL) {
|
||||
super->frameIndex = (super->parent->frame & 3) + 0x21;
|
||||
@@ -79,7 +78,7 @@ void sub_0806CBB4(GregalEntity* this) {
|
||||
if (super->action == 0) {
|
||||
super->action++;
|
||||
super->animationState = 2;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
InitializeAnimation(super, 0x11);
|
||||
}
|
||||
GetNextFrame(super);
|
||||
@@ -96,15 +95,15 @@ void sub_0806CC08(GregalEntity* this) {
|
||||
case 0:
|
||||
super->action = 1;
|
||||
super->spriteSettings.draw = 1;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
sub_0807DD64(super);
|
||||
case 1:
|
||||
if (super->interactType == INTERACTION_FUSE) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
this->animIndex = super->animIndex;
|
||||
InitAnimationForceUpdate(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)) + 8);
|
||||
InitAnimationForceUpdate(
|
||||
super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)) + 8);
|
||||
InitializeNPCFusion(super);
|
||||
} else {
|
||||
ExecuteScriptForEntity(super, NULL);
|
||||
@@ -177,7 +176,7 @@ void Gregal_Fusion(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action++;
|
||||
this->spriteSettings.draw = 1;
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
SetEntityPriority(this, PRIO_MESSAGE);
|
||||
InitAnimationForceUpdate(this, 6);
|
||||
} else {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
|
||||
+6
-7
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Guard NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
@@ -320,7 +319,7 @@ void sub_08063DC8(Entity* this) {
|
||||
if (this->type == 0xff) {
|
||||
this->action = 2;
|
||||
this->timer = 30;
|
||||
this->animationState = GetAnimationStateForDirection4(GetFacingDirection(this, &gPlayerEntity));
|
||||
this->animationState = GetAnimationStateForDirection4(GetFacingDirection(this, &gPlayerEntity.base));
|
||||
InitAnimationForceUpdate(this, this->animationState + 4);
|
||||
} else {
|
||||
sub_0806EE20(this);
|
||||
@@ -333,7 +332,7 @@ void sub_08063DC8(Entity* this) {
|
||||
if (this->interactType != INTERACTION_NONE) {
|
||||
this->action = 3;
|
||||
this->interactType = INTERACTION_NONE;
|
||||
InitializeAnimation(this, GetAnimationStateForDirection4(GetFacingDirection(this, &gPlayerEntity)));
|
||||
InitializeAnimation(this, GetAnimationStateForDirection4(GetFacingDirection(this, &gPlayerEntity.base)));
|
||||
sub_08064428(this);
|
||||
}
|
||||
}
|
||||
@@ -346,7 +345,7 @@ void sub_08063E54(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08063E6C(Entity* this) {
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
this->action = 1;
|
||||
InitializeAnimation(this, this->animationState + 4);
|
||||
}
|
||||
@@ -390,14 +389,14 @@ void sub_08063F20(GuardEntity* this) {
|
||||
if (super->interactType != INTERACTION_NONE) {
|
||||
super->action++;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
InitializeAnimation(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)) + this->unk_70);
|
||||
InitializeAnimation(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)) +
|
||||
this->unk_70);
|
||||
sub_08064428(super);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08063F78(GuardEntity* this) {
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
super->action = super->action - 1;
|
||||
InitializeAnimation(super, (super->animationState >> 1) + 4 + this->unk_70);
|
||||
}
|
||||
|
||||
+10
-11
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Guard with Spear NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
@@ -112,7 +111,7 @@ void sub_08064198(GuardWithSpearEntity* this) {
|
||||
this->unk_71--;
|
||||
}
|
||||
|
||||
yDiff = gPlayerEntity.y.HALF.HI - super->y.HALF.HI;
|
||||
yDiff = gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI;
|
||||
if (2 < yDiff) {
|
||||
yDiff = 2;
|
||||
}
|
||||
@@ -132,7 +131,7 @@ void sub_08064198(GuardWithSpearEntity* this) {
|
||||
sVar1 = super->y.HALF.HI;
|
||||
ProcessMovement0(super);
|
||||
if (sVar1 != super->y.HALF.HI) {
|
||||
if (0x140 < gPlayerEntity.speed && gRoomTransition.frameCount % 6 == 0) {
|
||||
if (0x140 < gPlayerEntity.base.speed && gRoomTransition.frameCount % 6 == 0) {
|
||||
CreateDustSmall(super);
|
||||
}
|
||||
this->unk_71 = 10;
|
||||
@@ -145,7 +144,7 @@ void sub_08064198(GuardWithSpearEntity* this) {
|
||||
}
|
||||
if (this->unk_71 == 0) {
|
||||
animationState = super->animationState =
|
||||
GetAnimationStateForDirection8(GetFacingDirection(super, &gPlayerEntity));
|
||||
GetAnimationStateForDirection8(GetFacingDirection(super, &gPlayerEntity.base));
|
||||
animIndex = (animationState >> 1) + this->unk_70;
|
||||
if (animIndex != super->animIndex) {
|
||||
InitializeAnimation(super, animIndex);
|
||||
@@ -153,8 +152,8 @@ void sub_08064198(GuardWithSpearEntity* this) {
|
||||
}
|
||||
sub_0806ED78(super);
|
||||
sVar1 = super->z.HALF.HI;
|
||||
super->z.HALF.HI = gPlayerEntity.z.HALF.HI;
|
||||
if (sVar1 < 0 && gPlayerEntity.z.HALF.HI == 0) {
|
||||
super->z.HALF.HI = gPlayerEntity.base.z.HALF.HI;
|
||||
if (sVar1 < 0 && gPlayerEntity.base.z.HALF.HI == 0) {
|
||||
CreateDustSmall(super);
|
||||
}
|
||||
}
|
||||
@@ -169,7 +168,7 @@ void sub_080642B8(GuardWithSpearEntity* this) {
|
||||
this->unk_71--;
|
||||
}
|
||||
|
||||
yDiff = gPlayerEntity.x.HALF.HI - super->x.HALF.HI;
|
||||
yDiff = gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI;
|
||||
if (2 < yDiff) {
|
||||
yDiff = 2;
|
||||
}
|
||||
@@ -189,7 +188,7 @@ void sub_080642B8(GuardWithSpearEntity* this) {
|
||||
sVar1 = super->x.HALF.HI;
|
||||
ProcessMovement0(super);
|
||||
if (sVar1 != super->x.HALF.HI) {
|
||||
if (0x140 < gPlayerEntity.speed && gRoomTransition.frameCount % 6 == 0) {
|
||||
if (0x140 < gPlayerEntity.base.speed && gRoomTransition.frameCount % 6 == 0) {
|
||||
CreateDustSmall(super);
|
||||
}
|
||||
this->unk_71 = 10;
|
||||
@@ -202,7 +201,7 @@ void sub_080642B8(GuardWithSpearEntity* this) {
|
||||
}
|
||||
if (this->unk_71 == 0) {
|
||||
animationState = super->animationState =
|
||||
GetAnimationStateForDirection8(GetFacingDirection(super, &gPlayerEntity));
|
||||
GetAnimationStateForDirection8(GetFacingDirection(super, &gPlayerEntity.base));
|
||||
animIndex = (animationState >> 1) + this->unk_70;
|
||||
if (animIndex != super->animIndex) {
|
||||
InitializeAnimation(super, animIndex);
|
||||
@@ -210,8 +209,8 @@ void sub_080642B8(GuardWithSpearEntity* this) {
|
||||
}
|
||||
sub_0806ED78(super);
|
||||
sVar1 = super->z.HALF.HI;
|
||||
super->z.HALF.HI = gPlayerEntity.z.HALF.HI;
|
||||
if (sVar1 < 0 && gPlayerEntity.z.HALF.HI == 0) {
|
||||
super->z.HALF.HI = gPlayerEntity.base.z.HALF.HI;
|
||||
if (sVar1 < 0 && gPlayerEntity.base.z.HALF.HI == 0) {
|
||||
CreateDustSmall(super);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Hurdy Gurdy Man NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "npc.h"
|
||||
@@ -29,7 +28,7 @@ void HurdyGurdyMan(HurdyGurdyManEntity* this) {
|
||||
if (LoadExtraSpriteData(super, gUnk_081144F0)) {
|
||||
super->action = 1;
|
||||
this->unk_69 = 0;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
InitScriptForNPC(super);
|
||||
}
|
||||
break;
|
||||
@@ -38,7 +37,8 @@ void HurdyGurdyMan(HurdyGurdyManEntity* this) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
this->unk_69 = super->animIndex;
|
||||
InitializeAnimation(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitializeAnimation(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
index = GetFuserId(super);
|
||||
pointerToArray = gUnk_08001A7C[index];
|
||||
if (this->fusionOffer == 0x32) {
|
||||
@@ -123,7 +123,7 @@ void HurdyGurdyMan_Fusion(Entity* this) {
|
||||
if (LoadExtraSpriteData(this, gUnk_081144F0)) {
|
||||
this->action++;
|
||||
this->spriteSettings.draw = 1;
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
SetEntityPriority(this, PRIO_MESSAGE);
|
||||
InitializeAnimation(this, 10);
|
||||
}
|
||||
} else {
|
||||
|
||||
+17
-18
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Kid NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "message.h"
|
||||
#include "npc.h"
|
||||
@@ -315,12 +314,12 @@ void sub_080621AC(KidEntity* this) {
|
||||
if (super->animIndex < 8) {
|
||||
InitializeAnimation(super,
|
||||
(super->animIndex & 0xfffffffc) +
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
GetNextFrame(super);
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
super->action = 1;
|
||||
}
|
||||
break;
|
||||
@@ -355,17 +354,17 @@ void sub_080622F4(KidEntity* this) {
|
||||
KidHeapItem item;
|
||||
|
||||
// Prepended heap item is initialized from player's current state.
|
||||
item.FIELDS.x = gPlayerEntity.x.HALF_U.HI;
|
||||
item.FIELDS.y = gPlayerEntity.y.HALF_U.HI;
|
||||
item.FIELDS.z = gPlayerEntity.z.HALF_U.HI;
|
||||
item.FIELDS.x = gPlayerEntity.base.x.HALF_U.HI;
|
||||
item.FIELDS.y = gPlayerEntity.base.y.HALF_U.HI;
|
||||
item.FIELDS.z = gPlayerEntity.base.z.HALF_U.HI;
|
||||
item.FIELDS.framestate = gPlayerState.framestate;
|
||||
item.FIELDS.animationState = gPlayerEntity.animationState;
|
||||
item.FIELDS.collisionLayer = gPlayerEntity.collisionLayer;
|
||||
item.FIELDS.animationState = gPlayerEntity.base.animationState;
|
||||
item.FIELDS.collisionLayer = gPlayerEntity.base.collisionLayer;
|
||||
|
||||
heapPtr = super->myHeap;
|
||||
if (heapPtr->FIELDS.framestate == 0x16 && item.FIELDS.framestate != 0x16) {
|
||||
dx = super->x.HALF.HI - gPlayerEntity.x.HALF.HI;
|
||||
dy = super->y.HALF.HI - gPlayerEntity.y.HALF.HI;
|
||||
dx = super->x.HALF.HI - gPlayerEntity.base.x.HALF.HI;
|
||||
dy = super->y.HALF.HI - gPlayerEntity.base.y.HALF.HI;
|
||||
|
||||
if (dx < 0)
|
||||
dx = -dx;
|
||||
@@ -397,7 +396,7 @@ void sub_080622F4(KidEntity* this) {
|
||||
KID_HEAP_SHIFT_RIGHT;
|
||||
animIndex = 0x4;
|
||||
} else {
|
||||
dist = sub_080041E8(gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, (u16)heapPtr->FIELDS.x,
|
||||
dist = sub_080041E8(gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI, (u16)heapPtr->FIELDS.x,
|
||||
(u16)heapPtr->FIELDS.y);
|
||||
dist = ((u32)dist) >> 0x4;
|
||||
if (dist > 0x18) {
|
||||
@@ -467,20 +466,20 @@ void sub_0806252C(Entity* this) {
|
||||
s32 r10;
|
||||
FORCE_REGISTER(s32 x, r12);
|
||||
|
||||
r1 = gPlayerEntity.x.HALF_U.HI;
|
||||
r1 = gPlayerEntity.base.x.HALF_U.HI;
|
||||
r3 = 0xffff0000;
|
||||
r0 = r3;
|
||||
r0 &= r5;
|
||||
r0 |= r1;
|
||||
|
||||
r1 = gPlayerEntity.y.HALF_U.HI;
|
||||
r1 = gPlayerEntity.base.y.HALF_U.HI;
|
||||
r1 <<= 0x10;
|
||||
r2 = 0x0000ffff;
|
||||
r0 &= r2;
|
||||
r0 |= r1;
|
||||
r5 = r0;
|
||||
|
||||
r0 = gPlayerEntity.z.HALF_U.HI;
|
||||
r0 = gPlayerEntity.base.z.HALF_U.HI;
|
||||
r3 &= r6;
|
||||
r3 |= r0;
|
||||
|
||||
@@ -490,7 +489,7 @@ void sub_0806252C(Entity* this) {
|
||||
r2 &= r3;
|
||||
r2 |= r0;
|
||||
|
||||
r1 = gPlayerEntity.animationState;
|
||||
r1 = gPlayerEntity.base.animationState;
|
||||
r0 = 0x3f;
|
||||
r1 &= r0;
|
||||
r1 <<= 0x18;
|
||||
@@ -498,15 +497,15 @@ void sub_0806252C(Entity* this) {
|
||||
r0 &= r2;
|
||||
r0 |= r1;
|
||||
|
||||
r1 = gPlayerEntity.collisionLayer;
|
||||
r1 = gPlayerEntity.base.collisionLayer;
|
||||
r1 <<= 0x1e;
|
||||
r2 = 0x3fffffff;
|
||||
r0 &= r2;
|
||||
r0 |= r1;
|
||||
r6 = r0;
|
||||
|
||||
r10 = r0 = gPlayerEntity.x.HALF.HI - this->x.HALF.HI;
|
||||
r8 = r0 = gPlayerEntity.y.HALF.HI - this->y.HALF.HI;
|
||||
r10 = r0 = gPlayerEntity.base.x.HALF.HI - this->x.HALF.HI;
|
||||
r8 = r0 = gPlayerEntity.base.y.HALF.HI - this->y.HALF.HI;
|
||||
|
||||
r10 = FixedDiv(r10, KID_HEAP_COUNT);
|
||||
r8 = FixedDiv(r8, KID_HEAP_COUNT);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief King Daltus NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
@@ -38,7 +37,8 @@ void KingDaltus(KingDaltusEntity* this) {
|
||||
if (super->interactType == INTERACTION_FUSE) {
|
||||
super->interactType = INTERACTION_NONE;
|
||||
super->action = 2;
|
||||
InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitAnimationForceUpdate(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
InitializeNPCFusion(super);
|
||||
}
|
||||
scriptedActionFuncs[super->action](this);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief King Gustaf NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "screen.h"
|
||||
@@ -16,7 +15,7 @@ void KingGustaf(Entity* this) {
|
||||
this->action++;
|
||||
this->spriteRendering.alphaBlend = 1;
|
||||
this->collisionLayer = 2;
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
SetEntityPriority(this, PRIO_MESSAGE);
|
||||
InitScriptForNPC(this);
|
||||
gScreen.controls.layerFXControl = 0x3f40;
|
||||
gScreen.controls.alphaBlend = 0x1000;
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Librari NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "item.h"
|
||||
#include "npc.h"
|
||||
@@ -22,7 +21,7 @@ void Librari(LibrariEntity* this) {
|
||||
super->animationState = super->timer;
|
||||
this->fusionOffer = GetFusionToOffer(super);
|
||||
AddInteractableWhenBigFuser(super, this->fusionOffer);
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
InitScriptForNPC(super);
|
||||
break;
|
||||
case 1:
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Librarians NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Mailbox NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "effects.h"
|
||||
#include "entity.h"
|
||||
#include "message.h"
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Malon NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "npc.h"
|
||||
#include "script.h"
|
||||
@@ -63,7 +62,7 @@ void sub_080658BC(MalonEntity* this) {
|
||||
if (super->interactType == INTERACTION_FUSE) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitAnimationForceUpdate(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
InitializeNPCFusion(super);
|
||||
} else {
|
||||
ExecuteScriptAndHandleAnimation(super, NULL);
|
||||
|
||||
+3
-3
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Mama NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "npc.h"
|
||||
#include "save.h"
|
||||
@@ -40,7 +39,8 @@ void Mama(MamaEntity* this) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
this->animIndex = super->animIndex;
|
||||
InitializeAnimation(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitializeAnimation(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
InitializeNPCFusion(super);
|
||||
} else {
|
||||
ExecuteScriptForEntity(super, NULL);
|
||||
@@ -62,7 +62,7 @@ bool32 sub_0806C454(Entity* this) {
|
||||
if (!LoadExtraSpriteData(this, gUnk_08113754)) {
|
||||
return FALSE;
|
||||
} else {
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
SetEntityPriority(this, PRIO_MESSAGE);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Marcy NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
@@ -14,7 +13,7 @@
|
||||
void Marcy(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action++;
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
SetEntityPriority(this, PRIO_MESSAGE);
|
||||
sub_0807DD64(this);
|
||||
}
|
||||
ExecuteScriptAndHandleAnimation(this, NULL);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Mayor Hagen NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "item.h"
|
||||
@@ -24,7 +23,7 @@ void MayorHagen(MayorHagenEntity* this) {
|
||||
super->action = 1;
|
||||
this->animIndex = 0;
|
||||
this->fusionOffer = GetFusionToOffer(super);
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
InitScriptForNPC(super);
|
||||
break;
|
||||
case 1:
|
||||
@@ -33,8 +32,8 @@ void MayorHagen(MayorHagenEntity* this) {
|
||||
super->action = v;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
this->animIndex = super->animIndex;
|
||||
InitAnimationForceUpdate(super,
|
||||
4 + GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitAnimationForceUpdate(
|
||||
super, 4 + GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
InitializeNPCFusion(super);
|
||||
break;
|
||||
}
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Melari NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "item.h"
|
||||
#include "npc.h"
|
||||
|
||||
@@ -78,7 +77,7 @@ void sub_08068780(Entity* this) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.draw = TRUE;
|
||||
this->animationState = this->type;
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
SetEntityPriority(this, PRIO_MESSAGE);
|
||||
InitScriptForNPC(this);
|
||||
break;
|
||||
case 1:
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Milk Cart NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "npc.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Minish Ezlo NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "npc.h"
|
||||
#include "script.h"
|
||||
@@ -33,7 +32,7 @@ void MinishEzlo(Entity* this) {
|
||||
}
|
||||
this->action++;
|
||||
this->animationState = this->timer * 2;
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
SetEntityPriority(this, PRIO_MESSAGE);
|
||||
InitScriptForNPC(this);
|
||||
}
|
||||
ExecuteScriptForEntity(this, NULL);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Minister Potho NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "item.h"
|
||||
@@ -79,8 +78,8 @@ void sub_08066864(MinisterPothoEntity* this) {
|
||||
if (super->interactType == INTERACTION_FUSE) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
InitAnimationForceUpdate(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitAnimationForceUpdate(
|
||||
super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
InitializeNPCFusion(super);
|
||||
} else {
|
||||
ExecuteScriptAndHandleAnimation(super, NULL);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Moblin Lady NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "npc.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Mountain Minish NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
@@ -126,7 +125,7 @@ void sub_08067EF0(MountainMinishEntity* this) {
|
||||
super->spriteSettings.draw = 1;
|
||||
super->animationState = super->type;
|
||||
this->animIndex = 0;
|
||||
SetDefaultPriority(super, 2);
|
||||
SetEntityPriority(super, 2);
|
||||
InitScriptForNPC(super);
|
||||
InitializeAnimation(super, gUnk_08111304[super->type2]);
|
||||
break;
|
||||
@@ -135,7 +134,8 @@ void sub_08067EF0(MountainMinishEntity* this) {
|
||||
super->action = 3;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
this->animIndex = super->animIndex;
|
||||
InitializeAnimation(super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitializeAnimation(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
InitializeNPCFusion(super);
|
||||
} else {
|
||||
ExecuteScriptForEntity(super, 0);
|
||||
@@ -144,13 +144,13 @@ void sub_08067EF0(MountainMinishEntity* this) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
InitializeAnimation(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
sub_08068190(super);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if ((gMessage.doTextBox & 0x7f) != 0)
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) != 0)
|
||||
break;
|
||||
super->action = 1;
|
||||
InitializeAnimation(super, (super->animationState >> 1) + 4);
|
||||
|
||||
+3
-4
@@ -5,7 +5,6 @@
|
||||
*
|
||||
* @brief Mutoh NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "item.h"
|
||||
@@ -36,7 +35,7 @@ void Mutoh(MutohEntity* this) {
|
||||
if (LoadExtraSpriteData(super, gUnk_08110C00)) {
|
||||
super->action = 1;
|
||||
super->spriteSettings.draw = TRUE;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
InitScriptForNPC(super);
|
||||
}
|
||||
break;
|
||||
@@ -44,8 +43,8 @@ void Mutoh(MutohEntity* this) {
|
||||
if (super->interactType == INTERACTION_FUSE) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
InitAnimationForceUpdate(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)) + 4);
|
||||
InitAnimationForceUpdate(
|
||||
super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)) + 4);
|
||||
InitializeNPCFusion(super);
|
||||
} else {
|
||||
ExecuteScriptAndHandleAnimation(super, NULL);
|
||||
|
||||
+2
-3
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Nayru NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "kinstone.h"
|
||||
#include "npc.h"
|
||||
@@ -27,8 +26,8 @@ void Nayru(NayruEntity* this) {
|
||||
super->interactType = INTERACTION_NONE;
|
||||
InitializeNPCFusion(super);
|
||||
this->animIndex = super->animIndex;
|
||||
InitAnimationForceUpdate(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitAnimationForceUpdate(
|
||||
super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
} else {
|
||||
ExecuteScriptAndHandleAnimation(super, NULL);
|
||||
}
|
||||
|
||||
+14
-15
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief NPC 23
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "message.h"
|
||||
@@ -52,7 +51,7 @@ void sub_080662F8(NPC23Entity* this) {
|
||||
this->unk_80 = super->y.HALF.HI;
|
||||
this->unk_86 = 0;
|
||||
this->unk_82 = super->timer;
|
||||
super->parent = &gPlayerEntity;
|
||||
super->parent = &gPlayerEntity.base;
|
||||
this->unk_84 = 0;
|
||||
sub_08066490(this, super->parent);
|
||||
AddInteractableWhenBigObject(super);
|
||||
@@ -87,7 +86,7 @@ void nullsub_110(NPC23Entity* this) {
|
||||
|
||||
void sub_080663D4(NPC23Entity* this) {
|
||||
if (super->x.HALF.HI == this->unk_7e - 8) {
|
||||
if (gPlayerEntity.action != PLAYER_ROOM_EXIT) {
|
||||
if (gPlayerEntity.base.action != PLAYER_ROOM_EXIT) {
|
||||
super->action = 4;
|
||||
super->direction = 0;
|
||||
super->speed = 0;
|
||||
@@ -101,7 +100,7 @@ void sub_080663D4(NPC23Entity* this) {
|
||||
}
|
||||
ProcessMovement0(super);
|
||||
}
|
||||
sub_08078B48();
|
||||
PausePlayer();
|
||||
GetNextFrame(super);
|
||||
}
|
||||
|
||||
@@ -110,14 +109,14 @@ void sub_0806643C(NPC23Entity* this) {
|
||||
super->action = 5;
|
||||
gRoomControls.camera_target = NULL;
|
||||
sub_08078AC0(0x40, 0, 0);
|
||||
gPlayerEntity.animationState = 0;
|
||||
gPlayerEntity.direction = 0;
|
||||
gPlayerEntity.base.animationState = 0;
|
||||
gPlayerEntity.base.direction = 0;
|
||||
}
|
||||
GetNextFrame(super);
|
||||
}
|
||||
|
||||
void sub_08066474(NPC23Entity* this) {
|
||||
if (gPlayerEntity.action != PLAYER_ROOM_EXIT) {
|
||||
if (gPlayerEntity.base.action != PLAYER_ROOM_EXIT) {
|
||||
gPauseMenuOptions.disabled = 0;
|
||||
}
|
||||
}
|
||||
@@ -160,9 +159,9 @@ void sub_08066490(NPC23Entity* this, Entity* entity) {
|
||||
|
||||
bool32 sub_0806650C(NPC23Entity* this) {
|
||||
u32 dir = 0;
|
||||
s32 px = gPlayerEntity.x.HALF_U.HI;
|
||||
s32 px = gPlayerEntity.base.x.HALF_U.HI;
|
||||
s32 px2 = px;
|
||||
s32 py = gPlayerEntity.y.HALF_U.HI;
|
||||
s32 py = gPlayerEntity.base.y.HALF_U.HI;
|
||||
|
||||
if (py < this->unk_80 + 16) {
|
||||
dir = 4;
|
||||
@@ -174,17 +173,17 @@ bool32 sub_0806650C(NPC23Entity* this) {
|
||||
dir = 6;
|
||||
}
|
||||
if (dir == 0) {
|
||||
gPlayerEntity.speed = 0;
|
||||
gPlayerEntity.base.speed = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (gPlayerEntity.action != PLAYER_ROOM_EXIT) {
|
||||
if (gPlayerEntity.base.action != PLAYER_ROOM_EXIT) {
|
||||
if (dir == 0) {
|
||||
return 0;
|
||||
}
|
||||
sub_08078AC0(8, 0, 0);
|
||||
gPlayerEntity.animationState = dir;
|
||||
gPlayerEntity.direction = Direction8FromAnimationState(dir);
|
||||
gPlayerEntity.base.animationState = dir;
|
||||
gPlayerEntity.base.direction = Direction8FromAnimationState(dir);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -198,11 +197,11 @@ void sub_08066570(Entity* this) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->action == 3 || !sub_0806FC80(this, &gPlayerEntity, 0x50)) {
|
||||
if (this->action == 3 || !sub_0806FC80(this, &gPlayerEntity.base, 0x50)) {
|
||||
return;
|
||||
}
|
||||
|
||||
direction = GetFacingDirection(this, &gPlayerEntity);
|
||||
direction = GetFacingDirection(this, &gPlayerEntity.base);
|
||||
cond = TRUE;
|
||||
|
||||
dir2 = (direction & DirectionWest);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief NPC 26
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "npc.h"
|
||||
|
||||
|
||||
+2
-3
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief NPC 4E
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
@@ -187,8 +186,8 @@ Item NPC4E_GetItemWithSwordUpgraded(Item itemId) {
|
||||
}
|
||||
|
||||
void NPC4E_SaveEquippedItems(NPC4EEntity* this) {
|
||||
this->unk_68 = gSave.stats.itemButtons[SLOT_A];
|
||||
this->unk_69 = gSave.stats.itemButtons[SLOT_B];
|
||||
this->unk_68 = gSave.stats.equipped[SLOT_A];
|
||||
this->unk_69 = gSave.stats.equipped[SLOT_B];
|
||||
}
|
||||
|
||||
void NPC4E_RestoreEquippedItems(NPC4EEntity* this) {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief NPC 4F
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "npc.h"
|
||||
|
||||
void NPC4F(Entity* this) {
|
||||
|
||||
+17
-18
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief NPC 5
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "collision.h"
|
||||
#include "functions.h"
|
||||
#include "hitbox.h"
|
||||
@@ -98,7 +97,7 @@ void CreateZeldaFollower(void) {
|
||||
if (CheckGlobalFlag(ZELDA_CHASE) != 0) {
|
||||
npc = CreateNPC(ZELDA_FOLLOWER, 0, 0);
|
||||
if (npc != NULL) {
|
||||
CopyPosition(&gPlayerEntity, npc);
|
||||
CopyPosition(&gPlayerEntity.base, npc);
|
||||
npc->flags |= ENT_PERSIST;
|
||||
npc->animationState = GetAnimationState(npc);
|
||||
}
|
||||
@@ -126,8 +125,8 @@ void sub_08060A00(NPC5Entity* this) {
|
||||
if (super->action != 0) {
|
||||
if (((((UnkHeap*)super->myHeap)->unk_0) & 4) == 0) {
|
||||
((UnkHeap*)super->myHeap)->unk_0 |= 4;
|
||||
((UnkHeap*)super->myHeap)->unk_5 = (gPlayerEntity.x.HALF.HI & 0xfff0) + 8;
|
||||
((UnkHeap*)super->myHeap)->unk_6 = (gPlayerEntity.y.HALF.HI & 0xfff0) + 8;
|
||||
((UnkHeap*)super->myHeap)->unk_5 = (gPlayerEntity.base.x.HALF.HI & 0xfff0) + 8;
|
||||
((UnkHeap*)super->myHeap)->unk_6 = (gPlayerEntity.base.y.HALF.HI & 0xfff0) + 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -137,12 +136,12 @@ void sub_08060A00(NPC5Entity* this) {
|
||||
}
|
||||
|
||||
if (super->action != 0) {
|
||||
((UnkHeap*)super->myHeap)->unk_1 = gPlayerEntity.x.HALF.HI;
|
||||
((UnkHeap*)super->myHeap)->unk_2 = gPlayerEntity.y.HALF.HI;
|
||||
((UnkHeap*)super->myHeap)->unk_1 = gPlayerEntity.base.x.HALF.HI;
|
||||
((UnkHeap*)super->myHeap)->unk_2 = gPlayerEntity.base.y.HALF.HI;
|
||||
}
|
||||
if (this->unk_74 != gRoomControls.room) {
|
||||
this->unk_74 = gRoomControls.room;
|
||||
CopyPosition(&gPlayerEntity, super);
|
||||
CopyPosition(&gPlayerEntity.base, super);
|
||||
super->action = 1;
|
||||
super->spriteSettings.draw = 1;
|
||||
super->speed = 0x120;
|
||||
@@ -184,7 +183,7 @@ void sub_08060AE0(NPC5Entity* this) {
|
||||
void sub_08060B5C(NPC5Entity* this) {
|
||||
if (sub_08061230(this) == 0) {
|
||||
if ((sub_08060F80(super) == 0) &&
|
||||
(((GetFacingDirection(super, &gPlayerEntity) + (super->animationState * -4) + 4) & 0x1f)) < 9) {
|
||||
(((GetFacingDirection(super, &gPlayerEntity.base) + (super->animationState * -4) + 4) & 0x1f)) < 9) {
|
||||
super->action = 2;
|
||||
super->subtimer = 0;
|
||||
return;
|
||||
@@ -229,8 +228,8 @@ void sub_08060BA0(NPC5Entity* this) {
|
||||
}
|
||||
|
||||
} else {
|
||||
if (sub_08060FD0(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI) != 0) {
|
||||
sub_08061090(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI);
|
||||
if (sub_08060FD0(super, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI) != 0) {
|
||||
sub_08061090(this, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI);
|
||||
sub_08061170(this);
|
||||
((UnkHeap*)super->myHeap)->unk_0 &= 0xf5;
|
||||
} else {
|
||||
@@ -259,7 +258,7 @@ void sub_08060BA0(NPC5Entity* this) {
|
||||
}
|
||||
} else {
|
||||
((UnkHeap*)super->myHeap)->unk_0 &= 0xfd;
|
||||
sub_08061464(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI);
|
||||
sub_08061464(this, gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -317,7 +316,7 @@ void sub_08060E34(NPC5Entity* this) {
|
||||
UpdateAnimationSingleFrame(super);
|
||||
if ((super->frame & ANIM_DONE) != 0) {
|
||||
super->action = 2;
|
||||
super->animationState = DirectionToAnimationState(GetFacingDirection(super, &gPlayerEntity)) * 2;
|
||||
super->animationState = DirectionToAnimationState(GetFacingDirection(super, &gPlayerEntity.base)) * 2;
|
||||
sub_08060E70(this, 8);
|
||||
}
|
||||
}
|
||||
@@ -345,7 +344,7 @@ void sub_08060EDC(NPC5Entity* this) {
|
||||
if (((u32)super->animIndex - 0x20 < 0x10) && ((super->frame & ANIM_DONE) == 0)) {
|
||||
UpdateAnimationSingleFrame(super);
|
||||
} else {
|
||||
tmp = GetFacingDirection(super, &gPlayerEntity) + super->animationState * -4;
|
||||
tmp = GetFacingDirection(super, &gPlayerEntity.base) + super->animationState * -4;
|
||||
if (((tmp + 3) & 0x1f) >= 7) {
|
||||
if ((tmp & 0x1f) < 0x10) {
|
||||
InitAnimationForceUpdate(super, super->animationState + 0x20);
|
||||
@@ -366,12 +365,12 @@ void sub_08060EDC(NPC5Entity* this) {
|
||||
}
|
||||
}
|
||||
u32 sub_08060F80(Entity* this) {
|
||||
if (sub_08060FD0(this, (s32)gPlayerEntity.x.HALF.HI, (s32)gPlayerEntity.y.HALF.HI) == 0) {
|
||||
if (sub_08060FD0(this, (s32)gPlayerEntity.base.x.HALF.HI, (s32)gPlayerEntity.base.y.HALF.HI) == 0) {
|
||||
return 0;
|
||||
}
|
||||
((UnkHeap*)this->myHeap)->unk_0 &= 0xfb;
|
||||
if (PointInsideRadius(gPlayerEntity.x.HALF.HI - this->x.HALF.HI, gPlayerEntity.y.HALF.HI - this->y.HALF.HI,
|
||||
((UnkHeap*)this->myHeap)->unk_0b) != 0) {
|
||||
if (PointInsideRadius(gPlayerEntity.base.x.HALF.HI - this->x.HALF.HI,
|
||||
gPlayerEntity.base.y.HALF.HI - this->y.HALF.HI, ((UnkHeap*)this->myHeap)->unk_0b) != 0) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -418,8 +417,8 @@ void sub_08061090(NPC5Entity* this, u32 a, u32 b) {
|
||||
s32 sqrDist;
|
||||
u32 tmp;
|
||||
|
||||
xDist = gPlayerEntity.x.HALF.HI - super->x.HALF.HI;
|
||||
yDist = gPlayerEntity.y.HALF.HI - super->y.HALF.HI;
|
||||
xDist = gPlayerEntity.base.x.HALF.HI - super->x.HALF.HI;
|
||||
yDist = gPlayerEntity.base.y.HALF.HI - super->y.HALF.HI;
|
||||
sqrDist = (xDist * xDist) + (yDist * yDist);
|
||||
if (sqrDist < 0x900) {
|
||||
super->speed = 0x120;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief NPC 58
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "npc.h"
|
||||
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief NPC 9
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "message.h"
|
||||
#include "npc.h"
|
||||
@@ -51,7 +50,7 @@ void sub_08062B48(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08062B70(Entity* this) {
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
InitializeAnimation(this, 2);
|
||||
this->action = 1;
|
||||
RevokePriority(this);
|
||||
|
||||
+4
-5
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Percy NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
@@ -85,7 +84,7 @@ void sub_0806B41C(PercyEntity* this) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
InitializeAnimation(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)) + 4);
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)) + 4);
|
||||
idx = GetFuserId(super);
|
||||
tmp = gUnk_08001A7C[idx];
|
||||
if (this->fusionOffer == 33)
|
||||
@@ -149,13 +148,13 @@ void sub_0806B540(Entity* this) {
|
||||
SetLocalFlag(0x3f);
|
||||
break;
|
||||
case 1:
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
context->unk_18 = 2;
|
||||
MessageNoOverlap(TEXT_INDEX(TEXT_PERCY, 0x15), this);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
context->unk_18 = 3;
|
||||
if (gSave.stats.hasAllFigurines != 0) {
|
||||
InitItemGetSequence(ITEM_RUPEE100, 0, 0);
|
||||
@@ -166,7 +165,7 @@ void sub_0806B540(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if ((gPlayerEntity.action != PLAYER_ITEMGET)) {
|
||||
if ((gPlayerEntity.base.action != PLAYER_ITEMGET)) {
|
||||
context->wait = 0x2d;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Phonograph NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "common.h"
|
||||
#include "entity.h"
|
||||
#include "fileselect.h"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Picolyte Bottle NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "hitbox.h"
|
||||
|
||||
+3
-4
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Pina NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "message.h"
|
||||
@@ -74,7 +73,7 @@ void sub_08063AC0(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08063B44(Entity* this) {
|
||||
u8 tmp = gMessage.doTextBox & 0x7f;
|
||||
u8 tmp = gMessage.state & MESSAGE_ACTIVE;
|
||||
if (tmp == 0) {
|
||||
this->action = 1;
|
||||
this->subtimer = tmp;
|
||||
@@ -94,8 +93,8 @@ void sub_08063B68(PinaEntity* this) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
this->animIndex = super->animIndex;
|
||||
InitAnimationForceUpdate(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)) + 4);
|
||||
InitAnimationForceUpdate(
|
||||
super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)) + 4);
|
||||
InitializeNPCFusion(super);
|
||||
} else {
|
||||
ExecuteScriptForEntity(super, NULL);
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Pita NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "item.h"
|
||||
#include "npc.h"
|
||||
|
||||
@@ -28,7 +27,7 @@ void Pita(PitaEntity* this) {
|
||||
};
|
||||
if (super->action == 0) {
|
||||
super->action++;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
SortEntityAbove(super, super);
|
||||
super->hitbox = (Hitbox*)&gUnk_0810C428;
|
||||
sub_0807DD64(super);
|
||||
|
||||
+11
-12
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Postman NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "npc.h"
|
||||
@@ -234,7 +233,7 @@ void sub_080604DC(Entity* this) {
|
||||
ent = CreateFx(this, FX_DASH, 0x40);
|
||||
if (ent != NULL) {
|
||||
ent->y.HALF.HI++;
|
||||
SetDefaultPriority(ent, 3);
|
||||
SetEntityPriority(ent, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -257,15 +256,15 @@ void sub_08060528(PostmanEntity* this) {
|
||||
super->action = 3;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
InitializeNPCFusion(super);
|
||||
InitAnimationForceUpdate(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitAnimationForceUpdate(
|
||||
super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
} else {
|
||||
if (super->interactType != INTERACTION_NONE) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
sub_080606D8(super);
|
||||
InitAnimationForceUpdate(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitAnimationForceUpdate(
|
||||
super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
} else {
|
||||
ExecuteScriptAndHandleAnimation(super, NULL);
|
||||
}
|
||||
@@ -273,7 +272,7 @@ void sub_08060528(PostmanEntity* this) {
|
||||
break;
|
||||
case 2:
|
||||
UpdateAnimationSingleFrame(super);
|
||||
if ((gMessage.doTextBox & 0x7f) != 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) != 0) {
|
||||
break;
|
||||
}
|
||||
super->action = 1;
|
||||
@@ -303,7 +302,7 @@ void sub_08060528(PostmanEntity* this) {
|
||||
Postman_MakeInteractable(this);
|
||||
}
|
||||
if (super->z.WORD >= 0 &&
|
||||
((gPlayerEntity.collisionLayer == 0 || (super->collisionLayer == gPlayerEntity.collisionLayer)))) {
|
||||
((gPlayerEntity.base.collisionLayer == 0 || (super->collisionLayer == gPlayerEntity.base.collisionLayer)))) {
|
||||
sub_0806ED78(super);
|
||||
}
|
||||
sub_0800451C(super);
|
||||
@@ -407,13 +406,13 @@ void sub_0806076C(PostmanEntity* this, ScriptExecutionContext* context) {
|
||||
void sub_080608E4(PostmanEntity* this, ScriptExecutionContext* context) {
|
||||
context->condition = 0;
|
||||
if (super->z.WORD >= 0) {
|
||||
if ((super->collisionLayer != 1 || gPlayerEntity.collisionLayer != 2) &&
|
||||
(super->collisionLayer != 2 || gPlayerEntity.collisionLayer != 1)) {
|
||||
if ((super->collisionLayer != 1 || gPlayerEntity.base.collisionLayer != 2) &&
|
||||
(super->collisionLayer != 2 || gPlayerEntity.base.collisionLayer != 1)) {
|
||||
const Rect* ptr = &gUnk_0810AA70[context->intVariable][super->animationState >> 1];
|
||||
u32 x = super->x.HALF.HI + ptr->x;
|
||||
u32 y = super->y.HALF.HI + ptr->y;
|
||||
x = gPlayerEntity.x.HALF.HI - x;
|
||||
y = gPlayerEntity.y.HALF.HI - y;
|
||||
x = gPlayerEntity.base.x.HALF.HI - x;
|
||||
y = gPlayerEntity.base.y.HALF.HI - y;
|
||||
x += ptr->width;
|
||||
y += ptr->height;
|
||||
if (ptr->width * 2 > x && ptr->height * 2 > y) {
|
||||
|
||||
+10
-11
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Rem NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
#include "npc.h"
|
||||
@@ -76,7 +75,7 @@ void sub_0806a370(RemEntity* this) {
|
||||
void sub_0806A3D8(RemEntity* this) {
|
||||
super->action = 1;
|
||||
super->timer = 180;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
sub_0806A8C8(super);
|
||||
this->context = StartCutscene(super, &script_Rem);
|
||||
ExecuteScriptAndHandleAnimation(super, NULL);
|
||||
@@ -297,7 +296,7 @@ void sub_0806A830(RemEntity* this) {
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
InitializeAnimation(super, 0x14);
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
}
|
||||
if ((gActiveScriptInfo.syncFlags & 0x200) != 0) {
|
||||
DeleteThisEntity();
|
||||
@@ -316,7 +315,7 @@ void sub_0806A890(RemEntity* this) {
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
InitializeAnimation(super, 0x15);
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
}
|
||||
GetNextFrame(super);
|
||||
if ((super->frame & ANIM_DONE) != 0) {
|
||||
@@ -435,18 +434,18 @@ void sub_0806AA50(Entity* this, ScriptExecutionContext* context) {
|
||||
MessageNoOverlap(messageIndex, this);
|
||||
switch (context->intVariable) {
|
||||
case 0:
|
||||
gRoomVars.entities[0] = this;
|
||||
gRoomVars.puzzleEntities[0] = this;
|
||||
PrependEntityToList(this, NPC);
|
||||
this->zVelocity = Q_16_16(1.5);
|
||||
break;
|
||||
case 1:
|
||||
pEnt = FindNextDuplicateID(gRoomVars.entities[0], NPC);
|
||||
gRoomVars.entities[1] = pEnt;
|
||||
pEnt = FindNextDuplicateID(gRoomVars.puzzleEntities[0], NPC);
|
||||
gRoomVars.puzzleEntities[1] = pEnt;
|
||||
pEnt->zVelocity = Q_16_16(1.5);
|
||||
break;
|
||||
case 2:
|
||||
pEnt = FindNextDuplicateID(gRoomVars.entities[1], NPC);
|
||||
gRoomVars.entities[2] = pEnt;
|
||||
pEnt = FindNextDuplicateID(gRoomVars.puzzleEntities[1], NPC);
|
||||
gRoomVars.puzzleEntities[2] = pEnt;
|
||||
pEnt->zVelocity = Q_16_16(1.5);
|
||||
break;
|
||||
}
|
||||
@@ -457,7 +456,7 @@ void sub_0806AA50(Entity* this, ScriptExecutionContext* context) {
|
||||
context->unk_18 = 1;
|
||||
break;
|
||||
case 1:
|
||||
pEnt = gRoomVars.entities[context->intVariable];
|
||||
pEnt = gRoomVars.puzzleEntities[context->intVariable];
|
||||
if (pEnt->z.HALF.HI < 0) {
|
||||
break;
|
||||
}
|
||||
@@ -475,7 +474,7 @@ void sub_0806AA50(Entity* this, ScriptExecutionContext* context) {
|
||||
}
|
||||
|
||||
void sub_0806AB74(Entity* this) {
|
||||
gRoomVars.field_0x3 = 1;
|
||||
gRoomVars.remFlagUnused = TRUE;
|
||||
if ((s32)(this->y.HALF.HI - (u32)gRoomControls.origin_y) < 0xa8) {
|
||||
this->y.HALF.HI = gRoomControls.origin_y + 0xa8;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Simon NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Sitting Person NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "npc.h"
|
||||
#include "functions.h"
|
||||
|
||||
@@ -152,7 +151,7 @@ void sub_080637B8(SittingPersonEntity* this) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
this->animIndex = super->animIndex;
|
||||
tmp = GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity));
|
||||
tmp = GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base));
|
||||
tmp += super->spriteSettings.flipX ? 4 : 0;
|
||||
InitializeAnimation(super, tmp);
|
||||
InitializeNPCFusion(super);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Small Town Minish NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Smith NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "npc.h"
|
||||
|
||||
@@ -49,7 +48,7 @@ void Smith(SmithEntity* this) {
|
||||
super->action = 4;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
index = (super->animIndex == 0xc) ? 8 : 0;
|
||||
index += GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity));
|
||||
index += GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base));
|
||||
InitAnimationForceUpdate(super, index);
|
||||
InitializeNPCFusion(super);
|
||||
}
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Stamp NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "effects.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
@@ -64,7 +63,7 @@ void sub_08062C24(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08062C54(Entity* this) {
|
||||
if ((gMessage.doTextBox & 127) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
this->action = 1;
|
||||
InitializeAnimation(this, 0);
|
||||
RevokePriority(this);
|
||||
|
||||
+8
-9
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Stockwell NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "game.h"
|
||||
@@ -59,7 +58,7 @@ void sub_08065080(StockwellEntity* this) {
|
||||
|
||||
super->action = 1;
|
||||
super->spriteSettings.draw = 1;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
InitializeAnimation(super, 4);
|
||||
AddInteractableWhenBigObject(super);
|
||||
#ifndef EU
|
||||
@@ -108,8 +107,8 @@ void sub_080650CC(StockwellEntity* this) {
|
||||
|
||||
void sub_080651AC(StockwellEntity* this) {
|
||||
GetNextFrame(super);
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
super->interactType = gMessage.doTextBox & 0x7f;
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
super->interactType = gMessage.state & MESSAGE_ACTIVE;
|
||||
super->action = 1;
|
||||
InitializeAnimation(super, 4);
|
||||
}
|
||||
@@ -164,7 +163,7 @@ void sub_0806528C(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_080652B0(Entity* this) {
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
this->subAction++;
|
||||
this->timer = 10;
|
||||
gRoomVars.animFlags = this->subtimer;
|
||||
@@ -176,7 +175,7 @@ void sub_080652E4(Entity* this) {
|
||||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
} else {
|
||||
if (gPlayerEntity.action != PLAYER_ITEMGET) {
|
||||
if (gPlayerEntity.base.action != PLAYER_ITEMGET) {
|
||||
this->subAction++;
|
||||
MessageNoOverlap(TEXT_INDEX(TEXT_STOCKWELL, 0x19), this);
|
||||
}
|
||||
@@ -184,16 +183,16 @@ void sub_080652E4(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08065314(Entity* this) {
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
this->subAction++;
|
||||
MenuFadeIn(3, 3);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08065338(Entity* this) {
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
this->action = 1;
|
||||
this->subAction = gMessage.doTextBox & 0x7f;
|
||||
this->subAction = gMessage.state & MESSAGE_ACTIVE;
|
||||
gRoomVars.animFlags = this->subtimer;
|
||||
InitializeAnimation(this, 4);
|
||||
}
|
||||
|
||||
+3
-4
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Sturgeon NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
@@ -65,8 +64,8 @@ void Sturgeon(SturgeonEntity* this) {
|
||||
if (super->interactType == INTERACTION_FUSE) {
|
||||
super->action = super->action | 0xff;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
InitAnimationForceUpdate(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitAnimationForceUpdate(
|
||||
super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
InitializeNPCFusion(super);
|
||||
} else {
|
||||
ExecuteScriptAndHandleAnimation(super, NULL);
|
||||
@@ -127,7 +126,7 @@ void sub_08064B88(SturgeonEntity* this) {
|
||||
}
|
||||
|
||||
void sub_08064C2C(SturgeonEntity* this) {
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
super->action = 1;
|
||||
InitializeAnimation(super, (u32)super->subtimer);
|
||||
}
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Syrup NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "npc.h"
|
||||
#include "object.h"
|
||||
@@ -48,7 +47,7 @@ void sub_0806A1F8(SyrupEntity* this) {
|
||||
|
||||
if (LoadExtraSpriteData(super, paVar2)) {
|
||||
super->action = 1;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
InitScriptForNPC(super);
|
||||
InitializeAnimation(super, 0);
|
||||
}
|
||||
|
||||
+2
-3
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Talon NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
#include "npc.h"
|
||||
@@ -119,7 +118,7 @@ void sub_08065680(TalonEntity* this) {
|
||||
}
|
||||
|
||||
void sub_080656A4(TalonEntity* this) {
|
||||
if ((gMessage.doTextBox & 0x7F) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
super->action = this->unk_69;
|
||||
InitAnimationForceUpdate(super, this->unk_6a);
|
||||
}
|
||||
@@ -153,7 +152,7 @@ void sub_080656D4(TalonEntity* this) {
|
||||
void sub_0806574C(TalonEntity* this) {
|
||||
u32 j;
|
||||
|
||||
j = (super->animIndex & ~3) + GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity));
|
||||
j = (super->animIndex & ~3) + GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base));
|
||||
if (super->animIndex != j) {
|
||||
InitAnimationForceUpdate(super, j);
|
||||
}
|
||||
|
||||
+3
-4
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Teachers NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "npc.h"
|
||||
#include "player.h"
|
||||
@@ -30,7 +29,7 @@ void Teachers(TeachersEntity* this) {
|
||||
super->spriteSettings.draw = TRUE;
|
||||
super->animationState = super->timer;
|
||||
this->animIndex = 0;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
InitScriptForNPC(super);
|
||||
}
|
||||
break;
|
||||
@@ -39,8 +38,8 @@ void Teachers(TeachersEntity* this) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
this->animIndex = super->animIndex;
|
||||
InitializeAnimation(super, (super->animIndex & -4) + GetAnimationStateForDirection4(
|
||||
GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitializeAnimation(super, (super->animIndex & -4) + GetAnimationStateForDirection4(GetFacingDirection(
|
||||
super, &gPlayerEntity.base)));
|
||||
InitializeNPCFusion(super);
|
||||
} else {
|
||||
ExecuteScriptAndHandleAnimation(super, NULL);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Tingle Siblings NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
@@ -71,7 +70,7 @@ void sub_08064DE4(Entity* this) {
|
||||
this->action = 2;
|
||||
this->interactType = INTERACTION_NONE;
|
||||
InitAnimationForceUpdate(this,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(this, &gPlayerEntity)));
|
||||
GetAnimationStateForDirection4(GetFacingDirection(this, &gPlayerEntity.base)));
|
||||
InitializeNPCFusion(this);
|
||||
} else {
|
||||
ExecuteScriptAndHandleAnimation(this, NULL);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Town Minish NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "asm.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
@@ -187,7 +186,7 @@ void sub_0806ABFC(TownMinishEntity* this) {
|
||||
void sub_0806AC3C(TownMinishEntity* this) {
|
||||
if (super->animIndex <= 3) {
|
||||
s32 unk;
|
||||
Entity* link = &gPlayerEntity;
|
||||
Entity* link = &gPlayerEntity.base;
|
||||
if (EntityInRectRadius(super, link, 0x18, 0x18)) {
|
||||
unk = GetFacingDirection(super, link) & 0x1e;
|
||||
} else {
|
||||
@@ -241,18 +240,18 @@ void sub_0806ACC4(TownMinishEntity* this) {
|
||||
if (super->type2 == 10 && super->interactType) {
|
||||
super->action = 2;
|
||||
super->interactType = INTERACTION_NONE;
|
||||
InitializeAnimation(super,
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)) + 8);
|
||||
InitializeAnimation(
|
||||
super, GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)) + 8);
|
||||
sub_0806AFE8(super, this->context);
|
||||
}
|
||||
if (super->type == 1) {
|
||||
u8 idx = gPlayerEntity.animationState >> 1;
|
||||
u8 idx = gPlayerEntity.base.animationState >> 1;
|
||||
SetInteractableObjectCollision(super, 1, gUnk_081126E4[idx], &gUnk_081126D4[idx]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (gMessage.doTextBox & 0x7f)
|
||||
if (gMessage.state & MESSAGE_ACTIVE)
|
||||
break;
|
||||
|
||||
super->action = 1;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Townsperson NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
#include "npc.h"
|
||||
@@ -132,7 +131,7 @@ void sub_08061D64(TownspersonEntity* this) {
|
||||
InitializeNPCFusion(super);
|
||||
this->unk_69 = super->animIndex;
|
||||
InitializeAnimation(super, (super->animIndex & -4) +
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
} else {
|
||||
ExecuteScriptForEntity(super, NULL);
|
||||
HandleEntity0x82Actions(super);
|
||||
@@ -145,15 +144,15 @@ void sub_08061D64(TownspersonEntity* this) {
|
||||
super->interactType = INTERACTION_NONE;
|
||||
sub_08062048(super);
|
||||
this->unk_69 = super->animIndex;
|
||||
InitializeAnimation(super, (super->animIndex & -4) +
|
||||
GetAnimationStateForDirection4(GetFacingDirection(super, &gPlayerEntity)));
|
||||
InitializeAnimation(super, (super->animIndex & -4) + GetAnimationStateForDirection4(
|
||||
GetFacingDirection(super, &gPlayerEntity.base)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08061E24(TownspersonEntity* this) {
|
||||
GetNextFrame(super);
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
super->action = 1;
|
||||
InitializeAnimation(super, this->unk_69);
|
||||
}
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Vaati NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "script.h"
|
||||
@@ -42,7 +41,7 @@ void VaatiAction0(VaatiEntity* this) {
|
||||
super->spriteSettings.draw = 1;
|
||||
this->unk_68 = 0;
|
||||
this->unk_69 = 0;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
sub_0807DD64(super);
|
||||
VaatiAction1(this);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Vaati Reborn NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "npc.h"
|
||||
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Wheaton NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "npc.h"
|
||||
|
||||
void Wheaton(Entity* this) {
|
||||
@@ -12,7 +11,7 @@ void Wheaton(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action++;
|
||||
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
SetEntityPriority(this, PRIO_MESSAGE);
|
||||
SortEntityAbove(this, this);
|
||||
this->hitbox = (Hitbox*)&gUnk_0810C3C0;
|
||||
this->spriteOffsetY = 0xfe;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Wind Tribespeople NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "npc.h"
|
||||
#include "sound.h"
|
||||
@@ -78,7 +77,7 @@ void sub_0806C7D4(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0806C834(Entity* this) {
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||
--this->action;
|
||||
InitializeAnimation(this, (this->animationState / 2) + 4);
|
||||
}
|
||||
|
||||
+2
-3
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Zelda NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "npc/zelda.h"
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
@@ -32,7 +31,7 @@ void sub_08066CCC(Entity* this) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
PrependEntityToList(this, 7);
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
SetEntityPriority(this, PRIO_MESSAGE);
|
||||
InitScriptForNPC(this);
|
||||
}
|
||||
|
||||
@@ -81,7 +80,7 @@ void sub_08066D94(Entity* this) {
|
||||
SetGlobalFlag(ZELDA_CHASE);
|
||||
npc = (ZeldaFollowerEntity*)CreateNPC(ZELDA_FOLLOWER, 0, 0);
|
||||
if (npc != NULL) {
|
||||
npc->base.animationState = gPlayerEntity.animationState;
|
||||
npc->base.animationState = gPlayerEntity.base.animationState;
|
||||
npc->base.flags |= ENT_PERSIST;
|
||||
npc->base.animationState = GetAnimationState(this);
|
||||
room = gRoomControls.room;
|
||||
|
||||
+24
-25
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* @brief Zelda Follower NPC
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "npc/zelda.h"
|
||||
#include "common.h"
|
||||
#include "entity.h"
|
||||
@@ -51,7 +50,7 @@ void ZeldaFollower(ZeldaFollowerEntity* this) {
|
||||
super->animationState = 4;
|
||||
this->unk_68 = 0;
|
||||
this->unk_69 = 0;
|
||||
SetDefaultPriority(super, PRIO_MESSAGE);
|
||||
SetEntityPriority(super, PRIO_MESSAGE);
|
||||
InitAnimationForceUpdate(super, 0);
|
||||
sub_0806854C(this, NULL);
|
||||
}
|
||||
@@ -72,19 +71,19 @@ void sub_08068318(ZeldaFollowerEntity* this) {
|
||||
ZeldaFollowerItem* heapPtr;
|
||||
ZeldaFollowerItem item;
|
||||
|
||||
item.FIELDS.x = gPlayerEntity.x.HALF_U.HI;
|
||||
item.FIELDS.y = gPlayerEntity.y.HALF_U.HI;
|
||||
item.FIELDS.z = gPlayerEntity.z.HALF_U.HI;
|
||||
item.FIELDS.x = gPlayerEntity.base.x.HALF_U.HI;
|
||||
item.FIELDS.y = gPlayerEntity.base.y.HALF_U.HI;
|
||||
item.FIELDS.z = gPlayerEntity.base.z.HALF_U.HI;
|
||||
item.FIELDS.framestate = gPlayerState.framestate;
|
||||
item.FIELDS.animationState = gPlayerEntity.animationState;
|
||||
item.FIELDS.collisionLayer = gPlayerEntity.collisionLayer;
|
||||
item.FIELDS.animationState = gPlayerEntity.base.animationState;
|
||||
item.FIELDS.collisionLayer = gPlayerEntity.base.collisionLayer;
|
||||
|
||||
heapPtr = super->myHeap;
|
||||
|
||||
if ((heapPtr->FIELDS.framestate == 0xa && item.FIELDS.framestate != 0xa) ||
|
||||
(heapPtr->FIELDS.framestate == 0x16 && item.FIELDS.framestate != 0x16)) {
|
||||
super->x.HALF.HI = gPlayerEntity.x.HALF.HI;
|
||||
super->y.HALF.HI = gPlayerEntity.y.HALF.HI;
|
||||
super->x.HALF.HI = gPlayerEntity.base.x.HALF.HI;
|
||||
super->y.HALF.HI = gPlayerEntity.base.y.HALF.HI;
|
||||
super->spriteSettings.draw = 1;
|
||||
sub_08068578(super);
|
||||
}
|
||||
@@ -107,7 +106,7 @@ void sub_08068318(ZeldaFollowerEntity* this) {
|
||||
ZELDA_FOLLOWER_HEAP_SHIFT_RIGHT(super, heapPtr);
|
||||
animIndex = 0x4;
|
||||
} else {
|
||||
dist = sub_080041E8(gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, (u16)heapPtr->FIELDS.x,
|
||||
dist = sub_080041E8(gPlayerEntity.base.x.HALF.HI, gPlayerEntity.base.y.HALF.HI, (u16)heapPtr->FIELDS.x,
|
||||
(u16)heapPtr->FIELDS.y);
|
||||
dist = ((u32)dist) >> 0x4;
|
||||
if (dist > 0x18) {
|
||||
@@ -188,17 +187,17 @@ void sub_08068578(Entity* this) {
|
||||
|
||||
// first u32 (r5)
|
||||
#ifdef REWRITE_CODE
|
||||
r0 = gPlayerEntity.x.HALF_U.HI | (r5 & 0xffff0000);
|
||||
r5 = (gPlayerEntity.y.HALF_U.HI << 0x10) | (r0 & 0x0000ffff);
|
||||
r0 = gPlayerEntity.base.x.HALF_U.HI | (r5 & 0xffff0000);
|
||||
r5 = (gPlayerEntity.base.y.HALF_U.HI << 0x10) | (r0 & 0x0000ffff);
|
||||
#else
|
||||
r1 = gPlayerEntity.x.HALF_U.HI;
|
||||
r1 = gPlayerEntity.base.x.HALF_U.HI;
|
||||
|
||||
r3 = 0xffff0000;
|
||||
r0 = r3;
|
||||
r0 &= r5;
|
||||
r0 |= r1;
|
||||
|
||||
r1 = gPlayerEntity.y.HALF_U.HI;
|
||||
r1 = gPlayerEntity.base.y.HALF_U.HI;
|
||||
r1 <<= 0x10;
|
||||
r2 = 0xffff;
|
||||
r0 &= r2;
|
||||
@@ -208,12 +207,12 @@ void sub_08068578(Entity* this) {
|
||||
|
||||
// second u32 (r6)
|
||||
#ifdef REWRITE_CODE
|
||||
r3 = gPlayerEntity.z.HALF_U.HI | (r6 & 0xffff0000);
|
||||
r3 = gPlayerEntity.base.z.HALF_U.HI | (r6 & 0xffff0000);
|
||||
r2 = (gPlayerState.framestate << 0x10) | (r3 & 0xff00ffff);
|
||||
r0 = ((gPlayerEntity.animationState & 0x3f) << 0x18) | (r2 & 0xc0ffffff);
|
||||
r6 = (gPlayerEntity.collisionLayer << 0x1e) | (r0 & 0x3fffffff);
|
||||
r0 = ((gPlayerEntity.base.animationState & 0x3f) << 0x18) | (r2 & 0xc0ffffff);
|
||||
r6 = (gPlayerEntity.base.collisionLayer << 0x1e) | (r0 & 0x3fffffff);
|
||||
#else
|
||||
r0 = gPlayerEntity.z.HALF_U.HI;
|
||||
r0 = gPlayerEntity.base.z.HALF_U.HI;
|
||||
r3 &= r6;
|
||||
r3 |= r0;
|
||||
|
||||
@@ -223,7 +222,7 @@ void sub_08068578(Entity* this) {
|
||||
r2 &= r3;
|
||||
r2 |= r0;
|
||||
|
||||
r1 = gPlayerEntity.animationState;
|
||||
r1 = gPlayerEntity.base.animationState;
|
||||
r0 = 0x3f;
|
||||
r1 &= r0;
|
||||
r1 <<= 0x18;
|
||||
@@ -231,8 +230,8 @@ void sub_08068578(Entity* this) {
|
||||
r0 &= r2;
|
||||
r0 |= r1;
|
||||
|
||||
// gPlayerEntity is now at r1
|
||||
r1 = gPlayerEntity.collisionLayer;
|
||||
// gPlayerEntity.base.is now at r1
|
||||
r1 = gPlayerEntity.base.collisionLayer;
|
||||
r1 <<= 0x1e;
|
||||
r2 = 0x3fffffff;
|
||||
r0 &= r2;
|
||||
@@ -241,18 +240,18 @@ void sub_08068578(Entity* this) {
|
||||
#endif
|
||||
|
||||
#ifdef REWRITE_CODE
|
||||
r10 = gPlayerEntity.x.HALF.HI - this->x.HALF.HI;
|
||||
r10 = gPlayerEntity.base.x.HALF.HI - this->x.HALF.HI;
|
||||
#else
|
||||
r1 = gPlayerEntity.x.HALF.HI;
|
||||
r1 = gPlayerEntity.base.x.HALF.HI;
|
||||
r0 = this->x.HALF.HI;
|
||||
r0 = r1 - r0;
|
||||
r10 = r0;
|
||||
#endif
|
||||
|
||||
#ifdef REWRITE_CODE
|
||||
r8 = gPlayerEntity.y.HALF.HI - this->y.HALF.HI;
|
||||
r8 = gPlayerEntity.base.y.HALF.HI - this->y.HALF.HI;
|
||||
#else
|
||||
r1 = gPlayerEntity.y.HALF.HI;
|
||||
r1 = gPlayerEntity.base.y.HALF.HI;
|
||||
r0 = this->y.HALF.HI;
|
||||
r0 = r1 - r0;
|
||||
r8 = r0;
|
||||
|
||||
Reference in New Issue
Block a user