preparing for daily

This commit is contained in:
Zeno Rogue 2018-05-01 00:21:18 +02:00
parent 02aac914d4
commit 67ad5f2f4b
8 changed files with 64 additions and 32 deletions

View File

@ -90,6 +90,9 @@ bool wrongMode(char flags) {
if((geometry != gNormal) != (flags == rg::geometry)) 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(yendor::on) return true;
if(peace::on) return true;
@ -598,6 +601,9 @@ void achievement_final(bool really_final) {
if(chaosmode) specials++;
if(nonbitrunc) specials++;
if(gp::on) specials++;
#if CAP_DALIY
if(daily::on) return;
#endif
if(inv::on) specials++;
if(specials > 1) return;

View File

@ -608,8 +608,8 @@ struct hrmap_quotient : hrmap {
}
int TOT = connections.size() / S7;
printf("heptagons = %d\n", TOT);
printf("all cells = %d\n", TOT*(S7+S3)/S3);
// printf("heptagons = %d\n", TOT);
// printf("all cells = %d\n", TOT*(S7+S3)/S3);
if(!TOT) exit(1);
allh.resize(TOT);
for(int i=0; i<TOT; i++) allh[i] = new heptagon;

31
hyper.h
View File

@ -378,6 +378,7 @@ namespace rg {
static const char shmup = 's';
static const char randpattern = 'r';
static const char princess = 'p';
static const char daily = 'd';
// wrongmode only -- marks 'global' achievements not related to the current mode
static const char global = 'x';
@ -3269,3 +3270,33 @@ extern int mutantphase;
void resize_screen_to(int x, int y);
extern bool canvas_invisible;
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
};

View File

@ -337,6 +337,10 @@ namespace inv {
gainOrbs(itMagnet, itOrbMagnetism);
gainOrbs(itRuins, itOrbSlaying);
#if CAP_DAILY
daily::gifts();
#endif
if(items[itOrbLove] && !items[itSavedPrincess]) items[itSavedPrincess] = 1;
int& r = remaining[itGreenStone];

View File

@ -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 == laCamelot && !tactic::on) setland(c, laCrossroads);
if(sphere || torus) setLandSphere(c);
else if(euclid) setLandEuclid(c);
if(weirdhyperbolic) setLandWeird(c);
if(quotient) { setland(c, specialland); setLandQuotient(c); }
#if CAP_DAILY
if(!daily::on) {
#else
if(true) {
#endif
if(sphere || torus) setLandSphere(c);
else if(euclid) setLandEuclid(c);
if(weirdhyperbolic) setLandWeird(c);
if(quotient) { setland(c, specialland); setLandQuotient(c); }
}
// if(chaosmode) setland(c, getCLand(c));
}

View File

@ -574,13 +574,13 @@ bool showHalloween() {
return false;
}
int daily;
int daily_mode;
void showStartMenu() {
if(!daily) {
daily = hrand(10) + 1;
if(!daily_mode) {
daily_mode = hrand(10) + 1;
if(showHalloween())
daily = 20;
daily_mode = 20;
}
gamescreen(2);
@ -608,7 +608,7 @@ void showStartMenu() {
dialog::addInfo(XLAT("learn about hyperbolic geometry!"));
#endif
switch(daily) {
switch(daily_mode) {
case 1:
#if CAP_SHMUP_GOOD
dialog::addBreak(100);

View File

@ -141,27 +141,6 @@ const orbinfo& getNativityOrbInfo(eItem orb) {
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[] = {
"forbidden to find in %the1",
"too dangerous to use in %the1",

View File

@ -181,6 +181,10 @@ void initgame() {
if(shmup::on) shmup::init();
#if CAP_DAILY
daily::split();
#endif
// extern int sightrange; sightrange = 9;
// cwt.c->land = laHell; items[itHell] = 10;
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;
princess::challenge = false;
}
if(switchWhat == rg::daily)
daily::setup();
if(switchWhat == rg::princess) {
princess::challenge = !princess::challenge;
firstland = princess::challenge ? laPalace : laIce;