mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-07-07 20:11:51 -04:00
Fix ac_npc_shasho
This commit is contained in:
@@ -19,7 +19,7 @@ typedef void (*aNSS_MOVE_PROC)(NPC_SHASHO_ACTOR*, GAME*);
|
||||
struct npc_shasho_s {
|
||||
/* 0x000 */ NPC_ACTOR npc_class;
|
||||
/* 0x994 */ int action;
|
||||
/* 0x998 */ int unk_move_action;
|
||||
/* 0x998 */ int next_action;
|
||||
/* 0x99C */ aNSS_PROC talk_action;
|
||||
/* 0x9A0 */ ACTOR* train_door_actor;
|
||||
};
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "m_actor_type.h"
|
||||
#include "m_common_data.h"
|
||||
#include "m_lib.h"
|
||||
#include "m_play_h.h"
|
||||
|
||||
enum {
|
||||
aNSS_ACT_ENTER_WALK_BACK_DECK,
|
||||
@@ -56,12 +55,21 @@ static void aNSS_exit_walk_back_deck_init(NPC_SHASHO_ACTOR* shasho_actor, GAME_P
|
||||
static void aNSS_init_proc(ACTOR* actorx, GAME* game, int action);
|
||||
static void aNSS_setupAction(ACTOR* actorx, GAME* game, int action);
|
||||
|
||||
// clang-format off
|
||||
ACTOR_PROFILE Npc_Shasho_Profile = {
|
||||
mAc_PROFILE_NPC_SHASHO, ACTOR_PART_NPC, ACTOR_STATE_NO_MOVE_WHILE_CULLED | ACTOR_STATE_NO_DRAW_WHILE_CULLED,
|
||||
SP_NPC_SASHO, ACTOR_OBJ_BANK_KEEP, sizeof(NPC_SHASHO_ACTOR),
|
||||
&aNSS_actor_ct, &aNSS_actor_dt, &aNSS_actor_init,
|
||||
mActor_NONE_PROC1, &aNSS_actor_save
|
||||
mAc_PROFILE_NPC_SHASHO,
|
||||
ACTOR_PART_NPC,
|
||||
ACTOR_STATE_NO_MOVE_WHILE_CULLED | ACTOR_STATE_NO_DRAW_WHILE_CULLED,
|
||||
SP_NPC_SASHO,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(NPC_SHASHO_ACTOR),
|
||||
&aNSS_actor_ct,
|
||||
&aNSS_actor_dt,
|
||||
&aNSS_actor_init,
|
||||
mActor_NONE_PROC1,
|
||||
&aNSS_actor_save,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
static void aNSS_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
static aNPC_ct_data_c ct_data = {
|
||||
@@ -96,7 +104,7 @@ static void aNSS_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
}
|
||||
|
||||
static void aNSS_actor_save(ACTOR* actorx, GAME* game) {
|
||||
(*Common_Get(clip).npc_clip->save_proc)(actorx, game);
|
||||
NPC_CLIP->save_proc(actorx, game);
|
||||
}
|
||||
|
||||
static void aNSS_actor_dt(ACTOR* actorx, GAME* game) {
|
||||
@@ -108,11 +116,11 @@ static void aNSS_actor_dt(ACTOR* actorx, GAME* game) {
|
||||
mask_cat2_actor->sasho_actor = NULL;
|
||||
}
|
||||
|
||||
(*Common_Get(clip).npc_clip->dt_proc)(actorx, game);
|
||||
NPC_CLIP->dt_proc(actorx, game);
|
||||
}
|
||||
|
||||
static void aNSS_actor_init(ACTOR* actorx, GAME* game) {
|
||||
(*Common_Get(clip).npc_clip->init_proc)(actorx, game);
|
||||
NPC_CLIP->init_proc(actorx, game);
|
||||
}
|
||||
|
||||
static void aNSS_actor_draw(ACTOR* actorx, GAME* game) {
|
||||
|
||||
@@ -61,7 +61,7 @@ static void aNSS_enter_back_door(ACTOR* actorx, GAME* game) {
|
||||
}
|
||||
|
||||
if (shasho_actor->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
|
||||
aNSS_setupAction(actorx, game, shasho_actor->unk_move_action);
|
||||
aNSS_setupAction(actorx, game, shasho_actor->next_action);
|
||||
if (shasho_actor->action == 8)
|
||||
shasho_actor->npc_class.draw.main_animation.keyframe.morph_counter = 0.0;
|
||||
} else {
|
||||
@@ -84,10 +84,10 @@ static void aNSS_exit_front_door(ACTOR* actorx, GAME* game) {
|
||||
NPC_SHASHO_ACTOR* shasho_actor = (NPC_SHASHO_ACTOR*)actorx;
|
||||
|
||||
if (shasho_actor->npc_class.draw.main_animation_state == cKF_STATE_STOPPED) {
|
||||
if (shasho_actor->unk_move_action == -1) {
|
||||
if (shasho_actor->next_action == -1) {
|
||||
shasho_actor->action = -1;
|
||||
} else {
|
||||
aNSS_setupAction(actorx, game, shasho_actor->unk_move_action);
|
||||
aNSS_setupAction(actorx, game, shasho_actor->next_action);
|
||||
}
|
||||
} else {
|
||||
aNSS_set_door_SE(shasho_actor);
|
||||
@@ -134,12 +134,12 @@ static void aNSS_enter_walk_back_deck_init(NPC_SHASHO_ACTOR* shasho_actor, GAME_
|
||||
}
|
||||
|
||||
static void aNSS_enter_turn_back_deck_init(NPC_SHASHO_ACTOR* shasho_actor, GAME_PLAY* game_play) {
|
||||
aNSS_set_walk_spd(shasho_actor);
|
||||
aNSS_set_stop_spd(shasho_actor);
|
||||
}
|
||||
|
||||
static void aNSS_enter_back_door_init(NPC_SHASHO_ACTOR* shasho_actor, GAME_PLAY* game_play) {
|
||||
aNSS_set_stop_spd(shasho_actor);
|
||||
shasho_actor->unk_move_action = 0x3;
|
||||
shasho_actor->next_action = aNSS_ACT_WALK_TO_FRONT_DOOR;
|
||||
}
|
||||
|
||||
static void aNSS_walk_to_front_door_init(NPC_SHASHO_ACTOR* shasho_actor, GAME_PLAY* game_play) {
|
||||
@@ -147,18 +147,18 @@ static void aNSS_walk_to_front_door_init(NPC_SHASHO_ACTOR* shasho_actor, GAME_PL
|
||||
}
|
||||
|
||||
static void aNSS_exit_front_door_init(NPC_SHASHO_ACTOR* shasho_actor, GAME_PLAY* game_play) {
|
||||
aNSS_set_walk_spd(shasho_actor);
|
||||
shasho_actor->unk_move_action = -1;
|
||||
aNSS_set_stop_spd(shasho_actor);
|
||||
shasho_actor->next_action = -1;
|
||||
}
|
||||
|
||||
static void aNSS_enter_front_door_init(NPC_SHASHO_ACTOR* shasho_actor, GAME_PLAY* game_play) {
|
||||
aNSS_set_stop_spd(shasho_actor);
|
||||
shasho_actor->unk_move_action = 0x6;
|
||||
shasho_actor->next_action = aNSS_ACT_WALK_TO_BACK_DOOR;
|
||||
}
|
||||
|
||||
static void aNSS_exit_back_door_init(NPC_SHASHO_ACTOR* shasho_actor, GAME_PLAY* game_play) {
|
||||
aNSS_set_stop_spd(shasho_actor);
|
||||
shasho_actor->unk_move_action = 0x8;
|
||||
shasho_actor->next_action = aNSS_ACT_EXIT_TURN_BACK_DECK;
|
||||
}
|
||||
|
||||
static void aNSS_exit_walk_back_deck_init(NPC_SHASHO_ACTOR* shasho_actor, GAME_PLAY* game_play) {
|
||||
|
||||
Reference in New Issue
Block a user