Implement & link ac_mikanbox, ac_npc_totakeke refactor

This commit is contained in:
Cuyler36
2025-01-07 19:09:21 -05:00
parent c84af287c2
commit 6bd0c5fc4b
18 changed files with 817 additions and 227 deletions
+86
View File
@@ -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"
+393
View File
@@ -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));
}
}
}
+69
View File
@@ -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);
}
+4
View File
@@ -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;
}
+24 -19
View File
@@ -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"
+104 -112
View File
@@ -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) {
+37 -38
View File
@@ -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) {