1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-06-27 23:42:53 +00:00

started working on the 'Dual Land'

This commit is contained in:
Zeno Rogue 2017-10-29 23:54:26 +01:00
parent e9696e73c2
commit 3ede3601ea
7 changed files with 71 additions and 20 deletions

View File

@ -1557,11 +1557,12 @@ const landtype linf[landtypes] = {
{ 0x8080FF, "Blizzard", blizzarddesc}, { 0x8080FF, "Blizzard", blizzarddesc},
{ 0x207068, "Hunting Ground", huntingdesc}, { 0x207068, "Hunting Ground", huntingdesc},
{ 0xE2725B, "Terracotta Army", terraldesc}, { 0xE2725B, "Terracotta Army", terraldesc},
{ 0xE2725B, "Terracotta Army", terraldesc} { 0xE2725B, "Terracotta Army", terraldesc},
{ 0xE04040, "Dual", NODESCYET}
}; };
#define LAND_OVER 57 #define LAND_OVER 57
#define LAND_OVERX 59 #define LAND_OVERX 60
eLand land_over[LAND_OVERX] = { eLand land_over[LAND_OVERX] = {
laIce, laCaves, laDesert, laHunting, laMotion, laJungle, laAlchemist, laIce, laCaves, laDesert, laHunting, laMotion, laJungle, laAlchemist,
@ -1581,10 +1582,10 @@ eLand land_over[LAND_OVERX] = {
laHell, laCrossroads3, laCocytus, laPower, laCrossroads4, laHell, laCrossroads3, laCocytus, laPower, laCrossroads4,
laCrossroads5, laCrossroads5,
// EXTRA // EXTRA
laWildWest, laHalloween laWildWest, laHalloween, laDual
}; };
#define LAND_EUC 53 #define LAND_EUC 54
eLand land_euc[LAND_EUC] = { eLand land_euc[LAND_EUC] = {
laIce, laCaves, laDesert, laMotion, laJungle, laIce, laCaves, laDesert, laMotion, laJungle,
laCrossroads, laCrossroads,
@ -1599,10 +1600,11 @@ eLand land_euc[LAND_EUC] = {
laWildWest, laWildWest,
laReptile, laMountain, laBull, laPrairie, laReptile, laMountain, laBull, laPrairie,
laVolcano, laHunting, laBlizzard, laTerracotta, laVolcano, laHunting, laBlizzard, laTerracotta,
laDual
}; };
// MISSING: laCrossroads2 // MISSING: laCrossroads2
#define LAND_SPH 39 #define LAND_SPH 40
eLand land_sph[LAND_SPH] = { eLand land_sph[LAND_SPH] = {
laHalloween, laHalloween,
laIce, laCaves, laDesert, laMotion, laJungle, laIce, laCaves, laDesert, laMotion, laJungle,
@ -1615,19 +1617,21 @@ eLand land_sph[LAND_SPH] = {
laEmerald, laDragon, laTortoise, laEmerald, laDragon, laTortoise,
laHell, laCrossroads3, laCocytus, laPower, laElementalWall, laHell, laCrossroads3, laCocytus, laPower, laElementalWall,
laCrossroads4, laCrossroads4,
laWildWest, laPalace, laBull, laPrairie, laCA laWildWest, laPalace, laBull, laPrairie, laCA,
laDual
}; };
#define LAND_OCT 33 #define LAND_OCT 36
eLand land_oct[LAND_OCT] = { eLand land_oct[LAND_OCT] = {
laIce, laDesert, laCaves, laJungle, laAlchemist, laWarpCoast, laIce, laDesert, laCaves, laJungle, laAlchemist,
laGraveyard, laRlyeh, laHell, laCocytus, laMotion, laGraveyard, laRlyeh, laHell, laCocytus, laMotion,
laDryForest, laDeadCaves, laRedRock, laMinefield, laLivefjord, laDryForest, laDeadCaves, laRedRock, laMinefield, laLivefjord,
laStorms, laOvergrown, laRose, laKraken, laBurial, laStorms, laOvergrown, laRose, laKraken, laBurial,
laTrollheim, laBull, laHunting, laTrollheim, laBull, laHunting,
laCaribbean, laCamelot, laPalace, laMirrorOld, laCaribbean, laCamelot, laPalace, laMirrorOld,
laVolcano, laBlizzard, laTerracotta, laVolcano, laBlizzard, laTerracotta,
laWineyard, laPower, laEmerald laWineyard, laPower, laEmerald, laWhirlpool,
laDual
}; };

View File

@ -158,7 +158,7 @@ enum eWall { waNone, waIcewall, waBarrier, waFloorA, waFloorB, waCavewall, waCav
waArrowTrap, waMercury, waMagma waArrowTrap, waMercury, waMagma
}; };
static const int landtypes = 77; static const int landtypes = 78;
struct landtype { struct landtype {
int color; int color;
@ -183,7 +183,8 @@ enum eLand { laNone, laBarrier, laCrossroads, laDesert, laIce, laCaves, laJungle
laPrairie, laBull, laCrossroads5, laCA, laPrairie, laBull, laCrossroads5, laCA,
laMirrorWall, laMirrored, laMirrorWall2, laMirrored2, laMirrorWall, laMirrored, laMirrorWall2, laMirrored2,
laMirrorOld, laMirrorOld,
laVolcano, laBlizzard, laHunting, laTerracotta, laMercuryRiver laVolcano, laBlizzard, laHunting, laTerracotta, laMercuryRiver,
laDual
}; };
enum eGeometry {gNormal, gEuclid, gSphere, gElliptic, gQuotient, gQuotient2, gTorus, gOctagon, g45, g46, g47, gSmallSphere, gTinySphere, gGUARD}; enum eGeometry {gNormal, gEuclid, gSphere, gElliptic, gQuotient, gQuotient2, gTorus, gOctagon, g45, g46, g47, gSmallSphere, gTinySphere, gGUARD};

View File

@ -2896,6 +2896,8 @@ bool makeEmpty(cell *c) {
c->wall = waFrozenLake; c->wall = waFrozenLake;
else if(c->land == laAlchemist || c->land == laCanvas) else if(c->land == laAlchemist || c->land == laCanvas)
; ;
else if(c->land == laDual)
;
else if(c->land == laCaves || c->land == laEmerald) else if(c->land == laCaves || c->land == laEmerald)
c->wall = waCavefloor; c->wall = waCavefloor;
else if(c->land == laDeadCaves) else if(c->land == laDeadCaves)

View File

@ -2431,7 +2431,7 @@ void setcolors(cell *c, int& wcol, int &fcol) {
case laBurial: case laTrollheim: case laBarrier: case laOceanWall: case laBurial: case laTrollheim: case laBarrier: case laOceanWall:
case laCrossroads2: case laCrossroads3: case laCrossroads4: case laCrossroads5: case laCrossroads2: case laCrossroads3: case laCrossroads4: case laCrossroads5:
case laRose: case laPower: case laWildWest: case laHalloween: case laRedRock: case laRose: case laPower: case laWildWest: case laHalloween: case laRedRock:
case laDragon: case laStorms: case laTerracotta: case laMercuryRiver: case laDragon: case laStorms: case laTerracotta: case laMercuryRiver: case laDual:
fcol = linf[c->land].color; break; fcol = linf[c->land].color; break;
case laDesert: fcol = 0xEDC9AF; break; case laDesert: fcol = 0xEDC9AF; break;
@ -2818,6 +2818,12 @@ void floorShadow(cell *c, const transmatrix& V, int col, bool warp) {
else else
queuepolyat(V * applyPatterndir(c), shTriheptaFloorShadow[ctof(c)], col, PPR_WALLSHADOW); queuepolyat(V * applyPatterndir(c), shTriheptaFloorShadow[ctof(c)], col, PPR_WALLSHADOW);
} }
else if(c->land == laDual) {
if(euclid && ishex1(c))
queuepolyat(V * pispin, shBigTriShadow, col, PPR_WALLSHADOW);
else
queuepolyat(V, shBigTriShadow, col, PPR_WALLSHADOW);
}
else { else {
queuepolyat(V, shFloorShadow[ctof(c)], col, PPR_WALLSHADOW); queuepolyat(V, shFloorShadow[ctof(c)], col, PPR_WALLSHADOW);
} }
@ -2838,6 +2844,12 @@ void plainfloor(cell *c, bool warp, const transmatrix &V, int col, int prio) {
else else
queuepolyat(V * applyPatterndir(c), shTriheptaFloor[sphere ? ctof(c) : mapeditor::nopattern(c)], col, prio); queuepolyat(V * applyPatterndir(c), shTriheptaFloor[sphere ? ctof(c) : mapeditor::nopattern(c)], col, prio);
} }
else if(c->land == laDual) {
if(euclid && ishex1(c))
queuepolyat(V * pispin, shBigTriangle, col, prio);
else
queuepolyat(V, shBigTriangle, col, prio);
}
else { else {
queuepolyat(V, shFloor[ctof(c)], col, prio); queuepolyat(V, shFloor[ctof(c)], col, prio);
} }
@ -2854,11 +2866,19 @@ void fullplainfloor(cell *c, bool warp, const transmatrix &V, int col, int prio)
else else
queuepolyat(V * applyPatterndir(c), shTriheptaFloor[sphere ? ctof(c) : mapeditor::nopattern(c)], col, prio); queuepolyat(V * applyPatterndir(c), shTriheptaFloor[sphere ? ctof(c) : mapeditor::nopattern(c)], col, prio);
} }
else if(c->land == laDual) {
if(euclid && ishex1(c))
queuepolyat(V * pispin, shBigTriangle, col, prio);
else
queuepolyat(V, shBigTriangle, col, prio);
}
else { else {
queuepolyat(V, shFullFloor[ctof(c)], col, prio); queuepolyat(V, shFullFloor[ctof(c)], col, prio);
} }
} }
void qfloor_eswap(cell *c, const transmatrix& V, const hpcshape& sh, int col);
void qplainfloor(cell *c, bool warp, const transmatrix &V, int col) { void qplainfloor(cell *c, bool warp, const transmatrix &V, int col) {
if(warp) { if(warp) {
if(euclid) { if(euclid) {
@ -2870,6 +2890,8 @@ void qplainfloor(cell *c, bool warp, const transmatrix &V, int col) {
else else
qfloor(c, V, applyPatterndir(c), shTriheptaFloor[sphere ? ctof(c) : mapeditor::nopattern(c)], col); qfloor(c, V, applyPatterndir(c), shTriheptaFloor[sphere ? ctof(c) : mapeditor::nopattern(c)], col);
} }
else if(c->land == laDual)
qfloor_eswap(c, V, shBigTriangle, col);
else { else {
qfloor(c, V, shFloor[ctof(c)], col); qfloor(c, V, shFloor[ctof(c)], col);
} }
@ -2925,6 +2947,10 @@ void escherSidewall(cell *c, int sidepar, const transmatrix& V, int col) {
void placeSidewall(cell *c, int i, int sidepar, const transmatrix& V, bool warp, bool mirr, int col) { void placeSidewall(cell *c, int i, int sidepar, const transmatrix& V, bool warp, bool mirr, int col) {
if(shmup::on || purehepta) warp = false; if(shmup::on || purehepta) warp = false;
if(warp && !ishept(c) && (!c->mov[i] || !ishept(c->mov[i]))) return; if(warp && !ishept(c) && (!c->mov[i] || !ishept(c->mov[i]))) return;
if(c->land == laDual) {
if(ctof(c)) return;
if(euclid ? (ishex1(c) ? !(i&1) : (i&1)) : !(i&1)) return;
}
int prio; int prio;
/* if(mirr) prio = PPR_GLASS - 2; /* if(mirr) prio = PPR_GLASS - 2;
else */ if(sidepar == SIDE_WALL) prio = PPR_WALL3 - 2; else */ if(sidepar == SIDE_WALL) prio = PPR_WALL3 - 2;
@ -2946,7 +2972,7 @@ void placeSidewall(cell *c, int i, int sidepar, const transmatrix& V, bool warp,
// prio += c->cpdist - c->mov[i]->cpdist; // prio += c->cpdist - c->mov[i]->cpdist;
queuepolyat(V2, queuepolyat(V2,
(mirr?shMFloorSide:warp?shTriheptaSide:shFloorSide)[sidepar][ctof(c)], col, prio); (mirr?shMFloorSide:warp?shTriheptaSide:c->land == laDual?shBigTriSide:shFloorSide)[sidepar][ctof(c)], col, prio);
} }
bool openorsafe(cell *c) { bool openorsafe(cell *c) {
@ -3591,6 +3617,10 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
else if(isWarped(c) && euclid) else if(isWarped(c) && euclid)
qfloor_eswap(c, Vf, shTriheptaFloor[ctof(c)], darkena(fcol, fd, 0xFF)); qfloor_eswap(c, Vf, shTriheptaFloor[ctof(c)], darkena(fcol, fd, 0xFF));
else if(c->land == laDual && !purehepta && !ctof(c)) {
qfloor_eswap(c, Vf, shBigTriangle, darkena(fcol, fd, 0xFF));
}
else if(isWarped(c) && !purehepta && !shmup::on) { else if(isWarped(c) && !purehepta && !shmup::on) {
int np = mapeditor::nopattern(c); int np = mapeditor::nopattern(c);
if(c->landparam == 1337) np = 0; // for the achievement screenshot if(c->landparam == 1337) np = 0; // for the achievement screenshot

View File

@ -1919,6 +1919,11 @@ void giantLandSwitch(cell *c, int d, cell *from) {
case laMercuryRiver: case laMercuryRiver:
// do nothing! // do nothing!
break; break;
case laDual:
if(d == 9 && (ctof(c) || hrand(100) < 5))
c->wall = waChasm;
break;
} }
} }

View File

@ -728,6 +728,7 @@ void showEuclideanMenu() {
landvisited[laHalloween] = true; landvisited[laHalloween] = true;
landvisited[laWarpCoast] = true; landvisited[laWarpCoast] = true;
landvisited[laGraveyard] = true; landvisited[laGraveyard] = true;
landvisited[laDual] = true;
landvisited[laCA] = true; landvisited[laCA] = true;
// for(int i=2; i<lt; i++) landvisited[i] = true; // for(int i=2; i<lt; i++) landvisited[i] = true;

View File

@ -639,7 +639,8 @@ hpcshape
shHedgehogBlade, shHedgehogBladePlayer, shHedgehogBlade, shHedgehogBladePlayer,
shWolfBody, shWolfHead, shWolfLegs, shWolfEyes, shWolfBody, shWolfHead, shWolfLegs, shWolfEyes,
shWolfFrontLeg, shWolfRearLeg, shWolfFrontPaw, shWolfRearPaw, shWolfFrontLeg, shWolfRearLeg, shWolfFrontPaw, shWolfRearPaw,
shBigHepta, shBigTriangle, shBigHex, shBigHexTriangle, shBigHexTriangleRev, shBigHepta, shBigHex, shBigHexTriangle, shBigHexTriangleRev,
shBigTriangle, shBigTriSide[SIDEPARS][2], shBigTriShadow,
shFemaleBody, shFemaleHair, shFemaleDress, shWitchDress, shFemaleBody, shFemaleHair, shFemaleDress, shWitchDress,
shWitchHair, shBeautyHair, shFlowerHair, shFlowerHand, shSuspenders, shWitchHair, shBeautyHair, shFlowerHair, shFlowerHand, shSuspenders,
shBugBody, shBugArmor, shBugLeg, shBugAntenna, shBugBody, shBugArmor, shBugLeg, shBugAntenna,
@ -1010,6 +1011,10 @@ void buildpolys() {
bshape(shMFloorSide[k][1], PPR_LAKEWALL); bshape(shMFloorSide[k][1], PPR_LAKEWALL);
for(int t=0; t<=1; t++) hpcpush(ddi(t*S12-S6, MF(floorrad1,7)) * C0); for(int t=0; t<=1; t++) hpcpush(ddi(t*S12-S6, MF(floorrad1,7)) * C0);
chasmifyPoly(dlow, dhi, k); chasmifyPoly(dlow, dhi, k);
bshape(shBigTriSide[k][0], PPR_LAKEWALL);
for(int t=0; t<=1; t++) hpcpush(ddi(t*S28-S14, hcrossf*.94) * C0);
chasmifyPoly(dlow, dhi, k);
} }
for(int d=0; d<2; d++) { for(int d=0; d<2; d++) {
@ -1316,7 +1321,11 @@ void buildpolys() {
for(int t=0; t<=S6; t++) hpcpush(ddi(t*S14, -shexf*1.3) * C0); for(int t=0; t<=S6; t++) hpcpush(ddi(t*S14, -shexf*1.3) * C0);
bshape(shBigTriangle, PPR_FLOOR); bshape(shBigTriangle, PPR_FLOOR);
for(int t=0; t<=S3; t++) hpcpush(ddi(t*S28, hcrossf*.94) * C0); for(int t=0; t<=S3; t++) hpcpush(ddi(t*S28, -hcrossf*.94) * C0);
bshape(shBigTriShadow, PPR_FLOOR);
for(int t=0; t<=S3; t++) hpcpush(ddi(t*S28 + S14, hcrossf*.94*SHADMUL) * C0);
/*bshape(shBigHexTriangleRev, PPR_FLOOR); /*bshape(shBigHexTriangleRev, PPR_FLOOR);
for(int t=0; t<=S3; t++) hpcpush(ddi(t*S28, -shexf*1.3) * C0); for(int t=0; t<=S3; t++) hpcpush(ddi(t*S28, -shexf*1.3) * C0);
@ -1898,8 +1907,7 @@ bool isSpecial(const hpcshape &h) {
&h != &shFloor[1] && &h != &shFloor[1] &&
&h != &shTriheptaFloor[0] && &h != &shTriheptaFloor[0] &&
&h != &shTriheptaFloor[1] && &h != &shTriheptaFloor[1] &&
&h != &shTriheptaEuc[0] && &h != &shBigTriangle;
&h != &shTriheptaEuc[1];
} }
const hpcshape& getSeabed(const hpcshape& c) { const hpcshape& getSeabed(const hpcshape& c) {