Merge branch 'master' into ac_ev_ghost

This commit is contained in:
Cuyler36
2024-01-16 06:03:22 -05:00
6 changed files with 144 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
#include "ac_mikuji.h"
#include "m_rcp.h"
#include "sys_matrix.h"
#include "m_name_table.h"
#include "bg_item.h"
#include "m_player_lib.h"
#include "m_field_info.h"
#include "m_demo.h"
#include "m_common_data.h"
static void aMIK_actor_ct(ACTOR* actor, GAME* game);
static void aMIK_actor_init(ACTOR* actor, GAME* game);
static void aMIK_actor_draw(ACTOR* actor, GAME* game);
ACTOR_PROFILE Mikuji_Profile = {
mAc_PROFILE_MIKUJI,
ACTOR_PART_ITEM,
ACTOR_STATE_TA_SET,
NEWYEAR_TABLE,
ACTOR_OBJ_BANK_KEEP,
sizeof(MIKUJI_ACTOR),
&aMIK_actor_ct,
NONE_ACTOR_PROC,
&aMIK_actor_init,
&aMIK_actor_draw,
NULL
};
extern Vtx obj_e_mikuji_shadow_v[];
extern Gfx obj_e_mikuji_shadow_model[];
u8 aMIK_shadow_vtx_fix_flg_table[] = {1,0,0,1,0,1,1,0};
bIT_ShadowData_c aMIK_shadow_data = {
8,
aMIK_shadow_vtx_fix_flg_table,
60.0f,
obj_e_mikuji_shadow_v,
obj_e_mikuji_shadow_model,
};
extern Gfx obj_e_mikuji_model[];
static void aMIK_set_bgOffset(MIKUJI_ACTOR* mikuji, int offs);
static void aMIK_actor_ct(ACTOR* actor, GAME* game)
{
aMIK_set_bgOffset((MIKUJI_ACTOR*)actor, 1);
}
#include "../src/ac_mikuji_move.c_inc"
#include "../src/ac_mikuji_draw.c_inc"
+24
View File
@@ -0,0 +1,24 @@
static void aMIK_actor_draw(ACTOR* actor, GAME* game){
MIKUJI_ACTOR* mikuji = (MIKUJI_ACTOR*)actor;
Mtx* cur;
GRAPH* graph = game->graph;
u16* pal;
Gfx* gfx;
OPEN_DISP(graph);
pal = Common_Get(clip.structure_clip)->get_pal_segment_proc(aSTR_PAL_MIKUJI);
cur = _Matrix_to_Mtx_new(graph);
if(cur != NULL){
_texture_z_light_fog_prim_npc(graph);
gfx = NOW_POLY_OPA_DISP;
gSPMatrix(gfx++, cur, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfx++, obj_e_mikuji_model);
SET_POLY_OPA_DISP(gfx);
Common_Get(clip.bg_item_clip)->draw_shadow_proc(game, &aMIK_shadow_data, 0);
}
CLOSE_DISP(graph);
}
+50
View File
@@ -0,0 +1,50 @@
static void aMIK_set_bgOffset(MIKUJI_ACTOR* mikuji, int offs)
{
static mCoBG_OffsetTable_c height_table_ct[] = { { 0x64, 2, 0, 2, 2, 2, 1 },
{ 0x64, 6, 6, 6, 6, 0, 1 },
{ 0x64, 2, 2, 0, 2, 2, 1 },
{ 0x64, 2, 2, 2, 0, 2, 1 } };
static mCoBG_OffsetTable_c* height_table[] = { height_table_ct, height_table_ct };
static f32 addX[] = { 0.0f, 40.0f };
static f32 addZ[] = { 40.0f, 80.0f };
mCoBG_OffsetTable_c* offset;
int i;
xyz_t pos;
offset = height_table[offs];
for(i = 0; i < 2; i++){
pos.z = mikuji->actor_class.home.position.z + addZ[i];
pos.x = mikuji->actor_class.home.position.x + addX[0];
mCoBG_SetPluss5PointOffset_file(pos, *offset, __FILE__, 97);
offset++;
pos.x = mikuji->actor_class.home.position.x + addX[1];
mCoBG_SetPluss5PointOffset_file(pos, *offset, __FILE__, 101);
offset++;
}
}
static void aMIK_actor_move(ACTOR* actor, GAME* game){
int world_bx, world_bz;
int player_bx, player_bz;
PLAYER_ACTOR* player_actor = get_player_actor_withoutCheck((GAME_PLAY*)game);
mFI_Wpos2BlockNum(&world_bx, &world_bz, actor->world.position);
mFI_Wpos2BlockNum(&player_bx, &player_bz, player_actor->actor_class.world.position);
if (
mDemo_Check(mDemo_TYPE_SCROLL, (ACTOR*)player_actor) == FALSE &&
mDemo_Check(mDemo_TYPE_SCROLL2, (ACTOR*)player_actor) == FALSE &&
mDemo_Check(mDemo_TYPE_SCROLL3, (ACTOR*)player_actor) == FALSE &&
(world_bx != player_bx || world_bz != player_bz)
) {
Actor_delete(actor);
}
}
static void aMIK_actor_init(ACTOR* actor, GAME* game){
mFI_SetFG_common(DUMMY_MIKUJI, actor->home.position, 0);
aMIK_actor_move(actor, game);
actor->mv_proc = &aMIK_actor_move;
}