1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-20 00:17:39 +00:00

Major refactoring, multisampling

This commit is contained in:
Zeno Rogue
2017-07-10 20:47:38 +02:00
parent c46ab39d1e
commit 069f7b0caf
31 changed files with 20872 additions and 6856 deletions

View File

@@ -4,12 +4,6 @@
// implementation of the shoot'em up mode
#ifdef MOBILE
#define SHMUPTITLE "shoot'em up mode"
#else
#define SHMUPTITLE "shoot'em up and multiplayer"
#endif
extern int mousex, mousey;
extern bool clicked;
@@ -215,6 +209,8 @@ bool shmupcfg;
bool configdead;
void handleConfig(int sym, int uni);
void showShmupConfig() {
#ifndef NOSDL
@@ -362,6 +358,8 @@ void showShmupConfig() {
dialog::display();
}
keyhandler = handleConfig;
#endif
}
@@ -380,7 +378,7 @@ void handleConfig(int sym, int uni) {
else if(uni == '7') vid.scfg.subconfig = 8;
else if(uni == 'j') vid.scfg.subconfig = SCJOY;
else if(uni == 'a') multi::alwaysuse = !multi::alwaysuse;
else if(uni == 'b') cmode = emJoyConfig;
else if(uni == 'b') pushScreen(showJoyConfig);
else if(uni == 'r')
for(int i=0; i<MAXPLAYER; i++)
kills[i] = deaths[i] = treasures[i] = 0;
@@ -396,20 +394,7 @@ void handleConfig(int sym, int uni) {
if(vid.scfg.players <= 0) vid.scfg.players += MAXPLAYER;
}
else if(sym == SDLK_F1 || uni == '?' || uni == 'h') {
lastmode = cmode;
cmode = emHelp;
/* help =
"In the shmup (shoot'em up) mode, you can play a hyperbolic shoot'em up "
"game. The game is based on the usual turn-based grid-based HyperRogue, "
"but there are some changes. You fight by throwing knives, and you "
"have three extra lives. There are no friendly monsters, so Orbs of "
"Life and Friendship give you extra lives instead. Some other rules have been "
"adapted too.\n\n"
"It is possible for two players to play the shmup mode cooperatively "
"(locally). When playing together, lives, orbs, and treasures are shared, "
"knives recharge slower, orbs drain faster, and player characters are not "
"allowed to separate."; */
gotoHelp("");
help =
XLAT(
@@ -438,8 +423,8 @@ help += XLATN(iinf[itOrbSafety].name); help += "\n\n";
help += XLAT("This menu can be also used to configure keys.\n\n");
}
else if(uni || sym == SDLK_F10) {
cmode = emNormal;
else if(doexiton(sym, uni)) {
popScreen();
if(shmup::on != shmupcfg) { restartGame('s'); resetScores(); }
else if(vid.scfg.players != players) { restartGame(); resetScores(); }
}
@@ -3334,9 +3319,24 @@ void virtualRebase(cell*& base, transmatrix& at, bool tohex) {
void virtualRebase(shmup::monster *m, bool tohex) {
virtualRebase(m->base, m->at, tohex);
}
}
void addShmupHelp(string& out) {
if(shmup::mousetarget && intval(mouseh, tC0(shmup::mousetarget->pat)) < .1) {
out += ", ";
#ifdef ROGUEVIZ
#include "rogueviz.cpp"
if(shmup::mousetarget->type == moRogueviz) {
help = XLAT(minf[shmup::mousetarget->type].help);
out += rogueviz::describe(shmup::mousetarget);
}
else
#endif
{
out += XLAT1(minf[shmup::mousetarget->type].name);
help = generateHelpForMonster(shmup::mousetarget->type);
}
}
}
auto hooks = addHook(clearmemory, 0, shmup::clearMemory);
}