From 7e0a78f7bbea3946bc14dd82e32cd21c02552635 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 15 May 2018 23:26:04 +0200 Subject: [PATCH] some work on daily --- compileunits.h | 2 ++ hyper.h | 6 +++++- menus.cpp | 16 +++++++++++++++- orbgen.cpp | 5 ++++- quit.cpp | 9 ++++++++- system.cpp | 5 ++++- 6 files changed, 38 insertions(+), 5 deletions(-) diff --git a/compileunits.h b/compileunits.h index 556c80c9..00284f3b 100644 --- a/compileunits.h +++ b/compileunits.h @@ -93,6 +93,8 @@ bool inv::activating; #if CAP_DAILY #include "private/daily.cpp" +#else +namespace daily { bool on; } #endif #endif diff --git a/hyper.h b/hyper.h index f82d3d28..a8da54b0 100644 --- a/hyper.h +++ b/hyper.h @@ -378,6 +378,7 @@ namespace rg { static const char randpattern = 'r'; static const char princess = 'p'; static const char daily = 'd'; + static const char daily_off = 'D'; // wrongmode only -- marks 'global' achievements not related to the current mode static const char global = 'x'; @@ -1047,7 +1048,7 @@ extern bool safety; #define SAGEMELT .1 #define TEMPLE_EACH 6 -#define PT(x, y) ((tactic::on || quotient == 2) ? (y) : inv::on ? min(2*(y),x) : (x)) +#define PT(x, y) ((tactic::on || quotient == 2 || daily::on) ? (y) : inv::on ? min(2*(y),x) : (x)) #define ROCKSNAKELENGTH 50 #define WORMLENGTH 15 #define PUREHARDCORE_LEVEL 10 @@ -3277,6 +3278,9 @@ namespace daily { void setup(); void split(); void gifts(); + void turnoff(); + void showMenu(); + int find_daily_lbid(int id); } enum eOrbLandRelation { diff --git a/menus.cpp b/menus.cpp index 2ae1e20e..fd8dbd34 100644 --- a/menus.cpp +++ b/menus.cpp @@ -460,6 +460,9 @@ void showChangeMode() { dialog::addBoolItem(XLAT("Yendor Challenge"), (yendor::on), 'y'); dialog::addBoolItem(XLAT("%1 Challenge", moPrincess), (princess::challenge), 'P'); dialog::addBoolItem(XLAT("random pattern mode"), (randomPatternsMode), 'r'); +#if CAP_DAILY + dialog::addBoolItem(XLAT("Strange Challenge"), (randomPatternsMode), 'z'); +#endif dialog::addBreak(50); // cheating and map editor @@ -480,6 +483,11 @@ void showChangeMode() { if(xuni == 'v' || sym == SDLK_ESCAPE) popScreen(); + #if CAP_DAILY + else if(uni == 'z') + pushScreen(daily::showMenu); + #endif + else if(uni == 'c') { if(tactic::on && gold()) { addMessage(XLAT("Not available in the pure tactics mode!")); @@ -799,7 +807,13 @@ void showStartMenu() { void setAppropriateOverview() { clearMessages(); - if(viewdists) + if(daily::on) { +#if CAP_DAILY + achievement_final(false); + pushScreen(daily::showMenu); +#endif + } + else if(viewdists) runGeometryExperiments(); else if(tactic::on) pushScreen(tactic::showMenu); diff --git a/orbgen.cpp b/orbgen.cpp index 5f7921c8..54fae742 100644 --- a/orbgen.cpp +++ b/orbgen.cpp @@ -379,6 +379,7 @@ eLand getPrizeLand(cell *c = cwt.c) { void placePrizeOrb(cell *c) { if(peace::on) return; + if(daily::on) return; eLand l = getPrizeLand(c); @@ -437,6 +438,7 @@ void placeLocalOrbs(cell *c) { if(isGravityLand(l) && cellEdgeUnstable(c)) return; if(isElemental(l)) l = laElementalWall; if(peace::on) return; + if(daily::on) return; for(int i=0; iland)] >= treasureForLocal() && !inv::on) c->item = nativeOrbType(c->land); @@ -481,6 +483,7 @@ void placeLocalSpecial(cell *c, int outof, int loc=1, int priz=1) { void placeCrossroadOrbs(cell *c) { if(peace::on) return; + if(daily::on) return; for(int i=0; i