1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 17:10:36 +00:00

CAP_TOUR guards added, more exported in hyper.h, general cleanup

This commit is contained in:
Zeno Rogue 2018-02-08 22:27:12 +01:00
parent 6c5ce655bb
commit 2a59ff7ab2
12 changed files with 101 additions and 53 deletions

View File

@ -142,8 +142,6 @@ void setbarrier(cell *c) {
c->wall = waBarrier;
c->land = laBarrier;
}
/*if(isHive(c->barleft) && isHive(c->barright))
c->wall = waWaxWall, c->land = c->barleft; */
}
void setland(cell *c, eLand l) {
@ -795,6 +793,6 @@ bool buildBarrierNowall(cell *c, eLand l2, bool force) {
}
}
return false;
return false;
}

View File

@ -192,10 +192,6 @@ heptagon *getDodecahedron(int i) {
// --- euclidean geometry ---
cell*& euclideanAtCreate(int vec);
static const int max_vec = (1<<14);
// NOTE: patterns assume that pair_to_vec(0,1) % 3 == 2!
// Thus, pair_to_vec(0,1) must not be e.g. a power of four
@ -1062,8 +1058,6 @@ bool randpattern(cell *c, int rval) {
return 0;
}
extern int randompattern[landtypes];
string describeRPM(eLand l) {
int rval = randompattern[l];
switch(rval%5) {

View File

@ -1612,8 +1612,6 @@ const landtype linf[landtypes] = {
},
};
struct landtacinfo { eLand l; int tries, multiplier; };
vector<landtacinfo> land_tac = {
{laIce, 10, 1}, {laDesert, 10, 1},
{laHunting, 5, 2},

View File

@ -231,3 +231,4 @@ enum cpatterntype {
cpFootball, cpThree, cpChess, cpSingle, cpLarge, cpZebra, cpUnknown
};
struct landtacinfo { eLand l; int tries, multiplier; };

View File

@ -348,7 +348,10 @@ void initConfig() {
}
bool inSpecialMode() {
return chaosmode || nonbitrunc || peace::on || tour::on ||
return chaosmode || nonbitrunc || peace::on ||
#if CAP_TOUR
tour::on ||
#endif
yendor::on || tactic::on || randomPatternsMode ||
geometry != gNormal || pmodel != mdDisk || vid.alpha != 1 || vid.scale != 1 ||
rug::rugged || vid.monmode != DEFAULT_MONMODE ||

View File

@ -842,6 +842,7 @@ bool handleCompass() {
if(!haveMobileCompass()) return false;
using namespace shmupballs;
int dx = mousex - xmove;
int dy = mousey - yb;
int h = hypot(dx, dy);

View File

@ -65,5 +65,5 @@ int main(int argc, char **argv) {
profile_info();
return 0;
}
#endif
#endif
#endif

86
hyper.h
View File

@ -1162,6 +1162,7 @@ extern bool timerghost;
#endif
namespace dialog {
extern string highlight_text;
enum tDialogItem {diTitle, diItem, diBreak, diHelp, diInfo, diSlider, diBigItem};
@ -2184,6 +2185,11 @@ namespace princess {
extern bool gotoPrincess;
extern bool forceMouse;
extern bool challenge;
extern bool squeaked;
extern bool saved;
extern bool nodungeon;
extern int reviveAt;
extern bool forceVizier;
struct info {
int id; // id of this info
@ -2564,3 +2570,83 @@ double randd();
transmatrix getOrientation();
#endif
bool showHalloween();
extern bool havesave;
extern vector<msginfo> gamelog;
extern time_t savetime;
extern bool cblind;
extern void save_memory();
namespace inv { void init(); }
extern bool survivalist;
extern bool hauntedWarning;
extern bool usedSafety;
namespace elec { extern int lightningfast; }
extern int lastkills;
extern map<cell*, int> rosemap;
extern int hardcoreAt;
extern flagtype havewhat, hadwhat;
extern int safetyseed;
extern int lastsafety;
extern int knighted;
extern int rosephase;
extern int rosewave;
extern eItem localTreasureType();
extern void clearshadow();
extern bool seenSevenMines;
extern vector<cell*> dcal; // queue for cpdist
extern vector<cell*> pathq; // queue for pathdist
extern vector<pair<cell*, int> > butterflies;
extern vector<cell*> crush_now, crush_next;
extern void shrand(int seed);
extern eLand safetyland;
extern int sagephase;
extern int lastsize;
extern int noiseuntil;
inline hyperpoint xpush0(ld x);
extern eGeometry targetgeometry;
inline hyperpoint xspinpush0(ld alpha, ld x);
#define DF_INIT 0 // always display these
#define DF_MSG 0 // always display these
#define DF_STEAM 1
#define DF_GRAPH 2
#define DF_TURN 4
#define DF_FIELD 8
#if ISANDROID
#define DEBB(r,x)
#else
#define DEBB(r,x) { if(debugfile && (!(r) || (debugflags & (r)))) { fprintf x; fflush(debugfile); } }
#endif
extern FILE *debugfile;
extern int debugflags;
int gmod(int i, int j);
extern walltype winf[walltypes];
extern vector<landtacinfo> land_tac;
string llts(long long i);
void clearMemoRPM();
extern int randompattern[landtypes];
extern int pair_to_vec(int x, int y);
cell*& euclideanAtCreate(int vec);
bool isCyclic(eLand l);
bool generateAll(eLand l);
void extendcheck(cell *c);
void extendNowall(cell *c);
bool isbar4(cell *c);
void extendBarrierFront(cell *c);
void extendBarrierBack(cell *c);
void extendCR5(cell *c);
bool mirrorwall(cell *c);
extern void setbarrier(cell *c);
extern function<void()> call_initgame;
extern void initializeCLI();
static const int max_vec = (1<<14);
extern void popGame();
string helptitle(string s, int col);
pair<int, int> cell_to_pair(cell *c);
extern bool nohud, nofps;

View File

@ -416,7 +416,6 @@ void gldraw(int useV, const transmatrix& V, int ps, int pq, int col, int outline
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_TEXTURE_2D);
}
}
#endif

View File

@ -333,8 +333,12 @@ void showMission() {
dialog::addInfo(XLAT("CONGRATULATIONS!"), iinf[itOrbYendor].color);
}
else {
if(tour::on)
if(0)
;
#if CAP_TOUR
else if(tour::on)
;
#endif
else if(princess::challenge)
dialog::addInfo(XLAT("Follow the Mouse and escape with %the1!", moPrincess));
else if(gold() < R30)

View File

@ -35,14 +35,7 @@ void welcomeMessage() {
items[itGreenStone] = 99;
addMessage(XLAT("Welcome to %the1 Challenge!", moPrincess));
addMessage(XLAT("The more Hypersian Rugs you collect, the harder it is.", moPrincess));
}
/* if(tactic::on && isCrossroads(firstland)) {
for(int i=0; i<ittypes; i++)
if(itemclass(eItem(i)) == IC_TREASURE && i != itHyperstone)
items[i] = 10;
kills[moYeti] = 1000;
} */
}
else if(randomPatternsMode)
addMessage(XLAT("Welcome to the Random Pattern mode!"));
else if(tactic::on)
@ -725,8 +718,6 @@ long long saveposition = -1;
void remove_emergency_save() {
#if !ISWINDOWS
if(saveposition >= 0) {
/* if(!timerghost)
addMessage(XLAT("Emergency truncate to ") + its(saveposition)); */
if(truncate(scorefile, saveposition)) {}
saveposition = -1;
}
@ -831,16 +822,6 @@ void saveStats(bool emergency = false) {
if(multi::players > 1) fprintf(f, "Multi-player (%d players)\n", multi::players);
fprintf(f, "Number of cells explored, by distance from the player:\n");
{for(int i=0; i<10; i++) fprintf(f, " %d", explore[i]);} fprintf(f, "\n");
/*for(int j=0; j<landtypes; j++) {
bool haveland = false;
for(int i=0; i<10; i++)
if(exploreland[i][j])
haveland = true;
if(haveland)
for(int i=0; i<10; i++)
fprintf(f, " %d", exploreland[i][j]);
fprintf(f, " %s\n", linf[j].name);
} */
if(kills[0]) fprintf(f, "walls melted: %d\n", kills[0]);
fprintf(f, "cells travelled: %d\n", celldist(cwt.c));
@ -1207,7 +1188,7 @@ void restartGame(char switchWhat, bool push, bool keep_screens) {
resetmusic();
resetmusic();
}
purehookset clearmemory;
void clearMemory() {
@ -1233,4 +1214,3 @@ addHook(hooks_removecells, 0, [] () {
for(int i=0; i<SHSIZE; i++) for(int p=0; p<MAXPLAYER; p++)
set_if_removed(shpos[p][i], NULL);
});;

View File

@ -68,22 +68,6 @@ ld frac(ld x) {
// debug utilities
extern FILE *debugfile;
extern int debugflags;
#if ISANDROID
#define DEBB(r,x)
#else
#define DEBB(r,x) { if(debugfile && (!(r) || (debugflags & (r)))) { fprintf x; fflush(debugfile); } }
#endif
#define DF_INIT 0 // always display these
#define DF_MSG 0 // always display these
#define DF_STEAM 1
#define DF_GRAPH 2
#define DF_TURN 4
#define DF_FIELD 8
#if CAP_PROFILING
#include <sys/time.h>