mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
implement and link ac_npc_mask_cat.c
This commit is contained in:
+1
-1
@@ -1123,7 +1123,7 @@ config.libs = [
|
||||
Object(NonMatching, "actor/npc/ac_npc_majin4.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_majin5.c"),
|
||||
Object(Matching, "actor/npc/ac_npc_mamedanuki.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_mask_cat.c"),
|
||||
Object(Matching, "actor/npc/ac_npc_mask_cat.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_mask_cat2.c"),
|
||||
Object(NonMatching, "actor/npc/ac_npc_needlework.c"),
|
||||
Object(Matching, "actor/npc/ac_npc_p_sel.c"),
|
||||
|
||||
@@ -3,11 +3,18 @@
|
||||
|
||||
#include "types.h"
|
||||
#include "m_actor.h"
|
||||
|
||||
#include "ac_npc.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct npc_mask_cat_s NPC_MASK_CAT_ACTOR;
|
||||
|
||||
/* sizeof(npc_mask_cat_s) == 0x994*/
|
||||
struct npc_mask_cat_s {
|
||||
/* 0x000 */ NPC_ACTOR npc_class;
|
||||
};
|
||||
|
||||
extern ACTOR_PROFILE Npc_Mask_Cat_Profile;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
#include "ac_npc_mask_cat.h"
|
||||
|
||||
#include "dolphin/os/OSRtc.h"
|
||||
#include "libc64/qrand.h"
|
||||
#include "libultra/libultra.h"
|
||||
#include "m_actor_type.h"
|
||||
#include "m_bgm.h"
|
||||
#include "m_card.h"
|
||||
#include "m_choice.h"
|
||||
#include "m_common_data.h"
|
||||
#include "m_config.h"
|
||||
#include "m_demo.h"
|
||||
#include "m_msg.h"
|
||||
#include "m_play.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "m_soncho.h"
|
||||
#include "m_vibctl.h"
|
||||
|
||||
static void aNMC_actor_ct(ACTOR* actorx, GAME* game);
|
||||
static void aNMC_actor_save(ACTOR* actorx, GAME* game);
|
||||
static void aNMC_actor_dt(ACTOR* actorx, GAME* game);
|
||||
static void aNMC_actor_init(ACTOR* actorx, GAME* game);
|
||||
static void aNMC_actor_draw(ACTOR* actorx, GAME* game);
|
||||
|
||||
static void aNMC_set_painter_name_str();
|
||||
static void aNMC_set_talk_info();
|
||||
static void aNMC_actor_move(ACTOR* actorx, GAME* game);
|
||||
static void aNMC_talk_request(ACTOR* actorx, GAME* game);
|
||||
static int aNMC_talk_init(ACTOR* actorx, GAME* game);
|
||||
static int aNMC_talk_end_chk(ACTOR* actorx, GAME* game);
|
||||
|
||||
static void aNMC_actor_ct(ACTOR* actorx, GAME* game);
|
||||
static void aNMC_actor_dt(ACTOR* actorx, GAME* game);
|
||||
static void aNMC_actor_init(ACTOR* actorx, GAME* game);
|
||||
static void aNMC_actor_save(ACTOR* actorx, GAME* game);
|
||||
|
||||
ACTOR_PROFILE Npc_Mask_Cat_Profile = {
|
||||
// clang-format off
|
||||
mAc_PROFILE_NPC_MASK_CAT,
|
||||
ACTOR_PART_NPC,
|
||||
ACTOR_STATE_NONE,
|
||||
SP_NPC_MASK_CAT,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(NPC_MASK_CAT_ACTOR),
|
||||
aNMC_actor_ct,
|
||||
aNMC_actor_dt,
|
||||
aNMC_actor_init,
|
||||
mActor_NONE_PROC1,
|
||||
aNMC_actor_save,
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
static void aNMC_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
static aNPC_ct_data_c ct_data = {
|
||||
&aNMC_actor_move,
|
||||
&aNMC_actor_draw,
|
||||
3,
|
||||
&aNMC_talk_request,
|
||||
&aNMC_talk_init,
|
||||
&aNMC_talk_end_chk,
|
||||
0,
|
||||
};
|
||||
if (CLIP(npc_clip)->birth_check_proc(actorx, game) == TRUE) {
|
||||
if (Common_Get(spnpc_first_talk_flags) & (1 << aNPC_SPNPC_BIT_MASK_CAT)) {
|
||||
Actor_delete(actorx);
|
||||
actorx->sv_proc = NULL;
|
||||
actorx->dt_proc = NULL;
|
||||
mNpc_RenewalSetNpc(actorx);
|
||||
} else {
|
||||
CLIP(npc_clip)->ct_proc(actorx, game, &ct_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aNMC_actor_save(ACTOR* actorx, GAME* game) {
|
||||
CLIP(npc_clip)->save_proc(actorx, game);
|
||||
}
|
||||
|
||||
static void aNMC_actor_dt(ACTOR* actorx, GAME* game) {
|
||||
CLIP(npc_clip)->dt_proc(actorx, game);
|
||||
mEv_actor_dying_message(0x73, actorx);
|
||||
}
|
||||
|
||||
static void aNMC_actor_init(ACTOR* actorx, GAME* game) {
|
||||
CLIP(npc_clip)->init_proc(actorx, game);
|
||||
}
|
||||
|
||||
static void aNMC_actor_draw(ACTOR* actorx, GAME* game) {
|
||||
CLIP(npc_clip)->draw_proc(actorx, game);
|
||||
}
|
||||
#include "../src/actor/npc/ac_npc_mask_cat_move.c_inc"
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
static void aNMC_set_painter_name_str() {
|
||||
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
|
||||
mMsg_Set_free_str(msg_p, 0, Save_Get(mask_cat).design.creator_pid.player_name, 8);
|
||||
}
|
||||
|
||||
static void aNMC_set_talk_info() {
|
||||
u32 msg_num;
|
||||
s32 mask_cat_talk_idx = Save_Get(mask_cat).talk_idx;
|
||||
if ((Common_Get(spnpc_first_talk_flags) & (1 << aNPC_SPNPC_BIT_MASK_CAT))) {
|
||||
if (mask_cat_talk_idx <= 0) {
|
||||
mask_cat_talk_idx = 1;
|
||||
}
|
||||
msg_num = 0x31E5 + 4 * (mask_cat_talk_idx - 1) + RANDOM(3);
|
||||
} else {
|
||||
++Save_Get(mask_cat).talk_idx;
|
||||
msg_num = mask_cat_talk_idx * 4 + 0x31E4;
|
||||
}
|
||||
mDemo_Set_msg_num(msg_num);
|
||||
aNMC_set_painter_name_str();
|
||||
}
|
||||
|
||||
static void aNMC_talk_request(ACTOR* actorx, GAME* game) {
|
||||
mDemo_Request(mDemo_TYPE_TALK, actorx, aNMC_set_talk_info);
|
||||
}
|
||||
|
||||
static int aNMC_talk_init(ACTOR* actorx, GAME* game) {
|
||||
Common_Get(spnpc_first_talk_flags) |= (1 << aNPC_SPNPC_BIT_MASK_CAT);
|
||||
mDemo_Set_ListenAble();
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int aNMC_talk_end_chk(ACTOR* actorx, GAME* game) {
|
||||
s32 retValue = 0;
|
||||
|
||||
if (mDemo_Check(mDemo_TYPE_TALK, actorx) == 0)
|
||||
{
|
||||
retValue = 1;
|
||||
}
|
||||
return retValue;
|
||||
}
|
||||
|
||||
static void aNMC_actor_move(ACTOR* actorx, GAME* game) {
|
||||
CLIP(npc_clip)->move_proc(actorx, game);
|
||||
}
|
||||
Reference in New Issue
Block a user