mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
Implement & link ac_npc_super_master
This commit is contained in:
+1
-1
@@ -1134,7 +1134,7 @@ config.libs = [
|
||||
Object(NonMatching, "actor/npc/ac_npc_sleep_obaba.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_soncho.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_station_master.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_super_master.c"),
|
||||
Object(Matching, "actor/npc/ac_npc_super_master.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_totakeke.c"),
|
||||
Object(NonMatching, "actor/npc/ac_present_npc.c"),
|
||||
Object(NonMatching, "actor/npc/ac_taisou_npc0.c"),
|
||||
|
||||
@@ -3,11 +3,17 @@
|
||||
|
||||
#include "types.h"
|
||||
#include "m_actor.h"
|
||||
#include "ac_npc.h"
|
||||
#include "m_mail_password_check.h"
|
||||
#include "m_private.h"
|
||||
#include "ac_npc_shop_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef NPC_SHOP_COMMON_ACTOR NPC_SUPER_MASTER_ACTOR;
|
||||
|
||||
extern ACTOR_PROFILE Npc_Super_Master_Profile;
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -15,4 +21,3 @@ extern ACTOR_PROFILE Npc_Super_Master_Profile;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
#include "ac_npc_super_master.h"
|
||||
|
||||
#include "m_shop.h"
|
||||
#include "m_common_data.h"
|
||||
#include "m_font.h"
|
||||
#include "m_msg.h"
|
||||
#include "m_private.h"
|
||||
#include "m_string.h"
|
||||
#include "m_actor_type.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "m_mail_password_check.h"
|
||||
#include "m_actor.h"
|
||||
#include "m_actor_type.h"
|
||||
#include "m_camera2.h"
|
||||
#include "m_house.h"
|
||||
#include "m_melody.h"
|
||||
#include "m_scene.h"
|
||||
#include "m_collision_bg.h"
|
||||
#include "m_demo.h"
|
||||
#include "m_player.h"
|
||||
#include "m_bgm.h"
|
||||
#include "ac_npc.h"
|
||||
#include "ac_uki.h"
|
||||
#include "ac_npc_anim_def.h"
|
||||
|
||||
void aNSPM_actor_ct(ACTOR* super_master, GAME* game);
|
||||
void aNSPM_actor_dt(ACTOR* actorx, GAME* game);
|
||||
void aNSPM_actor_move(ACTOR* actorx, GAME* game);
|
||||
void aNSPM_actor_draw(ACTOR* actorx, GAME* game);
|
||||
void aNSPM_actor_init(ACTOR* actorx, GAME* game);
|
||||
void aNSPM_actor_save(ACTOR* actorx, GAME* game);
|
||||
|
||||
// clang-format off
|
||||
ACTOR_PROFILE Npc_Super_Master_Profile = {
|
||||
mAc_PROFILE_NPC_SUPER_MASTER,
|
||||
ACTOR_PART_NPC,
|
||||
ACTOR_STATE_NONE,
|
||||
SP_NPC_SUPER_MASTER,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(NPC_SUPER_MASTER_ACTOR),
|
||||
&aNSPM_actor_ct,
|
||||
&aNSPM_actor_dt,
|
||||
&aNSPM_actor_init,
|
||||
mActor_NONE_PROC1,
|
||||
&aNSPM_actor_save,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
// TODO: are these declared in every file? DnM+ says they're static yet they seemingly must be defined after their usage...
|
||||
static void aNSC_setupAction(NPC_SUPER_MASTER_ACTOR *super_master, GAME_PLAY* play, int p3);
|
||||
static int aNSC_check_buy_item_sub(u32 *p1, mActor_name_t itm_name);
|
||||
static int aNSC_check_buy_paper(u32 *p1, mActor_name_t itm_name);
|
||||
static void aNSC_init_proc(NPC_SUPER_MASTER_ACTOR *super_master, GAME_PLAY * play, int p3);
|
||||
static void aNSC_BGcheck(ACTOR* actorx);
|
||||
static void aNSC_set_zone_data(NPC_SUPER_MASTER_ACTOR* super_master, ACTOR* actor);
|
||||
static void aNSC_set_player_angl(NPC_SUPER_MASTER_ACTOR* super_master);
|
||||
static void aNSC_talk_demo_proc(ACTOR* actorx);
|
||||
static void aNSC_sell_camera(NPC_SUPER_MASTER_ACTOR* super_master, GAME_PLAY* play);
|
||||
|
||||
void aNSPM_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
static aNPC_ct_data_c ct_data = {
|
||||
&aNSPM_actor_move, &aNSPM_actor_draw, 0, NULL, NULL, NULL, 1,
|
||||
};
|
||||
|
||||
NPC_SUPER_MASTER_ACTOR* super_master = (NPC_SUPER_MASTER_ACTOR*)actorx;
|
||||
int action;
|
||||
|
||||
CLIP(npc_clip)->ct_proc(actorx, game, &ct_data);
|
||||
|
||||
super_master->npc_class.draw.main_animation.keyframe.morph_counter = 0.0f;
|
||||
super_master->sell_item = EMPTY_NO;
|
||||
super_master->npc_class.condition_info.hide_flg = FALSE;
|
||||
super_master->talk_start_tim = -1;
|
||||
actorx->shape_info.draw_shadow = TRUE;
|
||||
|
||||
if (Common_Get(door_data).door_actor_name == RSV_NO) {
|
||||
super_master->npc_class.talk_info.melody_inst = 0;
|
||||
action = 61;
|
||||
} else {
|
||||
action = 0;
|
||||
}
|
||||
|
||||
aNSC_setupAction(super_master, (GAME_PLAY*)game, action);
|
||||
}
|
||||
|
||||
void aNSPM_actor_save(ACTOR* actorx, GAME* game) {
|
||||
(CLIP(npc_clip)->save_proc)(actorx, game);
|
||||
}
|
||||
|
||||
void aNSPM_actor_dt(ACTOR* actorx, GAME* game) {
|
||||
(CLIP(npc_clip)->dt_proc)(actorx, game);
|
||||
}
|
||||
|
||||
void aNSPM_actor_init(ACTOR* actorx, GAME* game) {
|
||||
(CLIP(npc_clip)->init_proc)(actorx, game);
|
||||
}
|
||||
|
||||
void aNSPM_actor_draw(ACTOR* actorx, GAME* game) {
|
||||
(CLIP(npc_clip)->draw_proc)(actorx, game);
|
||||
}
|
||||
|
||||
#include "../src/actor/npc/ac_npc_super_master_move.c_inc"
|
||||
@@ -0,0 +1,70 @@
|
||||
{ aNPC_ANIM_WAIT1, FALSE },
|
||||
{ aNPC_ANIM_WALK1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WALK1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WALK1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WALK1, TRUE },
|
||||
{ aNPC_ANIM_TRANSFER1, TRUE },
|
||||
{ aNPC_ANIM_TRANS_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_TRANSFER1, TRUE },
|
||||
{ aNPC_ANIM_TRANS_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, FALSE },
|
||||
{ aNPC_ANIM_WALK1, FALSE },
|
||||
{ aNPC_ANIM_WALK1, FALSE },
|
||||
{ aNPC_ANIM_RUN1, FALSE },
|
||||
{ aNPC_ANIM_RUN1, FALSE },
|
||||
{ aNPC_ANIM_WALK1, FALSE },
|
||||
{ aNPC_ANIM_WAIT1, FALSE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, FALSE }
|
||||
@@ -0,0 +1,252 @@
|
||||
static int aNSPM_get_zone_sub(f32 pos, f32* chk_p, int count) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
if (pos < *chk_p) {
|
||||
break;
|
||||
}
|
||||
|
||||
chk_p++;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
static u8 aNSPM_get_zone(xyz_t wpos) {
|
||||
static f32 chk0[] = { 140.0f, 240.0f, 280.0f, 400.0f };
|
||||
static f32 chk1[] = { 140.0f, 220.0f, 300.0f, 380.0f };
|
||||
|
||||
u8 zone;
|
||||
|
||||
if (wpos.z < 120.0f) {
|
||||
zone = (int)(wpos.x - mFI_UT_WORLDSIZE_X_F) / (2 * mFI_UT_WORLDSIZE_X);
|
||||
} else if (wpos.z < 160.0f) {
|
||||
zone = 5 + aNSPM_get_zone_sub(wpos.x, chk0, ARRAY_COUNT(chk0));
|
||||
} else if (wpos.z < 280.0f) {
|
||||
if (wpos.x < 220.0f) {
|
||||
zone = 10 + aNSPM_get_zone_sub(wpos.x, chk1, 1);
|
||||
} else if (wpos.z < 200.0f) {
|
||||
if (wpos.x < 340.0f) {
|
||||
zone = 12;
|
||||
} else {
|
||||
zone = 13;
|
||||
}
|
||||
} else {
|
||||
zone = 14 + aNSPM_get_zone_sub(wpos.x, chk1 + 2, 2);
|
||||
}
|
||||
} else {
|
||||
zone = aNSPM_get_zone_sub(wpos.x, chk1, ARRAY_COUNT(chk1));
|
||||
if (zone < 2) {
|
||||
if (wpos.z < 400.0f) {
|
||||
zone += 17;
|
||||
} else {
|
||||
zone += 22;
|
||||
}
|
||||
} else {
|
||||
if (wpos.z < 360.0f) {
|
||||
zone += 17;
|
||||
} else {
|
||||
zone += 22;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return zone;
|
||||
}
|
||||
|
||||
static u8 aNSPM_get_next_zone(u8 p1, u8 p2) {
|
||||
static u8 next_zone[27][27] = {
|
||||
{
|
||||
0x00, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
|
||||
0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
|
||||
},
|
||||
{
|
||||
0x06, 0x01, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
|
||||
0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
|
||||
},
|
||||
{
|
||||
0x07, 0x07, 0x02, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
|
||||
0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
|
||||
},
|
||||
{
|
||||
0x08, 0x08, 0x08, 0x03, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
|
||||
0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
|
||||
},
|
||||
{
|
||||
0x09, 0x09, 0x09, 0x09, 0x04, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09,
|
||||
0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09,
|
||||
},
|
||||
{
|
||||
0x00, 0x06, 0x06, 0x06, 0x06, 0x05, 0x06, 0x06, 0x06, 0x06, 0x0A, 0x06, 0x06, 0x06,
|
||||
0x06, 0x06, 0x06, 0x0A, 0x06, 0x06, 0x06, 0x06, 0x0A, 0x06, 0x06, 0x06, 0x06,
|
||||
},
|
||||
{
|
||||
0x05, 0x01, 0x07, 0x07, 0x07, 0x05, 0x06, 0x07, 0x07, 0x07, 0x05, 0x0B, 0x07, 0x07,
|
||||
0x07, 0x07, 0x07, 0x05, 0x0B, 0x07, 0x07, 0x07, 0x05, 0x0B, 0x07, 0x07, 0x07,
|
||||
},
|
||||
{
|
||||
0x06, 0x06, 0x02, 0x08, 0x08, 0x06, 0x06, 0x07, 0x08, 0x08, 0x06, 0x06, 0x0C, 0x08,
|
||||
0x0C, 0x0C, 0x0C, 0x06, 0x06, 0x0C, 0x0C, 0x0C, 0x06, 0x06, 0x0C, 0x0C, 0x0C,
|
||||
},
|
||||
{
|
||||
0x07, 0x07, 0x07, 0x03, 0x09, 0x07, 0x07, 0x07, 0x08, 0x09, 0x07, 0x07, 0x07, 0x09,
|
||||
0x07, 0x07, 0x09, 0x07, 0x07, 0x07, 0x07, 0x09, 0x07, 0x07, 0x07, 0x07, 0x09,
|
||||
},
|
||||
{
|
||||
0x08, 0x08, 0x08, 0x08, 0x04, 0x08, 0x08, 0x08, 0x08, 0x09, 0x08, 0x08, 0x08, 0x0D,
|
||||
0x0D, 0x0D, 0x0D, 0x08, 0x08, 0x08, 0x0D, 0x0D, 0x08, 0x08, 0x08, 0x0D, 0x0D,
|
||||
},
|
||||
{
|
||||
0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x0A, 0x05, 0x05, 0x05,
|
||||
0x05, 0x05, 0x05, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
|
||||
},
|
||||
{
|
||||
0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0B, 0x06, 0x06,
|
||||
0x06, 0x06, 0x06, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12,
|
||||
},
|
||||
{
|
||||
0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x0C, 0x07,
|
||||
0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E,
|
||||
},
|
||||
{
|
||||
0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0D,
|
||||
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
|
||||
},
|
||||
{
|
||||
0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0F,
|
||||
0x0E, 0x0F, 0x0F, 0x13, 0x13, 0x13, 0x0F, 0x0F, 0x13, 0x13, 0x13, 0x0F, 0x0F,
|
||||
},
|
||||
{
|
||||
0x0E, 0x0E, 0x0E, 0x10, 0x10, 0x0E, 0x0E, 0x0E, 0x10, 0x10, 0x0E, 0x0E, 0x0E, 0x10,
|
||||
0x0E, 0x0F, 0x10, 0x0E, 0x0E, 0x0E, 0x14, 0x10, 0x0E, 0x0E, 0x0E, 0x14, 0x10,
|
||||
},
|
||||
{
|
||||
0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0F, 0x0F, 0x0F, 0x0D,
|
||||
0x0F, 0x0F, 0x10, 0x0F, 0x0F, 0x0F, 0x0F, 0x15, 0x0F, 0x0F, 0x0F, 0x0F, 0x15,
|
||||
},
|
||||
{
|
||||
0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
|
||||
0x16, 0x16, 0x16, 0x11, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16,
|
||||
},
|
||||
{
|
||||
0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B,
|
||||
0x17, 0x17, 0x17, 0x17, 0x12, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17,
|
||||
},
|
||||
{
|
||||
0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E,
|
||||
0x0E, 0x0E, 0x0E, 0x18, 0x18, 0x13, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
|
||||
},
|
||||
{
|
||||
0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
|
||||
0x0F, 0x0F, 0x0F, 0x19, 0x19, 0x19, 0x14, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19,
|
||||
},
|
||||
{
|
||||
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
|
||||
0x10, 0x10, 0x10, 0x1A, 0x1A, 0x1A, 0x1A, 0x15, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
|
||||
},
|
||||
{
|
||||
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
|
||||
0x17, 0x17, 0x17, 0x11, 0x17, 0x17, 0x17, 0x17, 0x16, 0x17, 0x17, 0x17, 0x17,
|
||||
},
|
||||
{
|
||||
0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x16, 0x12, 0x18, 0x18,
|
||||
0x18, 0x18, 0x18, 0x16, 0x12, 0x18, 0x18, 0x18, 0x16, 0x17, 0x18, 0x18, 0x18,
|
||||
},
|
||||
{
|
||||
0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x17, 0x17, 0x13, 0x19,
|
||||
0x13, 0x13, 0x19, 0x17, 0x17, 0x13, 0x19, 0x19, 0x17, 0x17, 0x18, 0x19, 0x19,
|
||||
},
|
||||
{
|
||||
0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x18, 0x18, 0x14, 0x14,
|
||||
0x14, 0x14, 0x14, 0x18, 0x18, 0x18, 0x14, 0x1A, 0x18, 0x18, 0x18, 0x19, 0x1A,
|
||||
},
|
||||
{
|
||||
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x19, 0x19, 0x15, 0x15,
|
||||
0x15, 0x15, 0x15, 0x19, 0x19, 0x19, 0x19, 0x15, 0x19, 0x19, 0x19, 0x19, 0x1A,
|
||||
},
|
||||
};
|
||||
|
||||
return next_zone[p2][p1];
|
||||
}
|
||||
|
||||
static void aNSPM_search_player(NPC_SUPER_MASTER_ACTOR* super_master, GAME_PLAY* play) {
|
||||
ACTOR* actorx = (ACTOR*)super_master;
|
||||
ACTOR* player = GET_PLAYER_ACTOR_ACTOR(play);
|
||||
|
||||
if (player != NULL) {
|
||||
s16 angle = actorx->shape_info.rotation.y - super_master->player_angle;
|
||||
if (ABS(angle) > DEG2SHORT_ANGLE(90.0f)) {
|
||||
aNSC_setupAction(super_master, play, 66);
|
||||
} else {
|
||||
chase_angle(&actorx->shape_info.rotation.y, super_master->player_angle, DEG2SHORT_ANGLE(11.25f));
|
||||
actorx->world.angle.y = actorx->shape_info.rotation.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aNSPM_search_player2(NPC_SUPER_MASTER_ACTOR* super_master, GAME_PLAY* play) {
|
||||
static float posX[27] = {
|
||||
100.0f, 180.0f, 260.0f, 340.0f, 420.0f, 100.0f, 180.0f, 260.0f, 340.0f, 420.0f, 100.0f, 180.0f, 260.0f, 420.0f,
|
||||
260.0f, 340.0f, 420.0f, 100.0f, 180.0f, 260.0f, 340.0f, 420.0f, 100.0f, 180.0f, 260.0f, 340.0f, 420.0f,
|
||||
};
|
||||
|
||||
static float posZ[27] = {
|
||||
100.0f, 100.0f, 100.0f, 100.0f, 100.0f, 140.0f, 140.0f, 140.0f, 140.0f, 140.0f, 220.0f, 220.0f, 180.0f, 180.0f,
|
||||
240.0f, 240.0f, 240.0f, 340.0f, 340.0f, 320.0f, 320.0f, 320.0f, 420.0f, 420.0f, 420.0f, 380.0f, 380.0f,
|
||||
};
|
||||
|
||||
PLAYER_ACTOR* player = GET_PLAYER_ACTOR(play);
|
||||
if (player != NULL) {
|
||||
f32 dx = posX[super_master->next_zone] - super_master->npc_class.actor_class.world.position.x;
|
||||
f32 dz = posZ[super_master->next_zone] - super_master->npc_class.actor_class.world.position.z;
|
||||
|
||||
s16 angle = atans_table(dz, dx);
|
||||
chase_angle(&super_master->npc_class.actor_class.shape_info.rotation.y, angle, DEG2SHORT_ANGLE(11.25f));
|
||||
|
||||
super_master->npc_class.actor_class.world.angle.y = super_master->npc_class.actor_class.shape_info.rotation.y;
|
||||
|
||||
if (SQ(dx) + SQ(dz) < 200.0f) {
|
||||
super_master->next_zone = aNSPM_get_next_zone(super_master->player_zone, super_master->zone);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int aNSPM_check_safe_zone(NPC_SUPER_MASTER_ACTOR* super_master, ACTOR* player) {
|
||||
int res = FALSE;
|
||||
if (player->world.position.z > 440.0f && (super_master->zone == 24 || super_master->zone == 25)) {
|
||||
res = TRUE;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
#define aNSC_get_zone aNSPM_get_zone
|
||||
#define aNSC_get_next_zone aNSPM_get_next_zone
|
||||
#define aNSC_check_safe_zone aNSPM_check_safe_zone
|
||||
#define aNSC_search_player aNSPM_search_player
|
||||
#define aNSC_search_player2 aNSPM_search_player2
|
||||
#define aNSC_ANIME_FILE "../src/actor/npc/ac_npc_super_master_anime.c"
|
||||
#define aNSC_POS_Z_MAX 420.0f
|
||||
|
||||
#include "../src/actor/npc/ac_npc_shop_common.c"
|
||||
|
||||
#undef aNSC_get_zone
|
||||
#undef aNSC_get_next_zone
|
||||
#undef aNSC_check_safe_zone
|
||||
#undef aNSC_search_player
|
||||
#undef aNSC_search_player2
|
||||
#undef aNSC_ANIME_FILE
|
||||
#undef aNSC_POS_Z_MAX
|
||||
|
||||
void aNSPM_actor_move(ACTOR* actorx, GAME* game) {
|
||||
NPC_SUPER_MASTER_ACTOR* super_master = (NPC_SUPER_MASTER_ACTOR*)actorx;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
PLAYER_ACTOR* player = GET_PLAYER_ACTOR(play);
|
||||
CLIP(npc_clip)->move_before_proc(actorx, game);
|
||||
aNSC_BGcheck(actorx);
|
||||
aNSC_set_zone_data(super_master, (ACTOR*)player);
|
||||
aNSC_set_player_angl(super_master);
|
||||
(*super_master->proc)(super_master, play);
|
||||
aNSC_talk_demo_proc(actorx);
|
||||
CLIP(npc_clip)->move_after_proc(actorx, game);
|
||||
aNSC_sell_camera(super_master, play);
|
||||
}
|
||||
Reference in New Issue
Block a user