mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
ac_nameplate ok
This commit is contained in:
@@ -545,19 +545,22 @@ ac_dump.c:
|
||||
.text: [0x805AE704, 0x805AECE8]
|
||||
.rodata: [0x8064A7E8,0x8064A808]
|
||||
.data: [0x806C5018, 0x806C5120]
|
||||
ac_nameplate.c:
|
||||
.text: [0x805B63FC,0x805B65C4]
|
||||
.data: [0x806C6110,0x806C6138]
|
||||
ac_radio.c:
|
||||
.text: [0x805B887C,0x805B8C7C]
|
||||
.rodata: [0x8064AB58,0x8064AB68]
|
||||
.data: [0x806C6558,0x806C65A0]
|
||||
ac_tama.c:
|
||||
.text: [0x805BDDF4, 0x805BE06C]
|
||||
.rodata: [0x8064AC78, 0x8064AC80]
|
||||
.data: [0x806C7110, 0x806C7140]
|
||||
ac_structure.c:
|
||||
.text: [0x805BCA00, 0x805BD06C]
|
||||
.rodata: [0x8064AC30, 0x8064AC38]
|
||||
.data: [0x806C6C00, 0x806C6ED0]
|
||||
.bss: [0x813280F0, 0x8133DEB0]
|
||||
ac_tama.c:
|
||||
.text: [0x805BDDF4, 0x805BE06C]
|
||||
.rodata: [0x8064AC78, 0x8064AC80]
|
||||
.data: [0x806C7110, 0x806C7140]
|
||||
ac_toudai.c:
|
||||
.text: [0x805BEA00, 0x805BFC28]
|
||||
.rodata: [0x8064ACB0,0x8064AD28]
|
||||
|
||||
@@ -10,6 +10,11 @@ extern "C" {
|
||||
|
||||
extern ACTOR_PROFILE Nameplate_Profile;
|
||||
|
||||
typedef struct nameplate_actor_s{
|
||||
ACTOR actor_class;
|
||||
u8 pad[0x2D8 - 0x170];
|
||||
}NAMEPLATE_ACTOR;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2131,6 +2131,7 @@ extern mActor_name_t mNT_FishIdx2FishItemNo(int idx);
|
||||
#define DUMMY_RADIO 0xF109
|
||||
#define DUMMY_TAMA 0xF110
|
||||
#define DUMMY_DOUZOU 0xF11D
|
||||
#define DUMMY_NAMEPLATE 0xF11F
|
||||
|
||||
#define RSV_DOOR 0xFE1B
|
||||
#define RSV_FE1C 0xFE1C
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
#include "ac_nameplate.h"
|
||||
#include "m_npc.h"
|
||||
#include "m_lib.h"
|
||||
#include "m_name_table.h"
|
||||
#include "m_field_info.h"
|
||||
#include "m_demo.h"
|
||||
#include "m_player_lib.h"
|
||||
|
||||
extern void aNP_actor_init(ACTOR* actor, GAME* game);
|
||||
|
||||
ACTOR_PROFILE Nameplate_Profile = {
|
||||
mAc_PROFILE_NAMEPLATE,
|
||||
ACTOR_PART_ITEM,
|
||||
ACTOR_STATE_TA_SET,
|
||||
ACTOR_PROP_VILLAGER_SIGNBOARD,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(NAMEPLATE_ACTOR),
|
||||
NONE_ACTOR_PROC,
|
||||
NONE_ACTOR_PROC,
|
||||
aNP_actor_init,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static void aNP_set_talk_info(ACTOR* actor) {
|
||||
rgba_t color;
|
||||
u8 name[ANIMAL_NAME_LEN];
|
||||
|
||||
mNpc_GetAnimalPlateName(name, actor->world.position);
|
||||
mMsg_Set_free_str(mMsg_Get_base_window_p(), 0, name, ANIMAL_NAME_LEN);
|
||||
mDemo_Set_msg_num(0x1369);
|
||||
mDemo_Set_talk_display_name(0);
|
||||
mDemo_Set_ListenAble();
|
||||
mDemo_Set_camera(TRUE);
|
||||
mPlib_Set_able_hand_all_item_in_demo(TRUE);
|
||||
color.r = 205;
|
||||
color.g = 120;
|
||||
color.b = 0;
|
||||
color.a = 255;
|
||||
mDemo_Set_talk_window_color(&color);
|
||||
}
|
||||
|
||||
static void aNP_actor_move(ACTOR* actor, GAME_PLAY* play) {
|
||||
PLAYER_ACTOR* player;
|
||||
s16 player_angle;
|
||||
int angle;
|
||||
|
||||
if ((mDemo_Check(7, actor) == 0) && (mDemo_Check(8,actor) == 0)) {
|
||||
player = GET_PLAYER_ACTOR(play);
|
||||
if ((player != NULL) && (player->actor_class.world.position.z >= actor->world.position.z)) {
|
||||
player_angle = actor->player_angle_y;
|
||||
angle = (player_angle >= 0) ? player_angle : -player_angle;
|
||||
if (angle < 0x2000) {
|
||||
mDemo_Request(7, actor, aNP_set_talk_info);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern void aNP_actor_init(ACTOR* actor, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
mFI_SetFG_common(DUMMY_NAMEPLATE, actor->home.position, 0);
|
||||
aNP_actor_move(actor, play);
|
||||
actor->mv_proc = (mActor_proc)(aNP_actor_move);
|
||||
}
|
||||
Reference in New Issue
Block a user