1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-08-28 08:22:18 +00:00

ru:: rogue walls now detectable with cross, also smashed doors are saved as doors

This commit is contained in:
Zeno Rogue 2025-08-01 08:17:12 +02:00
parent 9311342e31
commit 6dfc6559b8
3 changed files with 15 additions and 2 deletions

View File

@ -59,7 +59,7 @@ enum eWall {
wAir, wWall, wBouncy, wSpike, wWater, wFrozen, wDoor, wSmashedDoor,
wLockedDoor, wFountain, wBluePortal, wOrangePortal, wPlatform, wStaircase,
wColumn, wForge, wWoodWall, wShopDoor, wSecretPassage, wSign, wWallSign, wTimeDoor,
wBottomSpike, wGUARD };
wBottomSpike, wRogueWallHidden, wRogueWall, wGUARD };
flagtype W_BLOCK = 1;
flagtype W_TRANS = 2;
@ -98,6 +98,8 @@ ruwall walls[qwall] = {
{"wall sign", "X", 0xFFFFC0FF, W_BLOCK, "You need to wait close to this sign to read it."},
{"time door", "#", 0x8080FFFF, W_BLOCK | W_STABLE, "A powerful door, opened by a mechanism."},
{"bottom spike", "v", 0xC08080FF, W_TRANS | W_PAIN | W_BLOCKBIRD | W_DOWNWARD, "A downward-pointing spike. You can fall from above through it safely, but otherwise, it is very dangerous."},
{"wall", "#", 0xFFFFFFFF, W_BLOCK | W_STABLE, "These kinds of tough walls can never be destroyed."},
{"fake wall", "#", 0x404080FF, W_PLATFORM | W_STABLE | W_BLOCKBIRD, "Your rogueish senses have discovered that this wall is fake."},
};
int sel = 1;

View File

@ -283,9 +283,16 @@ void man::draw() {
int cx = int(h.x / block_x);
int cy = int(h.y / block_y);
if(cx < 0 || cy < 0 || cx >= room_x || cy >= room_y) break;
if(!(walls[current_room->at(cx, cy)].flags & W_TRANS)) break;
auto what = current_room->at(cx, cy);
if(what == wRogueWallHidden) {
current_room->replace_block_frev(cx, cy, wRogueWall);
addMessage("You discover a secret door!");
}
if(!(walls[what].flags & W_TRANS)) break;
}
vid.linewidth *= 3;
queuecurve(scrm, 0x800080, 0, PPR::LINE);
vid.linewidth /= 3;
}
}

View File

@ -39,6 +39,7 @@ void save_map(string fname) {
for(int y=0; y<room_y; y++)
for(int x=0; x<room_x; x++) {
auto i = r.block_at[y][x] >> 3;
if(i == int(wRogueWallHidden)) i = int(wRogueWall);
auto& c = code_for[i];
if(c == 0 && !code_used.count(walls[i].glyph[0])) c = walls[i].glyph[0];
if(c == 0) c = next_code++;
@ -52,6 +53,7 @@ void save_map(string fname) {
for(int y=0; y<room_y; y++) {
for(int x=0; x<room_x; x++) {
auto v = r.block_at[y][x];
if(v == int(wRogueWallHidden)) v = int(wRogueWall);
print(f, format("%c", (v & 7) == 7 ? 'b' : code_for[v>>3]));
}
println(f);
@ -106,6 +108,8 @@ void load_room(fhstream& f, cell *c) {
string t = s.substr(2);
if(s.size() < 3 || s[1] != ' ') err("load codes", s);
for(int i=0; i<qwall; i++) if(walls[i].name == t) {
if(i == int(wRogueWall)) i = int(wRogueWallHidden);
if(i == int(wSmashedDoor)) i = int(wDoor);
codes[s[0]] = i;
break;
}