Skip to content

Commit

Permalink
th11: allow specifying MarisaB subshot
Browse files Browse the repository at this point in the history
  • Loading branch information
32th-System committed Feb 16, 2025
1 parent 70e122d commit de5a3a6
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 4 deletions.
15 changes: 14 additions & 1 deletion thprac/src/thprac/thprac_games_def.json
Original file line number Diff line number Diff line change
Expand Up @@ -3643,7 +3643,13 @@
"namespace": "TH11",

"glossary": {
"TH11_SIGNAL": [ "信号强度", "C. Gauge", "交信強度" ]
"TH11_SIGNAL": [ "信号强度", "C. Gauge", "交信強度" ],
"TH11_MARISAB_FORMATION_LABEL": [ "配置", "Formation", "配置" ],
"TH11_MARISAB_FIRE": [ "火符", "Fire", "火符" ],
"TH11_MARISAB_WATER": [ "水符", "Water", "水符" ],
"TH11_MARISAB_WOOD": [ "木符", "Wood", "木符" ],
"TH11_MARISAB_METAL": [ "金符", "Metal", "金符" ],
"TH11_MARISAB_EARTH": [ "土符", "Earth", "土符" ]
},

"sections": {
Expand Down Expand Up @@ -4213,6 +4219,13 @@
"TH_P3",
"TH_P4",
"TH_RAGE"
],
"TH11_MARISAB_FORMATION": [
"TH11_MARISAB_FIRE",
"TH11_MARISAB_WATER",
"TH11_MARISAB_WOOD",
"TH11_MARISAB_METAL",
"TH11_MARISAB_EARTH"
]
}
},
Expand Down
29 changes: 28 additions & 1 deletion thprac/src/thprac/thprac_locale_def.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace THPrac {

const char* th_glossary_str[3][850]
const char* th_glossary_str[3][856]
{
{
"",
Expand Down Expand Up @@ -128,6 +128,12 @@ const char* th_glossary_str[3][850]
"信仰条",
"不掉信仰",
"TH10 东方风神录 ~ Mountain of Faith.",
"土符",
"火符",
"配置",
"金符",
"水符",
"木符",
"信号强度",
"TH11 东方地灵殿 ~ Subterranean Animism.",
"TH12.3 东方非想天则 ~ 追寻特大型人偶之谜",
Expand Down Expand Up @@ -980,6 +986,12 @@ const char* th_glossary_str[3][850]
"Faith Bar",
"No faith loss",
"TH10 Mountain of Faith",
"Earth",
"Fire",
"Formation",
"Metal",
"Water",
"Wood",
"C. Gauge",
"TH11 Subterranean Animism",
"TH12.3 Touhou Hisoutensoku",
Expand Down Expand Up @@ -1832,6 +1844,12 @@ const char* th_glossary_str[3][850]
"カウンター",
"信仰点を減少させない",
"TH10 東方風神録 ~ Mountain of Faith.",
"土符",
"火符",
"配置",
"金符",
"水符",
"木符",
"交信強度",
"TH11 東方地霊殿 ~ Subterranean Animism.",
"TH12.3 東方非想天則 ~ 超弩級ギニョルの謎を追え",
Expand Down Expand Up @@ -9860,6 +9878,15 @@ const th_glossary_t TH11_SPELL_5PHASE[6]
TH_RAGE,
};

const th_glossary_t TH11_MARISAB_FORMATION[6]
{
TH11_MARISAB_FIRE,
TH11_MARISAB_WATER,
TH11_MARISAB_WOOD,
TH11_MARISAB_METAL,
TH11_MARISAB_EARTH,
};

}

namespace TH12 {
Expand Down
10 changes: 9 additions & 1 deletion thprac/src/thprac/thprac_locale_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ enum th_glossary_t
TH10_FAITH_BAR,
TH10_NO_FAITH_LOSS,
TH10_TITLE,
TH11_MARISAB_EARTH,
TH11_MARISAB_FIRE,
TH11_MARISAB_FORMATION_LABEL,
TH11_MARISAB_METAL,
TH11_MARISAB_WATER,
TH11_MARISAB_WOOD,
TH11_SIGNAL,
TH11_TITLE,
TH123_TITLE,
Expand Down Expand Up @@ -862,7 +868,7 @@ enum th_glossary_t
TH_WARP,
};

extern const char* th_glossary_str[3][850];
extern const char* th_glossary_str[3][856];

extern const th_glossary_t TH_TYPE_SELECT[13];

Expand Down Expand Up @@ -1502,6 +1508,8 @@ extern const th_sections_t th_sections_cbt[7][2][20];

extern const th_glossary_t TH11_SPELL_5PHASE[6];

extern const th_glossary_t TH11_MARISAB_FORMATION[6];

}

namespace TH12 {
Expand Down
26 changes: 25 additions & 1 deletion thprac/src/thprac/thprac_th11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@

namespace THPrac {
namespace TH11 {
struct Player {
char gap0[0x8bab];
int32_t marisa_b_formation;
};
static_assert(offsetof(Player, marisa_b_formation) == 0x8bac);

enum addrs {
CHARA = 0x4a5710,
SUBSHOT = 0x4a5714,
PLAYER_PTR = 0x4a8eb4,
};

using std::pair;
struct THPracParam {
int32_t mode;
Expand All @@ -17,6 +29,7 @@ namespace TH11 {
int32_t signal;
int32_t value;
int64_t score;
int32_t marisa_b_formation;

bool dlg;

Expand All @@ -42,6 +55,7 @@ namespace TH11 {
GetJsonValue(signal);
GetJsonValue(value);
GetJsonValue(score);
GetJsonValue(marisa_b_formation);

return true;
}
Expand All @@ -67,6 +81,7 @@ namespace TH11 {
AddJsonValue(signal);
AddJsonValue(value);
AddJsonValue(score);
AddJsonValue(marisa_b_formation);

ReturnJson();
}
Expand Down Expand Up @@ -139,6 +154,7 @@ namespace TH11 {
thPracParam.signal = 0;
thPracParam.value = *mValue;
thPracParam.score = *mScore;
thPracParam.marisa_b_formation = *mMarisaBFormation;
break;
case 4:
Close();
Expand Down Expand Up @@ -218,6 +234,10 @@ namespace TH11 {
mValue.RoundDown(10);
mScore();
mScore.RoundDown(10);

if (GetMemContent<uint32_t>(CHARA) == 1 && GetMemContent(SUBSHOT) == 1) {
mMarisaBFormation();
}
}

mNavFocus();
Expand Down Expand Up @@ -309,6 +329,7 @@ namespace TH11 {
Gui::GuiCombo mMode { TH_MODE, TH_MODE_SELECT };
Gui::GuiCombo mStage { TH_STAGE, TH_STAGE_SELECT };
Gui::GuiCombo mWarp { TH_WARP, TH_WARP_SELECT };
Gui::GuiCombo mMarisaBFormation { TH11_MARISAB_FORMATION_LABEL, TH11_MARISAB_FORMATION };
Gui::GuiCombo mSection { TH_MODE };
Gui::GuiCombo mPhase { TH_PHASE };
Gui::GuiCheckBox mDlg { TH_DLG };
Expand All @@ -323,7 +344,7 @@ namespace TH11 {

Gui::GuiNavFocus mNavFocus { TH_STAGE, TH_MODE, TH_WARP, TH_DLG,
TH_MID_STAGE, TH_END_STAGE, TH_NONSPELL, TH_SPELL, TH_PHASE, TH_CHAPTER,
TH_LIFE, TH_FAITH, TH_SCORE, TH_POWER, TH_GRAZE };
TH_LIFE, TH_FAITH, TH_SCORE, TH_POWER, TH_GRAZE, TH11_MARISAB_FORMATION_LABEL };

int mChapterSetup[7][2] {
{ 2, 2 },
Expand Down Expand Up @@ -1728,6 +1749,9 @@ namespace TH11 {
score /= 10;
*target = *((uint32_t*)&score);

Player* player = GetMemContent<Player*>(PLAYER_PTR);
player->marisa_b_formation = thPracParam.marisa_b_formation;

THSectionPatch();
}
thPracParam._playLock = true;
Expand Down

0 comments on commit de5a3a6

Please # to comment.