Skip to content

Commit

Permalink
[JP] Entities and World Areas (mac, tik, kgr, kmr, iwa, sbk) (#1199)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrshigure authored Sep 12, 2024
1 parent efd86ab commit 1bcc4ff
Show file tree
Hide file tree
Showing 44 changed files with 5,517 additions and 520 deletions.
29 changes: 29 additions & 0 deletions include/mapfs/mac_00_hit.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
#if VERSION_JP
#define COLLIDER_tt 0x70
#define COLLIDER_deilim 0x6F
#define COLLIDER_op3 0x67
#define COLLIDER_op2 0x66
#define COLLIDER_op_1 0x65
#define COLLIDER_deilit5u 0x57
#define COLLIDER_deilit5 0x56
#define COLLIDER_dummy 0x41
#define COLLIDER_mono6 0x40
#define COLLIDER_mono5 0x3F
#define COLLIDER_mono4 0x3E
#define COLLIDER_mono3 0x3D
#define COLLIDER_mono2 0x3C
#define COLLIDER_mono1 0x3B
#define COLLIDER_deilinw 0x39
#define COLLIDER_o484 0x33
#define COLLIDER_sign 0x32
#define COLLIDER_deilit3u 0x2D
#define COLLIDER_deilit3 0x2C
#define COLLIDER_deilit6u 0x23
#define COLLIDER_deilit6 0x22
#define COLLIDER_deilit 0x1E
#define COLLIDER_water 0x13
#define COLLIDER_deilie 0x10
#define COLLIDER_deilit4u 0x8
#define COLLIDER_deilit4 0x7
#else
#define COLLIDER_Root 0x6E
#define COLLIDER_g74 0x6D
#define COLLIDER_tt 0x6C
Expand Down Expand Up @@ -109,6 +137,7 @@
#define COLLIDER_min2mawari 0x2
#define COLLIDER_o259 0x1
#define COLLIDER_o258 0x0
#endif

#define ZONE_Root 0x12
#define ZONE_g64 0x11
Expand Down
2 changes: 1 addition & 1 deletion include/saved_flag_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ enum GameFlags {
GF_MAC00_DictionaryStolen = GameFlag(0x0F3),
GF_MAC00_DictionaryReturned = GameFlag(0x0F4),
GF_MAC00_TranslatedMysteryNote = GameFlag(0x0F5),
GF_Unused_MAC_74 = GameFlag(0x0F6), ///< presumably for translating the unused SuspiciousNote
GF_MAC00_TranslatedSuspiciousNote = GameFlag(0x0F6),
GF_MAC01_ShyGuyTookOverShop = GameFlag(0x0F7),
GF_MAC00_ShyGuyChasedFromShop = GameFlag(0x0F8),
GF_MAC01_Merlon_Shoo1 = GameFlag(0x0F9),
Expand Down
359 changes: 359 additions & 0 deletions src/recipes_jp.yaml

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions src/world/area_iwa/iwa_00/npc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
#include "world/common/enemy/Whacka.inc.c"

#include "world/common/complete/GiveReward.inc.c"
#if VERSION_JP
#include "world/common/todo/SomeItemEntityFunc.inc.c"
#include "world/common/todo/IsItemBadge.inc.c"
#include "world/common/todo/UnkScriptJP00.inc.c"
#endif

API_CALLABLE(N(func_80240118_90CD58)) {
Enemy* enemy = script->owner1.enemy;
Expand Down
5 changes: 5 additions & 0 deletions src/world/area_iwa/iwa_02/npc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
#include "world/common/npc/Bubulb.inc.c"

#include "world/common/complete/GiveReward.inc.c"
#if VERSION_JP
#include "world/common/todo/SomeItemEntityFunc.inc.c"
#include "world/common/todo/IsItemBadge.inc.c"
#include "world/common/todo/UnkScriptJP00.inc.c"
#endif

NpcData N(NpcData_Cleft_01) = {
.id = NPC_Cleft_01,
Expand Down
5 changes: 5 additions & 0 deletions src/world/area_iwa/iwa_10/npc.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
#include "world/common/npc/Dryite_Stationary.inc.c"

#include "world/common/complete/GiveReward.inc.c"
#if VERSION_JP
#include "world/common/todo/SomeItemEntityFunc.inc.c"
#include "world/common/todo/IsItemBadge.inc.c"
#include "world/common/todo/UnkScriptJP00.inc.c"
#endif

EvtScript N(EVS_NpcInteract_TrainToad_01) = {
Call(GetEntryID, LVar0)
Expand Down
3 changes: 3 additions & 0 deletions src/world/area_iwa/iwa_11/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ MapSettings N(settings) = {
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.background = &gBackgroundImage,
#if VERSION_JP
.tattle = { MSG_MapTattle_018C }
#endif
};
61 changes: 61 additions & 0 deletions src/world/area_kmr/kmr_20/records.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,66 @@ void N(appendGfx_records_impl)(GameRecords* records, s32 alpha) {
#endif

if (alpha > 0) {
#if VERSION_JP
gSPDisplayList(gMainGfxPos++, N(records_screen_gfx));
gDPPipeSync(gMainGfxPos++);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 16, 120, 24, alpha * 0.65);
gDPFillRectangle(gMainGfxPos++, 63, 43, 257, 192);
gDPPipeSync(gMainGfxPos++);

msg_draw_frame(60, 40, 200, 155, MSG_STYLE_INSPECT, MSG_PAL_WHITE, TRUE, alpha * 0.55, alpha);
draw_msg(MSG_CH0_00FC, 88, 50, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
draw_number(gPlayerData.totalCoinsEarned, 194, 50, 1, MSG_PAL_WHITE, alpha, 2);
draw_msg(MSG_CH0_00FD, 124, 65, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
draw_number(records->equippedBadges, 209, 65, 1, MSG_PAL_WHITE, alpha, 3);
draw_msg(MSG_MenuTip_0034, 210, 63, alpha, MSG_PAL_WHITE, 0);
draw_number(80, 222, 65, 1, MSG_PAL_WHITE, alpha, 2);
if (gPlayerData.starPiecesCollected == 0) {
draw_msg(MSG_CH0_00FA, 139, 80, alpha, MSG_PAL_WHITE, 1);
} else {
draw_msg(MSG_CH0_00FB, 96, 80, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
draw_number(gPlayerData.starPiecesCollected, 209, 80, 1, MSG_PAL_WHITE, alpha, 3);
draw_msg(MSG_MenuTip_0034, 210, 78, alpha, MSG_PAL_WHITE, 0);
draw_number(160, 222, 80, 1, MSG_PAL_WHITE, alpha, 2);
}

if (records->recipesFoundCount == 0) {
draw_msg(MSG_CH0_00FA, 140, 95, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
} else {
if (records->recipesFoundCount == -1) {
draw_msg(MSG_CH0_00FE, 103, 95, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
draw_number(0, 209, 95, 1, MSG_PAL_WHITE, alpha, 3);
} else {
draw_msg(MSG_CH0_00FE, 103, 95, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
draw_number(records->recipesFoundCount, 209, 95, 1, MSG_PAL_WHITE, alpha, 3);
}
draw_msg(MSG_MenuTip_0034, 210, 93, alpha, MSG_PAL_WHITE, 0);
draw_number(records->totalRecipesCount, 222, 95, 1, MSG_PAL_WHITE, alpha, 2);
}

if (gPlayerData.quizzesAnswered == 0) {
draw_msg(MSG_CH0_00FA, 139, 110, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
} else {
draw_msg(MSG_CH0_00FF, 94, 110, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
draw_number(gPlayerData.quizzesCorrect, 209, 110, 1, MSG_PAL_WHITE, alpha, 3);
draw_msg(MSG_MenuTip_0034, 210, 108, alpha, MSG_PAL_WHITE, 0);
draw_number(gPlayerData.quizzesAnswered, 222, 110, 1, MSG_PAL_WHITE, alpha, 2);
}

draw_msg(MSG_CH0_00F4, 93, 125, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
draw_number(gPlayerData.battlesCount, 194, 125, 1, MSG_PAL_WHITE, alpha, 2);
draw_msg(MSG_CH0_00F7, 84, 140, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
draw_number(gPlayerData.playerFirstStrikes, 194, 140, 1, MSG_PAL_WHITE, alpha, 2);
draw_msg(MSG_CH0_00F8, 75, 155, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
draw_number(gPlayerData.enemyFirstStrikes, 194, 155, 1, MSG_PAL_WHITE, alpha, 2);

if (gPlayerData.powerBounces == 0) {
draw_msg(MSG_CH0_00FA, 139, 170, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
} else {
draw_msg(MSG_CH0_00F9, 102, 170, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
draw_number(gPlayerData.powerBounces, 194, 170, 1, MSG_PAL_WHITE, alpha, 2);
}
#else
gSPDisplayList(gMainGfxPos++, N(records_screen_gfx));
gDPPipeSync(gMainGfxPos++);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 16, 120, 24, alpha * 0.65);
Expand Down Expand Up @@ -127,6 +187,7 @@ void N(appendGfx_records_impl)(GameRecords* records, s32 alpha) {
draw_msg(MSG_CH0_00F9, 206 - get_msg_width(MSG_CH0_00F9, CHARSET), 170, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
draw_number(gPlayerData.powerBounces, 216, 171, 1, MSG_PAL_WHITE, alpha, 2);
}
#endif
}

#undef CHARSET
Expand Down
22 changes: 22 additions & 0 deletions src/world/area_kmr/kmr_21/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ static TitleDataFile* TitleData;
static IMG_PTR TitleImage;

s32 TitlePrimAlpha = 0;
#if VERSION_JP
s32 TitlePosY = 125;
#else
s32 TitlePosY = 106;
#endif

Gfx N(Gfx_TexSetup_TitleImage)[] = {
gsDPPipeSync(),
Expand Down Expand Up @@ -42,6 +46,19 @@ void worker_render_title_image(void) {
gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, TitlePrimAlpha);
gDPPipeSync(gMainGfxPos++);

#if VERSION_JP
for (i = 0; i < 44; i++) {
gDPLoadTextureTile(gMainGfxPos++, &TitleImage[2176 * i], G_IM_FMT_RGBA, G_IM_SIZ_32b, 272, 112,
0, 0, 271, 1, 0,
G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(gMainGfxPos++,
/* ulx */ 25 * 4,
/* uly */ (i * 2 + TitlePosY) * 4,
/* lrx */ 297 * 4,
/* lry */ ((i * 2 + 2) + TitlePosY) * 4,
G_TX_RENDERTILE, 0, 0, 1024, 1024);
}
#else
for (i = 0; i < 56; i++) {
gDPLoadTextureTile(gMainGfxPos++, &TitleImage[1600 * i], G_IM_FMT_RGBA, G_IM_SIZ_32b, 200, 112,
0, 0, 199, 1, 0,
Expand All @@ -53,6 +70,7 @@ void worker_render_title_image(void) {
/* lry */ ((i * 2 + 2) + TitlePosY) * 4,
G_TX_RENDERTILE, 0, 0, 1024, 1024);
}
#endif
gDPPipeSync(gMainGfxPos++);
}

Expand Down Expand Up @@ -103,7 +121,11 @@ EvtScript N(EVS_Scene_ShowTitle) = {
EndIf
EndLoop
EndThread
#if VERSION_JP
Call(MakeLerp, 125, 75, 100 * DT, EASING_CUBIC_OUT)
#else
Call(MakeLerp, 106, 56, 100 * DT, EASING_CUBIC_OUT)
#endif
Loop(0)
Call(UpdateLerp)
Call(N(SetTitlePosY))
Expand Down
28 changes: 28 additions & 0 deletions src/world/area_kmr/kmr_22/npc.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ NpcSettings N(NpcSettings_Unused) = {
NpcData N(NpcData_Chapter1)[] = {
{
.id = NPC_Eldstar,
#if VERSION_JP
.pos = { -40.0f, 96.0f, 0.0f },
#else
.pos = { -62.0f, 96.0f, 0.0f },
#endif
.yaw = 270,
.init = &N(EVS_NpcInit_Eldstar),
.settings = &N(NpcSettings_Dummy),
Expand Down Expand Up @@ -86,7 +90,11 @@ NpcData N(NpcData_Chapter1)[] = {
NpcData N(NpcData_Chapter2)[] = {
{
.id = NPC_Mamar,
#if VERSION_JP
.pos = { -40.0f, 96.0f, 0.0f },
#else
.pos = { -62.0f, 96.0f, 0.0f },
#endif
.yaw = 270,
.init = &N(EVS_NpcInit_Mamar),
.settings = &N(NpcSettings_Dummy),
Expand Down Expand Up @@ -257,7 +265,11 @@ NpcData N(NpcData_Chapter2)[] = {
NpcData N(NpcData_Chapter3)[] = {
{
.id = NPC_Skolar,
#if VERSION_JP
.pos = { -40.0f, 96.0f, 0.0f },
#else
.pos = { -62.0f, 96.0f, 0.0f },
#endif
.yaw = 270,
.init = &N(EVS_NpcInit_Skolar),
.settings = &N(NpcSettings_Dummy),
Expand Down Expand Up @@ -297,7 +309,11 @@ NpcData N(NpcData_Chapter3)[] = {
NpcData N(NpcData_Chapter4)[] = {
{
.id = NPC_Muskular,
#if VERSION_JP
.pos = { -40.0f, 96.0f, 0.0f },
#else
.pos = { -62.0f, 96.0f, 0.0f },
#endif
.yaw = 270,
.init = &N(EVS_NpcInit_Muskular),
.settings = &N(NpcSettings_Dummy),
Expand Down Expand Up @@ -357,7 +373,11 @@ NpcData N(NpcData_Chapter4)[] = {
NpcData N(NpcData_Chapter5)[] = {
{
.id = NPC_Misstar,
#if VERSION_JP
.pos = { -40.0f, 96.0f, 0.0f },
#else
.pos = { -62.0f, 96.0f, 0.0f },
#endif
.yaw = 270,
.init = &N(EVS_NpcInit_Misstar),
.settings = &N(NpcSettings_Dummy),
Expand Down Expand Up @@ -403,7 +423,11 @@ NpcData N(NpcData_Chapter5)[] = {
NpcData N(NpcData_Chapter6)[] = {
{
.id = NPC_Klevar,
#if VERSION_JP
.pos = { -40.0f, 96.0f, 0.0f },
#else
.pos = { -62.0f, 96.0f, 0.0f },
#endif
.yaw = 270,
.init = &N(EVS_NpcInit_Klevar),
.settings = &N(NpcSettings_Dummy),
Expand Down Expand Up @@ -550,7 +574,11 @@ NpcData N(NpcData_Chapter6)[] = {
NpcData N(NpcData_Chapter7)[] = {
{
.id = NPC_Kalmar,
#if VERSION_JP
.pos = { -40.0f, 96.0f, 0.0f },
#else
.pos = { -62.0f, 96.0f, 0.0f },
#endif
.yaw = 270,
.init = &N(EVS_NpcInit_Kalmar),
.settings = &N(NpcSettings_Dummy),
Expand Down
8 changes: 8 additions & 0 deletions src/world/area_kmr/kmr_23/npc.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,11 @@ EvtScript N(EVS_Scene_EndOfChapter) = {
Wait(30 * DT)
Call(N(FlashScreenWhite))
Call(N(SpinDownStarSpirit), 1800, 100 * DT)
#if VERSION_JP
Call(N(EndOfChapterBounceIn), 64, 0, 55, 60)
#else
Call(N(EndOfChapterBounceIn), 36, 0, 55, 60)
#endif
Thread
Call(N(AddCardAngularVelocity), 0)
EndThread
Expand All @@ -495,7 +499,11 @@ EvtScript N(EVS_Scene_EndOfChapter) = {
Set(LVar1, MSG_Menus_01A5)
Switch(LVar0)
CaseEq(kmr_23_ENTRY_0)
#if VERSION_JP
Set(LVar1, MSG_Menus_JP_01C8)
#else
Set(LVar1, MSG_Menus_01A5)
#endif
CaseEq(kmr_23_ENTRY_1)
Set(LVar1, MSG_Menus_01A6)
CaseEq(kmr_23_ENTRY_2)
Expand Down
23 changes: 23 additions & 0 deletions src/world/area_mac/mac_00/npc/russ_and_thief.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,19 @@ EvtScript N(EVS_ItemPrompt_Dictionary) = {
IfEq(GF_MAC00_TranslatedMysteryNote, TRUE)
Call(SpeakToPlayer, NPC_SELF, ANIM_RussT_Talk, ANIM_RussT_Idle, 0, MSG_MAC_Gate_0010)
EndIf
#if VERSION_JP
IfEq(GF_MAC00_TranslatedSuspiciousNote, TRUE)
Call(SpeakToPlayer, NPC_SELF, ANIM_RussT_Talk, ANIM_RussT_Idle, 0, MSG_MAC_Gate_JP_0011)
EndIf
#endif
CaseEq(ITEM_MYSTERY_NOTE)
Call(SpeakToPlayer, NPC_SELF, ANIM_RussT_Talk, ANIM_RussT_Idle, 0, MSG_MAC_Gate_000F)
Set(GF_MAC00_TranslatedMysteryNote, TRUE)
#if VERSION_JP
CaseEq(ITEM_SUSPICIOUS_NOTE)
Call(SpeakToPlayer, NPC_SELF, ANIM_RussT_Talk, ANIM_RussT_Idle, 0, MSG_MAC_Gate_0122)
Set(GF_MAC00_TranslatedSuspiciousNote, TRUE)
#endif
CaseEq(-1)
Call(SpeakToPlayer, NPC_SELF, ANIM_RussT_Talk, ANIM_RussT_Idle, 0, MSG_MAC_Gate_000C)
CaseEq(0)
Expand All @@ -327,13 +337,26 @@ EvtScript N(EVS_ItemPrompt_Documents) = {
Return
EndIf
Else
#if VERSION_JP
IfEq(GF_MAC00_TranslatedSuspiciousNote, TRUE)
Call(SpeakToPlayer, NPC_SELF, ANIM_RussT_Talk, ANIM_RussT_Idle, 0, MSG_MAC_Gate_JP_0011)
Set(LVarA, 1)
Return
EndIf
#endif
EndIf
CaseEq(-1)
CaseDefault
IfEq(LVar0, ITEM_MYSTERY_NOTE)
Call(SpeakToPlayer, NPC_SELF, ANIM_RussT_Talk, ANIM_RussT_Idle, 0, MSG_MAC_Gate_000E)
Set(GF_MAC00_TranslatedMysteryNote, TRUE)
Set(LVarA, 1)
#if VERSION_JP
Else
Call(SpeakToPlayer, NPC_SELF, ANIM_RussT_Talk, ANIM_RussT_Idle, 0, MSG_MAC_Gate_0121)
Set(GF_MAC00_TranslatedSuspiciousNote, TRUE)
Set(LVarA, 1)
#endif
EndIf
EndSwitch
Return
Expand Down
Loading

0 comments on commit 1bcc4ff

Please sign in to comment.