Skip to content

Commit 718fbcd

Browse files
committed
Merge branch 'master' of https://github.com/zenorogue/hyperrogue
2 parents a96101e + ae97ae0 commit 718fbcd

File tree

10 files changed

+59
-33
lines changed

10 files changed

+59
-33
lines changed

content.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,7 @@ LAND( 0x306030, "Snake Nest", laSnakeNest, ZERO, itSnake, RESERVED, NODESCYET)
15041504
NATIVE(m == moHexSnake ? 2 : among(m, moRedTroll, moMiner, moSkeleton, moBomberbird) ? 1 : 0)
15051505
REQ(GOLD(R90))
15061506

1507-
LAND( 0x80FF00, "Docks", laDocks, ZERO | LF_SEA, itDock, RESERVED, NODESCYET)
1507+
LAND( 0x80FF00, "Docks", laDocks, ZERO | LF_SEA | LF_COASTAL, itDock, RESERVED, NODESCYET)
15081508
NATIVE(among(m, moRatling, moPirate, moCShark, moAlbatross, moFireFairy) ? 2 : 0)
15091509
REQAS(laOcean,)
15101510

debug.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ vector<cheatkey> cheats = {
168168
cheatkey{'R'-64, "advance the rose wave", buildRosemap},
169169
#if CAP_EDIT
170170
cheatkey{'A', "start the Map Editor", [] {
171-
lastexplore = turncount;
171+
lastexplore = shmup::on ? shmup::curtime : turncount;
172172
pushScreen(mapeditor::showMapEditor);
173173
}},
174174
cheatkey{'A'-64, "start the Vector Graphics Editor", [] {
@@ -246,8 +246,14 @@ vector<cheatkey> cheats = {
246246
cheatkey{'G'-64, "switch ghost timer", [] {
247247
timerghost = !timerghost;
248248
cheater++;
249-
addMessage(XLAT("turn count = %1 last exploration = %2 ghost timer = %3",
250-
its(turncount), its(lastexplore), ONOFF(timerghost)));
249+
if(shmup::on) {
250+
addMessage(XLAT("in-game time = %1 last exploration = %2 ghost timer = %3",
251+
its(shmup::curtime), its(lastexplore), ONOFF(timerghost)));
252+
}
253+
else {
254+
addMessage(XLAT("turn count = %1 last exploration = %2 ghost timer = %3",
255+
its(turncount), its(lastexplore), ONOFF(timerghost)));
256+
}
251257
}},
252258
cheatkey{'G', "edit cell values", push_debug_screen},
253259
cheatkey{'L'-64, "cell info", [] {

graph-item.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ EX bool drawItemType(eItem it, cell *c, const shiftmatrix& V, color_t icol, int
256256
}
257257

258258
else if(it == itBarrow && c) {
259-
for(int i = 0; i<c->landparam; i++)
260-
queuepolyat(Vit * spin(TAU * i / c->landparam) * xpush(.15 * cgi.scalefactor) * spinptick(1500, 0), *xsh, darkena(icol, 0, hidden ? 0x40 :
259+
for(int i = 0; i<barrowCount(c); i++)
260+
queuepolyat(Vit * spin(TAU * i / barrowCount(c)) * xpush(.15 * cgi.scalefactor) * spinptick(1500, 0), *xsh, darkena(icol, 0, hidden ? 0x40 :
261261
(highwall(c) && wmspatial) ? 0x60 : 0xFF),
262262
PPR::HIDDEN);
263263
}

graph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2013,7 +2013,7 @@ EX void drawscreen() {
20132013
displayfr(vid.xres * (p+.5) / numplayers(),
20142014
current_display->ycenter - current_display->radius * 3/4, 2,
20152015
vid.fsize,
2016-
mines[p] > sizeof(minetexts) / sizeof(minetexts[0]) ? its(mines[p]) : XLAT(minetexts[mines[p]]), minecolors[mines[p]], 8);
2016+
mines[p] >= sizeof(minetexts) / sizeof(minetexts[0]) ? its(mines[p]) : XLAT(minetexts[mines[p]]), minecolors[mines[p]], 8);
20172017

20182018
if(minefieldNearby && !shmup::on && cwt.at->land != laMinefield && cwt.peek()->land != laMinefield && !dont_display_minecount) {
20192019
displayfr(vid.xres/2, current_display->ycenter - current_display->radius * 3/4 - vid.fsize*3/2, 2,

help.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ EX void describeMouseover() {
10841084
if(c->item && !itemHiddenFromSight(c)) {
10851085
out += ", ";
10861086
out += XLAT1(iinf[c->item].name);
1087-
if(c->item == itBarrow) out += " (x" + its(c->landparam) + ")";
1087+
if(c->item == itBarrow) out += " (x" + its(barrowCount(c)) + ")";
10881088
#if CAP_COMPLEX2
10891089
if(c->land == laHunting) {
10901090
int i = ambush::size(c, c->item);

hud.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ EX int subclass(int i) {
4747
#define GLYPH_INSQUARE 1024
4848
#define GLYPH_INLANDSCAPE 2048
4949
#define GLYPH_ACTIVE 4096
50+
#define GLYPH_CIRCLE 8192
5051

5152
#if HDR
5253
enum eGlyphsortorder {
@@ -88,8 +89,13 @@ EX void updateglyphpinned() {
8889
exp_parser ep;
8990
ep.s = pinnedglyphs;
9091
do {
91-
int i = ep.iparse();
92-
if(i >= 0 && i < glyphs) glyphpinned[i] = true;
92+
try {
93+
int i = ep.iparse();
94+
if(i >= 0 && i < glyphs) glyphpinned[i] = true;
95+
}
96+
catch(hr_parse_exception&) {
97+
continue;
98+
}
9399
} while(ep.eat(","));
94100
}
95101
}
@@ -192,6 +198,7 @@ int glyphflags(int gid) {
192198
if(itemclass(i) == IC_ORB && items[i] < 10) f |= GLYPH_RUNOUT;
193199
}
194200
if(i == orbToTarget) f |= GLYPH_TARGET;
201+
if(orbToTarget == itOrbSpace && mouseover && i == mouseover->item) f |= GLYPH_CIRCLE;
195202
if(!less_in_portrait) f |= GLYPH_INPORTRAIT;
196203
if(!less_in_landscape) f |= GLYPH_INLANDSCAPE;
197204
}
@@ -307,6 +314,8 @@ bool displayglyph(int cx, int cy, int buttonsize, char glyph, color_t color, int
307314
else
308315
displaychr(cx + buttonsize/2, cy, 0, glsize, glyph, darkenedby(color, b?0:1));
309316

317+
if(flags & GLYPH_CIRCLE) drawCircle(cx + buttonsize/2, cy, buttonsize/2, darkena(color, 0, 0xFF));
318+
310319
string fl = "";
311320
string str = its(qty);
312321

items.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ EX bool collectItem(cell *c2, cell *last, bool telekinesis IS(false)) {
314314
int q_el = items[itElemental];
315315

316316
if(c2->item == itBarrow)
317-
for(int i=0; i<c2->landparam; i++) gainItem(c2->item);
317+
for(int i=0; i<barrowCount(c2); i++) gainItem(c2->item);
318318
else if(c2->item) gainItem(c2->item);
319319

320320
if(c2->item && items[c2->item] > q && (vid.bubbles_all || (threshold_met(items[c2->item]) > threshold_met(q) && vid.bubbles_threshold))) {
@@ -742,7 +742,7 @@ EX void collectMessage(cell *c2, eItem which) {
742742
addMessage(XLAT("A castle in the Crossroads..."));
743743
else if(which == itShard) ;
744744
else {
745-
int qty = (which == itBarrow) ? c2->landparam : 1;
745+
int qty = (which == itBarrow) ? barrowCount(c2) : 1;
746746
string t;
747747
if(which == itBarrow && items[which] < 25 && items[which] + qty >= 25)
748748
t = XLAT("Your energy swords get stronger!");
@@ -758,4 +758,12 @@ EX bool itemHiddenFromSight(cell *c) {
758758
&& !(shmup::on && shmup::boatAt(c)) && !(c->cpdist <= 1 && playerInWater());
759759
}
760760

761+
EX int barrowCount(cell *c) {
762+
// This should always be 2 or 3.
763+
// Clamping to exactly that would make bugs go unnoticed.
764+
// Not clamping at all would lead to freezes when it's absurdly large.
765+
// Clamping to [1,4] means any incorrect values will be apparent but not game-breaking.
766+
return min(max(c->landparam, 1), 4);
767+
}
768+
761769
}

landlock.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,10 +1046,11 @@ EX void customize_land_list() {
10461046

10471047
if(use_custom_land_list) {
10481048
dialog::addItem("disable/enable all", 'D');
1049-
dialog::add_action([] {
1049+
std::vector<eLand> ll(landlist);
1050+
dialog::add_action([ll] {
10501051
int qty = 0;
1051-
for(int i=0; i<landtypes; i++) if(custom_land_list[i]) qty++;
1052-
for(int i=0; i<landtypes; i++) custom_land_list[i] = !qty;
1052+
for(eLand l: ll) if(custom_land_list[l]) qty++;
1053+
for(eLand l: ll) custom_land_list[l] = !qty;
10531054
});
10541055
}
10551056
else dialog::addBreak(100);

menus.cpp

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -103,24 +103,26 @@ EX void showOverview() {
103103
displayfrZ(1, i0, 1, vf-4, "*", forecolor, 0);
104104
if(displayfrZH(xr*1, i0, 1, vf-4, XLAT1(linf[l].name), col, 0))
105105
getcstat = 1000 + l;
106+
int c8 = (vf+2)/3;
106107
eItem it = treasureType(l);
107108
int lv = items[it] * landMultiplier(l);
108-
if(lv >= 25) col = 0xFFD500;
109-
else if(lv && it == itSavedPrincess) col = 0xFFD500;
110-
else if(lv >= 10) col = 0x00D500;
111-
else if(items[it]) col = 0xC0C0C0;
112-
else col = BLACKISH;
113-
int c8 = (vf+2)/3;
114-
if(displayfrZH(xr*24-c8*6, i0, 1, vf-4, (required_for_hyperstones(it) ? "" : "*") + its(items[it]), col, 16))
115-
getcstat = 2000+it;
116-
if(!cheater)
117-
if(displayfrZH(xr*24, i0, 1, vf-4, its(hiitems[modecode()][it]), col, 16))
118-
getcstat = 2000+it;
119-
if(items[it]) col = iinf[it].color; else col = BLACKISH;
120-
if(displayfrZH(xr*24+c8*4, i0, 1, vf-4, s0 + iinf[it].glyph, col, 16))
121-
getcstat = 2000+it;
122-
if(displayfrZH(xr*24+c8*5, i0, 1, vf-4, XLAT1(iinf[it].name), col, 0))
123-
getcstat = 2000+it;
109+
if(it) {
110+
if(lv >= 25) col = 0xFFD500;
111+
else if(lv && it == itSavedPrincess) col = 0xFFD500;
112+
else if(lv >= 10) col = 0x00D500;
113+
else if(items[it]) col = 0xC0C0C0;
114+
else col = BLACKISH;
115+
if(displayfrZH(xr*24-c8*6, i0, 1, vf-4, (required_for_hyperstones(it) ? "" : "*") + its(items[it]), col, 16))
116+
getcstat = 2000+it;
117+
if(!cheater)
118+
if(displayfrZH(xr*24, i0, 1, vf-4, its(hiitems[modecode()][it]), col, 16))
119+
getcstat = 2000+it;
120+
if(items[it]) col = iinf[it].color; else col = BLACKISH;
121+
if(displayfrZH(xr*24+c8*4, i0, 1, vf-4, s0 + iinf[it].glyph, col, 16))
122+
getcstat = 2000+it;
123+
if(displayfrZH(xr*24+c8*5, i0, 1, vf-4, XLAT1(iinf[it].name), col, 0))
124+
getcstat = 2000+it;
125+
}
124126
eItem io = nativeOrbType(l);
125127
if(io == itShard) {
126128
if(items[it] >= 10) col = winf[waMirror].color; else col = BLACKISH;
@@ -329,7 +331,7 @@ EX void showCreative() {
329331
dialog::cheat_if_confirmed([] {
330332
cheater++;
331333
pushScreen(mapeditor::showMapEditor);
332-
lastexplore = turncount;
334+
lastexplore = shmup::on ? shmup::curtime : turncount;
333335
addMessage(XLAT("You activate your terraforming powers!"));
334336
});
335337
});

rogueviz/fifteen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ bool fifteen3 = true;
167167

168168
bool draw_fifteen(cell *c, const shiftmatrix& V) {
169169
hr::addaura(tC0(V), darkened(0x0000FF), 0);
170-
lastexplore = turncount;
170+
lastexplore = shmup::on ? shmup::curtime : turncount;
171171
if(!fif.count(c)) { c->land = laNone; c->wall = waChasm; c->item = itNone; c->monst = moNone; return false; }
172172
check_move();
173173

0 commit comments

Comments
 (0)