main npc funcs named

This commit is contained in:
theo3
2020-06-17 21:25:52 -07:00
parent 268dafde5d
commit 841a20ca2d
88 changed files with 587 additions and 512 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ extern void PlaySFX(u32);
extern void sub_0806D02C(Entity*);
extern Entity* sub_0805EB2C(u32, u32, u32, u32, u32);
void sub_0806CF18(Entity* this) {
void BigGoron(Entity* this) {
gUnk_081140D4[this->entityType.parameter1](this);
}
+2 -2
View File
@@ -42,7 +42,7 @@ extern u16 gUnk_0811172A[];
extern u32 gUnk_0300402B;
extern EntityData gUnk_080F3494;
void sub_080689C0(Entity* this) {
void BladeBrothers(Entity* this) {
if ((this->flags & 2) != 0) {
gUnk_081115D0[this->action](this);
@@ -397,7 +397,7 @@ void sub_08068F3C(Entity* this) {
}
}
void sub_08068F4C(Entity* this) {
void BladeBrothers_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
+1 -1
View File
@@ -7,7 +7,7 @@ extern void sub_08067C44();
extern void (*gCat[9])(Entity*);
// Main
void sub_080677B4(Entity* ent) {
void Cat(Entity* ent) {
gCat[ent->action](ent);
sub_08067C44(ent);
if (((ent->flags & 128) == 0) && ((ent->entityType).parameter1 != 5)) {
+1 -1
View File
@@ -3,6 +3,6 @@
extern void (*gUnk_0811423C[])(Entity*);
void sub_0806DD78(Entity* this) {
void ClothesRack(Entity* this) {
gUnk_0811423C[this->action](this);
}
+2 -2
View File
@@ -23,7 +23,7 @@ extern u32 Random();
extern u32 UpdateFuseInteraction(Entity*);
extern LinkState gLinkState;
void sub_08068F98(Entity* ent) {
void Cow(Entity* ent) {
gUnk_08111914[ent->action](ent);
sub_0806ED78(ent);
sub_0806920C(ent);
@@ -228,7 +228,7 @@ void sub_0806924C(Entity* ent) {
}
}
void sub_080692A0(Entity* ent) {
void Cow_Fusion(Entity* ent) {
if (ent->action == 0) {
ent->action++;
ent->spriteSettings.b.ss0 = 1;
+1 -1
View File
@@ -10,7 +10,7 @@ extern void sub_0807DD50(Entity*);
extern void sub_0807DD94(Entity*, u32);
extern void DoExitTransition(u32*);
void sub_0806C550(Entity* param_1)
void Emma(Entity* param_1)
{
if (param_1->action == 0) {
+2 -2
View File
@@ -10,7 +10,7 @@ void sub_08065AA4(Entity*);
extern void (*gUnk_0811006C[])(Entity*);
extern u32 gUnk_08110080[];
void sub_08065990(Entity* this) {
void Epona(Entity* this) {
gUnk_0811006C[this->action](this);
sub_08065A64(this);
sub_0806ED78(this);
@@ -88,7 +88,7 @@ void sub_08065AA4(Entity* this) {
}
}
void sub_08065B1C(Entity* this) {
void Epona_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->spriteSettings.b.ss0 = 1;
+2 -2
View File
@@ -7,7 +7,7 @@ extern void (*gUnk_08111A80[])(Entity*);
extern void (*gUnk_08111A8C[])(Entity*);
extern u8 gUnk_02033280[];
void sub_080692D0(Entity* this) {
void Goron(Entity* this) {
if (this->flags & 2) {
gUnk_08111A8C[this->action](this);
} else {
@@ -124,7 +124,7 @@ void sub_080694EC(Entity* this) {
this->field_0x80 = anim;
}
void sub_08069514(Entity* this) {
void Goron_Fusion(Entity* this) {
if (this->action == 0) {
this->action++;
this->spriteSettings.b.ss0 = 1;
+1 -1
View File
@@ -10,7 +10,7 @@ extern void CreateFx();
extern void (*gMailboxBehaviors[4])(Entity*);
void sub_080631E8(Entity* this) {
void Mailbox(Entity* this) {
gMailboxBehaviors[this->action](this);
if (this->action != 0) {
+2 -2
View File
@@ -7,7 +7,7 @@ extern Entity gLinkEntity;
extern void (*gUnk_0810FF5C[])(Entity* this);
extern void (*gUnk_0810FF64[])(Entity* this);
void sub_0806581C(Entity* this) {
void Malon(Entity* this) {
if (this->flags & 0x2) {
gUnk_0810FF64[this->action](this);
} else {
@@ -69,7 +69,7 @@ void sub_08065914(Entity* this) {
}
}
void sub_08065960(Entity* this) {
void Malon_Fusion(Entity* this) {
if (this->action == 0) {
this->action++;
this->spriteSettings.b.ss0 = 1;
+1 -1
View File
@@ -8,7 +8,7 @@ extern void UpdateAnimationSingleFrame();
extern void (*gMilkCartBehaviors[2])(Entity*);
void sub_08065B4C(Entity* ent) {
void MilkCart(Entity* ent) {
gMilkCartBehaviors[ent->action](ent);
sub_0806ED78(ent);
}
+132 -57
View File
@@ -3,61 +3,136 @@
#include "entity.h"
#include "npc.h"
//TODO: group into arrays of 3: [npc, npc_HEAD, npc_FUSION]
void (*const gNPCFunctions[])(Entity* ent) = {
DeleteEntity, NULL, NULL, sub_0805FD24, NULL, sub_0805FDC0, sub_0805FDF8, NULL,
sub_0805FFA0, sub_0805FFD8, sub_080600A8, sub_080603B4, sub_080603FC, NULL, sub_0806097C, sub_080609E8,
NULL, NULL, sub_08061B8C, sub_08061C60, sub_08062088, sub_080620C8, sub_08062834, sub_08062A60,
sub_08063CF8, sub_08063FAC, NULL, sub_08062AD8, NULL, NULL, sub_08062B98, NULL,
NULL, sub_08064508, sub_08064524, NULL, sub_08062CF0, NULL, NULL, sub_08062E20,
NULL, NULL, sub_08062E60, NULL, NULL, sub_08062F70, sub_08062FF0, NULL,
sub_080631E8, NULL, NULL, sub_080632A8, sub_080633E0, NULL, sub_08063524, NULL,
sub_0806370C, sub_08063740, sub_08063974, sub_080639E8, sub_08063A60, NULL, sub_08063CC4, sub_08063CF8,
sub_08063FAC, NULL, sub_08064508, sub_08064524, NULL, sub_08064790, NULL, sub_08064860,
sub_08064890, NULL, sub_08064960, sub_08064990, NULL, sub_08064A60, sub_08064A90, sub_08064C6C,
sub_08064D18, sub_08064D58, NULL, sub_0806501C, sub_08065054, NULL, NULL, sub_08065534,
sub_080657A8, sub_080657DC, sub_0806581C, NULL, sub_08065960, sub_08065990, NULL, sub_08065B1C,
sub_08065B4C, NULL, NULL, sub_08065BA4, NULL, sub_08065F90, sub_08065FC0, sub_080660A8,
sub_08066298, sub_080662D8, NULL, NULL, sub_080665E4, NULL, sub_08066780, sub_080667B0,
NULL, sub_08066948, sub_08066978, NULL, NULL, sub_08066A5C, NULL, NULL,
sub_08066CB4, NULL, NULL, sub_08066FD8, sub_08067080, sub_08067118, sub_08067158, sub_08067228,
sub_0806732C, sub_08067380, NULL, sub_08067750, sub_080677B4, NULL, sub_08067DFC, sub_08067E2C,
sub_080681E0, sub_08068270, sub_080682B0, NULL, NULL, sub_080686D4, sub_0806889C, sub_0806897C,
sub_080689C0, NULL, sub_08068F4C, sub_08068F98, NULL, sub_080692A0, sub_080692D0, NULL,
sub_08069514, sub_08069544, NULL, NULL, sub_08069784, sub_08069AE8, NULL, sub_08069B1C,
sub_08069F2C, sub_0806A194, Syrup, sub_0806A2B4, NULL, sub_0806A358, NULL, NULL,
sub_0806ABC8, sub_0806AE0C, sub_0806B184, sub_0806B1CC, NULL, sub_0806B32C, sub_0806B3AC, sub_0806B35C,
sub_0806B624, sub_0806B664, NULL, NULL, sub_0806B9D0, NULL, NULL, sub_0806B9F0,
NULL, NULL, sub_0806BBE4, sub_0806BC64, sub_0806BCFC, sub_0806BD54, NULL, NULL,
sub_0806BDAC, NULL, sub_0806BE54, sub_0806BF80, NULL, NULL, sub_0806C0B0, NULL,
NULL, sub_0806C13C, NULL, sub_0806C1D4, Simon, NULL, NULL, sub_0806C2C4,
NULL, sub_0806C36C, sub_0806C39C, sub_0806C478, sub_0806C510, sub_0806C550, NULL, NULL,
sub_0806C5A8, sub_0806C68C, sub_0806C738, sub_0806C780, sub_0806C888, sub_0806CA94, sub_0806CADC, NULL,
sub_0806CD70, sub_0806CDA8, NULL, sub_0806CEE8, sub_0806CF18, NULL, NULL, sub_0806D86C,
NULL, NULL, sub_0806D9D0, NULL, sub_0806DCD4, sub_0806DD44, NULL, NULL,
sub_0806DD78, NULL, NULL, sub_0806DED0, NULL, NULL, sub_0806E278, NULL,
NULL, sub_0806E308, sub_0806E3E4, sub_0806E458, sub_0806E4A0, NULL, sub_0806E6E0, sub_0806E710,
NULL, sub_0806E894, sub_0806E8CC, sub_0806E8F8, NULL, sub_0806E91C, NULL, NULL,
sub_0806EAF4, sub_0806EBAC, NULL, DeleteEntity, NULL, NULL, DeleteEntity, NULL,
NULL, DeleteEntity, NULL, NULL, DeleteEntity, NULL, NULL, DeleteEntity,
NULL, NULL, DeleteEntity, NULL, NULL, DeleteEntity, NULL, NULL,
DeleteEntity, NULL, NULL, DeleteEntity, NULL, NULL, DeleteEntity, NULL,
NULL, DeleteEntity, NULL, NULL, DeleteEntity, NULL, NULL, DeleteEntity,
NULL, NULL, DeleteEntity, NULL, NULL, DeleteEntity, NULL, NULL,
DeleteEntity, NULL, NULL, DeleteEntity, NULL, NULL, DeleteEntity, NULL,
NULL, DeleteEntity, NULL, NULL, DeleteEntity, NULL, NULL, DeleteEntity,
NULL, NULL, DeleteEntity, NULL, NULL, DeleteEntity, NULL, NULL,
DeleteEntity, NULL, NULL, DeleteEntity, NULL, NULL, DeleteEntity, NULL,
NULL, DeleteEntity, NULL, NULL, DeleteEntity, NULL, NULL, DeleteEntity,
NULL, NULL, DeleteEntity, NULL, NULL, DeleteEntity, NULL, NULL,
DeleteEntity, NULL, NULL, DeleteEntity, NULL, NULL, DeleteEntity, NULL,
NULL, DeleteEntity, NULL, NULL, DeleteEntity, NULL, NULL, DeleteEntity,
NULL, NULL, DeleteEntity, NULL, NULL, DeleteEntity, NULL, NULL,
//clang-format off
void (*const gNPCFunctions[][3])(Entity* ent) = {
{ DeleteEntity, NULL, NULL },
{ Gentari, NULL, Gentari_Fusion },
{ Festari, NULL, Festari_Fusion },
{ ForestMinish, ForestMinish_Head, ForestMinish_Fusion },
{ Postman, NULL, Postman_Fusion },
{ NPC5, NULL, NULL },
{ Townsperson, Townsperson_Head, Townsperson_Fusion },
{ Kid, Kid_Head, Kid_Fusion },
{ Guard, Guard_Head, NULL },
{ NPC9, NULL, NULL },
{ Stamp, NULL, NULL },
{ Maid, Maid_Head, NULL },
{ Marcy, NULL, NULL },
{ Wheaton, NULL, NULL },
{ Pita, NULL, NULL },
{ MinishEzlo, MinishEzlo_Head, NULL },
{ Mailbox, NULL, NULL },
{ Beedle, Beedle_Head, NULL },
{ Brocco, NULL, Brocco_Fusion },
{ SittingPerson, SittingPerson_Head, SittingPerson_Fusion },
{ Pina, NULL, Pina_Fusion },
{ Guard, Guard_Head, NULL },
{ Maid, Maid_Head, NULL },
{ Din, NULL, Din_Fusion },
{ Nayru, NULL, Nayru_Fusion },
{ Farore, NULL, Farore_Fusion },
{ Sturgeon, Sturgeon_Head, Sturgeon_Fusion },
{ TingleSiblings, NULL, TingleSiblings_Fusion },
{ Stockwell, NULL, NULL },
{ Talon, Talon_Head, Talon_Fusion },
{ Malon, NULL, Malon_Fusion },
{ Epona, NULL, Epona_Fusion },
{ MilkCart, NULL, NULL },
{ GhostBrothers, NULL, GhostBrothers_Fusion },
{ Smith, Smith_Head, Smith_Fusion },
{ NPC23, NULL, NULL },
{ KingDaltus, NULL, KingDaltus_Fusion },
{ MinisterPotho, NULL, MinisterPotho_Fusion },
{ NPC26, NULL, NULL },
{ Vaati, NULL, NULL },
{ Zelda, NULL, NULL },
{ Mutoh, Mutoh_Head, Mutoh_Fusion },
{ Carpenter, Carpenter_Head, Carpenter_Fusion },
{ CastorWildsStatue, NULL, CastorWildsStatue_Fusion },
{ Cat, NULL, Cat_Fusion },
{ MountainMinish, MountainMinish_Head, MountainMinish_Fusion },
{ ZeldaFollower, NULL, NULL },
{ Melari, Melari_Head, Melari_Fusion },
{ BladeBrothers, NULL, BladeBrothers_Fusion },
{ Cow, NULL, Cow_Fusion },
{ Goron, NULL, Goron_Fusion },
{ GoronMerchant, NULL, NULL },
{ Gorman, Gorman_Head, NULL },
{ Dog, Dog_Head, Dog_Fusion },
{ Syrup, Syrup_Head, NULL },
{ Rem, NULL, NULL },
{ TownMinish, TownMinish_Head, TownMinish_Fusion },
{ Librari, NULL, Librari_Fusion },
{ Percy, Percy_Head, Percy_Fusion },
{ VaatiReborn, NULL, NULL },
{ MoblinLady, NULL, NULL },
{ Librarians, NULL, NULL },
{ Farmers, Farmers_Head, Farmers_Fusion },
{ Carlov, NULL, NULL },
{ Dampe, NULL, Dampe_Fusion },
{ DrLeft, NULL, NULL },
{ KingGustaf, NULL, NULL },
{ Gina, NULL, Gina_Fusion },
{ Simon, NULL, NULL },
{ Anju, NULL, Anju_Fusion },
{ Mama, Mama_Head, Mama_Fusion },
{ Emma, NULL, NULL },
{ Teachers, Teachers_Head, Teachers_Fusion },
{ WindTribespeople, WindTribespeople_Head, WindTribespeople_Fusion },
{ Gregal, NULL, Gregal_Fusion },
{ MayorHagen, NULL, MayorHagen_Fusion },
{ BigGoron, NULL, NULL },
{ EzloCap, NULL, NULL },
{ NPC4E, NULL, NPC4E_Fusion },
{ NPC4F, NULL, NULL },
{ ClothesRack, NULL, NULL },
{ PicolyteBottle, NULL, NULL },
{ SmallTownMinish, NULL, NULL },
{ HurdyGurdyMan, HurdyGurdyMan_Head, HurdyGurdyMan_Fusion },
{ Cucco, NULL, Cucco_Fusion },
{ CuccoChick, NULL, CuccoChick_Fusion },
{ FusionMenuNPC, FusionMenuNPC_Head, NULL },
{ Phonograph, NULL, NULL },
{ NPC58, NPC58_Head, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL },
{ DeleteEntity, NULL, NULL }
};
const u8 npc_unk[] = {
0x04,
0x05,
0x06,
0x06
};
//clang-format on
const u8 npc_unk[] = { 0x04, 0x05, 0x06, 0x06 };
+1 -1
View File
@@ -16,7 +16,7 @@ extern void (*gUnk_08112278[])(Entity*);
extern void gUnk_08012F0C;
void sub_0806A358(Entity* this) {
void Rem(Entity* this) {
gUnk_08112260[this->entityType.parameter1](this);
}
+1 -1
View File
@@ -44,7 +44,7 @@ extern void (*gStampBehaviors2[2])(Entity*);
extern TextBox gTextBox;
extern u32 gUnk_0810C2E4;
void sub_08062B98(Entity* ent) {
void Stamp(Entity* ent) {
if ((ent->flags & 2) != 0) {
gStampBehaviors2[ent->action](ent);
} else {
+3 -3
View File
@@ -14,7 +14,7 @@ extern u8 gUnk_0810FED8[];
void sub_0806574C(Entity* this);
void sub_08065534(Entity* this) {
void Talon(Entity* this) {
if (this->flags & 2) {
gUnk_0810FEC4[this->action](this);
} else {
@@ -143,14 +143,14 @@ void sub_08065780(Entity* this, u16* param_2) {
param_2[8] = gUnk_0810FED8[rand >> 8 & 7];
}
void sub_080657A8(Entity* this) {
void Talon_Head(Entity* this) {
sub_0806FF60(this, 0, ((this->frames.all & 7) + 0xB));
sub_0806FF60(this, 1, this->animationList);
sub_0806FF88(this, 1, 0);
sub_0807000C(this);
}
void sub_080657DC(Entity* this) {
void Talon_Fusion(Entity* this) {
if (this->action == 0) {
if (LoadExtraSpriteData(this, &gUnk_0810FEB0) != 0) {
this->action++;
+1 -1
View File
@@ -12,7 +12,7 @@ extern void sub_0806ACC4(Entity *);
extern u32 LoadExtraSpriteData(Entity *, SpriteLoadData *);
extern SpriteLoadData gUnk_08112674[];
void sub_0806ABC8(Entity *this)
void TownMinish(Entity *this)
{
if ((this->flags & 2) == 0) {
(*gUnk_081126E8[this->action])(this);
+1 -1
View File
@@ -31,7 +31,7 @@ extern void (*gUnk_08110BD8[])(Entity* ent);
extern u8 gUnk_02033280[];
extern u16 gUnk_08110BE0[];
void sub_08066CB4(Entity* ent) {
void Zelda(Entity* ent) {
gUnk_08110BD8[ent->action](ent);
}