From c57566f9da4abca5110fd65f3ce39bfac86521c8 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 6 Feb 2021 02:55:51 +0100 Subject: [PATCH] highlights in special modes --- complex.cpp | 15 ++++++ crystal.cpp | 23 +++++++++ dialogs.cpp | 4 ++ menus.cpp | 146 +++++++++++++++++++++++++++++++++++++++++++++------- racing.cpp | 8 +++ 5 files changed, 176 insertions(+), 20 deletions(-) diff --git a/complex.cpp b/complex.cpp index 26a756be..663556ff 100644 --- a/complex.cpp +++ b/complex.cpp @@ -3924,6 +3924,21 @@ EX namespace halloween { items[itOrbShell] += 5; } } + + EX void start_all() { + popScreenAll(); + resetModes('g'); + stampbase = ticks; + if(!sphere) { + stop_game(); + specialland = laHalloween; + set_geometry(gSphere); + start_game(); + pconf.alpha = 999; + pconf.scale = 998; + } + } + EX } // ... also includes the Ivory Tower diff --git a/crystal.cpp b/crystal.cpp index e703a4d3..2ceb4f60 100644 --- a/crystal.cpp +++ b/crystal.cpp @@ -1439,6 +1439,29 @@ string make_help() { ); } +EX void crystal_knight_help() { + gamescreen(1); + dialog::init(); + + dialog::addHelp(XLAT( + "This is a representation of four-dimensional geometry. Can you find the Holy Grail in the center of the Round Table?\n\n" + "In 'Knight of the 16-Cell Table', each cell has 8 adjacent cells, " + "which correspond to 8 adjacent points in the four-dimensional grid. The Round Table has the shape of a 16-cell.\n\n" + "In 'Knight of the 3-Spherical Table', it is the same map, but double bitruncated. The Round Table has the shape of a hypersphere.\n\n" + )); + + dialog::addItem(XLAT("let me understand how the coordinates work"), 'e'); + dialog::add_action([] { cheater = true; view_coordinates = true; compass_probability = 1; restart_game(); popScreenAll(); }); + + dialog::addItem(XLAT("thanks, I need no hints (achievement)"), 't'); + dialog::add_action([] { view_coordinates = false; compass_probability = 0; restart_game(); popScreenAll(); }); + + dialog::addItem(XLAT("more about this geometry..."), 'm'); + dialog::add_action([] { popScreenAll(); pushScreen(show); }); + + dialog::display(); + } + EX void show() { cmode = sm::SIDE | sm::MAYDARK; gamescreen(0); diff --git a/dialogs.cpp b/dialogs.cpp index 55218d09..6bcd69ee 100644 --- a/dialogs.cpp +++ b/dialogs.cpp @@ -136,6 +136,10 @@ EX namespace dialog { add_key_action(key, action); } + EX void extend() { + items.back().key = items[isize(items)-2].key; + } + EX void add_action(const reaction_t& action) { add_key_action_adjust(lastItem().key, action); } diff --git a/menus.cpp b/menus.cpp index 0e0e81f1..b61ea0a8 100644 --- a/menus.cpp +++ b/menus.cpp @@ -518,6 +518,125 @@ EX void show_chaos() { dialog::addBack(); dialog::display(); } + +EX void mode_higlights() { + gamescreen(3); + dialog::init(XLAT("highlights & achievements")); + + dialog::addBigItem(XLAT("Space Rocks"), 'r'); + dialog::add_action(dialog::add_confirmation([] { + popScreenAll(); + stop_game(); + resetModes(); + specialland = laAsteroids; + set_geometry(gKleinQuartic); + set_variation(eVariation::bitruncated); + shmup::on = true; + start_game(); + })); + dialog::addInfo(XLAT("classic game except hyperbolic")); + dialog::extend(); + + dialog::addBigItem(XLAT("Racing in Thurston geometries"), 't'-96); + dialog::add_action(dialog::add_confirmation(racing::start_thurston)); + dialog::addInfo(XLAT("race through a maze in exotic 3D geometry!")); + dialog::extend(); + + dialog::addBigItem(XLAT1("Halloween"), 'Z'); + dialog::add_action(dialog::add_confirmation(halloween::start_all)); + dialog::addInfo(XLAT("Halloween mini-game")); + dialog::extend(); + + dialog::addBigItem(XLAT1("heptagonal mode"), 'H'); + dialog::add_action(dialog::add_confirmation([] { + popScreenAll(); + resetModes('7'); + start_game(); + clearMessages(); + welcomeMessage(); + })); + dialog::addInfo(XLAT("can you find the Heptagonal Grail?")); + dialog::extend(); + + dialog::addBreak(100); + dialog::addBigItem(XLAT1("other achievements:"), 0); + dialog::addItem(XLAT("General Euclid"), 'e'); + dialog::add_action(dialog::add_confirmation([] { + popScreenAll(); + resetModes(); + set_geometry(gEuclid); + firstland = specialland = laMirrorOld; + start_game(); + clearMessages(); + welcomeMessage(); + })); + + dialog::addItem(XLAT("Worm of the World"), 'w'); + dialog::add_action(dialog::add_confirmation([] { + popScreenAll(); + resetModes(); + set_geometry(gZebraQuotient); + firstland = specialland = laDesert; + start_game(); + clearMessages(); + welcomeMessage(); + })); + + if(hiitemsMax(itHolyGrail) || cheater || autocheat) { + dialog::addItem(XLAT("Knight of the 16-Cell Table"), '1'); + dialog::add_action(dialog::add_confirmation([] { + popScreenAll(); + resetModes(); + crystal::set_crystal(8); + firstland = specialland = laCamelot; + start_game(); + clearMessages(); + welcomeMessage(); + pushScreen(crystal::crystal_knight_help); + })); + + dialog::addItem(XLAT("Knight of the 3-Spherical Table"), '3'); + dialog::add_action(dialog::add_confirmation([] { + popScreenAll(); + resetModes(); + crystal::set_crystal(8); + set_variation(eVariation::bitruncated); + set_variation(eVariation::bitruncated); + firstland = specialland = laCamelot; + start_game(); + clearMessages(); + welcomeMessage(); + pushScreen(crystal::crystal_knight_help); + })); + } + else { + dialog::addItem("(locked until you find a Holy Grail)", 0); + } + + dialog::addBreak(100); + dialog::addBigItem(XLAT1("some cool visualizations"), 0); + dialog::addItem(XLAT("Emerald Mine in {5,3,4}"), '5'); + dialog::add_action(dialog::add_confirmation([] { + popScreenAll(); + resetModes(); + specialland = laEmerald; + set_geometry(gSpace534); + check_cgi(); + cgi.require_basics(); + cgi.require_shapes(); + fieldpattern::field_from_current(); + set_geometry(gFieldQuotient); + int p = 2; + for(;; p++) { currfp.Prime = p; currfp.force_hash = 0x72414D0C; if(!currfp.solve()) break; } + start_game(); + clearMessages(); + welcomeMessage(); + })); + + dialog::addBreak(100); + dialog::addBack(); + dialog::display(); + } EX void showChangeMode() { gamescreen(3); @@ -568,6 +687,9 @@ EX void showChangeMode() { #endif dialog::addBreak(50); + + dialog::addItem(XLAT("highlights & achievements"), 'h'); + dialog::add_action_push(mode_higlights); dialog::addBack(); dialog::display(); @@ -867,19 +989,8 @@ EX void showStartMenu() { if(uni == 's') multi::configure(); } - else if(uni == 'Z') { - popScreenAll(); - resetModes('g'); - stampbase = ticks; - if(!sphere) { - stop_game(); - specialland = laHalloween; - set_geometry(gSphere); - start_game(); - pconf.alpha = 999; - pconf.scale = 998; - } - } + else if(uni == 'Z') + halloween::start_all(); #if CAP_RACING && MAXMDIM >= 4 else if(uni == 'r' - 96) { popScreenAll(); @@ -900,13 +1011,8 @@ EX void showStartMenu() { vid.use_smart_range = 1; vid.smart_range_detail = 3; } - else if(uni == 't' - 96) { - stop_game(); - resetModes(); - start_game(); - pushScreen(showStartMenu); - pushScreen(racing::thurston_racing); - } + else if(uni == 't' - 96) + racing::start_thurston(); #endif #if CAP_TOUR else if(uni == 't') { diff --git a/racing.cpp b/racing.cpp index 884e0cc0..61477140 100644 --- a/racing.cpp +++ b/racing.cpp @@ -1488,6 +1488,14 @@ EX void add_debug(cell *c) { } #endif +EX void start_thurston() { + stop_game(); + resetModes(); + start_game(); + pushScreen(showStartMenu); + pushScreen(racing::thurston_racing); + } + #if !CAP_RACING EX always_false on; #endif