attempt at deduplicating

This commit is contained in:
ThreeMustyFears 2021-09-21 20:08:50 -03:00
parent 86a09cdcee
commit 6393e85703
14 changed files with 159 additions and 499 deletions

View File

@ -0,0 +1,105 @@
#include "common.h"
s32 N(UnkPartnerFunc2)(Evt* evt, s32 arg1) {
PlayerData* playerData = &gPlayerData;
Npc* npc;
Entity* entity;
f32 sp10;
f32 sp14;
f32 tempY;
npc = evt->owner2.npc;
if (arg1 != 0) {
#if IS_WALKING_PARTNER == 1
partner_walking_enable(npc, 1);
#else
partner_flying_enable(npc, 1);
#endif
mem_clear(UNK_PARTNER_SYMBOL, sizeof(*UNK_PARTNER_SYMBOL));
D_8010C954 = 0;
}
#ifdef IS_PLAYER_DATA_USED
playerData->unk_2F4[IS_PLAYER_DATA_USED]++;
#if IS_PLAYER_DATA_USED == 8 || IS_PLAYER_DATA_USED == 3 // Laki and Bombette have the following
npc->flags |= 0x10000;
#endif
#endif
entity = D_8010C954;
if (entity == NULL) {
#if IS_WALKING_PARTNER == 1
partner_walking_update_player_tracking(npc);
partner_walking_update_motion(npc);
#else
partner_flying_update_player_tracking(npc);
partner_flying_update_motion(npc);
#endif
return 0;
}
switch (UNK_PARTNER_SYMBOL->unk_04) {
case 0:
UNK_PARTNER_SYMBOL->unk_04 = 1;
UNK_PARTNER_SYMBOL->unk_08 = npc->flags;
UNK_PARTNER_SYMBOL->unk_0C = fabsf(dist2D(npc->pos.x, npc->pos.z, entity->position.x, entity->position.z));
UNK_PARTNER_SYMBOL->unk_10 = atan2(entity->position.x, entity->position.z, npc->pos.x, npc->pos.z);
UNK_PARTNER_SYMBOL->unk_14 = 6.0f;
UNK_PARTNER_SYMBOL->unk_18 = 50.0f;
UNK_PARTNER_SYMBOL->unk_00 = 0x78;
npc->flags |= 0x40148;
npc->flags &= ~0x200;
case 1:
sin_cos_rad((UNK_PARTNER_SYMBOL->unk_10 * TAU) / 360.0f, &sp10, &sp14);
npc->pos.x = entity->position.x + (sp10 * UNK_PARTNER_SYMBOL->unk_0C);
npc->pos.z = entity->position.z - (sp14 * UNK_PARTNER_SYMBOL->unk_0C);
UNK_PARTNER_SYMBOL->unk_10 = clamp_angle(UNK_PARTNER_SYMBOL->unk_10 - UNK_PARTNER_SYMBOL->unk_14);
if (UNK_PARTNER_SYMBOL->unk_0C > 20.0f) {
UNK_PARTNER_SYMBOL->unk_0C--;
} else if (UNK_PARTNER_SYMBOL->unk_0C < 19.0f) {
UNK_PARTNER_SYMBOL->unk_0C++;
}
tempY = sin_rad((UNK_PARTNER_SYMBOL->unk_18 * TAU) / 360.0f) * 3.0f;
UNK_PARTNER_SYMBOL->unk_18 += 3.0f;
if (UNK_PARTNER_SYMBOL->unk_18 > 150.0f) {
UNK_PARTNER_SYMBOL->unk_18 = 150.0f;
}
npc->pos.y += tempY;
npc->renderYaw = clamp_angle(360.0f - UNK_PARTNER_SYMBOL->unk_10);
UNK_PARTNER_SYMBOL->unk_14 += UNK_14_ADDITION;
if (UNK_PARTNER_SYMBOL->unk_14 > 40.0f) {
UNK_PARTNER_SYMBOL->unk_14 = 40.0f;
}
if (--UNK_PARTNER_SYMBOL->unk_00 == 0) {
UNK_PARTNER_SYMBOL->unk_04++;
}
break;
case 2:
npc->flags = UNK_PARTNER_SYMBOL->unk_08;
UNK_PARTNER_SYMBOL->unk_00 = 0x1E;
UNK_PARTNER_SYMBOL->unk_04++;
break;
case 3:
#if IS_WALKING_PARTNER == 1
partner_walking_update_player_tracking(npc);
partner_walking_update_motion(npc);
#else
partner_flying_update_player_tracking(npc);
partner_flying_update_motion(npc);
#endif
if (--UNK_PARTNER_SYMBOL->unk_00 == 0) {
UNK_PARTNER_SYMBOL->unk_04 = 0;
D_8010C954 = 0;
}
break;
}
return 0;
}

View File

@ -5,6 +5,13 @@ extern f64 D_802BE900_319650;
extern struct unkPartnerStruct* D_802BE89C_3195EC;
#define NAMESPACE world_partner_bombette
#define UNK_PARTNER_SYMBOL D_802BE89C_3195EC
#define UNK_14_ADDITION D_802BE900_319650
#define IS_PLAYER_DATA_USED 3
#define IS_WALKING_PARTNER 1
INCLUDE_ASM(s32, "world/partner/bombette", func_802BD100_317E50);
INCLUDE_ASM(s32, "world/partner/bombette", func_802BD2D8_318028);
@ -18,89 +25,7 @@ ApiStatus func_802BD300_318050(Evt* script, s32 isInitialCall) {
return partner_get_out(unk) != 0;
}
s32 func_802BD338_318088(Evt* evt, s32 arg1) {
PlayerData* playerData = &gPlayerData;
Npc* npc;
f32 sp10;
f32 sp14;
f32 tempY;
Entity* entity;
npc = evt->owner2.npc;
if (arg1 != 0) {
partner_walking_enable(npc, 1);
mem_clear(D_802BE89C_3195EC, sizeof(*D_802BE89C_3195EC));
D_8010C954 = 0;
}
playerData->unk_2F4[3]++;
npc->flags |= 0x10000;
entity = D_8010C954;
if (entity == NULL) {
partner_walking_update_player_tracking(npc);
partner_walking_update_motion(npc);
return 0;
}
switch (D_802BE89C_3195EC->unk_04) {
case 0:
D_802BE89C_3195EC->unk_04 = 1;
D_802BE89C_3195EC->unk_08 = npc->flags;
D_802BE89C_3195EC->unk_0C = fabsf(dist2D(npc->pos.x, npc->pos.z, entity->position.x, entity->position.z));
D_802BE89C_3195EC->unk_10 = atan2(entity->position.x, entity->position.z, npc->pos.x, npc->pos.z);
D_802BE89C_3195EC->unk_14 = 6.0f;
D_802BE89C_3195EC->unk_18 = 50.0f;
D_802BE89C_3195EC->unk_00 = 0x78;
npc->flags |= 0x40148;
npc->flags &= ~0x200;
case 1:
sin_cos_rad((D_802BE89C_3195EC->unk_10 * TAU) / 360.0f, &sp10, &sp14);
npc->pos.x = entity->position.x + (sp10 * D_802BE89C_3195EC->unk_0C);
npc->pos.z = entity->position.z - (sp14 * D_802BE89C_3195EC->unk_0C);
D_802BE89C_3195EC->unk_10 = clamp_angle(D_802BE89C_3195EC->unk_10 - D_802BE89C_3195EC->unk_14);
if (D_802BE89C_3195EC->unk_0C > 20.0f) {
D_802BE89C_3195EC->unk_0C--;
} else if (D_802BE89C_3195EC->unk_0C < 19.0f) {
D_802BE89C_3195EC->unk_0C++;
}
tempY = sin_rad((D_802BE89C_3195EC->unk_18 * TAU) / 360.0f) * 3.0f;
D_802BE89C_3195EC->unk_18 += 3.0f;
if (D_802BE89C_3195EC->unk_18 > 150.0f) {
D_802BE89C_3195EC->unk_18 = 150.0f;
}
npc->pos.y += tempY;
npc->renderYaw = clamp_angle(360.0f - D_802BE89C_3195EC->unk_10);
D_802BE89C_3195EC->unk_14 += D_802BE900_319650;
if (D_802BE89C_3195EC->unk_14 > 40.0f) {
D_802BE89C_3195EC->unk_14 = 40.0f;
}
if (--D_802BE89C_3195EC->unk_00 == 0) {
D_802BE89C_3195EC->unk_04++;
}
break;
case 2:
npc->flags = D_802BE89C_3195EC->unk_08;
D_802BE89C_3195EC->unk_00 = 0x1E;
D_802BE89C_3195EC->unk_04++;
break;
case 3:
partner_walking_update_player_tracking(npc);
partner_walking_update_motion(npc);
if (--D_802BE89C_3195EC->unk_00 == 0) {
D_802BE89C_3195EC->unk_04 = 0;
D_8010C954 = 0;
}
break;
}
return 0;
}
#include "world/common/UnkPartnerFunc2.inc.c"
INCLUDE_ASM(s32, "world/partner/bombette", func_802BD6DC_31842C);

View File

@ -5,6 +5,12 @@ extern s32 D_802BE0C0;
extern s32 D_802BE0C4;
extern struct unkPartnerStruct* D_802BDFFC_32494C;
#define NAMESPACE world_partner_bow
#define UNK_PARTNER_SYMBOL D_802BDFFC_32494C
#define UNK_14_ADDITION 0.8
#define IS_PLAYER_DATA_USED 9
#define IS_WALKING_PARTNER 0
void func_802BD100_323A50(Npc* partner) {
partner->collisionHeight = 26;
partner->collisionRadius = 24;
@ -21,81 +27,7 @@ ApiStatus func_802BD130_323A80(Evt* script, s32 isInitialCall) {
return partner_get_out(owner) != 0;
}
s32 func_802BD168_323AB8(Evt* evt, s32 arg1) {
PlayerData* playerData = &gPlayerData;
Npc* npc;
Entity* entity;
f32 sp10;
f32 sp14;
f32 tempY;
npc = evt->owner2.npc;
if (arg1 != 0) {
partner_flying_enable(npc, 1);
mem_clear(D_802BDFFC_32494C, sizeof(*D_802BDFFC_32494C));
D_8010C954 = 0;
}
entity = D_8010C954;
playerData->unk_2F4[9]++;
if (entity == NULL) {
partner_flying_update_player_tracking(npc);
partner_flying_update_motion(npc);
return 0;
}
switch (D_802BDFFC_32494C->unk_04){
case 0:
D_802BDFFC_32494C->unk_04 = 1;
D_802BDFFC_32494C->unk_08 = npc->flags;
D_802BDFFC_32494C->unk_0C = fabsf(dist2D(npc->pos.x, npc->pos.z, entity->position.x, entity->position.z));
D_802BDFFC_32494C->unk_10 = atan2(entity->position.x, entity->position.z, npc->pos.x, npc->pos.z);
D_802BDFFC_32494C->unk_14 = 6.0f;
D_802BDFFC_32494C->unk_18 = 50.0f;
D_802BDFFC_32494C->unk_00 = 0x78;
npc->flags |= 0x40148;
npc->flags &= ~0x200;
case 1:
sin_cos_rad((D_802BDFFC_32494C->unk_10 * TAU) / 360.0f, &sp10, &sp14);
npc->pos.x = entity->position.x + (sp10 * D_802BDFFC_32494C->unk_0C);
npc->pos.z = entity->position.z - (sp14 * D_802BDFFC_32494C->unk_0C);
D_802BDFFC_32494C->unk_10 = clamp_angle(D_802BDFFC_32494C->unk_10 - D_802BDFFC_32494C->unk_14);
if (D_802BDFFC_32494C->unk_0C > 20.0f) {
D_802BDFFC_32494C->unk_0C -= 1.0f;
} else if (D_802BDFFC_32494C->unk_0C < 19.0f) {
D_802BDFFC_32494C->unk_0C++;
}
tempY = sin_rad((D_802BDFFC_32494C->unk_18 * TAU) / 360.0f) * 3.0f;
D_802BDFFC_32494C->unk_18 += 3.0f;
if (D_802BDFFC_32494C->unk_18 > 150.0f) {
D_802BDFFC_32494C->unk_18 = 150.0f;
}
npc->pos.y += tempY;
npc->renderYaw = clamp_angle(360.0f - D_802BDFFC_32494C->unk_10);
D_802BDFFC_32494C->unk_14 += 0.8;
if (D_802BDFFC_32494C->unk_14 > 40.0f) {
D_802BDFFC_32494C->unk_14 = 40.0f;
}
if (--D_802BDFFC_32494C->unk_00 == 0) {
D_802BDFFC_32494C->unk_04++;
}
break;
case 2:
npc->flags = D_802BDFFC_32494C->unk_08;
D_802BDFFC_32494C->unk_00 = 0x1E;
D_802BDFFC_32494C->unk_04++;
break;
case 3:
partner_flying_update_player_tracking(npc);
partner_flying_update_motion(npc);
if (--D_802BDFFC_32494C->unk_00 == 0) {
D_802BDFFC_32494C->unk_04 = 0;
D_8010C954 = 0;
}
break;
}
return 0;
}
#include "world/common/UnkPartnerFunc2.inc.c"
INCLUDE_ASM(s32, "world/partner/bow", func_802BD4FC_323E4C);

View File

@ -2,6 +2,12 @@
extern unkPartnerStruct* D_802BEB60_31CB80;
#define NAMESPACE world_partner_kooper
#define UNK_PARTNER_SYMBOL D_802BEB60_31CB80
#define UNK_14_ADDITION 0.8
#define IS_PLAYER_DATA_USED 2
#define IS_WALKING_PARTNER 1
INCLUDE_ASM(s32, "world/partner/kooper", func_802BD100_31B120);
INCLUDE_ASM(s32, "world/partner/kooper", func_802BD144_31B164);
@ -12,89 +18,7 @@ INCLUDE_ASM(s32, "world/partner/kooper", func_802BD200_31B220);
INCLUDE_ASM(s32, "world/partner/kooper", func_802BD228_31B248);
s32 func_802BD260_31B280(Evt* evt, s32 arg1) {
PlayerData* playerData = &gPlayerData;
Npc* npc;
f32 sp10;
f32 sp14;
f32 tempY;
Entity* entity;
npc = evt->owner2.npc;
if (arg1 != 0) {
partner_walking_enable(npc, 1);
mem_clear(D_802BEB60_31CB80, sizeof(*D_802BEB60_31CB80));
D_8010C954 = 0;
}
playerData->unk_2F4[2]++;
entity = D_8010C954;
if (entity == NULL) {
partner_walking_update_player_tracking(npc);
partner_walking_update_motion(npc);
return 0;
}
switch (D_802BEB60_31CB80->unk_04) {
case 0:
D_802BEB60_31CB80->unk_04 = 1;
D_802BEB60_31CB80->unk_08 = npc->flags;
D_802BEB60_31CB80->unk_0C = fabsf(dist2D(npc->pos.x, npc->pos.z, entity->position.x, entity->position.z));
D_802BEB60_31CB80->unk_10 = atan2(entity->position.x, entity->position.z, npc->pos.x, npc->pos.z);
D_802BEB60_31CB80->unk_14 = 6.0f;
D_802BEB60_31CB80->unk_18 = 50.0f;
D_802BEB60_31CB80->unk_00 = 0x78;
npc->flags |= 0x40148;
npc->flags &= ~0x200;
case 1:
sin_cos_rad((D_802BEB60_31CB80->unk_10 * TAU) / 360.0f, &sp10, &sp14);
npc->pos.x = entity->position.x + (sp10 * D_802BEB60_31CB80->unk_0C);
npc->pos.z = entity->position.z - (sp14 * D_802BEB60_31CB80->unk_0C);
D_802BEB60_31CB80->unk_10 = clamp_angle(D_802BEB60_31CB80->unk_10 - D_802BEB60_31CB80->unk_14);
if (D_802BEB60_31CB80->unk_0C > 20.0f) {
D_802BEB60_31CB80->unk_0C--;
} else if (D_802BEB60_31CB80->unk_0C < 19.0f) {
D_802BEB60_31CB80->unk_0C++;
}
tempY = sin_rad((D_802BEB60_31CB80->unk_18 * TAU) / 360.0f) * 3.0f;
D_802BEB60_31CB80->unk_18 += 3.0f;
if (D_802BEB60_31CB80->unk_18 > 150.0f) {
D_802BEB60_31CB80->unk_18 = 150.0f;
}
npc->pos.y += tempY;
npc->renderYaw = clamp_angle(360.0f - D_802BEB60_31CB80->unk_10);
D_802BEB60_31CB80->unk_14 += 0.8;
if (D_802BEB60_31CB80->unk_14 > 40.0f) {
D_802BEB60_31CB80->unk_14 = 40.0f;
}
if (--D_802BEB60_31CB80->unk_00 == 0) {
D_802BEB60_31CB80->unk_04++;
}
break;
case 2:
npc->flags = D_802BEB60_31CB80->unk_08;
D_802BEB60_31CB80->unk_00 = 0x1E;
D_802BEB60_31CB80->unk_04++;
break;
case 3:
partner_walking_update_player_tracking(npc);
partner_walking_update_motion(npc);
if (--D_802BEB60_31CB80->unk_00 == 0) {
D_802BEB60_31CB80->unk_04 = 0;
D_8010C954 = 0;
}
break;
}
return 0;
}
#include "world/common/UnkPartnerFunc2.inc.c"
INCLUDE_ASM(s32, "world/partner/kooper", func_802BD5F4_31B614);

View File

@ -3,95 +3,19 @@
extern unkPartnerStruct* D_802BFE7C_3239CC;
extern f64 D_802BFEF0;
#define NAMESPACE world_partner_lakilester
#define UNK_PARTNER_SYMBOL D_802BFE7C_3239CC
#define UNK_14_ADDITION D_802BFEF0
#define IS_PLAYER_DATA_USED 8
#define IS_WALKING_PARTNER 0
INCLUDE_ASM(s32, "world/partner/lakilester", func_802BD100_320C50);
INCLUDE_ASM(s32, "world/partner/lakilester", func_802BD21C_320D6C);
INCLUDE_ASM(s32, "world/partner/lakilester", func_802BD29C_320DEC);
s32 func_802BD2D4_320E24(Evt* evt, s32 arg1) {
PlayerData* playerData = &gPlayerData;
Entity* entity;
Npc* npc;
f32 sp10;
f32 sp14;
f32 tempY;
npc = evt->owner2.npc;
if (arg1 != 0) {
partner_flying_enable(npc, 1);
mem_clear(D_802BFE7C_3239CC, sizeof(*D_802BFE7C_3239CC));
D_8010C954 = 0;
}
playerData->unk_2F4[8]++;
npc->flags |= 0x10000;
entity = D_8010C954;
if (entity == NULL) {
partner_flying_update_player_tracking(npc);
partner_flying_update_motion(npc);
return 0;
}
switch (D_802BFE7C_3239CC->unk_04) {
case 0:
D_802BFE7C_3239CC->unk_04 = 1;
D_802BFE7C_3239CC->unk_08 = npc->flags;
D_802BFE7C_3239CC->unk_0C = fabsf(dist2D(npc->pos.x, npc->pos.z, entity->position.x, entity->position.z));
D_802BFE7C_3239CC->unk_10 = atan2(entity->position.x, entity->position.z, npc->pos.x, npc->pos.z);
D_802BFE7C_3239CC->unk_14 = 6.0f;
D_802BFE7C_3239CC->unk_18 = 50.0f;
D_802BFE7C_3239CC->unk_00 = 0x78;
npc->flags |= 0x40148;
npc->flags &= ~0x200;
case 1:
sin_cos_rad((D_802BFE7C_3239CC->unk_10 * TAU) / 360.0f, &sp10, &sp14);
npc->pos.x = entity->position.x + (sp10 * D_802BFE7C_3239CC->unk_0C);
npc->pos.z = entity->position.z - (sp14 * D_802BFE7C_3239CC->unk_0C);
D_802BFE7C_3239CC->unk_10 = clamp_angle(D_802BFE7C_3239CC->unk_10 - D_802BFE7C_3239CC->unk_14);
if (D_802BFE7C_3239CC->unk_0C > 20.0f) {
D_802BFE7C_3239CC->unk_0C--;
} else if (D_802BFE7C_3239CC->unk_0C < 19.0f) {
D_802BFE7C_3239CC->unk_0C++;
}
tempY = sin_rad((D_802BFE7C_3239CC->unk_18 * TAU) / 360.0f) * 3.0f;
D_802BFE7C_3239CC->unk_18 += 3.0f;
if (D_802BFE7C_3239CC->unk_18 > 150.0f) {
D_802BFE7C_3239CC->unk_18 = 150.0f;
}
npc->pos.y += tempY;
npc->renderYaw = clamp_angle(360.0f - D_802BFE7C_3239CC->unk_10);
D_802BFE7C_3239CC->unk_14 += D_802BFEF0;
if (D_802BFE7C_3239CC->unk_14 > 40.0f) {
D_802BFE7C_3239CC->unk_14 = 40.0f;
}
if (--D_802BFE7C_3239CC->unk_00 == 0) {
D_802BFE7C_3239CC->unk_04++;
}
break;
case 2:
npc->flags = D_802BFE7C_3239CC->unk_08;
D_802BFE7C_3239CC->unk_00 = 0x1E;
D_802BFE7C_3239CC->unk_04++;
break;
case 3:
partner_flying_update_player_tracking(npc);
partner_flying_update_motion(npc);
if (--D_802BFE7C_3239CC->unk_00 == 0) {
D_802BFE7C_3239CC->unk_04 = 0;
D_8010C954 = 0;
}
break;
}
return 0;
}
#include "world/common/UnkPartnerFunc2.inc.c"
INCLUDE_ASM(s32, "world/partner/lakilester", func_802BD678_3211C8);

View File

@ -2,6 +2,12 @@
extern struct unkPartnerStruct* D_802BEAAC_31B01C;
#define NAMESPACE world_partner_parakarry
#define UNK_PARTNER_SYMBOL D_802BEAAC_31B01C
#define UNK_14_ADDITION 0.8
#define IS_PLAYER_DATA_USED 4
#define IS_WALKING_PARTNER 0
INCLUDE_ASM(s32, "world/partner/parakarry", func_802BD100_319670);
ApiStatus func_802BD148_3196B8(Evt* script, s32 isInitialCall) {
@ -13,88 +19,7 @@ ApiStatus func_802BD148_3196B8(Evt* script, s32 isInitialCall) {
return partner_get_out(unk) != 0;
}
s32 func_802BD180_3196F0(Evt* evt, s32 arg1) {
PlayerData* playerData = &gPlayerData;
Entity* temp_s2;
Npc* npc;
f32 sp10;
f32 sp14;
f32 tempY;
npc = evt->owner2.npc;
if (arg1 != 0) {
partner_flying_enable(npc, 1);
mem_clear(D_802BEAAC_31B01C, sizeof(*D_802BEAAC_31B01C));
D_8010C954 = 0;
}
playerData->unk_2F4[4]++;
temp_s2 = D_8010C954;
if (temp_s2 == NULL) {
partner_flying_update_player_tracking(npc);
partner_flying_update_motion(npc);
return 0;
}
switch (D_802BEAAC_31B01C->unk_04) {
case 0:
D_802BEAAC_31B01C->unk_04 = 1;
D_802BEAAC_31B01C->unk_08 = npc->flags;
D_802BEAAC_31B01C->unk_0C = fabsf(dist2D(npc->pos.x, npc->pos.z, temp_s2->position.x, temp_s2->position.z));
D_802BEAAC_31B01C->unk_10 = atan2(temp_s2->position.x, temp_s2->position.z, npc->pos.x, npc->pos.z);
D_802BEAAC_31B01C->unk_14 = 6.0f;
D_802BEAAC_31B01C->unk_18 = 50.0f;
D_802BEAAC_31B01C->unk_00 = 0x78;
npc->flags |= 0x40148;
npc->flags &= ~0x200;
case 1:
sin_cos_rad((D_802BEAAC_31B01C->unk_10 * TAU) / 360.0f, &sp10, &sp14);
npc->pos.x = temp_s2->position.x + (sp10 * D_802BEAAC_31B01C->unk_0C);
npc->pos.z = temp_s2->position.z - (sp14 * D_802BEAAC_31B01C->unk_0C);
D_802BEAAC_31B01C->unk_10 = clamp_angle(D_802BEAAC_31B01C->unk_10 - D_802BEAAC_31B01C->unk_14);
if (D_802BEAAC_31B01C->unk_0C > 20.0f) {
D_802BEAAC_31B01C->unk_0C--;
} else if (D_802BEAAC_31B01C->unk_0C < 19.0f) {
D_802BEAAC_31B01C->unk_0C++;
}
tempY = sin_rad((D_802BEAAC_31B01C->unk_18 * TAU) / 360.0f) * 3.0f;
D_802BEAAC_31B01C->unk_18 += 3.0f;
if (D_802BEAAC_31B01C->unk_18 > 150.0f) {
D_802BEAAC_31B01C->unk_18 = 150.0f;
}
npc->pos.y += tempY;
npc->renderYaw = clamp_angle(360.0f - D_802BEAAC_31B01C->unk_10);
D_802BEAAC_31B01C->unk_14 += 0.8;
if (D_802BEAAC_31B01C->unk_14 > 40.0f) {
D_802BEAAC_31B01C->unk_14 = 40.0f;
}
if (--D_802BEAAC_31B01C->unk_00 == 0) {
D_802BEAAC_31B01C->unk_04++;
}
break;
case 2:
npc->flags = D_802BEAAC_31B01C->unk_08;
D_802BEAAC_31B01C->unk_00 = 0x1E;
D_802BEAAC_31B01C->unk_04++;
break;
case 3:
partner_flying_update_player_tracking(npc);
partner_flying_update_motion(npc);
if (--D_802BEAAC_31B01C->unk_00 == 0) {
D_802BEAAC_31B01C->unk_04 = 0;
D_8010C954 = 0;
}
break;
}
return 0;
}
#include "world/common/UnkPartnerFunc2.inc.c"
INCLUDE_ASM(s32, "world/partner/parakarry", func_802BD514_319A84);

View File

@ -2,6 +2,11 @@
extern unkPartnerStruct* D_802BFDF8_320B68;
#define NAMESPACE world_partner_sushi
#define UNK_PARTNER_SYMBOL D_802BFDF8_320B68
#define UNK_14_ADDITION 0.8
#define IS_WALKING_PARTNER 1
INCLUDE_ASM(s32, "world/partner/sushie", func_802BD100_31DE70);
INCLUDE_ASM(s32, "world/partner/sushie", func_802BD20C_31DF7C);
@ -18,87 +23,7 @@ INCLUDE_ASM(s32, "world/partner/sushie", func_802BF520_320290);
INCLUDE_ASM(s32, "world/partner/sushie", func_802BF568_3202D8);
s32 func_802BF5A0_320310(Evt* evt, s32 arg1) {
Npc* npc;
Entity* entity;
f32 sp10;
f32 sp14;
f32 tempY;
npc = evt->owner2.npc;
if (arg1 != 0) {
partner_walking_enable(npc, 1);
mem_clear(D_802BFDF8_320B68, sizeof(*D_802BFDF8_320B68));
D_8010C954 = 0;
}
entity = D_8010C954;
if (entity == NULL) {
partner_walking_update_player_tracking(npc);
partner_walking_update_motion(npc);
return 0;
}
switch (D_802BFDF8_320B68->unk_04) {
case 0:
D_802BFDF8_320B68->unk_04 = 1;
D_802BFDF8_320B68->unk_08 = npc->flags;
D_802BFDF8_320B68->unk_0C = fabsf(dist2D(npc->pos.x, npc->pos.z, entity->position.x, entity->position.z));
D_802BFDF8_320B68->unk_10 = atan2(entity->position.x, entity->position.z, npc->pos.x, npc->pos.z);
D_802BFDF8_320B68->unk_14 = 6.0f;
D_802BFDF8_320B68->unk_18 = 50.0f;
D_802BFDF8_320B68->unk_00 = 0x78;
npc->flags |= 0x40148;
npc->flags &= ~0x200;
case 1:
sin_cos_rad((D_802BFDF8_320B68->unk_10 * TAU) / 360.0f, &sp10, &sp14);
npc->pos.x = entity->position.x + (sp10 * D_802BFDF8_320B68->unk_0C);
npc->pos.z = entity->position.z - (sp14 * D_802BFDF8_320B68->unk_0C);
D_802BFDF8_320B68->unk_10 = clamp_angle(D_802BFDF8_320B68->unk_10 - D_802BFDF8_320B68->unk_14);
if (D_802BFDF8_320B68->unk_0C > 20.0f) {
D_802BFDF8_320B68->unk_0C--;
} else if (D_802BFDF8_320B68->unk_0C < 19.0f) {
D_802BFDF8_320B68->unk_0C++;
}
tempY = sin_rad((D_802BFDF8_320B68->unk_18 * TAU) / 360.0f) * 3.0f;
D_802BFDF8_320B68->unk_18 += 3.0f;
if (D_802BFDF8_320B68->unk_18 > 150.0f) {
D_802BFDF8_320B68->unk_18 = 150.0f;
}
npc->pos.y += tempY;
npc->renderYaw = clamp_angle(360.0f - D_802BFDF8_320B68->unk_10);
D_802BFDF8_320B68->unk_14 += 0.8;
if (D_802BFDF8_320B68->unk_14 > 40.0f) {
D_802BFDF8_320B68->unk_14 = 40.0f;
}
if (--D_802BFDF8_320B68->unk_00 == 0) {
D_802BFDF8_320B68->unk_04++;
}
break;
case 2:
npc->flags = D_802BFDF8_320B68->unk_08;
D_802BFDF8_320B68->unk_00 = 0x1E;
D_802BFDF8_320B68->unk_04++;
break;
case 3:
partner_walking_update_player_tracking(npc);
partner_walking_update_motion(npc);
if (--D_802BFDF8_320B68->unk_00 == 0) {
D_802BFDF8_320B68->unk_04 = 0;
D_8010C954 = 0;
}
break;
}
return 0;
}
#include "world/common/UnkPartnerFunc2.inc.c"
INCLUDE_ASM(s32, "world/partner/sushie", func_802BF920_320690);

View File

@ -6,7 +6,7 @@ glabel D_802BE880_3195D0
.word 0x00000043, 0x00000001, func_802BD300_318050, 0x00000002, 0x00000000, 0x00000001, 0x00000000
glabel D_802BE89C_3195EC
.word 0x802BE940, 0x00000043, 0x00000001, func_802BD338_318088, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BD758_3184A8, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BE4E8_319238, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000
.word 0x802BE940, 0x00000043, 0x00000001, world_partner_bombette_UnkPartnerFunc2, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BD758_3184A8, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BE4E8_319238, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000
glabel D_802BE900_319650
.double 0.8

View File

@ -6,4 +6,4 @@ glabel D_802BEA90_31B000
.word 0x00000043, 0x00000001, func_802BD148_3196B8, 0x00000002, 0x00000000, 0x00000001, 0x00000000
glabel D_802BEAAC_31B01C
.word 0x802BEBC8, 0x00000043, 0x00000001, func_802BD180_3196F0, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BD660_319BD0, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BE8D4_31AE44, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000
.word 0x802BEBC8, 0x00000043, 0x00000001, world_partner_parakarry_UnkPartnerFunc2, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BD660_319BD0, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BE8D4_31AE44, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000

View File

@ -6,4 +6,4 @@ glabel D_802BEB40_31CB60
.word 0x00000000, 0x00000043, 0x00000001, func_802BD228_31B248, 0x00000002, 0x00000000, 0x00000001, 0x00000000
glabel D_802BEB60_31CB80
.word 0x802BEC80, 0x00000043, 0x00000001, func_802BD260_31B280, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BD638_31B658, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BE7E0_31C800, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000
.word 0x802BEC80, 0x00000043, 0x00000001, world_partner_kooper_UnkPartnerFunc2, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BD638_31B658, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BE7E0_31C800, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000

View File

@ -15,4 +15,4 @@ glabel D_802BFDBC_320B2C
.word 0x00000000, 0x00000043, 0x00000001, func_802BE3A4_31F114, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BF568_3202D8, 0x00000002, 0x00000000, 0x00000001, 0x00000000
glabel D_802BFDF8_320B68
.word D_802BFF10, 0x00000043, 0x00000001, func_802BF5A0_320310, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BF964_3206D4, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BFAB8_320828, 0x00000002, 0x00000000, 0x00000001, 0x00000000
.word D_802BFF10, 0x00000043, 0x00000001, world_partner_sushi_UnkPartnerFunc2, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BF964_3206D4, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BFAB8_320828, 0x00000002, 0x00000000, 0x00000001, 0x00000000

View File

@ -6,7 +6,7 @@ glabel D_802BFE60_3239B0
.word 0x00000043, 0x00000001, func_802BD29C_320DEC, 0x00000002, 0x00000000, 0x00000001, 0x00000000
glabel D_802BFE7C_3239CC
.word 0x802BFF30, 0x00000043, 0x00000001, func_802BD2D4_320E24, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BE724_322274, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BF4F0_323040, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BFBA0_3236F0
.word 0x802BFF30, 0x00000043, 0x00000001, world_partner_lakilester_UnkPartnerFunc2, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BE724_322274, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BF4F0_323040, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BFBA0_3236F0
glabel D_802BFEE0
.word 0x00000002

View File

@ -6,4 +6,4 @@ glabel D_802BDFE0_324930
.word 0x00000043, 0x00000001, func_802BD130_323A80, 0x00000002, 0x00000000, 0x00000001, 0x00000000
glabel D_802BDFFC_32494C
.word 0x802BE0C8, 0x00000043, 0x00000001, func_802BD168_323AB8, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BD694_323FE4, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BDF08_324858, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000
.word 0x802BE0C8, 0x00000043, 0x00000001, world_partner_bow_UnkPartnerFunc2, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BD694_323FE4, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802BDF08_324858, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000

View File

@ -4698,7 +4698,7 @@ D_802BDE88_317DA8 = 0x802BDE88; // type:data rom:0x317DA8
func_802BD100_317E50 = 0x802BD100; // type:func rom:0x317E50
func_802BD2D8_318028 = 0x802BD2D8; // type:func rom:0x318028
func_802BD300_318050 = 0x802BD300; // type:func rom:0x318050
func_802BD338_318088 = 0x802BD338; // type:func rom:0x318088
world_partner_bombette_UnkPartnerFunc2 = 0x802BD338; // type:func rom:0x318088
func_802BD6DC_31842C = 0x802BD6DC; // type:func rom:0x31842C
func_802BD720_318470 = 0x802BD720; // type:func rom:0x318470
func_802BD748 = 0x802BD748; // type:func rom:0x318498
@ -4708,7 +4708,7 @@ func_802BE520_319270 = 0x802BE520; // type:func rom:0x319270
func_802BE6E8_319438 = 0x802BE6E8; // type:func rom:0x319438
func_802BD100_319670 = 0x802BD100; // type:func rom:0x319670
func_802BD148_3196B8 = 0x802BD148; // type:func rom:0x3196B8
func_802BD180_3196F0 = 0x802BD180; // type:func rom:0x3196F0
world_partner_parakarry_UnkPartnerFunc2 = 0x802BD180; // type:func rom:0x3196F0
func_802BD514_319A84 = 0x802BD514; // type:func rom:0x319A84
func_802BD558_319AC8 = 0x802BD558; // type:func rom:0x319AC8
func_802BD660_319BD0 = 0x802BD660; // type:func rom:0x319BD0
@ -4724,7 +4724,7 @@ func_802BD144_31B164 = 0x802BD144; // type:func rom:0x31B164
func_802BD17C_31B19C = 0x802BD17C; // type:func rom:0x31B19C
func_802BD200_31B220 = 0x802BD200; // type:func rom:0x31B220
func_802BD228_31B248 = 0x802BD228; // type:func rom:0x31B248
func_802BD260_31B280 = 0x802BD260; // type:func rom:0x31B280
world_partner_kooper_UnkPartnerFunc2 = 0x802BD260; // type:func rom:0x31B280
func_802BD5F4_31B614 = 0x802BD5F4; // type:func rom:0x31B614
func_802BD638_31B658 = 0x802BD638; // type:func rom:0x31B658
func_802BE7E0_31C800 = 0x802BE7E0; // type:func rom:0x31C800
@ -4760,7 +4760,7 @@ func_802BE280_31EFF0 = 0x802BE280; // type:func rom:0x31EFF0
func_802BE3A4_31F114 = 0x802BE3A4; // type:func rom:0x31F114
func_802BF520_320290 = 0x802BF520; // type:func rom:0x320290
func_802BF568_3202D8 = 0x802BF568; // type:func rom:0x3202D8
func_802BF5A0_320310 = 0x802BF5A0; // type:func rom:0x320310
world_partner_sushi_UnkPartnerFunc2 = 0x802BF5A0; // type:func rom:0x320310
func_802BF920_320690 = 0x802BF920; // type:func rom:0x320690
func_802BF964_3206D4 = 0x802BF964; // type:func rom:0x3206D4
func_802BF9B8_320728 = 0x802BF9B8; // type:func rom:0x320728
@ -4774,7 +4774,7 @@ D_802BFED8_320C48 = 0x802BFED8; // type:data rom:0x320C48
func_802BD100_320C50 = 0x802BD100; // type:func rom:0x320C50
func_802BD21C_320D6C = 0x802BD21C; // type:func rom:0x320D6C
func_802BD29C_320DEC = 0x802BD29C; // type:func rom:0x320DEC
func_802BD2D4_320E24 = 0x802BD2D4; // type:func rom:0x320E24
world_partner_lakilester_UnkPartnerFunc2 = 0x802BD2D4; // type:func rom:0x320E24
func_802BD678_3211C8 = 0x802BD678; // type:func rom:0x3211C8
func_802BD6BC_32120C = 0x802BD6BC; // type:func rom:0x32120C
func_802BD7DC = 0x802BD7DC; // type:func rom:0x32132C
@ -4790,7 +4790,7 @@ func_802BFB44_323694 = 0x802BFB44; // type:func rom:0x323694
func_802BFBA0_3236F0 = 0x802BFBA0; // type:func rom:0x3236F0
func_802BD100_323A50 = 0x802BD100; // type:func rom:0x323A50
func_802BD130_323A80 = 0x802BD130; // type:func rom:0x323A80
func_802BD168_323AB8 = 0x802BD168; // type:func rom:0x323AB8
world_partner_bow_UnkPartnerFunc2 = 0x802BD168; // type:func rom:0x323AB8
func_802BD4FC_323E4C = 0x802BD4FC; // type:func rom:0x323E4C
func_802BD540_323E90 = 0x802BD540; // type:func rom:0x323E90
func_802BD694_323FE4 = 0x802BD694; // type:func rom:0x323FE4