going back towards the Orb of Yendor now updates lastexplore

This commit is contained in:
Zeno Rogue
2026-04-17 21:36:07 +02:00
parent eed8cf9882
commit 1cde32a3c2
4 changed files with 13 additions and 4 deletions
+1 -1
View File
@@ -189,7 +189,7 @@ vector<cheatkey> cheats = {
cheatkey{'R'-64, "advance the rose wave", buildRosemap}, cheatkey{'R'-64, "advance the rose wave", buildRosemap},
#if CAP_EDIT #if CAP_EDIT
cheatkey{'A', "start the Map Editor", [] { cheatkey{'A', "start the Map Editor", [] {
lastexplore = shmup::on ? shmup::curtime : turncount; update_lastexplore();
pushScreen(mapeditor::showMapEditor); pushScreen(mapeditor::showMapEditor);
}}, }},
cheatkey{'A'-64, "start the Vector Graphics Editor", [] { cheatkey{'A'-64, "start the Vector Graphics Editor", [] {
+5 -1
View File
@@ -20,6 +20,10 @@ EX eLand lastland;
EX int lastexplore; EX int lastexplore;
EX void update_lastexplore() {
lastexplore = shmup::on ? shmup::curtime : turncount;
}
EX bool randomPatternsMode = false; EX bool randomPatternsMode = false;
EX int randompattern[landtypes]; EX int randompattern[landtypes];
@@ -3034,7 +3038,7 @@ EX void setdist(cell *c, int d, cell *from) {
} }
} }
if(d <= 10 - getDistLimit()) lastexplore = shmup::on ? shmup::curtime : turncount; if(d <= 10 - getDistLimit()) update_lastexplore();
if(mhybrid) { if(mhybrid) {
auto wc = hybrid::get_where(c).first; auto wc = hybrid::get_where(c).first;
+1 -1
View File
@@ -339,7 +339,7 @@ EX void showCreative() {
dialog::cheat_if_confirmed([] { dialog::cheat_if_confirmed([] {
cheater++; cheater++;
pushScreen(mapeditor::showMapEditor); pushScreen(mapeditor::showMapEditor);
lastexplore = shmup::on ? shmup::curtime : turncount; update_lastexplore();
addMessage(XLAT("You activate your terraforming powers!")); addMessage(XLAT("You activate your terraforming powers!"));
}); });
}); });
+6 -1
View File
@@ -160,7 +160,7 @@ EX namespace yendor {
cell *actualKey; cell *actualKey;
bool found; bool found;
bool foundOrb; bool foundOrb;
int howfar; int howfar, howfar_back;
bignum age; bignum age;
yendorinfo() { actualKey = NULL; } yendorinfo() { actualKey = NULL; }
cell* key() { return path[YDIST-1]; } cell* key() { return path[YDIST-1]; }
@@ -257,6 +257,7 @@ EX namespace yendor {
nyi.found = false; nyi.found = false;
nyi.foundOrb = false; nyi.foundOrb = false;
nyi.howfar_back = 999;
for(int i=1; i<YDIST; i++) { for(int i=1; i<YDIST; i++) {
setdist(nyi.path[i], 7, nyi.path[i-1]); setdist(nyi.path[i], 7, nyi.path[i-1]);
@@ -405,6 +406,10 @@ EX namespace yendor {
if(yii < isize(yi)) { if(yii < isize(yi)) {
for(int i=0; i<YDIST; i++) if(yi[yii].path[i]->cpdist <= 7) { for(int i=0; i<YDIST; i++) if(yi[yii].path[i]->cpdist <= 7) {
if(i > yi[yii].howfar) yi[yii].howfar = i; if(i > yi[yii].howfar) yi[yii].howfar = i;
if(yi[yii].found && i < yi[yii].howfar_back) {
yi[yii].howfar_back = i;
update_lastexplore();
}
path = true; path = true;
} }
} }