some work on daily

This commit is contained in:
Zeno Rogue 2018-05-15 23:26:04 +02:00
parent 586101e0d6
commit 7e0a78f7bb
6 changed files with 38 additions and 5 deletions

View File

@ -93,6 +93,8 @@ bool inv::activating;
#if CAP_DAILY #if CAP_DAILY
#include "private/daily.cpp" #include "private/daily.cpp"
#else
namespace daily { bool on; }
#endif #endif
#endif #endif

View File

@ -378,6 +378,7 @@ namespace rg {
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'; static const char daily = 'd';
static const char daily_off = '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';
@ -1047,7 +1048,7 @@ extern bool safety;
#define SAGEMELT .1 #define SAGEMELT .1
#define TEMPLE_EACH 6 #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 ROCKSNAKELENGTH 50
#define WORMLENGTH 15 #define WORMLENGTH 15
#define PUREHARDCORE_LEVEL 10 #define PUREHARDCORE_LEVEL 10
@ -3277,6 +3278,9 @@ namespace daily {
void setup(); void setup();
void split(); void split();
void gifts(); void gifts();
void turnoff();
void showMenu();
int find_daily_lbid(int id);
} }
enum eOrbLandRelation { enum eOrbLandRelation {

View File

@ -460,6 +460,9 @@ void showChangeMode() {
dialog::addBoolItem(XLAT("Yendor Challenge"), (yendor::on), 'y'); dialog::addBoolItem(XLAT("Yendor Challenge"), (yendor::on), 'y');
dialog::addBoolItem(XLAT("%1 Challenge", moPrincess), (princess::challenge), 'P'); dialog::addBoolItem(XLAT("%1 Challenge", moPrincess), (princess::challenge), 'P');
dialog::addBoolItem(XLAT("random pattern mode"), (randomPatternsMode), 'r'); dialog::addBoolItem(XLAT("random pattern mode"), (randomPatternsMode), 'r');
#if CAP_DAILY
dialog::addBoolItem(XLAT("Strange Challenge"), (randomPatternsMode), 'z');
#endif
dialog::addBreak(50); dialog::addBreak(50);
// cheating and map editor // cheating and map editor
@ -480,6 +483,11 @@ void showChangeMode() {
if(xuni == 'v' || sym == SDLK_ESCAPE) popScreen(); if(xuni == 'v' || sym == SDLK_ESCAPE) popScreen();
#if CAP_DAILY
else if(uni == 'z')
pushScreen(daily::showMenu);
#endif
else if(uni == 'c') { else if(uni == 'c') {
if(tactic::on && gold()) { if(tactic::on && gold()) {
addMessage(XLAT("Not available in the pure tactics mode!")); addMessage(XLAT("Not available in the pure tactics mode!"));
@ -799,7 +807,13 @@ void showStartMenu() {
void setAppropriateOverview() { void setAppropriateOverview() {
clearMessages(); clearMessages();
if(viewdists) if(daily::on) {
#if CAP_DAILY
achievement_final(false);
pushScreen(daily::showMenu);
#endif
}
else if(viewdists)
runGeometryExperiments(); runGeometryExperiments();
else if(tactic::on) else if(tactic::on)
pushScreen(tactic::showMenu); pushScreen(tactic::showMenu);

View File

@ -379,6 +379,7 @@ eLand getPrizeLand(cell *c = cwt.c) {
void placePrizeOrb(cell *c) { void placePrizeOrb(cell *c) {
if(peace::on) return; if(peace::on) return;
if(daily::on) return;
eLand l = getPrizeLand(c); eLand l = getPrizeLand(c);
@ -437,6 +438,7 @@ void placeLocalOrbs(cell *c) {
if(isGravityLand(l) && cellEdgeUnstable(c)) return; if(isGravityLand(l) && cellEdgeUnstable(c)) return;
if(isElemental(l)) l = laElementalWall; if(isElemental(l)) l = laElementalWall;
if(peace::on) return; if(peace::on) return;
if(daily::on) return;
for(int i=0; i<ORBLINES; i++) { for(int i=0; i<ORBLINES; i++) {
const orbinfo& oi(orbinfos[i]); const orbinfo& oi(orbinfos[i]);
@ -471,7 +473,7 @@ void placeLocalOrbs(cell *c) {
} }
void placeLocalSpecial(cell *c, int outof, int loc=1, int priz=1) { void placeLocalSpecial(cell *c, int outof, int loc=1, int priz=1) {
if(peace::on || safety) return; if(peace::on || safety || daily::on) return;
int i = hrand(outof); int i = hrand(outof);
if(i < loc && items[treasureType(c->land)] >= treasureForLocal() && !inv::on) if(i < loc && items[treasureType(c->land)] >= treasureForLocal() && !inv::on)
c->item = nativeOrbType(c->land); 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) { void placeCrossroadOrbs(cell *c) {
if(peace::on) return; if(peace::on) return;
if(daily::on) return;
for(int i=0; i<ORBLINES; i++) { for(int i=0; i<ORBLINES; i++) {
const orbinfo& oi(orbinfos[i]); const orbinfo& oi(orbinfos[i]);
if(!(oi.flags & orbgenflags::CROSS10)) continue; if(!(oi.flags & orbgenflags::CROSS10)) continue;

View File

@ -513,9 +513,16 @@ int counthints() {
void showMissionScreen() { void showMissionScreen() {
cancel(); cancel = noaction; cancel(); cancel = noaction;
popScreenAll(); popScreenAll();
pushScreen(showMission);
achievement_final(false); achievement_final(false);
if(daily::on) {
#if CAP_DAILY
pushScreen(daily::showMenu);
#endif
}
else
pushScreen(showMission);
#if CAP_TOUR #if CAP_TOUR
if(!tour::on) if(!tour::on)
#endif #endif

View File

@ -69,7 +69,7 @@ void welcomeMessage() {
addMessage(XLAT("Welcome to HyperRogue!")); addMessage(XLAT("Welcome to HyperRogue!"));
} }
if(do_use_special_land() || firstland != laIce) { if(do_use_special_land() || firstland != laIce) if(!daily::on) {
auto lv = land_validity(specialland); auto lv = land_validity(specialland);
if(lv.flags & lv::display_error_message) if(lv.flags & lv::display_error_message)
addMessage(XLAT(lv.msg)); addMessage(XLAT(lv.msg));
@ -759,6 +759,7 @@ void saveStats(bool emergency = false) {
if(tour::on) return; if(tour::on) return;
#endif #endif
if(randomPatternsMode) return; if(randomPatternsMode) return;
if(daily::on) return;
if(peace::on) return; if(peace::on) return;
if(!gold()) return; if(!gold()) return;
@ -1191,6 +1192,8 @@ void restartGame(char switchWhat, bool push, bool keep_screens) {
#if CAP_DAILY #if CAP_DAILY
if(switchWhat == rg::daily) if(switchWhat == rg::daily)
daily::setup(); daily::setup();
if(switchWhat == rg::daily_off)
daily::turnoff();
#endif #endif
if(switchWhat == rg::princess) { if(switchWhat == rg::princess) {
princess::challenge = !princess::challenge; princess::challenge = !princess::challenge;