1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-02-02 20:29:17 +00:00

... but only increased

This commit is contained in:
Zeno Rogue 2018-04-11 15:49:49 +02:00
parent f6aaa0515a
commit 1f6ee5a408
3 changed files with 16 additions and 4 deletions

View File

@ -696,7 +696,7 @@ namespace dialog {
addBoolItem("all directional lands", conformal::do_rotate == 2, 'd'); addBoolItem("all directional lands", conformal::do_rotate == 2, 'd');
} }
if(ne.editwhat == &ne.intbuf && ne.intval == &sightrange_bonus && allowIncreasedSight()) { if(ne.editwhat == &ne.intbuf && ne.intval == &sightrange_bonus && allowChangeRange()) {
addSelItem("generation range bonus", its(genrange_bonus), 'o'); addSelItem("generation range bonus", its(genrange_bonus), 'o');
addSelItem("game range bonus", its(gamerange_bonus), 'O'); addSelItem("game range bonus", its(gamerange_bonus), 'O');
} }
@ -754,11 +754,11 @@ namespace dialog {
conformal::do_rotate = 1; conformal::do_rotate = 1;
else if(uni == 'd' && ne.editwhat == &conformal::rotation) else if(uni == 'd' && ne.editwhat == &conformal::rotation)
conformal::do_rotate = 2; conformal::do_rotate = 2;
else if(uni == 'o' && ne.editwhat == &ne.intbuf && ne.intval == &sightrange_bonus && allowIncreasedSight()) { else if(uni == 'o' && ne.editwhat == &ne.intbuf && ne.intval == &sightrange_bonus && allowChangeRange()) {
genrange_bonus = sightrange_bonus; genrange_bonus = sightrange_bonus;
doOvergenerate(); doOvergenerate();
} }
else if(uni == 'O' && ne.editwhat == &ne.intbuf && ne.intval == &sightrange_bonus && allowIncreasedSight()) { else if(uni == 'O' && ne.editwhat == &ne.intbuf && ne.intval == &sightrange_bonus && allowChangeRange()) {
gamerange_bonus = sightrange_bonus; gamerange_bonus = sightrange_bonus;
} }
else if(uni == 'o' && ne.editwhat == &vid.linewidth) else if(uni == 'o' && ne.editwhat == &vid.linewidth)

View File

@ -5200,7 +5200,6 @@ void drawFlashes() {
bool allowIncreasedSight() { bool allowIncreasedSight() {
if(cheater) return true; if(cheater) return true;
if(inHighQual) return true;
if(peace::on) return true; if(peace::on) return true;
#if CAP_TOUR #if CAP_TOUR
if(tour::on) return true; if(tour::on) return true;
@ -5213,6 +5212,18 @@ bool allowIncreasedSight() {
return false; return false;
} }
bool allowChangeRange() {
if(cheater || peace::on || randomPatternsMode) return true;
#if CAP_TOUR
if(tour::on) return true;
#endif
#if CAP_ROGUEVIZ
if(rogueviz::on) return true;
#endif
if(sightrange_bonus >= 0) return true;
return false;
}
purehookset hooks_drawmap; purehookset hooks_drawmap;
transmatrix cview() { transmatrix cview() {

View File

@ -2102,6 +2102,7 @@ void selectLanguageScreen();
bool inscreenrange(cell *c); bool inscreenrange(cell *c);
bool allowIncreasedSight(); bool allowIncreasedSight();
bool allowChangeRange();
static inline bool orbProtection(eItem it) { return false; } // not implemented static inline bool orbProtection(eItem it) { return false; } // not implemented