mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-07-07 12:03:27 -04:00
Merge pull request #374 from Cuyler36/ac_npc_guide
This commit is contained in:
@@ -760,6 +760,10 @@ ac_npc_curator.c:
|
||||
ac_npc_engineer.c:
|
||||
.text: [0x80552984, 0x80552B5C]
|
||||
.data: [0x806A61C8, 0x806A6208]
|
||||
ac_npc_guide.c:
|
||||
.text: [0x80552B5C, 0x80554B00]
|
||||
.rodata: [0x80649620, 0x806496A0]
|
||||
.data: [0x806A6208, 0x806A6508]
|
||||
ac_npc_rcn_guide.c:
|
||||
.text: [0x8056EED0, 0x8056FFF0]
|
||||
.rodata: [0x806499C0, 0x806499E8]
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef AC_COMMON_H
|
||||
#define AC_COMMON_H
|
||||
|
||||
#include "types.h"
|
||||
#include "m_actor.h"
|
||||
#include "c_keyframe.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* sizeof(aCM_anime_c) == 0x7C */
|
||||
typedef struct actor_common_anime_s {
|
||||
/* 0x00 */ int cur_keyframe;
|
||||
/* 0x04 */ int state;
|
||||
/* 0x08 */ cKF_SkeletonInfo_R_c keyframe;
|
||||
/* 0x78 */ int anime_no;
|
||||
} aCMN_anime_c;
|
||||
|
||||
/* sizeof(CMN_ACTOR) == 0x210 */
|
||||
typedef struct actor_common_s {
|
||||
/* 0x000 */ ACTOR actor_class;
|
||||
/* 0x174 */ aCMN_anime_c anime;
|
||||
/* 0x1F0 */ ClObjPipe_c col_pipe;
|
||||
/* 0x20C */ int act;
|
||||
} CMN_ACTOR;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+42
-51
@@ -2,79 +2,71 @@
|
||||
#define AC_HANIWA_H
|
||||
|
||||
#include "types.h"
|
||||
#include "m_actor.h"
|
||||
#include "c_keyframe.h"
|
||||
#include "ac_common.h"
|
||||
#include "m_collision_obj.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define aHNW_JOINT_NUM 8
|
||||
|
||||
typedef struct actor_haniwa_s HANIWA_ACTOR;
|
||||
|
||||
typedef void (*HANIWA_ACTOR_PROC)(ACTOR*, GAME*);
|
||||
|
||||
enum haniwa_msg {
|
||||
aHNW_MSG_NO_OWNER,
|
||||
aHNW_MSG_PROCEEDS,
|
||||
aHNW_MSG_NORMAL,
|
||||
aHNW_MSG_OTHER_OWNER,
|
||||
aHNW_MSG_NEED_FRIEND,
|
||||
aHNW_MSG_NO_OWNER,
|
||||
aHNW_MSG_PROCEEDS,
|
||||
aHNW_MSG_NORMAL,
|
||||
aHNW_MSG_OTHER_OWNER,
|
||||
aHNW_MSG_NEED_FRIEND,
|
||||
|
||||
aHNW_MSG_NUM
|
||||
aHNW_MSG_NUM
|
||||
};
|
||||
|
||||
enum haniwa_handover {
|
||||
aHNW_HANDOVER_YES,
|
||||
aHNW_HANDOVER_NO,
|
||||
aHNW_HANDOVER_YES,
|
||||
aHNW_HANDOVER_NO,
|
||||
|
||||
aHNW_HANDOVER_NUM
|
||||
aHNW_HANDOVER_NUM
|
||||
};
|
||||
|
||||
enum haniwa_action {
|
||||
aHNW_ACTION_WAIT,
|
||||
aHNW_ACTION_DANCE,
|
||||
aHNW_ACTION_CHECK_PROCEEDS,
|
||||
aHNW_ACTION_TALK_WITH_MASTER,
|
||||
aHNW_ACTION_TALK_WITH_MASTER2,
|
||||
aHNW_ACTION_TALK_END_WAIT,
|
||||
aHNW_ACTION_MENU_OPEN_WAIT,
|
||||
aHNW_ACTION_MENU_END_WAIT,
|
||||
aHNW_ACTION_TALK_WITH_GUEST,
|
||||
aHNW_ACTION_MENU_OPEN_WAIT_FOR_GUEST,
|
||||
aHNW_ACTION_MENU_END_WAIT_FOR_GUEST,
|
||||
aHNW_ACTION_ROOF_CHECK,
|
||||
aHNW_ACTION_SAVE_CHECK,
|
||||
aHNW_ACTION_SAVE_END_WAIT,
|
||||
aHNW_ACTION_PL_APPROACH_DOOR,
|
||||
aHNW_ACTION_DOOR_OPEN_WAIT,
|
||||
aHNW_ACTION_DOOR_OPEN_TIMER,
|
||||
aHNW_ACTION_WAIT,
|
||||
aHNW_ACTION_DANCE,
|
||||
aHNW_ACTION_CHECK_PROCEEDS,
|
||||
aHNW_ACTION_TALK_WITH_MASTER,
|
||||
aHNW_ACTION_TALK_WITH_MASTER2,
|
||||
aHNW_ACTION_TALK_END_WAIT,
|
||||
aHNW_ACTION_MENU_OPEN_WAIT,
|
||||
aHNW_ACTION_MENU_END_WAIT,
|
||||
aHNW_ACTION_TALK_WITH_GUEST,
|
||||
aHNW_ACTION_MENU_OPEN_WAIT_FOR_GUEST,
|
||||
aHNW_ACTION_MENU_END_WAIT_FOR_GUEST,
|
||||
aHNW_ACTION_ROOF_CHECK,
|
||||
aHNW_ACTION_SAVE_CHECK,
|
||||
aHNW_ACTION_SAVE_END_WAIT,
|
||||
aHNW_ACTION_PL_APPROACH_DOOR,
|
||||
aHNW_ACTION_DOOR_OPEN_WAIT,
|
||||
aHNW_ACTION_DOOR_OPEN_TIMER,
|
||||
|
||||
aHNW_ACTION_NUM
|
||||
aHNW_ACTION_NUM
|
||||
};
|
||||
|
||||
/* sizeof(HANIWA_ACTOR) == 0x288 */
|
||||
struct actor_haniwa_s {
|
||||
ACTOR actor_class;
|
||||
|
||||
int saved_current_frame;
|
||||
int keyframe_state;
|
||||
|
||||
cKF_SkeletonInfo_R_c keyframe;
|
||||
int animation_state;
|
||||
|
||||
ClObjPipe_c col_pipe;
|
||||
|
||||
int action;
|
||||
char* bank_ram_start;
|
||||
s_xyz keyframe_work_area[8];
|
||||
s_xyz keyframe_morph_area[8];
|
||||
HANIWA_ACTOR_PROC action_proc;
|
||||
f32 anim_frame_speed;
|
||||
int player_approach_door_stage;
|
||||
u16 door_approach_frame;
|
||||
u8 submenu_type;
|
||||
u8 house_idx;
|
||||
u8 playing_save_bgm;
|
||||
/* 0x000 */ CMN_ACTOR common_actor_class;
|
||||
/* 0x210 */ char* bank_ram_start;
|
||||
/* 0x214 */ s_xyz keyframe_work_area[aHNW_JOINT_NUM];
|
||||
/* 0x244 */ s_xyz keyframe_morph_area[aHNW_JOINT_NUM];
|
||||
/* 0x274 */ HANIWA_ACTOR_PROC action_proc;
|
||||
/* 0x278 */ f32 anim_frame_speed;
|
||||
/* 0x27C */ int player_approach_door_stage;
|
||||
/* 0x280 */ u16 door_approach_frame;
|
||||
/* 0x282 */ u8 submenu_type;
|
||||
/* 0x283 */ u8 house_idx;
|
||||
/* 0x284 */ u8 playing_save_bgm;
|
||||
};
|
||||
|
||||
extern ACTOR_PROFILE Haniwa_Profile;
|
||||
@@ -84,4 +76,3 @@ extern ACTOR_PROFILE Haniwa_Profile;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+10
-5
@@ -9,6 +9,7 @@
|
||||
#include "m_actor_dlftbls.h"
|
||||
#include "m_npc.h"
|
||||
#include "c_keyframe.h"
|
||||
#include "ac_npc_anim_def.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -94,6 +95,7 @@ typedef void (*aNPC_MOVE_AFTER_PROC)(ACTOR*, GAME*);
|
||||
typedef void (*aNPC_DRAW_PROC)(ACTOR*, GAME*);
|
||||
|
||||
typedef void (*aNPC_REBUILD_DMA_PROC)();
|
||||
typedef void (*aNPC_TALK_DEMO_PROC)(ACTOR*);
|
||||
typedef void (*aNPC_ANIMATION_INIT_PROC)(ACTOR*, int, int);
|
||||
typedef void (*aNPC_CHG_SCHEDULE_PROC)(NPC_ACTOR*, GAME_PLAY*, u8);
|
||||
typedef int (*aNPC_CLIP_THINK_PROC)(NPC_ACTOR*, GAME_PLAY*, int, int);
|
||||
@@ -121,7 +123,8 @@ struct ac_npc_clip_s {
|
||||
/* 0x0F0 */ void* _0F0;
|
||||
/* 0x0F4 */ aNPC_DRAW_PROC draw_proc;
|
||||
/* 0x0F8 */ aNPC_REBUILD_DMA_PROC rebuild_dma_proc;
|
||||
/* 0x0FC */ void* _0FC[(0x114 - 0x0FC) / sizeof(void*)];
|
||||
/* 0x0FC */ void* _0FC[(0x110 - 0x0FC) / sizeof(void*)];
|
||||
/* 0x110 */ aNPC_TALK_DEMO_PROC talk_demo_proc;
|
||||
/* 0x114 */ aNPC_ANIMATION_INIT_PROC animation_init_proc;
|
||||
/* 0x118 */ aNPC_CHG_SCHEDULE_PROC chg_schedule_proc;
|
||||
/* 0x11C */ void* _11C;
|
||||
@@ -150,10 +153,10 @@ typedef struct npc_animation_s {
|
||||
/* TODO: draw data */
|
||||
typedef struct npc_draw_info_s {
|
||||
/* 0x000 */ int main_animation_frame;
|
||||
/* 0x004 */ int _04; // TODO: figure out where this is set
|
||||
/* 0x004 */ int main_animation_state;
|
||||
/* 0x008 */ int main_animation_frame_changed;
|
||||
/* 0x00C */ int _08; // TODO: figure out where this is set
|
||||
/* 0x010 */ int _0C; // TODO: figure out where this is set
|
||||
/* 0x00C */ int sub_animation0_state;
|
||||
/* 0x010 */ int sub_animation1_state;
|
||||
/* 0x014 */ aNPC_ANIMATION_c main_animation;
|
||||
/* 0x1D0 */ aNPC_ANIMATION_c sub_animation0;
|
||||
/* 0x38C */ aNPC_ANIMATION_c sub_animation1;
|
||||
@@ -178,7 +181,9 @@ typedef struct npc_draw_info_s {
|
||||
/* 0x5BE */ u8 _5BE;
|
||||
/* 0x5BE */ u8 _5BF[0x5D0 - 0x5BF];
|
||||
/* 0x5D0 */ f32 animation_speed;
|
||||
/* 0x5D4 */ u8 _5D4[0x630 - 0x5D4];
|
||||
/* 0x5D4 */ u8 _5D4[0x5D8 - 0x5D4];
|
||||
/* 0x5D8 */ xyz_t shadow_pos;
|
||||
/* 0x5E4 */ u8 _5E4[0x630 - 0x5E4];
|
||||
} aNPC_draw_info_c;
|
||||
|
||||
typedef void (*aNPC_THINK_PROC)(NPC_ACTOR*, GAME_PLAY*, int);
|
||||
|
||||
@@ -0,0 +1,265 @@
|
||||
#ifndef AC_NPC_ANIM_DEF_H
|
||||
#define AC_NPC_ANIM_DEF_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum {
|
||||
aNPC_ANIM_RUN1,
|
||||
aNPC_ANIM_WALK1,
|
||||
aNPC_ANIM_WALK_KI1,
|
||||
aNPC_ANIM_WALK_DO1,
|
||||
aNPC_ANIM_WALK_AI1,
|
||||
aNPC_ANIM_WAIT1,
|
||||
aNPC_ANIM_WAIT_KI1,
|
||||
aNPC_ANIM_WAIT_DO1,
|
||||
aNPC_ANIM_WAIT_AI1,
|
||||
aNPC_ANIM_WAIT_NEMU1,
|
||||
aNPC_ANIM_AISATU1,
|
||||
aNPC_ANIM_AISATU2,
|
||||
aNPC_ANIM_AISATU3,
|
||||
aNPC_ANIM_AISATU4,
|
||||
aNPC_ANIM_GURATUKU1,
|
||||
aNPC_ANIM_OTIRU1,
|
||||
aNPC_ANIM_OTIRU2,
|
||||
aNPC_ANIM_MOGAKU1,
|
||||
aNPC_ANIM_DERU1,
|
||||
aNPC_ANIM_DERU2,
|
||||
aNPC_ANIM_TALK_TURN1,
|
||||
aNPC_ANIM_TALK1,
|
||||
aNPC_ANIM_OPEN1,
|
||||
aNPC_ANIM_GO_OUT1,
|
||||
aNPC_ANIM_UMB_OPEN1,
|
||||
aNPC_ANIM_UMB_CLOSE1,
|
||||
aNPC_ANIM_TRANSFER1,
|
||||
aNPC_ANIM_TRANS_WAIT1,
|
||||
aNPC_ANIM_GET1,
|
||||
aNPC_ANIM_GET_PULL1,
|
||||
aNPC_ANIM_GET_PULL_WAIT1,
|
||||
aNPC_ANIM_GET_PUTAWAY1,
|
||||
aNPC_ANIM_GET_EAT1,
|
||||
aNPC_ANIM_GET_CHANGE1,
|
||||
aNPC_ANIM_GET_RETURN1,
|
||||
aNPC_ANIM_TRANSFER_F1,
|
||||
aNPC_ANIM_TRANS_WAIT_F1,
|
||||
aNPC_ANIM_GET_F1,
|
||||
aNPC_ANIM_GET_PULL_F1,
|
||||
aNPC_ANIM_GET_PULL_WAIT_F1,
|
||||
aNPC_ANIM_GET_PUTAWAY_F1,
|
||||
aNPC_ANIM_GET_RETURN_F1,
|
||||
aNPC_ANIM_ESTIMATE_F1,
|
||||
aNPC_ANIM_CONTRACT1,
|
||||
aNPC_ANIM_CONTRACT2,
|
||||
aNPC_ANIM_CONTRACT3,
|
||||
aNPC_ANIM_NOT_CONTRACT1,
|
||||
aNPC_ANIM_FLY1,
|
||||
aNPC_ANIM_FLYAWAY1,
|
||||
aNPC_ANIM_DELIVERY1,
|
||||
aNPC_ANIM_KYORO1,
|
||||
aNPC_ANIM_LANDING1,
|
||||
aNPC_ANIM_LANDING2,
|
||||
aNPC_ANIM_LANDING3,
|
||||
aNPC_ANIM_OPEN_D1,
|
||||
aNPC_ANIM_SITDOWN_D1,
|
||||
aNPC_ANIM_SITDOWN_WAIT_D1,
|
||||
aNPC_ANIM_STANDUP_D1,
|
||||
aNPC_ANIM_OPEN_D2,
|
||||
aNPC_ANIM_TO_DECK_D1,
|
||||
aNPC_ANIM_KEITAI_ON1,
|
||||
aNPC_ANIM_KEITAI_TALK1,
|
||||
aNPC_ANIM_KEITAI_TALK2,
|
||||
aNPC_ANIM_KEITAI_OFF1,
|
||||
aNPC_ANIM_WAIT_E1,
|
||||
aNPC_ANIM_ENSOU_E1,
|
||||
aNPC_ANIM_BANZAI1,
|
||||
aNPC_ANIM_CLAP1,
|
||||
aNPC_ANIM_KOKKURI_D1,
|
||||
aNPC_ANIM_KOKKURI_D2,
|
||||
aNPC_ANIM_SAISEN1,
|
||||
aNPC_ANIM_OMAIRI1,
|
||||
aNPC_ANIM_SITDOWN_WAIT1,
|
||||
aNPC_ANIM_SITDOWN_DRINK1,
|
||||
aNPC_ANIM_SITDOWN_CLAP1,
|
||||
aNPC_ANIM_DANCE1,
|
||||
aNPC_ANIM_KUISINBO1,
|
||||
aNPC_ANIM_SANBASI1,
|
||||
aNPC_ANIM_WAIT_R1,
|
||||
aNPC_ANIM_APPEAR1,
|
||||
aNPC_ANIM_GO_UG1,
|
||||
aNPC_ANIM_INTRO1_A,
|
||||
aNPC_ANIM_INTRO1_B,
|
||||
aNPC_ANIM_TAISOU1,
|
||||
aNPC_ANIM_TAISOU2,
|
||||
aNPC_ANIM_TAISOU3_A,
|
||||
aNPC_ANIM_TAISOU3_B,
|
||||
aNPC_ANIM_TAISOU4_A,
|
||||
aNPC_ANIM_TAISOU4_B,
|
||||
aNPC_ANIM_TAISOU5_A,
|
||||
aNPC_ANIM_TAISOU5_B,
|
||||
aNPC_ANIM_TAISOU6_A,
|
||||
aNPC_ANIM_TAISOU6_B,
|
||||
aNPC_ANIM_TAISOU7,
|
||||
aNPC_ANIM_KIDUKU1,
|
||||
aNPC_ANIM_KIDUKU2,
|
||||
aNPC_ANIM_CRACKER_WAIT1,
|
||||
aNPC_ANIM_CRACKER_FIRE1,
|
||||
aNPC_ANIM_CRACKER_RUN1,
|
||||
aNPC_ANIM_CRACKER_COUNT1,
|
||||
aNPC_ANIM_WARMUP1,
|
||||
aNPC_ANIM_READY1,
|
||||
aNPC_ANIM_ASIHUMI1,
|
||||
aNPC_ANIM_KOKERU1,
|
||||
aNPC_ANIM_KOKERU_GETUP1,
|
||||
aNPC_ANIM_TIRED1,
|
||||
aNPC_ANIM_TAMAKOME1,
|
||||
aNPC_ANIM_YOUI1,
|
||||
aNPC_ANIM_DON1,
|
||||
aNPC_ANIM_TUNAHIKI_AIKO1,
|
||||
aNPC_ANIM_TUNAHIKI_YURI1,
|
||||
aNPC_ANIM_TUNAHIKI_FURI1,
|
||||
aNPC_ANIM_HATAFURI1,
|
||||
aNPC_ANIM_TAMAHIROI1,
|
||||
aNPC_ANIM_TAMANAGE1,
|
||||
aNPC_ANIM_GETUP_SEG1,
|
||||
aNPC_ANIM_GETUP_WAIT_SEG1,
|
||||
aNPC_ANIM_PIKU_SEG1,
|
||||
aNPC_ANIM_4HAKU_E1,
|
||||
aNPC_ANIM_3HAKU_E1,
|
||||
aNPC_ANIM_SEND_MAIL1,
|
||||
aNPC_ANIM_TURI_WAIT1,
|
||||
aNPC_ANIM_MISIN1,
|
||||
aNPC_ANIM_WIPKOGU1,
|
||||
aNPC_ANIM_WIPWAIT1,
|
||||
aNPC_ANIM_WIPWAIT2,
|
||||
aNPC_ANIM_GSTWAIT1,
|
||||
aNPC_ANIM_GYAFUN1,
|
||||
aNPC_ANIM_GYAFUN2,
|
||||
aNPC_ANIM_TKYKYORO1,
|
||||
aNPC_ANIM_MUKA1,
|
||||
aNPC_ANIM_MUKA2,
|
||||
aNPC_ANIM_GAAAN1,
|
||||
aNPC_ANIM_GAAAN2,
|
||||
aNPC_ANIM_SMILE1,
|
||||
aNPC_ANIM_SMILE2,
|
||||
aNPC_ANIM_HA1,
|
||||
aNPC_ANIM_HA2,
|
||||
aNPC_ANIM_PUNPUN1,
|
||||
aNPC_ANIM_PUNPUN2,
|
||||
aNPC_ANIM_A1,
|
||||
aNPC_ANIM_A2,
|
||||
aNPC_ANIM_ASERU1,
|
||||
aNPC_ANIM_ASERU2,
|
||||
aNPC_ANIM_BURUBURU1,
|
||||
aNPC_ANIM_BURUBURU2,
|
||||
aNPC_ANIM_GOUKYU1,
|
||||
aNPC_ANIM_GOUKYU2,
|
||||
aNPC_ANIM_HAPPY1,
|
||||
aNPC_ANIM_HAPPY2,
|
||||
aNPC_ANIM_HATE1,
|
||||
aNPC_ANIM_HATE2,
|
||||
aNPC_ANIM_HIRAMEKI1,
|
||||
aNPC_ANIM_HIRAMEKI2,
|
||||
aNPC_ANIM_HYUUU1,
|
||||
aNPC_ANIM_HYUUU2,
|
||||
aNPC_ANIM_LOVELOVE1,
|
||||
aNPC_ANIM_LOVELOVE2,
|
||||
aNPC_ANIM_MUUUUU1,
|
||||
aNPC_ANIM_MUUUUU2,
|
||||
aNPC_ANIM_OTIKOMU1,
|
||||
aNPC_ANIM_OTIKOMU2,
|
||||
aNPC_ANIM_SHITUREN1,
|
||||
aNPC_ANIM_SHITUREN2,
|
||||
aNPC_ANIM_WARUDAKUMI1,
|
||||
aNPC_ANIM_WARUDAKUMI2,
|
||||
aNPC_ANIM_NEBOKE1,
|
||||
aNPC_ANIM_NEBOKE2,
|
||||
aNPC_ANIM_LOVE1,
|
||||
aNPC_ANIM_LOVE2,
|
||||
aNPC_ANIM_NIKO1,
|
||||
aNPC_ANIM_MUSU1,
|
||||
aNPC_ANIM_KOMARI1,
|
||||
aNPC_ANIM_HATE_F1,
|
||||
aNPC_ANIM_HATE_F2,
|
||||
aNPC_ANIM_HA_F1,
|
||||
aNPC_ANIM_HA_F2,
|
||||
aNPC_ANIM_HAPPY_F1,
|
||||
aNPC_ANIM_HAPPY_F2,
|
||||
aNPC_ANIM_ASERU_F1,
|
||||
aNPC_ANIM_ASERU_F2,
|
||||
aNPC_ANIM_MUUUUU_F1,
|
||||
aNPC_ANIM_MUUUUU_F2,
|
||||
aNPC_ANIM_LOVELOVE_F1,
|
||||
aNPC_ANIM_LOVELOVE_F2,
|
||||
aNPC_ANIM_A_F1,
|
||||
aNPC_ANIM_A_F2,
|
||||
aNPC_ANIM_SMILE_F1,
|
||||
aNPC_ANIM_SMILE_F2,
|
||||
aNPC_ANIM_KOMARI_F1,
|
||||
aNPC_ANIM_NIKO_F1,
|
||||
aNPC_ANIM_MUSU_F1,
|
||||
aNPC_ANIM_HATE_I1,
|
||||
aNPC_ANIM_HATE_I2,
|
||||
aNPC_ANIM_HA_I1,
|
||||
aNPC_ANIM_HA_I2,
|
||||
aNPC_ANIM_HAPPY_I1,
|
||||
aNPC_ANIM_HAPPY_I2,
|
||||
aNPC_ANIM_ASERU_I1,
|
||||
aNPC_ANIM_ASERU_I2,
|
||||
aNPC_ANIM_MUUUUU_I1,
|
||||
aNPC_ANIM_MUUUUU_I2,
|
||||
aNPC_ANIM_LOVE_I1,
|
||||
aNPC_ANIM_LOVE_I2,
|
||||
aNPC_ANIM_SHITUREN_I1,
|
||||
aNPC_ANIM_SHITUREN_I2,
|
||||
aNPC_ANIM_KOMARI_I1,
|
||||
aNPC_ANIM_NIKO_I1,
|
||||
aNPC_ANIM_MUSU_I1,
|
||||
aNPC_ANIM_SMILE_D1,
|
||||
aNPC_ANIM_SMILE_D2,
|
||||
aNPC_ANIM_GAAAN_D1,
|
||||
aNPC_ANIM_GAAAN_D2,
|
||||
aNPC_ANIM_HIRAMEKI_D1,
|
||||
aNPC_ANIM_HIRAMEKI_D2,
|
||||
aNPC_ANIM_HA_D1,
|
||||
aNPC_ANIM_HA_D2,
|
||||
aNPC_ANIM_MUSU_D1,
|
||||
aNPC_ANIM_NIKO_D1,
|
||||
aNPC_ANIM_KOMARI_D1,
|
||||
aNPC_ANIM_HATE_D1,
|
||||
aNPC_ANIM_HATE_D2,
|
||||
aNPC_ANIM_PUNPUN_R1,
|
||||
aNPC_ANIM_PUNPUN_R2,
|
||||
aNPC_ANIM_MUSU_R1,
|
||||
aNPC_ANIM_HYUUU_R1,
|
||||
aNPC_ANIM_HYUUU_R2,
|
||||
aNPC_ANIM_A_R1,
|
||||
aNPC_ANIM_A_R2,
|
||||
aNPC_ANIM_A2_R1,
|
||||
aNPC_ANIM_AKIRERU_R1,
|
||||
aNPC_ANIM_AKIRERU_R2,
|
||||
aNPC_ANIM_MATAROU_R1,
|
||||
aNPC_ANIM_MATAROU_R2,
|
||||
aNPC_ANIM_GEKIDO_R1,
|
||||
aNPC_ANIM_GEKIDO_R2,
|
||||
aNPC_ANIM_HA_E1,
|
||||
aNPC_ANIM_HA_E2,
|
||||
aNPC_ANIM_KEIREI1,
|
||||
aNPC_ANIM_KIEEEEI1,
|
||||
aNPC_ANIM_KIEEEEI2,
|
||||
aNPC_ANIM_UMBRELLA1,
|
||||
aNPC_ANIM_UTIWA_WAIT1,
|
||||
aNPC_ANIM_TUE1,
|
||||
aNPC_ANIM_KUTIPAKU1,
|
||||
aNPC_ANIM_KUTIPAKU2,
|
||||
|
||||
aNPC_ANIM_NUM
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+27
-1
@@ -3,11 +3,38 @@
|
||||
|
||||
#include "types.h"
|
||||
#include "m_actor.h"
|
||||
#include "ac_npc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct npc_guide_actor_s NPC_GUIDE_ACTOR;
|
||||
|
||||
typedef void (*aNGD_PROC)(NPC_GUIDE_ACTOR*, GAME_PLAY*);
|
||||
|
||||
struct npc_guide_actor_s {
|
||||
NPC_ACTOR npc_class;
|
||||
int action;
|
||||
int next_action;
|
||||
aNGD_PROC proc;
|
||||
int lock_camera_flag;
|
||||
int camera_morph_counter;
|
||||
s16 camera_move;
|
||||
s8 camera_move_cnt;
|
||||
s8 camera_move_set_counter;
|
||||
f32 camera_move_y;
|
||||
f32 camera_move_range;
|
||||
s16 camera_tilt_cur_angle;
|
||||
s16 camera_tilt_goal_angle;
|
||||
s16 camera_tilt_add;
|
||||
int answer_flags;
|
||||
ACTOR* train_door_actor;
|
||||
int obj_look_type;
|
||||
f32 obj_dist_ground;
|
||||
int camera_eyes_flag;
|
||||
};
|
||||
|
||||
extern ACTOR_PROFILE Npc_Guide_Profile;
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -15,4 +42,3 @@ extern ACTOR_PROFILE Npc_Guide_Profile;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ extern ACTOR_PROFILE T_Keitai_Profile;
|
||||
|
||||
typedef void (*KEITAI_PROC)(ACTOR*);
|
||||
|
||||
typedef struct t_keitai_s{
|
||||
typedef struct t_keitai_s {
|
||||
TOOLS_ACTOR tools_class;
|
||||
KEITAI_PROC action_proc;
|
||||
int action;
|
||||
@@ -34,4 +34,3 @@ typedef struct t_keitai_action_anim_s {
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+82
-63
@@ -12,78 +12,97 @@ extern "C" {
|
||||
extern ACTOR_PROFILE Tools_Profile;
|
||||
|
||||
typedef enum {
|
||||
TOOL_UMBRELLA0,
|
||||
TOOL_UMBRELLA1,
|
||||
TOOL_UMBRELLA2,
|
||||
TOOL_UMBRELLA3,
|
||||
TOOL_UMBRELLA4,
|
||||
TOOL_UMBRELLA5,
|
||||
TOOL_UMBRELLA6,
|
||||
TOOL_UMBRELLA7,
|
||||
TOOL_UMBRELLA8,
|
||||
TOOL_UMBRELLA9,
|
||||
TOOL_UMBRELLA10,
|
||||
TOOL_UMBRELLA11,
|
||||
TOOL_UMBRELLA12,
|
||||
TOOL_UMBRELLA13,
|
||||
TOOL_UMBRELLA14,
|
||||
TOOL_UMBRELLA15,
|
||||
TOOL_UMBRELLA16,
|
||||
TOOL_UMBRELLA17,
|
||||
TOOL_UMBRELLA18,
|
||||
TOOL_UMBRELLA19,
|
||||
TOOL_UMBRELLA20,
|
||||
TOOL_UMBRELLA21,
|
||||
TOOL_UMBRELLA22,
|
||||
TOOL_UMBRELLA23,
|
||||
TOOL_UMBRELLA24,
|
||||
TOOL_UMBRELLA25,
|
||||
TOOL_UMBRELLA26,
|
||||
TOOL_UMBRELLA27,
|
||||
TOOL_UMBRELLA28,
|
||||
TOOL_UMBRELLA29,
|
||||
TOOL_UMBRELLA30,
|
||||
TOOL_UMBRELLA31,
|
||||
TOOL_UMBRELLA32,
|
||||
TOOL_KEITAI,
|
||||
TOOL_UTIWA,
|
||||
TOOL_HANABI,
|
||||
TOOL_CRACKER,
|
||||
TOOL_PISTOL,
|
||||
TOOL_FLAG,
|
||||
TOOL_TUMBLER,
|
||||
TOOL_NPC_SAO,
|
||||
TOOL_TAMA1,
|
||||
TOOL_TAMA2,
|
||||
TOOL_TAMA3,
|
||||
TOOL_TAMA4
|
||||
TOOL_UMBRELLA0,
|
||||
TOOL_UMBRELLA1,
|
||||
TOOL_UMBRELLA2,
|
||||
TOOL_UMBRELLA3,
|
||||
TOOL_UMBRELLA4,
|
||||
TOOL_UMBRELLA5,
|
||||
TOOL_UMBRELLA6,
|
||||
TOOL_UMBRELLA7,
|
||||
TOOL_UMBRELLA8,
|
||||
TOOL_UMBRELLA9,
|
||||
TOOL_UMBRELLA10,
|
||||
TOOL_UMBRELLA11,
|
||||
TOOL_UMBRELLA12,
|
||||
TOOL_UMBRELLA13,
|
||||
TOOL_UMBRELLA14,
|
||||
TOOL_UMBRELLA15,
|
||||
TOOL_UMBRELLA16,
|
||||
TOOL_UMBRELLA17,
|
||||
TOOL_UMBRELLA18,
|
||||
TOOL_UMBRELLA19,
|
||||
TOOL_UMBRELLA20,
|
||||
TOOL_UMBRELLA21,
|
||||
TOOL_UMBRELLA22,
|
||||
TOOL_UMBRELLA23,
|
||||
TOOL_UMBRELLA24,
|
||||
TOOL_UMBRELLA25,
|
||||
TOOL_UMBRELLA26,
|
||||
TOOL_UMBRELLA27,
|
||||
TOOL_UMBRELLA28,
|
||||
TOOL_UMBRELLA29,
|
||||
TOOL_UMBRELLA30,
|
||||
TOOL_UMBRELLA31,
|
||||
TOOL_ORG_UMBRELLA0,
|
||||
TOOL_ORG_UMBRELLA1,
|
||||
TOOL_ORG_UMBRELLA2,
|
||||
TOOL_ORG_UMBRELLA3,
|
||||
TOOL_ORG_UMBRELLA4,
|
||||
TOOL_ORG_UMBRELLA5,
|
||||
TOOL_ORG_UMBRELLA6,
|
||||
TOOL_ORG_UMBRELLA7,
|
||||
TOOL_KEITAI,
|
||||
TOOL_UTIWA,
|
||||
TOOL_HANABI,
|
||||
TOOL_CRACKER,
|
||||
TOOL_PISTOL,
|
||||
TOOL_FLAG,
|
||||
TOOL_TUMBLER,
|
||||
TOOL_NPC_SAO,
|
||||
TOOL_TAMA1,
|
||||
TOOL_TAMA2,
|
||||
TOOL_TAMA3,
|
||||
TOOL_TAMA4,
|
||||
|
||||
aTOL_NUM
|
||||
} ToolName;
|
||||
|
||||
typedef struct tools_s{
|
||||
/* 0x000 */ ACTOR actor_class;
|
||||
/* 0x174 */ int tool_name;
|
||||
/* 0x178 */ MtxF matrix_work;
|
||||
/* 0x1B8 */ int init_matrix;
|
||||
/* 0x1BC */ int unk1BC;
|
||||
/* 0x1C0 */ int work0;
|
||||
/* 0x1C4 */ int work1;
|
||||
/* 0x1C8 */ int work2;
|
||||
}TOOLS_ACTOR;
|
||||
enum {
|
||||
aTOL_ACTION_WAIT,
|
||||
aTOL_ACTION_TAKEOUT,
|
||||
aTOL_ACTION_PUTAWAY,
|
||||
aTOL_ACTION_DESTRUCT,
|
||||
aTOL_ACTION_S_TAKEOUT,
|
||||
aTOL_ACTION_SPECIAL,
|
||||
|
||||
aTOL_ACTION_NUM
|
||||
};
|
||||
|
||||
typedef struct tools_s {
|
||||
/* 0x000 */ ACTOR actor_class;
|
||||
/* 0x174 */ int tool_name;
|
||||
/* 0x178 */ MtxF matrix_work;
|
||||
/* 0x1B8 */ int init_matrix;
|
||||
/* 0x1BC */ int unk1BC;
|
||||
/* 0x1C0 */ int work0;
|
||||
/* 0x1C4 */ int work1;
|
||||
/* 0x1C8 */ int work2;
|
||||
} TOOLS_ACTOR;
|
||||
|
||||
typedef ACTOR* (*ToolBirthProc)(int, int, ACTOR*, GAME*, s16, int*);
|
||||
typedef int (*ToolChgRequestModeProc)(ACTOR*, ACTOR*, int);
|
||||
|
||||
typedef TOOLS_ACTOR* (*ToolBirthProc)(int, int, TOOLS_ACTOR*, GAME_PLAY*, s16, int*);
|
||||
typedef int (*ToolChgRequestModeProc)(ACTOR*, TOOLS_ACTOR*, int);
|
||||
|
||||
typedef struct ToolClip {
|
||||
ToolBirthProc aTOL_birth_proc;
|
||||
ToolChgRequestModeProc aTOL_chg_request_mode_proc;
|
||||
int bank_id;
|
||||
ToolBirthProc aTOL_birth_proc;
|
||||
ToolChgRequestModeProc aTOL_chg_request_mode_proc;
|
||||
int bank_id;
|
||||
} aTOL_Clip_c;
|
||||
|
||||
extern aTOL_Clip_c aTOL_clip;
|
||||
extern aTOL_Clip_c aTOL_clip;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
#define AC_TRAIN_DOOR_H
|
||||
|
||||
#include "types.h"
|
||||
#include "m_actor.h"
|
||||
#include "c_keyframe.h"
|
||||
#include "ac_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -12,10 +11,7 @@ extern "C" {
|
||||
#define aTRD_JOINT_NUM 5
|
||||
|
||||
typedef struct traindoor_s {
|
||||
/* 0x000 */ ACTOR actor_class;
|
||||
/* 0x178 */ u8 pad[0x17C - 0x174];
|
||||
/* 0x17C */ cKF_SkeletonInfo_R_c keyframe;
|
||||
/* 0x1EC */ u8 pad2[0x210 - 0x1EC];
|
||||
/* 0x000 */ CMN_ACTOR common_actor_class;
|
||||
/* 0x210 */ s_xyz work[aTRD_JOINT_NUM];
|
||||
/* 0x22E */ s_xyz target[aTRD_JOINT_NUM];
|
||||
/* 0x24C */ int open_flag;
|
||||
|
||||
@@ -74,9 +74,11 @@ typedef enum audio_sound_effects {
|
||||
NA_SE_STONECOIN_ROLL = 0x7D,
|
||||
NA_SE_STONECOIN_DRAG = 0x7E,
|
||||
|
||||
NA_SE_A8 = 0xA8,
|
||||
NA_SE_TRAIN_RIDE = 0x8D,
|
||||
|
||||
NA_SE_CF = 0xCF,
|
||||
NA_SE_GOKI_MOVE = 0xA8,
|
||||
|
||||
NA_SE_KA_BUZZ = 0xCF,
|
||||
|
||||
NA_SE_ROD_STROKE = 0x109,
|
||||
NA_SE_ROD_BACK,
|
||||
|
||||
@@ -573,8 +573,10 @@ typedef struct event_common_save_data {
|
||||
|
||||
extern void mEv_clear_status(int event, s16 status);
|
||||
extern int mEv_CheckFirstJob();
|
||||
extern void mEv_SetFirstJob();
|
||||
extern void mEv_UnSetFirstJob();
|
||||
extern int mEv_CheckFirstIntro();
|
||||
extern void mEv_SetFirstIntro();
|
||||
extern void mEv_UnSetFirstIntro();
|
||||
extern int mEv_CheckArbeit();
|
||||
extern int mEv_CheckTitleDemo();
|
||||
|
||||
+46
-57
@@ -10,91 +10,80 @@ static void aECST_actor_draw(ACTOR* actorx, GAME* game);
|
||||
static void aECST_actor_save(ACTOR* actorx, GAME* game);
|
||||
|
||||
ACTOR_PROFILE Ev_Castaway_Profile = {
|
||||
mAc_PROFILE_EV_CASTAWAY,
|
||||
ACTOR_PART_NPC,
|
||||
ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(EV_CASTAWAY_ACTOR),
|
||||
&aECST_actor_ct,
|
||||
&aECST_actor_dt,
|
||||
&aECST_actor_init,
|
||||
mActor_NONE_PROC1,
|
||||
&aECST_actor_save
|
||||
mAc_PROFILE_EV_CASTAWAY,
|
||||
ACTOR_PART_NPC,
|
||||
ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(EV_CASTAWAY_ACTOR),
|
||||
&aECST_actor_ct,
|
||||
&aECST_actor_dt,
|
||||
&aECST_actor_init,
|
||||
mActor_NONE_PROC1,
|
||||
&aECST_actor_save,
|
||||
};
|
||||
|
||||
static void aECST_schedule_proc(NPC_ACTOR* actorx, GAME_PLAY* play, int type);
|
||||
|
||||
static void aECST_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
static aNPC_ct_data_c ct_data = {
|
||||
&aECST_actor_move,
|
||||
&aECST_actor_draw,
|
||||
5,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
0
|
||||
};
|
||||
static aNPC_ct_data_c ct_data = { &aECST_actor_move, &aECST_actor_draw, 5, NULL, NULL, NULL, 0 };
|
||||
|
||||
static xyz_t def_pos = { 3580.0f, 0.0f, 4670.0f }; // 'G-5' @ 9-4
|
||||
|
||||
EV_CASTAWAY_ACTOR* castaway = (EV_CASTAWAY_ACTOR*)actorx;
|
||||
static xyz_t def_pos = { 3580.0f, 0.0f, 4670.0f }; // 'G-5' @ 9-4
|
||||
|
||||
if ((*Common_Get(clip).npc_clip->birth_check_proc)(actorx, game) == TRUE) {
|
||||
castaway->npc_class.schedule.schedule_proc = &aECST_schedule_proc;
|
||||
(*Common_Get(clip).npc_clip->ct_proc)(actorx, game, &ct_data);
|
||||
castaway->npc_class.condition_info.demo_flg = ~aNPC_COND_DEMO_SKIP_MOVE_Y; // is this a mistake?
|
||||
castaway->npc_class.condition_info.hide_request = FALSE;
|
||||
castaway->npc_class.palActorIgnoreTimer = -1;
|
||||
aNPC_SPNPC_BIT_SET(Common_Get(spnpc_first_talk_flags), aNPC_SPNPC_BIT_DOZAEMON);
|
||||
actorx->status_data.weight = 254;
|
||||
actorx->gravity = 0.0f;
|
||||
actorx->max_velocity_y = 0.0f;
|
||||
actorx->shape_info.rotation.y = DEG2SHORT_ANGLE(68.027344f); // 0x3060
|
||||
actorx->world.angle.y = DEG2SHORT_ANGLE(68.027344f); // 0x3060
|
||||
castaway->npc_class.movement.mv_angl = DEG2SHORT_ANGLE(68.027344f); // 0x3060
|
||||
actorx->world.position = def_pos;
|
||||
actorx->home.position = def_pos;
|
||||
}
|
||||
EV_CASTAWAY_ACTOR* castaway = (EV_CASTAWAY_ACTOR*)actorx;
|
||||
|
||||
if ((*Common_Get(clip).npc_clip->birth_check_proc)(actorx, game) == TRUE) {
|
||||
castaway->npc_class.schedule.schedule_proc = &aECST_schedule_proc;
|
||||
(*Common_Get(clip).npc_clip->ct_proc)(actorx, game, &ct_data);
|
||||
castaway->npc_class.condition_info.demo_flg = ~aNPC_COND_DEMO_SKIP_MOVE_Y; // is this a mistake?
|
||||
castaway->npc_class.condition_info.hide_request = FALSE;
|
||||
castaway->npc_class.palActorIgnoreTimer = -1;
|
||||
aNPC_SPNPC_BIT_SET(Common_Get(spnpc_first_talk_flags), aNPC_SPNPC_BIT_DOZAEMON);
|
||||
actorx->status_data.weight = 254;
|
||||
actorx->gravity = 0.0f;
|
||||
actorx->max_velocity_y = 0.0f;
|
||||
actorx->shape_info.rotation.y = DEG2SHORT_ANGLE(68.027344f); // 0x3060
|
||||
actorx->world.angle.y = DEG2SHORT_ANGLE(68.027344f); // 0x3060
|
||||
castaway->npc_class.movement.mv_angl = DEG2SHORT_ANGLE(68.027344f); // 0x3060
|
||||
actorx->world.position = def_pos;
|
||||
actorx->home.position = def_pos;
|
||||
}
|
||||
}
|
||||
|
||||
static void aECST_actor_save(ACTOR* actorx, GAME* game) {
|
||||
(*Common_Get(clip).npc_clip->save_proc)(actorx, game);
|
||||
(*Common_Get(clip).npc_clip->save_proc)(actorx, game);
|
||||
}
|
||||
|
||||
static void aECST_actor_dt(ACTOR* actorx, GAME* game) {
|
||||
(*Common_Get(clip).npc_clip->dt_proc)(actorx, game);
|
||||
(*Common_Get(clip).npc_clip->dt_proc)(actorx, game);
|
||||
}
|
||||
|
||||
static void aECST_actor_init(ACTOR* actorx, GAME* game) {
|
||||
(*Common_Get(clip).npc_clip->init_proc)(actorx, game);
|
||||
(*Common_Get(clip).npc_clip->init_proc)(actorx, game);
|
||||
}
|
||||
|
||||
static void aECST_schedule_main_proc(NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
if (actorx->draw.animation_id != 116) {
|
||||
(*Common_Get(clip).npc_clip->animation_init_proc)((ACTOR*)actorx, 116, 0);
|
||||
}
|
||||
if (actorx->draw.animation_id != 116) {
|
||||
(*Common_Get(clip).npc_clip->animation_init_proc)((ACTOR*)actorx, aNPC_ANIM_GETUP_WAIT_SEG1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void aECST_schedule_proc(NPC_ACTOR* actorx, GAME_PLAY* play, int type) {
|
||||
static aNPC_SUB_PROC sched_proc[2] = {
|
||||
(aNPC_SUB_PROC)&none_proc1,
|
||||
aECST_schedule_main_proc
|
||||
};
|
||||
static aNPC_SUB_PROC sched_proc[2] = { (aNPC_SUB_PROC)&none_proc1, aECST_schedule_main_proc };
|
||||
|
||||
(*sched_proc[type])(actorx, play);
|
||||
(*sched_proc[type])(actorx, play);
|
||||
}
|
||||
|
||||
static void aECST_actor_move(ACTOR* actorx, GAME* game) {
|
||||
EV_CASTAWAY_ACTOR* castaway = (EV_CASTAWAY_ACTOR*)actorx;
|
||||
s16 cycle = castaway->bobbing_cycle;
|
||||
EV_CASTAWAY_ACTOR* castaway = (EV_CASTAWAY_ACTOR*)actorx;
|
||||
s16 cycle = castaway->bobbing_cycle;
|
||||
|
||||
cycle += 512;
|
||||
actorx->position_speed.y = (actorx->home.position.y + 4.0f + sin_s(cycle) * 4.0f) - actorx->world.position.y;
|
||||
castaway->bobbing_cycle = cycle;
|
||||
(*Common_Get(clip).npc_clip->move_proc)(actorx, game);
|
||||
cycle += 512;
|
||||
actorx->position_speed.y = (actorx->home.position.y + 4.0f + sin_s(cycle) * 4.0f) - actorx->world.position.y;
|
||||
castaway->bobbing_cycle = cycle;
|
||||
(*Common_Get(clip).npc_clip->move_proc)(actorx, game);
|
||||
}
|
||||
|
||||
static void aECST_actor_draw(ACTOR* actorx, GAME* game) {
|
||||
(*Common_Get(clip).npc_clip->draw_proc)(actorx, game);
|
||||
(*Common_Get(clip).npc_clip->draw_proc)(actorx, game);
|
||||
}
|
||||
|
||||
+200
-271
@@ -1,376 +1,305 @@
|
||||
static void aEGH_look_player(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
|
||||
if (ghost->npc_class.action.step == aNPC_ACTION_END_STEP) {
|
||||
u8 action = 4;
|
||||
s16 player_y = ghost->npc_class.actor_class.player_angle_y;
|
||||
s16 rot_y = ghost->npc_class.actor_class.shape_info.rotation.y;
|
||||
s16 diff = player_y - rot_y;
|
||||
|
||||
if (ABS(diff) < DEG2SHORT_ANGLE(67.5f)) {
|
||||
action = 0;
|
||||
}
|
||||
if (ghost->npc_class.action.step == aNPC_ACTION_END_STEP) {
|
||||
u8 action = 4;
|
||||
s16 player_y = ghost->npc_class.actor_class.player_angle_y;
|
||||
s16 rot_y = ghost->npc_class.actor_class.shape_info.rotation.y;
|
||||
s16 diff = player_y - rot_y;
|
||||
|
||||
aEGH_set_request_act(ghost, 4, action, 2, 1, 0, 0);
|
||||
}
|
||||
if (ABS(diff) < DEG2SHORT_ANGLE(67.5f)) {
|
||||
action = 0;
|
||||
}
|
||||
|
||||
aEGH_set_request_act(ghost, 4, action, 2, 1, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static int aEGH_bitset_func(u16 bit) {
|
||||
u32 player_no = Common_Get(player_no);
|
||||
mEv_gst_c* ghost_save = (mEv_gst_c*)mEv_get_save_area(mEv_EVENT_GHOST, 54);
|
||||
mEv_gst_common_c* ghost_common = (mEv_gst_common_c*)mEv_get_common_area(mEv_EVENT_GHOST, 55);
|
||||
u32 player_no = Common_Get(player_no);
|
||||
mEv_gst_c* ghost_save = (mEv_gst_c*)mEv_get_save_area(mEv_EVENT_GHOST, 54);
|
||||
mEv_gst_common_c* ghost_common = (mEv_gst_common_c*)mEv_get_common_area(mEv_EVENT_GHOST, 55);
|
||||
|
||||
if (player_no == mPr_FOREIGNER) {
|
||||
if (ghost_common != NULL) {
|
||||
ghost_common->flags |= bit;
|
||||
return TRUE;
|
||||
if (player_no == mPr_FOREIGNER) {
|
||||
if (ghost_common != NULL) {
|
||||
ghost_common->flags |= bit;
|
||||
return TRUE;
|
||||
}
|
||||
} else if (ghost_save != NULL) {
|
||||
ghost_save->flags |= (u16)(bit << player_no);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (ghost_save != NULL) {
|
||||
ghost_save->flags |= (u16)(bit << player_no);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int aEGH_bitclr_func(u16 bit) {
|
||||
u32 player_no = Common_Get(player_no);
|
||||
mEv_gst_c* ghost_save = (mEv_gst_c*)mEv_get_save_area(mEv_EVENT_GHOST, 54);
|
||||
mEv_gst_common_c* ghost_common = (mEv_gst_common_c*)mEv_get_common_area(mEv_EVENT_GHOST, 55);
|
||||
u32 player_no = Common_Get(player_no);
|
||||
mEv_gst_c* ghost_save = (mEv_gst_c*)mEv_get_save_area(mEv_EVENT_GHOST, 54);
|
||||
mEv_gst_common_c* ghost_common = (mEv_gst_common_c*)mEv_get_common_area(mEv_EVENT_GHOST, 55);
|
||||
|
||||
if (player_no == mPr_FOREIGNER) {
|
||||
if (ghost_common != NULL) {
|
||||
ghost_common->flags &= ~bit;
|
||||
return TRUE;
|
||||
if (player_no == mPr_FOREIGNER) {
|
||||
if (ghost_common != NULL) {
|
||||
ghost_common->flags &= ~bit;
|
||||
return TRUE;
|
||||
}
|
||||
} else if (ghost_save != NULL) {
|
||||
ghost_save->flags &= ~(u16)(bit << player_no);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (ghost_save != NULL) {
|
||||
ghost_save->flags &= ~(u16)(bit << player_no);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static u16 aEGH_bitcheck_func(u16 bit) {
|
||||
u32 player_no = Common_Get(player_no);
|
||||
mEv_gst_c* ghost_save = (mEv_gst_c*)mEv_get_save_area(mEv_EVENT_GHOST, 54);
|
||||
mEv_gst_common_c* ghost_common = (mEv_gst_common_c*)mEv_get_common_area(mEv_EVENT_GHOST, 55);
|
||||
u32 player_no = Common_Get(player_no);
|
||||
mEv_gst_c* ghost_save = (mEv_gst_c*)mEv_get_save_area(mEv_EVENT_GHOST, 54);
|
||||
mEv_gst_common_c* ghost_common = (mEv_gst_common_c*)mEv_get_common_area(mEv_EVENT_GHOST, 55);
|
||||
|
||||
if (player_no == mPr_FOREIGNER) {
|
||||
if (ghost_common != NULL) {
|
||||
return ghost_common->flags & bit;
|
||||
if (player_no == mPr_FOREIGNER) {
|
||||
if (ghost_common != NULL) {
|
||||
return ghost_common->flags & bit;
|
||||
}
|
||||
} else if (ghost_save != NULL) {
|
||||
return (u16)(bit << player_no) & ghost_save->flags;
|
||||
}
|
||||
}
|
||||
else if (ghost_save != NULL) {
|
||||
return (u16)(bit << player_no) & ghost_save->flags;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int aEGH_equal_block(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
|
||||
int bx;
|
||||
int bz;
|
||||
int bx;
|
||||
int bz;
|
||||
|
||||
mFI_Wpos2BlockNum(&bx, &bz, GET_PLAYER_ACTOR(play)->actor_class.world.position);
|
||||
return bx == ghost->npc_class.actor_class.block_x && bz == ghost->npc_class.actor_class.block_z;
|
||||
mFI_Wpos2BlockNum(&bx, &bz, GET_PLAYER_ACTOR(play)->actor_class.world.position);
|
||||
return bx == ghost->npc_class.actor_class.block_x && bz == ghost->npc_class.actor_class.block_z;
|
||||
}
|
||||
|
||||
static int aEGH_time_over() {
|
||||
return Common_Get(time.now_sec) > (4 * mTM_SECONDS_IN_HOUR);
|
||||
return Common_Get(time.now_sec) > (4 * mTM_SECONDS_IN_HOUR);
|
||||
}
|
||||
|
||||
static void aEGH_byebye_check(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
|
||||
ACTOR* actorx = (ACTOR*)ghost;
|
||||
ACTOR* actorx = (ACTOR*)ghost;
|
||||
|
||||
if (
|
||||
mDemo_Check(mDemo_TYPE_TALK, actorx) == FALSE &&
|
||||
mDemo_Check(mDemo_TYPE_SPEAK, actorx) == FALSE &&
|
||||
aEGH_time_over() != FALSE
|
||||
) {
|
||||
if (aEGH_equal_block(ghost, play)) {
|
||||
switch (ghost->think_act) {
|
||||
case aEGH_THINK_SPEAK:
|
||||
{
|
||||
aEGH_setup_think_proc(ghost, play, aEGH_THINK_BYEBYE);
|
||||
ghost->msg_no = 0x2EDD;
|
||||
ghost->npc_class.actor_class.talk_distance = 1000.0f;
|
||||
ghost->_9AA = 1;
|
||||
break;
|
||||
}
|
||||
if (mDemo_Check(mDemo_TYPE_TALK, actorx) == FALSE && mDemo_Check(mDemo_TYPE_SPEAK, actorx) == FALSE &&
|
||||
aEGH_time_over() != FALSE) {
|
||||
if (aEGH_equal_block(ghost, play)) {
|
||||
switch (ghost->think_act) {
|
||||
case aEGH_THINK_SPEAK: {
|
||||
aEGH_setup_think_proc(ghost, play, aEGH_THINK_BYEBYE);
|
||||
ghost->msg_no = 0x2EDD;
|
||||
ghost->npc_class.actor_class.talk_distance = 1000.0f;
|
||||
ghost->_9AA = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
case aEGH_THINK_NORMAL_WAIT:
|
||||
case aEGH_THINK_IRAI_AF:
|
||||
case aEGH_THINK_BYE:
|
||||
case aEGH_THINK_WELCOM:
|
||||
{
|
||||
Actor_delete((ACTOR*)ghost);
|
||||
break;
|
||||
case aEGH_THINK_NORMAL_WAIT:
|
||||
case aEGH_THINK_IRAI_AF:
|
||||
case aEGH_THINK_BYE:
|
||||
case aEGH_THINK_WELCOM: {
|
||||
Actor_delete((ACTOR*)ghost);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
aEGH_setup_think_proc(ghost, play, aEGH_THINK_IRAI);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
aEGH_setup_think_proc(ghost, play, aEGH_THINK_IRAI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aEGH_irai(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
|
||||
if (ghost->npc_class.actor_class.player_distance_xz > 220.0f) {
|
||||
aEGH_setup_think_proc(ghost, play, aEGH_THINK_BYE);
|
||||
}
|
||||
if (ghost->npc_class.actor_class.player_distance_xz > 220.0f) {
|
||||
aEGH_setup_think_proc(ghost, play, aEGH_THINK_BYE);
|
||||
}
|
||||
}
|
||||
|
||||
static void aEGH_bye(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
|
||||
if (ghost->npc_class.actor_class.player_distance_xz < 200.0f) {
|
||||
aEGH_setup_think_proc(ghost, play, aEGH_THINK_WELCOM);
|
||||
}
|
||||
if (ghost->npc_class.actor_class.player_distance_xz < 200.0f) {
|
||||
aEGH_setup_think_proc(ghost, play, aEGH_THINK_WELCOM);
|
||||
}
|
||||
}
|
||||
|
||||
static void aEGH_byebye(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
|
||||
if (ghost->alpha == 0) {
|
||||
Actor_delete((ACTOR*)ghost);
|
||||
}
|
||||
else {
|
||||
if (ghost->bye_bye_timer != 0) {
|
||||
ghost->bye_bye_timer--;
|
||||
if (ghost->alpha == 0) {
|
||||
Actor_delete((ACTOR*)ghost);
|
||||
} else {
|
||||
if (ghost->bye_bye_timer != 0) {
|
||||
ghost->bye_bye_timer--;
|
||||
|
||||
if (ghost->bye_bye_timer == 0) {
|
||||
sAdo_SysTrgStart(0x16C);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ghost->bye_bye_angle < 30000) {
|
||||
ghost->bye_bye_angle += 60;
|
||||
}
|
||||
if (ghost->bye_bye_timer == 0) {
|
||||
sAdo_SysTrgStart(0x16C);
|
||||
}
|
||||
} else {
|
||||
if (ghost->bye_bye_angle < 30000) {
|
||||
ghost->bye_bye_angle += 60;
|
||||
}
|
||||
|
||||
ghost->npc_class.actor_class.shape_info.rotation.y += ghost->bye_bye_angle;
|
||||
ghost->npc_class.actor_class.world.angle.y = ghost->npc_class.actor_class.shape_info.rotation.y;
|
||||
ghost->npc_class.movement.mv_angl = ghost->npc_class.actor_class.world.angle.y;
|
||||
ghost->npc_class.movement.mv_add_angl = 0;
|
||||
}
|
||||
ghost->npc_class.actor_class.shape_info.rotation.y += ghost->bye_bye_angle;
|
||||
ghost->npc_class.actor_class.world.angle.y = ghost->npc_class.actor_class.shape_info.rotation.y;
|
||||
ghost->npc_class.movement.mv_angl = ghost->npc_class.actor_class.world.angle.y;
|
||||
ghost->npc_class.movement.mv_add_angl = 0;
|
||||
}
|
||||
|
||||
if (ghost->bye_bye_scale_timer != 0) {
|
||||
ghost->bye_bye_scale_timer--;
|
||||
if (ghost->bye_bye_scale_timer != 0) {
|
||||
ghost->bye_bye_scale_timer--;
|
||||
} else {
|
||||
ghost->npc_class.actor_class.scale.x += -0.00004f;
|
||||
ghost->npc_class.actor_class.scale.z = ghost->npc_class.actor_class.scale.x;
|
||||
}
|
||||
}
|
||||
else {
|
||||
ghost->npc_class.actor_class.scale.x += -0.00004f;
|
||||
ghost->npc_class.actor_class.scale.z = ghost->npc_class.actor_class.scale.x;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aEGH_speak_byebye(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
|
||||
ACTOR* actorx = (ACTOR*)ghost;
|
||||
ACTOR* actorx = (ACTOR*)ghost;
|
||||
|
||||
if (
|
||||
mDemo_Check(mDemo_TYPE_TALK, actorx) == FALSE &&
|
||||
mDemo_Check(mDemo_TYPE_SPEAK, actorx) == FALSE &&
|
||||
aEGH_equal_block(ghost, play) == FALSE
|
||||
) {
|
||||
aEGH_setup_think_proc(ghost, play, aEGH_THINK_IRAI);
|
||||
}
|
||||
if (mDemo_Check(mDemo_TYPE_TALK, actorx) == FALSE && mDemo_Check(mDemo_TYPE_SPEAK, actorx) == FALSE &&
|
||||
aEGH_equal_block(ghost, play) == FALSE) {
|
||||
aEGH_setup_think_proc(ghost, play, aEGH_THINK_IRAI);
|
||||
}
|
||||
}
|
||||
|
||||
static void aEGH_think_main_proc(NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
EV_GHOST_ACTOR* ghost = (EV_GHOST_ACTOR*)actorx;
|
||||
EV_GHOST_ACTOR* ghost = (EV_GHOST_ACTOR*)actorx;
|
||||
|
||||
(*ghost->think_proc)(ghost, play);
|
||||
aEGH_look_player(ghost, play);
|
||||
(*ghost->think_proc)(ghost, play);
|
||||
aEGH_look_player(ghost, play);
|
||||
}
|
||||
|
||||
static void aEGH_think_init_proc(NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
EV_GHOST_ACTOR* ghost = (EV_GHOST_ACTOR*)actorx;
|
||||
u8 think_act;
|
||||
EV_GHOST_ACTOR* ghost = (EV_GHOST_ACTOR*)actorx;
|
||||
u8 think_act;
|
||||
|
||||
if (ghost->_9AC) {
|
||||
ghost->_9AC = FALSE;
|
||||
}
|
||||
else {
|
||||
if (aEGH_bitcheck_func(aEGH_BIT_FOUND_GHOST)) {
|
||||
ghost->alpha = 140;
|
||||
think_act = aEGH_THINK_SPEAK;
|
||||
}
|
||||
else {
|
||||
ghost->alpha = 0;
|
||||
think_act = aEGH_THINK_IRAI_AF;
|
||||
}
|
||||
if (ghost->_9AC) {
|
||||
ghost->_9AC = FALSE;
|
||||
} else {
|
||||
if (aEGH_bitcheck_func(aEGH_BIT_FOUND_GHOST)) {
|
||||
ghost->alpha = 140;
|
||||
think_act = aEGH_THINK_SPEAK;
|
||||
} else {
|
||||
ghost->alpha = 0;
|
||||
think_act = aEGH_THINK_IRAI_AF;
|
||||
}
|
||||
|
||||
actorx->actor_class.status_data.weight = 255;
|
||||
actorx->condition_info.hide_request = FALSE;
|
||||
aEGH_setup_think_proc(ghost, play, think_act);
|
||||
actorx->condition_info.demo_flg = aNPC_COND_DEMO_SKIP_FOOTSTEPS_VFX |
|
||||
aNPC_COND_DEMO_SKIP_FEEL_CHECK |
|
||||
aNPC_COND_DEMO_SKIP_FOOTSTEPS |
|
||||
aNPC_COND_DEMO_SKIP_ENTRANCE_CHECK |
|
||||
aNPC_COND_DEMO_SKIP_HEAD_LOOKAT;
|
||||
}
|
||||
actorx->actor_class.status_data.weight = 255;
|
||||
actorx->condition_info.hide_request = FALSE;
|
||||
aEGH_setup_think_proc(ghost, play, think_act);
|
||||
actorx->condition_info.demo_flg = aNPC_COND_DEMO_SKIP_FOOTSTEPS_VFX | aNPC_COND_DEMO_SKIP_FEEL_CHECK |
|
||||
aNPC_COND_DEMO_SKIP_FOOTSTEPS | aNPC_COND_DEMO_SKIP_ENTRANCE_CHECK |
|
||||
aNPC_COND_DEMO_SKIP_HEAD_LOOKAT;
|
||||
}
|
||||
}
|
||||
|
||||
static void aEGH_normal_wait_init(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
|
||||
(*Common_Get(clip).npc_clip->animation_init_proc)((ACTOR*)ghost, 126, FALSE);
|
||||
ghost->npc_class.draw.main_animation.keyframe.frame_control.mode = cKF_FRAMECONTROL_REPEAT;
|
||||
ghost->npc_class.action.idx = 0;
|
||||
aEGH_set_request_act(ghost, 4, 0, 0, 0, 0, 0);
|
||||
(*Common_Get(clip).npc_clip->animation_init_proc)((ACTOR*)ghost, aNPC_ANIM_GSTWAIT1, FALSE);
|
||||
ghost->npc_class.draw.main_animation.keyframe.frame_control.mode = cKF_FRAMECONTROL_REPEAT;
|
||||
ghost->npc_class.action.idx = 0;
|
||||
aEGH_set_request_act(ghost, 4, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
static void aEGH_irai_init(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
|
||||
ghost->npc_class.actor_class.talk_distance = 80.0f;
|
||||
aEGH_normal_wait_init(ghost, play);
|
||||
ghost->msg_no = 0x2EE2;
|
||||
ghost->npc_class.actor_class.talk_distance = 80.0f;
|
||||
aEGH_normal_wait_init(ghost, play);
|
||||
ghost->msg_no = 0x2EE2;
|
||||
}
|
||||
|
||||
static void aEGH_irai_af_init(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
|
||||
ghost->npc_class.actor_class.talk_distance = 55.0f;
|
||||
ghost->msg_no = 0x2EE7;
|
||||
(*Common_Get(clip).npc_clip->chg_schedule_proc)((NPC_ACTOR*)ghost, play, 5);
|
||||
ghost->npc_class.actor_class.status_data.weight = 80;
|
||||
ghost->npc_class.actor_class.talk_distance = 55.0f;
|
||||
ghost->msg_no = 0x2EE7;
|
||||
(*Common_Get(clip).npc_clip->chg_schedule_proc)((NPC_ACTOR*)ghost, play, 5);
|
||||
ghost->npc_class.actor_class.status_data.weight = 80;
|
||||
}
|
||||
|
||||
static void aEGH_bye_init(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
|
||||
ghost->npc_class.actor_class.talk_distance = 280.0f;
|
||||
aEGH_normal_wait_init(ghost, play);
|
||||
ghost->msg_no = 0x2ED8;
|
||||
ghost->npc_class.actor_class.talk_distance = 280.0f;
|
||||
aEGH_normal_wait_init(ghost, play);
|
||||
ghost->msg_no = 0x2ED8;
|
||||
}
|
||||
|
||||
static void aEGH_welcom_init(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
|
||||
ghost->npc_class.actor_class.talk_distance = 200.0f;
|
||||
aEGH_normal_wait_init(ghost, play);
|
||||
ghost->msg_no = 0x2ED3;
|
||||
ghost->npc_class.actor_class.talk_distance = 200.0f;
|
||||
aEGH_normal_wait_init(ghost, play);
|
||||
ghost->msg_no = 0x2ED3;
|
||||
}
|
||||
|
||||
static void aEGH_byebye_init(EV_GHOST_ACTOR* ghost, GAME_PLAY* play) {
|
||||
aEGH_bitclr_func(aEGH_BIT_FOUND_GHOST);
|
||||
ghost->bye_bye_angle = -1000;
|
||||
ghost->bye_bye_timer = 25;
|
||||
ghost->bye_bye_scale_timer = 48;
|
||||
ghost->bye_bye_transparency_delay_timer = 43;
|
||||
aEGH_normal_wait_init(ghost, play);
|
||||
ghost->npc_class.head.lock_flag = TRUE;
|
||||
aEGH_bitclr_func(aEGH_BIT_FOUND_GHOST);
|
||||
ghost->bye_bye_angle = -1000;
|
||||
ghost->bye_bye_timer = 25;
|
||||
ghost->bye_bye_scale_timer = 48;
|
||||
ghost->bye_bye_transparency_delay_timer = 43;
|
||||
aEGH_normal_wait_init(ghost, play);
|
||||
ghost->npc_class.head.lock_flag = TRUE;
|
||||
}
|
||||
|
||||
static aEGH_setup_c dt_tbl[aEGH_THINK_NUM] = {
|
||||
{
|
||||
aEGH_THINK_PROC_BYE,
|
||||
aEGH_THINK_INIT_NORMAL_WAIT,
|
||||
aEGH_TALK_REQUEST_NONE,
|
||||
aEGH_TALK_END_WAIT,
|
||||
aEGH_THINK_NORMAL_WAIT
|
||||
},
|
||||
{
|
||||
aEGH_THINK_PROC_BYEBYE,
|
||||
aEGH_THINK_INIT_BYEBYE,
|
||||
aEGH_TALK_REQUEST_NONE,
|
||||
aEGH_TALK_END_WAIT,
|
||||
aEGH_THINK_IRAI
|
||||
},
|
||||
{ aEGH_THINK_PROC_BYE, aEGH_THINK_INIT_NORMAL_WAIT, aEGH_TALK_REQUEST_NONE, aEGH_TALK_END_WAIT,
|
||||
aEGH_THINK_NORMAL_WAIT },
|
||||
{ aEGH_THINK_PROC_BYEBYE, aEGH_THINK_INIT_BYEBYE, aEGH_TALK_REQUEST_NONE, aEGH_TALK_END_WAIT, aEGH_THINK_IRAI },
|
||||
|
||||
{
|
||||
aEGH_THINK_PROC_NONE,
|
||||
aEGH_THINK_INIT_WELCOM,
|
||||
aEGH_TALK_REQUEST_FORCE,
|
||||
aEGH_TALK_END_WAIT,
|
||||
aEGH_THINK_WELCOM
|
||||
},
|
||||
{ aEGH_THINK_PROC_NONE, aEGH_THINK_INIT_WELCOM, aEGH_TALK_REQUEST_FORCE, aEGH_TALK_END_WAIT, aEGH_THINK_WELCOM },
|
||||
|
||||
{
|
||||
aEGH_THINK_PROC_BYE,
|
||||
aEGH_THINK_INIT_BYE,
|
||||
aEGH_TALK_REQUEST_FORCE,
|
||||
aEGH_TALK_GIVE_ME_WAIT,
|
||||
aEGH_THINK_NORMAL_WAIT
|
||||
},
|
||||
{ aEGH_THINK_PROC_BYE, aEGH_THINK_INIT_BYE, aEGH_TALK_REQUEST_FORCE, aEGH_TALK_GIVE_ME_WAIT,
|
||||
aEGH_THINK_NORMAL_WAIT },
|
||||
|
||||
{
|
||||
aEGH_THINK_PROC_IRAI,
|
||||
aEGH_THINK_INIT_IRAI,
|
||||
aEGH_TALK_REQUEST_FORCE,
|
||||
aEGH_TALK_SELECT_WAIT,
|
||||
aEGH_THINK_SPEAK
|
||||
},
|
||||
{ aEGH_THINK_PROC_IRAI, aEGH_THINK_INIT_IRAI, aEGH_TALK_REQUEST_FORCE, aEGH_TALK_SELECT_WAIT, aEGH_THINK_SPEAK },
|
||||
|
||||
{
|
||||
aEGH_THINK_PROC_SPEAK_BYEBYE,
|
||||
aEGH_THINK_INIT_NORMAL_WAIT,
|
||||
aEGH_TALK_REQUEST_FORCE,
|
||||
aEGH_TALK_SELECT_ROOF,
|
||||
aEGH_THINK_IRAI
|
||||
},
|
||||
{ aEGH_THINK_PROC_SPEAK_BYEBYE, aEGH_THINK_INIT_NORMAL_WAIT, aEGH_TALK_REQUEST_FORCE, aEGH_TALK_SELECT_ROOF,
|
||||
aEGH_THINK_IRAI },
|
||||
|
||||
{
|
||||
aEGH_THINK_PROC_NONE,
|
||||
aEGH_THINK_INIT_IRAI_AF,
|
||||
aEGH_TALK_REQUEST_NORM,
|
||||
aEGH_TALK_END_WAIT,
|
||||
aEGH_THINK_SPEAK
|
||||
}
|
||||
{ aEGH_THINK_PROC_NONE, aEGH_THINK_INIT_IRAI_AF, aEGH_TALK_REQUEST_NORM, aEGH_TALK_END_WAIT, aEGH_THINK_SPEAK }
|
||||
};
|
||||
|
||||
static aEGH_PROC proc_table[aEGH_THINK_PROC_NUM] = {
|
||||
(aEGH_PROC)&none_proc1,
|
||||
&aEGH_irai,
|
||||
&aEGH_bye,
|
||||
&aEGH_byebye,
|
||||
&aEGH_speak_byebye
|
||||
};
|
||||
static aEGH_PROC proc_table[aEGH_THINK_PROC_NUM] = { (aEGH_PROC)&none_proc1, &aEGH_irai, &aEGH_bye, &aEGH_byebye,
|
||||
&aEGH_speak_byebye };
|
||||
|
||||
static aEGH_PROC init_table[aEGH_THINK_INIT_NUM] = {
|
||||
(aEGH_PROC)&none_proc1,
|
||||
&aEGH_normal_wait_init,
|
||||
&aEGH_irai_init,
|
||||
&aEGH_irai_af_init,
|
||||
&aEGH_bye_init,
|
||||
&aEGH_welcom_init,
|
||||
&aEGH_byebye_init
|
||||
};
|
||||
static aEGH_PROC init_table[aEGH_THINK_INIT_NUM] = { (aEGH_PROC)&none_proc1, &aEGH_normal_wait_init, &aEGH_irai_init,
|
||||
&aEGH_irai_af_init, &aEGH_bye_init, &aEGH_welcom_init,
|
||||
&aEGH_byebye_init };
|
||||
|
||||
static void aEGH_setup_think_proc(EV_GHOST_ACTOR* ghost, GAME_PLAY* play, u8 think_act) {
|
||||
static aNPC_TALK_REQUEST_PROC talk_request_table[aEGH_TALK_REQUEST_NUM] = {
|
||||
(aNPC_TALK_REQUEST_PROC)&none_proc1,
|
||||
&aEGH_norm_talk_request,
|
||||
&aEGH_force_talk_request
|
||||
};
|
||||
|
||||
aEGH_setup_c* data = &dt_tbl[think_act];
|
||||
static aNPC_TALK_REQUEST_PROC talk_request_table[aEGH_TALK_REQUEST_NUM] = { (aNPC_TALK_REQUEST_PROC)&none_proc1,
|
||||
&aEGH_norm_talk_request,
|
||||
&aEGH_force_talk_request };
|
||||
|
||||
ghost->think_act = think_act;
|
||||
ghost->think_proc = proc_table[data->think_proc];
|
||||
ghost->npc_class.talk_info.talk_request_proc = talk_request_table[data->talk_request_proc];
|
||||
ghost->talk_act = data->talk_act;
|
||||
ghost->after_talk_think_act = data->talk_after_act;
|
||||
(*init_table[data->think_init_proc])(ghost, play);
|
||||
ghost->_9A7 = TRUE;
|
||||
aEGH_setup_c* data = &dt_tbl[think_act];
|
||||
|
||||
ghost->think_act = think_act;
|
||||
ghost->think_proc = proc_table[data->think_proc];
|
||||
ghost->npc_class.talk_info.talk_request_proc = talk_request_table[data->talk_request_proc];
|
||||
ghost->talk_act = data->talk_act;
|
||||
ghost->after_talk_think_act = data->talk_after_act;
|
||||
(*init_table[data->think_init_proc])(ghost, play);
|
||||
ghost->_9A7 = TRUE;
|
||||
}
|
||||
|
||||
static void aEGH_think_proc(NPC_ACTOR* actorx, GAME_PLAY* play, int think_type) {
|
||||
switch (think_type) {
|
||||
case 0:
|
||||
aEGH_think_init_proc(actorx, play);
|
||||
break;
|
||||
case 1:
|
||||
aEGH_think_main_proc(actorx, play);
|
||||
break;
|
||||
}
|
||||
switch (think_type) {
|
||||
case 0:
|
||||
aEGH_think_init_proc(actorx, play);
|
||||
break;
|
||||
case 1:
|
||||
aEGH_think_main_proc(actorx, play);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void aEGH_schedule_init_proc(NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
actorx->think.think_proc = &aEGH_think_proc;
|
||||
(*Common_Get(clip).npc_clip->think_proc)(actorx, play, aNPC_THINK_SPECIAL, 0);
|
||||
actorx->think.think_proc = &aEGH_think_proc;
|
||||
(*Common_Get(clip).npc_clip->think_proc)(actorx, play, aNPC_THINK_SPECIAL, 0);
|
||||
}
|
||||
|
||||
static void aEGH_schedule_main_proc(NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
if ((*Common_Get(clip).npc_clip->think_proc)(actorx, play, -1, 1) == FALSE) {
|
||||
(*Common_Get(clip).npc_clip->think_proc)(actorx, play, -1, 2);
|
||||
}
|
||||
if ((*Common_Get(clip).npc_clip->think_proc)(actorx, play, -1, 1) == FALSE) {
|
||||
(*Common_Get(clip).npc_clip->think_proc)(actorx, play, -1, 2);
|
||||
}
|
||||
}
|
||||
|
||||
static void aEGH_schedule_proc(NPC_ACTOR* actorx, GAME_PLAY* play, int sched_type) {
|
||||
switch (sched_type) {
|
||||
case 0:
|
||||
aEGH_schedule_init_proc(actorx, play);
|
||||
break;
|
||||
case 1:
|
||||
aEGH_schedule_main_proc(actorx, play);
|
||||
break;
|
||||
}
|
||||
switch (sched_type) {
|
||||
case 0:
|
||||
aEGH_schedule_init_proc(actorx, play);
|
||||
break;
|
||||
case 1:
|
||||
aEGH_schedule_main_proc(actorx, play);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+24
-38
@@ -9,17 +9,10 @@ extern void aEMJ_actor_init(ACTOR*, GAME*);
|
||||
extern void aEMJ_actor_save(ACTOR*, GAME*);
|
||||
|
||||
ACTOR_PROFILE Ev_Majin_Profile = {
|
||||
mAc_PROFILE_EV_MAJIN,
|
||||
ACTOR_PART_NPC,
|
||||
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
SP_NPC_EV_MAJIN,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(EV_NPCMAJIN_ACTOR),
|
||||
aEMJ_actor_ct,
|
||||
aEMJ_actor_dt,
|
||||
aEMJ_actor_init,
|
||||
NONE_ACTOR_PROC,
|
||||
aEMJ_actor_save,
|
||||
mAc_PROFILE_EV_MAJIN, ACTOR_PART_NPC, ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
SP_NPC_EV_MAJIN, ACTOR_OBJ_BANK_KEEP, sizeof(EV_NPCMAJIN_ACTOR),
|
||||
aEMJ_actor_ct, aEMJ_actor_dt, aEMJ_actor_init,
|
||||
NONE_ACTOR_PROC, aEMJ_actor_save,
|
||||
};
|
||||
|
||||
extern void aEMJ_actor_move(ACTOR*, GAME*);
|
||||
@@ -31,57 +24,50 @@ static void aEMJ_schedule_proc(NPC_ACTOR*, GAME_PLAY*, int);
|
||||
|
||||
void aEMJ_actor_ct(ACTOR* actor, GAME* game) {
|
||||
static aNPC_ct_data_c ct_data = {
|
||||
&aEMJ_actor_move,
|
||||
&aEMJ_actor_draw,
|
||||
5,
|
||||
mActor_NONE_PROC1,
|
||||
&aEMJ_talk_init,
|
||||
&aEMJ_talk_end_chk,
|
||||
0,
|
||||
&aEMJ_actor_move, &aEMJ_actor_draw, 5, mActor_NONE_PROC1, &aEMJ_talk_init, &aEMJ_talk_end_chk, 0,
|
||||
};
|
||||
EV_NPCMAJIN_ACTOR* majin = (EV_NPCMAJIN_ACTOR*)actor;
|
||||
|
||||
if(Common_Get(clip.npc_clip)->birth_check_proc(actor,game) == TRUE){
|
||||
|
||||
if (Common_Get(clip.npc_clip)->birth_check_proc(actor, game) == TRUE) {
|
||||
majin->npc_class.schedule.schedule_proc = aEMJ_schedule_proc;
|
||||
Common_Get(clip.npc_clip)->ct_proc(actor,game,&ct_data);
|
||||
Common_Get(clip.npc_clip)->ct_proc(actor, game, &ct_data);
|
||||
majin->npc_class.head.lock_flag = 1;
|
||||
majin->npc_class.talk_info.default_turn_animation = 0x4E;
|
||||
majin->npc_class.talk_info.default_animation = 0x4E;
|
||||
majin->npc_class.talk_info.default_turn_animation = aNPC_ANIM_WAIT_R1;
|
||||
majin->npc_class.talk_info.default_animation = aNPC_ANIM_WAIT_R1;
|
||||
majin->npc_class.talk_info.turn = 2;
|
||||
}
|
||||
}
|
||||
|
||||
void aEMJ_actor_save(ACTOR* actor, GAME* game) {
|
||||
Common_Get(clip.npc_clip)->save_proc(actor,game);
|
||||
Common_Get(clip.npc_clip)->save_proc(actor, game);
|
||||
}
|
||||
|
||||
void aEMJ_actor_dt(ACTOR* actor, GAME* game) {
|
||||
|
||||
if(Common_Get(clip.groundhog_control_clip) != NULL){
|
||||
|
||||
if (Common_Get(clip.groundhog_control_clip) != NULL) {
|
||||
Common_Get(clip.groundhog_control_clip)->groundhog_npc_actor = NULL;
|
||||
}
|
||||
Common_Get(clip.npc_clip)->dt_proc(actor,game);
|
||||
Common_Get(clip.effect_clip)->effect_kill_proc(0x5D, 0xFFFF);
|
||||
|
||||
Common_Get(clip.npc_clip)->dt_proc(actor, game);
|
||||
Common_Get(clip.effect_clip)->effect_kill_proc(eEC_EFFECT_RESET_HOLE, RSV_NO);
|
||||
}
|
||||
|
||||
void aEMJ_actor_init(ACTOR* actor, GAME* game) {
|
||||
Common_Get(clip.npc_clip)->init_proc(actor,game);
|
||||
Common_Get(clip.npc_clip)->init_proc(actor, game);
|
||||
}
|
||||
|
||||
void aEMJ_set_animation(ACTOR* actor, int idx){
|
||||
static s16 animeSeqNo[] = {79,78,80};
|
||||
|
||||
Common_Get(clip.npc_clip)->animation_init_proc(actor,animeSeqNo[idx],0);
|
||||
void aEMJ_set_animation(ACTOR* actor, int idx) {
|
||||
static s16 animeSeqNo[] = { aNPC_ANIM_APPEAR1, aNPC_ANIM_WAIT_R1, aNPC_ANIM_GO_UG1 };
|
||||
|
||||
Common_Get(clip.npc_clip)->animation_init_proc(actor, animeSeqNo[idx], 0);
|
||||
}
|
||||
|
||||
void aEMJ_actor_move(ACTOR* actor, GAME* game){
|
||||
Common_Get(clip.npc_clip)->move_proc(actor,game);
|
||||
void aEMJ_actor_move(ACTOR* actor, GAME* game) {
|
||||
Common_Get(clip.npc_clip)->move_proc(actor, game);
|
||||
actor->shape_info.draw_shadow = 0;
|
||||
}
|
||||
|
||||
void aEMJ_actor_draw(ACTOR* actor, GAME* game) {
|
||||
Common_Get(clip.npc_clip)->draw_proc(actor,game);
|
||||
Common_Get(clip.npc_clip)->draw_proc(actor, game);
|
||||
}
|
||||
|
||||
#include "../src/ac_ev_majin_move.c_inc"
|
||||
#include "../src/ac_ev_majin_move.c_inc"
|
||||
|
||||
+10
-10
@@ -18,8 +18,8 @@ void aEMJ_act_init_proc(NPC_ACTOR* actor, GAME_PLAY* play) {
|
||||
}
|
||||
|
||||
void aEMJ_act_proc(NPC_ACTOR* actor, GAME_PLAY* play, int idx) {
|
||||
static aNPC_SUB_PROC act_proc[] = {aEMJ_act_init_proc, (aNPC_SUB_PROC)mActor_NONE_PROC1,
|
||||
(aNPC_SUB_PROC)mActor_NONE_PROC1};
|
||||
static aNPC_SUB_PROC act_proc[] = { aEMJ_act_init_proc, (aNPC_SUB_PROC)mActor_NONE_PROC1,
|
||||
(aNPC_SUB_PROC)mActor_NONE_PROC1 };
|
||||
|
||||
act_proc[idx](actor, play);
|
||||
}
|
||||
@@ -27,13 +27,13 @@ void aEMJ_act_proc(NPC_ACTOR* actor, GAME_PLAY* play, int idx) {
|
||||
void aEMJ_appear(NPC_ACTOR* actor, GAME_PLAY* play) {
|
||||
EV_NPCMAJIN_ACTOR* majin = (EV_NPCMAJIN_ACTOR*)actor;
|
||||
|
||||
if (majin->npc_class.draw._04 == 1) {
|
||||
if (majin->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
|
||||
aEMJ_setup_think_proc(actor, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void aEMJ_retire(NPC_ACTOR* actor, GAME_PLAY* play) {
|
||||
if (actor->draw._04 == 1) {
|
||||
if (actor->draw.main_animation_state == cKF_STATE_STOPPED) {
|
||||
((NPC_ACTOR*)(actor->actor_class.parent_actor))->npc_info.animal = (Animal_c*)1;
|
||||
Actor_delete(&actor->actor_class);
|
||||
}
|
||||
@@ -64,9 +64,9 @@ void aEMJ_think_init_proc(ACTOR* actor, GAME* game) {
|
||||
|
||||
void aEMJ_setup_think_proc(NPC_ACTOR* actor, int idx) {
|
||||
static NPC_DT_PROCS dt_tbl[] = {
|
||||
{aEMJ_appear, (aNPC_SUB_PROC)none_proc1},
|
||||
{(aNPC_SUB_PROC)none_proc1, aEMJ_force_talk_request},
|
||||
{aEMJ_retire, (aNPC_SUB_PROC)none_proc1},
|
||||
{ aEMJ_appear, (aNPC_SUB_PROC)none_proc1 },
|
||||
{ (aNPC_SUB_PROC)none_proc1, aEMJ_force_talk_request },
|
||||
{ aEMJ_retire, (aNPC_SUB_PROC)none_proc1 },
|
||||
};
|
||||
EV_NPCMAJIN_ACTOR* majin = (EV_NPCMAJIN_ACTOR*)actor;
|
||||
|
||||
@@ -106,7 +106,7 @@ void aEMJ_schedule_main_proc(NPC_ACTOR* actor, GAME_PLAY* play) {
|
||||
}
|
||||
|
||||
void aEMJ_schedule_proc(NPC_ACTOR* actor, GAME_PLAY* play, int idx) {
|
||||
static aNPC_SUB_PROC sche_proc[] = {aEMJ_schedule_init_proc, aEMJ_schedule_main_proc};
|
||||
static aNPC_SUB_PROC sche_proc[] = { aEMJ_schedule_init_proc, aEMJ_schedule_main_proc };
|
||||
|
||||
sche_proc[idx](actor, play);
|
||||
}
|
||||
@@ -132,8 +132,8 @@ void aEMJ_set_force_talk_info() {
|
||||
mDemo_Set_msg_num(msg_num);
|
||||
}
|
||||
|
||||
void aEMJ_force_talk_request(NPC_ACTOR* actor, GAME_PLAY* play) {
|
||||
mDemo_Request(10, &actor->actor_class, aEMJ_set_force_talk_info);
|
||||
void aEMJ_force_talk_request(NPC_ACTOR* actor, GAME_PLAY* play) {
|
||||
mDemo_Request(10, &actor->actor_class, aEMJ_set_force_talk_info);
|
||||
}
|
||||
|
||||
int aEMJ_talk_init(ACTOR* actor, GAME* play) {
|
||||
|
||||
+58
-76
@@ -32,107 +32,89 @@ static void aHNW_actor_init(ACTOR* actor, GAME* game);
|
||||
static void aHNW_actor_draw(ACTOR* actor, GAME* game);
|
||||
|
||||
ACTOR_PROFILE Haniwa_Profile = {
|
||||
mAc_PROFILE_HANIWA,
|
||||
ACTOR_PART_BG,
|
||||
ACTOR_STATE_NONE,
|
||||
ACTOR_PROP_HANIWA0,
|
||||
ACTOR_OBJ_BANK_12,
|
||||
sizeof(HANIWA_ACTOR),
|
||||
mAc_PROFILE_HANIWA, ACTOR_PART_BG, ACTOR_STATE_NONE, ACTOR_PROP_HANIWA0, ACTOR_OBJ_BANK_12,
|
||||
sizeof(HANIWA_ACTOR),
|
||||
|
||||
&aHNW_actor_ct,
|
||||
&aHNW_actor_dt,
|
||||
&aHNW_actor_init,
|
||||
(mActor_proc)&none_proc1,
|
||||
NULL
|
||||
&aHNW_actor_ct, &aHNW_actor_dt, &aHNW_actor_init, (mActor_proc)&none_proc1, NULL
|
||||
};
|
||||
|
||||
static ClObjPipeData_c AcHaniwaCoInfoData = {
|
||||
{ 57, 32, ClObj_TYPE_PIPE },
|
||||
{ 1 },
|
||||
{ 20, 30, 0, { 0, 0, 0 } }
|
||||
};
|
||||
static ClObjPipeData_c AcHaniwaCoInfoData = { { 57, 32, ClObj_TYPE_PIPE }, { 1 }, { 20, 30, 0, { 0, 0, 0 } } };
|
||||
|
||||
static StatusData_c AcHaniwaStatusData = {
|
||||
0,
|
||||
20, 30, 0,
|
||||
254
|
||||
};
|
||||
static StatusData_c AcHaniwaStatusData = { 0, 20, 30, 0, 254 };
|
||||
|
||||
/* TODO: ct, dt, & draw are in their own TU */
|
||||
static void aHNW_actor_ct(ACTOR* actor, GAME* game) {
|
||||
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
|
||||
ClObjPipe_c* pipe;
|
||||
cKF_SkeletonInfo_R_c* keyframe = &haniwa->keyframe;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
|
||||
ClObjPipe_c* pipe;
|
||||
cKF_SkeletonInfo_R_c* keyframe = &haniwa->common_actor_class.anime.keyframe;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
cKF_SkeletonInfo_R_ct(keyframe, &cKF_bs_r_hnw, NULL, haniwa->keyframe_work_area, haniwa->keyframe_morph_area);
|
||||
cKF_SkeletonInfo_R_ct(keyframe, &cKF_bs_r_hnw, NULL, haniwa->keyframe_work_area, haniwa->keyframe_morph_area);
|
||||
|
||||
pipe = &haniwa->col_pipe;
|
||||
ClObjPipe_ct(game, pipe);
|
||||
ClObjPipe_set5(game, pipe, actor, &AcHaniwaCoInfoData);
|
||||
CollisionCheck_Status_set3(&haniwa->actor_class.status_data, &AcHaniwaStatusData);
|
||||
pipe = &haniwa->common_actor_class.col_pipe;
|
||||
ClObjPipe_ct(game, pipe);
|
||||
ClObjPipe_set5(game, pipe, actor, &AcHaniwaCoInfoData);
|
||||
CollisionCheck_Status_set3(&haniwa->common_actor_class.actor_class.status_data, &AcHaniwaStatusData);
|
||||
|
||||
{
|
||||
Object_Bank_c* bank = &play->object_exchange.banks[actor->data_bank_id];
|
||||
haniwa->bank_ram_start = bank->ram_start;
|
||||
}
|
||||
{
|
||||
Object_Bank_c* bank = &play->object_exchange.banks[actor->data_bank_id];
|
||||
haniwa->bank_ram_start = bank->ram_start;
|
||||
}
|
||||
|
||||
haniwa->animation_state = 2;
|
||||
haniwa->house_idx = actor->npc_id - ACTOR_PROP_HANIWA0;
|
||||
actor->talk_distance = 43.0f;
|
||||
haniwa->common_actor_class.anime.anime_no = 2;
|
||||
haniwa->house_idx = actor->npc_id - ACTOR_PROP_HANIWA0;
|
||||
actor->talk_distance = 43.0f;
|
||||
}
|
||||
|
||||
static void aHNW_actor_dt(ACTOR* actor, GAME* game) {
|
||||
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
if (haniwa->playing_save_bgm) {
|
||||
mBGMPsComp_delete_ps_demo(0x41, 0x168);
|
||||
}
|
||||
if (haniwa->playing_save_bgm) {
|
||||
mBGMPsComp_delete_ps_demo(0x41, 0x168);
|
||||
}
|
||||
|
||||
cKF_SkeletonInfo_R_dt(&haniwa->keyframe);
|
||||
ClObjPipe_dt(game, &haniwa->col_pipe);
|
||||
cKF_SkeletonInfo_R_dt(&haniwa->common_actor_class.anime.keyframe);
|
||||
ClObjPipe_dt(game, &haniwa->common_actor_class.col_pipe);
|
||||
}
|
||||
|
||||
#include "../src/ac_haniwa_move.c_inc"
|
||||
|
||||
static void aHNW_actor_draw(ACTOR* actor, GAME* game) {
|
||||
static Gfx hnw_tex_model[] = {
|
||||
gsDPLoadTLUT_Dolphin(15, 16, 1, hnw_face),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
static Gfx hnw_tex_model[] = {
|
||||
gsDPLoadTLUT_Dolphin(15, 16, 1, hnw_face),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
|
||||
cKF_SkeletonInfo_R_c* keyframe = &haniwa->keyframe;
|
||||
GRAPH* g = game->graph;
|
||||
Mtx* m;
|
||||
|
||||
m = GRAPH_ALLOC_TYPE(g, Mtx, keyframe->skeleton->num_shown_joints);
|
||||
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
|
||||
cKF_SkeletonInfo_R_c* keyframe = &haniwa->common_actor_class.anime.keyframe;
|
||||
GRAPH* g = game->graph;
|
||||
Mtx* m;
|
||||
|
||||
if (m != NULL) {
|
||||
Gfx* gfx;
|
||||
int house_idx = haniwa->house_idx;
|
||||
_texture_z_light_fog_prim(g);
|
||||
m = GRAPH_ALLOC_TYPE(g, Mtx, keyframe->skeleton->num_shown_joints);
|
||||
|
||||
OPEN_DISP(g);
|
||||
gfx = NOW_POLY_OPA_DISP;
|
||||
if (m != NULL) {
|
||||
Gfx* gfx;
|
||||
int house_idx = haniwa->house_idx;
|
||||
_texture_z_light_fog_prim(g);
|
||||
|
||||
gSPSegment(gfx++, G_MWO_SEGMENT_B, hnw_tmem_txt);
|
||||
OPEN_DISP(g);
|
||||
gfx = NOW_POLY_OPA_DISP;
|
||||
|
||||
if (mPr_NullCheckPersonalID(&Save_Get(homes[house_idx]).ownerID) != TRUE &&
|
||||
Common_Get(player_no) == mHS_get_pl_no(house_idx)
|
||||
) {
|
||||
gDPSetPrimColor(gfx++, 0, 128, 255, 255, 255, 255);
|
||||
gSPSegment(gfx++, G_MWO_SEGMENT_B, hnw_tmem_txt);
|
||||
|
||||
if (mPr_NullCheckPersonalID(&Save_Get(homes[house_idx]).ownerID) != TRUE &&
|
||||
Common_Get(player_no) == mHS_get_pl_no(house_idx)) {
|
||||
gDPSetPrimColor(gfx++, 0, 128, 255, 255, 255, 255);
|
||||
} else {
|
||||
gDPSetPrimColor(gfx++, 0, 128, 255, 255, 255, 255);
|
||||
}
|
||||
|
||||
gSPDisplayList(gfx++, hnw_tex_model);
|
||||
|
||||
SET_POLY_OPA_DISP(gfx);
|
||||
CLOSE_DISP(g);
|
||||
|
||||
cKF_Si3_draw_R_SV(game, keyframe, m, NULL, NULL, actor);
|
||||
}
|
||||
else {
|
||||
gDPSetPrimColor(gfx++, 0, 128, 255, 255, 255, 255);
|
||||
}
|
||||
|
||||
gSPDisplayList(gfx++, hnw_tex_model);
|
||||
|
||||
SET_POLY_OPA_DISP(gfx);
|
||||
CLOSE_DISP(g);
|
||||
|
||||
cKF_Si3_draw_R_SV(game, keyframe, m, NULL, NULL, actor);
|
||||
}
|
||||
}
|
||||
|
||||
+19
-17
@@ -646,11 +646,11 @@ static void aHNW_setupAction(ACTOR* actor, GAME* game, int action) {
|
||||
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
|
||||
|
||||
int house_idx = haniwa->house_idx;
|
||||
int animation_state = haniwa->animation_state;
|
||||
int animation_state = haniwa->common_actor_class.anime.anime_no;
|
||||
int no_owner = mPr_NullCheckPersonalID(&Save_Get(homes[house_idx]).ownerID);
|
||||
int owner_is_player = mHS_get_pl_no(house_idx) == Common_Get(player_no);
|
||||
|
||||
haniwa->action = action;
|
||||
haniwa->common_actor_class.act = action;
|
||||
haniwa->action_proc = process[action];
|
||||
|
||||
if (action >= aHNW_ACTION_CHECK_PROCEEDS) {
|
||||
@@ -674,37 +674,39 @@ static void aHNW_setupAction(ACTOR* actor, GAME* game, int action) {
|
||||
}
|
||||
|
||||
if (animation_state == 2) {
|
||||
cKF_SkeletonInfo_R_init(&haniwa->keyframe, haniwa->keyframe.skeleton, &cKF_ba_r_hnw_move, 1.0f, 9.0f, 1.0f,
|
||||
haniwa->anim_frame_speed, 0.0f, cKF_FRAMECONTROL_REPEAT, NULL);
|
||||
haniwa->saved_current_frame = haniwa->keyframe.frame_control.current_frame;
|
||||
cKF_SkeletonInfo_R_init(&haniwa->common_actor_class.anime.keyframe,
|
||||
haniwa->common_actor_class.anime.keyframe.skeleton, &cKF_ba_r_hnw_move, 1.0f, 9.0f,
|
||||
1.0f, haniwa->anim_frame_speed, 0.0f, cKF_FRAMECONTROL_REPEAT, NULL);
|
||||
haniwa->common_actor_class.anime.cur_keyframe =
|
||||
haniwa->common_actor_class.anime.keyframe.frame_control.current_frame;
|
||||
}
|
||||
|
||||
haniwa->animation_state = 0;
|
||||
haniwa->common_actor_class.anime.anime_no = 0;
|
||||
aHNW_init_proc(actor, game, action);
|
||||
if (no_owner && action < aHNW_ACTION_CHECK_PROCEEDS) {
|
||||
haniwa->keyframe.frame_control.mode = cKF_FRAMECONTROL_STOP;
|
||||
haniwa->common_actor_class.anime.keyframe.frame_control.mode = cKF_FRAMECONTROL_STOP;
|
||||
} else {
|
||||
haniwa->keyframe.frame_control.mode = cKF_FRAMECONTROL_REPEAT;
|
||||
haniwa->common_actor_class.anime.keyframe.frame_control.mode = cKF_FRAMECONTROL_REPEAT;
|
||||
}
|
||||
}
|
||||
|
||||
static void aHNW_common_process(ACTOR* actor, GAME* game) {
|
||||
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
|
||||
cKF_SkeletonInfo_R_c* keyframe = &haniwa->keyframe;
|
||||
cKF_SkeletonInfo_R_c* keyframe = &haniwa->common_actor_class.anime.keyframe;
|
||||
int house_idx = haniwa->house_idx;
|
||||
int no_owner = mPr_NullCheckPersonalID(&Save_Get(homes[house_idx]).ownerID);
|
||||
f32 target;
|
||||
|
||||
if (no_owner == FALSE && keyframe->frame_control.mode == cKF_FRAMECONTROL_STOP) {
|
||||
aHNW_setupAction((ACTOR*)haniwa, game, haniwa->action);
|
||||
aHNW_setupAction((ACTOR*)haniwa, game, haniwa->common_actor_class.act);
|
||||
keyframe->frame_control.mode = cKF_FRAMECONTROL_REPEAT;
|
||||
} else if (no_owner && haniwa->action < 2 && keyframe->frame_control.speed <= 0.1f) {
|
||||
} else if (no_owner && haniwa->common_actor_class.act < 2 && keyframe->frame_control.speed <= 0.1f) {
|
||||
keyframe->frame_control.mode = cKF_FRAMECONTROL_STOP;
|
||||
} else {
|
||||
keyframe->frame_control.mode = cKF_FRAMECONTROL_REPEAT;
|
||||
}
|
||||
|
||||
if (no_owner == FALSE || haniwa->action >= aHNW_ACTION_CHECK_PROCEEDS) {
|
||||
if (no_owner == FALSE || haniwa->common_actor_class.act >= aHNW_ACTION_CHECK_PROCEEDS) {
|
||||
aHNW_search_player((ACTOR*)haniwa);
|
||||
} else {
|
||||
aHNW_search_front((ACTOR*)haniwa, house_idx);
|
||||
@@ -724,13 +726,13 @@ static void aHNW_common_process(ACTOR* actor, GAME* game) {
|
||||
static void aHNW_actor_move(ACTOR* actor, GAME* game) {
|
||||
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
cKF_SkeletonInfo_R_c* keyframe = &haniwa->keyframe;
|
||||
cKF_SkeletonInfo_R_c* keyframe = &haniwa->common_actor_class.anime.keyframe;
|
||||
|
||||
haniwa->keyframe_state = cKF_SkeletonInfo_R_play(keyframe);
|
||||
haniwa->common_actor_class.anime.state = cKF_SkeletonInfo_R_play(keyframe);
|
||||
(*haniwa->action_proc)((ACTOR*)haniwa, game);
|
||||
aHNW_common_process(actor, game);
|
||||
CollisionCheck_Uty_ActorWorldPosSetPipeC(actor, &haniwa->col_pipe);
|
||||
CollisionCheck_setOC(game, &play->collision_check, &haniwa->col_pipe.collision_obj);
|
||||
CollisionCheck_Uty_ActorWorldPosSetPipeC(actor, &haniwa->common_actor_class.col_pipe);
|
||||
CollisionCheck_setOC(game, &play->collision_check, &haniwa->common_actor_class.col_pipe.collision_obj);
|
||||
Actor_world_to_eye(actor, 50.0f);
|
||||
}
|
||||
|
||||
@@ -743,6 +745,6 @@ static void aHNW_actor_init(ACTOR* actor, GAME* game) {
|
||||
actor->dw_proc = &aHNW_actor_draw;
|
||||
aHNW_setupAction((ACTOR*)haniwa, game,
|
||||
aHNW_ACTION_WAIT); // weird that we have to re-cast to ACTOR so fequently for matches
|
||||
haniwa->keyframe.morph_counter = 0.0f;
|
||||
haniwa->common_actor_class.anime.keyframe.morph_counter = 0.0f;
|
||||
aHNW_actor_move(actor, game);
|
||||
}
|
||||
|
||||
+1
-1
@@ -268,7 +268,7 @@ static void aIGK_move_on_flower(ACTOR* actorx, GAME* game) {
|
||||
aIGK_MOVE_TIMER(insect)--;
|
||||
|
||||
if (aIGK_MOVE_TIMER(insect) <= 0) {
|
||||
sAdo_OngenPos((u32)actorx, NA_SE_A8, &actorx->world.position);
|
||||
sAdo_OngenPos((u32)actorx, NA_SE_GOKI_MOVE, &actorx->world.position);
|
||||
insect->timer = (int)(2 * (90.0f + RANDOM_F(90.0f)));
|
||||
aIGK_setupAction(insect, aIGK_ACTION_WAIT_ON_FLOWER, game);
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -283,7 +283,7 @@ static void aIKA_actor_move(ACTOR* actorx, GAME* game) {
|
||||
aIKA_setupAction(insect, aIKA_ACTION_LET_ESCAPE, game);
|
||||
} else {
|
||||
if (insect->action != aIKA_ACTION_ATTACK) {
|
||||
sAdo_OngenPos((u32)actorx, NA_SE_CF, &actorx->world.position);
|
||||
sAdo_OngenPos((u32)actorx, NA_SE_KA_BUZZ, &actorx->world.position);
|
||||
}
|
||||
|
||||
if (insect->insect_flags.bit_3 == TRUE && insect->insect_flags.bit_2 == FALSE &&
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
static void aCR_set_animation(NPC_CURATOR_ACTOR* curator, int action) {
|
||||
static int animeSeqNo[] = { 5, 5, 9 };
|
||||
static int animeSeqNo[] = { aNPC_ANIM_WAIT1, aNPC_ANIM_WAIT1, aNPC_ANIM_WAIT_NEMU1 };
|
||||
|
||||
(*Common_Get(clip).npc_clip->animation_init_proc)((ACTOR*)curator, animeSeqNo[action], FALSE);
|
||||
}
|
||||
@@ -7,7 +7,7 @@ static void aCR_set_animation(NPC_CURATOR_ACTOR* curator, int action) {
|
||||
static void aCR_set_request_act(NPC_CURATOR_ACTOR* curator) {
|
||||
curator->npc_class.request.act_priority = 4;
|
||||
curator->npc_class.request.act_idx = 16;
|
||||
curator->npc_class.request.act_type = 2;
|
||||
curator->npc_class.request.act_type = aNPC_ACT_TYPE_SEARCH;
|
||||
}
|
||||
|
||||
static int aCR_check_sleep_time() {
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
#include "ac_npc_guide.h"
|
||||
|
||||
#include "m_play.h"
|
||||
#include "m_common_data.h"
|
||||
#include "ac_train_door.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "m_font.h"
|
||||
#include "m_msg.h"
|
||||
#include "m_timeIn_ovl.h"
|
||||
#include "m_ledit_ovl.h"
|
||||
#include "libultra/libultra.h"
|
||||
#include "m_bgm.h"
|
||||
#include "m_soncho.h"
|
||||
|
||||
enum {
|
||||
aNGD_ACTION_ENTER,
|
||||
aNGD_ACTION_APPROACH,
|
||||
aNGD_ACTION_TALK_START_WAIT,
|
||||
aNGD_ACTION_TIME_CHECK,
|
||||
aNGD_ACTION_SDON_AND_PB_WAIT,
|
||||
aNGD_ACTION_TIME_MENU_OPEN_WAIT,
|
||||
aNGD_ACTION_TIME_MENU_CLOSE_WAIT,
|
||||
aNGD_ACTION_MSG_WIN_OPEN_WAIT,
|
||||
aNGD_ACTION_CONFIRM_INPUT_DATA,
|
||||
aNGD_ACTION_WAIT_PERMISSION,
|
||||
aNGD_ACTION_SITDOWN,
|
||||
aNGD_ACTION_PNAME_MENU_OPEN_WAIT,
|
||||
aNGD_ACTION_PNAME_MENU_CLOSE_WAIT,
|
||||
aNGD_ACTION_SEX_SELECT_WAIT,
|
||||
aNGD_ACTION_SEX_SELECT_WAIT2,
|
||||
aNGD_ACTION_SEX_SELECT_AFTER,
|
||||
aNGD_ACTION_CNAME_MENU_OPEN_WAIT,
|
||||
aNGD_ACTION_CNAME_MENU_CLOSE_WAIT,
|
||||
aNGD_ACTION_STANDUP_START_WAIT,
|
||||
aNGD_ACTION_STANDUP,
|
||||
aNGD_ACTION_MOVE_READY,
|
||||
aNGD_ACTION_MOVE_TO_AISLE,
|
||||
aNGD_ACTION_MOVE_TO_DOOR,
|
||||
aNGD_ACTION_MOVE_TO_DECK,
|
||||
aNGD_ACTION_KEITAI_ON,
|
||||
aNGD_ACTION_KEITAI_TALK,
|
||||
aNGD_ACTION_KEITAI_OFF,
|
||||
aNGD_ACTION_OPEN_DOOR,
|
||||
aNGD_ACTION_RETURN_APPROACH,
|
||||
aNGD_ACTION_LAST_TALK_START_WAIT,
|
||||
aNGD_ACTION_SITDOWN2_START_WAIT,
|
||||
aNGD_ACTION_SITDOWN2,
|
||||
aNGD_ACTION_LAST_TALK_END_WAIT,
|
||||
aNGD_ACTION_SCENE_CHANGE_WAIT,
|
||||
|
||||
aNGD_ACTION_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
aNGD_OBJ_LOOK_TYPE_NORMAL,
|
||||
aNGD_OBJ_LOOK_TYPE_TALK,
|
||||
|
||||
aNGD_OBJ_LOOK_TYPE_NUM
|
||||
};
|
||||
|
||||
static void aNGD_actor_ct(ACTOR* actorx, GAME* game);
|
||||
static void aNGD_actor_dt(ACTOR* actorx, GAME* game);
|
||||
static void aNGD_actor_init(ACTOR* actorx, GAME* game);
|
||||
static void aNGD_actor_save(ACTOR* actorx, GAME* game);
|
||||
|
||||
// clang-format off
|
||||
ACTOR_PROFILE Npc_Guide_Profile = {
|
||||
mAc_PROFILE_NPC_GUIDE,
|
||||
ACTOR_PART_NPC,
|
||||
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
SP_NPC_GUIDE,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(NPC_GUIDE_ACTOR),
|
||||
&aNGD_actor_ct,
|
||||
&aNGD_actor_dt,
|
||||
&aNGD_actor_init,
|
||||
mActor_NONE_PROC1,
|
||||
&aNGD_actor_save,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
static void aNGD_actor_move(ACTOR* actorx, GAME* game);
|
||||
static void aNGD_actor_draw(ACTOR* actorx, GAME* game);
|
||||
|
||||
static void aNGD_setupAction(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play, int action);
|
||||
|
||||
static void aNGD_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
static aNPC_ct_data_c ct_data = { &aNGD_actor_move, &aNGD_actor_draw, 0, NULL, NULL, NULL, 0 };
|
||||
NPC_GUIDE_ACTOR* guide = (NPC_GUIDE_ACTOR*)actorx;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
PLAYER_ACTOR* player;
|
||||
|
||||
Common_Get(clip).npc_clip->ct_proc(actorx, game, &ct_data);
|
||||
guide->npc_class.condition_info.hide_flg = FALSE; // show guide actor
|
||||
guide->npc_class.condition_info.demo_flg =
|
||||
aNPC_COND_DEMO_SKIP_ENTRANCE_CHECK | aNPC_COND_DEMO_SKIP_HEAD_LOOKAT | aNPC_COND_DEMO_SKIP_TALK_CHECK |
|
||||
aNPC_COND_DEMO_SKIP_ITEM | aNPC_COND_DEMO_SKIP_FORWARD_CHECK | aNPC_COND_DEMO_SKIP_BGCHECK |
|
||||
aNPC_COND_DEMO_SKIP_OBJ_COL_CHECK | aNPC_COND_DEMO_SKIP_MOVE_Y | aNPC_COND_DEMO_SKIP_MOVE_CIRCLE_REV |
|
||||
aNPC_COND_DEMO_SKIP_MOVE_RANGE_CHECK;
|
||||
guide->camera_morph_counter = 40;
|
||||
guide->obj_look_type = aNGD_OBJ_LOOK_TYPE_NORMAL;
|
||||
guide->npc_class.eye_y = 30.0f;
|
||||
guide->camera_move_set_counter = 1;
|
||||
guide->npc_class.palActorIgnoreTimer = -1;
|
||||
guide->train_door_actor = Actor_info_fgName_search(&play->actor_info, TRAIN_DOOR, ACTOR_PART_BG);
|
||||
guide->npc_class.actor_class.shape_info.draw_shadow = TRUE;
|
||||
guide->npc_class.actor_class.world.position.z = 130.0f;
|
||||
|
||||
/* Put the player into demo wait state */
|
||||
mPlib_request_main_demo_wait_type1(game, 0, NULL);
|
||||
player = GET_PLAYER_ACTOR(play);
|
||||
if (player != NULL) {
|
||||
/* Make the player invisible during the intro train ride */
|
||||
player->actor_class.state_bitfield |= ACTOR_STATE_INVISIBLE;
|
||||
}
|
||||
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_ENTER);
|
||||
|
||||
/* Play train noises sfx repeatedly */
|
||||
sAdo_SysLevStart(NA_SE_TRAIN_RIDE);
|
||||
|
||||
/* Disable sunlight */
|
||||
Common_Set(sunlight_flag, FALSE);
|
||||
|
||||
/* Turn on echo for sound effects */
|
||||
sAdo_TrgSeEcho(TRUE);
|
||||
sAdo_LevSeEcho(TRUE);
|
||||
}
|
||||
|
||||
static void aNGD_actor_save(ACTOR* actorx, GAME* game) {
|
||||
Common_Get(clip).npc_clip->save_proc(actorx, game);
|
||||
}
|
||||
|
||||
static void aNGD_actor_dt(ACTOR* actorx, GAME* game) {
|
||||
/* Update all animals in town to have this town's info */
|
||||
mNpc_SetAnimalThisLand(Save_Get(animals), ANIMAL_NUM_MAX);
|
||||
Common_Get(clip).npc_clip->dt_proc(actorx, game);
|
||||
|
||||
/* Stop train noise sfx */
|
||||
sAdo_SysLevStop(NA_SE_TRAIN_RIDE);
|
||||
}
|
||||
|
||||
static void aNGD_actor_init(ACTOR* actorx, GAME* game) {
|
||||
Common_Get(clip).npc_clip->init_proc(actorx, game);
|
||||
}
|
||||
|
||||
static void aNGD_actor_draw(ACTOR* actorx, GAME* game) {
|
||||
Common_Get(clip).npc_clip->draw_proc(actorx, game);
|
||||
}
|
||||
|
||||
#include "../src/ac_npc_guide_animation.c_inc"
|
||||
#include "../src/ac_npc_guide_move.c_inc"
|
||||
@@ -0,0 +1,56 @@
|
||||
typedef struct npc_guide_animation_s {
|
||||
int anim_id;
|
||||
int talk_flag;
|
||||
} aNGD_anime_c;
|
||||
|
||||
static void aNGD_set_animation(NPC_GUIDE_ACTOR* guide, int action) {
|
||||
// clang-format off
|
||||
static aNGD_anime_c anime[] = {
|
||||
{ aNPC_ANIM_OPEN_D1, FALSE },
|
||||
{ aNPC_ANIM_WALK1, FALSE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_SITDOWN_D1, TRUE },
|
||||
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
|
||||
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
|
||||
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
|
||||
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
|
||||
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
|
||||
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
|
||||
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
|
||||
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
|
||||
{ aNPC_ANIM_STANDUP_D1, FALSE },
|
||||
{ aNPC_ANIM_WAIT1, FALSE },
|
||||
{ aNPC_ANIM_WALK1, FALSE },
|
||||
{ aNPC_ANIM_WALK1, FALSE },
|
||||
{ aNPC_ANIM_TO_DECK_D1, FALSE },
|
||||
{ aNPC_ANIM_KEITAI_ON1, FALSE },
|
||||
{ aNPC_ANIM_KEITAI_TALK1, TRUE },
|
||||
{ aNPC_ANIM_KEITAI_OFF1, FALSE },
|
||||
{ aNPC_ANIM_OPEN_D2, FALSE },
|
||||
{ aNPC_ANIM_WALK1, FALSE },
|
||||
{ aNPC_ANIM_WAIT1, FALSE },
|
||||
{ aNPC_ANIM_WAIT1, TRUE },
|
||||
{ aNPC_ANIM_SITDOWN_D1, TRUE },
|
||||
{ aNPC_ANIM_SITDOWN_WAIT_D1, TRUE },
|
||||
{ aNPC_ANIM_SITDOWN_WAIT_D1, FALSE },
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
aNGD_anime_c* anime_info = &anime[action];
|
||||
int anim_id = anime_info->anim_id;
|
||||
int talk_flag = anime_info->talk_flag;
|
||||
|
||||
if ((action == 4 || action == 7 || action == 8) && guide->next_action != 5 && guide->next_action != 6) {
|
||||
anim_id = aNPC_ANIM_SITDOWN_WAIT_D1;
|
||||
talk_flag = TRUE;
|
||||
}
|
||||
|
||||
Common_Get(clip).npc_clip->animation_init_proc(&guide->npc_class.actor_class, anim_id, talk_flag);
|
||||
}
|
||||
@@ -0,0 +1,908 @@
|
||||
static void aNGD_set_camera(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
static s8 mov_def_cnt[] = { 3, 0 };
|
||||
static f32 obj_look_y_max[] = { 30.0f, 20.0f };
|
||||
static f32 obj_look_y_spd[] = { 0.5f, 2.5f };
|
||||
|
||||
xyz_t eye;
|
||||
xyz_t pos;
|
||||
xyz_t ground;
|
||||
s16 move;
|
||||
f32 moveX;
|
||||
f32 moveY;
|
||||
int obj_look_type = guide->obj_look_type;
|
||||
s16 cur_angle;
|
||||
f32 inter;
|
||||
f32 sin;
|
||||
f32 ground_y;
|
||||
s16 angle;
|
||||
|
||||
move = guide->camera_move;
|
||||
guide->camera_move += 0xE20;
|
||||
angle = move;
|
||||
angle += 0xE20;
|
||||
moveX = cos_s(angle) * 0.1f;
|
||||
angle = move;
|
||||
angle += 0xE20;
|
||||
moveY = sin_s(angle) * guide->camera_move_range;
|
||||
|
||||
if (guide->camera_move_y <= 0.0f && moveY >= 0.0f) {
|
||||
s8 cnt = guide->camera_move_cnt;
|
||||
|
||||
cnt--;
|
||||
if (cnt < 0) {
|
||||
s8 set_cnt = guide->camera_move_set_counter;
|
||||
|
||||
set_cnt--;
|
||||
if (set_cnt < 0) {
|
||||
set_cnt = ARRAY_COUNT(mov_def_cnt) - 1;
|
||||
}
|
||||
|
||||
guide->camera_move_set_counter = set_cnt;
|
||||
cnt = mov_def_cnt[set_cnt];
|
||||
guide->camera_move_range = 0.3f;
|
||||
} else {
|
||||
guide->camera_move_range *= 0.35f;
|
||||
}
|
||||
|
||||
guide->camera_move_cnt = cnt;
|
||||
}
|
||||
|
||||
guide->camera_move_y = moveY;
|
||||
cur_angle = guide->camera_tilt_cur_angle;
|
||||
chase_angle(&cur_angle, guide->camera_tilt_goal_angle, guide->camera_tilt_add);
|
||||
guide->camera_tilt_cur_angle = cur_angle;
|
||||
sin = sin_s(cur_angle);
|
||||
|
||||
/* Set camera eye pos */
|
||||
eye.x = moveX + sin * 20.0f + 100.0f;
|
||||
eye.y = moveY + sin * -5.0f + 80.0f;
|
||||
eye.z = 400.0f;
|
||||
|
||||
/* Move NPC head to current target */
|
||||
chase_f(&guide->npc_class.eye_y, obj_look_y_max[obj_look_type], obj_look_y_spd[obj_look_type] * 0.5f);
|
||||
|
||||
/* Set ground pos */
|
||||
ground.x = guide->npc_class.draw.shadow_pos.x;
|
||||
ground.z = guide->npc_class.draw.shadow_pos.z;
|
||||
if (obj_look_type == aNGD_OBJ_LOOK_TYPE_TALK) {
|
||||
/* Use the guide's NPC shadow position for Y */
|
||||
ground_y = guide->npc_class.draw.shadow_pos.y;
|
||||
} else {
|
||||
/* Get the ground position for Y */
|
||||
ground_y = mCoBG_GetBgY_OnlyCenter_FromWpos2(ground, 0.0f);
|
||||
}
|
||||
|
||||
chase_f(&guide->obj_dist_ground, ground_y, 0.5f);
|
||||
ground.y = guide->obj_dist_ground;
|
||||
|
||||
/* Set camera center pos */
|
||||
if (guide->lock_camera_flag == TRUE) {
|
||||
pos.x = ground.x;
|
||||
pos.y = ground.y + guide->npc_class.eye_y;
|
||||
pos.z = ground.z;
|
||||
} else if (mDemo_Check(mDemo_TYPE_SPEAK, &guide->npc_class.actor_class) == TRUE) {
|
||||
int morph_counter = guide->camera_morph_counter;
|
||||
f32 r;
|
||||
|
||||
guide->camera_morph_counter = morph_counter - 1;
|
||||
if ((morph_counter - 1) == 0) {
|
||||
guide->lock_camera_flag = TRUE;
|
||||
}
|
||||
|
||||
r = (40.0f - (f32)(morph_counter - 1)) / 40.0f;
|
||||
inter = cKF_HermitCalc(r, 1.0f, 0.0f, 1.0f, 3.2f, 0.0f);
|
||||
|
||||
pos.x = (ground.x - 90.0f) * inter + 90.0f;
|
||||
pos.y = ((ground.y + guide->npc_class.eye_y) - 80.0f) * inter + 80.0f;
|
||||
pos.z = (ground.z - 280.0f) * inter + 280.0f;
|
||||
} else {
|
||||
/* Default position */
|
||||
pos.x = 90.0f;
|
||||
pos.y = 80.0f;
|
||||
pos.z = 280.0f;
|
||||
}
|
||||
|
||||
pos.x += moveX;
|
||||
pos.y += moveY;
|
||||
|
||||
Camera2_change_priority(play, 0);
|
||||
Camera2_request_main_lock(play, &pos, &eye, 40.0f, 0, 60.0f, 800.0f, 5);
|
||||
}
|
||||
|
||||
static void aNGD_set_camera_eyes(NPC_GUIDE_ACTOR* guide) {
|
||||
if (guide->camera_eyes_flag == TRUE) {
|
||||
guide->npc_class.request.head_pos.x = 100.0f;
|
||||
guide->npc_class.request.head_pos.y = guide->npc_class.actor_class.eye.position.y;
|
||||
guide->npc_class.request.head_pos.z = 400.0f;
|
||||
guide->npc_class.request.head_priority = 3;
|
||||
guide->npc_class.request.head_type = 2;
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_set_walk_spd(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
guide->npc_class.movement.max_speed = 1.0f;
|
||||
guide->npc_class.movement.acceleration = 0.1f;
|
||||
guide->npc_class.movement.deceleration = 0.2f;
|
||||
}
|
||||
|
||||
static void aNGD_set_walk_spd2(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
guide->npc_class.movement.max_speed = 1.5f;
|
||||
guide->npc_class.movement.acceleration = 0.15f;
|
||||
guide->npc_class.movement.deceleration = 0.3f;
|
||||
}
|
||||
|
||||
static void aNGD_set_stop_spd(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
guide->npc_class.actor_class.speed = 0.0f;
|
||||
guide->npc_class.movement.max_speed = 0.0f;
|
||||
guide->npc_class.movement.acceleration = 0.0f;
|
||||
guide->npc_class.movement.deceleration = 0.0f;
|
||||
}
|
||||
|
||||
static int aNGD_make_keitai(NPC_GUIDE_ACTOR* guide, GAME* game) {
|
||||
int res = FALSE;
|
||||
|
||||
if (guide->npc_class.right_hand.item_actor_p == NULL) {
|
||||
if (Common_Get(clip).tools_clip != NULL) {
|
||||
ACTOR* keitai = Common_Get(clip).tools_clip->aTOL_birth_proc(TOOL_KEITAI, aTOL_ACTION_TAKEOUT,
|
||||
&guide->npc_class.actor_class, game, -1, NULL);
|
||||
|
||||
if (keitai != NULL) {
|
||||
guide->npc_class.right_hand.item_actor_p = keitai;
|
||||
res = TRUE;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
res = TRUE;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static int aNGD_chg_cond_keitai(NPC_GUIDE_ACTOR* guide, int cond) {
|
||||
int res = FALSE;
|
||||
|
||||
if (Common_Get(clip).tools_clip != NULL) {
|
||||
if (Common_Get(clip).tools_clip->aTOL_chg_request_mode_proc(
|
||||
&guide->npc_class.actor_class, guide->npc_class.right_hand.item_actor_p, cond) == TRUE) {
|
||||
res = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static void aNGD_talk_demo_proc(ACTOR* actorx) {
|
||||
if (mDemo_Check(mDemo_TYPE_SPEAK, actorx) == TRUE) {
|
||||
Common_Get(clip).npc_clip->talk_demo_proc(actorx);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_check_talk_msg_no(NPC_GUIDE_ACTOR* guide) {
|
||||
if (mDemo_Check(mDemo_TYPE_SPEAK, &guide->npc_class.actor_class) == TRUE) {
|
||||
int msg_no = mMsg_GET_MSG_NUM();
|
||||
int flags;
|
||||
|
||||
switch (msg_no) {
|
||||
case 0x2AC9:
|
||||
flags = (1 << 3);
|
||||
break;
|
||||
case 0x2ACD:
|
||||
flags = (1 << 2);
|
||||
break;
|
||||
case 0x2ACF:
|
||||
flags = (1 << 1);
|
||||
break;
|
||||
case 0x2AD3:
|
||||
flags = (1 << 0);
|
||||
break;
|
||||
default:
|
||||
flags = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
guide->answer_flags |= flags;
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_set_pl_face_type(NPC_GUIDE_ACTOR* guide) {
|
||||
static int face_type_table[mPr_SEX_NUM][mPr_FACE_TYPE_NUM] = {
|
||||
/* Male faces */
|
||||
{
|
||||
mPr_FACE_TYPE5,
|
||||
mPr_FACE_TYPE6,
|
||||
mPr_FACE_TYPE1,
|
||||
mPr_FACE_TYPE4,
|
||||
mPr_FACE_TYPE0,
|
||||
mPr_FACE_TYPE2,
|
||||
mPr_FACE_TYPE7,
|
||||
mPr_FACE_TYPE3,
|
||||
},
|
||||
/* Female faces */
|
||||
{
|
||||
mPr_FACE_TYPE0,
|
||||
mPr_FACE_TYPE5,
|
||||
mPr_FACE_TYPE2,
|
||||
mPr_FACE_TYPE6,
|
||||
mPr_FACE_TYPE4,
|
||||
mPr_FACE_TYPE7,
|
||||
mPr_FACE_TYPE3,
|
||||
mPr_FACE_TYPE1,
|
||||
},
|
||||
};
|
||||
|
||||
int answer_flags = guide->answer_flags;
|
||||
int face_type;
|
||||
|
||||
if ((answer_flags & 1) == 0) {
|
||||
/* Select a random face for the player */
|
||||
face_type = RANDOM(mPr_FACE_TYPE_NUM);
|
||||
} else {
|
||||
/* Select a face based on choices */
|
||||
face_type = face_type_table[Now_Private->gender][answer_flags >> 1];
|
||||
}
|
||||
|
||||
Now_Private->face = face_type;
|
||||
}
|
||||
|
||||
static void aNGD_calc_body_angl(NPC_GUIDE_ACTOR* guide, f32 pos_x, f32 pos_z) {
|
||||
f32 dX = pos_x - guide->npc_class.actor_class.world.position.x;
|
||||
f32 dZ = pos_z - guide->npc_class.actor_class.world.position.z;
|
||||
s16 angl = atans_table(dZ, dX);
|
||||
|
||||
chase_angle(&guide->npc_class.actor_class.shape_info.rotation.y, angl, DEG2SHORT_ANGLE2(11.25f));
|
||||
guide->npc_class.actor_class.world.angle.y = guide->npc_class.actor_class.shape_info.rotation.y;
|
||||
}
|
||||
|
||||
static void aNGD_set_default_talk_info(void) {
|
||||
mDemo_Set_camera(CAMERA2_PROCESS_NUM);
|
||||
mDemo_Set_talk_change_player(FALSE);
|
||||
mDemo_Set_use_zoom_sound(TRUE);
|
||||
}
|
||||
|
||||
static void aNGD_enter(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
if (guide->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
|
||||
guide->camera_eyes_flag = TRUE;
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_APPROACH);
|
||||
} else if (cKF_FrameControl_passCheck_now(&guide->npc_class.draw.main_animation.keyframe.frame_control, 20.0f) ==
|
||||
TRUE) {
|
||||
TRAINDOOR_ACTOR* train_door = (TRAINDOOR_ACTOR*)guide->train_door_actor;
|
||||
|
||||
train_door->open_flag = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_approach(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
if (guide->npc_class.actor_class.world.position.z >= 290.0f) {
|
||||
guide->npc_class.actor_class.world.position.z = 290.0f;
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_TALK_START_WAIT);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_set_talk_info_talk_start_wait(ACTOR* actorx) {
|
||||
mDemo_Set_msg_num(0x2AC6);
|
||||
aNGD_set_default_talk_info();
|
||||
((NPC_GUIDE_ACTOR*)actorx)->obj_look_type = aNGD_OBJ_LOOK_TYPE_TALK;
|
||||
}
|
||||
|
||||
static void aNGD_talk_start_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
ACTOR* actorx = (ACTOR*)guide;
|
||||
|
||||
if (mDemo_Check(mDemo_TYPE_SPEAK, actorx) == TRUE) {
|
||||
if (mDemo_Check_ListenAble() == FALSE &&
|
||||
chase_angle(&actorx->shape_info.rotation.y, actorx->player_angle_y, 0x400) == TRUE) {
|
||||
guide->camera_eyes_flag = FALSE;
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_TIME_CHECK);
|
||||
mDemo_Set_ListenAble();
|
||||
}
|
||||
} else {
|
||||
mDemo_Request(mDemo_TYPE_SPEAK, actorx, &aNGD_set_talk_info_talk_start_wait);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_time_check(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
if (mMsg_CHECK_MAINNORMALCONTINUE() == TRUE) {
|
||||
switch (mChoice_GET_CHOSENUM()) {
|
||||
case mChoice_CHOICE0:
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_WAIT_PERMISSION);
|
||||
break;
|
||||
case mChoice_CHOICE1:
|
||||
guide->next_action = aNGD_ACTION_TIME_MENU_OPEN_WAIT;
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_SDON_AND_PB_WAIT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_sdon_and_pb_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
u16 order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
|
||||
|
||||
if (order != 0 && mMsg_CHECK_MAINNORMALCONTINUE()) {
|
||||
aNGD_setupAction(guide, play, guide->next_action);
|
||||
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_time_menu_open_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
if (mMsg_CHECK_MAIN_WAIT() == TRUE) {
|
||||
aNGD_setupAction(guide, play, guide->action + 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_time_menu_close_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
if (play->submenu.open_flag == FALSE) {
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_MSG_WIN_OPEN_WAIT);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_msg_win_open_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
static int msg_no[] = { 0x2AE5, 0x2ACA, 0x2AE4 };
|
||||
static int next_act_idx[] = {
|
||||
aNGD_ACTION_CONFIRM_INPUT_DATA,
|
||||
aNGD_ACTION_SEX_SELECT_WAIT,
|
||||
aNGD_ACTION_CONFIRM_INPUT_DATA,
|
||||
};
|
||||
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
|
||||
|
||||
if (mMsg_Check_not_series_main_wait(msg_p) == TRUE) {
|
||||
int idx = -1;
|
||||
|
||||
switch (guide->next_action) {
|
||||
case aNGD_ACTION_TIME_MENU_CLOSE_WAIT:
|
||||
idx = 0;
|
||||
break;
|
||||
case aNGD_ACTION_PNAME_MENU_CLOSE_WAIT:
|
||||
idx = 1;
|
||||
break;
|
||||
case aNGD_ACTION_CNAME_MENU_CLOSE_WAIT:
|
||||
idx = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
if (idx >= 0) {
|
||||
mMsg_Unset_LockContinue(msg_p);
|
||||
mMsg_Set_continue_msg_num(msg_p, msg_no[idx]);
|
||||
mMsg_Set_ForceNext(msg_p);
|
||||
aNGD_setupAction(guide, play, next_act_idx[idx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_confirm_input_data(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
if (mMsg_CHECK_MAINNORMALCONTINUE() == TRUE) {
|
||||
switch (mChoice_GET_CHOSENUM()) {
|
||||
case mChoice_CHOICE0:
|
||||
switch (guide->next_action) {
|
||||
case aNGD_ACTION_TIME_MENU_CLOSE_WAIT:
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_WAIT_PERMISSION);
|
||||
break;
|
||||
case aNGD_ACTION_CNAME_MENU_CLOSE_WAIT:
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_STANDUP_START_WAIT);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case mChoice_CHOICE1:
|
||||
switch (guide->next_action) {
|
||||
case aNGD_ACTION_TIME_MENU_CLOSE_WAIT:
|
||||
guide->next_action = aNGD_ACTION_TIME_MENU_OPEN_WAIT;
|
||||
break;
|
||||
case aNGD_ACTION_CNAME_MENU_CLOSE_WAIT:
|
||||
guide->next_action = aNGD_ACTION_CNAME_MENU_OPEN_WAIT;
|
||||
break;
|
||||
}
|
||||
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_SDON_AND_PB_WAIT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_wait_permission(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
if (mMsg_CHECK_MAINNORMALCONTINUE() == TRUE) {
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_SITDOWN);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_sitdown(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
guide->npc_class.actor_class.world.position.x = 100.0f;
|
||||
guide->npc_class.actor_class.world.position.z = 280.0f;
|
||||
guide->npc_class.actor_class.shape_info.rotation.y = 0;
|
||||
|
||||
/* Wait for the sit animation to finish before continuing */
|
||||
if (guide->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
|
||||
mMsg_UNSET_LOCKCONTINUE();
|
||||
guide->next_action = aNGD_ACTION_PNAME_MENU_OPEN_WAIT;
|
||||
Common_Set(sunlight_flag, TRUE); // turn on the sunlight as we exit tunnel
|
||||
/* Turn off echoes since we exited the tunnel */
|
||||
sAdo_TrgSeEcho(FALSE);
|
||||
sAdo_LevSeEcho(FALSE);
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_SDON_AND_PB_WAIT);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_sex_select_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
if (mMsg_CHECK_MAINNORMALCONTINUE() == TRUE) {
|
||||
switch (mChoice_GET_CHOSENUM()) {
|
||||
case mChoice_CHOICE0: // male
|
||||
case mChoice_CHOICE1: // female
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_SEX_SELECT_WAIT2);
|
||||
break;
|
||||
case mChoice_CHOICE2: // 'That's not right'
|
||||
guide->next_action = aNGD_ACTION_PNAME_MENU_OPEN_WAIT;
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_SDON_AND_PB_WAIT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_sex_select_wait2(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
int order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
|
||||
|
||||
if (order != 0 && mMsg_CHECK_MAINNORMALCONTINUE() == TRUE) {
|
||||
switch (mChoice_GET_CHOSENUM()) {
|
||||
case mChoice_CHOICE0: // male
|
||||
switch (order) {
|
||||
case 1: // That's right
|
||||
Now_Private->gender = mPr_SEX_MALE;
|
||||
break;
|
||||
case 2: // I'm not a boy
|
||||
Now_Private->gender = mPr_SEX_FEMALE;
|
||||
break;
|
||||
}
|
||||
|
||||
guide->next_action = aNGD_ACTION_CNAME_MENU_OPEN_WAIT;
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_SDON_AND_PB_WAIT);
|
||||
break;
|
||||
case mChoice_CHOICE1: // female
|
||||
switch (order) {
|
||||
case 1: // That's right
|
||||
Now_Private->gender = mPr_SEX_FEMALE;
|
||||
break;
|
||||
case 2: // I'm not a girl
|
||||
Now_Private->gender = mPr_SEX_MALE;
|
||||
break;
|
||||
}
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_SEX_SELECT_AFTER);
|
||||
break;
|
||||
}
|
||||
|
||||
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_sex_select_after(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
|
||||
u16 order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
|
||||
|
||||
if (order != 0 && mMsg_Check_MainNormalContinue(msg_p)) {
|
||||
mMsg_Set_continue_msg_num(msg_p, 0x2AD8);
|
||||
mMsg_Set_ForceNext(msg_p);
|
||||
guide->next_action = aNGD_ACTION_CNAME_MENU_OPEN_WAIT;
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_SDON_AND_PB_WAIT);
|
||||
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_standup_start_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
/* Wait for guide to stop speaking to us */
|
||||
if (mDemo_Check(mDemo_TYPE_SPEAK, &guide->npc_class.actor_class) == FALSE) {
|
||||
guide->obj_look_type = aNGD_OBJ_LOOK_TYPE_NORMAL;
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_STANDUP);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_standup(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
/* Wait for animation to finish */
|
||||
if (guide->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
|
||||
aNGD_setupAction(guide, play, guide->next_action);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_move_ready(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
guide->npc_class.actor_class.world.position.x = 100.0f;
|
||||
guide->npc_class.actor_class.world.position.z = 300.0f;
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_MOVE_TO_AISLE);
|
||||
}
|
||||
|
||||
static void aNGD_move_to_aisle(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
aNGD_calc_body_angl(guide, 140.0f, 290.0f);
|
||||
if (guide->npc_class.actor_class.world.position.x > 140.0f) {
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_MOVE_TO_DOOR);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_move_to_door(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
aNGD_calc_body_angl(guide, 140.0f, 130.0f);
|
||||
/* Check if we reached the door */
|
||||
if (guide->npc_class.actor_class.world.position.z < 130.0f) {
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_MOVE_TO_DECK);
|
||||
}
|
||||
|
||||
/* Check if we should start rotating */
|
||||
if (guide->npc_class.draw.shadow_pos.z < 140.0f) {
|
||||
guide->camera_tilt_goal_angle = DEG2SHORT_ANGLE2(90.0f);
|
||||
guide->camera_tilt_add = DEG2SHORT_ANGLE2(2.8125f);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_move_to_deck(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
if (cKF_FrameControl_passCheck_now(&guide->npc_class.draw.main_animation.keyframe.frame_control, 9.0f) == TRUE) {
|
||||
TRAINDOOR_ACTOR* train_door = (TRAINDOOR_ACTOR*)guide->train_door_actor;
|
||||
|
||||
train_door->open_flag = TRUE;
|
||||
}
|
||||
|
||||
/* Reuse standup state to wait for animation to finish */
|
||||
aNGD_standup(guide, play);
|
||||
}
|
||||
|
||||
static void aNGD_set_talk_info_keitai_on(ACTOR* actorx) {
|
||||
mDemo_Set_msg_num(0x2AD0);
|
||||
aNGD_set_default_talk_info();
|
||||
}
|
||||
|
||||
static void aNGD_keitai_on(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
static f32 anmSpd[] = { 0.0f, 0.5f };
|
||||
int idx = aNGD_make_keitai(guide, &play->game);
|
||||
|
||||
guide->npc_class.draw.main_animation.keyframe.frame_control.speed = anmSpd[idx];
|
||||
if (idx != 0) {
|
||||
if (mDemo_Check(mDemo_TYPE_SPEAK, (ACTOR*)guide) == TRUE) {
|
||||
if (mDemo_Check_ListenAble() == FALSE) {
|
||||
mDemo_Set_ListenAble();
|
||||
}
|
||||
} else {
|
||||
/* Request to start speaking */
|
||||
mDemo_Request(mDemo_TYPE_SPEAK, (ACTOR*)guide, &aNGD_set_talk_info_keitai_on);
|
||||
}
|
||||
}
|
||||
|
||||
/* Wait for animation to finish */
|
||||
if (guide->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_KEITAI_TALK);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_keitai_talk(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
if (mDemo_Check(mDemo_TYPE_SPEAK, &guide->npc_class.actor_class) == FALSE) {
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_KEITAI_OFF);
|
||||
} else if (guide->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
|
||||
Common_Get(clip).npc_clip->animation_init_proc(&guide->npc_class.actor_class, aNPC_ANIM_KEITAI_TALK2, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_open_door(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
chase_angle(&guide->npc_class.actor_class.shape_info.rotation.y, DEG2SHORT_ANGLE2(-180.0f),
|
||||
DEG2SHORT_ANGLE2(0.703125f));
|
||||
if (cKF_FrameControl_passCheck_now(&guide->npc_class.draw.main_animation.keyframe.frame_control, 22.0f) == TRUE) {
|
||||
TRAINDOOR_ACTOR* train_door = (TRAINDOOR_ACTOR*)guide->train_door_actor;
|
||||
|
||||
train_door->open_flag = TRUE;
|
||||
if (guide->npc_class.draw.shadow_pos.z < 140.0f) {
|
||||
guide->camera_tilt_goal_angle = 0;
|
||||
guide->camera_tilt_add = 0x600;
|
||||
}
|
||||
}
|
||||
|
||||
/* Reuse standup state to wait for animation to finish */
|
||||
aNGD_standup(guide, play);
|
||||
}
|
||||
|
||||
static void aNGD_return_approach(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
guide->npc_class.actor_class.world.position.x = 140.0f;
|
||||
guide->npc_class.actor_class.world.angle.y = 0;
|
||||
guide->npc_class.actor_class.shape_info.rotation.y = 0;
|
||||
if (guide->npc_class.actor_class.world.position.z > 290.0f) {
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_LAST_TALK_START_WAIT);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_set_talk_info_last_talk_start_wait(ACTOR* actorx) {
|
||||
mDemo_Set_msg_num(0x2AD1);
|
||||
aNGD_set_default_talk_info();
|
||||
((NPC_GUIDE_ACTOR*)actorx)->obj_look_type = aNGD_OBJ_LOOK_TYPE_TALK;
|
||||
}
|
||||
|
||||
static void aNGD_last_talk_start_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
ACTOR* actorx = (ACTOR*)guide;
|
||||
|
||||
if (mDemo_Check(mDemo_TYPE_SPEAK, actorx) == TRUE) {
|
||||
if (mDemo_Check_ListenAble() == FALSE &&
|
||||
chase_angle(&actorx->shape_info.rotation.y, actorx->player_angle_y, 0x400) == TRUE) {
|
||||
guide->camera_eyes_flag = FALSE;
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_SITDOWN2_START_WAIT);
|
||||
mDemo_Set_ListenAble();
|
||||
}
|
||||
} else {
|
||||
mDemo_Request(mDemo_TYPE_SPEAK, actorx, &aNGD_set_talk_info_last_talk_start_wait);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_sitdown2_start_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
u16 order = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
|
||||
|
||||
if (order != 0) {
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_SITDOWN2);
|
||||
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_sitdown2(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
guide->npc_class.actor_class.world.position.x = 100.0f;
|
||||
guide->npc_class.actor_class.world.position.z = 280.0f;
|
||||
guide->npc_class.actor_class.shape_info.rotation.y = 0;
|
||||
|
||||
/* Wait for animation to finish */
|
||||
aNGD_standup(guide, play);
|
||||
}
|
||||
|
||||
static void aNGD_last_talk_end_wait(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
if (mDemo_Check(mDemo_TYPE_SPEAK, &guide->npc_class.actor_class) == FALSE) {
|
||||
aNGD_setupAction(guide, play, aNGD_ACTION_SCENE_CHANGE_WAIT);
|
||||
}
|
||||
}
|
||||
|
||||
/* Init procs */
|
||||
|
||||
static void aNGD_time_menu_open_wait_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
|
||||
|
||||
mMsg_Set_LockContinue(msg_p);
|
||||
mMsg_request_main_disappear_wait_type1(msg_p);
|
||||
guide->next_action = aNGD_ACTION_TIME_MENU_CLOSE_WAIT;
|
||||
}
|
||||
|
||||
static void aNGD_time_menu_close_wait_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
Submenu* submenu = &play->submenu;
|
||||
|
||||
switch (guide->next_action) {
|
||||
case aNGD_ACTION_TIME_MENU_CLOSE_WAIT:
|
||||
mSM_open_submenu(submenu, mSM_OVL_TIMEIN, mTI_OVL_OPEN_INITIAL, 0);
|
||||
break;
|
||||
case aNGD_ACTION_PNAME_MENU_CLOSE_WAIT:
|
||||
mSM_open_submenu(submenu, mSM_OVL_LEDIT, mLE_TYPE_PLAYER_NAME, 0);
|
||||
break;
|
||||
case aNGD_ACTION_CNAME_MENU_CLOSE_WAIT:
|
||||
mSM_open_submenu(submenu, mSM_OVL_LEDIT, mLE_TYPE_COUNTRY_NAME, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void aNGD_msg_win_open_wait_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
mMsg_REQUEST_MAIN_APPEAR_WAIT_TYPE1();
|
||||
}
|
||||
|
||||
static void aNGD_sitdown_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
mMsg_SET_LOCKCONTINUE();
|
||||
}
|
||||
|
||||
static void aNGD_pname_menu_open_wait_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
|
||||
|
||||
mMsg_Set_LockContinue(msg_p);
|
||||
mMsg_request_main_disappear_wait_type1(msg_p);
|
||||
guide->next_action = aNGD_ACTION_PNAME_MENU_CLOSE_WAIT;
|
||||
}
|
||||
|
||||
static void aNGD_cname_menu_open_wait_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
|
||||
|
||||
mMsg_Set_LockContinue(msg_p);
|
||||
mMsg_request_main_disappear_wait_type1(msg_p);
|
||||
guide->next_action = aNGD_ACTION_CNAME_MENU_CLOSE_WAIT;
|
||||
}
|
||||
|
||||
static void aNGD_standup_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
guide->next_action = aNGD_ACTION_MOVE_READY;
|
||||
}
|
||||
|
||||
static void aNGD_move_ready_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
guide->npc_class.draw.main_animation.keyframe.morph_counter = 0.0f;
|
||||
}
|
||||
|
||||
static void aNGD_move_to_aisle_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
aNGD_set_walk_spd2(guide, play);
|
||||
}
|
||||
|
||||
static void aNGD_move_to_deck_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
aNGD_set_stop_spd(guide, play);
|
||||
guide->npc_class.actor_class.world.position.x = 140.0f;
|
||||
guide->npc_class.actor_class.world.position.z = 130.0f;
|
||||
guide->next_action = aNGD_ACTION_KEITAI_ON;
|
||||
}
|
||||
|
||||
static void aNGD_keitai_off_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
aNGD_chg_cond_keitai(guide, aTOL_ACTION_PUTAWAY);
|
||||
guide->next_action = aNGD_ACTION_OPEN_DOOR;
|
||||
}
|
||||
|
||||
static void aNGD_open_door_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
guide->next_action = aNGD_ACTION_RETURN_APPROACH;
|
||||
}
|
||||
|
||||
static void aNGD_return_approach_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
guide->camera_eyes_flag = TRUE;
|
||||
aNGD_set_walk_spd2(guide, play);
|
||||
guide->npc_class.draw.main_animation.keyframe.morph_counter = 0.0f;
|
||||
}
|
||||
|
||||
static void aNGD_sitdown2_start_wait_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
|
||||
}
|
||||
|
||||
static void aNGD_sitdown2_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
guide->npc_class.draw.main_animation.keyframe.morph_counter = 0.0f;
|
||||
guide->next_action = aNGD_ACTION_LAST_TALK_END_WAIT;
|
||||
}
|
||||
|
||||
static void aNGD_last_talk_end_wait_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
aNGD_chg_cond_keitai(guide, aTOL_ACTION_DESTRUCT);
|
||||
guide->npc_class.right_hand.item_actor_p = NULL;
|
||||
}
|
||||
|
||||
static void aNGD_scene_change_wait_init(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play) {
|
||||
u8 term;
|
||||
int town_day;
|
||||
|
||||
/* Init next scene transition */
|
||||
goto_next_scene(play, 0, 1);
|
||||
play->fb_wipe_type = 3;
|
||||
Common_Get(transition).wipe_type = 4;
|
||||
|
||||
/* Clear plant growth renew time */
|
||||
Save_Set(all_grow_renew_time, mTM_rtcTime_clear_code);
|
||||
|
||||
/* Update player ID town info */
|
||||
if (Now_Private != NULL) {
|
||||
mLd_CopyLandName(Now_Private->player_ID.land_name, Save_Get(land_info).name);
|
||||
}
|
||||
|
||||
/* Init island */
|
||||
bcopy(Save_GetPointer(land_info), &Save_Get(island).landinfo, sizeof(mLd_land_info_c)); // Copy the town's land info
|
||||
mNpc_DecideIslandNpc(&Save_Get(island).animal); // Pick islander
|
||||
|
||||
/* Update some renew time values to current rtc time */
|
||||
lbRTC_TimeCopy(Save_GetPointer(last_grow_time), Common_GetPointer(time.rtc_time));
|
||||
mTM_set_renew_time(Save_GetPointer(renew_time), Common_GetPointer(time.rtc_time));
|
||||
mTM_set_season(); // initialize the season
|
||||
|
||||
/* Initialize first Stalk Market info */
|
||||
Kabu_decide_price_schedule();
|
||||
|
||||
/* Init Post Office */
|
||||
mPO_post_office_init();
|
||||
|
||||
/* Set insect term info */
|
||||
Save_Set(insect_term, Common_Get(time.rtc_time.month));
|
||||
Save_Set(insect_term_transition_offset, RANDOM(6));
|
||||
|
||||
/* Set fish term info */
|
||||
term = Common_Get(time.rtc_time.month) * 2;
|
||||
if (Common_Get(time.rtc_time.day) > 15) {
|
||||
term++;
|
||||
}
|
||||
Save_Set(gyoei_term, term);
|
||||
Save_Set(gyoei_term_transition_offset, RANDOM(6));
|
||||
|
||||
/* Decide Town Day date */
|
||||
town_day = 1 + RANDOM(30);
|
||||
if (town_day >= 4) {
|
||||
town_day++; // add one to prevent conflict with Fireworks Festival (4th of July)
|
||||
}
|
||||
Save_Set(town_day, town_day);
|
||||
|
||||
mSP_ShopGameStartCt(NULL);
|
||||
mNtc_SetInitData();
|
||||
mPr_SetNowPrivateCloth();
|
||||
mEv_SetFirstJob();
|
||||
mEv_SetFirstIntro();
|
||||
mEnv_DecideWeather_FirstGameStart();
|
||||
mCD_calendar_clear(-1);
|
||||
mCD_calendar_wellcome_on();
|
||||
mNpc_SetParentNameAllAnimal();
|
||||
aNGD_set_pl_face_type(guide);
|
||||
Common_Set(submenu_disabled, TRUE);
|
||||
mRmTp_SetDefaultLightSwitchData(1);
|
||||
mBGMPsComp_make_ps_wipe(0x41C2);
|
||||
mBGMPsComp_scene_mode(18);
|
||||
}
|
||||
|
||||
typedef void (*aNGD_INIT_PROC)(NPC_GUIDE_ACTOR*, GAME_PLAY*);
|
||||
|
||||
static void aNGD_init_proc(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play, int action) {
|
||||
static aNGD_INIT_PROC init_proc[] = {
|
||||
(aNGD_INIT_PROC)&none_proc1,
|
||||
&aNGD_set_walk_spd,
|
||||
&aNGD_set_stop_spd,
|
||||
(aNGD_INIT_PROC)&none_proc1,
|
||||
(aNGD_INIT_PROC)&none_proc1,
|
||||
&aNGD_time_menu_open_wait_init,
|
||||
&aNGD_time_menu_close_wait_init,
|
||||
&aNGD_msg_win_open_wait_init,
|
||||
(aNGD_INIT_PROC)&none_proc1,
|
||||
(aNGD_INIT_PROC)&none_proc1,
|
||||
&aNGD_sitdown_init,
|
||||
&aNGD_pname_menu_open_wait_init,
|
||||
&aNGD_time_menu_close_wait_init,
|
||||
(aNGD_INIT_PROC)&none_proc1,
|
||||
(aNGD_INIT_PROC)&none_proc1,
|
||||
(aNGD_INIT_PROC)&none_proc1,
|
||||
&aNGD_cname_menu_open_wait_init,
|
||||
&aNGD_time_menu_close_wait_init,
|
||||
(aNGD_INIT_PROC)&none_proc1,
|
||||
&aNGD_standup_init,
|
||||
&aNGD_move_ready_init,
|
||||
&aNGD_move_to_aisle_init,
|
||||
(aNGD_INIT_PROC)&none_proc1,
|
||||
&aNGD_move_to_deck_init,
|
||||
(aNGD_INIT_PROC)&none_proc1,
|
||||
(aNGD_INIT_PROC)&none_proc1,
|
||||
&aNGD_keitai_off_init,
|
||||
&aNGD_open_door_init,
|
||||
&aNGD_return_approach_init,
|
||||
&aNGD_set_stop_spd,
|
||||
&aNGD_sitdown2_start_wait_init,
|
||||
&aNGD_sitdown2_init,
|
||||
&aNGD_last_talk_end_wait_init,
|
||||
&aNGD_scene_change_wait_init,
|
||||
};
|
||||
|
||||
(*init_proc[action])(guide, play);
|
||||
}
|
||||
|
||||
static void aNGD_setupAction(NPC_GUIDE_ACTOR* guide, GAME_PLAY* play, int action) {
|
||||
static aNGD_PROC process[] = {
|
||||
&aNGD_enter,
|
||||
&aNGD_approach,
|
||||
&aNGD_talk_start_wait,
|
||||
&aNGD_time_check,
|
||||
&aNGD_sdon_and_pb_wait,
|
||||
&aNGD_time_menu_open_wait,
|
||||
&aNGD_time_menu_close_wait,
|
||||
&aNGD_msg_win_open_wait,
|
||||
&aNGD_confirm_input_data,
|
||||
&aNGD_wait_permission,
|
||||
&aNGD_sitdown,
|
||||
&aNGD_time_menu_open_wait,
|
||||
&aNGD_time_menu_close_wait,
|
||||
&aNGD_sex_select_wait,
|
||||
&aNGD_sex_select_wait2,
|
||||
&aNGD_sex_select_after,
|
||||
&aNGD_time_menu_open_wait,
|
||||
&aNGD_time_menu_close_wait,
|
||||
&aNGD_standup_start_wait,
|
||||
&aNGD_standup,
|
||||
&aNGD_move_ready,
|
||||
&aNGD_move_to_aisle,
|
||||
&aNGD_move_to_door,
|
||||
&aNGD_move_to_deck,
|
||||
&aNGD_keitai_on,
|
||||
&aNGD_keitai_talk,
|
||||
&aNGD_standup,
|
||||
&aNGD_open_door,
|
||||
&aNGD_return_approach,
|
||||
&aNGD_last_talk_start_wait,
|
||||
&aNGD_sitdown2_start_wait,
|
||||
&aNGD_sitdown2,
|
||||
&aNGD_last_talk_end_wait,
|
||||
(aNGD_PROC)&none_proc1,
|
||||
};
|
||||
|
||||
guide->action = action;
|
||||
guide->proc = process[action];
|
||||
aNGD_set_animation(guide, action);
|
||||
aNGD_init_proc(guide, play, action);
|
||||
}
|
||||
|
||||
static void aNGD_actor_move(ACTOR* actorx, GAME* game) {
|
||||
NPC_GUIDE_ACTOR* guide = (NPC_GUIDE_ACTOR*)actorx;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
Common_Get(clip).npc_clip->move_before_proc(actorx, game);
|
||||
aNGD_talk_demo_proc(actorx);
|
||||
aNGD_check_talk_msg_no(guide);
|
||||
(*guide->proc)(guide, play);
|
||||
Common_Get(clip).npc_clip->move_after_proc(actorx, game);
|
||||
aNGD_set_camera(guide, play);
|
||||
aNGD_set_camera_eyes(guide);
|
||||
mSC_change_player_freeze(play);
|
||||
}
|
||||
+952
-1125
File diff suppressed because it is too large
Load Diff
+109
-122
@@ -6,26 +6,14 @@
|
||||
#include "m_rcp.h"
|
||||
#include "m_common_data.h"
|
||||
|
||||
enum {
|
||||
aTKT_ACTION_WAIT,
|
||||
aTKT_ACTION_TAKEOUT,
|
||||
aTKT_ACTION_PUTAWAY,
|
||||
aTKT_ACTION_DESTRUCT,
|
||||
aTKT_ACTION_TAKEOUT2,
|
||||
aTKT_ACTION_DELETED // Placeholder. Unknown use.
|
||||
};
|
||||
|
||||
extern cKF_Animation_R_c cKF_ba_r_tol_keitai_1_keitai_on1;
|
||||
extern cKF_Animation_R_c cKF_ba_r_tol_keitai_1_keitai_off1;
|
||||
extern cKF_Skeleton_R_c cKF_bs_r_tol_keitai_1;
|
||||
|
||||
KEITAI_ACTION_ANIM aTKT_anm_dt[6] = {
|
||||
{ &cKF_ba_r_tol_keitai_1_keitai_on1, 1.0f, 1.0f },
|
||||
{ &cKF_ba_r_tol_keitai_1_keitai_on1, 1.0f, 68.0f },
|
||||
{ &cKF_ba_r_tol_keitai_1_keitai_off1, 1.0f, 61.0f},
|
||||
{ &cKF_ba_r_tol_keitai_1_keitai_off1, 1.0f, 61.0f},
|
||||
{ &cKF_ba_r_tol_keitai_1_keitai_on1, 1.0f, 68.0f},
|
||||
{ NULL, 0.0f, 0.0f}
|
||||
{ &cKF_ba_r_tol_keitai_1_keitai_on1, 1.0f, 1.0f }, { &cKF_ba_r_tol_keitai_1_keitai_on1, 1.0f, 68.0f },
|
||||
{ &cKF_ba_r_tol_keitai_1_keitai_off1, 1.0f, 61.0f }, { &cKF_ba_r_tol_keitai_1_keitai_off1, 1.0f, 61.0f },
|
||||
{ &cKF_ba_r_tol_keitai_1_keitai_on1, 1.0f, 68.0f }, { NULL, 0.0f, 0.0f },
|
||||
};
|
||||
|
||||
static void aTKT_actor_ct(ACTOR* actor, GAME* game);
|
||||
@@ -33,149 +21,148 @@ static void aTKT_actor_move(ACTOR* actor, GAME* game);
|
||||
static void aTKT_actor_draw(ACTOR* actor, GAME* game);
|
||||
|
||||
ACTOR_PROFILE T_Keitai_Profile = {
|
||||
mAc_PROFILE_T_KEITAI,
|
||||
ACTOR_PART_BG,
|
||||
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_KEITAI,
|
||||
sizeof(KEITAI_ACTOR),
|
||||
&aTKT_actor_ct,
|
||||
NONE_ACTOR_PROC,
|
||||
&aTKT_actor_move,
|
||||
&aTKT_actor_draw,
|
||||
NULL
|
||||
mAc_PROFILE_T_KEITAI,
|
||||
ACTOR_PART_BG,
|
||||
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_KEITAI,
|
||||
sizeof(KEITAI_ACTOR),
|
||||
&aTKT_actor_ct,
|
||||
NONE_ACTOR_PROC,
|
||||
&aTKT_actor_move,
|
||||
&aTKT_actor_draw,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static void aTKT_setupAction(KEITAI_ACTOR* actor, int action);
|
||||
|
||||
static void aTKT_actor_ct(ACTOR* actor, GAME* game) {
|
||||
KEITAI_ACTOR* keitai = (KEITAI_ACTOR*)actor;
|
||||
cKF_SkeletonInfo_R_ct(&keitai->keyframe, &cKF_bs_r_tol_keitai_1, NULL, keitai->work, keitai->morph);
|
||||
keitai->bank_ram_start = ((GAME_PLAY*)game)->object_exchange.banks[actor->data_bank_id].ram_start;
|
||||
aTKT_setupAction(keitai, aTKT_ACTION_TAKEOUT);
|
||||
KEITAI_ACTOR* keitai = (KEITAI_ACTOR*)actor;
|
||||
cKF_SkeletonInfo_R_ct(&keitai->keyframe, &cKF_bs_r_tol_keitai_1, NULL, keitai->work, keitai->morph);
|
||||
keitai->bank_ram_start = ((GAME_PLAY*)game)->object_exchange.banks[actor->data_bank_id].ram_start;
|
||||
aTKT_setupAction(keitai, aTOL_ACTION_TAKEOUT);
|
||||
}
|
||||
|
||||
static void aTKT_calc_scale(ACTOR* actor, int idx) {
|
||||
static f32 start_scale[2] = { 0.0f, 1.0f };
|
||||
static f32 end_scale[2] = { 1.0f, 0.0f };
|
||||
static f32 start_chno[2] = { 10.0f, 33.0f };
|
||||
static f32 end_chno[2] = { 20.0f, 41.0f };
|
||||
static f32 start_scale[2] = { 0.0f, 1.0f };
|
||||
static f32 end_scale[2] = { 1.0f, 0.0f };
|
||||
static f32 start_chno[2] = { 10.0f, 33.0f };
|
||||
static f32 end_chno[2] = { 20.0f, 41.0f };
|
||||
|
||||
f32 current_frame;
|
||||
f32 starting_chno;
|
||||
f32 ending_chno;
|
||||
f32 starting_scale;
|
||||
f32 ending_scale;
|
||||
f32 scale;
|
||||
KEITAI_ACTOR* keitai;
|
||||
f32 current_frame;
|
||||
f32 starting_chno;
|
||||
f32 ending_chno;
|
||||
f32 starting_scale;
|
||||
f32 ending_scale;
|
||||
f32 scale;
|
||||
KEITAI_ACTOR* keitai;
|
||||
|
||||
keitai = (KEITAI_ACTOR*)actor;
|
||||
current_frame = keitai->keyframe.frame_control.current_frame;
|
||||
starting_chno = start_chno[idx];
|
||||
ending_chno = end_chno[idx];
|
||||
starting_scale = start_scale[idx];
|
||||
ending_scale = end_scale[idx];
|
||||
|
||||
if (current_frame < starting_chno) {
|
||||
scale = starting_scale;
|
||||
} else if (current_frame > ending_chno) {
|
||||
scale = ending_scale;
|
||||
} else {
|
||||
scale = starting_scale + ((ending_scale - starting_scale) * ((current_frame - starting_chno) / (ending_chno - starting_chno)));
|
||||
}
|
||||
|
||||
actor->scale.x = scale;
|
||||
actor->scale.y = scale;
|
||||
actor->scale.z = scale;
|
||||
keitai = (KEITAI_ACTOR*)actor;
|
||||
current_frame = keitai->keyframe.frame_control.current_frame;
|
||||
starting_chno = start_chno[idx];
|
||||
ending_chno = end_chno[idx];
|
||||
starting_scale = start_scale[idx];
|
||||
ending_scale = end_scale[idx];
|
||||
|
||||
if (current_frame < starting_chno) {
|
||||
scale = starting_scale;
|
||||
} else if (current_frame > ending_chno) {
|
||||
scale = ending_scale;
|
||||
} else {
|
||||
scale = starting_scale +
|
||||
((ending_scale - starting_scale) * ((current_frame - starting_chno) / (ending_chno - starting_chno)));
|
||||
}
|
||||
|
||||
actor->scale.x = scale;
|
||||
actor->scale.y = scale;
|
||||
actor->scale.z = scale;
|
||||
}
|
||||
|
||||
static void aTKT_takeout(ACTOR* actor) {
|
||||
aTKT_calc_scale(actor, 0);
|
||||
aTKT_calc_scale(actor, 0);
|
||||
}
|
||||
|
||||
static void aTKT_putaway(ACTOR* actor) {
|
||||
aTKT_calc_scale(actor, 1);
|
||||
aTKT_calc_scale(actor, 1);
|
||||
}
|
||||
|
||||
static void aTKT_destruct(ACTOR* actor) {
|
||||
Actor_delete(actor);
|
||||
Actor_delete(actor);
|
||||
}
|
||||
|
||||
static void aTKT_s_takeout(ACTOR* actor) {
|
||||
KEITAI_ACTOR* keitai = (KEITAI_ACTOR*)actor;
|
||||
KEITAI_ACTOR* keitai = (KEITAI_ACTOR*)actor;
|
||||
|
||||
actor->scale.x = 1.0f;
|
||||
actor->scale.y = 1.0f;
|
||||
actor->scale.z = 1.0f;
|
||||
actor->scale.x = 1.0f;
|
||||
actor->scale.y = 1.0f;
|
||||
actor->scale.z = 1.0f;
|
||||
|
||||
keitai->keyframe.frame_control.current_frame = keitai->keyframe.frame_control.end_frame;
|
||||
keitai->keyframe.frame_control.current_frame = keitai->keyframe.frame_control.end_frame;
|
||||
}
|
||||
|
||||
static void aTKT_setupAction(KEITAI_ACTOR* keitai, int action) {
|
||||
static KEITAI_PROC action_process[] = {(KEITAI_PROC)none_proc1, aTKT_takeout, aTKT_putaway, aTKT_destruct, aTKT_s_takeout, NULL};
|
||||
|
||||
KEITAI_ACTION_ANIM *action_anim;
|
||||
f32 starting_frame;
|
||||
f32 ending_frame;
|
||||
static KEITAI_PROC process[] = {
|
||||
(KEITAI_PROC)none_proc1, aTKT_takeout, aTKT_putaway, aTKT_destruct, aTKT_s_takeout, NULL,
|
||||
};
|
||||
|
||||
keitai->action_proc = action_process[action];
|
||||
keitai->action = action;
|
||||
keitai->tools_class.work0 = action;
|
||||
|
||||
action_anim = &aTKT_anm_dt[action];
|
||||
starting_frame = action_anim->start_frame;
|
||||
|
||||
cKF_SkeletonInfo_R_init(
|
||||
&keitai->keyframe, keitai->keyframe.skeleton,
|
||||
action_anim->animation, starting_frame, action_anim->end_frame, starting_frame,
|
||||
0.5f, 0.0f, cKF_FRAMECONTROL_STOP, NULL
|
||||
);
|
||||
KEITAI_ACTION_ANIM* action_anim;
|
||||
f32 starting_frame;
|
||||
f32 ending_frame;
|
||||
|
||||
keitai->action_proc = process[action];
|
||||
keitai->action = action;
|
||||
keitai->tools_class.work0 = action;
|
||||
|
||||
action_anim = &aTKT_anm_dt[action];
|
||||
starting_frame = action_anim->start_frame;
|
||||
|
||||
cKF_SkeletonInfo_R_init(&keitai->keyframe, keitai->keyframe.skeleton, action_anim->animation, starting_frame,
|
||||
action_anim->end_frame, starting_frame, 0.5f, 0.0f, cKF_FRAMECONTROL_STOP, NULL);
|
||||
}
|
||||
|
||||
static void aTKT_actor_move(ACTOR* actor, GAME* game) {
|
||||
KEITAI_ACTOR* keitai = (KEITAI_ACTOR*)actor;
|
||||
int action = keitai->tools_class.work0;
|
||||
if (action != keitai->action) {
|
||||
aTKT_setupAction(keitai, action);
|
||||
}
|
||||
KEITAI_ACTOR* keitai = (KEITAI_ACTOR*)actor;
|
||||
int action = keitai->tools_class.work0;
|
||||
if (action != keitai->action) {
|
||||
aTKT_setupAction(keitai, action);
|
||||
}
|
||||
|
||||
cKF_SkeletonInfo_R_play(&keitai->keyframe);
|
||||
keitai->action_proc(actor);
|
||||
cKF_SkeletonInfo_R_play(&keitai->keyframe);
|
||||
keitai->action_proc(actor);
|
||||
}
|
||||
|
||||
static void aTKT_actor_draw(ACTOR* actor, GAME* game) {
|
||||
cKF_SkeletonInfo_R_c* keyf;
|
||||
GRAPH* graph;
|
||||
Mtx* mtx;
|
||||
Gfx* gfx;
|
||||
KEITAI_ACTOR* keitai;
|
||||
cKF_SkeletonInfo_R_c* keyf;
|
||||
GRAPH* graph;
|
||||
Mtx* mtx;
|
||||
Gfx* gfx;
|
||||
KEITAI_ACTOR* keitai;
|
||||
|
||||
keitai = (KEITAI_ACTOR*)actor;
|
||||
keyf = &keitai->keyframe;
|
||||
graph = game->graph;
|
||||
mtx = GRAPH_ALLOC_TYPE(graph, Mtx, keyf->skeleton->num_shown_joints);
|
||||
keitai = (KEITAI_ACTOR*)actor;
|
||||
keyf = &keitai->keyframe;
|
||||
graph = game->graph;
|
||||
mtx = GRAPH_ALLOC_TYPE(graph, Mtx, keyf->skeleton->num_shown_joints);
|
||||
|
||||
if (mtx != NULL) {
|
||||
if (keitai->tools_class.init_matrix == TRUE) {
|
||||
Matrix_put(&keitai->tools_class.matrix_work);
|
||||
Matrix_Position_Zero(&actor->world.position);
|
||||
keitai->tools_class.init_matrix = FALSE;
|
||||
if (mtx != NULL) {
|
||||
if (keitai->tools_class.init_matrix == TRUE) {
|
||||
Matrix_put(&keitai->tools_class.matrix_work);
|
||||
Matrix_Position_Zero(&actor->world.position);
|
||||
keitai->tools_class.init_matrix = FALSE;
|
||||
} else {
|
||||
Matrix_translate(actor->world.position.x, actor->world.position.y, actor->world.position.z, FALSE);
|
||||
Matrix_scale(0.01f, 0.01f, 0.01f, TRUE);
|
||||
}
|
||||
|
||||
_texture_z_light_fog_prim_npc(graph);
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gfx = NOW_POLY_OPA_DISP;
|
||||
Matrix_scale(actor->scale.x, actor->scale.y, actor->scale.z, TRUE);
|
||||
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
SET_POLY_OPA_DISP(gfx);
|
||||
|
||||
cKF_Si3_draw_R_SV(game, keyf, mtx, NULL, NULL, NULL);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
else {
|
||||
Matrix_translate(actor->world.position.x, actor->world.position.y, actor->world.position.z, FALSE);
|
||||
Matrix_scale(0.01f, 0.01f, 0.01f, TRUE);
|
||||
}
|
||||
|
||||
_texture_z_light_fog_prim_npc(graph);
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gfx = NOW_POLY_OPA_DISP;
|
||||
Matrix_scale(actor->scale.x, actor->scale.y, actor->scale.z, TRUE);
|
||||
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
SET_POLY_OPA_DISP(gfx);
|
||||
|
||||
cKF_Si3_draw_R_SV(game, keyf, mtx, NULL, NULL, NULL);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
}
|
||||
|
||||
+196
-238
@@ -7,31 +7,29 @@
|
||||
#include "m_common_data.h"
|
||||
|
||||
enum {
|
||||
aTUMB_ACTION_TAKEOUT_BEFORE,
|
||||
aTUMB_ACTION_OPENING, // Placeholder. Unknown use.
|
||||
aTUMB_ACTION_DELETED2, // Placeholder. Unknown use.
|
||||
aTUMB_ACTION_DESTRUCT,
|
||||
aTUMB_ACTION_DELETED3, // Placeholder. Unknown use.
|
||||
aTUMB_ACTION_DELETED4 // Placeholder. Unknown use.
|
||||
aTUMB_ACTION_TAKEOUT_BEFORE,
|
||||
aTUMB_ACTION_OPENING, // Placeholder. Unknown use.
|
||||
aTUMB_ACTION_DELETED2, // Placeholder. Unknown use.
|
||||
aTUMB_ACTION_DESTRUCT,
|
||||
aTUMB_ACTION_DELETED3, // Placeholder. Unknown use.
|
||||
aTUMB_ACTION_DELETED4 // Placeholder. Unknown use.
|
||||
};
|
||||
|
||||
static void aTUMB_actor_ct(ACTOR* actor, GAME* game);
|
||||
static void aTUMB_actor_move(ACTOR* actor, GAME* game);
|
||||
static void aTUMB_actor_draw(ACTOR* actor, GAME* game);
|
||||
|
||||
ACTOR_PROFILE T_Umbrella_Profile = {
|
||||
mAc_PROFILE_T_UMBRELLA,
|
||||
ACTOR_PART_BG,
|
||||
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_UMBRELLA,
|
||||
sizeof(UMBRELLA_ACTOR),
|
||||
&aTUMB_actor_ct,
|
||||
NONE_ACTOR_PROC,
|
||||
&aTUMB_actor_move,
|
||||
&aTUMB_actor_draw,
|
||||
NULL
|
||||
};
|
||||
ACTOR_PROFILE T_Umbrella_Profile = { mAc_PROFILE_T_UMBRELLA,
|
||||
ACTOR_PART_BG,
|
||||
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_UMBRELLA,
|
||||
sizeof(UMBRELLA_ACTOR),
|
||||
&aTUMB_actor_ct,
|
||||
NONE_ACTOR_PROC,
|
||||
&aTUMB_actor_move,
|
||||
&aTUMB_actor_draw,
|
||||
NULL };
|
||||
|
||||
extern Gfx e_umb01_model[];
|
||||
extern Gfx kasa_umb01_model[];
|
||||
@@ -103,284 +101,244 @@ extern Gfx kasa_umb_w_model[];
|
||||
static void aTUMB_setupAction(UMBRELLA_ACTOR* umbrella, int action);
|
||||
|
||||
static void aTUMB_actor_ct(ACTOR* actor, GAME* game) {
|
||||
UMBRELLA_ACTOR* umbrella = (UMBRELLA_ACTOR*)actor;
|
||||
aTUMB_setupAction(umbrella, umbrella->tools_class.work0);
|
||||
UMBRELLA_ACTOR* umbrella = (UMBRELLA_ACTOR*)actor;
|
||||
aTUMB_setupAction(umbrella, umbrella->tools_class.work0);
|
||||
}
|
||||
|
||||
static void aTUMB_OngenTrgStart_sub(ACTOR* actor, u16 id) {
|
||||
sAdo_OngenTrgStart(id, &actor->world.position);
|
||||
sAdo_OngenTrgStart(id, &actor->world.position);
|
||||
}
|
||||
|
||||
static void aTUMB_OngenTrgStart(ACTOR* actor, int idx) {
|
||||
switch(idx) {
|
||||
case 1:
|
||||
aTUMB_OngenTrgStart_sub(actor, 0x139);
|
||||
break;
|
||||
case 2:
|
||||
aTUMB_OngenTrgStart_sub(actor, 0x10E);
|
||||
break;
|
||||
}
|
||||
switch (idx) {
|
||||
case 1:
|
||||
aTUMB_OngenTrgStart_sub(actor, 0x139);
|
||||
break;
|
||||
case 2:
|
||||
aTUMB_OngenTrgStart_sub(actor, 0x10E);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void aTUMB_calc_model_scale_sub(xyz_t* scale, UMBRELLA_ACTOR* umbrella, int idx) {
|
||||
static f32 e_open_sect_table[6] = { 0.0f, 7.0f, 11.0f, 18.0f, 22.0f, 26.0f };
|
||||
static f32 e_open_scale_table[12] = {
|
||||
0.0f, 0.0f, 0.0f, 0.0f, 0.5f, 1.0f,0.5f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f
|
||||
};
|
||||
static f32 e_open_sect_table[6] = { 0.0f, 7.0f, 11.0f, 18.0f, 22.0f, 26.0f };
|
||||
static f32 e_open_scale_table[12] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.5f, 1.0f, 0.5f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f };
|
||||
|
||||
static f32 kasa_open_sect_table[4] = { 0.0f, 15.0f, 22.0f, 26.0f };
|
||||
static f32 kasa_open_scale_table[8] = {
|
||||
3.0f, 0.15f, 3.0f, 0.15f, 1.0f, 1.0f, 0.9, 1.0f
|
||||
};
|
||||
static f32 kasa_open_sect_table[4] = { 0.0f, 15.0f, 22.0f, 26.0f };
|
||||
static f32 kasa_open_scale_table[8] = { 3.0f, 0.15f, 3.0f, 0.15f, 1.0f, 1.0f, 0.9, 1.0f };
|
||||
|
||||
static UMBRELLA_DATA_TABLE open_data_table[2] = {
|
||||
{ 6, e_open_sect_table, e_open_scale_table },
|
||||
{ 4, kasa_open_sect_table, kasa_open_scale_table }
|
||||
};
|
||||
static UMBRELLA_DATA_TABLE open_data_table[2] = { { 6, e_open_sect_table, e_open_scale_table },
|
||||
{ 4, kasa_open_sect_table, kasa_open_scale_table } };
|
||||
|
||||
static f32 e_close_sect_table[6] = { 0.0f, 4.0f, 12.0f, 15.0f, 22.0f, 30.0f };
|
||||
static f32 e_close_scale_table[12] = {
|
||||
1.0f, 1.0f, 1.0f, 1.0f, 0.5f, 1.0f, 0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f
|
||||
};
|
||||
static f32 e_close_sect_table[6] = { 0.0f, 4.0f, 12.0f, 15.0f, 22.0f, 30.0f };
|
||||
static f32 e_close_scale_table[12] = { 1.0f, 1.0f, 1.0f, 1.0f, 0.5f, 1.0f, 0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f };
|
||||
|
||||
static f32 kasa_close_sect_table[4] = { 0.0f, 4.0f, 12.0f, 30.0f };
|
||||
static f32 kasa_close_scale_table[8] = {
|
||||
1.0f, 1.0f, 1.2f, 1.0f, 3.0f, 0.15f, 3.0f, 0.15f
|
||||
};
|
||||
static f32 kasa_close_sect_table[4] = { 0.0f, 4.0f, 12.0f, 30.0f };
|
||||
static f32 kasa_close_scale_table[8] = { 1.0f, 1.0f, 1.2f, 1.0f, 3.0f, 0.15f, 3.0f, 0.15f };
|
||||
|
||||
static UMBRELLA_DATA_TABLE close_data_table[2] = {
|
||||
{ 6, e_close_sect_table, e_close_scale_table },
|
||||
{ 4, kasa_close_sect_table, kasa_close_scale_table }
|
||||
};
|
||||
static UMBRELLA_DATA_TABLE close_data_table[2] = { { 6, e_close_sect_table, e_close_scale_table },
|
||||
{ 4, kasa_close_sect_table, kasa_close_scale_table } };
|
||||
|
||||
static UMBRELLA_DATA_TABLE* data_table[6] = {
|
||||
open_data_table, open_data_table, close_data_table, close_data_table, open_data_table, NULL
|
||||
};
|
||||
static UMBRELLA_DATA_TABLE* data_table[6] = { open_data_table, open_data_table, close_data_table,
|
||||
close_data_table, open_data_table, NULL };
|
||||
|
||||
f32 modifier_percentage;
|
||||
f32 base_scale_x;
|
||||
f32 base_scale_y;
|
||||
f32 max_scale_y;
|
||||
f32 max_scale_x;
|
||||
f32 modifier_percentage;
|
||||
f32 base_scale_x;
|
||||
f32 base_scale_y;
|
||||
f32 max_scale_y;
|
||||
f32 max_scale_x;
|
||||
|
||||
int scale_idx_offset;
|
||||
f32* scale_table;
|
||||
int sector_idx;
|
||||
int frame;
|
||||
int corresponding_sector;
|
||||
UMBRELLA_DATA_TABLE *table;
|
||||
f32* sect_table;
|
||||
int scale_idx_offset;
|
||||
f32* scale_table;
|
||||
int sector_idx;
|
||||
int frame;
|
||||
int corresponding_sector;
|
||||
UMBRELLA_DATA_TABLE* table;
|
||||
f32* sect_table;
|
||||
|
||||
corresponding_sector = 0;
|
||||
table = data_table[umbrella->action] + idx;
|
||||
sector_idx = table->table_length - 1;
|
||||
frame = (int)umbrella->frame;
|
||||
sect_table = table->sect_table + 1;
|
||||
corresponding_sector = 0;
|
||||
table = data_table[umbrella->action] + idx;
|
||||
sector_idx = table->table_length - 1;
|
||||
frame = (int)umbrella->frame;
|
||||
sect_table = table->sect_table + 1;
|
||||
|
||||
for(sector_idx; sector_idx > 0; sector_idx--) {
|
||||
if (frame <= (int)sect_table[0]) {
|
||||
frame -= (int)sect_table[-1];
|
||||
break;
|
||||
}
|
||||
for (sector_idx; sector_idx > 0; sector_idx--) {
|
||||
if (frame <= (int)sect_table[0]) {
|
||||
frame -= (int)sect_table[-1];
|
||||
break;
|
||||
}
|
||||
|
||||
sect_table++;
|
||||
corresponding_sector++;
|
||||
}
|
||||
sect_table++;
|
||||
corresponding_sector++;
|
||||
}
|
||||
|
||||
scale_idx_offset = corresponding_sector * 2;
|
||||
scale_table = table->scale_table;
|
||||
base_scale_x = scale_table[scale_idx_offset];
|
||||
modifier_percentage = (f32) frame / (sect_table[0] - sect_table[-1]);
|
||||
base_scale_y = scale_table[scale_idx_offset + 1];
|
||||
max_scale_y = scale_table[scale_idx_offset + 3];
|
||||
max_scale_x = scale_table[scale_idx_offset + 2];
|
||||
scale_idx_offset = corresponding_sector * 2;
|
||||
scale_table = table->scale_table;
|
||||
base_scale_x = scale_table[scale_idx_offset];
|
||||
modifier_percentage = (f32)frame / (sect_table[0] - sect_table[-1]);
|
||||
base_scale_y = scale_table[scale_idx_offset + 1];
|
||||
max_scale_y = scale_table[scale_idx_offset + 3];
|
||||
max_scale_x = scale_table[scale_idx_offset + 2];
|
||||
|
||||
scale->x = base_scale_x + modifier_percentage * (max_scale_x - base_scale_x);
|
||||
scale->y = base_scale_y + modifier_percentage * (max_scale_y - base_scale_y);
|
||||
scale->z = scale->y;
|
||||
scale->x = base_scale_x + modifier_percentage * (max_scale_x - base_scale_x);
|
||||
scale->y = base_scale_y + modifier_percentage * (max_scale_y - base_scale_y);
|
||||
scale->z = scale->y;
|
||||
}
|
||||
|
||||
static void aTUMB_calc_model_scale(UMBRELLA_ACTOR* umbrella) {
|
||||
aTUMB_calc_model_scale_sub(&umbrella->scale_e, umbrella, 0);
|
||||
aTUMB_calc_model_scale_sub(&umbrella->scale_kasa, umbrella, 1);
|
||||
aTUMB_calc_model_scale_sub(&umbrella->scale_e, umbrella, 0);
|
||||
aTUMB_calc_model_scale_sub(&umbrella->scale_kasa, umbrella, 1);
|
||||
}
|
||||
|
||||
static void aTUMB_anime_proc(UMBRELLA_ACTOR* umbrella) {
|
||||
static f32 max_anm[6] = { 0.0f, 26.0f, 30.0f, 30.0f, 26.0f, 0.0f };
|
||||
static f32 max_anm[6] = { 0.0f, 26.0f, 30.0f, 30.0f, 26.0f, 0.0f };
|
||||
|
||||
f32 max_anm_for_action;
|
||||
f32 next_frame;
|
||||
int action;
|
||||
f32 max_anm_for_action;
|
||||
f32 next_frame;
|
||||
int action;
|
||||
|
||||
action = umbrella->action;
|
||||
max_anm_for_action = max_anm[action];
|
||||
next_frame = umbrella->frame;
|
||||
next_frame += 0.5f;
|
||||
action = umbrella->action;
|
||||
max_anm_for_action = max_anm[action];
|
||||
next_frame = umbrella->frame;
|
||||
next_frame += 0.5f;
|
||||
|
||||
if (next_frame >= max_anm_for_action) {
|
||||
next_frame = max_anm_for_action;
|
||||
}
|
||||
if (next_frame >= max_anm_for_action) {
|
||||
next_frame = max_anm_for_action;
|
||||
}
|
||||
|
||||
if (action == aTUMB_ACTION_OPENING) {
|
||||
umbrella->opened_fully = next_frame == max_anm_for_action;
|
||||
}
|
||||
if (action == aTUMB_ACTION_OPENING) {
|
||||
umbrella->opened_fully = next_frame == max_anm_for_action;
|
||||
}
|
||||
|
||||
umbrella->frame = next_frame;
|
||||
aTUMB_calc_model_scale(umbrella);
|
||||
umbrella->frame = next_frame;
|
||||
aTUMB_calc_model_scale(umbrella);
|
||||
}
|
||||
|
||||
static void aTUMB_takeout_before(ACTOR* actor) {
|
||||
UMBRELLA_ACTOR* umbrella = (UMBRELLA_ACTOR*)actor;
|
||||
if (umbrella->tools_class.unk1BC == TRUE) {
|
||||
aTUMB_setupAction(umbrella, aTUMB_ACTION_OPENING);
|
||||
}
|
||||
UMBRELLA_ACTOR* umbrella = (UMBRELLA_ACTOR*)actor;
|
||||
if (umbrella->tools_class.unk1BC == TRUE) {
|
||||
aTUMB_setupAction(umbrella, aTUMB_ACTION_OPENING);
|
||||
}
|
||||
}
|
||||
|
||||
static void aTUMB_destruct(ACTOR* actor) {
|
||||
Actor_delete(actor);
|
||||
Actor_delete(actor);
|
||||
}
|
||||
|
||||
void aTUMB_setupAction(UMBRELLA_ACTOR* umbrella, int action) {
|
||||
static UMBRELLA_PROC process[] = {
|
||||
aTUMB_takeout_before, (UMBRELLA_PROC)none_proc1, (UMBRELLA_PROC)none_proc1, aTUMB_destruct, (UMBRELLA_PROC)none_proc1, NULL
|
||||
};
|
||||
static UMBRELLA_PROC process[] = { aTUMB_takeout_before, (UMBRELLA_PROC)none_proc1, (UMBRELLA_PROC)none_proc1,
|
||||
aTUMB_destruct, (UMBRELLA_PROC)none_proc1, NULL };
|
||||
|
||||
f32 frame;
|
||||
f32 frame;
|
||||
|
||||
umbrella->action_proc = process[action];
|
||||
umbrella->action = action;
|
||||
umbrella->tools_class.work0 = action;
|
||||
|
||||
aTUMB_OngenTrgStart(&umbrella->tools_class.actor_class, action);
|
||||
umbrella->action_proc = process[action];
|
||||
umbrella->action = action;
|
||||
umbrella->tools_class.work0 = action;
|
||||
|
||||
if (action == aTUMB_ACTION_DELETED3) {
|
||||
umbrella->opened_fully = TRUE;
|
||||
frame = 26.0f;
|
||||
} else {
|
||||
frame = 0.0f;
|
||||
}
|
||||
aTUMB_OngenTrgStart(&umbrella->tools_class.actor_class, action);
|
||||
|
||||
umbrella->frame = frame;
|
||||
if (action == aTUMB_ACTION_DELETED3) {
|
||||
umbrella->opened_fully = TRUE;
|
||||
frame = 26.0f;
|
||||
} else {
|
||||
frame = 0.0f;
|
||||
}
|
||||
|
||||
umbrella->frame = frame;
|
||||
}
|
||||
|
||||
static void aTUMB_actor_move(ACTOR* actor, GAME* game) {
|
||||
UMBRELLA_ACTOR* umbrella;
|
||||
int action;
|
||||
UMBRELLA_ACTOR* umbrella;
|
||||
int action;
|
||||
|
||||
umbrella = (UMBRELLA_ACTOR*)actor;
|
||||
action = umbrella->tools_class.work0;
|
||||
umbrella = (UMBRELLA_ACTOR*)actor;
|
||||
action = umbrella->tools_class.work0;
|
||||
|
||||
if (action != umbrella->action) {
|
||||
aTUMB_setupAction(umbrella, action);
|
||||
}
|
||||
if (action != umbrella->action) {
|
||||
aTUMB_setupAction(umbrella, action);
|
||||
}
|
||||
|
||||
if (umbrella->action != aTUMB_ACTION_DESTRUCT) {
|
||||
aTUMB_anime_proc(umbrella);
|
||||
}
|
||||
if (umbrella->action != aTUMB_ACTION_DESTRUCT) {
|
||||
aTUMB_anime_proc(umbrella);
|
||||
}
|
||||
|
||||
umbrella->action_proc(actor);
|
||||
umbrella->action_proc(actor);
|
||||
}
|
||||
|
||||
static void aTUMB_actor_draw(ACTOR* actor, GAME* game) {
|
||||
static UMBRELLA_MODEL draw_dt[40] = {
|
||||
{ e_umb01_model, kasa_umb01_model },
|
||||
{ e_umb02_model, kasa_umb02_model },
|
||||
{ e_umb03_model, kasa_umb03_model },
|
||||
{ e_umb04_model, kasa_umb04_model },
|
||||
{ e_umb05_model, kasa_umb05_model },
|
||||
{ e_umb06_model, kasa_umb06_model },
|
||||
{ e_umb07_model, kasa_umb07_model },
|
||||
{ e_umb08_model, kasa_umb08_model },
|
||||
{ e_umb09_model, kasa_umb09_model },
|
||||
{ e_umb10_model, kasa_umb10_model },
|
||||
{ e_umb11_model, kasa_umb11_model },
|
||||
{ e_umb12_model, kasa_umb12_model },
|
||||
{ e_umb13_model, kasa_umb13_model },
|
||||
{ e_umb14_model, kasa_umb14_model },
|
||||
{ e_umb15_model, kasa_umb15_model },
|
||||
{ e_umb16_model, kasa_umb16_model },
|
||||
{ e_umb17_model, kasa_umb17_model },
|
||||
{ e_umb18_model, kasa_umb18_model },
|
||||
{ e_umb19_model, kasa_umb19_model },
|
||||
{ e_umb20_model, kasa_umb20_model },
|
||||
{ e_umb21_model, kasa_umb21_model },
|
||||
{ e_umb22_model, kasa_umb22_model },
|
||||
{ e_umb23_model, kasa_umb23_model },
|
||||
{ e_umb24_model, kasa_umb24_model },
|
||||
{ e_umb25_model, kasa_umb25_model },
|
||||
{ e_umb26_model, kasa_umb26_model },
|
||||
{ e_umb27_model, kasa_umb27_model },
|
||||
{ e_umb28_model, kasa_umb28_model },
|
||||
{ e_umb29_model, kasa_umb29_model },
|
||||
{ e_umb30_model, kasa_umb30_model },
|
||||
{ e_umb31_model, kasa_umb31_model },
|
||||
{ e_umb32_model, kasa_umb32_model },
|
||||
{ e_umb_w_model, kasa_umb_w_model },
|
||||
{ e_umb_w_model, kasa_umb_w_model },
|
||||
{ e_umb_w_model, kasa_umb_w_model },
|
||||
{ e_umb_w_model, kasa_umb_w_model },
|
||||
{ e_umb_w_model, kasa_umb_w_model },
|
||||
{ e_umb_w_model, kasa_umb_w_model },
|
||||
{ e_umb_w_model, kasa_umb_w_model },
|
||||
{ e_umb_w_model, kasa_umb_w_model }
|
||||
};
|
||||
static UMBRELLA_MODEL draw_dt[40] = {
|
||||
{ e_umb01_model, kasa_umb01_model }, { e_umb02_model, kasa_umb02_model }, { e_umb03_model, kasa_umb03_model },
|
||||
{ e_umb04_model, kasa_umb04_model }, { e_umb05_model, kasa_umb05_model }, { e_umb06_model, kasa_umb06_model },
|
||||
{ e_umb07_model, kasa_umb07_model }, { e_umb08_model, kasa_umb08_model }, { e_umb09_model, kasa_umb09_model },
|
||||
{ e_umb10_model, kasa_umb10_model }, { e_umb11_model, kasa_umb11_model }, { e_umb12_model, kasa_umb12_model },
|
||||
{ e_umb13_model, kasa_umb13_model }, { e_umb14_model, kasa_umb14_model }, { e_umb15_model, kasa_umb15_model },
|
||||
{ e_umb16_model, kasa_umb16_model }, { e_umb17_model, kasa_umb17_model }, { e_umb18_model, kasa_umb18_model },
|
||||
{ e_umb19_model, kasa_umb19_model }, { e_umb20_model, kasa_umb20_model }, { e_umb21_model, kasa_umb21_model },
|
||||
{ e_umb22_model, kasa_umb22_model }, { e_umb23_model, kasa_umb23_model }, { e_umb24_model, kasa_umb24_model },
|
||||
{ e_umb25_model, kasa_umb25_model }, { e_umb26_model, kasa_umb26_model }, { e_umb27_model, kasa_umb27_model },
|
||||
{ e_umb28_model, kasa_umb28_model }, { e_umb29_model, kasa_umb29_model }, { e_umb30_model, kasa_umb30_model },
|
||||
{ e_umb31_model, kasa_umb31_model }, { e_umb32_model, kasa_umb32_model }, { e_umb_w_model, kasa_umb_w_model },
|
||||
{ e_umb_w_model, kasa_umb_w_model }, { e_umb_w_model, kasa_umb_w_model }, { e_umb_w_model, kasa_umb_w_model },
|
||||
{ e_umb_w_model, kasa_umb_w_model }, { e_umb_w_model, kasa_umb_w_model }, { e_umb_w_model, kasa_umb_w_model },
|
||||
{ e_umb_w_model, kasa_umb_w_model },
|
||||
};
|
||||
|
||||
UMBRELLA_ACTOR* umbrella;
|
||||
GRAPH* graph;
|
||||
int umbrella_design_index;
|
||||
int umbrella_name;
|
||||
int tool_name;
|
||||
UMBRELLA_MODEL* umbrella_model;
|
||||
ACTOR* parent;
|
||||
Gfx* gfx;
|
||||
UMBRELLA_ACTOR* umbrella;
|
||||
GRAPH* graph;
|
||||
int umbrella_design_index;
|
||||
int umbrella_name;
|
||||
int tool_name;
|
||||
UMBRELLA_MODEL* umbrella_model;
|
||||
ACTOR* parent;
|
||||
Gfx* gfx;
|
||||
|
||||
umbrella = (UMBRELLA_ACTOR*)actor;
|
||||
parent = actor->parent_actor;
|
||||
tool_name = umbrella->tools_class.tool_name;
|
||||
graph = game->graph;
|
||||
umbrella_model = &draw_dt[tool_name];
|
||||
umbrella = (UMBRELLA_ACTOR*)actor;
|
||||
parent = actor->parent_actor;
|
||||
tool_name = umbrella->tools_class.tool_name;
|
||||
graph = game->graph;
|
||||
umbrella_model = &draw_dt[tool_name];
|
||||
|
||||
if (parent->drawn == FALSE || umbrella->tools_class.init_matrix == FALSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
Matrix_put(&umbrella->tools_class.matrix_work);
|
||||
Matrix_Position_Zero(&umbrella->tools_class.actor_class.world.position);
|
||||
|
||||
umbrella->tools_class.init_matrix = FALSE;
|
||||
umbrella->tools_class.unk1BC = TRUE;
|
||||
|
||||
_texture_z_light_fog_prim_npc(graph);
|
||||
|
||||
OPEN_DISP(graph);
|
||||
gfx = NOW_POLY_OPA_DISP;
|
||||
|
||||
Matrix_rotateXYZ(0, -0x4000, 0, TRUE);
|
||||
Matrix_scale(umbrella->scale_e.x, umbrella->scale_e.y, umbrella->scale_e.z, TRUE);
|
||||
|
||||
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gfx++, umbrella_model->model_e);
|
||||
|
||||
Matrix_translate(4500.0f, 0.0f, 0.0f, TRUE);
|
||||
Matrix_scale(umbrella->scale_kasa.x, umbrella->scale_kasa.y, umbrella->scale_kasa.z, TRUE);
|
||||
|
||||
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
if (tool_name >= TOOL_UMBRELLA32) {
|
||||
umbrella_name = tool_name - TOOL_UMBRELLA32;
|
||||
if (parent->part == ACTOR_PART_PLAYER) {
|
||||
umbrella_name = (umbrella_name & 7);
|
||||
gSPSegment(gfx++, G_MWO_SEGMENT_8, mNW_PaletteIdx2Palette(Player_Palette_Get(umbrella_name)));
|
||||
gSPSegment(gfx++, G_MWO_SEGMENT_9, Player_Design_Get(umbrella_name));
|
||||
if (parent->drawn == FALSE || umbrella->tools_class.init_matrix == FALSE) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
umbrella_name = umbrella_name & 3;
|
||||
gSPSegment(gfx++, G_MWO_SEGMENT_8, mNW_PaletteIdx2Palette(Able_Sisters_Umbrella_Palette_Get(umbrella_name)));
|
||||
gSPSegment(gfx++, G_MWO_SEGMENT_9, Able_Sisters_Umbrella_Design_Get(umbrella_name));
|
||||
}
|
||||
}
|
||||
|
||||
gSPDisplayList(gfx++, umbrella_model->model_kasa);
|
||||
SET_POLY_OPA_DISP(gfx);
|
||||
CLOSE_DISP(graph);
|
||||
Matrix_put(&umbrella->tools_class.matrix_work);
|
||||
Matrix_Position_Zero(&umbrella->tools_class.actor_class.world.position);
|
||||
|
||||
umbrella->tools_class.init_matrix = FALSE;
|
||||
umbrella->tools_class.unk1BC = TRUE;
|
||||
|
||||
_texture_z_light_fog_prim_npc(graph);
|
||||
|
||||
OPEN_DISP(graph);
|
||||
gfx = NOW_POLY_OPA_DISP;
|
||||
|
||||
Matrix_rotateXYZ(0, -0x4000, 0, TRUE);
|
||||
Matrix_scale(umbrella->scale_e.x, umbrella->scale_e.y, umbrella->scale_e.z, TRUE);
|
||||
|
||||
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gfx++, umbrella_model->model_e);
|
||||
|
||||
Matrix_translate(4500.0f, 0.0f, 0.0f, TRUE);
|
||||
Matrix_scale(umbrella->scale_kasa.x, umbrella->scale_kasa.y, umbrella->scale_kasa.z, TRUE);
|
||||
|
||||
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
if (tool_name >= TOOL_ORG_UMBRELLA0) {
|
||||
umbrella_name = tool_name - TOOL_ORG_UMBRELLA0;
|
||||
if (parent->part == ACTOR_PART_PLAYER) {
|
||||
umbrella_name = (umbrella_name & 7);
|
||||
gSPSegment(gfx++, G_MWO_SEGMENT_8, mNW_PaletteIdx2Palette(Player_Palette_Get(umbrella_name)));
|
||||
gSPSegment(gfx++, G_MWO_SEGMENT_9, Player_Design_Get(umbrella_name));
|
||||
} else {
|
||||
umbrella_name = umbrella_name & 3;
|
||||
gSPSegment(gfx++, G_MWO_SEGMENT_8,
|
||||
mNW_PaletteIdx2Palette(Able_Sisters_Umbrella_Palette_Get(umbrella_name)));
|
||||
gSPSegment(gfx++, G_MWO_SEGMENT_9, Able_Sisters_Umbrella_Design_Get(umbrella_name));
|
||||
}
|
||||
}
|
||||
|
||||
gSPDisplayList(gfx++, umbrella_model->model_kasa);
|
||||
SET_POLY_OPA_DISP(gfx);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
+51
-61
@@ -10,7 +10,6 @@ static void aTOL_actor_dt(ACTOR*, GAME*);
|
||||
static void aTOL_init_clip_area(GAME* play);
|
||||
static void aTOL_free_clip_area();
|
||||
|
||||
|
||||
ACTOR_PROFILE Tools_Profile = {
|
||||
mAc_PROFILE_TOOLS,
|
||||
ACTOR_PART_CONTROL,
|
||||
@@ -25,124 +24,115 @@ ACTOR_PROFILE Tools_Profile = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
aTOL_Clip_c aTOL_clip;
|
||||
|
||||
|
||||
|
||||
static void aTOL_actor_ct(ACTOR* actor, GAME* game){
|
||||
aTOL_Clip_c aTOL_clip;
|
||||
|
||||
static void aTOL_actor_ct(ACTOR* actor, GAME* game) {
|
||||
aTOL_init_clip_area(game);
|
||||
}
|
||||
|
||||
static void aTOL_actor_dt(ACTOR*, GAME*){
|
||||
|
||||
static void aTOL_actor_dt(ACTOR*, GAME*) {
|
||||
aTOL_free_clip_area();
|
||||
}
|
||||
|
||||
static void aTOL_check_data_bank(int id, ACTOR* actor){
|
||||
|
||||
static void aTOL_check_data_bank(int id, ACTOR* actor) {
|
||||
ACTOR* kill;
|
||||
aTOL_Clip_c* clip;
|
||||
|
||||
if((actor->part == ACTOR_PART_PLAYER) && (id <= 0x1F)){
|
||||
if ((actor->part == ACTOR_PART_PLAYER) && (id <= 0x1F)) {
|
||||
|
||||
clip = Common_Get(clip.tools_clip);
|
||||
|
||||
if(clip->bank_id != -1){
|
||||
if (clip->bank_id != -1) {
|
||||
|
||||
kill = actor->child_actor;
|
||||
|
||||
if((kill != NULL) && (kill->data_bank_id == clip->bank_id)){
|
||||
if ((kill != NULL) && (kill->data_bank_id == clip->bank_id)) {
|
||||
Actor_delete(kill);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static TOOLS_ACTOR* aTOL_birth_proc(int name, int id, TOOLS_ACTOR* tool,
|
||||
GAME_PLAY* play, s16 arg, int* arg5){
|
||||
static ACTOR* aTOL_birth_proc(int name, int id, ACTOR* tool, GAME* game, s16 arg, int* arg5) {
|
||||
static s16 profile_table[] = {
|
||||
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
|
||||
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
|
||||
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
|
||||
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
|
||||
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
|
||||
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
|
||||
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
|
||||
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
|
||||
mAc_PROFILE_T_KEITAI, mAc_PROFILE_T_UTIWA, mAc_PROFILE_T_HANABI, mAc_PROFILE_T_CRACKER, mAc_PROFILE_T_PISTOL,
|
||||
mAc_PROFILE_T_FLAG, mAc_PROFILE_T_TUMBLER, mAc_PROFILE_T_NPCSAO, mAc_PROFILE_T_TAMA, mAc_PROFILE_T_TAMA,
|
||||
mAc_PROFILE_T_TAMA, mAc_PROFILE_T_TAMA, mAc_PROFILE_T_ANRIUM1, mAc_PROFILE_T_BAG1, mAc_PROFILE_T_BAG2,
|
||||
mAc_PROFILE_T_BISCUS1, mAc_PROFILE_T_BISCUS2, mAc_PROFILE_T_BISCUS3, mAc_PROFILE_T_BISCUS4, mAc_PROFILE_T_HASU1,
|
||||
mAc_PROFILE_T_HAT1, mAc_PROFILE_T_HAT2, mAc_PROFILE_T_HAT3, mAc_PROFILE_T_REI1, mAc_PROFILE_T_REI2,
|
||||
mAc_PROFILE_T_ZINNIA1, mAc_PROFILE_T_ZINNIA2, mAc_PROFILE_T_COBRA1,
|
||||
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
|
||||
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
|
||||
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
|
||||
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
|
||||
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
|
||||
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
|
||||
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
|
||||
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
|
||||
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
|
||||
mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA,
|
||||
mAc_PROFILE_T_KEITAI, mAc_PROFILE_T_UTIWA, mAc_PROFILE_T_HANABI, mAc_PROFILE_T_CRACKER,
|
||||
mAc_PROFILE_T_PISTOL, mAc_PROFILE_T_FLAG, mAc_PROFILE_T_TUMBLER, mAc_PROFILE_T_NPCSAO,
|
||||
mAc_PROFILE_T_TAMA, mAc_PROFILE_T_TAMA, mAc_PROFILE_T_TAMA, mAc_PROFILE_T_TAMA,
|
||||
mAc_PROFILE_T_ANRIUM1, mAc_PROFILE_T_BAG1, mAc_PROFILE_T_BAG2, mAc_PROFILE_T_BISCUS1,
|
||||
mAc_PROFILE_T_BISCUS2, mAc_PROFILE_T_BISCUS3, mAc_PROFILE_T_BISCUS4, mAc_PROFILE_T_HASU1,
|
||||
mAc_PROFILE_T_HAT1, mAc_PROFILE_T_HAT2, mAc_PROFILE_T_HAT3, mAc_PROFILE_T_REI1,
|
||||
mAc_PROFILE_T_REI2, mAc_PROFILE_T_ZINNIA1, mAc_PROFILE_T_ZINNIA2, mAc_PROFILE_T_COBRA1,
|
||||
};
|
||||
|
||||
|
||||
TOOLS_ACTOR* child;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
aTOL_check_data_bank(name, &tool->actor_class);
|
||||
aTOL_check_data_bank(name, tool);
|
||||
|
||||
child = (TOOLS_ACTOR*)Actor_info_make_child_actor(&play->actor_info, &tool->actor_class, &play->game,
|
||||
profile_table[name], 0.0f, 0.0f, 0.0f, 0, 0, 0, -1, 0, arg, -1);
|
||||
child = (TOOLS_ACTOR*)Actor_info_make_child_actor(&play->actor_info, tool, game, profile_table[name], 0.0f, 0.0f,
|
||||
0.0f, 0, 0, 0, -1, 0, arg, -1);
|
||||
|
||||
if(child != NULL){
|
||||
if (child != NULL) {
|
||||
child->work0 = id;
|
||||
child->tool_name = name;
|
||||
}
|
||||
|
||||
|
||||
if(arg5 != NULL){
|
||||
if (arg5 != NULL) {
|
||||
*arg5 = -1;
|
||||
}
|
||||
|
||||
|
||||
return &child->actor_class;
|
||||
}
|
||||
|
||||
static int aTOL_chg_request_mode_proc(ACTOR* actor ,TOOLS_ACTOR* tool, int id){
|
||||
static int aTOL_chg_request_mode_proc(ACTOR* actor, ACTOR* tool, int id) {
|
||||
TOOLS_ACTOR* t_actor = (TOOLS_ACTOR*)tool;
|
||||
|
||||
if(actor != tool->actor_class.parent_actor){
|
||||
return 0;
|
||||
if (actor != tool->parent_actor) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
tool->work0 = id;
|
||||
return 1;
|
||||
t_actor->work0 = id;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void aTOL_secure_pl_umbrella_bank_area(GAME* game){
|
||||
static void aTOL_secure_pl_umbrella_bank_area(GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
Object_Exchange_c* exchange;
|
||||
int id;
|
||||
|
||||
|
||||
exchange = &play->object_exchange;
|
||||
id = exchange->bank_idx;
|
||||
|
||||
if(mSc_secure_exchange_keep_bank(exchange, 0, 0xC00) != NULL){
|
||||
if (mSc_secure_exchange_keep_bank(exchange, 0, 0xC00) != NULL) {
|
||||
Common_Set(clip.tools_clip->bank_id, id);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
Common_Set(clip.tools_clip->bank_id, -1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void aTOL_init_clip_area(GAME* game){
|
||||
|
||||
if(Common_Get(clip.tools_clip) == NULL){
|
||||
|
||||
static void aTOL_init_clip_area(GAME* game) {
|
||||
if (Common_Get(clip.tools_clip) == NULL) {
|
||||
Common_Set(clip.tools_clip, &aTOL_clip);
|
||||
bzero(&aTOL_clip, sizeof(aTOL_Clip_c));
|
||||
Common_Set(clip.tools_clip->aTOL_birth_proc,aTOL_birth_proc);
|
||||
Common_Set(clip.tools_clip->aTOL_chg_request_mode_proc,aTOL_chg_request_mode_proc);
|
||||
Common_Set(clip.tools_clip->aTOL_birth_proc, aTOL_birth_proc);
|
||||
Common_Set(clip.tools_clip->aTOL_chg_request_mode_proc, aTOL_chg_request_mode_proc);
|
||||
aTOL_secure_pl_umbrella_bank_area(game);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void aTOL_free_clip_area(){
|
||||
|
||||
if(Common_Get(clip.tools_clip) != NULL){
|
||||
|
||||
static void aTOL_free_clip_area() {
|
||||
if (Common_Get(clip.tools_clip) != NULL) {
|
||||
Common_Set(clip.tools_clip, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
-12
@@ -29,17 +29,19 @@ extern cKF_Animation_R_c cKF_ba_r_obj_romtrain_door;
|
||||
static void aTRD_actor_ct(ACTOR* actor, GAME* game) {
|
||||
TRAINDOOR_ACTOR* traindoor = (TRAINDOOR_ACTOR*)actor;
|
||||
|
||||
cKF_SkeletonInfo_R_ct(&traindoor->keyframe, &cKF_bs_r_obj_romtrain_door, NULL, traindoor->work, traindoor->target);
|
||||
cKF_SkeletonInfo_R_init(&traindoor->keyframe, traindoor->keyframe.skeleton, &cKF_ba_r_obj_romtrain_door, 1.0f,
|
||||
cKF_SkeletonInfo_R_ct(&traindoor->common_actor_class.anime.keyframe, &cKF_bs_r_obj_romtrain_door, NULL,
|
||||
traindoor->work, traindoor->target);
|
||||
cKF_SkeletonInfo_R_init(&traindoor->common_actor_class.anime.keyframe,
|
||||
traindoor->common_actor_class.anime.keyframe.skeleton, &cKF_ba_r_obj_romtrain_door, 1.0f,
|
||||
51.0f, 1.0f, 0.0f, 0.0f, 0, NULL);
|
||||
traindoor->keyframe.morph_counter = 0.0f;
|
||||
cKF_SkeletonInfo_R_play(&traindoor->keyframe);
|
||||
traindoor->common_actor_class.anime.keyframe.morph_counter = 0.0f;
|
||||
cKF_SkeletonInfo_R_play(&traindoor->common_actor_class.anime.keyframe);
|
||||
}
|
||||
|
||||
static void aTRD_actor_dt(ACTOR* actor, GAME* game) {
|
||||
TRAINDOOR_ACTOR* traindoor = (TRAINDOOR_ACTOR*)actor;
|
||||
|
||||
cKF_SkeletonInfo_R_dt(&traindoor->keyframe);
|
||||
cKF_SkeletonInfo_R_dt(&traindoor->common_actor_class.anime.keyframe);
|
||||
}
|
||||
|
||||
static void aTRD_set_door_SE(ACTOR* actor) {
|
||||
@@ -50,8 +52,8 @@ static void aTRD_set_door_SE(ACTOR* actor) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (cKF_FrameControl_passCheck_now(&traindoor->keyframe.frame_control, chk_pat[i])) {
|
||||
sAdo_OngenTrgStart(se_no[i], &traindoor->actor_class.world.position);
|
||||
if (cKF_FrameControl_passCheck_now(&traindoor->common_actor_class.anime.keyframe.frame_control, chk_pat[i])) {
|
||||
sAdo_OngenTrgStart(se_no[i], &traindoor->common_actor_class.actor_class.world.position);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -62,12 +64,13 @@ static void aTRD_actor_move(ACTOR* actor, GAME* game) {
|
||||
|
||||
if (traindoor->open_flag == TRUE) {
|
||||
traindoor->open_flag = FALSE;
|
||||
traindoor->keyframe.frame_control.speed = 0.5f;
|
||||
traindoor->common_actor_class.anime.keyframe.frame_control.speed = 0.5f;
|
||||
}
|
||||
|
||||
if (cKF_SkeletonInfo_R_play(&traindoor->keyframe) == cKF_FRAMECONTROL_REPEAT) {
|
||||
traindoor->keyframe.frame_control.current_frame = traindoor->keyframe.frame_control.start_frame;
|
||||
traindoor->keyframe.frame_control.speed = 0.0f;
|
||||
if (cKF_SkeletonInfo_R_play(&traindoor->common_actor_class.anime.keyframe) == cKF_FRAMECONTROL_REPEAT) {
|
||||
traindoor->common_actor_class.anime.keyframe.frame_control.current_frame =
|
||||
traindoor->common_actor_class.anime.keyframe.frame_control.start_frame;
|
||||
traindoor->common_actor_class.anime.keyframe.frame_control.speed = 0.0f;
|
||||
}
|
||||
|
||||
aTRD_set_door_SE(actor);
|
||||
@@ -76,7 +79,7 @@ static void aTRD_actor_move(ACTOR* actor, GAME* game) {
|
||||
static void aTRD_actor_draw(ACTOR* actor, GAME* game) {
|
||||
TRAINDOOR_ACTOR* traindoor = (TRAINDOOR_ACTOR*)actor;
|
||||
|
||||
cKF_SkeletonInfo_R_c* keyf = &traindoor->keyframe;
|
||||
cKF_SkeletonInfo_R_c* keyf = &traindoor->common_actor_class.anime.keyframe;
|
||||
Mtx* mtxp;
|
||||
|
||||
mtxp = GRAPH_ALLOC_TYPE(game->graph, Mtx, (u32)keyf->skeleton->num_shown_joints);
|
||||
|
||||
+1
-1
@@ -161,7 +161,7 @@ extern int mEv_CheckArbeit() {
|
||||
return res;
|
||||
}
|
||||
|
||||
extern int mFI_CheckFirstJob() {
|
||||
extern int mEv_CheckFirstJob() {
|
||||
u32 player_no = Common_Get(player_no);
|
||||
int res = FALSE;
|
||||
|
||||
|
||||
+13
-11
@@ -320,17 +320,19 @@ static void Scene_Proc_Sound(GAME_PLAY* play, Scene_Word_u* data);
|
||||
typedef void (*mSc_SCENE_WORD_PROC)(GAME_PLAY*, Scene_Word_u*);
|
||||
|
||||
extern void Scene_ct(GAME_PLAY* play, Scene_Word_u* scene_data) {
|
||||
static mSc_SCENE_WORD_PROC Scene_Proc[mSc_SCENE_DATA_TYPE_NUM] = { &Scene_Proc_Player_Ptr,
|
||||
&Scene_Proc_Ctrl_Actor_Ptr,
|
||||
&Scene_Proc_Actor_Ptr,
|
||||
&Scene_Proc_Object_Exchange_Bank_Ptr,
|
||||
&Scene_Proc_Door_Data_Ptr,
|
||||
&Scene_Proc_Field_ct,
|
||||
&Scene_Proc_MyRoom_ct,
|
||||
&Scene_Proc_ArrangeRoom_ct,
|
||||
&Scene_Proc_ArrangeFurniture_ct,
|
||||
&Scene_Proc_Sound,
|
||||
NULL };
|
||||
static mSc_SCENE_WORD_PROC Scene_Proc[mSc_SCENE_DATA_TYPE_NUM] = {
|
||||
&Scene_Proc_Player_Ptr,
|
||||
&Scene_Proc_Ctrl_Actor_Ptr,
|
||||
&Scene_Proc_Actor_Ptr,
|
||||
&Scene_Proc_Object_Exchange_Bank_Ptr,
|
||||
&Scene_Proc_Door_Data_Ptr,
|
||||
&Scene_Proc_Field_ct,
|
||||
&Scene_Proc_MyRoom_ct,
|
||||
&Scene_Proc_ArrangeRoom_ct,
|
||||
&Scene_Proc_ArrangeFurniture_ct,
|
||||
&Scene_Proc_Sound,
|
||||
NULL,
|
||||
};
|
||||
|
||||
/* Initialize all scene data */
|
||||
while (TRUE) {
|
||||
|
||||
+1
-1
@@ -1088,7 +1088,7 @@ extern int mSC_LightHouse_travel_check() {
|
||||
}
|
||||
|
||||
extern void mSC_change_player_freeze(GAME_PLAY* play) {
|
||||
if (mPlib_get_player_actor_main_index((GAME*)play) != 74) {
|
||||
if (mPlib_get_player_actor_main_index((GAME*)play) != mPlayer_INDEX_DEMO_WAIT) {
|
||||
mPlib_request_main_demo_wait_type1((GAME*)play, 0, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user