Merge pull request #470 from SamuraiOndo/master

implement and link ac_kamakura_npc0
This commit is contained in:
Cuyler36
2025-05-16 00:00:50 -04:00
committed by GitHub
4 changed files with 117 additions and 2 deletions
+1 -1
View File
@@ -1106,7 +1106,7 @@ config.libs = [
Object(NonMatching, "actor/npc/ac_harvest_npc0.c"),
Object(NonMatching, "actor/npc/ac_harvest_npc1.c"),
Object(Matching, "actor/npc/ac_hatumode_npc0.c"),
Object(NonMatching, "actor/npc/ac_kamakura_npc0.c"),
Object(Matching, "actor/npc/ac_kamakura_npc0.c"),
Object(Matching, "actor/npc/ac_normal_npc.c"),
Object(Matching, "actor/npc/ac_npc.c"),
Object(Matching, "actor/npc/ac_npc2.c"),
+7 -1
View File
@@ -3,11 +3,17 @@
#include "types.h"
#include "m_actor.h"
#include "ac_npc.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct npc_kamakura_npc0_s NPC_KAMUKURA_NPC0_ACTOR;
/* sizeof(npc_kamakura_npc0_s) == 0x994*/
struct npc_kamakura_npc0_s {
/* 0x000 */ NPC_ACTOR npc_class;
};
extern ACTOR_PROFILE Kamakura_Npc0_Profile;
#ifdef __cplusplus
+94
View File
@@ -0,0 +1,94 @@
#include "ac_kamakura_npc0.h"
#include "ac_npc.h"
#include "ac_npc_h.h"
#include "ac_quest_manager.h"
#include "ac_quest_manager_clip.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_lib.h"
#include "m_msg.h"
#include "m_name_table.h"
#include "m_npc.h"
#include "m_play.h"
#include "m_play_h.h"
#include "m_player.h"
#include "m_player_lib.h"
#include "m_room_type.h"
#include "m_soncho.h"
#include "m_vibctl.h"
#include "types.h"
static void aKM0_actor_ct(ACTOR* actorx, GAME* game);
static void aKM0_actor_save(ACTOR* actorx, GAME* game);
static void aKM0_actor_dt(ACTOR* actorx, GAME* game);
static void aKM0_actor_init(ACTOR* actorx, GAME* game);
static void aKM0_actor_move(ACTOR* actorx, GAME* game);
static void aKM0_actor_draw(ACTOR* actorx, GAME* game);
static void aKM0_talk_request(ACTOR* actorx, GAME* game);
static int aKM0_talk_init(ACTOR* actorx, GAME* game);
static int aKM0_talk_end_chk(ACTOR* actorx, GAME* game);
// clang-format off
ACTOR_PROFILE Kamakura_Npc0_Profile = {
mAc_PROFILE_KAMAKURA_NPC0,
ACTOR_PART_NPC,
ACTOR_STATE_NONE,
EMPTY_NO,
ACTOR_OBJ_BANK_KEEP,
sizeof(NPC_KAMUKURA_NPC0_ACTOR),
aKM0_actor_ct,
aKM0_actor_dt,
aKM0_actor_init,
mActor_NONE_PROC1,
aKM0_actor_save,
};
// clang-format on
static void aKM0_actor_ct(ACTOR* actorx, GAME* game) {
// clang-format off
static aNPC_ct_data_c ct_data = {
&aKM0_actor_move,
&aKM0_actor_draw,
aNPC_CT_SCHED_TYPE_WANDER,
&aKM0_talk_request,
&aKM0_talk_init,
&aKM0_talk_end_chk,
0,
};
// clang-format on
if (NPC_CLIP->birth_check_proc(actorx, game) == TRUE) {
NPC_CLIP->ct_proc(actorx, game, &ct_data);
NPC_CLIP->set_start_pos_proc(actorx);
}
}
static void aKM0_actor_save(ACTOR* actorx, GAME* game) {
NPC_CLIP->save_proc(actorx, game);
}
static void aKM0_actor_dt(ACTOR* actorx, GAME* game) {
NPC_CLIP->dt_proc(actorx, game);
}
static void aKM0_actor_init(ACTOR* actorx, GAME* game) {
NPC_CLIP->init_proc(actorx, game);
}
static void aKM0_actor_move(ACTOR* actorx, GAME* game) {
NPC_CLIP->move_proc(actorx, game);
}
static void aKM0_actor_draw(ACTOR* actorx, GAME* game) {
NPC_CLIP->draw_proc(actorx, game);
}
#include "../src/actor/npc/ac_kamakura_npc0_talk.c_inc"
+15
View File
@@ -0,0 +1,15 @@
static void aKM0_talk_request(ACTOR* actorx, GAME* game) {
CLIP(quest_manager_clip)->talk_request_proc(actorx);
}
static int aKM0_talk_init(ACTOR* actorx, GAME* game) {
return CLIP(quest_manager_clip)->talk_start_proc(actorx);
}
static int aKM0_talk_end_chk(ACTOR* actorx, GAME* game) {
BOOL res = FALSE;
if (CLIP(quest_manager_clip)->talk_check_proc(actorx) == TRUE) {
res = TRUE;
}
return res;
}