mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 01:00:25 +00:00
fixed Hall of Mirrors in PTM, added mercury rivers, improved wall sorting
This commit is contained in:
parent
96bc0fbd65
commit
7567c34705
10
classes.cpp
10
classes.cpp
@ -1241,7 +1241,7 @@ enum eItem { itNone, itDiamond, itGold, itSpice, itRuby, itElixir, itShard, itBo
|
||||
|
||||
// --- wall types ---
|
||||
|
||||
const int walltypes = 103;
|
||||
const int walltypes = 104;
|
||||
|
||||
struct walltype {
|
||||
char glyph;
|
||||
@ -1427,6 +1427,7 @@ walltype winf[walltypes] = {
|
||||
{ 'S', 0xB0B0B0, "warrior statue", NODESCYET},
|
||||
{ '=', 0xB0B0B0, "bubbling slime", NODESCYET},
|
||||
{ '^', 0xD00000, "arrow trap", NODESCYET},
|
||||
{ '=', 0xE2E2E2, "mercury river", NODESCYET},
|
||||
};
|
||||
|
||||
enum eWall { waNone, waIcewall, waBarrier, waFloorA, waFloorB, waCavewall, waCavefloor, waDeadTroll, waDune,
|
||||
@ -1460,12 +1461,12 @@ enum eWall { waNone, waIcewall, waBarrier, waFloorA, waFloorB, waCavewall, waCav
|
||||
waPetrifiedBridge,
|
||||
waTempBridgeBlocked,
|
||||
waTerraWarrior, waBubble,
|
||||
waArrowTrap
|
||||
waArrowTrap, waMercury
|
||||
};
|
||||
|
||||
// --- land types ---
|
||||
|
||||
const int landtypes = 76;
|
||||
const int landtypes = 77;
|
||||
|
||||
struct landtype {
|
||||
int color;
|
||||
@ -1651,6 +1652,7 @@ const landtype linf[landtypes] = {
|
||||
{ 0xA06000, "Alchemy II", NODESCYET},
|
||||
{ 0x8080FF, "Blizzard", NODESCYET},
|
||||
{ 0x207068, "Hunting Ground", NODESCYET},
|
||||
{ 0xE2725B, "Terracotta Army", NODESCYET},
|
||||
{ 0xE2725B, "Terracotta Army", NODESCYET}
|
||||
};
|
||||
|
||||
@ -1671,7 +1673,7 @@ enum eLand { laNone, laBarrier, laCrossroads, laDesert, laIce, laCaves, laJungle
|
||||
laPrairie, laBull, laCrossroads5, laCA,
|
||||
laMirrorWall, laMirrored, laMirrorWall2, laMirrored2,
|
||||
laMirrorOld,
|
||||
laAlchemy2, laBlizzard, laDogPlains, laTerracotta
|
||||
laAlchemy2, laBlizzard, laDogPlains, laTerracotta, laMercuryRiver
|
||||
};
|
||||
|
||||
// cell information for the game
|
||||
|
10
flags.cpp
10
flags.cpp
@ -24,7 +24,8 @@ bool isWatery(cell *c) {
|
||||
}
|
||||
|
||||
bool isChasmy(cell *c) {
|
||||
return c->wall == waChasm || c->wall == waSulphur || c->wall == waSulphurC || c->wall == waBubble;
|
||||
return c->wall == waChasm || c->wall == waSulphur || c->wall == waSulphurC || c->wall == waBubble ||
|
||||
c->wall == waMercury;
|
||||
}
|
||||
|
||||
bool isWateryOrBoat(cell *c) {
|
||||
@ -588,6 +589,13 @@ bool survivesWater(eMonster m) {
|
||||
m == moTortoise; // Tortoises and Ivies survive, but don't go through water
|
||||
}
|
||||
|
||||
// survives Mercury or Sulphur
|
||||
bool survivesPoison(eMonster m, eWall p) {
|
||||
return
|
||||
isGhost(m) || m == moWitchGhost || m == moShadow ||
|
||||
isBird(m) || m == moAirElemental || isDragon(m);
|
||||
}
|
||||
|
||||
// flying even if stunned
|
||||
bool isPermanentFlying(eMonster m) {
|
||||
return m == moAirElemental || isGhost(m);
|
||||
|
26
game.cpp
26
game.cpp
@ -5123,10 +5123,16 @@ void moverefresh(bool turn = true) {
|
||||
playSound(c, "click");
|
||||
}
|
||||
else if(isChasmy(c) || isWatery(c)) {
|
||||
c->wall = waReptileBridge;
|
||||
if(c->wall == waMercury) {
|
||||
fallMonster(c, AF_FALL);
|
||||
c->wall = waNone;
|
||||
}
|
||||
else {
|
||||
c->wall = waReptileBridge;
|
||||
c->wparam = reptilemax();
|
||||
c->monst = moNone;
|
||||
}
|
||||
c->item = itNone;
|
||||
c->wparam = reptilemax();
|
||||
c->monst = moNone;
|
||||
playSound(c, "click");
|
||||
}
|
||||
}
|
||||
@ -5199,6 +5205,20 @@ void moverefresh(bool turn = true) {
|
||||
fallMonster(c, AF_FALL);
|
||||
}
|
||||
}
|
||||
else if(c->wall == waSulphur || c->wall == waSulphurC || c->wall == waMercury) {
|
||||
if(c->monst && !survivesPoison(c->monst, c->wall)) {
|
||||
playSound(c, "splash"+pick12());
|
||||
if(isNonliving(c->monst))
|
||||
addMessage(XLAT("%The1 sinks!", c->monst));
|
||||
else
|
||||
addMessage(XLAT("%The1 drowns!", c->monst));
|
||||
if(isBull(c->monst)) {
|
||||
addMessage(XLAT("%The1 is filled!", c->wall));
|
||||
c->wall = waNone;
|
||||
}
|
||||
fallMonster(c, AF_FALL);
|
||||
}
|
||||
}
|
||||
else if(!isWateryOrBoat(c)) {
|
||||
if(c->monst == moGreaterShark)
|
||||
c->monst = moGreaterM;
|
||||
|
21
graph.cpp
21
graph.cpp
@ -2353,7 +2353,7 @@ void setcolors(cell *c, int& wcol, int &fcol) {
|
||||
case laBurial: case laTrollheim: case laBarrier: case laOceanWall:
|
||||
case laCrossroads2: case laCrossroads3: case laCrossroads4: case laCrossroads5:
|
||||
case laRose: case laPower: case laWildWest: case laHalloween: case laRedRock:
|
||||
case laDragon: case laStorms: case laTerracotta:
|
||||
case laDragon: case laStorms: case laTerracotta: case laMercuryRiver:
|
||||
fcol = linf[c->land].color; break;
|
||||
|
||||
case laDesert: fcol = 0xEDC9AF; break;
|
||||
@ -2616,7 +2616,7 @@ void setcolors(cell *c, int& wcol, int &fcol) {
|
||||
fcol = wcol = winf[c->wall].color; */
|
||||
|
||||
// floors become fcol
|
||||
if(c->wall == waSulphur || c->wall == waSulphurC || c->wall == waPlatform)
|
||||
if(c->wall == waSulphur || c->wall == waSulphurC || c->wall == waPlatform || c->wall == waMercury)
|
||||
fcol = wcol;
|
||||
|
||||
if(isAlch(c)) {
|
||||
@ -2824,8 +2824,8 @@ void placeSidewall(cell *c, int i, int sidepar, const transmatrix& V, bool warp,
|
||||
if(shmup::on || purehepta) warp = false;
|
||||
if(warp && !ishept(c) && (!c->mov[i] || !ishept(c->mov[i]))) return;
|
||||
int prio;
|
||||
if(mirr) prio = PPR_GLASS - 2;
|
||||
else if(sidepar == SIDE_WALL) prio = PPR_WALL3 - 2;
|
||||
/* if(mirr) prio = PPR_GLASS - 2;
|
||||
else */ if(sidepar == SIDE_WALL) prio = PPR_WALL3 - 2;
|
||||
else if(sidepar == SIDE_WTS3) prio = PPR_WALL3 - 2;
|
||||
else if(sidepar == SIDE_LAKE) prio = PPR_LAKEWALL;
|
||||
else if(sidepar == SIDE_LTOB) prio = PPR_INLAKEWALL;
|
||||
@ -2834,8 +2834,10 @@ void placeSidewall(cell *c, int i, int sidepar, const transmatrix& V, bool warp,
|
||||
|
||||
transmatrix V2 = V * ddspin(c, i);
|
||||
|
||||
int aw = away(V2); prio += aw;
|
||||
/* int aw = away(V2); prio += aw;
|
||||
if(!detaillevel && aw < 0) return;
|
||||
*/
|
||||
|
||||
// queuepoly(V2 * xpush(.1), shSnowball, aw ? 0xFFFFFFFF : 0xFF0000FF);
|
||||
// prio += c->cpdist - c->mov[i]->cpdist;
|
||||
|
||||
@ -3255,6 +3257,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
||||
c->land == laReptile ? 0 :
|
||||
c->land == laDogPlains ? 1 :
|
||||
c->land == laTerracotta ? 1 :
|
||||
c->land == laMercuryRiver ? 0 :
|
||||
2;
|
||||
|
||||
if(c->land == laAlchemy2) {
|
||||
@ -3870,7 +3873,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
||||
int col = winf[waGlass].color;
|
||||
int dcol = darkena(col, 0, 0x80);
|
||||
transmatrix Vdepth = mscale((*Vdp), geom3::WALL);
|
||||
queuepolyat(Vdepth, shMFloor[ct6], dcol, PPR_GLASS);
|
||||
queuepolyat(Vdepth, shMFloor[ct6], dcol, PPR_WALL); // GLASS
|
||||
if(validsidepar[SIDE_WALL]) forCellIdEx(c2, i, c)
|
||||
placeSidewall(c, i, SIDE_WALL, (*Vdp), false, true, dcol);
|
||||
}
|
||||
@ -3982,7 +3985,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
||||
int col = winf[c->wall].color;
|
||||
int dcol = darkena(col, 0, 0xC0);
|
||||
transmatrix Vdepth = mscale((*Vdp), geom3::WALL);
|
||||
queuepolyat(Vdepth, shMFloor[ct6], dcol, PPR_GLASS);
|
||||
queuepolyat(Vdepth, shMFloor[ct6], dcol, PPR_WALL); // GLASS
|
||||
if(validsidepar[SIDE_WALL]) forCellIdEx(c2, i, c)
|
||||
placeSidewall(c, i, SIDE_WALL, (*Vdp), false, true, dcol);
|
||||
}
|
||||
@ -4011,7 +4014,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
||||
queuepoly(V, shBigCarpet3, darkena(0xC09F00, 0, 0xFF));
|
||||
}
|
||||
|
||||
else if(xch != '.' && xch != '+' && xch != '>' && xch != ':'&& xch != '-' && xch != ';' && c->wall != waSulphur && xch != ',')
|
||||
else if(xch != '.' && xch != '+' && xch != '>' && xch != ':'&& xch != '-' && xch != ';' && c->wall != waSulphur && c->wall != waMercury && xch != ',')
|
||||
error = true;
|
||||
}
|
||||
|
||||
@ -4311,7 +4314,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
||||
#endif
|
||||
}
|
||||
|
||||
if(c->bardir != NODIR && c->bardir != NOBARRIERS && c->land != laHauntedWall &&
|
||||
if(vid.grid && c->bardir != NODIR && c->bardir != NOBARRIERS && c->land != laHauntedWall &&
|
||||
c->barleft != NOWALLSEP_USED) {
|
||||
int col = darkena(0x505050, 0, 0xFF);
|
||||
queueline(tC0(V), V*tC0(heptmove[c->bardir]), col, 2);
|
||||
|
30
landgen.cpp
30
landgen.cpp
@ -223,7 +223,7 @@ int isNative(eLand l, eMonster m) {
|
||||
case laAlchemy2:
|
||||
return m == moLemur ? 2 : 0;
|
||||
|
||||
case laTerracotta:
|
||||
case laTerracotta: case laMercuryRiver:
|
||||
return m == moJiangshi ? 2 : m == moTerraWarrior ? 1 : 0;
|
||||
|
||||
case laBlizzard:
|
||||
@ -321,7 +321,7 @@ eItem treasureType(eLand l) {
|
||||
case laPrairie: return itGreenGrass;
|
||||
|
||||
case laAlchemy2: return itAlchemy2;
|
||||
case laTerracotta: return itTerra;
|
||||
case laTerracotta: case laMercuryRiver: return itTerra;
|
||||
case laBlizzard: return itBlizzard;
|
||||
case laDogPlains: return itDogPlains;
|
||||
|
||||
@ -783,7 +783,7 @@ bool landUnlocked(eLand l) {
|
||||
case laDogPlains:
|
||||
return true;
|
||||
|
||||
case laTerracotta:
|
||||
case laTerracotta: case laMercuryRiver:
|
||||
return gold() >= 60;
|
||||
|
||||
case laBlizzard:
|
||||
@ -988,6 +988,10 @@ void setbarrier(cell *c) {
|
||||
c->land = laMirrorWall2;
|
||||
else if(c->barleft == laMirrored || c->barright == laMirrored)
|
||||
c->land = laMirrorWall;
|
||||
else if(c->barleft == laTerracotta && c->barright == laTerracotta) {
|
||||
c->land = laMercuryRiver;
|
||||
c->wall = waMercury;
|
||||
}
|
||||
else {
|
||||
c->wall = waBarrier;
|
||||
c->land = laBarrier;
|
||||
@ -1440,7 +1444,8 @@ void extendCR5(cell *c) {
|
||||
bool isbar4(cell *c) {
|
||||
return
|
||||
c->wall == waBarrier || c->land == laElementalWall ||
|
||||
c->land == laMirrorWall || c->land == laMirrorWall2;
|
||||
c->land == laMirrorWall || c->land == laMirrorWall2 ||
|
||||
c->land == laMercuryRiver;
|
||||
}
|
||||
|
||||
void extendBarrier(cell *c) {
|
||||
@ -1453,7 +1458,7 @@ void extendBarrier(cell *c) {
|
||||
|
||||
// printf("build barrier at %p", c);
|
||||
if(c->land == laBarrier || c->land == laElementalWall || c->land == laHauntedWall || c->land == laOceanWall ||
|
||||
c->land == laMirrorWall || c->land == laMirrorWall2) {
|
||||
c->land == laMirrorWall || c->land == laMirrorWall2 || c->land == laMercuryRiver) {
|
||||
// printf("-> ready\n");
|
||||
return;
|
||||
}
|
||||
@ -1718,7 +1723,8 @@ hookset<eLand(eLand)> *hooks_nextland;
|
||||
|
||||
eLand getNewLand(eLand old) {
|
||||
|
||||
if(old == laMirror && !chaosmode && hrand(10) < 8) return laMirrored;
|
||||
if(old == laMirror && !chaosmode && hrand(10) >= (tactic::on ? 0 : markOrb(itOrbLuck) ? 5 : 2)) return laMirrored;
|
||||
if(old == laTerracotta && !chaosmode && hrand(5) >= (tactic::on ? 0 : markOrb(itOrbLuck) ? 2 : 1)) return laTerracotta;
|
||||
|
||||
eLand l = callhandlers(laNone, hooks_nextland, old);
|
||||
if(l) return l;
|
||||
@ -3180,6 +3186,8 @@ void buildBigStuff(cell *c, cell *from) {
|
||||
c->land == laCrossroads2 ? 10000 :
|
||||
c->land == laCrossroads5 ? 10000 :
|
||||
c->land == laCrossroads4 ? 0 :
|
||||
(c->land == laMirror && !yendor::generating) ? 6000 :
|
||||
c->land == laTerracotta ? 250 :
|
||||
(tactic::on && !tactic::trailer) ? 0 :
|
||||
c->land == laCaribbean ? 500 :
|
||||
(c->land == laWarpSea || c->land == laWarpCoast) ? 500 :
|
||||
@ -3190,7 +3198,6 @@ void buildBigStuff(cell *c, cell *from) {
|
||||
(c->land == laGraveyard && items[itBone] >= 10) ? 120 :
|
||||
c->land == laOcean ? (deepOcean ? (purehepta ? 250 : 2000) : 0) :
|
||||
c->land == laDragon ? 120 :
|
||||
(c->land == laMirror && !yendor::generating) ? 6000 :
|
||||
50))
|
||||
{
|
||||
|
||||
@ -4046,16 +4053,19 @@ void setdist(cell *c, int d, cell *from) {
|
||||
cwstep(cw); cc[3] = cw.c; cwrevstep(cw); cc[4] = cw.c;
|
||||
cwrevstep(cw2); cc[1] = cw2.c; cwrevstep(cw2); cc[0] = cw2.c;
|
||||
bool ok = true;
|
||||
for(int i=1; i<4; i++) {
|
||||
forCellEx(c2, cc[i]) if(c2->wall == waArrowTrap) ok = false;
|
||||
for(int i=0; i<5; i++) {
|
||||
if(cc[i]->land != laNone && cc[i]->land != laTerracotta) ok = false;
|
||||
if(cc[i]->bardir != NODIR) ok = false;
|
||||
cc[i]->bardir = NOBARRIERS;
|
||||
}
|
||||
for(int i=1; i<4; i++) {
|
||||
forCellEx(c2, cc[i]) if(c2->wall == waArrowTrap) ok = false;
|
||||
}
|
||||
if(ok) {
|
||||
for(int i=1; i<4; i++)
|
||||
cc[i]->wall = waArrowTrap,
|
||||
cc[i]->wparam = 0;
|
||||
for(int i=0; i<5; i++)
|
||||
cc[i]->bardir = NOBARRIERS;
|
||||
cc[0]->wall = waStone;
|
||||
cc[4]->wall = waStone;
|
||||
}
|
||||
|
11
polygons.cpp
11
polygons.cpp
@ -556,7 +556,7 @@ void drawqueue() {
|
||||
|
||||
#else
|
||||
|
||||
int qp[PPR_MAX];
|
||||
int qp[PPR_MAX], qp0[PPR_MAX];
|
||||
for(int a=0; a<PPR_MAX; a++) qp[a] = 0;
|
||||
|
||||
for(int i = 0; i<siz; i++) {
|
||||
@ -570,12 +570,19 @@ void drawqueue() {
|
||||
int total = 0;
|
||||
for(int a=0; a<PPR_MAX; a++) {
|
||||
int b = qp[a];
|
||||
qp[a] = total; total += b;
|
||||
qp0[a] = qp[a] = total; total += b;
|
||||
}
|
||||
|
||||
ptds2.resize(siz);
|
||||
|
||||
for(int i = 0; i<siz; i++) ptds2[qp[ptds[i].prio]++] = &ptds[i];
|
||||
|
||||
for(int p: {PPR_REDWALLs, PPR_REDWALLs2, PPR_REDWALLs3, PPR_WALL3s})
|
||||
sort(&ptds2[qp0[p]], &ptds2[qp[p]],
|
||||
[] (polytodraw* p1, polytodraw* p2) {
|
||||
return intval(p1->u.poly.V * xpush0(.1), C0)
|
||||
> intval(p2->u.poly.V * xpush0(.1), C0);
|
||||
});
|
||||
|
||||
#endif
|
||||
profile_stop(3);
|
||||
|
Loading…
Reference in New Issue
Block a user