mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
Link ac_npc_shop_master, implement & link ac_npc_mamedanuki
This commit is contained in:
+2
-2
@@ -1113,7 +1113,7 @@ config.libs = [
|
||||
Object(NonMatching, "actor/npc/ac_npc_majin3.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_majin4.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_majin5.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_mamedanuki.c"),
|
||||
Object(Matching, "actor/npc/ac_npc_mamedanuki.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_mask_cat.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_mask_cat2.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_needlework.c"),
|
||||
@@ -1129,7 +1129,7 @@ config.libs = [
|
||||
Object(Matching, "actor/npc/ac_npc_rtc.c"),
|
||||
Object(Matching, "actor/npc/ac_npc_sendo.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_shasho.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_shop_master.c"),
|
||||
Object(Matching, "actor/npc/ac_npc_shop_master.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_shop_mastersp.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_sleep_obaba.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_soncho.c"),
|
||||
|
||||
@@ -2,12 +2,25 @@
|
||||
#define AC_NPC_MAMEDANUKI_H
|
||||
|
||||
#include "types.h"
|
||||
#include "m_actor.h"
|
||||
#include "ac_npc.h"
|
||||
#include "m_private.h"
|
||||
#include "ac_npc_shop_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum {
|
||||
aNMD_ZONE_0,
|
||||
aNMD_ZONE_1,
|
||||
aNMD_ZONE_2,
|
||||
aNMD_ZONE_3,
|
||||
|
||||
aNMD_ZONE_NUM
|
||||
};
|
||||
|
||||
typedef NPC_SHOP_COMMON_ACTOR NPC_MAMEDANUKI_ACTOR;
|
||||
|
||||
extern ACTOR_PROFILE Npc_Mamedanuki_Profile;
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -15,4 +28,3 @@ extern ACTOR_PROFILE Npc_Mamedanuki_Profile;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "ac_npc.h"
|
||||
#include "m_mail_password_check.h"
|
||||
#include "m_font.h"
|
||||
#include "m_player_lib.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -22,79 +23,7 @@ extern "C" {
|
||||
#define aNSC_LOAN_STATUE 0
|
||||
#define aNSC_LOAN_BASEMENT 49800
|
||||
|
||||
enum aNSC_action {
|
||||
aNSC_ACTION_EMPTY,
|
||||
aNSC_ACTION_SAY_HELLO_APPROACH,
|
||||
aNSC_ACTION_SAY_HELLO_END_WAIT,
|
||||
aNSC_ACTION_03_SAY_HELLO_END_WAIT,
|
||||
aNSC_ACTION_CHECK_ROOF_COL_ORDER,
|
||||
aNSC_ACTION_CHECK_ROOF_COL_ORDER2,
|
||||
aNSC_ACTION_CHECK_COL_CHG_OR_MAKE_BASEMENT,
|
||||
aNSC_ACTION_PRESENT_BALLOON_START_WAIT,
|
||||
aNSC_ACTION_PRESENT_BALLOON_TRANS_MOVE,
|
||||
aNSC_ACTION_PRESENT_BALLOON_TRANS_TAKEOUT,
|
||||
aNSC_ACTION_PRESENT_BALLOON_TRANS_WAIT,
|
||||
aNSC_ACTION_PRESENT_BALLOON_END_WAIT,
|
||||
aNSC_ACTION_REQUEST_Q_START_WAIT,
|
||||
aNSC_ACTION_REQUEST_Q_ANSWER_WAIT,
|
||||
aNSC_ACTION_REQUEST_Q_ANSWER_WAIT2,
|
||||
aNSC_ACTION_REQUEST_Q_END_WAIT,
|
||||
aNSC_ACTION_ANSWER_BUY_ITEM,
|
||||
aNSC_ACTION_BUY_MENU_OPEN_WAIT,
|
||||
aNSC_ACTION_BUY_MENU_CLOSE_WAIT,
|
||||
aNSC_ACTION_MSG_WIN_OPEN_WAIT,
|
||||
aNSC_ACTION_BUY_SUM_CHECK,
|
||||
aNSC_ACTION_BUY_CHECK,
|
||||
aNSC_ACTION_BUY_AFTER_SERVICE,
|
||||
aNSC_ACTION_BUY_CONTINUE_CHECK,
|
||||
aNSC_ACTION_RECEIVE_CHECK,
|
||||
aNSC_ACTION_19_ANSWER_BUY_ITEM,
|
||||
aNSC_ACTION_0x1a_UNUSED,
|
||||
aNSC_ACTION_0x1b_UNUSED,
|
||||
aNSC_ACTION_MSG_WIN_OPEN_WAIT2,
|
||||
aNSC_ACTION_ORDER_CHECK,
|
||||
aNSC_ACTION_SELL_CHECK_BEFORE,
|
||||
aNSC_ACTION_SELL_CHECK,
|
||||
aNSC_ACTION_SELL_ANSWER0,
|
||||
aNSC_ACTION_21_REQUEST_Q_END_WAIT,
|
||||
aNSC_ACTION_SELL_ITEM_WITHOUT_TICKET,
|
||||
aNSC_ACTION_SELL_ITEM_WITH_TICKET,
|
||||
aNSC_ACTION_SELL_ITEM_POCKETS_FULL,
|
||||
aNSC_ACTION_SELL_ITEM_INSUFICIENT_FUNDS,
|
||||
aNSC_ACTION_SHOW_ITEM_CHECK,
|
||||
aNSC_ACTION_CHG_CLOTH_START_WAIT,
|
||||
aNSC_ACTION_CHG_CLOTH_END_WAIT,
|
||||
aNSC_ACTION_PW_ENTRY_SEND_ADDR_START_WAIT,
|
||||
aNSC_ACTION_2A_BUY_MENU_OPEN_WAIT,
|
||||
aNSC_ACTION_0x2b_UNUSED,
|
||||
aNSC_ACTION_PW_MSG_WIN_OPEN_WAIT,
|
||||
aNSC_ACTION_PW_SEND_ADDR_CHECK,
|
||||
aNSC_ACTION_PW_SEL_ITEM_START_WAIT,
|
||||
aNSC_ACTION_2F_BUY_MENU_OPEN_WAIT,
|
||||
aNSC_ACTION_0x30_UNUSED,
|
||||
aNSC_ACTION_0x31_UNUSED,
|
||||
aNSC_ACTION_PW_SEND_CHECK,
|
||||
aNSC_ACTION_PW_RETRY_SEL_ITEM_CHECK,
|
||||
aNSC_ACTION_PC_INPUT_PW_START_WAIT,
|
||||
aNSC_ACTION_35_BUY_MENU_OPEN_WAIT,
|
||||
aNSC_ACTION_0x36_UNUSED,
|
||||
aNSC_ACTION_PC_MSG_WIN_OPEN_WAIT,
|
||||
aNSC_ACTION_PC_RETRY_INPUT_PW_CHECK,
|
||||
aNSC_ACTION_PC_PRESENT_START_WAIT,
|
||||
aNSC_ACTION_PC_PRESENT_TRANS_TAKEOUT,
|
||||
aNSC_ACTION_PC_PRESENT_TRANS_WAIT,
|
||||
aNSC_ACTION_PC_PRESENT_END_WAIT,
|
||||
aNSC_ACTION_WAIT,
|
||||
aNSC_ACTION_0x3e_WAIT,
|
||||
aNSC_ACTION_WALK_PL_OTHER_ZONE,
|
||||
aNSC_ACTION_0x40_WAIT,
|
||||
aNSC_ACTION_0x41_WALK_PL_OTHER_ZONE,
|
||||
aNSC_ACTION_TURN,
|
||||
aNSC_ACTION_GOODBYE_WAIT,
|
||||
aNSC_ACTION_SAY_GOODBYE,
|
||||
aNSC_ACTION_EXIT_WAIT,
|
||||
aNSC_ACTION_NUM
|
||||
};
|
||||
#define aNSC_PLAYER_DISTANCE (f32)60.0
|
||||
|
||||
enum aNSC_msg_no {
|
||||
aNSC_MSG_WAIT = -0x1,
|
||||
@@ -122,7 +51,7 @@ enum aNSC_msg_no {
|
||||
aNSC_MSG_CANCEL,
|
||||
aNSC_MSG_START_CALL_NORMAL,
|
||||
aNSC_MSG_INTERACT_START,
|
||||
aNSC_MSG_INTERACT_CANCEl,
|
||||
aNSC_MSG_INTERACT_CANCEL,
|
||||
aNSC_MSG_KABU_INFO,
|
||||
aNSC_MSG_SELL_START,
|
||||
aNSC_MSG_SELL_OFFER,
|
||||
@@ -157,6 +86,11 @@ enum aNSC_msg_no {
|
||||
aNSC_MSG_SELL_QUEST,
|
||||
aNSC_MSG_JUNK_ACCEPT,
|
||||
aNSC_MSG_JUNK_CANCEL,
|
||||
aNSC_MSG_3B,
|
||||
aNSC_MSG_3C,
|
||||
aNSC_MSG_3D,
|
||||
aNSC_MSG_3E,
|
||||
aNSC_MSG_3F,
|
||||
aNSC_MSG_SELL_SHOVEL = 0x64,
|
||||
aNSC_MSG_SELL_NET,
|
||||
aNSC_MSG_SELL_ROD,
|
||||
@@ -199,7 +133,6 @@ enum aNSC_msg_no {
|
||||
aNSC_MSG_PSWD_GOOD_MAGAZINE_2,
|
||||
aNSC_MSG_GIFT_OUT,
|
||||
aNSC_MSG_PSWD_BAD,
|
||||
aNSC_MSG_TAKE_OFF_HANDS= 0x108a
|
||||
};
|
||||
|
||||
enum aNSC_wait_type {
|
||||
@@ -269,6 +202,13 @@ enum aNSC_request_show_type {
|
||||
aNSC_REQUEST_SHOW_TYPE_CARPET
|
||||
};
|
||||
|
||||
enum {
|
||||
aNSC_DAY_NORMAL,
|
||||
aNSC_DAY_FUKUBIKI,
|
||||
|
||||
aNSC_DAY_NUM
|
||||
};
|
||||
|
||||
typedef struct aNSC_animation_data_s {
|
||||
int anim;
|
||||
int talk_flag;
|
||||
@@ -282,6 +222,8 @@ typedef void (*aNSC_INIT_PROC)(NPC_SHOP_COMMON_ACTOR*, GAME_PLAY*);
|
||||
typedef int (*aNSC_PC_CHECK_PASSWORD_PROC)(mMpswd_password_c*);
|
||||
typedef void (*aNSC_ITEM_SELL_PROC)(NPC_SHOP_COMMON_ACTOR*, mActor_name_t);
|
||||
typedef void (*aNSC_ACTION_PROC)(NPC_SHOP_COMMON_ACTOR*, GAME_PLAY*);
|
||||
typedef void (*aNSC_TALK_PROC)(NPC_SHOP_COMMON_ACTOR*, GAME_PLAY*);
|
||||
typedef void (*aNSC_TALK_REQ_PROC)(NPC_SHOP_COMMON_ACTOR*, PLAYER_ACTOR*);
|
||||
|
||||
struct npc_shop_common_actor_s {
|
||||
/* 0x000 */ NPC_ACTOR npc_class;
|
||||
@@ -292,13 +234,14 @@ struct npc_shop_common_actor_s {
|
||||
/* 0x9A2 */ u8 zone;
|
||||
/* 0x9A3 */ u8 next_zone;
|
||||
/* 0x9A4 */ u8 player_zone;
|
||||
/* 0x9A5 */ u8 sale_type;
|
||||
/* 0x9A6 */ s16 player_angle;
|
||||
/* 0x9A8 */ u32 money;
|
||||
/* 0x9AC */ u32 value;
|
||||
/* 0x9B0 */ u32 counter;
|
||||
/* 0x9B4 */ mActor_name_t sell_item;
|
||||
/* 0x9B6 */ u8 ut_x;
|
||||
/* 0x9B7 */ u8 ut_y;
|
||||
/* 0x9B7 */ u8 ut_z;
|
||||
/* 0x9B8 */ u8 is_selling;
|
||||
/* 0x9B9 */ u8 _9B9;
|
||||
/* 0x9BA */ mActor_name_t order_item;
|
||||
|
||||
@@ -21,8 +21,6 @@ typedef NPC_SHOP_COMMON_ACTOR NPC_SHOP_MASTER_ACTOR;
|
||||
|
||||
extern ACTOR_PROFILE Npc_Shop_Master_Profile;
|
||||
|
||||
#define aNSC_PLAYER_DISTANCE (f32)60.0
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -541,6 +541,7 @@ extern int mNT_check_unknown(mActor_name_t item_no);
|
||||
#define ITEM_IS_MYUMBRELLA_TOOL(item) ((item) >= ITM_MY_ORG_UMBRELLA0 && (item) <= ITM_MY_ORG_UMBRELLA7)
|
||||
#define ITEM_IS_SCOOP(item) ((item) >= ITM_SHOVEL && (item) <= ITM_SHOVEL)
|
||||
#define ITEM_IS_GOLD_SCOOP(item) ((item) >= ITM_GOLDEN_SHOVEL && (item) <= ITM_GOLDEN_SHOVEL)
|
||||
#define ITEM_IS_PAINT(item) ((item) >= ITM_RED_PAINT && (item) <= ITM_BROWN_PAINT)
|
||||
|
||||
#define BG_CATEGORY 0
|
||||
#define ENV_CATEGORY 8
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
#include "ac_npc_mamedanuki.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"
|
||||
|
||||
#define aNSC_MAMEDANUKI
|
||||
|
||||
enum {
|
||||
aNMD_SALE_TYPE_NORMAL,
|
||||
aNMD_SALE_TYPE_FTR,
|
||||
aNMD_SALE_TYPE_CLOTH,
|
||||
aNMD_SALE_TYPE_CARPET,
|
||||
|
||||
aNMD_SALE_TYPE_NUM
|
||||
};
|
||||
|
||||
void aNMD_actor_ct(ACTOR* mamedanuki, GAME* game);
|
||||
void aNMD_actor_dt(ACTOR* actorx, GAME* game);
|
||||
void aNMD_actor_move(ACTOR* actorx, GAME* game);
|
||||
void aNMD_actor_draw(ACTOR* actorx, GAME* game);
|
||||
void aNMD_actor_init(ACTOR* actorx, GAME* game);
|
||||
void aNMD_actor_save(ACTOR* actorx, GAME* game);
|
||||
|
||||
// clang-format off
|
||||
ACTOR_PROFILE Npc_Mamedanuki_Profile = {
|
||||
mAc_PROFILE_NPC_MAMEDANUKI,
|
||||
ACTOR_PART_NPC,
|
||||
ACTOR_STATE_NONE,
|
||||
SP_NPC_MAMEDANUKI0,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(NPC_MAMEDANUKI_ACTOR),
|
||||
&aNMD_actor_ct,
|
||||
&aNMD_actor_dt,
|
||||
&aNMD_actor_init,
|
||||
mActor_NONE_PROC1,
|
||||
&aNMD_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_SHOP_COMMON_ACTOR *mamedanuki, 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_SHOP_COMMON_ACTOR *mamedanuki, GAME_PLAY * play, int p3);
|
||||
static void aNSC_BGcheck(ACTOR* actorx);
|
||||
static void aNSC_set_zone_data(NPC_SHOP_COMMON_ACTOR* mamedanuki, ACTOR* actor);
|
||||
static void aNSC_set_player_angl(NPC_SHOP_COMMON_ACTOR* mamedanuki);
|
||||
static void aNSC_talk_demo_proc(ACTOR* actorx);
|
||||
static void aNSC_sell_camera(NPC_SHOP_COMMON_ACTOR* mamedanuki, GAME_PLAY* play);
|
||||
|
||||
static ACTOR* aNMD_actor_p[2];
|
||||
static int aNMD_selectIdx = 0;
|
||||
|
||||
void aNMD_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
// clang-format off
|
||||
static aNPC_ct_data_c ct_data = {
|
||||
&aNMD_actor_move,
|
||||
&aNMD_actor_draw,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
1,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
static int start_act_idx[] = { 0, 1 }; // TODO: figure out how the hell to define this with enums
|
||||
// clang-format off
|
||||
static u8 special_sale_type[mSP_KIND_MAX] = {
|
||||
aNMD_SALE_TYPE_FTR,
|
||||
aNMD_SALE_TYPE_NORMAL,
|
||||
aNMD_SALE_TYPE_CLOTH,
|
||||
aNMD_SALE_TYPE_CARPET,
|
||||
aNMD_SALE_TYPE_CARPET,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
NPC_MAMEDANUKI_ACTOR* mamedanuki = (NPC_MAMEDANUKI_ACTOR*)actorx;
|
||||
int action;
|
||||
CLIP(npc_clip)->ct_proc(actorx, game, &ct_data);
|
||||
|
||||
mamedanuki->npc_class.draw.main_animation.keyframe.morph_counter = 0.0f;
|
||||
mamedanuki->sell_item = EMPTY_NO;
|
||||
mamedanuki->npc_class.condition_info.hide_flg = FALSE;
|
||||
mamedanuki->talk_start_tim = -1;
|
||||
actorx->shape_info.draw_shadow = TRUE;
|
||||
actorx->shape_info.rotation.y = DEG2SHORT_ANGLE2(180.0f);
|
||||
actorx->world.angle.y = DEG2SHORT_ANGLE2(180.0f);
|
||||
mamedanuki->npc_class.collision.pipe.attribute.pipe.radius = 20;
|
||||
|
||||
{
|
||||
u8 sale_type = aNMD_SALE_TYPE_NORMAL;
|
||||
|
||||
if (Common_Get(tanuki_shop_status) == mSP_TANUKI_SHOP_STATUS_EVENT) {
|
||||
int sale_kind = mSP_WhatSpecialSale();
|
||||
|
||||
if (sale_kind >= 0 && sale_kind <= mSP_KIND_WALLPAPER) {
|
||||
sale_type = special_sale_type[sale_kind];
|
||||
}
|
||||
}
|
||||
|
||||
mamedanuki->sale_type = sale_type;
|
||||
}
|
||||
|
||||
if (Common_Get(door_data).door_actor_name == RSV_NO) {
|
||||
mamedanuki->npc_class.talk_info.melody_inst = 0;
|
||||
action = 61;
|
||||
} else {
|
||||
action = start_act_idx[actorx->npc_id != SP_NPC_MAMEDANUKI0];
|
||||
}
|
||||
|
||||
{
|
||||
int idx;
|
||||
|
||||
if (actorx->npc_id == SP_NPC_MAMEDANUKI1) {
|
||||
idx = 1;
|
||||
} else {
|
||||
idx = 0;
|
||||
}
|
||||
|
||||
aNMD_actor_p[idx] = actorx;
|
||||
aNSC_setupAction(mamedanuki, (GAME_PLAY*)game, action);
|
||||
aNMD_selectIdx = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void aNMD_actor_save(ACTOR* actorx, GAME* game) {
|
||||
(CLIP(npc_clip)->save_proc)(actorx, game);
|
||||
}
|
||||
|
||||
void aNMD_actor_dt(ACTOR* actorx, GAME* game) {
|
||||
(CLIP(npc_clip)->dt_proc)(actorx, game);
|
||||
}
|
||||
|
||||
void aNMD_actor_init(ACTOR* actorx, GAME* game) {
|
||||
(CLIP(npc_clip)->init_proc)(actorx, game);
|
||||
}
|
||||
|
||||
void aNMD_actor_draw(ACTOR* actorx, GAME* game) {
|
||||
(CLIP(npc_clip)->draw_proc)(actorx, game);
|
||||
}
|
||||
|
||||
static u8 aNMD_get_zone(NPC_MAMEDANUKI_ACTOR* mamedanuki, xyz_t wpos);
|
||||
static u8 aNMD_get_next_zone(NPC_MAMEDANUKI_ACTOR* mamedanuki, u8 p1, u8 p2);
|
||||
static void aNMD_search_player(NPC_MAMEDANUKI_ACTOR* mamedanuki, GAME_PLAY* play);
|
||||
static void aNMD_search_player2(NPC_MAMEDANUKI_ACTOR* mamedanuki, GAME_PLAY* play);
|
||||
|
||||
#include "../src/actor/npc/ac_npc_mamedanuki_move.c_inc"
|
||||
@@ -0,0 +1,71 @@
|
||||
{ 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_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_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, FALSE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, FALSE },
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -30,10 +30,6 @@ void aNSM_actor_draw(ACTOR* actorx, GAME* game);
|
||||
void aNSM_actor_init(ACTOR* actorx, GAME* game);
|
||||
void aNSM_actor_save(ACTOR* actorx, GAME* game);
|
||||
|
||||
static void aNSM_talk_request(ACTOR* actorx, GAME* game);
|
||||
static int aNSM_talk_init(ACTOR* actorx, GAME* game);
|
||||
static int aNSM_talk_end_chk(ACTOR* actorx, GAME* game);
|
||||
|
||||
// clang-format off
|
||||
ACTOR_PROFILE Npc_Shop_Master_Profile = {
|
||||
mAc_PROFILE_NPC_SHOP_MASTER,
|
||||
@@ -42,6 +38,11 @@ ACTOR_PROFILE Npc_Shop_Master_Profile = {
|
||||
SP_NPC_SHOP_MASTER,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(NPC_SHOP_MASTER_ACTOR),
|
||||
&aNSM_actor_ct,
|
||||
&aNSM_actor_dt,
|
||||
&aNSM_actor_init,
|
||||
mActor_NONE_PROC1,
|
||||
&aNSM_actor_save,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
@@ -58,7 +59,7 @@ static void aNSC_sell_camera(NPC_SHOP_MASTER_ACTOR* shop_master, GAME_PLAY* play
|
||||
|
||||
void aNSM_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
static aNPC_ct_data_c ct_data = {
|
||||
&aNSM_actor_move, &aNSM_actor_draw, 0, &aNSM_talk_request, &aNSM_talk_init, &aNSM_talk_end_chk, TRUE,
|
||||
&aNSM_actor_move, &aNSM_actor_draw, 0, NULL, NULL, NULL, 1,
|
||||
};
|
||||
|
||||
NPC_SHOP_MASTER_ACTOR* shop_master = (NPC_SHOP_MASTER_ACTOR*)actorx;
|
||||
@@ -74,7 +75,7 @@ void aNSM_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
|
||||
if (Common_Get(door_data).door_actor_name == RSV_NO) {
|
||||
shop_master->npc_class.talk_info.melody_inst = 0;
|
||||
action = aNSC_ACTION_WAIT;
|
||||
action = 61;
|
||||
} else {
|
||||
action = 0;
|
||||
}
|
||||
@@ -99,4 +100,3 @@ void aNSM_actor_draw(ACTOR* actorx, GAME* game) {
|
||||
}
|
||||
|
||||
#include "../src/actor/npc/ac_npc_shop_master_move.c_inc"
|
||||
#include "../src/actor/npc/ac_npc_shop_common.c"
|
||||
|
||||
@@ -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 }
|
||||
@@ -1,12 +1,12 @@
|
||||
static u8 aNSM_get_zone(xyz_t* wpos) {
|
||||
if (wpos->x < 120.0f) {
|
||||
if (wpos->z < 180.0f) {
|
||||
static u8 aNSM_get_zone(xyz_t wpos) {
|
||||
if (wpos.x < 120.0f) {
|
||||
if (wpos.z < 180.0f) {
|
||||
return aNSM_ZONE_1;
|
||||
} else {
|
||||
return aNSM_ZONE_2;
|
||||
}
|
||||
}
|
||||
if (wpos->z < 160.0f) {
|
||||
if (wpos.z < 160.0f) {
|
||||
return aNSM_ZONE_0;
|
||||
} else {
|
||||
return aNSM_ZONE_3;
|
||||
@@ -31,7 +31,7 @@ static void aNSM_search_player(NPC_SHOP_MASTER_ACTOR* shop_master, GAME_PLAY* pl
|
||||
if (player != NULL) {
|
||||
s16 angle = actorx->shape_info.rotation.y - shop_master->player_angle;
|
||||
if (ABS(angle) > DEG2SHORT_ANGLE(90.0f)) {
|
||||
aNSC_setupAction(shop_master, play, aNSC_ACTION_TURN);
|
||||
aNSC_setupAction(shop_master, play, 66);
|
||||
} else {
|
||||
chase_angle(&actorx->shape_info.rotation.y, shop_master->player_angle, DEG2SHORT_ANGLE(11.25f));
|
||||
actorx->world.angle.y = actorx->shape_info.rotation.y;
|
||||
@@ -66,6 +66,22 @@ static int aNSM_check_safe_zone(NPC_SHOP_MASTER_ACTOR* shop_master, PLAYER_ACTOR
|
||||
return res;
|
||||
}
|
||||
|
||||
#define aNSC_get_zone aNSM_get_zone
|
||||
#define aNSC_get_next_zone aNSM_get_next_zone
|
||||
#define aNSC_check_safe_zone aNSM_check_safe_zone
|
||||
#define aNSC_search_player aNSM_search_player
|
||||
#define aNSC_search_player2 aNSM_search_player2
|
||||
#define aNSC_ANIME_FILE "../src/actor/npc/ac_npc_shop_master_anime.c"
|
||||
|
||||
#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
|
||||
|
||||
void aNSM_actor_move(ACTOR* actorx, GAME* game) {
|
||||
NPC_SHOP_MASTER_ACTOR* shop_master = (NPC_SHOP_MASTER_ACTOR*)actorx;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
Reference in New Issue
Block a user