1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 01:00:25 +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},
{ 0x207068, "Hunting Ground", huntingdesc},
{ 0xE2725B, "Terracotta Army", terraldesc},
{ 0xE2725B, "Terracotta Army", terraldesc}
{ 0xE2725B, "Terracotta Army", terraldesc},
{ 0xE04040, "Dual", NODESCYET}
};
#define LAND_OVER 57
#define LAND_OVERX 59
#define LAND_OVERX 60
eLand land_over[LAND_OVERX] = {
laIce, laCaves, laDesert, laHunting, laMotion, laJungle, laAlchemist,
@ -1581,10 +1582,10 @@ eLand land_over[LAND_OVERX] = {
laHell, laCrossroads3, laCocytus, laPower, laCrossroads4,
laCrossroads5,
// EXTRA
laWildWest, laHalloween
laWildWest, laHalloween, laDual
};
#define LAND_EUC 53
#define LAND_EUC 54
eLand land_euc[LAND_EUC] = {
laIce, laCaves, laDesert, laMotion, laJungle,
laCrossroads,
@ -1599,10 +1600,11 @@ eLand land_euc[LAND_EUC] = {
laWildWest,
laReptile, laMountain, laBull, laPrairie,
laVolcano, laHunting, laBlizzard, laTerracotta,
laDual
};
// MISSING: laCrossroads2
#define LAND_SPH 39
#define LAND_SPH 40
eLand land_sph[LAND_SPH] = {
laHalloween,
laIce, laCaves, laDesert, laMotion, laJungle,
@ -1615,19 +1617,21 @@ eLand land_sph[LAND_SPH] = {
laEmerald, laDragon, laTortoise,
laHell, laCrossroads3, laCocytus, laPower, laElementalWall,
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] = {
laIce, laDesert, laCaves, laJungle, laAlchemist,
laWarpCoast, laIce, laDesert, laCaves, laJungle, laAlchemist,
laGraveyard, laRlyeh, laHell, laCocytus, laMotion,
laDryForest, laDeadCaves, laRedRock, laMinefield, laLivefjord,
laStorms, laOvergrown, laRose, laKraken, laBurial,
laTrollheim, laBull, laHunting,
laCaribbean, laCamelot, laPalace, laMirrorOld,
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
};
static const int landtypes = 77;
static const int landtypes = 78;
struct landtype {
int color;
@ -183,7 +183,8 @@ enum eLand { laNone, laBarrier, laCrossroads, laDesert, laIce, laCaves, laJungle
laPrairie, laBull, laCrossroads5, laCA,
laMirrorWall, laMirrored, laMirrorWall2, laMirrored2,
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};

View File

@ -2896,6 +2896,8 @@ bool makeEmpty(cell *c) {
c->wall = waFrozenLake;
else if(c->land == laAlchemist || c->land == laCanvas)
;
else if(c->land == laDual)
;
else if(c->land == laCaves || c->land == laEmerald)
c->wall = waCavefloor;
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 laCrossroads2: case laCrossroads3: case laCrossroads4: case laCrossroads5:
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;
case laDesert: fcol = 0xEDC9AF; break;
@ -2818,6 +2818,12 @@ void floorShadow(cell *c, const transmatrix& V, int col, bool warp) {
else
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 {
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
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 {
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
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 {
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) {
if(warp) {
if(euclid) {
@ -2870,6 +2890,8 @@ void qplainfloor(cell *c, bool warp, const transmatrix &V, int col) {
else
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 {
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) {
if(shmup::on || purehepta) warp = false;
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;
/* if(mirr) prio = PPR_GLASS - 2;
else */ if(sidepar == SIDE_WALL) prio = PPR_WALL3 - 2;
@ -2944,9 +2970,9 @@ void placeSidewall(cell *c, int i, int sidepar, const transmatrix& V, bool warp,
// queuepoly(V2 * xpush(.1), shSnowball, aw ? 0xFFFFFFFF : 0xFF0000FF);
// prio += c->cpdist - c->mov[i]->cpdist;
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) {
@ -3591,6 +3617,10 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
else if(isWarped(c) && euclid)
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) {
int np = mapeditor::nopattern(c);
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:
// do nothing!
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[laWarpCoast] = true;
landvisited[laGraveyard] = true;
landvisited[laDual] = true;
landvisited[laCA] = true;
// for(int i=2; i<lt; i++) landvisited[i] = true;

View File

@ -639,7 +639,8 @@ hpcshape
shHedgehogBlade, shHedgehogBladePlayer,
shWolfBody, shWolfHead, shWolfLegs, shWolfEyes,
shWolfFrontLeg, shWolfRearLeg, shWolfFrontPaw, shWolfRearPaw,
shBigHepta, shBigTriangle, shBigHex, shBigHexTriangle, shBigHexTriangleRev,
shBigHepta, shBigHex, shBigHexTriangle, shBigHexTriangleRev,
shBigTriangle, shBigTriSide[SIDEPARS][2], shBigTriShadow,
shFemaleBody, shFemaleHair, shFemaleDress, shWitchDress,
shWitchHair, shBeautyHair, shFlowerHair, shFlowerHand, shSuspenders,
shBugBody, shBugArmor, shBugLeg, shBugAntenna,
@ -1010,6 +1011,10 @@ void buildpolys() {
bshape(shMFloorSide[k][1], PPR_LAKEWALL);
for(int t=0; t<=1; t++) hpcpush(ddi(t*S12-S6, MF(floorrad1,7)) * C0);
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++) {
@ -1316,7 +1321,11 @@ void buildpolys() {
for(int t=0; t<=S6; t++) hpcpush(ddi(t*S14, -shexf*1.3) * C0);
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);
for(int t=0; t<=S3; t++) hpcpush(ddi(t*S28, -shexf*1.3) * C0);
@ -1897,9 +1906,8 @@ bool isSpecial(const hpcshape &h) {
&h != &shFloor[0] &&
&h != &shFloor[1] &&
&h != &shTriheptaFloor[0] &&
&h != &shTriheptaFloor[1] &&
&h != &shTriheptaEuc[0] &&
&h != &shTriheptaEuc[1];
&h != &shTriheptaFloor[1] &&
&h != &shBigTriangle;
}
const hpcshape& getSeabed(const hpcshape& c) {
@ -1927,7 +1935,7 @@ void qfloor0(cell *c, const transmatrix& V, const hpcshape& h, int col) {
}
void qfloor(cell *c, const transmatrix& V, const hpcshape& h, int col) {
qfloor0(c, V, h, col);
qfloor0(c, V, h, col);
qfi.special = isSpecial(h);
qfi.shape = &h, qfi.spin = Id;
}