mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-06-19 06:27:04 -04:00
Implement & link ac_mikanbox, ac_npc_totakeke refactor
This commit is contained in:
+1
-1
@@ -1007,7 +1007,7 @@ config.libs = [
|
||||
Object(Matching, "actor/ac_lotus.c"),
|
||||
Object(NonMatching, "actor/ac_mailbox.c"),
|
||||
Object(Matching, "actor/ac_mbg.c"),
|
||||
Object(NonMatching, "actor/ac_mikanbox.c"),
|
||||
Object(Matching, "actor/ac_mikanbox.c"),
|
||||
Object(Matching, "actor/ac_mikuji.c"),
|
||||
Object(Matching, "actor/ac_misin.c"),
|
||||
Object(Matching, "actor/ac_mscore_control.c"),
|
||||
|
||||
@@ -3,16 +3,21 @@
|
||||
|
||||
#include "types.h"
|
||||
#include "m_actor.h"
|
||||
#include "ac_mikanbox_clip.h"
|
||||
#include "ac_structure.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern ACTOR_PROFILE Mikanbox_Profile;
|
||||
typedef struct mikanbox_actor_s {
|
||||
STRUCTURE_ACTOR s_actor;
|
||||
} MIKANBOX_ACTOR;
|
||||
|
||||
extern ACTOR_PROFILE Mikanbox_Profile;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
#ifndef AC_MIKANBOX_CLIP_H
|
||||
#define AC_MIKANBOX_CLIP_H
|
||||
|
||||
#include "types.h"
|
||||
#include "m_actor.h"
|
||||
#include "ac_npc_totakeke.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define aMKBC_NUM_GOOD_MD (ITM_MINIDISK52 - ITM_MINIDISK_START)
|
||||
|
||||
typedef void (*aMKBC_SET_STRING_PROC)(int base);
|
||||
typedef void (*aMKBC_ROLL_DRAW_PROC)(GAME_PLAY* play, int timer, int page_idx);
|
||||
typedef void (*aMKBC_THINK_INIT_PROC)(NPC_TOTAKEKE_ACTOR* totakeke, GAME_PLAY* play, int init_idx);
|
||||
typedef void (*aMKBC_SOUND_PROC)(NPC_TOTAKEKE_ACTOR* totakeke, GAME_PLAY* play, int idx);
|
||||
typedef int (*aMKBC_SECTION_CHK_PROC)(int section);
|
||||
typedef u8 (*aMKBC_BGM_NO_PROC)(NPC_TOTAKEKE_ACTOR* totakeke);
|
||||
typedef void (*aMKBC_ROLL_PROC)(NPC_TOTAKEKE_ACTOR* totakeke, GAME_PLAY* play);
|
||||
typedef void (*aMKBC_HEAD_UP_PROC)(ACTOR* actorx);
|
||||
typedef void (*aMKBC_SET_ITEMSTR_PROC)(int str_no, u8 md_no);
|
||||
typedef void (*aMKBC_SET_ITEMSTR3_PROC)(void);
|
||||
typedef u8 (*aMKBC_SEARCH_MERODY_PROC)(void);
|
||||
typedef void (*aMKBC_CHECK_MERODY_PROC)(u32 md_no);
|
||||
|
||||
typedef struct mikanbox_clip_s aMKBC_Clip_c;
|
||||
|
||||
struct mikanbox_clip_s {
|
||||
/* 0x000 */ aMKBC_SET_STRING_PROC set_string_proc;
|
||||
/* 0x004 */ aMKBC_ROLL_DRAW_PROC roll_draw_proc;
|
||||
/* 0x008 */ aMKBC_THINK_INIT_PROC think_init_proc;
|
||||
/* 0x00C */ aMKBC_SOUND_PROC sound_proc;
|
||||
/* 0x010 */ aMKBC_SECTION_CHK_PROC section_chk_proc;
|
||||
/* 0x014 */ aMKBC_BGM_NO_PROC bgm_no_proc;
|
||||
/* 0x018 */ aMKBC_ROLL_PROC roll_proc;
|
||||
/* 0x01C */ aMKBC_HEAD_UP_PROC head_up_proc;
|
||||
/* 0x020 */ aMKBC_SET_ITEMSTR_PROC set_itemstr_proc;
|
||||
/* 0x024 */ aMKBC_SET_ITEMSTR3_PROC set_itemstr3_proc;
|
||||
/* 0x028 */ aMKBC_SEARCH_MERODY_PROC search_merody_proc;
|
||||
/* 0x02C */ aMKBC_CHECK_MERODY_PROC check_merody_proc;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+27
-45
@@ -4,6 +4,7 @@
|
||||
#include "types.h"
|
||||
#include "m_actor.h"
|
||||
#include "ac_npc.h"
|
||||
#include "m_item_name.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -11,25 +12,19 @@ extern "C" {
|
||||
|
||||
extern ACTOR_PROFILE Npc_Totakeke_Profile;
|
||||
|
||||
// @BUG - this should've been updated to mIN_ITEM_NAME_LEN
|
||||
#ifndef BUGFIXES
|
||||
#define aNTT_REQUEST_STR_LEN 10
|
||||
#else
|
||||
#define aNTT_REQUEST_STR_LEN mIN_ITEM_NAME_LEN
|
||||
#endif
|
||||
|
||||
typedef struct npc_totakeke_s NPC_TOTAKEKE_ACTOR;
|
||||
typedef struct npc_totakeke_clip_s aNTT_Clip_c;
|
||||
|
||||
typedef struct npc_totakeke_think_data_s aNTT_think_data_c;
|
||||
typedef struct npc_totakeke_event_save_s aNTT_event_save_c;
|
||||
typedef struct npc_totakeke_event_common_s aNTT_event_common_c;
|
||||
|
||||
typedef void (*aNTTrequest_str_PROC)(GAME*, s16, u8);
|
||||
typedef void (*aNTT_08_PROC)(NPC_TOTAKEKE_ACTOR*, GAME_PLAY*, u8);
|
||||
typedef void (*aNTT_0C_PROC)(NPC_TOTAKEKE_ACTOR*, GAME_PLAY*, int);
|
||||
typedef int (*aNTT_10_PROC)(int);
|
||||
typedef u8 (*aNTT_14_PROC)(NPC_TOTAKEKE_ACTOR*);
|
||||
typedef void (*aNTT_1C_PROC)(NPC_TOTAKEKE_ACTOR*);
|
||||
typedef void (*aNTT_20_PROC)(int, u8);
|
||||
typedef void (*aNTT_24_PROC)();
|
||||
typedef u8 (*aNTT_PICK_SONG_PROC)();
|
||||
typedef void (*aNTT_2C_PROC)(int);
|
||||
|
||||
typedef void (*aNTT_PROC)(NPC_TOTAKEKE_ACTOR* totakeke, GAME_PLAY* play);
|
||||
|
||||
struct npc_totakeke_s {
|
||||
@@ -37,7 +32,7 @@ struct npc_totakeke_s {
|
||||
/* 0x994 */ aNTT_PROC proc;
|
||||
/* 0x998 */ s16 roll2_count;
|
||||
/* 0x99a */ s16 roll4_count;
|
||||
/* 0x99c */ u16 _99c;
|
||||
/* 0x99c */ s16 show_timer;
|
||||
/* 0x99e */ u8 song;
|
||||
/* 0x99f */ u8 _99f;
|
||||
/* 0x9a0 */ u8 _9a0;
|
||||
@@ -49,50 +44,37 @@ struct npc_totakeke_s {
|
||||
/* 0x9a6 */ u8 post_roll_think;
|
||||
/* 0x9a7 */ u8 melody_inst;
|
||||
/* 0x9a8 */ u8 think_proc_id;
|
||||
/* 0x9a9 */ u8 _9a9;
|
||||
/* 0x9ac */ u8 _9aa;
|
||||
/* 0x9ac */ u8 _9ab;
|
||||
};
|
||||
|
||||
struct npc_totakeke_clip_s {
|
||||
/* 0x000 */ int _00;
|
||||
/* 0x004 */ aNTTrequest_str_PROC _04;
|
||||
/* 0x008 */ aNTT_08_PROC _08;
|
||||
/* 0x00c */ aNTT_0C_PROC _0C;
|
||||
/* 0x010 */ aNTT_10_PROC _10;
|
||||
/* 0x014 */ aNTT_14_PROC _14;
|
||||
/* 0x018 */ aNTT_PROC _18;
|
||||
/* 0x01c */ aNTT_1C_PROC _1c;
|
||||
/* 0x020 */ aNTT_20_PROC _20;
|
||||
/* 0x024 */ aNTT_24_PROC _24;
|
||||
/* 0x028 */ aNTT_PICK_SONG_PROC pick_song;
|
||||
/* 0x02c */ aNTT_2C_PROC _2c;
|
||||
/* 0x9a9 */ u8 majin_flag;
|
||||
/* 0x9aa */ u8 _9aa;
|
||||
/* 0x9ab */ u8 _9ab;
|
||||
};
|
||||
|
||||
struct npc_totakeke_think_data_s {
|
||||
/* 0x00 */ u8 think_proc_id;
|
||||
/* 0x01 */ u8 _01;
|
||||
/* 0x01 */ u8 think_init_idx;
|
||||
/* 0x02 */ u8 next_talk;
|
||||
/* 0x03 */ u8 talk;
|
||||
/* 0x04 */ u8 pre_roll_think;
|
||||
};
|
||||
|
||||
#define aNTT_FLAG_0 1
|
||||
#define aNTT_FLAG_AIRCHECK_RECEIVED 1 << 4
|
||||
#define aNTT_FLAG_HELLO (1 << 0)
|
||||
#define aNTT_FLAG_1 (1 << 1)
|
||||
#define aNTT_FLAG_2 (1 << 2)
|
||||
#define aNTT_FLAG_3 (1 << 3)
|
||||
#define aNTT_FLAG_AIRCHECK_RECEIVED (1 << 4)
|
||||
#define aNTT_FLAG_5 (1 << 5)
|
||||
#define aNTT_FLAG_6 (1 << 6)
|
||||
#define aNTT_FLAG_7 (1 << 7)
|
||||
#define aNTT_FLAG_SP_DELETE_MAJIN (1 << 13)
|
||||
#define aNTT_FLAG_SP_ROLL_DRAW (1 << 14)
|
||||
#define aNTT_FLAG_SP_ROLL_END (1 << 15)
|
||||
|
||||
struct npc_totakeke_event_save_s {
|
||||
/* 0x00 */ u8 _00;
|
||||
/* 0x01 */ u8 _01;
|
||||
/* 0x00 */ s16 _00;
|
||||
/* 0x01 */ u16 bitfield;
|
||||
/* 0x04 */ u8 request_str[aNTT_REQUEST_STR_LEN];
|
||||
/* 0x0e */ u8 _0e;
|
||||
/* 0x0f */ u8 _0f;
|
||||
/* 0x10 */ u8 _10;
|
||||
/* 0x11 */ u8 _11;
|
||||
/* 0x12 */ u8 _12;
|
||||
/* 0x13 */ u8 _13;
|
||||
/* 0x14 */ u8 _14;
|
||||
/* 0x15 */ u8 _15;
|
||||
/* 0x04 */ u8 request_str[mIN_ITEM_NAME_LEN];
|
||||
/* 0x14 */ u8 roll_flag;
|
||||
/* 0x15 */ u8 copyright_alpha;
|
||||
};
|
||||
|
||||
struct npc_totakeke_event_common_s {
|
||||
|
||||
@@ -370,6 +370,8 @@ typedef enum bgm_e {
|
||||
BGM_KAPPA_SONG15,
|
||||
// TODO: others
|
||||
BGM_MD0 = 128,
|
||||
|
||||
BGM_TOTAKEKE_LIVE0 = 192,
|
||||
} BGM_e;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
+2
-2
@@ -34,7 +34,7 @@
|
||||
#include "ac_turi_clip.h"
|
||||
#include "ac_hatumode_control.h"
|
||||
#include "ac_station_clip.h"
|
||||
#include "ac_npc_totakeke.h"
|
||||
#include "ac_mikanbox_clip.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -91,7 +91,7 @@ typedef struct clip_s {
|
||||
/* 0x0CC */ void* _0CC;
|
||||
/* 0x0D0 */ void* _0D0;
|
||||
/* 0x0D4 */ CLIP_NONE_PROC ball_redma_proc; /* removed in DnM+ */
|
||||
/* 0x0D8 */ aNTT_Clip_c* totakeke_clip;
|
||||
/* 0x0D8 */ aMKBC_Clip_c* mikanbox_clip;
|
||||
/* 0x0DC */ aAL_Clip_c* animal_logo_clip;
|
||||
/* 0x0E0 */ aSTC_clip_c* station_clip;
|
||||
/* 0x0E4 */ aTRC_clip_c* turi_clip;
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MSG_CARPETPEDDLER_START 0x048A
|
||||
#define MSG_TOTAKEKE_START 0x1B93
|
||||
#define MSG_SANTA_WISH_FTR 0x2B54
|
||||
#define MSG_SANTA_WISH_WALL 0x2B55
|
||||
#define MSG_SANTA_WISH_CARPET 0x2B56
|
||||
|
||||
@@ -3294,6 +3294,7 @@ extern int mNT_check_unknown(mActor_name_t item_no);
|
||||
#define DUMMY_KOINOBORI 0xF114
|
||||
#define DUMMY_WINDMILL 0xF116
|
||||
#define DUMMY_LOTUS 0xF11B
|
||||
#define DUMMY_MIKANBOX 0xF11C
|
||||
#define DUMMY_DOUZOU 0xF11D
|
||||
#define DUMMY_NAMEPLATE 0xF11F
|
||||
#define DUMMY_MUSEUM 0xF120
|
||||
|
||||
@@ -18,8 +18,8 @@ extern "C" {
|
||||
#define mString_HANIWA_MSG1 0x76B
|
||||
#define mString_HANIWA_MSG2 0x76C
|
||||
#define mString_HANIWA_MSG3 0x76D
|
||||
#define mString_CARPETPEDDLER_START 0x48a
|
||||
#define mString_TOTAKEKE_START 0x1b93
|
||||
#define mString_MIKANBOX_START 0x77B
|
||||
#define mString_MIKANBOX_END 0x7FE
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+3
-1
@@ -57,12 +57,14 @@ enum {
|
||||
};
|
||||
|
||||
#define mTM_SECONDS_IN_MINUTE 60
|
||||
#define mTM_SECONDS_IN_HOUR 60*60
|
||||
#define mTM_SECONDS_IN_HOUR (60*60)
|
||||
#define mTM_SECONDS_IN_HALFDAY (12*60*60)
|
||||
#define mTM_SECONDS_IN_DAY (24*60*60)
|
||||
|
||||
#define mTM_MINUTES_IN_HOUR 60
|
||||
|
||||
#define mTM_TIME2SEC(h, m, s) ((h) * mTM_SECONDS_IN_HOUR + (m) * mTM_SECONDS_IN_MINUTE + (s))
|
||||
|
||||
typedef struct time_calendar_term_s {
|
||||
lbRTC_month_t month;
|
||||
lbRTC_day_t day;
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
#include "ac_mikanbox.h"
|
||||
|
||||
#include "m_string.h"
|
||||
#include "m_font.h"
|
||||
#include "m_msg.h"
|
||||
#include "m_bgm.h"
|
||||
#include "m_common_data.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "sys_matrix.h"
|
||||
#include "m_rcp.h"
|
||||
|
||||
#define aMIK_STRING_NUM 10
|
||||
#define aMIK_STRING_LEN 25
|
||||
|
||||
enum {
|
||||
aMIK_ACTION_WAIT,
|
||||
|
||||
aMIK_ACTION_NUM
|
||||
};
|
||||
|
||||
static void aMIK_actor_ct(ACTOR* actorx, GAME* game);
|
||||
static void aMIK_actor_dt(ACTOR* actorx, GAME* game);
|
||||
static void aMIK_actor_init(ACTOR* actorx, GAME* game);
|
||||
static void aMIK_actor_draw(ACTOR* actorx, GAME* game);
|
||||
static void aMIK_actor_save(ACTOR* actorx, GAME* game);
|
||||
|
||||
// clang-format off
|
||||
ACTOR_PROFILE Mikanbox_Profile = {
|
||||
mAc_PROFILE_MIKANBOX,
|
||||
ACTOR_PART_ITEM,
|
||||
ACTOR_STATE_NONE,
|
||||
MIKANBOX,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(MIKANBOX_ACTOR),
|
||||
&aMIK_actor_ct,
|
||||
&aMIK_actor_dt,
|
||||
&aMIK_actor_init,
|
||||
&aMIK_actor_draw,
|
||||
&aMIK_actor_save,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
static aMKBC_Clip_c aMKBC_clip;
|
||||
|
||||
static void aMKBC_clip_set_string(int base);
|
||||
static void aMKBC_clip_roll_draw(GAME_PLAY* play, int timer, int page_idx);
|
||||
static void aMKBC_clip_think_init(NPC_TOTAKEKE_ACTOR* totakeke, GAME_PLAY* play, int init_idx);
|
||||
static void aMKBC_clip_sound_proc(NPC_TOTAKEKE_ACTOR* totakeke, GAME_PLAY* play, int idx);
|
||||
static int aMKBC_clip_section_chk(int section);
|
||||
static u8 aMKBC_clip_bgm_no(NPC_TOTAKEKE_ACTOR* totakeke);
|
||||
static void aMKBC_clip_roll_proc(NPC_TOTAKEKE_ACTOR* totakeke, GAME_PLAY* play);
|
||||
static void aMKBC_clip_head_up(ACTOR* actorx);
|
||||
static void aMKBC_clip_set_itemstr(int str_no, u8 md_no);
|
||||
static void aMKBC_clip_set_itemstr3(void);
|
||||
static u8 aMKBC_clip_search_merody(void);
|
||||
static void aMKBC_clip_check_merody(u32 md_no);
|
||||
|
||||
static void aMIK_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
aMKBC_clip.set_string_proc = &aMKBC_clip_set_string;
|
||||
aMKBC_clip.roll_draw_proc = &aMKBC_clip_roll_draw;
|
||||
aMKBC_clip.think_init_proc = &aMKBC_clip_think_init;
|
||||
aMKBC_clip.sound_proc = &aMKBC_clip_sound_proc;
|
||||
aMKBC_clip.section_chk_proc = &aMKBC_clip_section_chk;
|
||||
aMKBC_clip.bgm_no_proc = &aMKBC_clip_bgm_no;
|
||||
aMKBC_clip.roll_proc = &aMKBC_clip_roll_proc;
|
||||
aMKBC_clip.head_up_proc = &aMKBC_clip_head_up;
|
||||
aMKBC_clip.set_itemstr_proc = &aMKBC_clip_set_itemstr;
|
||||
aMKBC_clip.set_itemstr3_proc = &aMKBC_clip_set_itemstr3;
|
||||
aMKBC_clip.search_merody_proc = &aMKBC_clip_search_merody;
|
||||
aMKBC_clip.check_merody_proc = &aMKBC_clip_check_merody;
|
||||
|
||||
CLIP(mikanbox_clip) = &aMKBC_clip;
|
||||
}
|
||||
|
||||
|
||||
static void aMIK_actor_dt(ACTOR* actorx, GAME* game) {
|
||||
CLIP(mikanbox_clip) = NULL;
|
||||
}
|
||||
|
||||
static void aMIK_actor_save(ACTOR* actorx, GAME* game) {
|
||||
// nothing
|
||||
}
|
||||
|
||||
#include "../src/actor/ac_mikanbox_clip.c_inc"
|
||||
#include "../src/actor/ac_mikanbox_move.c_inc"
|
||||
#include "../src/actor/ac_mikanbox_draw.c_inc"
|
||||
@@ -0,0 +1,393 @@
|
||||
static u8 totakeke_str[aMIK_STRING_LEN * aMIK_STRING_NUM];
|
||||
|
||||
// clang-format off
|
||||
static u8 page_table[] = {
|
||||
0,
|
||||
9,
|
||||
18,
|
||||
27,
|
||||
37,
|
||||
45,
|
||||
53,
|
||||
57,
|
||||
66,
|
||||
74,
|
||||
82,
|
||||
89,
|
||||
96,
|
||||
103,
|
||||
112,
|
||||
122,
|
||||
124,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
// clang-format off
|
||||
static u8 index_line_table[] = {
|
||||
3, 6, 9, 12, 16, 18, 21, 25,
|
||||
27, 30, 37, 40, 43, 45, 48, 51,
|
||||
53, 57, 60, 66, 74, 82, 86, 89,
|
||||
91, 96, 100, 103, 112, 116, 119, 122,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
static void aMKBC_clip_set_string(int base) {
|
||||
if (CLIP(mikanbox_clip) != NULL) {
|
||||
u8* str_p = totakeke_str;
|
||||
int page = mString_MIKANBOX_START + page_table[base];
|
||||
int i;
|
||||
|
||||
for (i = 0; i < aMIK_STRING_NUM; i++) {
|
||||
mString_Load_StringFromRom(str_p, aMIK_STRING_LEN, page);
|
||||
|
||||
page++;
|
||||
if (page > mString_MIKANBOX_END) {
|
||||
page = mString_MIKANBOX_END;
|
||||
}
|
||||
|
||||
str_p += aMIK_STRING_LEN;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aMKBC_clip_roll_draw(GAME_PLAY* play, int timer, int page) {
|
||||
aNTT_event_save_c* kk_save = (aNTT_event_save_c*)mEv_get_save_area(mEv_EVENT_KK_SLIDER, 10);
|
||||
GAME* game = (GAME*)play;
|
||||
GRAPH* graph = game->graph;
|
||||
int i;
|
||||
int j;
|
||||
int k;
|
||||
int start_idx;
|
||||
int end_idx;
|
||||
u8* str_p;
|
||||
f32 scale;
|
||||
f32 pos_y;
|
||||
int alpha;
|
||||
|
||||
if (kk_save == NULL || (kk_save->bitfield & aNTT_FLAG_SP_ROLL_DRAW) == 0 || CLIP(mikanbox_clip) == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
str_p = totakeke_str;
|
||||
|
||||
mFont_SetMatrix(graph, mFont_MODE_FONT);
|
||||
start_idx = page_table[page];
|
||||
end_idx = page_table[page + 1];
|
||||
|
||||
if (timer < 40 || timer > 446) {
|
||||
alpha = 0;
|
||||
} else if (timer < 120) {
|
||||
alpha = (u8)((timer - 40) * 3.1875f);
|
||||
} else if (timer > 366) {
|
||||
alpha = (u8)((446 - timer) * 3.1875f);
|
||||
} else {
|
||||
alpha = 255;
|
||||
}
|
||||
|
||||
pos_y = 30.0f;
|
||||
pos_y += ((start_idx + 10) - end_idx) * 10.0f;
|
||||
for (i = 0, j = start_idx; i < 10 && j < end_idx; i++, j++) {
|
||||
scale = 0.9f;
|
||||
|
||||
for (k = 0; k < ARRAY_COUNT(index_line_table); k++) {
|
||||
if (index_line_table[k] == j) {
|
||||
scale *= 0.85f;
|
||||
}
|
||||
}
|
||||
|
||||
mFont_SetLineStrings_AndSpace(game, str_p, aMIK_STRING_LEN, 150.0f, pos_y + i * 18.0f, 255, 255, 255, alpha,
|
||||
FALSE, TRUE, TRUE, scale, scale, mFont_MODE_FONT);
|
||||
str_p += aMIK_STRING_LEN;
|
||||
}
|
||||
|
||||
mFont_UnSetMatrix(graph, mFont_MODE_FONT);
|
||||
}
|
||||
|
||||
static int aNTT_draw_chk_proc(ACTOR* actorx, GAME_PLAY* play) {
|
||||
s16 profile = actorx->id;
|
||||
mActor_name_t name = actorx->npc_id;
|
||||
|
||||
if (profile == mAc_PROFILE_PLAYER || profile == mAc_PROFILE_WEATHER || profile == mAc_PROFILE_EFFECT_CONTROL ||
|
||||
name == SP_NPC_TOTAKEKE || name == MIKANBOX || name == SP_NPC_MAJIN5) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// force cull all other actors
|
||||
actorx->state_bitfield &= ~ACTOR_STATE_NO_CULL;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void aNTT_set_string(NPC_TOTAKEKE_ACTOR* kk) {
|
||||
aNTT_event_save_c* kk_save = (aNTT_event_save_c*)mEv_get_save_area(mEv_EVENT_KK_SLIDER, 10);
|
||||
|
||||
aMKBC_clip_set_string(kk->_9a2);
|
||||
kk->roll2_count = 0;
|
||||
kk_save->bitfield |= aNTT_FLAG_SP_ROLL_DRAW;
|
||||
}
|
||||
|
||||
static void aNTT_roll_init(NPC_TOTAKEKE_ACTOR* kk, GAME_PLAY* play) {
|
||||
aNTT_event_save_c* kk_save = (aNTT_event_save_c*)mEv_get_save_area(mEv_EVENT_KK_SLIDER, 10);
|
||||
|
||||
kk_save->roll_flag = TRUE;
|
||||
mBGMPsComp_make_ps_quiet(0x168);
|
||||
staffroll_light_init(play);
|
||||
kk->roll2_count = 180;
|
||||
|
||||
if (CLIP(weather_clip) != NULL) {
|
||||
CLIP(weather_clip)->change_weather(CLIP(weather_clip)->actor, mEnv_WEATHER_CLEAR, mEnv_WEATHER_INTENSITY_NONE);
|
||||
}
|
||||
|
||||
kk_save->bitfield &= ~aNTT_FLAG_SP_ROLL_END;
|
||||
kk->_9a0 = 255;
|
||||
kk->show_timer = 0;
|
||||
kk_save->_00 = 120;
|
||||
kk->_9aa = 0;
|
||||
kk->npc_class.condition_info.demo_flg = aNPC_COND_DEMO_SKIP_HEAD_LOOKAT;
|
||||
}
|
||||
|
||||
static void aNTT_roll1_init(NPC_TOTAKEKE_ACTOR* kk, GAME_PLAY* play) {
|
||||
u8 bgm_no = CLIP(mikanbox_clip)->bgm_no_proc(kk);
|
||||
|
||||
mBGMPsComp_make_ps_demo(bgm_no, 0x168);
|
||||
mBGMPsComp_delete_ps_quiet();
|
||||
kk->npc_class.condition_info.demo_flg = aNPC_COND_DEMO_SKIP_KUTIPAKU | aNPC_COND_DEMO_SKIP_HEAD_LOOKAT;
|
||||
Camera2_request_main_staff_roll(play, GET_PLAYER_ACTOR_ACTOR(play), (ACTOR*)kk, 5);
|
||||
play->draw_chk_proc = &aNTT_draw_chk_proc;
|
||||
}
|
||||
|
||||
static void aNTT_roll2_init(NPC_TOTAKEKE_ACTOR* kk, GAME_PLAY* play) {
|
||||
kk->_9a2 = 0;
|
||||
aNTT_set_string(kk);
|
||||
kk->roll4_count = 0;
|
||||
}
|
||||
|
||||
static void aNTT_roll3_init(NPC_TOTAKEKE_ACTOR* kk, GAME_PLAY* play) {
|
||||
aNTT_set_string(kk);
|
||||
}
|
||||
|
||||
static void aNTT_roll_end_init(NPC_TOTAKEKE_ACTOR* kk, GAME_PLAY* play) {
|
||||
u8 bgm_no = CLIP(mikanbox_clip)->bgm_no_proc(kk);
|
||||
|
||||
mBGMPsComp_delete_ps_demo(bgm_no, 0x168);
|
||||
play->draw_chk_proc = (DRAW_CHK_PROC)&none_proc1;
|
||||
|
||||
if (CLIP(weather_clip) != NULL) {
|
||||
CLIP(weather_clip)->change_weather_instance(CLIP(weather_clip)->actor, mEnv_SAVE_GET_WEATHER_TYPE(Save_Get(weather)), mEnv_SAVE_GET_WEATHER_INTENSITY(Save_Get(weather)));
|
||||
}
|
||||
|
||||
mBGMPsComp_scene_mode(1);
|
||||
if (CLIP(weather_clip) != NULL) {
|
||||
CLIP(weather_clip)->start_sound();
|
||||
}
|
||||
}
|
||||
|
||||
static void aNTT_call_init(NPC_TOTAKEKE_ACTOR* kk, GAME_PLAY* play) {
|
||||
aNTT_event_save_c* kk_save = (aNTT_event_save_c*)mEv_get_save_area(mEv_EVENT_KK_SLIDER, 10);
|
||||
|
||||
staffroll_light_dt(play);
|
||||
kk_save->roll_flag = FALSE;
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
static aNTT_PROC init_table[] = {
|
||||
(aNTT_PROC)&none_proc1,
|
||||
&aNTT_roll_init,
|
||||
&aNTT_roll1_init,
|
||||
&aNTT_roll2_init,
|
||||
&aNTT_roll3_init,
|
||||
&aNTT_roll_end_init,
|
||||
&aNTT_call_init,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
static void aMKBC_clip_think_init(NPC_TOTAKEKE_ACTOR* kk, GAME_PLAY* play, int init_idx) {
|
||||
(*init_table[init_idx])(kk, play);
|
||||
}
|
||||
|
||||
static StaffRollInfo_c staffroll_info;
|
||||
|
||||
static void aMKBC_anime_stop(NPC_TOTAKEKE_ACTOR* kk) {
|
||||
if (kk->_9a0 == 0xFF) {
|
||||
kk->_9a0 = kk->npc_class.draw.main_animation.keyframe.frame_control.current_frame;
|
||||
}
|
||||
|
||||
kk->npc_class.draw.main_animation.keyframe.frame_control.current_frame = kk->_9a0;
|
||||
}
|
||||
|
||||
static void aMKBC_clip_head_up(ACTOR* actorx) {
|
||||
xyz_t pos;
|
||||
|
||||
pos.x = actorx->world.position.x;
|
||||
pos.y = actorx->world.position.y + 35.0f;
|
||||
pos.z = actorx->world.position.z + 40.0f;
|
||||
CLIP(npc_clip)->set_head_request_act_proc((NPC_ACTOR*)actorx, 4, aNPC_HEAD_TARGET_POS, NULL, &pos);
|
||||
}
|
||||
|
||||
static void aMKBC_clip_sound_proc(NPC_TOTAKEKE_ACTOR* kk, GAME_PLAY* play, int idx) {
|
||||
ACTOR* actorx = (ACTOR*)kk;
|
||||
|
||||
sAdos_GetStaffRollInfo(&staffroll_info);
|
||||
if (staffroll_info.staffroll_part == STAFFROLL_PART_FINISH) {
|
||||
aMKBC_anime_stop(kk);
|
||||
|
||||
if (kk->_9aa != 0) {
|
||||
aMKBC_clip_head_up(actorx);
|
||||
}
|
||||
} else {
|
||||
kk->npc_class.draw.tex_anim[aNPC_TEX_ANIM_MOUTH].pattern = staffroll_info.mouth_num;
|
||||
if (staffroll_info.blink_flag) {
|
||||
aMKBC_clip_head_up(actorx);
|
||||
kk->_9aa = TRUE;
|
||||
} else {
|
||||
kk->_9aa = FALSE;
|
||||
}
|
||||
|
||||
kk->npc_class.draw.main_animation.keyframe.frame_control.speed = 0.0f;
|
||||
|
||||
if (staffroll_info.staffroll_part == STAFFROLL_PART_FADEOUT) {
|
||||
aMKBC_anime_stop(kk);
|
||||
} else {
|
||||
switch (staffroll_info.beat) {
|
||||
case 3:
|
||||
if (kk->npc_class.draw.animation_id != aNPC_ANIM_3HAKU_E1) {
|
||||
CLIP(npc_clip)->animation_init_proc(actorx, aNPC_ANIM_3HAKU_E1, FALSE);
|
||||
}
|
||||
kk->npc_class.draw.main_animation.keyframe.frame_control.current_frame = 48.0f * (f32)staffroll_info.percent;
|
||||
break;
|
||||
case 4:
|
||||
if (kk->npc_class.draw.animation_id != aNPC_ANIM_4HAKU_E1) {
|
||||
CLIP(npc_clip)->animation_init_proc(actorx, aNPC_ANIM_4HAKU_E1, FALSE);
|
||||
}
|
||||
kk->npc_class.draw.main_animation.keyframe.frame_control.current_frame = 64.0f * (f32)staffroll_info.percent;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int aMKBC_clip_section_chk(int section) {
|
||||
return staffroll_info.staffroll_part == section;
|
||||
}
|
||||
|
||||
static u8 aMKBC_clip_bgm_no(NPC_TOTAKEKE_ACTOR* kk) {
|
||||
return BGM_TOTAKEKE_LIVE0 + kk->song;
|
||||
}
|
||||
|
||||
static void aMKBC_clip_roll_proc(NPC_TOTAKEKE_ACTOR* kk, GAME_PLAY* play) {
|
||||
ACTOR* actorx = (ACTOR*)kk;
|
||||
mFI_block_tbl_c* table_p = &play->block_table;
|
||||
aNTT_event_save_c* kk_save = (aNTT_event_save_c*)mEv_get_save_area(mEv_EVENT_KK_SLIDER, 10);
|
||||
int ux;
|
||||
int uz;
|
||||
int now_sec = Common_Get(time.now_sec);
|
||||
|
||||
|
||||
kk->show_timer++;
|
||||
if (kk->majin_flag) {
|
||||
kk_save->_00 = 550;
|
||||
}
|
||||
|
||||
if (kk->show_timer >= 4800) {
|
||||
if (kk->majin_flag) {
|
||||
kk_save->bitfield |= aNTT_FLAG_SP_DELETE_MAJIN;
|
||||
kk->majin_flag = FALSE;
|
||||
}
|
||||
|
||||
kk_save->_00 = 120;
|
||||
} else if (now_sec >= mTM_TIME2SEC(20, 45, 0) && now_sec <= mTM_TIME2SEC(20, 55, 0)) {
|
||||
if (kk->majin_flag == FALSE) {
|
||||
if (kk->show_timer >= 3600 && kk->show_timer < 3610) {
|
||||
mFI_Wpos2UtNum_inBlock(&ux, &uz, actorx->world.position);
|
||||
kk->majin_flag = CLIP(npc_clip)->setupActor_proc(play, SP_NPC_MAJIN5, -1, -1, -1, table_p->block_x, table_p->block_z, ux, uz);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aMKBC_clip_set_itemstr(int str_no, u8 md_no) {
|
||||
u8 item_name_str[mIN_ITEM_NAME_LEN];
|
||||
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
|
||||
|
||||
mIN_copy_name_str(item_name_str, ITM_MINIDISK_START + md_no);
|
||||
mMsg_Set_item_str_art(msg_p, str_no, item_name_str, mIN_ITEM_NAME_LEN, mIN_get_item_article(ITM_MINIDISK_START + md_no));
|
||||
}
|
||||
|
||||
static void aMKBC_clip_set_itemstr3() {
|
||||
aNTT_event_save_c* kk_save = (aNTT_event_save_c*)mEv_get_save_area(mEv_EVENT_KK_SLIDER, 10);
|
||||
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
|
||||
|
||||
mMsg_Set_item_str(msg_p, mMsg_FREE_STR0, kk_save->request_str, mIN_ITEM_NAME_LEN);
|
||||
}
|
||||
|
||||
static int aMKBC_count_merody(void) {
|
||||
u32* collect_bit;
|
||||
int i;
|
||||
int j;
|
||||
int k;
|
||||
int count;
|
||||
u32 bit;
|
||||
|
||||
collect_bit = Now_Private->aircheck_collect_bitfield;
|
||||
j = ITM_MINIDISK_START;
|
||||
count = 0;
|
||||
for (i = 0; i < ARRAY_COUNT(Now_Private->aircheck_collect_bitfield); i++) {
|
||||
bit = 1;
|
||||
for (k = 0; j < ITM_MINIDISK52 && k < 32; j++, k++) {
|
||||
if ((bit & collect_bit[i]) == 0) {
|
||||
count++;
|
||||
}
|
||||
|
||||
bit <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static u8 aMKBC_clip_search_merody(void) {
|
||||
int count;
|
||||
int j;
|
||||
int k;
|
||||
int i;
|
||||
u32 bit;
|
||||
u32* collect_bit;
|
||||
|
||||
count = aMKBC_count_merody();
|
||||
collect_bit = Now_Private->aircheck_collect_bitfield;
|
||||
if (count == 0) {
|
||||
count = aMKBC_NUM_GOOD_MD;
|
||||
Now_Private->aircheck_collect_bitfield[0] = 0;
|
||||
Now_Private->aircheck_collect_bitfield[1] = 0;
|
||||
}
|
||||
|
||||
count = RANDOM(count);
|
||||
j = ITM_MINIDISK_START;
|
||||
for (i = 0; i < ARRAY_COUNT(Now_Private->aircheck_collect_bitfield); i++) {
|
||||
bit = 1;
|
||||
for (k = 0; j < ITM_MINIDISK52 && k < 32; j++, k++) {
|
||||
if ((bit & collect_bit[i]) == 0) {
|
||||
if (count > 0) {
|
||||
count--;
|
||||
} else {
|
||||
return i * 32 + k;
|
||||
}
|
||||
}
|
||||
|
||||
bit <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void aMKBC_clip_check_merody(u32 md_no) {
|
||||
if (md_no < aMKBC_NUM_GOOD_MD) {
|
||||
u32* collect_bit = Now_Private->aircheck_collect_bitfield;
|
||||
|
||||
if (md_no < 32) {
|
||||
collect_bit[0] |= (1 << md_no);
|
||||
} else {
|
||||
collect_bit[1] |= (1 << (md_no - 32));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
// clang-format off
|
||||
static Vtx obj_e_mikanbox_v[] = {
|
||||
{{ {-2048, 128, 0}, 0, { (0 << 5), (0 << 5)}, {180, 180, 180, 180} }},
|
||||
{{ {-2048, -128, 0}, 0, { (0 << 5), (16 << 5)}, {180, 180, 180, 180} }},
|
||||
{{ { 2048, -128, 0}, 0, {(256 << 5), (16 << 5)}, {180, 180, 180, 180} }},
|
||||
{{ { 2048, 128, 0}, 0, {(256 << 5), (0 << 5)}, {180, 180, 180, 180} }},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
extern Gfx obj_e_mikanbox_copyrightT_model[];
|
||||
extern Gfx obj_e_mikanbox_copyrightT_model2[];
|
||||
|
||||
static void aMIK_copyright_draw(GAME* game) {
|
||||
GRAPH* graph = game->graph;
|
||||
aNTT_event_save_c* kk_save = (aNTT_event_save_c*)mEv_get_save_area(mEv_EVENT_KK_SLIDER, 10);
|
||||
u8 alpha;
|
||||
|
||||
if (kk_save == NULL || kk_save->copyright_alpha == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
alpha = kk_save->copyright_alpha;
|
||||
mFont_SetMatrix(graph, mFont_MODE_FONT);
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gDPPipeSync(NEXT_FONT_DISP);
|
||||
gDPSetPrimColor(NEXT_FONT_DISP, 0, 128, 255, 255, 255, alpha);
|
||||
gSPDisplayList(NEXT_FONT_DISP, obj_e_mikanbox_copyrightT_model);
|
||||
gSPVertex(NEXT_FONT_DISP, obj_e_mikanbox_v, 4, 0);
|
||||
gSP2Triangles(NEXT_FONT_DISP, 0, 1, 2, 0, 0, 2, 3, 0);
|
||||
|
||||
Matrix_push();
|
||||
Matrix_translate(0.0f, -900.0f, 0.0f, 1);
|
||||
Matrix_scale(0.85f, 0.85f, 1.0f, 1);
|
||||
gSPMatrix(NEXT_FONT_DISP, _Matrix_to_Mtx_new(graph), G_MTX_LOAD | G_MTX_NOPUSH);
|
||||
gSPDisplayList(NEXT_FONT_DISP, obj_e_mikanbox_copyrightT_model2);
|
||||
Matrix_pull();
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
|
||||
mFont_UnSetMatrix(graph, mFont_MODE_FONT);
|
||||
}
|
||||
|
||||
extern Gfx obj_e_mikanbox_model[];
|
||||
|
||||
static void aMIK_actor_draw(ACTOR* actorx, GAME* game) {
|
||||
GRAPH* graph = game->graph;
|
||||
u16* pal = (u16*)CLIP(structure_clip)->get_pal_segment_proc(aSTR_PAL_MIKANBOX);
|
||||
Mtx* mtx = _Matrix_to_Mtx_new(graph);
|
||||
|
||||
if (mtx != NULL) {
|
||||
_texture_z_light_fog_prim_npc(graph);
|
||||
|
||||
OPEN_POLY_OPA_DISP(graph);
|
||||
|
||||
gDPSetTextureAdjustMode(POLY_OPA_DISP++, G_TA_DOLPHIN);
|
||||
gDPSetTexEdgeAlpha(POLY_OPA_DISP++, 127);
|
||||
gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_LOAD | G_MTX_NOPUSH);
|
||||
gSPSegment(POLY_OPA_DISP++, ANIME_1_TXT_SEG, pal);
|
||||
gSPDisplayList(POLY_OPA_DISP++, obj_e_mikanbox_model);
|
||||
gDPSetTextureAdjustMode(POLY_OPA_DISP++, G_TA_N64);
|
||||
gDPSetTexEdgeAlpha(POLY_OPA_DISP++, 144);
|
||||
|
||||
CLOSE_POLY_OPA_DISP(graph);
|
||||
}
|
||||
|
||||
aMIK_copyright_draw(game);
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
static void aMIK_actor_init(ACTOR* actorx, GAME* game) {
|
||||
mFI_SetFG_common(DUMMY_MIKANBOX, actorx->home.position, FALSE);
|
||||
actorx->mv_proc = NONE_ACTOR_PROC;
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "m_bgm.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "m_string_data.h"
|
||||
#include "m_ledit_ovl.h"
|
||||
|
||||
void aNTT_schedule_proc();
|
||||
int aNTT_change_talk_proc(NPC_TOTAKEKE_ACTOR*, int);
|
||||
@@ -37,11 +38,11 @@ ACTOR_PROFILE Npc_Totakeke_Profile = {
|
||||
&aNTT_actor_save,
|
||||
};
|
||||
|
||||
void aNTT_actor_ct(ACTOR *actorx, GAME *game) {
|
||||
static void aNTT_actor_ct(ACTOR *actorx, GAME *game) {
|
||||
static aNPC_ct_data_c ct_data = {
|
||||
&aNTT_actor_move,
|
||||
&aNTT_actor_draw,
|
||||
0x5,
|
||||
aNPC_CT_SCHED_TYPE_SPECIAL,
|
||||
(mActor_proc)none_proc1,
|
||||
&aNTT_talk_init,
|
||||
&aNTT_talk_end_chk,
|
||||
@@ -49,16 +50,17 @@ void aNTT_actor_ct(ACTOR *actorx, GAME *game) {
|
||||
};
|
||||
aNTT_event_save_c *save = (aNTT_event_save_c *)mEv_get_save_area(mEv_EVENT_KK_SLIDER, 0xa);
|
||||
aNTT_event_common_c *common = (aNTT_event_common_c *)mEv_get_common_area(mEv_EVENT_KK_SLIDER, 0x10);
|
||||
|
||||
if (Common_Get(reset_flag) == TRUE) {
|
||||
Actor_delete(actorx);
|
||||
actorx->sv_proc = 0;
|
||||
actorx->dt_proc = 0;
|
||||
actorx->sv_proc = NULL;
|
||||
actorx->dt_proc = NULL;
|
||||
mNpc_RenewalSetNpc(actorx);
|
||||
mEv_actor_dying_message(mEv_EVENT_KK_SLIDER, actorx);
|
||||
} else if (CLIP(npc_clip)->birth_check_proc(actorx, game) == TRUE) {
|
||||
xyz_t wpos;
|
||||
|
||||
NPC_TOTAKEKE_ACTOR *totakeke = (NPC_TOTAKEKE_ACTOR *)actorx;
|
||||
|
||||
totakeke->npc_class.schedule.schedule_proc = aNTT_schedule_proc;
|
||||
CLIP(npc_clip)->ct_proc(actorx, game, &ct_data);
|
||||
totakeke->npc_class.palActorIgnoreTimer = -1;
|
||||
@@ -70,7 +72,7 @@ void aNTT_actor_ct(ACTOR *actorx, GAME *game) {
|
||||
actorx->max_velocity_y = 0.0f;
|
||||
totakeke->npc_class.talk_info.default_animation = aNPC_ANIM_WAIT_E1;
|
||||
totakeke->npc_class.talk_info.default_act = aNPC_ACT_TALK2;
|
||||
totakeke->npc_class.talk_info.turn = 2;
|
||||
totakeke->npc_class.talk_info.turn = aNPC_TALK_TURN_NONE;
|
||||
|
||||
aNTT_enso_init(totakeke);
|
||||
totakeke->_9a1 = FALSE;
|
||||
@@ -80,7 +82,7 @@ void aNTT_actor_ct(ACTOR *actorx, GAME *game) {
|
||||
save->bitfield = 0;
|
||||
}
|
||||
|
||||
save->bitfield = save->bitfield & 0x3fff;
|
||||
save->bitfield &= ~(aNTT_FLAG_SP_ROLL_END | aNTT_FLAG_SP_ROLL_DRAW);
|
||||
|
||||
{
|
||||
int i;
|
||||
@@ -89,51 +91,54 @@ void aNTT_actor_ct(ACTOR *actorx, GAME *game) {
|
||||
}
|
||||
}
|
||||
|
||||
save->_14 = 0;
|
||||
save->_15 = 0;
|
||||
save->roll_flag = FALSE;
|
||||
save->copyright_alpha = 0;
|
||||
|
||||
if (common == NULL) {
|
||||
common = (aNTT_event_common_c *)mEv_reserve_common_area(mEv_EVENT_KK_SLIDER, 0x10);
|
||||
common->foreigner_bitfield = 0;
|
||||
}
|
||||
totakeke->npc_class.collision.pipe.attribute.pipe.radius = 0x1e;
|
||||
totakeke->npc_class.collision.pipe.attribute.pipe.radius = 30;
|
||||
totakeke->melody_inst = 0;
|
||||
totakeke->_9a9 = 0;
|
||||
totakeke->majin_flag = 0;
|
||||
totakeke->_99f = 0xff;
|
||||
mCoBG_SetPlussOffset(actorx->world.position, 0x3, 0x64);
|
||||
mCoBG_SetPlussOffset(actorx->world.position, 3, mCoBG_ATTRIBUTE_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
void aNTT_actor_save(ACTOR *actorx, GAME *game) {
|
||||
static void aNTT_actor_save(ACTOR *actorx, GAME *game) {
|
||||
mNpc_RenewalSetNpc(actorx);
|
||||
}
|
||||
|
||||
void aNTT_actor_dt(ACTOR *actorx, GAME *game) {
|
||||
static void aNTT_actor_dt(ACTOR *actorx, GAME *game) {
|
||||
mEv_actor_dying_message(mEv_EVENT_KK_SLIDER, actorx);
|
||||
CLIP(npc_clip)->dt_proc(actorx, game);
|
||||
mCoBG_SetPlussOffset(actorx->world.position, 0x0, 0x64);
|
||||
}
|
||||
|
||||
void aNTT_actor_init(ACTOR *actorx, GAME *game) {
|
||||
static void aNTT_actor_init(ACTOR *actorx, GAME *game) {
|
||||
CLIP(npc_clip)->init_proc(actorx, game);
|
||||
}
|
||||
|
||||
void aNTT_actor_move(ACTOR *actorx, GAME *game) {
|
||||
static void aNTT_actor_move(ACTOR *actorx, GAME *game) {
|
||||
NPC_TOTAKEKE_ACTOR *totakeke = (NPC_TOTAKEKE_ACTOR *)actorx;
|
||||
|
||||
CLIP(npc_clip)->move_proc(actorx, game);
|
||||
if (totakeke->npc_class.draw.animation_id == aNPC_ANIM_ENSOU_E1) {
|
||||
totakeke->npc_class.draw.main_animation.keyframe.frame_control.mode = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void aNTT_actor_draw(ACTOR *actorx, GAME *game) {
|
||||
static void aNTT_actor_draw(ACTOR *actorx, GAME *game) {
|
||||
NPC_TOTAKEKE_ACTOR *totakeke = (NPC_TOTAKEKE_ACTOR *)actorx;
|
||||
aNTT_event_save_c *save = (aNTT_event_save_c *)mEv_get_save_area(mEv_EVENT_KK_SLIDER, 0xa);
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
CLIP(npc_clip)->draw_proc(actorx, game);
|
||||
if (save == NULL || (save->bitfield & 0x4000) == 0 || CLIP(totakeke_clip) == NULL) {
|
||||
if (save == NULL || (save->bitfield & 0x4000) == 0 || CLIP(mikanbox_clip) == NULL) {
|
||||
return;
|
||||
}
|
||||
CLIP(totakeke_clip)->_04(game, totakeke->roll2_count, totakeke->_9a2);
|
||||
CLIP(mikanbox_clip)->roll_draw_proc(play, totakeke->roll2_count, totakeke->_9a2);
|
||||
}
|
||||
|
||||
#include "../src/actor/npc/ac_npc_totakeke_talk.c_inc"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
u16 aNTT_bitset_func(u16 field, int flag) {
|
||||
static u16 aNTT_bitset_func(u16 field, int flag) {
|
||||
u32 player_no = Common_Get(player_no);
|
||||
aNTT_event_common_c *common = (aNTT_event_common_c *)mEv_get_common_area(mEv_EVENT_KK_SLIDER, 0x10);
|
||||
aNTT_event_common_c* common = (aNTT_event_common_c*)mEv_get_common_area(mEv_EVENT_KK_SLIDER, 0x10);
|
||||
if (player_no == mPr_FOREIGNER) {
|
||||
common->foreigner_bitfield |= flag;
|
||||
} else {
|
||||
@@ -9,9 +9,9 @@ u16 aNTT_bitset_func(u16 field, int flag) {
|
||||
return field;
|
||||
}
|
||||
|
||||
int aNTT_bitcheck_func(int field, u16 flag) {
|
||||
static int aNTT_bitcheck_func(int field, u16 flag) {
|
||||
u16 player_no = Common_Get(player_no);
|
||||
aNTT_event_common_c *common = (aNTT_event_common_c *)mEv_get_common_area(mEv_EVENT_KK_SLIDER, 0x10);
|
||||
aNTT_event_common_c* common = (aNTT_event_common_c*)mEv_get_common_area(mEv_EVENT_KK_SLIDER, 0x10);
|
||||
if (player_no == mPr_FOREIGNER) {
|
||||
return common->foreigner_bitfield & flag;
|
||||
} else {
|
||||
@@ -19,14 +19,14 @@ int aNTT_bitcheck_func(int field, u16 flag) {
|
||||
}
|
||||
}
|
||||
|
||||
int aNTT_enso_init(NPC_TOTAKEKE_ACTOR *totakeke) {
|
||||
totakeke->npc_class.request.act_priority = 0x4;
|
||||
totakeke->npc_class.request.act_idx = 0xd;
|
||||
totakeke->npc_class.request.act_type = 0x0;
|
||||
static int aNTT_enso_init(NPC_TOTAKEKE_ACTOR* totakeke) {
|
||||
totakeke->npc_class.request.act_priority = 4;
|
||||
totakeke->npc_class.request.act_idx = aNPC_ACT_ENSOU;
|
||||
totakeke->npc_class.request.act_type = aNPC_ACT_TYPE_DEFAULT;
|
||||
}
|
||||
|
||||
void aTTN_give_merody(NPC_TOTAKEKE_ACTOR *totakeke) {
|
||||
aNTT_event_save_c *save = (aNTT_event_save_c *)mEv_get_save_area(mEv_EVENT_KK_SLIDER, 0xa);
|
||||
static void aTTN_give_merody(NPC_TOTAKEKE_ACTOR* totakeke) {
|
||||
aNTT_event_save_c* save = (aNTT_event_save_c*)mEv_get_save_area(mEv_EVENT_KK_SLIDER, 0xa);
|
||||
|
||||
if (mPr_GetPossessionItemSumWithCond(Now_Private, EMPTY_NO, mPr_ITEM_COND_NORMAL) == 0) {
|
||||
totakeke->post_roll_think = aNTT_THINK_POCKETS_FULL;
|
||||
@@ -34,107 +34,106 @@ void aTTN_give_merody(NPC_TOTAKEKE_ACTOR *totakeke) {
|
||||
totakeke->post_roll_think = aNTT_THINK_GIVE_MERODY;
|
||||
mPr_SetFreePossessionItem(Now_Private, ITM_MINIDISK_START + totakeke->song, mPr_ITEM_COND_NORMAL);
|
||||
save->bitfield = aNTT_bitset_func(save->bitfield, aNTT_FLAG_AIRCHECK_RECEIVED);
|
||||
CLIP(totakeke_clip)->_2c(totakeke->song);
|
||||
CLIP(mikanbox_clip)->check_merody_proc(totakeke->song);
|
||||
}
|
||||
}
|
||||
|
||||
void aNTT_talk_select0(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
static void aNTT_talk_select0(NPC_TOTAKEKE_ACTOR* totakeke, GAME_PLAY* play) {
|
||||
int value = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 0x9);
|
||||
aNTT_event_save_c *save = (aNTT_event_save_c *)mEv_get_save_area(mEv_EVENT_KK_SLIDER, 0xa);
|
||||
aNTT_event_save_c* save = (aNTT_event_save_c*)mEv_get_save_area(mEv_EVENT_KK_SLIDER, 0xa);
|
||||
if (value == 0x1 && mMsg_Check_MainNormalContinue(mMsg_Get_base_window_p()) == TRUE) {
|
||||
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 0x9, 0x0);
|
||||
save->bitfield = aNTT_bitset_func(save->bitfield, aNTT_FLAG_0);
|
||||
save->bitfield = aNTT_bitset_func(save->bitfield, aNTT_FLAG_HELLO);
|
||||
switch (mChoice_Get_ChoseNum(mChoice_Get_base_window_p())) {
|
||||
case mChoice_CHOICE0:
|
||||
if (aNTT_bitcheck_func(save->bitfield, aNTT_FLAG_AIRCHECK_RECEIVED)) {
|
||||
mMsg_Set_continue_msg_num(mMsg_Get_base_window_p(), mString_TOTAKEKE_START + 4);
|
||||
case mChoice_CHOICE0:
|
||||
if (aNTT_bitcheck_func(save->bitfield, aNTT_FLAG_AIRCHECK_RECEIVED)) {
|
||||
mMsg_Set_continue_msg_num(mMsg_Get_base_window_p(), MSG_TOTAKEKE_START + 4);
|
||||
aNTT_change_talk_proc(totakeke, aNTT_TALK_NONE);
|
||||
} else {
|
||||
mMsg_Set_continue_msg_num(mMsg_Get_base_window_p(), MSG_TOTAKEKE_START + 5);
|
||||
aNTT_change_talk_proc(totakeke, aNTT_TALK_SELECT1);
|
||||
}
|
||||
break;
|
||||
case mChoice_CHOICE1:
|
||||
aNTT_change_talk_proc(totakeke, aNTT_TALK_NONE);
|
||||
} else {
|
||||
mMsg_Set_continue_msg_num(mMsg_Get_base_window_p(), mString_TOTAKEKE_START + 5);
|
||||
aNTT_change_talk_proc(totakeke, aNTT_TALK_SELECT1);
|
||||
}
|
||||
break;
|
||||
case mChoice_CHOICE1:
|
||||
aNTT_change_talk_proc(totakeke, aNTT_TALK_NONE);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void aNTT_talk_select1(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
static void aNTT_talk_select1(NPC_TOTAKEKE_ACTOR* totakeke, GAME_PLAY* play) {
|
||||
int value = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 0x9);
|
||||
if (value == 0x2 && mMsg_Check_MainNormalContinue(mMsg_Get_base_window_p()) == TRUE) {
|
||||
int count;
|
||||
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 0x9, 0x0);
|
||||
switch (mChoice_Get_ChoseNum(mChoice_Get_base_window_p())) {
|
||||
case mChoice_CHOICE1:
|
||||
mMsg_request_main_disappear_wait_type1(mMsg_Get_base_window_p());
|
||||
aNTT_change_talk_proc(totakeke, aNTT_TALK_SUBMENU);
|
||||
break;
|
||||
case mChoice_CHOICE0:
|
||||
totakeke->song = CLIP(totakeke_clip)->pick_song();
|
||||
for (count = 0; count < 3 && totakeke->song == totakeke->_99f; count++) {
|
||||
totakeke->song = CLIP(totakeke_clip)->pick_song();
|
||||
}
|
||||
totakeke->_99f = totakeke->song;
|
||||
CLIP(totakeke_clip)->_20(0x1, totakeke->song);
|
||||
CLIP(totakeke_clip)->_20(0x2, totakeke->song);
|
||||
mMsg_Set_continue_msg_num(mMsg_Get_base_window_p(), mString_TOTAKEKE_START + 10);
|
||||
aNTT_change_talk_proc(totakeke, aNTT_TALK_STOP_PLAYER);
|
||||
totakeke->pre_roll_think = aNTT_THINK_ROLL2;
|
||||
aTTN_give_merody(totakeke);
|
||||
break;
|
||||
case mChoice_CHOICE1:
|
||||
mMsg_request_main_disappear_wait_type1(mMsg_Get_base_window_p());
|
||||
aNTT_change_talk_proc(totakeke, aNTT_TALK_SUBMENU);
|
||||
break;
|
||||
case mChoice_CHOICE0:
|
||||
totakeke->song = CLIP(mikanbox_clip)->search_merody_proc();
|
||||
for (count = 0; count < 3 && totakeke->song == totakeke->_99f; count++) {
|
||||
totakeke->song = CLIP(mikanbox_clip)->search_merody_proc();
|
||||
}
|
||||
totakeke->_99f = totakeke->song;
|
||||
CLIP(mikanbox_clip)->set_itemstr_proc(mMsg_ITEM_STR1, totakeke->song);
|
||||
CLIP(mikanbox_clip)->set_itemstr_proc(mMsg_ITEM_STR2, totakeke->song);
|
||||
mMsg_Set_continue_msg_num(mMsg_Get_base_window_p(), MSG_TOTAKEKE_START + 10);
|
||||
aNTT_change_talk_proc(totakeke, aNTT_TALK_STOP_PLAYER);
|
||||
totakeke->pre_roll_think = aNTT_THINK_ROLL2;
|
||||
aTTN_give_merody(totakeke);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void aNTT_talk_stop_player(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
ACTOR *actorx = (ACTOR *)totakeke;
|
||||
GAME *game = (GAME *)play;
|
||||
static void aNTT_talk_stop_player(NPC_TOTAKEKE_ACTOR* totakeke, GAME_PLAY* play) {
|
||||
ACTOR* actorx = (ACTOR*)totakeke;
|
||||
GAME* game = (GAME*)play;
|
||||
if (mMsg_Check_MainDisappear(mMsg_Get_base_window_p()) && totakeke->_9ab == FALSE) {
|
||||
aWeather_Clip_c *clip = CLIP(weather_clip);
|
||||
if (clip != NULL) {
|
||||
clip->stop_sound();
|
||||
if (CLIP(weather_clip) != NULL) {
|
||||
CLIP(weather_clip)->stop_sound();
|
||||
}
|
||||
mBGMPsComp_scene_mode(0x5);
|
||||
totakeke->_9ab = TRUE;
|
||||
}
|
||||
if (mDemo_Check(mDemo_TYPE_TALK, actorx) == 0 && mDemo_Check(mDemo_TYPE_SPEAK, actorx) == 0x0) {
|
||||
if (mPlib_get_player_actor_main_index(game) != 0x4a) {
|
||||
mPlib_request_main_demo_wait_type1(game, 0x0, 0x0);
|
||||
if (mPlib_get_player_actor_main_index(game) != mPlayer_INDEX_DEMO_WAIT) {
|
||||
mPlib_request_main_demo_wait_type1(game, FALSE, NULL);
|
||||
} else {
|
||||
aNTT_change_talk_proc(totakeke, aNTT_TALK_NONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void aNTT_talk_submenu(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
Submenu *submenu = &play->submenu;
|
||||
aNTT_event_save_c *save = (aNTT_event_save_c *)mEv_get_save_area(mEv_EVENT_KK_SLIDER, 0xa);
|
||||
static void aNTT_talk_submenu(NPC_TOTAKEKE_ACTOR* totakeke, GAME_PLAY* play) {
|
||||
Submenu* submenu = &play->submenu;
|
||||
aNTT_event_save_c* save = (aNTT_event_save_c*)mEv_get_save_area(mEv_EVENT_KK_SLIDER, 0xa);
|
||||
if (mMsg_Check_main_wait(mMsg_Get_base_window_p()) == TRUE) {
|
||||
aNTT_change_talk_proc(totakeke, aNTT_TALK_SUBMENU2);
|
||||
mSM_open_submenu_new(submenu, mSM_OVL_LEDIT, 0x4, 0x0, save->request_str);
|
||||
mSM_open_submenu_new(submenu, mSM_OVL_LEDIT, mLE_TYPE_REQUEST, 0, save->request_str);
|
||||
mMsg_request_main_appear_wait_type1(mMsg_Get_base_window_p());
|
||||
}
|
||||
}
|
||||
|
||||
void aNTT_talk_submenu2(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
static void aNTT_talk_submenu2(NPC_TOTAKEKE_ACTOR* totakeke, GAME_PLAY* play) {
|
||||
if (play->submenu.open_flag == FALSE && mMsg_Check_not_series_main_wait(mMsg_Get_base_window_p()) == TRUE) {
|
||||
Submenu_Item_c *submenu_item = play->submenu.item_p;
|
||||
CLIP(totakeke_clip)->_24();
|
||||
Submenu_Item_c* submenu_item = play->submenu.item_p;
|
||||
CLIP(mikanbox_clip)->set_itemstr3_proc();
|
||||
mMsg_Set_ForceNext(mMsg_Get_base_window_p());
|
||||
if (submenu_item->item == ITM_MINIDISK_END) {
|
||||
mMsg_Set_continue_msg_num(mMsg_Get_base_window_p(), mString_TOTAKEKE_START + 6);
|
||||
mMsg_Set_continue_msg_num(mMsg_Get_base_window_p(), MSG_TOTAKEKE_START + 6);
|
||||
totakeke->post_roll_think = 0xc;
|
||||
totakeke->song = 0x37 + (int)RANDOM_F(3);
|
||||
} else {
|
||||
totakeke->song = submenu_item->item - ITM_MINIDISK_START;
|
||||
if (totakeke->song >= 0x34) {
|
||||
mMsg_Set_continue_msg_num(mMsg_Get_base_window_p(), mString_TOTAKEKE_START + 8);
|
||||
mMsg_Set_continue_msg_num(mMsg_Get_base_window_p(), MSG_TOTAKEKE_START + 8);
|
||||
} else {
|
||||
mMsg_Set_continue_msg_num(mMsg_Get_base_window_p(), mString_TOTAKEKE_START + 9);
|
||||
mMsg_Set_continue_msg_num(mMsg_Get_base_window_p(), MSG_TOTAKEKE_START + 9);
|
||||
}
|
||||
CLIP(totakeke_clip)->_20(0x2, totakeke->song);
|
||||
CLIP(mikanbox_clip)->set_itemstr_proc(mMsg_ITEM_STR2, totakeke->song);
|
||||
aTTN_give_merody(totakeke);
|
||||
}
|
||||
aNTT_change_talk_proc(totakeke, aNTT_TALK_STOP_PLAYER);
|
||||
@@ -142,26 +141,19 @@ void aNTT_talk_submenu2(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
}
|
||||
}
|
||||
|
||||
void aNTT_talk_give(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
static void aNTT_talk_give(NPC_TOTAKEKE_ACTOR* totakeke, GAME_PLAY* play) {
|
||||
int value = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 0x1);
|
||||
if (value == 0x2) {
|
||||
mDemo_Set_OrderValue(0x5, 0x0, ITM_MINIDISK_START + totakeke->song);
|
||||
mDemo_Set_OrderValue(0x5, 0x1, 0x7);
|
||||
mDemo_Set_OrderValue(0x5, 0x2, 0x0);
|
||||
mDemo_Set_OrderValue(mDemo_ORDER_NPC1, 0x0, ITM_MINIDISK_START + totakeke->song);
|
||||
mDemo_Set_OrderValue(mDemo_ORDER_NPC1, 0x1, 0x7);
|
||||
mDemo_Set_OrderValue(mDemo_ORDER_NPC1, 0x2, 0x0);
|
||||
aNTT_change_talk_proc(totakeke, aNTT_TALK_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
int aNTT_change_talk_proc(NPC_TOTAKEKE_ACTOR *totakeke, int talk) {
|
||||
static aNTT_PROC proc[7] = {
|
||||
(aNTT_PROC)none_proc1,
|
||||
aNTT_talk_select0,
|
||||
aNTT_talk_select1,
|
||||
aNTT_talk_stop_player,
|
||||
aNTT_talk_submenu,
|
||||
aNTT_talk_submenu2,
|
||||
aNTT_talk_give
|
||||
};
|
||||
static int aNTT_change_talk_proc(NPC_TOTAKEKE_ACTOR* totakeke, int talk) {
|
||||
static aNTT_PROC proc[7] = { (aNTT_PROC)none_proc1, aNTT_talk_select0, aNTT_talk_select1, aNTT_talk_stop_player,
|
||||
aNTT_talk_submenu, aNTT_talk_submenu2, aNTT_talk_give };
|
||||
totakeke->proc = proc[talk];
|
||||
if (talk == aNTT_TALK_STOP_PLAYER) {
|
||||
mEv_SetTitleDemo(-0x9);
|
||||
@@ -171,16 +163,16 @@ int aNTT_change_talk_proc(NPC_TOTAKEKE_ACTOR *totakeke, int talk) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void aNTT_set_force_talk_info(ACTOR *actorx) {
|
||||
NPC_TOTAKEKE_ACTOR *totakeke = (NPC_TOTAKEKE_ACTOR *)actorx;
|
||||
static u8 msg[3] = {0xc, 0xb, 0x7};
|
||||
mDemo_Set_msg_num(mString_TOTAKEKE_START + msg[totakeke->talk]);
|
||||
static void aNTT_set_force_talk_info(ACTOR* actorx) {
|
||||
NPC_TOTAKEKE_ACTOR* totakeke = (NPC_TOTAKEKE_ACTOR*)actorx;
|
||||
static u8 msg[3] = { 0xc, 0xb, 0x7 };
|
||||
mDemo_Set_msg_num(MSG_TOTAKEKE_START + msg[totakeke->talk]);
|
||||
mDemo_Set_talk_turn(TRUE);
|
||||
mDemo_Set_camera(TRUE);
|
||||
if (totakeke->talk == 0) {
|
||||
totakeke->proc = aNTT_talk_give;
|
||||
} else {
|
||||
totakeke->proc = (void *)none_proc1;
|
||||
totakeke->proc = (void*)none_proc1;
|
||||
}
|
||||
if (totakeke->npc_class.talk_info.melody_inst) {
|
||||
totakeke->melody_inst = totakeke->npc_class.talk_info.melody_inst;
|
||||
@@ -188,62 +180,62 @@ void aNTT_set_force_talk_info(ACTOR *actorx) {
|
||||
totakeke->npc_class.talk_info.melody_inst = 0;
|
||||
}
|
||||
|
||||
void aNTT_force_talk_request(ACTOR *actorx, GAME *game) {
|
||||
NPC_TOTAKEKE_ACTOR *totakeke = (NPC_TOTAKEKE_ACTOR *)actorx;
|
||||
static void aNTT_force_talk_request(ACTOR* actorx, GAME* game) {
|
||||
NPC_TOTAKEKE_ACTOR* totakeke = (NPC_TOTAKEKE_ACTOR*)actorx;
|
||||
if (totakeke->_9a1 == FALSE) {
|
||||
mDemo_Request(0x8, (ACTOR *)totakeke, aNTT_set_force_talk_info);
|
||||
mDemo_Request(mDemo_TYPE_SPEAK, (ACTOR*)totakeke, aNTT_set_force_talk_info);
|
||||
} else {
|
||||
totakeke->_9a1 = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void aNTT_set_norm_talk_info(ACTOR *actorx) {
|
||||
NPC_TOTAKEKE_ACTOR *totakeke = (NPC_TOTAKEKE_ACTOR *)actorx;
|
||||
static u8 msg[4] = {0x0, 0x1, 0x2, 0xd};
|
||||
mDemo_Set_msg_num(mString_TOTAKEKE_START + msg[totakeke->talk]);
|
||||
static void aNTT_set_norm_talk_info(ACTOR* actorx) {
|
||||
NPC_TOTAKEKE_ACTOR* totakeke = (NPC_TOTAKEKE_ACTOR*)actorx;
|
||||
static u8 msg[4] = { 0x0, 0x1, 0x2, 0xd };
|
||||
mDemo_Set_msg_num(MSG_TOTAKEKE_START + msg[totakeke->talk]);
|
||||
mDemo_Set_talk_turn(TRUE);
|
||||
mDemo_Set_camera(TRUE);
|
||||
switch (totakeke->talk) {
|
||||
case 0:
|
||||
totakeke->proc = (void *)none_proc1;
|
||||
break;
|
||||
case 3:
|
||||
Now_Private->state_flags |= mPr_FLAG_TOTAKEKE_INTRODUCTION;
|
||||
totakeke->proc = aNTT_talk_select0;
|
||||
break;
|
||||
default:
|
||||
totakeke->proc = aNTT_talk_select0;
|
||||
break;
|
||||
case 0:
|
||||
totakeke->proc = (void*)none_proc1;
|
||||
break;
|
||||
case 3:
|
||||
Now_Private->state_flags |= mPr_FLAG_TOTAKEKE_INTRODUCTION;
|
||||
totakeke->proc = aNTT_talk_select0;
|
||||
break;
|
||||
default:
|
||||
totakeke->proc = aNTT_talk_select0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void aNTT_norm_talk_request(ACTOR *actorx, GAME *game) {
|
||||
NPC_TOTAKEKE_ACTOR *totakeke = (NPC_TOTAKEKE_ACTOR *)actorx;
|
||||
static void aNTT_norm_talk_request(ACTOR* actorx, GAME* game) {
|
||||
NPC_TOTAKEKE_ACTOR* totakeke = (NPC_TOTAKEKE_ACTOR*)actorx;
|
||||
if (totakeke->_9a1 == FALSE) {
|
||||
mDemo_Request(0x7, (ACTOR *)totakeke, aNTT_set_norm_talk_info);
|
||||
mDemo_Request(mDemo_TYPE_TALK, (ACTOR*)totakeke, aNTT_set_norm_talk_info);
|
||||
} else {
|
||||
totakeke->_9a1 = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
int aNTT_talk_init(ACTOR *actorx, GAME *game) {
|
||||
NPC_TOTAKEKE_ACTOR *totakeke = (NPC_TOTAKEKE_ACTOR *)actorx;
|
||||
totakeke->npc_class.talk_info.talk_request_proc = (void *)none_proc1;
|
||||
static int aNTT_talk_init(ACTOR* actorx, GAME* game) {
|
||||
NPC_TOTAKEKE_ACTOR* totakeke = (NPC_TOTAKEKE_ACTOR*)actorx;
|
||||
totakeke->npc_class.talk_info.talk_request_proc = (void*)none_proc1;
|
||||
mDemo_Set_ListenAble();
|
||||
mDemo_Start(actorx);
|
||||
switch (totakeke->think) {
|
||||
case aNTT_THINK_GIVE_MERODY:
|
||||
case aNTT_THINK_POCKETS_FULL:
|
||||
case aNTT_THINK_GIVE_LATER:
|
||||
mEv_SetTitleDemo(0);
|
||||
break;
|
||||
case aNTT_THINK_GIVE_MERODY:
|
||||
case aNTT_THINK_POCKETS_FULL:
|
||||
case aNTT_THINK_GIVE_LATER:
|
||||
mEv_SetTitleDemo(0);
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int aNTT_talk_end_chk(ACTOR *actorx, GAME *game) {
|
||||
NPC_TOTAKEKE_ACTOR *totakeke = (NPC_TOTAKEKE_ACTOR *)actorx;
|
||||
GAME_PLAY *play = (GAME_PLAY *)game;
|
||||
static int aNTT_talk_end_chk(ACTOR* actorx, GAME* game) {
|
||||
NPC_TOTAKEKE_ACTOR* totakeke = (NPC_TOTAKEKE_ACTOR*)actorx;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
int res = FALSE;
|
||||
totakeke->proc(totakeke, play);
|
||||
if (mDemo_Check(mDemo_TYPE_SPEAK, actorx) == FALSE && mDemo_Check(mDemo_TYPE_TALK, actorx) == FALSE) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
void aNTT_wait(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
static void aNTT_wait(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
ACTOR *actorx = (ACTOR *)totakeke;
|
||||
aNTT_event_save_c *save = (aNTT_event_save_c *)mEv_get_save_area(mEv_EVENT_KK_SLIDER, 0xa);
|
||||
if (ABS(actorx->player_angle_y) > 4000) {
|
||||
@@ -9,7 +9,7 @@ void aNTT_wait(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
if (totakeke->think != aNTT_THINK_ROLL1) {
|
||||
aNTT_setup_think_proc(totakeke, play, 0x3);
|
||||
}
|
||||
} else if (aNTT_bitcheck_func(save->bitfield, aNTT_FLAG_0) == 0) {
|
||||
} else if (aNTT_bitcheck_func(save->bitfield, aNTT_FLAG_HELLO) == 0) {
|
||||
if (totakeke->think != aNTT_THINK_WAIT) {
|
||||
aNTT_setup_think_proc(totakeke, play, 0x1);
|
||||
}
|
||||
@@ -18,39 +18,39 @@ void aNTT_wait(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
}
|
||||
}
|
||||
|
||||
void aNTT_roll(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
static void aNTT_roll(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
staffroll_light_proc_start(play);
|
||||
if (totakeke->roll2_count > 0) {
|
||||
totakeke->roll2_count -= 1;
|
||||
} else {
|
||||
aNTT_setup_think_proc(totakeke, play, ++totakeke->think);
|
||||
}
|
||||
CLIP(totakeke_clip)->_18(totakeke, play);
|
||||
CLIP(mikanbox_clip)->roll_proc(totakeke, play);
|
||||
}
|
||||
|
||||
void aNTT_roll1(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
u8 bgm = CLIP(totakeke_clip)->_14(totakeke);
|
||||
static void aNTT_roll1(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
u8 bgm = CLIP(mikanbox_clip)->bgm_no_proc(totakeke);
|
||||
if (bgm == mBGMPsComp_execute_bgm_num_get()) {
|
||||
if (CLIP(totakeke_clip) != NULL) {
|
||||
CLIP(totakeke_clip)->_0C(totakeke, play, 0);
|
||||
if (CLIP(totakeke_clip)->_10(0x2)) {
|
||||
if (CLIP(mikanbox_clip) != NULL) {
|
||||
CLIP(mikanbox_clip)->sound_proc(totakeke, play, 0);
|
||||
if (CLIP(mikanbox_clip)->section_chk_proc(0x2)) {
|
||||
aNTT_setup_think_proc(totakeke, play, ++totakeke->think);
|
||||
}
|
||||
}
|
||||
CLIP(totakeke_clip)->_18(totakeke, play);
|
||||
CLIP(mikanbox_clip)->roll_proc(totakeke, play);
|
||||
}
|
||||
}
|
||||
|
||||
void aNTT_roll2(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
static void aNTT_roll2(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
aWeather_Clip_c *weather;
|
||||
aNTT_event_save_c *save = (aNTT_event_save_c *)mEv_get_save_area(mEv_EVENT_KK_SLIDER, 0xa);
|
||||
if (CLIP(totakeke_clip) != NULL) {
|
||||
CLIP(totakeke_clip)->_0C(totakeke, play, 0x0);
|
||||
if (CLIP(mikanbox_clip) != NULL) {
|
||||
CLIP(mikanbox_clip)->sound_proc(totakeke, play, 0x0);
|
||||
}
|
||||
staffroll_light_proc_start(play);
|
||||
totakeke->roll2_count += 1;
|
||||
totakeke->roll4_count += 1;
|
||||
CLIP(totakeke_clip)->_18(totakeke, play);
|
||||
CLIP(mikanbox_clip)->roll_proc(totakeke, play);
|
||||
weather = CLIP(weather_clip);
|
||||
if (weather != NULL) {
|
||||
if (totakeke->roll4_count == 0x15e0) {
|
||||
@@ -75,41 +75,41 @@ void aNTT_roll2(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
totakeke->_9a2 += 1;
|
||||
if (totakeke->_9a2 >= 0x10) {
|
||||
aNTT_setup_think_proc(totakeke, play, 0x8);
|
||||
save->bitfield |= 0x8000;
|
||||
save->bitfield &= ~(0x4000);
|
||||
save->bitfield |= aNTT_FLAG_SP_ROLL_END;
|
||||
save->bitfield &= ~aNTT_FLAG_SP_ROLL_DRAW;
|
||||
} else {
|
||||
aNTT_setup_think_proc(totakeke, play, 0x7);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void aNTT_roll4(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
static void aNTT_roll4(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
aNTT_event_save_c *save = (aNTT_event_save_c *)mEv_get_save_area(mEv_EVENT_KK_SLIDER, 0xa);
|
||||
totakeke->roll4_count += 1;
|
||||
CLIP(totakeke_clip)->_18(totakeke, play);
|
||||
CLIP(mikanbox_clip)->roll_proc(totakeke, play);
|
||||
if (totakeke->roll4_count >= 0x1d88 || totakeke->roll4_count <= 0x1c70) {
|
||||
save->_15 = 0;
|
||||
save->copyright_alpha = 0;
|
||||
} else if (totakeke->roll4_count > 0x1d38) {
|
||||
save->_15 = 3.1875f * (0x1d88 - totakeke->roll4_count);
|
||||
save->copyright_alpha = 3.1875f * (0x1d88 - totakeke->roll4_count);
|
||||
} else if (totakeke->roll4_count < 0x1cc0) {
|
||||
save->_15 = 3.1875f * (totakeke->roll4_count - 0x1c70);
|
||||
save->copyright_alpha = 3.1875f * (totakeke->roll4_count - 0x1c70);
|
||||
} else {
|
||||
save->_15 = 0xff;
|
||||
save->copyright_alpha = 255;
|
||||
}
|
||||
|
||||
if (CLIP(totakeke_clip) != NULL) {
|
||||
CLIP(totakeke_clip)->_0C(totakeke, play, 0);
|
||||
if (CLIP(totakeke_clip)->_10(0x4) && totakeke->roll4_count > 0x1d88) {
|
||||
save->_15 = 0;
|
||||
if (CLIP(mikanbox_clip) != NULL) {
|
||||
CLIP(mikanbox_clip)->sound_proc(totakeke, play, 0);
|
||||
if (CLIP(mikanbox_clip)->section_chk_proc(0x4) && totakeke->roll4_count > 0x1d88) {
|
||||
save->copyright_alpha = 0;
|
||||
aNTT_setup_think_proc(totakeke, play, 0x9);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void aNTT_roll_end(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
static void aNTT_roll_end(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
totakeke->npc_class.draw.main_animation.keyframe.frame_control.current_frame = totakeke->_9a0;
|
||||
if (totakeke->_9aa != 0) {
|
||||
CLIP(totakeke_clip)->_1c(totakeke);
|
||||
CLIP(mikanbox_clip)->head_up_proc((ACTOR*)totakeke);
|
||||
}
|
||||
if (staffroll_light_proc_end(play)) {
|
||||
aNTT_setup_think_proc(totakeke, play, totakeke->post_roll_think);
|
||||
@@ -127,11 +127,11 @@ static aNTT_PROC proc_table[7] = {
|
||||
aNTT_roll_end
|
||||
};
|
||||
|
||||
void aNTT_think_main_proc(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
static void aNTT_think_main_proc(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
proc_table[totakeke->think_proc_id](totakeke, play);
|
||||
}
|
||||
|
||||
void aNTT_think_init_proc(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
static void aNTT_think_init_proc(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
totakeke->npc_class.actor_class.status_data.weight = 0xff;
|
||||
totakeke->npc_class.condition_info.hide_request = FALSE;
|
||||
aNTT_setup_think_proc(totakeke, play, 0);
|
||||
@@ -153,7 +153,7 @@ static aNTT_think_data_c dt_tbl[13] = {
|
||||
{aNTT_THINK_NONE, 6, 2, aNTT_TALK_SELECT1, aNTT_THINK_NONE}
|
||||
};
|
||||
|
||||
void aNTT_setup_think_proc(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play, u8 think_id) {
|
||||
static void aNTT_setup_think_proc(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play, u8 think_id) {
|
||||
static aNPC_TALK_REQUEST_PROC talk_request_table[3] = {
|
||||
(aNPC_TALK_REQUEST_PROC)none_proc1,
|
||||
aNTT_norm_talk_request,
|
||||
@@ -169,12 +169,12 @@ void aNTT_setup_think_proc(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play, u8 thi
|
||||
totakeke->talk = think->talk;
|
||||
totakeke->pre_roll_think = think->pre_roll_think;
|
||||
|
||||
if (CLIP(totakeke_clip) != NULL) {
|
||||
CLIP(totakeke_clip)->_08(totakeke, play, think->_01);
|
||||
if (CLIP(mikanbox_clip) != NULL) {
|
||||
CLIP(mikanbox_clip)->think_init_proc(totakeke, play, think->think_init_idx);
|
||||
}
|
||||
}
|
||||
|
||||
void aNTT_think_proc(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play, int think_id) {
|
||||
static void aNTT_think_proc(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play, int think_id) {
|
||||
switch (think_id) {
|
||||
case 0x0:
|
||||
aNTT_think_init_proc(totakeke, play);
|
||||
@@ -185,18 +185,18 @@ void aNTT_think_proc(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play, int think_id
|
||||
}
|
||||
}
|
||||
|
||||
void aNTT_schedule_init_proc(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
static void aNTT_schedule_init_proc(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
totakeke->npc_class.think.think_proc = (aNPC_THINK_PROC)aNTT_think_proc;
|
||||
CLIP(npc_clip)->think_proc((NPC_ACTOR *)totakeke, play, aNPC_THINK_SPECIAL, 0);
|
||||
}
|
||||
|
||||
void aNTT_schedule_main_proc(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
static void aNTT_schedule_main_proc(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play) {
|
||||
if (CLIP(npc_clip)->think_proc((NPC_ACTOR *)totakeke, play, -1, 1) == FALSE) {
|
||||
CLIP(npc_clip)->think_proc((NPC_ACTOR *)totakeke, play, -1, 2);
|
||||
}
|
||||
}
|
||||
|
||||
void aNTT_schedule_proc(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play, int schedule_id) {
|
||||
static void aNTT_schedule_proc(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play, int schedule_id) {
|
||||
switch (schedule_id) {
|
||||
case 0:
|
||||
aNTT_schedule_init_proc(totakeke, play);
|
||||
@@ -206,4 +206,3 @@ void aNTT_schedule_proc(NPC_TOTAKEKE_ACTOR *totakeke, GAME_PLAY *play, int sched
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,8 +45,8 @@ void aECPD_1st_check(EV_CARPETPEDDLER_ACTOR* peddler, GAME_PLAY* play) {
|
||||
}
|
||||
|
||||
void aECPD_2nd_check(EV_CARPETPEDDLER_ACTOR* peddler, GAME_PLAY* play) {
|
||||
static int next_msg[4] = { mString_CARPETPEDDLER_START+ 1, mString_CARPETPEDDLER_START + 4,
|
||||
mString_CARPETPEDDLER_START + 3, mString_CARPETPEDDLER_START + 5 };
|
||||
static int next_msg[4] = { MSG_CARPETPEDDLER_START+ 1, MSG_CARPETPEDDLER_START + 4,
|
||||
MSG_CARPETPEDDLER_START + 3, MSG_CARPETPEDDLER_START + 5 };
|
||||
static int next_act[4] = { eECPD_ACTION_NONE, eECPD_ACTION_NONE, eECPD_ACTION_NONE, eECPD_ACTION_GRAD_MESSAGE };
|
||||
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
|
||||
if (mMsg_Check_MainNormalContinue(msg_p) == TRUE) {
|
||||
@@ -94,7 +94,7 @@ void aECPD_menu_close_wait(EV_CARPETPEDDLER_ACTOR* peddler, GAME_PLAY* play) {
|
||||
Submenu_Item_c* submenu_item = play->submenu.item_p;
|
||||
if (submenu_item->item == EMPTY_NO) {
|
||||
peddler->next_action = eECPD_ACTION_NONE;
|
||||
mMsg_Set_continue_msg_num(msg_p, mString_CARPETPEDDLER_START + 6);
|
||||
mMsg_Set_continue_msg_num(msg_p, MSG_CARPETPEDDLER_START + 6);
|
||||
peddler->setup_action(peddler, play, eECPD_ACTION_MSG_WIN_OPEN_WAIT);
|
||||
mMsg_Unset_LockContinue(msg_p);
|
||||
} else {
|
||||
@@ -107,7 +107,7 @@ void aECPD_menu_close_wait(EV_CARPETPEDDLER_ACTOR* peddler, GAME_PLAY* play) {
|
||||
void aECPD_demo0_end_wait(EV_CARPETPEDDLER_ACTOR* peddler, GAME_PLAY* play) {
|
||||
static int next_act[2] = { eECPD_ACTION_DEMO_START_WAIT, eECPD_ACTION_MSG_WIN_OPEN_WAIT };
|
||||
static int over_next_act_idx[2] = { eECPD_ACTION_DEMO1_END_WAIT, eECPD_ACTION_REFUSE_TRADE_IN };
|
||||
static int msg_no[2] = { mString_CARPETPEDDLER_START + 7, mString_CARPETPEDDLER_START + 9 };
|
||||
static int msg_no[2] = { MSG_CARPETPEDDLER_START + 7, MSG_CARPETPEDDLER_START + 9 };
|
||||
int next;
|
||||
if (CLIP(handOverItem_clip)->master_actor == NULL) {
|
||||
mActor_name_t item = CLIP(handOverItem_clip)->item;
|
||||
@@ -270,7 +270,7 @@ void aECPD_setupAction(EV_CARPETPEDDLER_ACTOR* peddler, GAME_PLAY* play, int act
|
||||
}
|
||||
|
||||
void aECPD_set_talk_info(ACTOR* actorx) {
|
||||
mDemo_Set_msg_num(mString_CARPETPEDDLER_START);
|
||||
mDemo_Set_msg_num(MSG_CARPETPEDDLER_START);
|
||||
}
|
||||
|
||||
void aECPD_talk_request(ACTOR* actorx, GAME* game) {
|
||||
|
||||
Reference in New Issue
Block a user