mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
link kago
This commit is contained in:
@@ -618,6 +618,9 @@ ac_dump.c:
|
||||
.text: [0x805AE704, 0x805AECE8]
|
||||
.rodata: [0x8064A7E8,0x8064A808]
|
||||
.data: [0x806C5018, 0x806C5120]
|
||||
ac_kago.c:
|
||||
.text: [0x805B1A08, 0x805B1D50]
|
||||
.data: [0x806C5750, 0x806C57A8]
|
||||
ac_nameplate.c:
|
||||
.text: [0x805B63FC,0x805B65C4]
|
||||
.data: [0x806C6110,0x806C6138]
|
||||
|
||||
@@ -3,11 +3,17 @@
|
||||
|
||||
#include "types.h"
|
||||
#include "m_actor.h"
|
||||
#include "ac_structure.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct actor_kago_s{
|
||||
STRUCTURE_ACTOR structure_class;
|
||||
}KAGO_ACTOR;
|
||||
|
||||
|
||||
extern ACTOR_PROFILE Kago_Profile;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
#include "ac_kago.h"
|
||||
|
||||
#include "m_name_table.h"
|
||||
#include "m_common_data.h"
|
||||
#include "m_field_info.h"
|
||||
#include "m_collision_bg.h"
|
||||
#include "sys_matrix.h"
|
||||
#include "m_player_lib.h"
|
||||
|
||||
static void aKAG_actor_ct(ACTOR*,GAME*);
|
||||
static void aKAG_actor_init(ACTOR*,GAME*);
|
||||
static void aKAG_actor_draw(ACTOR*,GAME*);
|
||||
|
||||
|
||||
ACTOR_PROFILE Kago_Profile = {
|
||||
mAc_PROFILE_KAGO,
|
||||
ACTOR_PART_ITEM,
|
||||
ACTOR_STATE_TA_SET,
|
||||
SPORTSFAIR_BASKET_RED,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(KAGO_ACTOR),
|
||||
&aKAG_actor_ct,
|
||||
NONE_ACTOR_PROC,
|
||||
&aKAG_actor_init,
|
||||
&aKAG_actor_draw,
|
||||
NULL
|
||||
};
|
||||
|
||||
extern Vtx obj_e_kago_shadow_v[];
|
||||
extern Gfx obj_e_kago_shadow_model[];
|
||||
|
||||
u8 aKAG_shadow_vtx_fix_flg_table[] = {1,0,0,1,1,0,0,1,0,1,0,0,1};
|
||||
bIT_ShadowData_c aKAG_shadow_data = {
|
||||
13,
|
||||
aKAG_shadow_vtx_fix_flg_table,
|
||||
60.0f,
|
||||
obj_e_kago_shadow_v,
|
||||
obj_e_kago_shadow_model,
|
||||
};
|
||||
|
||||
void aKAG_set_bgOffset(KAGO_ACTOR*, int);
|
||||
void aKAG_setup_action(KAGO_ACTOR*, int);
|
||||
|
||||
void aKAG_actor_ct(ACTOR* actor, GAME*){
|
||||
KAGO_ACTOR* kago = (KAGO_ACTOR*)actor;
|
||||
|
||||
kago->structure_class.action = actor->npc_id - SPORTSFAIR_BASKET_RED;
|
||||
kago->structure_class.structure_type = kago->structure_class.action + aSTR_TYPE_SPORTSFAIR_A;
|
||||
kago->structure_class.structure_pal = kago->structure_class.action + aSTR_PAL_KAGO_R;
|
||||
aKAG_setup_action(kago,0);
|
||||
aKAG_set_bgOffset(kago,1);
|
||||
}
|
||||
|
||||
#include "../src/ac_kago_move.c_inc"
|
||||
|
||||
#include "../src/ac_kago_draw.c_inc"
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
extern Gfx kago_r_DL_model[];
|
||||
extern Gfx kago_w_DL_model[];
|
||||
|
||||
static void aKAG_actor_draw(ACTOR* actor, GAME* game) {
|
||||
static Gfx* model[] = {kago_r_DL_model, kago_w_DL_model};
|
||||
|
||||
KAGO_ACTOR* kago = (KAGO_ACTOR*)actor;
|
||||
GRAPH* graph = game->graph;
|
||||
|
||||
u16* pal = (*Common_Get(clip).structure_clip->get_pal_segment_proc)(kago->structure_class.structure_pal);
|
||||
Gfx* gfx;
|
||||
Mtx* mtx;
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
mtx = _Matrix_to_Mtx_new(graph);
|
||||
|
||||
if(mtx != NULL){
|
||||
_texture_z_light_fog_prim(graph);
|
||||
gfx = NOW_POLY_OPA_DISP;
|
||||
gSPSegment(gfx++, G_MWO_SEGMENT_8, pal);
|
||||
gSPMatrix(gfx++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gfx++, model[kago->structure_class.action]);
|
||||
SET_POLY_OPA_DISP(gfx);
|
||||
Common_Get(clip.bg_item_clip)->draw_shadow_proc(game, &aKAG_shadow_data, 0);
|
||||
}
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
void aKAG_set_bgOffset(KAGO_ACTOR* actor, int id){
|
||||
id = id == 0 ? 10 : 10;
|
||||
|
||||
mCoBG_SetPlussOffset(actor->structure_class.actor_class.home.position, id, 100);
|
||||
}
|
||||
|
||||
void aKAG_wait(ACTOR*, GAME*){
|
||||
|
||||
}
|
||||
|
||||
void aKAG_setup_action(KAGO_ACTOR* kago, int id) {
|
||||
static aSTR_MOVE_PROC process[] = {
|
||||
aKAG_wait,
|
||||
};
|
||||
|
||||
kago->structure_class.action_proc = process[id];
|
||||
kago->structure_class.arg0 = id;
|
||||
}
|
||||
|
||||
|
||||
void aKAG_actor_move(ACTOR* actor, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
KAGO_ACTOR* kago = (KAGO_ACTOR*)actor;
|
||||
|
||||
PLAYER_ACTOR* player;
|
||||
int bx;
|
||||
int bz;
|
||||
int playerbx;
|
||||
int playerbz;
|
||||
|
||||
player = GET_PLAYER_ACTOR(play);
|
||||
mFI_Wpos2BlockNum(&bx, &bz, actor->world.position);
|
||||
|
||||
mFI_Wpos2BlockNum(&playerbx, &playerbz, player->actor_class.world.position);
|
||||
|
||||
if ((mDemo_Check(mDemo_TYPE_SCROLL, &player->actor_class) == 0) &&
|
||||
(mDemo_Check(mDemo_TYPE_SCROLL2, &player->actor_class) == 0) &&
|
||||
(mDemo_Check(mDemo_TYPE_SCROLL3, &player->actor_class) == 0) && ((bx != playerbx) || (bz != playerbz))) {
|
||||
Actor_delete(actor);
|
||||
} else {
|
||||
kago->structure_class.action_proc(&kago->structure_class.actor_class, &play->game);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void aKAG_actor_init(ACTOR* actor, GAME* game){
|
||||
|
||||
mFI_SetFG_common(0xF111, actor->home.position, 0);
|
||||
aKAG_actor_move(actor,game);
|
||||
actor->mv_proc = aKAG_actor_move;
|
||||
}
|
||||
Reference in New Issue
Block a user