mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-05-17 22:54:08 +00:00
preparing for daily
This commit is contained in:
parent
02aac914d4
commit
67ad5f2f4b
@ -90,6 +90,9 @@ bool wrongMode(char flags) {
|
|||||||
if((geometry != gNormal) != (flags == rg::geometry)) return true;
|
if((geometry != gNormal) != (flags == rg::geometry)) return true;
|
||||||
|
|
||||||
if(shmup::on != (flags == rg::shmup)) return true;
|
if(shmup::on != (flags == rg::shmup)) return true;
|
||||||
|
#if CAP_DAILY
|
||||||
|
if(daily::on != (flags == rg::daily)) return true;
|
||||||
|
#endif
|
||||||
if(randomPatternsMode) return true;
|
if(randomPatternsMode) return true;
|
||||||
if(yendor::on) return true;
|
if(yendor::on) return true;
|
||||||
if(peace::on) return true;
|
if(peace::on) return true;
|
||||||
@ -598,6 +601,9 @@ void achievement_final(bool really_final) {
|
|||||||
if(chaosmode) specials++;
|
if(chaosmode) specials++;
|
||||||
if(nonbitrunc) specials++;
|
if(nonbitrunc) specials++;
|
||||||
if(gp::on) specials++;
|
if(gp::on) specials++;
|
||||||
|
#if CAP_DALIY
|
||||||
|
if(daily::on) return;
|
||||||
|
#endif
|
||||||
if(inv::on) specials++;
|
if(inv::on) specials++;
|
||||||
if(specials > 1) return;
|
if(specials > 1) return;
|
||||||
|
|
||||||
|
4
cell.cpp
4
cell.cpp
@ -608,8 +608,8 @@ struct hrmap_quotient : hrmap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int TOT = connections.size() / S7;
|
int TOT = connections.size() / S7;
|
||||||
printf("heptagons = %d\n", TOT);
|
// printf("heptagons = %d\n", TOT);
|
||||||
printf("all cells = %d\n", TOT*(S7+S3)/S3);
|
// printf("all cells = %d\n", TOT*(S7+S3)/S3);
|
||||||
if(!TOT) exit(1);
|
if(!TOT) exit(1);
|
||||||
allh.resize(TOT);
|
allh.resize(TOT);
|
||||||
for(int i=0; i<TOT; i++) allh[i] = new heptagon;
|
for(int i=0; i<TOT; i++) allh[i] = new heptagon;
|
||||||
|
31
hyper.h
31
hyper.h
@ -378,6 +378,7 @@ namespace rg {
|
|||||||
static const char shmup = 's';
|
static const char shmup = 's';
|
||||||
static const char randpattern = 'r';
|
static const char randpattern = 'r';
|
||||||
static const char princess = 'p';
|
static const char princess = 'p';
|
||||||
|
static const char daily = 'd';
|
||||||
|
|
||||||
// wrongmode only -- marks 'global' achievements not related to the current mode
|
// wrongmode only -- marks 'global' achievements not related to the current mode
|
||||||
static const char global = 'x';
|
static const char global = 'x';
|
||||||
@ -3269,3 +3270,33 @@ extern int mutantphase;
|
|||||||
void resize_screen_to(int x, int y);
|
void resize_screen_to(int x, int y);
|
||||||
extern bool canvas_invisible;
|
extern bool canvas_invisible;
|
||||||
extern cell *pd_from;
|
extern cell *pd_from;
|
||||||
|
|
||||||
|
namespace daily {
|
||||||
|
extern bool on;
|
||||||
|
extern int daily_id;
|
||||||
|
void setup();
|
||||||
|
void split();
|
||||||
|
void gifts();
|
||||||
|
}
|
||||||
|
|
||||||
|
enum eOrbLandRelation {
|
||||||
|
olrForbidden, // never appears: forbidden
|
||||||
|
olrDangerous, // never appears: would be dangerous
|
||||||
|
olrUseless, // never appears: useless here
|
||||||
|
olrNoPrizes, // no prizes in this land
|
||||||
|
olrNoPrizeOrb,// orb not allowed as a prize
|
||||||
|
olrPrize25, // prize for collecting 25
|
||||||
|
olrPrize3, // prize for collecting 3
|
||||||
|
olrNative, // native orb in this land
|
||||||
|
olrNative1, // native orb in this land (1)
|
||||||
|
olrGuest, // extra orb in this land
|
||||||
|
olrPNative, // Land of Power: native
|
||||||
|
olrPBasic, // Land of Power: basic orbs
|
||||||
|
olrPPrized, // Land of Power: prized orbs
|
||||||
|
olrPNever, // Land of Power: foreign orbs
|
||||||
|
olrHub, // hub lands
|
||||||
|
olrMonster, // available from a monster
|
||||||
|
olrAlways, // always available
|
||||||
|
olrBurns // burns
|
||||||
|
};
|
||||||
|
|
||||||
|
@ -337,6 +337,10 @@ namespace inv {
|
|||||||
gainOrbs(itMagnet, itOrbMagnetism);
|
gainOrbs(itMagnet, itOrbMagnetism);
|
||||||
gainOrbs(itRuins, itOrbSlaying);
|
gainOrbs(itRuins, itOrbSlaying);
|
||||||
|
|
||||||
|
#if CAP_DAILY
|
||||||
|
daily::gifts();
|
||||||
|
#endif
|
||||||
|
|
||||||
if(items[itOrbLove] && !items[itSavedPrincess]) items[itSavedPrincess] = 1;
|
if(items[itOrbLove] && !items[itSavedPrincess]) items[itSavedPrincess] = 1;
|
||||||
|
|
||||||
int& r = remaining[itGreenStone];
|
int& r = remaining[itGreenStone];
|
||||||
|
@ -2333,10 +2333,16 @@ void setdist(cell *c, int d, cell *from) {
|
|||||||
if(c->land == laWhirlpool && !tactic::on && !yendor::on) setland(c, laOcean);
|
if(c->land == laWhirlpool && !tactic::on && !yendor::on) setland(c, laOcean);
|
||||||
if(c->land == laCamelot && !tactic::on) setland(c, laCrossroads);
|
if(c->land == laCamelot && !tactic::on) setland(c, laCrossroads);
|
||||||
|
|
||||||
|
#if CAP_DAILY
|
||||||
|
if(!daily::on) {
|
||||||
|
#else
|
||||||
|
if(true) {
|
||||||
|
#endif
|
||||||
if(sphere || torus) setLandSphere(c);
|
if(sphere || torus) setLandSphere(c);
|
||||||
else if(euclid) setLandEuclid(c);
|
else if(euclid) setLandEuclid(c);
|
||||||
if(weirdhyperbolic) setLandWeird(c);
|
if(weirdhyperbolic) setLandWeird(c);
|
||||||
if(quotient) { setland(c, specialland); setLandQuotient(c); }
|
if(quotient) { setland(c, specialland); setLandQuotient(c); }
|
||||||
|
}
|
||||||
|
|
||||||
// if(chaosmode) setland(c, getCLand(c));
|
// if(chaosmode) setland(c, getCLand(c));
|
||||||
}
|
}
|
||||||
|
10
menus.cpp
10
menus.cpp
@ -574,13 +574,13 @@ bool showHalloween() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int daily;
|
int daily_mode;
|
||||||
|
|
||||||
void showStartMenu() {
|
void showStartMenu() {
|
||||||
if(!daily) {
|
if(!daily_mode) {
|
||||||
daily = hrand(10) + 1;
|
daily_mode = hrand(10) + 1;
|
||||||
if(showHalloween())
|
if(showHalloween())
|
||||||
daily = 20;
|
daily_mode = 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
gamescreen(2);
|
gamescreen(2);
|
||||||
@ -608,7 +608,7 @@ void showStartMenu() {
|
|||||||
dialog::addInfo(XLAT("learn about hyperbolic geometry!"));
|
dialog::addInfo(XLAT("learn about hyperbolic geometry!"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch(daily) {
|
switch(daily_mode) {
|
||||||
case 1:
|
case 1:
|
||||||
#if CAP_SHMUP_GOOD
|
#if CAP_SHMUP_GOOD
|
||||||
dialog::addBreak(100);
|
dialog::addBreak(100);
|
||||||
|
21
orbgen.cpp
21
orbgen.cpp
@ -141,27 +141,6 @@ const orbinfo& getNativityOrbInfo(eItem orb) {
|
|||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum eOrbLandRelation {
|
|
||||||
olrForbidden, // never appears: forbidden
|
|
||||||
olrDangerous, // never appears: would be dangerous
|
|
||||||
olrUseless, // never appears: useless here
|
|
||||||
olrNoPrizes, // no prizes in this land
|
|
||||||
olrNoPrizeOrb,// orb not allowed as a prize
|
|
||||||
olrPrize25, // prize for collecting 25
|
|
||||||
olrPrize3, // prize for collecting 3
|
|
||||||
olrNative, // native orb in this land
|
|
||||||
olrNative1, // native orb in this land (1)
|
|
||||||
olrGuest, // extra orb in this land
|
|
||||||
olrPNative, // Land of Power: native
|
|
||||||
olrPBasic, // Land of Power: basic orbs
|
|
||||||
olrPPrized, // Land of Power: prized orbs
|
|
||||||
olrPNever, // Land of Power: foreign orbs
|
|
||||||
olrHub, // hub lands
|
|
||||||
olrMonster, // available from a monster
|
|
||||||
olrAlways, // always available
|
|
||||||
olrBurns // burns
|
|
||||||
};
|
|
||||||
|
|
||||||
string olrDescriptions[] = {
|
string olrDescriptions[] = {
|
||||||
"forbidden to find in %the1",
|
"forbidden to find in %the1",
|
||||||
"too dangerous to use in %the1",
|
"too dangerous to use in %the1",
|
||||||
|
@ -181,6 +181,10 @@ void initgame() {
|
|||||||
|
|
||||||
if(shmup::on) shmup::init();
|
if(shmup::on) shmup::init();
|
||||||
|
|
||||||
|
#if CAP_DAILY
|
||||||
|
daily::split();
|
||||||
|
#endif
|
||||||
|
|
||||||
// extern int sightrange; sightrange = 9;
|
// extern int sightrange; sightrange = 9;
|
||||||
// cwt.c->land = laHell; items[itHell] = 10;
|
// cwt.c->land = laHell; items[itHell] = 10;
|
||||||
for(int i=BARLEV; i>=7 - getDistLimit() - genrange_bonus; i--) {
|
for(int i=BARLEV; i>=7 - getDistLimit() - genrange_bonus; i--) {
|
||||||
@ -1184,6 +1188,8 @@ void restartGame(char switchWhat, bool push, bool keep_screens) {
|
|||||||
inv::on = false;
|
inv::on = false;
|
||||||
princess::challenge = false;
|
princess::challenge = false;
|
||||||
}
|
}
|
||||||
|
if(switchWhat == rg::daily)
|
||||||
|
daily::setup();
|
||||||
if(switchWhat == rg::princess) {
|
if(switchWhat == rg::princess) {
|
||||||
princess::challenge = !princess::challenge;
|
princess::challenge = !princess::challenge;
|
||||||
firstland = princess::challenge ? laPalace : laIce;
|
firstland = princess::challenge ? laPalace : laIce;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user