Skip to content

Commit

Permalink
Add manticore states
Browse files Browse the repository at this point in the history
  • Loading branch information
Dregu committed Aug 24, 2024
1 parent 0f01144 commit 11654d3
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
4 changes: 4 additions & 0 deletions max.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,10 @@ uint8_t *Max::portals() { return (uint8_t *)(slot() + 0x418 + 0x223); }

uint8_t *Max::shards() { return (uint8_t *)(slot() + 0x418 + 0x1F4 + 0xa); }

uint16_t *Max::progress() { return (uint16_t *)(slot() + 0x418 + 0x21c); }

uint8_t *Max::manticore() { return (uint8_t *)(slot() + 0x418 + 0x1F0); }

Pause *Max::pause() {
return (Pause *)((*(size_t *)get_address("slots") + 0x93608));
};
Expand Down
2 changes: 2 additions & 0 deletions max.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ struct Max {
uint16_t *squirrels();
uint8_t *portals();
uint8_t *shards();
uint16_t *progress();
uint8_t *manticore();
Pause *pause();
uint32_t *timer();
void save_game();
Expand Down
46 changes: 44 additions & 2 deletions ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

const char s8_zero = 0, s8_one = 1, s8_fifty = 50, s8_min = -128, s8_max = 127;
const ImU8 u8_zero = 0, u8_one = 1, u8_fifty = 50, u8_min = 0, u8_max = 255,
u8_five = 5;
u8_five = 5, u8_two = 2;
const short s16_zero = 0, s16_one = 1, s16_fifty = 50, s16_min = -32768,
s16_max = 32767;
const ImU16 u16_zero = 0, u16_one = 1, u16_fifty = 50, u16_min = 0,
Expand Down Expand Up @@ -221,6 +221,10 @@ std::array asset_type_names{
"Text", "Binary", "PNG", "Ogg", "4", "Sprite", "6", "Shader", "Font",
};

std::array progress_names{
"Game Started", "Unknown", "Ready to hatch", "Show HP", "Drop House Key",
};

const std::map<std::string, PLAYER_INPUT> notes{
{"A4", (PLAYER_INPUT)(PLAYER_INPUT::RIGHT | PLAYER_INPUT::LB)},
{"A#4",
Expand Down Expand Up @@ -655,6 +659,19 @@ void UI::DrawPlayer() {
}
}
}
{
bool all = *Max::get().manticore() == 2 && *(Max::get().manticore() + 1);
if (ImGui::Checkbox("Tame both manticores##TameAllManticores2", &all) ||
everything) {
if (everything || all) {
*Max::get().manticore() = 2;
*(Max::get().manticore() + 1) = 2;
} else {
*Max::get().manticore() = 0;
*(Max::get().manticore() + 1) = 0;
}
}
}
{
bool all = (*Max::get().portals() & 0xfe) == 0xfe;
if (ImGui::Checkbox("Unlock all portals##UnlockAllPortals2", &all) ||
Expand Down Expand Up @@ -820,6 +837,12 @@ void UI::DrawPlayer() {
}
ImGui::PopID();
}
if (ImGui::CollapsingHeader("Progress##PlayerProgress")) {
ImGui::PushID("PlayerSectionProgress");
DebugPtr(Max::get().progress());
Flags(progress_names, Max::get().progress());
ImGui::PopID();
}
if (ImGui::CollapsingHeader("Eggs##PlayerEggs")) {
ImGui::PushID("PlayerSectionEggs");
DebugPtr(Max::get().eggs());
Expand Down Expand Up @@ -1024,6 +1047,25 @@ void UI::DrawPlayer() {
}
ImGui::PopID();
}
if (ImGui::CollapsingHeader("Manticores##PlayerManticores")) {
ImGui::PushID("PlayerSectionManticores");
DebugPtr(Max::get().manticore());
bool all = *Max::get().manticore() == 2 && *(Max::get().manticore() + 1);
if (ImGui::Checkbox("Tame both manticores##TameAllManticores", &all)) {
if (all) {
*Max::get().manticore() = 2;
*(Max::get().manticore() + 1) = 2;
} else {
*Max::get().manticore() = 0;
*(Max::get().manticore() + 1) = 0;
}
}
ImGui::SliderScalar("Blue##BlueManticoreSlider", ImGuiDataType_U8,
Max::get().manticore(), &u8_zero, &u8_two);
ImGui::SliderScalar("Red##RedManticoreSlider", ImGuiDataType_U8,
Max::get().manticore() + 1, &u8_zero, &u8_two);
ImGui::PopID();
}
if (ImGui::CollapsingHeader("Animal head portals##PlayerPortals")) {
ImGui::PushID("PlayerSectionPortals");
DebugPtr(Max::get().portals());
Expand Down Expand Up @@ -2644,7 +2686,7 @@ void UI::Cheats() {
*(Max::get().player_hp() + 1) = 4;
*Max::get().keys() = 9;
*(Max::get().keys() + 1) = 9;
*(Max::get().keys() + 2) = 255;
*(Max::get().keys() + 2) = 6;
}
}

Expand Down

0 comments on commit 11654d3

Please sign in to comment.