Implement & link ac_t_npc_sao

This commit is contained in:
Cuyler36
2023-12-07 17:56:08 -05:00
parent ccdd22a449
commit 246b3e7fda
38 changed files with 215 additions and 103 deletions
+4
View File
@@ -452,6 +452,10 @@ ac_t_hat2.c:
ac_t_hat3.c:
.text: [0x804A8E98, 0x804A8FEC]
.data: [0x8068ED70, 0x8068EDB0]
ac_t_npc_sao.c:
.text: [0x804A9348, 0x804A95F4]
.rodata: [0x80645EE0, 0x80645EF8]
.data: [0x8068EE58, 0x8068EE98]
ac_t_pistol.c:
.text: [0x804A95F4, 0x804A9858]
.rodata: [0x80645EF8, 0x80645F00]
-1
View File
@@ -14,7 +14,6 @@ typedef void (*ANRIUM1_PROC)(ACTOR*);
typedef struct t_anrium_s{
TOOLS_ACTOR tools_class;
u8 pad2[0x8];
ANRIUM1_PROC proc;
int current_id;
}ANRIUM1_ACTOR;
-1
View File
@@ -15,7 +15,6 @@ typedef void (*BAG1_PROC)(ACTOR*);
typedef struct t_bag1_s{
TOOLS_ACTOR tools_class;
u8 pad2[0x8];
BAG1_PROC proc;
int current_id;
}BAG1_ACTOR;
-1
View File
@@ -15,7 +15,6 @@ typedef void (*BAG2_PROC)(ACTOR*);
typedef struct t_bag2_s{
TOOLS_ACTOR tools_class;
u8 pad2[0x8];
BAG2_PROC proc;
int current_id;
}BAG2_ACTOR;
-1
View File
@@ -15,7 +15,6 @@ typedef void (*BISCUS1_PROC)(ACTOR*);
typedef struct t_biscus1_s{
TOOLS_ACTOR tools_class;
u8 pad2[0x8];
BISCUS1_PROC proc;
int current_id;
}BISCUS1_ACTOR;
-1
View File
@@ -15,7 +15,6 @@ typedef void (*BISCUS2_PROC)(ACTOR*);
typedef struct t_biscus2_s{
TOOLS_ACTOR tools_class;
u8 pad2[0x8];
BISCUS2_PROC proc;
int current_id;
}BISCUS2_ACTOR;
-1
View File
@@ -15,7 +15,6 @@ typedef void (*BISCUS3_PROC)(ACTOR*);
typedef struct t_biscus3_s{
TOOLS_ACTOR tools_class;
u8 pad2[0x8];
BISCUS3_PROC proc;
int current_id;
}BISCUS3_ACTOR;
-1
View File
@@ -16,7 +16,6 @@ typedef void (*BISCUS4_PROC)(ACTOR*);
typedef struct t_biscus4_s{
TOOLS_ACTOR tools_class;
u8 pad2[0x8];
BISCUS4_PROC proc;
int current_id;
}BISCUS4_ACTOR;
-1
View File
@@ -16,7 +16,6 @@ typedef void (*COBRA1_PROC)(ACTOR*);
typedef struct t_cobra1_s{
TOOLS_ACTOR tools_class;
u8 pad2[0x8];
COBRA1_PROC proc;
int current_id;
}COBRA1_ACTOR;
-1
View File
@@ -15,7 +15,6 @@ typedef void (*CRACKER_PROC)(ACTOR*);
typedef struct t_cracker_s{
TOOLS_ACTOR tools_class;
u8 pad2[0x8];
CRACKER_PROC proc;
int current_id;
}CRACKER_ACTOR;
-2
View File
@@ -13,8 +13,6 @@ extern ACTOR_PROFILE T_Flag_Profile;
typedef struct t_flag_s{
TOOLS_ACTOR tools_class;
u32 unk1C4;
u32 unk1C8;
s16 angle;
s16 addendedang;
int unk1D0;
-1
View File
@@ -15,7 +15,6 @@ typedef void (*HANABI_PROC)(ACTOR*);
typedef struct t_hanabi_s{
TOOLS_ACTOR tools_class;
u8 pad2[0x8];
HANABI_PROC proc;
int current_id;
}HANABI_ACTOR;
-1
View File
@@ -15,7 +15,6 @@ typedef void (*HASU1_PROC)(ACTOR*);
typedef struct t_hasu1_s{
TOOLS_ACTOR tools_class;
u8 pad2[0x8];
HASU1_PROC proc;
int current_id;
}HASU1_ACTOR;
-1
View File
@@ -15,7 +15,6 @@ typedef void (*HAT1_PROC)(ACTOR*);
typedef struct t_hat1_s{
TOOLS_ACTOR tools_class;
u8 pad2[0x8];
HAT1_PROC proc;
int current_id;
}HAT1_ACTOR;
-1
View File
@@ -15,7 +15,6 @@ typedef void (*HAT2_PROC)(ACTOR*);
typedef struct t_hat2_s{
TOOLS_ACTOR tools_class;
u8 pad2[0x8];
HAT2_PROC proc;
int current_id;
}HAT2_ACTOR;
-1
View File
@@ -15,7 +15,6 @@ typedef void (*HAT3_PROC)(ACTOR*);
typedef struct t_hat3_s{
TOOLS_ACTOR tools_class;
u8 pad2[0x8];
HAT3_PROC proc;
int current_id;
}HAT3_ACTOR;
+18
View File
@@ -3,11 +3,29 @@
#include "types.h"
#include "m_actor.h"
#include "ac_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct npc_sao_tool_s NPC_SAO_TOOL_ACTOR;
typedef void (*aTNS_ACTION_PROC)(NPC_SAO_TOOL_ACTOR*);
struct npc_sao_tool_s {
TOOLS_ACTOR tool_class;
aTNS_ACTION_PROC action_proc; // 0x1cc
u8 action; // 0x1d0
short rotation_y; // 0x1d2
f32 pos_x; // 0x1d4
f32 pos_y; // 0x1d8
f32 pos_z; // 0x1dc
};
extern void aTNS_actor_ct(ACTOR* actorx, GAME* game);
extern void aTNS_actor_move(ACTOR* actorx, GAME* game);
extern void aTNS_actor_draw(ACTOR* actorx, GAME* game);
extern ACTOR_PROFILE T_NpcSao_Profile;
#ifdef __cplusplus
-1
View File
@@ -14,7 +14,6 @@ typedef void (*PISTOL_PROC)(ACTOR*);
typedef struct t_pistol_s{
TOOLS_ACTOR tools_class;
u8 pad2[0x8];
PISTOL_PROC proc;
int current_id;
}PISTOL_ACTOR;
+9 -7
View File
@@ -60,15 +60,17 @@ typedef enum {
} ToolName;
typedef struct tools_s{
ACTOR actor_class;
ToolName tool_name;
MtxF matrix_work;
int enable;
int unk1BC;
int process_id;
/* 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 TOOLS_ACTOR* (*ToolBirthProc)(ToolName, int, TOOLS_ACTOR*, GAME_PLAY*, s16, int*);
typedef TOOLS_ACTOR* (*ToolBirthProc)(int, int, TOOLS_ACTOR*, GAME_PLAY*, s16, int*);
typedef int (*ToolChgRequestModeProc)(ACTOR*, TOOLS_ACTOR*, int);
typedef struct ToolClip {
+1 -1
View File
@@ -409,7 +409,7 @@ typedef enum bank_id {
ACTOR_OBJ_BANK_367,
ACTOR_OBJ_BANK_368,
ACTOR_OBJ_BANK_369,
ACTOR_OBJ_BANK_370,
ACTOR_OBJ_BANK_NPC_SAO,
ACTOR_OBJ_BANK_371,
ACTOR_OBJ_BANK_372,
ACTOR_OBJ_BANK_373,
+5 -5
View File
@@ -46,15 +46,15 @@ static void aTA1_setupAction(ACTOR*actor, int action){
anrium->proc = process[action];
anrium->current_id = action;
anrium->tools_class.process_id = action;
anrium->tools_class.work0 = action;
}
static void aTA1_actor_move(ACTOR* actor, GAME*){
ANRIUM1_ACTOR* anrium = (ANRIUM1_ACTOR*)actor;
if(anrium->tools_class.process_id != anrium->current_id){
aTA1_setupAction(actor, anrium->tools_class.process_id);
if(anrium->tools_class.work0 != anrium->current_id){
aTA1_setupAction(actor, anrium->tools_class.work0);
}
anrium->proc(actor);
@@ -66,7 +66,7 @@ static void aTA1_actor_draw(ACTOR* actor, GAME* game){
GRAPH* graph;
Gfx* gfxp;
if(anrium->tools_class.enable == 1){
if(anrium->tools_class.init_matrix == 1){
graph = game->graph;
OPEN_DISP(graph);
@@ -74,7 +74,7 @@ static void aTA1_actor_draw(ACTOR* actor, GAME* game){
Matrix_put(&anrium->tools_class.matrix_work);
Matrix_Position_Zero(&anrium->tools_class.actor_class.world.position);
anrium->tools_class.enable = 0;
anrium->tools_class.init_matrix = 0;
_texture_z_light_fog_prim_npc(graph);
+5 -5
View File
@@ -46,15 +46,15 @@ static void aTBG1_setupAction(ACTOR*actor, int action){
bag->proc = process[action];
bag->current_id = action;
bag->tools_class.process_id = action;
bag->tools_class.work0 = action;
}
static void aTBG1_actor_move(ACTOR* actor, GAME*){
BAG1_ACTOR* bag = (BAG1_ACTOR*)actor;
if(bag->tools_class.process_id != bag->current_id){
aTBG1_setupAction(actor, bag->tools_class.process_id);
if(bag->tools_class.work0 != bag->current_id){
aTBG1_setupAction(actor, bag->tools_class.work0);
}
bag->proc(actor);
@@ -66,7 +66,7 @@ static void aTBG1_actor_draw(ACTOR* actor, GAME* game){
GRAPH* graph;
Gfx* gfxp;
if(bag->tools_class.enable == 1){
if(bag->tools_class.init_matrix == 1){
graph = game->graph;
OPEN_DISP(graph);
@@ -74,7 +74,7 @@ static void aTBG1_actor_draw(ACTOR* actor, GAME* game){
Matrix_put(&bag->tools_class.matrix_work);
Matrix_Position_Zero(&bag->tools_class.actor_class.world.position);
bag->tools_class.enable = 0;
bag->tools_class.init_matrix = 0;
_texture_z_light_fog_prim_npc(graph);
+5 -5
View File
@@ -46,15 +46,15 @@ static void aTBG2_setupAction(ACTOR*actor, int action){
bag->proc = process[action];
bag->current_id = action;
bag->tools_class.process_id = action;
bag->tools_class.work0 = action;
}
static void aTBG2_actor_move(ACTOR* actor, GAME*){
BAG2_ACTOR* bag = (BAG2_ACTOR*)actor;
if(bag->tools_class.process_id != bag->current_id){
aTBG2_setupAction(actor, bag->tools_class.process_id);
if(bag->tools_class.work0 != bag->current_id){
aTBG2_setupAction(actor, bag->tools_class.work0);
}
bag->proc(actor);
@@ -66,7 +66,7 @@ static void aTBG2_actor_draw(ACTOR* actor, GAME* game){
GRAPH* graph;
Gfx* gfxp;
if(bag->tools_class.enable == 1){
if(bag->tools_class.init_matrix == 1){
graph = game->graph;
OPEN_DISP(graph);
@@ -74,7 +74,7 @@ static void aTBG2_actor_draw(ACTOR* actor, GAME* game){
Matrix_put(&bag->tools_class.matrix_work);
Matrix_Position_Zero(&bag->tools_class.actor_class.world.position);
bag->tools_class.enable = 0;
bag->tools_class.init_matrix = 0;
_texture_z_light_fog_prim_npc(graph);
+5 -5
View File
@@ -46,15 +46,15 @@ static void aTB1_setupAction(ACTOR*actor, int action){
biscus->proc = process[action];
biscus->current_id = action;
biscus->tools_class.process_id = action;
biscus->tools_class.work0 = action;
}
static void aTB1_actor_move(ACTOR* actor, GAME*){
BISCUS1_ACTOR* biscus = (BISCUS1_ACTOR*)actor;
if(biscus->tools_class.process_id != biscus->current_id){
aTB1_setupAction(actor, biscus->tools_class.process_id);
if(biscus->tools_class.work0 != biscus->current_id){
aTB1_setupAction(actor, biscus->tools_class.work0);
}
biscus->proc(actor);
@@ -66,7 +66,7 @@ static void aTB1_actor_draw(ACTOR* actor, GAME* game){
GRAPH* graph;
Gfx* gfxp;
if(biscus->tools_class.enable == 1){
if(biscus->tools_class.init_matrix == 1){
graph = game->graph;
OPEN_DISP(graph);
@@ -74,7 +74,7 @@ static void aTB1_actor_draw(ACTOR* actor, GAME* game){
Matrix_put(&biscus->tools_class.matrix_work);
Matrix_Position_Zero(&biscus->tools_class.actor_class.world.position);
biscus->tools_class.enable = 0;
biscus->tools_class.init_matrix = 0;
_texture_z_light_fog_prim_npc(graph);
+5 -5
View File
@@ -46,15 +46,15 @@ static void aTB2_setupAction(ACTOR*actor, int action){
biscus->proc = process[action];
biscus->current_id = action;
biscus->tools_class.process_id = action;
biscus->tools_class.work0 = action;
}
static void aTB2_actor_move(ACTOR* actor, GAME*){
BISCUS2_ACTOR* biscus = (BISCUS2_ACTOR*)actor;
if(biscus->tools_class.process_id != biscus->current_id){
aTB2_setupAction(actor, biscus->tools_class.process_id);
if(biscus->tools_class.work0 != biscus->current_id){
aTB2_setupAction(actor, biscus->tools_class.work0);
}
biscus->proc(actor);
@@ -66,7 +66,7 @@ static void aTB2_actor_draw(ACTOR* actor, GAME* game){
GRAPH* graph;
Gfx* gfxp;
if(biscus->tools_class.enable == 1){
if(biscus->tools_class.init_matrix == 1){
graph = game->graph;
OPEN_DISP(graph);
@@ -74,7 +74,7 @@ static void aTB2_actor_draw(ACTOR* actor, GAME* game){
Matrix_put(&biscus->tools_class.matrix_work);
Matrix_Position_Zero(&biscus->tools_class.actor_class.world.position);
biscus->tools_class.enable = 0;
biscus->tools_class.init_matrix = 0;
_texture_z_light_fog_prim_npc(graph);
+5 -5
View File
@@ -46,15 +46,15 @@ static void aTB3_setupAction(ACTOR*actor, int action){
biscus->proc = process[action];
biscus->current_id = action;
biscus->tools_class.process_id = action;
biscus->tools_class.work0 = action;
}
static void aTB3_actor_move(ACTOR* actor, GAME*){
BISCUS3_ACTOR* biscus = (BISCUS3_ACTOR*)actor;
if(biscus->tools_class.process_id != biscus->current_id){
aTB3_setupAction(actor, biscus->tools_class.process_id);
if(biscus->tools_class.work0 != biscus->current_id){
aTB3_setupAction(actor, biscus->tools_class.work0);
}
biscus->proc(actor);
@@ -66,7 +66,7 @@ static void aTB3_actor_draw(ACTOR* actor, GAME* game){
GRAPH* graph;
Gfx* gfxp;
if(biscus->tools_class.enable == 1){
if(biscus->tools_class.init_matrix == 1){
graph = game->graph;
OPEN_DISP(graph);
@@ -74,7 +74,7 @@ static void aTB3_actor_draw(ACTOR* actor, GAME* game){
Matrix_put(&biscus->tools_class.matrix_work);
Matrix_Position_Zero(&biscus->tools_class.actor_class.world.position);
biscus->tools_class.enable = 0;
biscus->tools_class.init_matrix = 0;
_texture_z_light_fog_prim_npc(graph);
+5 -5
View File
@@ -46,15 +46,15 @@ static void aTB4_setupAction(ACTOR*actor, int action){
biscus->proc = process[action];
biscus->current_id = action;
biscus->tools_class.process_id = action;
biscus->tools_class.work0 = action;
}
static void aTB4_actor_move(ACTOR* actor, GAME*){
BISCUS4_ACTOR* biscus = (BISCUS4_ACTOR*)actor;
if(biscus->tools_class.process_id != biscus->current_id){
aTB4_setupAction(actor, biscus->tools_class.process_id);
if(biscus->tools_class.work0 != biscus->current_id){
aTB4_setupAction(actor, biscus->tools_class.work0);
}
biscus->proc(actor);
@@ -66,7 +66,7 @@ static void aTB4_actor_draw(ACTOR* actor, GAME* game){
GRAPH* graph;
Gfx* gfxp;
if(biscus->tools_class.enable == 1){
if(biscus->tools_class.init_matrix == 1){
graph = game->graph;
OPEN_DISP(graph);
@@ -74,7 +74,7 @@ static void aTB4_actor_draw(ACTOR* actor, GAME* game){
Matrix_put(&biscus->tools_class.matrix_work);
Matrix_Position_Zero(&biscus->tools_class.actor_class.world.position);
biscus->tools_class.enable = 0;
biscus->tools_class.init_matrix = 0;
_texture_z_light_fog_prim_npc(graph);
+5 -5
View File
@@ -46,15 +46,15 @@ static void aTCB1_setupAction(ACTOR*actor, int action){
cobra->proc = process[action];
cobra->current_id = action;
cobra->tools_class.process_id = action;
cobra->tools_class.work0 = action;
}
static void aTCB1_actor_move(ACTOR* actor, GAME*){
COBRA1_ACTOR* cobra = (COBRA1_ACTOR*)actor;
if(cobra->tools_class.process_id != cobra->current_id){
aTCB1_setupAction(actor, cobra->tools_class.process_id);
if(cobra->tools_class.work0 != cobra->current_id){
aTCB1_setupAction(actor, cobra->tools_class.work0);
}
cobra->proc(actor);
@@ -66,7 +66,7 @@ static void aTCB1_actor_draw(ACTOR* actor, GAME* game){
GRAPH* graph;
Gfx* gfxp;
if(cobra->tools_class.enable == 1){
if(cobra->tools_class.init_matrix == 1){
graph = game->graph;
OPEN_DISP(graph);
@@ -74,7 +74,7 @@ static void aTCB1_actor_draw(ACTOR* actor, GAME* game){
Matrix_put(&cobra->tools_class.matrix_work);
Matrix_Position_Zero(&cobra->tools_class.actor_class.world.position);
cobra->tools_class.enable = 0;
cobra->tools_class.init_matrix = 0;
_texture_z_light_fog_prim_npc(graph);
+4 -4
View File
@@ -69,7 +69,7 @@ static void aTCR_setupAction(ACTOR* actor, int idx){
cracker->proc = process[idx];
cracker->current_id = idx;
cracker->tools_class.process_id = idx;
cracker->tools_class.work0 = idx;
scale = start_scale[idx];
cracker->tools_class.actor_class.scale.x = scale;
@@ -81,7 +81,7 @@ static void aTCR_setupAction(ACTOR* actor, int idx){
static void aTCR_actor_move(ACTOR* actor, GAME* game){
CRACKER_ACTOR* cracker = (CRACKER_ACTOR*)actor;
int t = cracker->tools_class.process_id;
int t = cracker->tools_class.work0;
if(t!= cracker->current_id){
aTCR_setupAction(actor, t);
}
@@ -96,10 +96,10 @@ static void aTCR_actor_draw(ACTOR* actor, GAME* game){
OPEN_DISP(graph);
if(cracker->tools_class.enable == 1){
if(cracker->tools_class.init_matrix == 1){
Matrix_put(&cracker->tools_class.matrix_work);
Matrix_Position_Zero(&cracker->tools_class.actor_class.world.position);
cracker->tools_class.enable = 0;
cracker->tools_class.init_matrix = 0;
}
else{
Matrix_translate(cracker->tools_class.actor_class.world.position.x, cracker->tools_class.actor_class.world.position.y,
+3 -3
View File
@@ -60,7 +60,7 @@ static void aTFL_make_vtx(Vtx* v, ACTOR* actor){
fact = 0;
if(tools->enable == 1){
if(tools->init_matrix == 1){
Matrix_put(&flag->tools_class.matrix_work);
Matrix_translate(0.0f,0.0f,48.0999984741f,1);
Matrix_Position_Zero(&pos);
@@ -114,10 +114,10 @@ static void aTFL_actor_draw(ACTOR* actor, GAME* game){
buf = tol_hata_01_v;
}
if(tools->enable == 1){
if(tools->init_matrix == 1){
Matrix_put(&flag->tools_class.matrix_work);
Matrix_Position_Zero(&actor->world.position);
tools->enable = 0;
tools->init_matrix = 0;
}
else{
Matrix_translate(actor->world.position.x, actor->world.position.y,
+4 -4
View File
@@ -73,7 +73,7 @@ static void aTHB_setupAction(ACTOR* actor, int idx){
hanabi->proc = process[idx];
hanabi->current_id = idx;
hanabi->tools_class.process_id = idx;
hanabi->tools_class.work0 = idx;
scale = start_scale[idx];
hanabi->tools_class.actor_class.scale.x = scale;
@@ -85,7 +85,7 @@ static void aTHB_setupAction(ACTOR* actor, int idx){
static void aTHB_actor_move(ACTOR* actor, GAME* game){
HANABI_ACTOR* hanabi = (HANABI_ACTOR*)actor;
int t = hanabi->tools_class.process_id;
int t = hanabi->tools_class.work0;
if(t!= hanabi->current_id){
aTHB_setupAction(actor, t);
}
@@ -100,10 +100,10 @@ static void aTHB_actor_draw(ACTOR* actor, GAME* game){
OPEN_DISP(graph);
if(hanabi->tools_class.enable == 1){
if(hanabi->tools_class.init_matrix == 1){
Matrix_put(&hanabi->tools_class.matrix_work);
Matrix_Position_Zero(&hanabi->tools_class.actor_class.world.position);
hanabi->tools_class.enable = 0;
hanabi->tools_class.init_matrix = 0;
}
else{
Matrix_translate(hanabi->tools_class.actor_class.world.position.x, hanabi->tools_class.actor_class.world.position.y,
+5 -5
View File
@@ -46,15 +46,15 @@ static void aTHS1_setupAction(ACTOR*actor, int action){
hasu->proc = process[action];
hasu->current_id = action;
hasu->tools_class.process_id = action;
hasu->tools_class.work0 = action;
}
static void aTHS1_actor_move(ACTOR* actor, GAME*){
HASU1_ACTOR* hasu = (HASU1_ACTOR*)actor;
if(hasu->tools_class.process_id != hasu->current_id){
aTHS1_setupAction(actor, hasu->tools_class.process_id);
if(hasu->tools_class.work0 != hasu->current_id){
aTHS1_setupAction(actor, hasu->tools_class.work0);
}
hasu->proc(actor);
@@ -66,7 +66,7 @@ static void aTHS1_actor_draw(ACTOR* actor, GAME* game){
GRAPH* graph;
Gfx* gfxp;
if(hasu->tools_class.enable == 1){
if(hasu->tools_class.init_matrix == 1){
graph = game->graph;
OPEN_DISP(graph);
@@ -74,7 +74,7 @@ static void aTHS1_actor_draw(ACTOR* actor, GAME* game){
Matrix_put(&hasu->tools_class.matrix_work);
Matrix_Position_Zero(&hasu->tools_class.actor_class.world.position);
hasu->tools_class.enable = 0;
hasu->tools_class.init_matrix = 0;
_texture_z_light_fog_prim_npc(graph);
+5 -5
View File
@@ -46,15 +46,15 @@ static void aTHT1_setupAction(ACTOR*actor, int action){
hat->proc = process[action];
hat->current_id = action;
hat->tools_class.process_id = action;
hat->tools_class.work0 = action;
}
static void aTHT1_actor_move(ACTOR* actor, GAME*){
HAT1_ACTOR* hat = (HAT1_ACTOR*)actor;
if(hat->tools_class.process_id != hat->current_id){
aTHT1_setupAction(actor, hat->tools_class.process_id);
if(hat->tools_class.work0 != hat->current_id){
aTHT1_setupAction(actor, hat->tools_class.work0);
}
hat->proc(actor);
@@ -66,7 +66,7 @@ static void aTHT1_actor_draw(ACTOR* actor, GAME* game){
GRAPH* graph;
Gfx* gfxp;
if(hat->tools_class.enable == 1){
if(hat->tools_class.init_matrix == 1){
graph = game->graph;
OPEN_DISP(graph);
@@ -74,7 +74,7 @@ static void aTHT1_actor_draw(ACTOR* actor, GAME* game){
Matrix_put(&hat->tools_class.matrix_work);
Matrix_Position_Zero(&hat->tools_class.actor_class.world.position);
hat->tools_class.enable = 0;
hat->tools_class.init_matrix = 0;
_texture_z_light_fog_prim_npc(graph);
+5 -5
View File
@@ -46,15 +46,15 @@ static void aTHT2_setupAction(ACTOR*actor, int action){
hat->proc = process[action];
hat->current_id = action;
hat->tools_class.process_id = action;
hat->tools_class.work0 = action;
}
static void aTHT2_actor_move(ACTOR* actor, GAME*){
HAT2_ACTOR* hat = (HAT2_ACTOR*)actor;
if(hat->tools_class.process_id != hat->current_id){
aTHT2_setupAction(actor, hat->tools_class.process_id);
if(hat->tools_class.work0 != hat->current_id){
aTHT2_setupAction(actor, hat->tools_class.work0);
}
hat->proc(actor);
@@ -66,7 +66,7 @@ static void aTHT2_actor_draw(ACTOR* actor, GAME* game){
GRAPH* graph;
Gfx* gfxp;
if(hat->tools_class.enable == 1){
if(hat->tools_class.init_matrix == 1){
graph = game->graph;
OPEN_DISP(graph);
@@ -74,7 +74,7 @@ static void aTHT2_actor_draw(ACTOR* actor, GAME* game){
Matrix_put(&hat->tools_class.matrix_work);
Matrix_Position_Zero(&hat->tools_class.actor_class.world.position);
hat->tools_class.enable = 0;
hat->tools_class.init_matrix = 0;
_texture_z_light_fog_prim_npc(graph);
+5 -5
View File
@@ -46,15 +46,15 @@ static void aTHT3_setupAction(ACTOR*actor, int action){
hat->proc = process[action];
hat->current_id = action;
hat->tools_class.process_id = action;
hat->tools_class.work0 = action;
}
static void aTHT3_actor_move(ACTOR* actor, GAME*){
HAT3_ACTOR* hat = (HAT3_ACTOR*)actor;
if(hat->tools_class.process_id != hat->current_id){
aTHT3_setupAction(actor, hat->tools_class.process_id);
if(hat->tools_class.work0 != hat->current_id){
aTHT3_setupAction(actor, hat->tools_class.work0);
}
hat->proc(actor);
@@ -66,7 +66,7 @@ static void aTHT3_actor_draw(ACTOR* actor, GAME* game){
GRAPH* graph;
Gfx* gfxp;
if(hat->tools_class.enable == 1){
if(hat->tools_class.init_matrix == 1){
graph = game->graph;
OPEN_DISP(graph);
@@ -74,7 +74,7 @@ static void aTHT3_actor_draw(ACTOR* actor, GAME* game){
Matrix_put(&hat->tools_class.matrix_work);
Matrix_Position_Zero(&hat->tools_class.actor_class.world.position);
hat->tools_class.enable = 0;
hat->tools_class.init_matrix = 0;
_texture_z_light_fog_prim_npc(graph);
+105
View File
@@ -0,0 +1,105 @@
#include "ac_t_npc_sao.h"
#include "m_name_table.h"
#include "sys_matrix.h"
static void aTNS_setupAction(ACTOR* actorx, u8 action);
ACTOR_PROFILE T_NpcSao_Profile = {
mAc_PROFILE_T_NPCSAO,
ACTOR_PART_BG,
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_NPC_SAO,
sizeof(NPC_SAO_TOOL_ACTOR),
&aTNS_actor_ct,
NONE_ACTOR_PROC,
&aTNS_actor_move,
&aTNS_actor_draw,
NULL
};
extern void aTNS_actor_ct(ACTOR* actorx, GAME* game) {
aTNS_setupAction(actorx, 1);
}
static void aTNS_destruct(NPC_SAO_TOOL_ACTOR* npc_sao) {
Actor_delete((ACTOR*)npc_sao);
}
static void aTNS_setupAction(ACTOR* actorx, u8 action) {
NPC_SAO_TOOL_ACTOR* npc_sao = (NPC_SAO_TOOL_ACTOR*)actorx;
static aTNS_ACTION_PROC process[] = {
(aTNS_ACTION_PROC)&none_proc1,
(aTNS_ACTION_PROC)&none_proc1,
(aTNS_ACTION_PROC)&none_proc1,
&aTNS_destruct,
(aTNS_ACTION_PROC)&none_proc1,
NULL
};
npc_sao->action_proc = process[action];
npc_sao->action = action;
npc_sao->tool_class.work0 = action;
}
extern void aTNS_actor_move(ACTOR* actorx, GAME* game) {
NPC_SAO_TOOL_ACTOR* npc_sao = (NPC_SAO_TOOL_ACTOR*)actorx;
s16 rotation_y;
ACTOR* parent_actor;
s16 parent_rotation_y;
int temp;
f32 pos_offset;
if (npc_sao->tool_class.work0 != npc_sao->action) {
aTNS_setupAction(actorx, npc_sao->tool_class.work0);
}
(npc_sao->action_proc)(npc_sao);
parent_actor = actorx->parent_actor;
temp = npc_sao->rotation_y;
parent_rotation_y = parent_actor->shape_info.rotation.y;
rotation_y = temp + ((int)(fqrand() * 6.0f + 2.0f) * 256);
npc_sao->pos_x = parent_actor->world.position.x + sin_s(parent_rotation_y) * 100.0f;
npc_sao->pos_y = parent_actor->world.position.y + -20.0f + sin_s(rotation_y) * 1.5f;
npc_sao->pos_z = parent_actor->world.position.z + cos_s(parent_rotation_y) * 100.0f;
npc_sao->rotation_y = rotation_y;
}
extern Gfx tol_npcsao_1_sao_model[];
extern Gfx tol_npcsao_1_uki_model[];
extern void aTNS_actor_draw(ACTOR* actorx, GAME* game) {
NPC_SAO_TOOL_ACTOR* npc_sao = (NPC_SAO_TOOL_ACTOR*)actorx;
GRAPH* g = game->graph;
Gfx* gfx;
if (npc_sao->tool_class.init_matrix == TRUE) {
Matrix_put(&npc_sao->tool_class.matrix_work);
Matrix_Position_Zero(&actorx->world.position);
npc_sao->tool_class.init_matrix = FALSE;
}
else {
Matrix_translate(actorx->world.position.x, actorx->world.position.y, actorx->world.position.z, FALSE);
Matrix_scale(0.01f, 0.01f, 0.01f, TRUE);
}
_texture_z_light_fog_prim_npc(g);
OPEN_DISP(g);
gfx = NOW_POLY_OPA_DISP;
gSPMatrix(gfx++, _Matrix_to_Mtx_new(g), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfx++, tol_npcsao_1_sao_model);
Matrix_translate(npc_sao->pos_x, npc_sao->pos_y, npc_sao->pos_z, FALSE);
Matrix_scale(0.01f, 0.01f, 0.01f, 1);
gSPMatrix(gfx++, _Matrix_to_Mtx_new(g), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfx++, tol_npcsao_1_uki_model);
SET_POLY_OPA_DISP(gfx);
CLOSE_DISP(g);
}
+4 -4
View File
@@ -69,7 +69,7 @@ static void aTPT_setupAction(ACTOR* actor, int idx){
pistol->proc = process[idx];
pistol->current_id = idx;
pistol->tools_class.process_id = idx;
pistol->tools_class.work0 = idx;
scale = start_scale[idx];
pistol->tools_class.actor_class.scale.x = scale;
@@ -81,7 +81,7 @@ static void aTPT_setupAction(ACTOR* actor, int idx){
static void aTPT_actor_move(ACTOR* actor, GAME* game){
PISTOL_ACTOR* pistol = (PISTOL_ACTOR*)actor;
int t = pistol->tools_class.process_id;
int t = pistol->tools_class.work0;
if(t!= pistol->current_id){
aTPT_setupAction(actor, t);
}
@@ -96,10 +96,10 @@ static void aTPT_actor_draw(ACTOR* actor, GAME* game){
OPEN_DISP(graph);
if(pistol->tools_class.enable == 1){
if(pistol->tools_class.init_matrix == 1){
Matrix_put(&pistol->tools_class.matrix_work);
Matrix_Position_Zero(&pistol->tools_class.actor_class.world.position);
pistol->tools_class.enable = 0;
pistol->tools_class.init_matrix = 0;
}
else{
Matrix_translate(pistol->tools_class.actor_class.world.position.x, pistol->tools_class.actor_class.world.position.y,
+3 -3
View File
@@ -59,7 +59,7 @@ static void aTOL_check_data_bank(int id, ACTOR* actor){
}
}
static TOOLS_ACTOR* aTOL_birth_proc(ToolName name, int id, TOOLS_ACTOR* tool,
static TOOLS_ACTOR* aTOL_birth_proc(int name, int id, TOOLS_ACTOR* tool,
GAME_PLAY* play, 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,
@@ -86,7 +86,7 @@ static TOOLS_ACTOR* aTOL_birth_proc(ToolName name, int id, TOOLS_ACTOR* tool,
profile_table[name], 0.0f, 0.0f, 0.0f, 0, 0, 0, -1, 0, arg, -1);
if(child != NULL){
child->process_id = id;
child->work0 = id;
child->tool_name = name;
}
@@ -103,7 +103,7 @@ static int aTOL_chg_request_mode_proc(ACTOR* actor ,TOOLS_ACTOR* tool, int id){
return 0;
}
tool->process_id = id;
tool->work0 = id;
return 1;
}