1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-25 18:05:15 +00:00
This commit is contained in:
Zeno Rogue
2025-10-13 17:49:07 +02:00
10 changed files with 59 additions and 33 deletions

View File

@@ -1504,7 +1504,7 @@ LAND( 0x306030, "Snake Nest", laSnakeNest, ZERO, itSnake, RESERVED, NODESCYET)
NATIVE(m == moHexSnake ? 2 : among(m, moRedTroll, moMiner, moSkeleton, moBomberbird) ? 1 : 0)
REQ(GOLD(R90))
LAND( 0x80FF00, "Docks", laDocks, ZERO | LF_SEA, itDock, RESERVED, NODESCYET)
LAND( 0x80FF00, "Docks", laDocks, ZERO | LF_SEA | LF_COASTAL, itDock, RESERVED, NODESCYET)
NATIVE(among(m, moRatling, moPirate, moCShark, moAlbatross, moFireFairy) ? 2 : 0)
REQAS(laOcean,)

View File

@@ -168,7 +168,7 @@ vector<cheatkey> cheats = {
cheatkey{'R'-64, "advance the rose wave", buildRosemap},
#if CAP_EDIT
cheatkey{'A', "start the Map Editor", [] {
lastexplore = turncount;
lastexplore = shmup::on ? shmup::curtime : turncount;
pushScreen(mapeditor::showMapEditor);
}},
cheatkey{'A'-64, "start the Vector Graphics Editor", [] {
@@ -246,8 +246,14 @@ vector<cheatkey> cheats = {
cheatkey{'G'-64, "switch ghost timer", [] {
timerghost = !timerghost;
cheater++;
addMessage(XLAT("turn count = %1 last exploration = %2 ghost timer = %3",
its(turncount), its(lastexplore), ONOFF(timerghost)));
if(shmup::on) {
addMessage(XLAT("in-game time = %1 last exploration = %2 ghost timer = %3",
its(shmup::curtime), its(lastexplore), ONOFF(timerghost)));
}
else {
addMessage(XLAT("turn count = %1 last exploration = %2 ghost timer = %3",
its(turncount), its(lastexplore), ONOFF(timerghost)));
}
}},
cheatkey{'G', "edit cell values", push_debug_screen},
cheatkey{'L'-64, "cell info", [] {

View File

@@ -256,8 +256,8 @@ EX bool drawItemType(eItem it, cell *c, const shiftmatrix& V, color_t icol, int
}
else if(it == itBarrow && c) {
for(int i = 0; i<c->landparam; i++)
queuepolyat(Vit * spin(TAU * i / c->landparam) * xpush(.15 * cgi.scalefactor) * spinptick(1500, 0), *xsh, darkena(icol, 0, hidden ? 0x40 :
for(int i = 0; i<barrowCount(c); i++)
queuepolyat(Vit * spin(TAU * i / barrowCount(c)) * xpush(.15 * cgi.scalefactor) * spinptick(1500, 0), *xsh, darkena(icol, 0, hidden ? 0x40 :
(highwall(c) && wmspatial) ? 0x60 : 0xFF),
PPR::HIDDEN);
}

View File

@@ -2013,7 +2013,7 @@ EX void drawscreen() {
displayfr(vid.xres * (p+.5) / numplayers(),
current_display->ycenter - current_display->radius * 3/4, 2,
vid.fsize,
mines[p] > sizeof(minetexts) / sizeof(minetexts[0]) ? its(mines[p]) : XLAT(minetexts[mines[p]]), minecolors[mines[p]], 8);
mines[p] >= sizeof(minetexts) / sizeof(minetexts[0]) ? its(mines[p]) : XLAT(minetexts[mines[p]]), minecolors[mines[p]], 8);
if(minefieldNearby && !shmup::on && cwt.at->land != laMinefield && cwt.peek()->land != laMinefield && !dont_display_minecount) {
displayfr(vid.xres/2, current_display->ycenter - current_display->radius * 3/4 - vid.fsize*3/2, 2,

View File

@@ -1084,7 +1084,7 @@ EX void describeMouseover() {
if(c->item && !itemHiddenFromSight(c)) {
out += ", ";
out += XLAT1(iinf[c->item].name);
if(c->item == itBarrow) out += " (x" + its(c->landparam) + ")";
if(c->item == itBarrow) out += " (x" + its(barrowCount(c)) + ")";
#if CAP_COMPLEX2
if(c->land == laHunting) {
int i = ambush::size(c, c->item);

13
hud.cpp
View File

@@ -47,6 +47,7 @@ EX int subclass(int i) {
#define GLYPH_INSQUARE 1024
#define GLYPH_INLANDSCAPE 2048
#define GLYPH_ACTIVE 4096
#define GLYPH_CIRCLE 8192
#if HDR
enum eGlyphsortorder {
@@ -88,8 +89,13 @@ EX void updateglyphpinned() {
exp_parser ep;
ep.s = pinnedglyphs;
do {
int i = ep.iparse();
if(i >= 0 && i < glyphs) glyphpinned[i] = true;
try {
int i = ep.iparse();
if(i >= 0 && i < glyphs) glyphpinned[i] = true;
}
catch(hr_parse_exception&) {
continue;
}
} while(ep.eat(","));
}
}
@@ -192,6 +198,7 @@ int glyphflags(int gid) {
if(itemclass(i) == IC_ORB && items[i] < 10) f |= GLYPH_RUNOUT;
}
if(i == orbToTarget) f |= GLYPH_TARGET;
if(orbToTarget == itOrbSpace && mouseover && i == mouseover->item) f |= GLYPH_CIRCLE;
if(!less_in_portrait) f |= GLYPH_INPORTRAIT;
if(!less_in_landscape) f |= GLYPH_INLANDSCAPE;
}
@@ -307,6 +314,8 @@ bool displayglyph(int cx, int cy, int buttonsize, char glyph, color_t color, int
else
displaychr(cx + buttonsize/2, cy, 0, glsize, glyph, darkenedby(color, b?0:1));
if(flags & GLYPH_CIRCLE) drawCircle(cx + buttonsize/2, cy, buttonsize/2, darkena(color, 0, 0xFF));
string fl = "";
string str = its(qty);

View File

@@ -314,7 +314,7 @@ EX bool collectItem(cell *c2, cell *last, bool telekinesis IS(false)) {
int q_el = items[itElemental];
if(c2->item == itBarrow)
for(int i=0; i<c2->landparam; i++) gainItem(c2->item);
for(int i=0; i<barrowCount(c2); i++) gainItem(c2->item);
else if(c2->item) gainItem(c2->item);
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) {
addMessage(XLAT("A castle in the Crossroads..."));
else if(which == itShard) ;
else {
int qty = (which == itBarrow) ? c2->landparam : 1;
int qty = (which == itBarrow) ? barrowCount(c2) : 1;
string t;
if(which == itBarrow && items[which] < 25 && items[which] + qty >= 25)
t = XLAT("Your energy swords get stronger!");
@@ -758,4 +758,12 @@ EX bool itemHiddenFromSight(cell *c) {
&& !(shmup::on && shmup::boatAt(c)) && !(c->cpdist <= 1 && playerInWater());
}
EX int barrowCount(cell *c) {
// This should always be 2 or 3.
// Clamping to exactly that would make bugs go unnoticed.
// Not clamping at all would lead to freezes when it's absurdly large.
// Clamping to [1,4] means any incorrect values will be apparent but not game-breaking.
return min(max(c->landparam, 1), 4);
}
}

View File

@@ -1046,10 +1046,11 @@ EX void customize_land_list() {
if(use_custom_land_list) {
dialog::addItem("disable/enable all", 'D');
dialog::add_action([] {
std::vector<eLand> ll(landlist);
dialog::add_action([ll] {
int qty = 0;
for(int i=0; i<landtypes; i++) if(custom_land_list[i]) qty++;
for(int i=0; i<landtypes; i++) custom_land_list[i] = !qty;
for(eLand l: ll) if(custom_land_list[l]) qty++;
for(eLand l: ll) custom_land_list[l] = !qty;
});
}
else dialog::addBreak(100);

View File

@@ -103,24 +103,26 @@ EX void showOverview() {
displayfrZ(1, i0, 1, vf-4, "*", forecolor, 0);
if(displayfrZH(xr*1, i0, 1, vf-4, XLAT1(linf[l].name), col, 0))
getcstat = 1000 + l;
int c8 = (vf+2)/3;
eItem it = treasureType(l);
int lv = items[it] * landMultiplier(l);
if(lv >= 25) col = 0xFFD500;
else if(lv && it == itSavedPrincess) col = 0xFFD500;
else if(lv >= 10) col = 0x00D500;
else if(items[it]) col = 0xC0C0C0;
else col = BLACKISH;
int c8 = (vf+2)/3;
if(displayfrZH(xr*24-c8*6, i0, 1, vf-4, (required_for_hyperstones(it) ? "" : "*") + its(items[it]), col, 16))
getcstat = 2000+it;
if(!cheater)
if(displayfrZH(xr*24, i0, 1, vf-4, its(hiitems[modecode()][it]), col, 16))
getcstat = 2000+it;
if(items[it]) col = iinf[it].color; else col = BLACKISH;
if(displayfrZH(xr*24+c8*4, i0, 1, vf-4, s0 + iinf[it].glyph, col, 16))
getcstat = 2000+it;
if(displayfrZH(xr*24+c8*5, i0, 1, vf-4, XLAT1(iinf[it].name), col, 0))
getcstat = 2000+it;
if(it) {
if(lv >= 25) col = 0xFFD500;
else if(lv && it == itSavedPrincess) col = 0xFFD500;
else if(lv >= 10) col = 0x00D500;
else if(items[it]) col = 0xC0C0C0;
else col = BLACKISH;
if(displayfrZH(xr*24-c8*6, i0, 1, vf-4, (required_for_hyperstones(it) ? "" : "*") + its(items[it]), col, 16))
getcstat = 2000+it;
if(!cheater)
if(displayfrZH(xr*24, i0, 1, vf-4, its(hiitems[modecode()][it]), col, 16))
getcstat = 2000+it;
if(items[it]) col = iinf[it].color; else col = BLACKISH;
if(displayfrZH(xr*24+c8*4, i0, 1, vf-4, s0 + iinf[it].glyph, col, 16))
getcstat = 2000+it;
if(displayfrZH(xr*24+c8*5, i0, 1, vf-4, XLAT1(iinf[it].name), col, 0))
getcstat = 2000+it;
}
eItem io = nativeOrbType(l);
if(io == itShard) {
if(items[it] >= 10) col = winf[waMirror].color; else col = BLACKISH;
@@ -329,7 +331,7 @@ EX void showCreative() {
dialog::cheat_if_confirmed([] {
cheater++;
pushScreen(mapeditor::showMapEditor);
lastexplore = turncount;
lastexplore = shmup::on ? shmup::curtime : turncount;
addMessage(XLAT("You activate your terraforming powers!"));
});
});

View File

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