1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-20 12:20:01 +00:00

shmup replaced with random special mode in start menu; use current settings in the start menu

This commit is contained in:
Zeno Rogue 2018-03-24 16:00:13 +01:00
parent 17dc4c7e83
commit e24ae3f717
3 changed files with 139 additions and 21 deletions

View File

@ -4,8 +4,8 @@
videopar vid;
#define DEFAULT_WALLMODE ISMOBILE ? 3 : 5
#define DEFAULT_MONMODE ISMOBILE ? 2 : 4
#define DEFAULT_WALLMODE (ISMOBILE ? 3 : 5)
#define DEFAULT_MONMODE (ISMOBILE ? 2 : 4)
#if ISANDROID
#define ANDROID_SETTINGS settingsChanged = true;
@ -359,6 +359,30 @@ bool inSpecialMode() {
vid.wallmode != DEFAULT_WALLMODE;
}
bool have_current_settings() {
int modecount = 0;
if(inv::on) modecount++;
if(shmup::on) modecount += 10;
if(tour::on) modecount += 10;
if(chaosmode) modecount += 10;
if(nonbitrunc) modecount += 10;
if(peace::on) modecount += 10;
if(yendor::on) modecount += 10;
if(tactic::on) modecount += 10;
if(randomPatternsMode) modecount += 10;
if(geometry != gNormal) modecount += 10;
if(vid.xposition || vid.yposition || vid.alpha != 1 || vid.scale != 1)
return true;
if(pmodel != mdDisk || vid.monmode != DEFAULT_MONMODE || vid.wallmode != DEFAULT_WALLMODE)
return true;
if(firstland != laIce || vid.scfg.players != 1 || rug::rugged)
return true;
if(modecount > 1)
return true;
return false;
}
void resetModes(char leave) {
popAllGames();
firstland = laIce; vid.scfg.players = 1;

View File

@ -2870,3 +2870,5 @@ ld hypot2(const hyperpoint& h);
transmatrix pushxto0(const hyperpoint& H);
transmatrix rpushxto0(const hyperpoint& H);
transmatrix spintox(const hyperpoint& H);
extern int ewhichscreen;

130
menus.cpp
View File

@ -421,6 +421,15 @@ void switchHardcore() {
if(pureHardcore()) popScreenAll();
}
void help_nochaos() {
gotoHelp(
"In the Chaos mode, lands change very often, and "
"there are no walls between them. "
"Some lands are incompatible with this."
"\n\nYou need to reach Crossroads IV to unlock the Chaos mode."
);
}
void showChangeMode() {
gamescreen(3);
dialog::init(XLAT("special game modes"));
@ -509,12 +518,7 @@ void showChangeMode() {
#endif
else if(uni == 'C') {
if(chaosUnlocked) restartGame('C');
if(chaosmode) gotoHelp(
"In the Chaos mode, lands change very often, and "
"there are no walls between them. "
"Some lands are incompatible with this."
"\n\nYou need to reach Crossroads IV to unlock the Chaos mode."
);
if(chaosmode) help_nochaos();
}
else if(xuni == 'P') {
if(!princess::everSaved)
@ -565,7 +569,15 @@ bool showHalloween() {
return false;
}
int daily;
void showStartMenu() {
if(!daily) {
daily = hrand(10) + 1;
if(showHalloween())
daily = 20;
}
gamescreen(2);
getcstat = ' ';
@ -585,31 +597,73 @@ void showStartMenu() {
dialog::addInfo(XLAT("use your Orbs in tough situations"));
#endif
#if CAP_SHMUP_GOOD
dialog::addBreak(100);
dialog::addBigItem(XLAT("shoot'em up mode"), 's');
dialog::addInfo(XLAT("continuous spacetime"));
#if CAP_ACHIEVE
dialog::addInfo(XLAT("(most achievements are not available)"));
#endif
#endif
#if CAP_TOUR
dialog::addBreak(100);
dialog::addBigItem(XLAT("tutorial"), 't');
dialog::addInfo(XLAT("learn about hyperbolic geometry!"));
#endif
switch(daily) {
case 1:
#if CAP_SHMUP_GOOD
dialog::addBreak(100);
dialog::addBigItem(XLAT("shoot'em up mode"), 's');
dialog::addInfo(XLAT("continuous spacetime"));
#if CAP_ACHIEVE
dialog::addInfo(XLAT("(most achievements are not available)"));
#endif
#endif
break;
case 2:
dialog::addBreak(100);
dialog::addBigItem(XLAT("heptagonal mode"), '7');
dialog::addInfo(XLAT("more curvature"));
dialog::addInfo(XLAT("(most achievements are not available)"));
break;
case 3:
dialog::addBreak(100);
dialog::addBigItem(XLAT("geometry experiments"), 'g');
dialog::addInfo(XLAT("(most achievements are not available)"));
break;
case 4:
if(chaosUnlocked) {
dialog::addBreak(100);
dialog::addBigItem(XLAT("Chaos mode"), 'C');
dialog::addInfo(XLAT("(most achievements are not available)"));
}
break;
case 5:
dialog::addBreak(100);
dialog::addBigItem(XLAT("hypersian rug mode"), 'M');
dialog::addInfo(XLAT("see the true form"));
break;
case 6:
dialog::addBreak(100);
dialog::addBigItem(XLAT("texture mode"), 'T');
dialog::addInfo(XLAT("paint pictures"));
break;
case 20:
dialog::addBreak(100);
dialog::addBigItem(XLAT1("Halloween"), 'z');
dialog::addInfo(XLAT("Halloween mini-game"));
break;
}
#if CAP_ROGUEVIZ && CAP_TOUR
dialog::addBreak(100);
dialog::addBigItem(XLAT("RogueViz"), 'r');
dialog::addInfo(XLAT("see the visualizations"));
#endif
if(showHalloween()) {
if(have_current_settings()) {
dialog::addBreak(100);
dialog::addBigItem(XLAT1("Halloween"), 'z');
dialog::addInfo(XLAT("Halloween mini-game"));
dialog::addBigItem(XLAT1("use current/saved settings"), SDLK_ESCAPE);
}
dialog::addBreak(100);
@ -635,7 +689,45 @@ void showStartMenu() {
keyhandler = [] (int sym, int uni) {
dialog::handleNavigation(sym, uni);
if(uni == 'o') uni = 'i';
if(uni == 'c' || uni == 'i' || uni == 's') {
else if(uni == 'M') {
rug::init();
popScreenAll();
resetModes('c');
clearMessages();
welcomeMessage();
vid.wallmode = 3;
vid.monmode = 2;
rug::model_distance *= 2;
rug::init();
}
else if(uni == 'T') {
popScreenAll();
resetModes('c');
clearMessages();
welcomeMessage();
using namespace texture;
if(config.data.whitetexture() && config.data.loadTextureGL()) {
config.tstate = config.tstate_max = tsActive;
config.perform_mapping();
config.finish_mapping();
mapeditor::initdraw(cwt.c);
pushScreen(showMenu);
pushScreen(mapeditor::showDrawEditor);
}
}
else if(uni == 'g') {
popScreenAll();
resetModes('c');
clearMessages();
welcomeMessage();
pushScreen(showEuclideanMenu);
ewhichscreen = 2;
}
else if(uni == 'c' || uni == 'i' || uni == 's' || uni == 'C' || uni == '7') {
if(uni == 'C' && !chaosUnlocked) {
help_nochaos();
return;
}
popScreenAll();
resetModes(uni);
clearMessages();