1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00
This commit is contained in:
Zeno Rogue 2018-04-03 23:39:18 +02:00
parent 857c8c41cb
commit 22a92059b6
18 changed files with 217 additions and 50 deletions

View File

@ -4,7 +4,7 @@
double randd() { return (rand() + .5) / (RAND_MAX + 1.); }
double cellgfxdist(cell *c, int i) {
return nonbitrunc ? tessf : (c->type == 6 && (i&1)) ? hexhexdist : crossf;
return nonbitrunc ? tessf * whirl::scale : (c->type == 6 && (i&1)) ? hexhexdist : crossf;
}
transmatrix cellrelmatrix(cell *c, int i) {

View File

@ -739,6 +739,13 @@ cell *createMov(cell *c, int d) {
}
if(c->mov[d]) return c->mov[d];
else if(nonbitrunc && whirl::whirl) {
whirl::extend_map(c, d);
if(!c->mov[d]) {
printf("extend failed to create for %p/%d\n", c, d);
exit(1);
}
}
else if(nonbitrunc) {
heptagon *h2 = createStep(c->master, d);
merge(c,d,h2->c7,c->master->spin(d),false);
@ -928,6 +935,7 @@ void verifycell(cell *c) {
}
void verifycells(heptagon *at) {
if(whirl::whirl) return;
for(int i=0; i<S7; i++) if(at->move[i] && at->move[i]->move[at->spin(i)] && at->move[i]->move[at->spin(i)] != at) {
printf("hexmix error %p [%d s=%d] %p %p\n", at, i, at->spin(i), at->move[i], at->move[i]->move[at->spin(i)]);
}
@ -1343,10 +1351,11 @@ int celldistance(cell *c1, cell *c2) {
return eudist(decodeId(c1->master) - decodeId(c2->master));
}
if(sphere || quotient == 1) {
if(sphere || quotient == 1 || whirl::whirl) {
celllister cl(c1, 64, 1000, c2);
for(int i=0; i<size(cl.lst); i++)
if(cl.lst[i] == c2) return cl.dists[i];
return 64;
}
if(quotient == 2)

View File

@ -386,6 +386,13 @@ else if(args()[0] == '-' && args()[1] == x && args()[2] == '0') { showstartmenu
quantum = true;
autocheat = true;
}
else if(argis("-whirl")) {
PHASE(3);
if(nonbitrunc) restartGame('7');
shift(); whirl::param.first = argi();
shift(); whirl::param.second = argi();
restartGame('w');
}
else if(argis("-P")) {
PHASE(2); shift();
vid.scfg.players = argi();

View File

@ -30,6 +30,7 @@
#include "heptagon.cpp"
#include "language.cpp"
#include "cell.cpp"
#include "whirl.cpp"
#include "pattern2.cpp"
#include "flags.cpp"
#include "yendor.cpp"

View File

@ -3055,7 +3055,10 @@ namespace windmap {
cell *c = samples[k];
neighbors.emplace_back();
auto &v = neighbors.back();
for(int l=0; l<c->type; l++) v.push_back(getId(createMov(c, l)));
if(whirl::whirl)
for(int l=0; l<S7; l++) v.push_back(getId(createStep(c->master, l)->c7));
else
for(int l=0; l<c->type; l++) v.push_back(getId(createMov(c, l)));
}
int N = size(samples);

View File

@ -236,7 +236,7 @@ void showEuclideanMenu() {
landvisited[laCA] = true;
// for(int i=2; i<lt; i++) landvisited[i] = true;
if(geometry == gNormal || ewhichscreen == 2) {
if((geometry == gNormal && !whirl::whirl) || ewhichscreen == 2) {
dialog::init(XLAT("experiment with geometry"));
int ts = ginf[geometry].sides;
int tv = ginf[geometry].vertex;
@ -244,6 +244,12 @@ void showEuclideanMenu() {
int nom = (nonbitrunc ? tv : tv+ts) * ((tq & qELLIP) ? 2 : 4);
int denom = (2*ts + 2*tv - ts * tv);
if(whirl::whirl) {
denom *= 2;
nom = nom / tv * (2*tv + ts * (whirl::area-1));
if(nom % 2 == 0) nom /= 2, denom /= 2;
}
dialog::addSelItem(XLAT("land"), XLAT1(linf[specialland].name), '5');
dialog::addBreak(50);
@ -254,17 +260,25 @@ void showEuclideanMenu() {
if(ts == 6 && tv == 3)
dialog::addSelItem(XLAT("bitruncated"), XLAT("does not matter"), 't');
else
else if(S3 != 3)
dialog::addBoolItem(XLAT("bitruncated"), !nonbitrunc, 't');
else {
dialog::addBoolItem(XLAT("operation"), nonbitrunc, 't');
dialog::lastItem().value = whirl::operation_name();
}
dialog::addBreak(50);
int worldsize = denom ? nom/denom : 0;
if(tq & qTORUS) worldsize = torusconfig::qty;
if(tq & qZEBRA) worldsize = nonbitrunc ? 12 : 40;
if(tq & qZEBRA) worldsize =
whirl::whirl ? 12 + 14 * (whirl::area - 1) :
nonbitrunc ? 12 :
40;
if(tq & qFIELD) {
worldsize = size(currfp.matrices) / ts;
if(!nonbitrunc) worldsize = ((ts+tv)*worldsize) / tv;
if(whirl::whirl) worldsize = worldsize * (2*tv + ts * (whirl::area-1)) / tv / 2;
else if(!nonbitrunc) worldsize = ((ts+tv)*worldsize) / tv;
}
dialog::addSelItem(XLAT("sides per face"), its(ts), 0);
@ -319,7 +333,10 @@ void showEuclideanMenu() {
pushScreen(showEuclideanMenu);
}
else if(uni == 't') {
if(!euclid6) {
if(euclid6) ;
else if(S3 == 3)
whirl::configure();
else {
restartGame('7');
pushScreen(showEuclideanMenu);
}

View File

@ -161,6 +161,10 @@ void precalc() {
hexhexdist, hexvdist);
for(int i=0; i<S84; i++) spinmatrix[i] = spin(i * M_PI / S42);
base_distlimit = ginf[geometry].distlimit[nonbitrunc];
whirl::compute_geometry();
}
transmatrix ddi(ld dir, ld dist) {

View File

@ -157,7 +157,7 @@ void drawSpeed(const transmatrix& V) {
}
int ctof(cell *c) {
if(nonbitrunc) return 1;
if(nonbitrunc && !whirl::whirl) return 1;
// if(euclid) return 0;
return ishept(c) ? 1 : 0;
// c->type == 6 ? 0 : 1;
@ -244,7 +244,6 @@ double hexshiftat(cell *c) {
return 0;
}
transmatrix ddspin(cell *c, int d, int bonus) {
int hdir = displaydir(c, d) + bonus;
double ha = hexshiftat(c);
@ -252,7 +251,7 @@ transmatrix ddspin(cell *c, int d, int bonus) {
return getspinmatrix(hdir);
}
transmatrix iddspin(cell *c, int d, int bonus = 0) {
transmatrix iddspin(cell *c, int d, int bonus) {
int hdir = displaydir(c, d) + bonus;
double ha = hexshiftat(c);
if(ha) return spin(ha) * getspinmatrix(-hdir);
@ -291,11 +290,11 @@ void drawPlayerEffects(const transmatrix& V, cell *c, bool onplayer) {
if(!euclid) for(int a=0; a<S42; a++) {
int dda = S42 + (-1-2*a);
if(a == ang && items[itOrbSword]) continue;
if(nonbitrunc && a%3 != ang%3) continue;
if(nonbitrunc && !whirl::whirl && a%3 != ang%3) continue;
if((a+S21)%S42 == ang && items[itOrbSword2]) continue;
bool longer = sword::pos(cwt.c, a-1) != sword::pos(cwt.c, a+1);
int col = darkena(0xC0C0C0, 0, 0xFF);
queueline(Vnow*ddi0(dda, nonbitrunc ? 0.6 : longer ? 0.36 : 0.4), Vnow*ddi0(dda, nonbitrunc ? 0.7 : longer ? 0.44 : 0.42), col, 1);
queueline(Vnow*ddi0(dda, nonbitrunc ? 0.6 * whirl::scale : longer ? 0.36 : 0.4), Vnow*ddi0(dda, nonbitrunc ? 0.7 * whirl::scale : longer ? 0.44 : 0.42), col, 1);
}
#endif
@ -2088,8 +2087,11 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, int col) {
Vb = Vb * pispin;
}
else Vb = Vb * ddspin(c, c->mondir, S42);
if(weirdhyperbolic || sphere) Vb = Vb * xpush(-(hexhexdist - hcrossf7));
if(ctof(c) && !euclid) Vb = Vb * xpush(hexhexdist - hcrossf);
if(whirl::whirl) Vb = Vb * xpush(crossf * .6);
else {
if(weirdhyperbolic || sphere) Vb = Vb * xpush(-(hexhexdist - hcrossf7));
if(ctof(c) && !euclid) Vb = Vb * xpush(hexhexdist - hcrossf);
}
return drawMonsterTypeDH(m, c, Vb, col, darkhistory, footphase);
}

View File

@ -348,7 +348,7 @@ void drawStats() {
int d = celldistance(ac[i], cwt.c);
if(d >= 0 && d < 64) qty[d]++;
}
if(geometry == gNormal)
if(geometry == gNormal && !whirl::whirl)
for(int i=nonbitrunc?6:8; i<=15; i++)
qty[i] =
nonbitrunc ?
@ -363,7 +363,7 @@ void drawStats() {
dialog::addHelp("a(d+4) = a(d+3) + a(d+2) + a(d+1) - a(d)");
dialog::addInfo("a(d) ~ 1.72208ᵈ", forecolor);
}
if(geometry == gNormal && nonbitrunc) {
if(geometry == gNormal && nonbitrunc && !whirl::whirl) {
dialog::addBreak(200);
dialog::addHelp("a(d+2) = 3a(d+1) - a(d+2)");
dialog::addInfo("a(d) ~ 2.61803ᵈ", forecolor);

14
hyper.h
View File

@ -1804,6 +1804,7 @@ namespace linepatterns {
};
transmatrix ddspin(cell *c, int d, int bonus = 0);
transmatrix iddspin(cell *c, int d, int bonus = 0);
bool doexiton(int sym, int uni);
void switchFullscreen();
string turnstring(int i);
@ -2940,3 +2941,16 @@ string XLAT(string x, stringpar p1, stringpar p2);
string XLAT(string x, stringpar p1, stringpar p2, stringpar p3);
string XLAT(string x, stringpar p1, stringpar p2, stringpar p3, stringpar p4);
string XLAT(string x, stringpar p1, stringpar p2, stringpar p3, stringpar p4, stringpar p5);
namespace whirl {
extern bool whirl;
void compute_geometry();
void extend_map(cell *c, int d);
}
int get_sightrange();
int gamerange();
int numplayers();
extern int base_distlimit;

View File

@ -322,6 +322,11 @@ transmatrix spintox(const hyperpoint& H) {
return T;
}
void set_column(transmatrix& T, int i, const hyperpoint& H) {
for(int j=0; j<3; j++)
T[j][i] = H[j];
}
// reverse of spintox(H)
transmatrix rspintox(const hyperpoint& H) {
transmatrix T = Id;

View File

@ -453,9 +453,78 @@ bool confusingGeometry() {
}
transmatrix actualV(const heptspin& hs, const transmatrix& V) {
return (hs.spin || nonbitrunc) ? V * spin(hs.spin*2*M_PI/S7 + (nonbitrunc ? M_PI:0)) : V;
return (hs.spin || nonbitrunc) ? V * spin(hs.spin*2*M_PI/S7 + (nonbitrunc ? M_PI:0) + whirl::alpha) : V;
}
namespace whirl {
/*
void drawrec(cell *c, const transmatrix& V) {
if(dodrawcell(c))
drawcell(c, V, 0, false);
for(int i=0; i<c->type; i++) {
cell *c2 = c->mov[i];
if(!c2) continue;
if(c2->mov[0] != c) continue;
if(c2 == c2->master->c7) continue;
transmatrix V1 = V * ddspin(c, i) * xpush(crossf) * iddspin(c2, 0) * spin(M_PI);
drawrec(c2, V1);
}
} */
hyperpoint atz(const transmatrix& T, loc at) {
int sp = 0;
while(at.first < 0 || at.second < 0)
at = at * eudir(1), sp++;
if(sp>3) sp -= 6;
hyperpoint h = spin(2*M_PI*sp/S7) * T * hpxyz(at.first, at.second, 1);
h = mid(h,h);
return h;
}
void drawrec(cell *c, const transmatrix& V, const transmatrix& T, whirl::loc at, int dir) {
if(dodrawcell(c)) {
hyperpoint h = atz(T, at);
hyperpoint hl = atz(T, at + eudir(dir));
transmatrix T1 = V * rgpushxto0(h) * rspintox(gpushxto0(h) * hl) * spin(M_PI);
drawcell(c, T1, 0, false);
}
for(int i=0; i<c->type; i++) {
cell *c2 = c->mov[i];
if(!c2) continue;
if(c2->mov[0] != c) continue;
if(c2 == c2->master->c7) continue;
drawrec(c2, V, T, at + eudir(dir+i), dir + i + 3);
}
}
void drawrec(cell *c, const transmatrix& V) {
if(dodrawcell(c))
drawcell(c, V, 0, false);
for(int i=0; i<c->type; i++) {
cell *c2 = c->mov[i];
if(!c2) continue;
if(c2->mov[0] != c) continue;
if(c2 == c2->master->c7) continue;
transmatrix T;
set_column(T, 0, C0);
set_column(T, 1, ddspin(c, i) * xpush(tessf) * C0);
set_column(T, 2, ddspin(c, i+1) * xpush(tessf) * C0);
transmatrix corners;
set_column(corners, 0, hpxyz(0, 0, 1));
set_column(corners, 1, hpxyz(whirl::param.first, whirl::param.second, 1));
loc nx = param * loc(0,1);
set_column(corners, 2, hpxyz(nx.first, nx.second, 1));
// corners * e[i] = corner[i]
T = T * inverse(corners);
drawrec(c2, V, T, whirl::loc(1,0), 3);
}
}
}
void drawrec(const heptspin& hs, int lev, hstate s, const transmatrix& V) {
// shmup::calc_relative_matrix(cwt.c, hs.h);
@ -465,9 +534,14 @@ void drawrec(const heptspin& hs, int lev, hstate s, const transmatrix& V) {
transmatrix V10;
const transmatrix& V1 = hs.mirrored ? (V10 = V * Mirror) : V;
if(dodrawcell(c)) {
if(whirl::whirl) {
whirl::drawrec(c, actualV(hs, V1));
}
else if(dodrawcell(c)) {
reclevel = maxreclevel - lev;
drawcell(c, actualV(hs, V1), 0, hs.mirrored);
transmatrix V2 = actualV(hs, V1);
drawcell(c, V2, 0, hs.mirrored);
}
if(lev <= 0) return;

View File

@ -387,8 +387,8 @@ void addMessage(string s, char spamtype = 0);
#define ALPHA (M_PI*2/S7)
#define S7 ginf[geometry].sides
#define S3 ginf[geometry].vertex
#define weirdhyperbolic ((S7 > 7 || S3 > 3) && hyperbolic)
#define stdhyperbolic (S7 == 7 && S3 == 3)
#define weirdhyperbolic ((S7 > 7 || S3 > 3 || whirl::whirl) && hyperbolic)
#define stdhyperbolic (S7 == 7 && S3 == 3 && !whirl::whirl)
#define cgclass (ginf[geometry].cclass)
#define euclid (cgclass == gcEuclid)

View File

@ -1299,7 +1299,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
case laHive:
if(d == 9) {
if(hrand(2000) < (chaosmode ? 1000 : nonbitrunc?200:2) && !safety)
if(hrand(2000) < (chaosmode ? 1000 : (nonbitrunc && !whirl::whirl) ?200:2) && !safety)
hive::createBugArmy(c);
if(hrand(2000) < 100 && !c->wall && !c->item && !c->monst) {
int nww = 0;

View File

@ -807,7 +807,7 @@ void setAppropriateOverview() {
pushScreen(yendor::showMenu);
else if(peace::on)
pushScreen(peace::showMenu);
else if(geometry != gNormal && !chaosmode && !(geometry == gEuclid && isCrossroads(specialland)) && !(weirdhyperbolic && specialland == laCrossroads4)) {
else if((geometry != gNormal || whirl::whirl) && !chaosmode && !(geometry == gEuclid && isCrossroads(specialland)) && !(weirdhyperbolic && specialland == laCrossroads4)) {
runGeometryExperiments();
}
else {

View File

@ -36,7 +36,7 @@ bool ishex1(cell *c) {
int emeraldval(cell *c) {
if(euclid) return eupattern(c);
if(sphere) return 0;
if(ctof(c))
if(ctof(c) || whirl::whirl)
return c->master->emeraldval >> 3;
else {
return emerald_hexagon(
@ -92,6 +92,7 @@ int cdist50(cell *c) {
else return "012333321112322232222321123"[eufifty(c)] - '0';
}
if(c->type != 6) return cdist50(fiftyval(c));
if(whirl::whirl) return cdist50(c->master->c7);
int a0 = cdist50(createMov(c,0));
int a1 = cdist50(createMov(c,2));
int a2 = cdist50(createMov(c,4));
@ -313,7 +314,7 @@ int fieldval_uniq(cell *c) {
auto p = cell_to_pair(c);
return gmod(p.first * torusconfig::dx + p.second * torusconfig::dy, torusconfig::qty);
}
if(ctof(c)) return c->master->fieldval/S7;
if(ctof(c) || whirl::whirl) return c->master->fieldval/S7;
else {
int z = 0;
for(int u=0; u<S6; u+=2)
@ -962,6 +963,7 @@ int pattern_threecolor(cell *c) {
// in the 'pure heptagonal' tiling, returns true for a set of cells
// which roughly corresponds to the heptagons in the normal tiling
bool pseudohept(cell *c) {
if(whirl::whirl) return whirl::pseudohept(c);
return pattern_threecolor(c) == 0;
}
@ -1631,10 +1633,18 @@ namespace linepatterns {
break;
case patTriNet:
forCellEx(c2, c) if(c2 > c) if(gmatrix.count(c2)) if(celldist(c) != celldist(c2)) {
queueline(tC0(V), gmatrix[c2]*C0,
darkena(backcolor ^ 0xFFFFFF, 0, col),
2);
if(whirl::whirl) {
if(c->master->c7 != c) if(gmatrix.count(c->mov[0]))
queueline(tC0(V), gmatrix[c->mov[0]]*C0,
darkena(backcolor ^ 0xFFFFFF, 0, col),
2);
}
else {
forCellEx(c2, c) if(c2 > c) if(gmatrix.count(c2)) if(celldist(c) != celldist(c2)) {
queueline(tC0(V), gmatrix[c2]*C0,
darkena(backcolor ^ 0xFFFFFF, 0, col),
2);
}
}
break;

View File

@ -1094,7 +1094,7 @@ struct usershape {
usershape *usershapes[USERSHAPEGROUPS][USERSHAPEIDS];
void drawTentacle(hpcshape &h, ld rad, ld var, ld divby) {
double tlength = max(crossf, hexhexdist);
double tlength = max(crossf, hexhexdist * whirl::scale);
for(int i=0; i<=20; i++)
hpcpush(ddi(S21, rad + var * sin(i * M_PI/divby)) * ddi(0, tlength * i/20.) * C0);
for(int i=20; i>=0; i--)
@ -1345,10 +1345,16 @@ void buildpolys() {
{double x = hexvdist;
bshape(shFullFloor[0], PPR_FLOOR);
x *= bscale6;
x *= whirl::scale;
if(whirl::scale != 1) x *= 1.6;
// if(whirl::whirl::coords == whirl::euc_coord(2,0)) x /= 1.2;
// if(whirl::whirl::coords == whirl::euc_coord(3,0)) x /= 2;
for(int t=0; t<=S6; t++) hpcpush(ddi(S7 + t*S14, x) * C0);
x = rhexf;
x *= bscale7;
x *= whirl::scale;
if(whirl::scale != 1) x *= 1.6;
bshape(shFullFloor[1], PPR_FLOOR);
for(int t=0; t<=S7; t++) hpcpush(ddi(t*S12+td, x) * C0);
}
@ -1356,10 +1362,13 @@ void buildpolys() {
{double x = hexvdist;
bshape(shFullCross[0], PPR_FLOOR);
x *= bscale6;
x *= whirl::scale;
if(whirl::scale != 1) x /= 2;
for(int t=0; t<=S6; t++) { hpcpush(C0); if(t) hpcpush(ddi(S7 + t*S14, x) * C0); }
x = rhexf;
x *= bscale7;
x *= whirl::scale;
bshape(shFullCross[1], PPR_FLOOR);
for(int t=0; t<=S7; t++) { hpcpush(C0); if(t) hpcpush(ddi(t*S12+td, x) * C0); }
}
@ -1593,6 +1602,8 @@ void buildpolys() {
if(nonbitrunc && a38) disksize *= 2;
else if(a38) disksize *= 1.5;
else if(nonbitrunc && S6 == 8) disksize *= 1.5;
if(a38 && whirl::whirl) disksize /= 2;
bshape(shDisk, PPR_ITEM);
for(int i=0; i<=S84; i+=S3)
@ -1810,6 +1821,12 @@ void buildpolys() {
if(a46 && !nonbitrunc) spzoom6 *= .9;
if(a47 && !nonbitrunc) spzoom6 *= .85;
ld whirlf = 1;
if(whirl::scale != 1) whirlf = whirl::scale * 1.6;
ld whirlf2 = whirl::scale;
double espzoom6 = spzoom6, espzoomd7 = spzoomd7;
// if(euclid) espzoom6 *= 1.5, espzoomd7 *= 1.2;
@ -1836,7 +1853,7 @@ void buildpolys() {
bshape(shCrossFloor[0], PPR_FLOOR, scalef*espzoom6*gsca(sphere,.9)*ffscale2, 5, ffspin2);
bshape(shCrossFloor[1], PPR_FLOOR, scalef*espzoomd7*gsca(sphere,.9)*ffscale2 * gsca(a47,1.3), 6, octroll);
double ntscale = gsca(nonbitrunc, gsca(a38, 1.4, a47, 2, a46, 1.525));
double ntscale = gsca(nonbitrunc, gsca(a38, 1.4, a47, 2, a46, 1.525)) * whirl::scale;
double ntrot = grot(a46&&nonbitrunc, .25, a38&&nonbitrunc, -.2);
bshape(shChargedFloor[0], PPR_FLOOR, scalef*espzoom6*gsca(sphere,.9)*ffscale2, 7, ffspin2);
@ -1848,8 +1865,8 @@ void buildpolys() {
bshape(shSStarFloor[1], PPR_FLOOR, scalef*spzoomd7*gsca(a4,.85), 12, octroll);
bshape(shOverFloor[0], PPR_FLOOR, scalef*spzoom * gsca(a47,1.3, a45,1.3, a46,1.1), 13, grot(a47,-.75, a45,-.7, a46,.9));
if(nonbitrunc) {
if(a4) bshape(shOverFloor[1], PPR_FLOOR, 1, 368 + S7 - 5, 0);
else bshape(shOverFloor[1], PPR_FLOOR, gsca(a38,1.3, sphere, .83), 14, octroll + grot(a38,.4));
if(a4) bshape(shOverFloor[1], PPR_FLOOR, whirlf2, 368 + S7 - 5, 0);
else bshape(shOverFloor[1], PPR_FLOOR, whirlf2 * gsca(a38,1.3, sphere, .83), 14, octroll + grot(a38,.4));
}
else bshape(shOverFloor[1], PPR_FLOOR, scalef*spzoom7, 15);
bshape(shOverFloor[2], PPR_FLOOR, euclid?scalef*1.2:spzoom7, 16);
@ -1859,8 +1876,8 @@ void buildpolys() {
if(nonbitrunc) bshape(shFeatherFloor[1], PPR_FLOOR, sphere ? .83 : gsca(ap4,1.1) * ntscale, 20, ntrot);
else bshape(shFeatherFloor[1], PPR_FLOOR, scalef*spzoom7*gsca(sphere,1.1,a4,1.1)*ffscale2*ntscale, 21, sphere?1.3:ntrot);
bshape(shFeatherFloor[2], PPR_FLOOR, scalef*1.1, 22); // Euclidean variant
bshape(shBarrowFloor[0], PPR_FLOOR, gsca(euclid,.9) * spzoom6 * gsca(a467,1.7, a46,.8, a38,1.4) * gsca(euclid&&a4, .7), 23);
bshape(shBarrowFloor[1], PPR_FLOOR, spzoomd7 * gsca(a4,1.15, a467,1.9, a46,.8, a38,1.5, sphere&&nonbitrunc,.9) * gsca(euclid&&a4, .5), 24, octroll - grot(a47,.1));
bshape(shBarrowFloor[0], PPR_FLOOR, whirlf * gsca(euclid,.9) * spzoom6 * gsca(a467,1.7, a46,.8, a38,1.4) * gsca(euclid&&a4, .7), 23);
bshape(shBarrowFloor[1], PPR_FLOOR, whirlf * spzoomd7 * gsca(a4,1.15, a467,1.9, a46,.8, a38,1.5, sphere&&nonbitrunc,.9) * gsca(euclid&&a4, .5), 24, octroll - grot(a47,.1));
bshape(shBarrowFloor[2], PPR_FLOOR, ntscale*gsca(sphere||euclid,.9) * gsca(euclid&&a4&&nonbitrunc, .5), 25, ntrot + grot(euclid&&a4&&nonbitrunc, M_PI/4));
bshape(shNewFloor[0], PPR_FLOOR, scalef*espzoom6 * ffscale2, 26, ffspin2);
bshape(shNewFloor[1], PPR_FLOOR, scalef*espzoomd7 * ffscale2, 27, octroll);
@ -1949,12 +1966,12 @@ void buildpolys() {
bshape(shSwitchFloor[0], PPR_FLOOR, scalef*spzoom6*ffscale2, 377, ffspin2);
bshape(shSwitchFloor[1], PPR_FLOOR, scalef*spzoomd7*ffscale2, 378, ffspin2);
bshape(shSwitchFloor[2], PPR_FLOOR, euclid?scalef*1.2:spzoom7, 379, ffspin2);
bshape(shSwitchFloor[2], PPR_FLOOR, euclid?scalef*1.2:scalef*spzoom7, 379, ffspin2);
bshape(shSwitchDisk, PPR_FLOOR); for(int i=0; i<=S84; i+=S3) hpcpush(ddi(i, .06) * C0);
bshape(shTurtleFloor[0], PPR_FLOOR, gsca(euclid,.9, sphere, .9*1.3, a4, 1.6, a38, 1.3, a467, 1.4) * gsca(euclid&&a4, .9), 176);
bshape(shTurtleFloor[1], PPR_FLOOR, scalef * gsca(euclid,.9, a4, .9, a47,1.3) * gsca(euclid&&a4, .8), 177, octroll - grot(a47,.1));
bshape(shTurtleFloor[0], PPR_FLOOR, whirlf * gsca(euclid,.9, sphere, .9*1.3, a4, 1.6, a38, 1.3, a467, 1.4) * gsca(euclid&&a4, .9), 176);
bshape(shTurtleFloor[1], PPR_FLOOR, whirlf * scalef * gsca(euclid,.9, a4, .9, a47,1.3) * gsca(euclid&&a4, .8), 177, octroll - grot(a47,.1));
bshape(shTurtleFloor[2], PPR_FLOOR, ntscale * gsca(sphere && nonbitrunc, .9) * gsca(euclid&&a4&&nonbitrunc, .5), 178, ntrot + grot(euclid&&a4&&nonbitrunc, M_PI/4)); // nonbitrunc
bshape(shDragonFloor[0], PPR_FLOOR_DRAGON, gsca(a4,1.6, a38, 1.3) * gsca(euclid&&a4, .5), 181, ffspin2);
@ -2023,17 +2040,17 @@ void buildpolys() {
bshape(shWormTail, PPR_TENTACLE1, scalef, 383);
bshape(shSmallWormTail, PPR_TENTACLE1, scalef, 384);
if(nonbitrunc) bshape(shDragonSegment, PPR_TENTACLE1, 1, 233);
if(nonbitrunc) bshape(shDragonSegment, PPR_TENTACLE1, whirl::scale, 233);
else bshape(shDragonSegment, PPR_TENTACLE1, scalef, 234);
bshape(shDragonWings, PPR_ONTENTACLE, scalef, 237);
bshape(shDragonLegs, PPR_TENTACLE0, scalef, 238);
if(nonbitrunc) bshape(shDragonTail, PPR_TENTACLE1, 1, 239);
if(nonbitrunc) bshape(shDragonTail, PPR_TENTACLE1, whirl::scale, 239);
else bshape(shDragonTail, PPR_TENTACLE1, scalef, 240);
bshape(shDragonNostril, PPR_ONTENTACLE_EYES, scalef, 241);
bshape(shDragonHead, PPR_ONTENTACLE, scalef, 242);
if(nonbitrunc) bshape(shSeaTentacle, PPR_TENTACLE1, 1, 245);
if(nonbitrunc) bshape(shSeaTentacle, PPR_TENTACLE1, whirl::scale, 245);
else bshape(shSeaTentacle, PPR_TENTACLE1, 1, 246);
ld ksc = nonbitrunc ? 1.8 : 1.5;
ld ksc = (nonbitrunc ? 1.8 : 1.5) * whirl::scale;
bshape(shKrakenHead, PPR_ONTENTACLE, ksc, 247);
bshape(shKrakenEye, PPR_ONTENTACLE_EYES, ksc, 248);
bshape(shKrakenEye2, PPR_ONTENTACLE_EYES2, ksc, 249);
@ -2264,10 +2281,10 @@ void buildpolys() {
for(int v=0; v<13; v++) for(int z=0; z<2; z++)
copyshape(shTortoise[v][4+z], shTortoise[v][2+z], shTortoise[v][2+z].prio + (PPR_CARRIED-PPR_ITEM));
if(nonbitrunc) bshape(shMagicSword, PPR_MAGICSWORD, 1, 243);
if(nonbitrunc) bshape(shMagicSword, PPR_MAGICSWORD, whirl::scale, 243);
else bshape(shMagicSword, PPR_MAGICSWORD, 1, 244);
if(nonbitrunc) bshape(shMagicShovel, PPR_MAGICSWORD, 1, 333);
if(nonbitrunc) bshape(shMagicShovel, PPR_MAGICSWORD, whirl::scale, 333);
else bshape(shMagicShovel, PPR_MAGICSWORD, 1, 333);
bshape(shBead0, 20, 1, 250);
@ -3486,6 +3503,8 @@ NEWSHAPE
/* floors */
// need eswap
#define nbtplain (nonbitrunc && !whirl::whirl)
#define DESERTFLOOR (nonbitrunc ? shCloudFloor : shDesertFloor)[ct6]
#define BUTTERFLYFLOOR (nonbitrunc ? shFloor : shButterflyFloor)[ct6]
#define PALACEFLOOR (nonbitrunc?shFloor:shPalaceFloor)[ct6]
@ -3496,10 +3515,10 @@ NEWSHAPE
#define NEWFLOOR (nonbitrunc ? shCloudFloor : shNewFloor)[ct6]
#define CROSSFLOOR (nonbitrunc ? shFloor : shCrossFloor)[ct6]
#define TROLLFLOOR shTrollFloor[ct6]
#define BARROWFLOOR shBarrowFloor[(euclid&&!a4)?0:nonbitrunc?2:ct6]
#define BARROWFLOOR shBarrowFloor[(euclid&&!a4)?0:nbtplain?2:ct6]
#define LAVAFLOOR (nonbitrunc ? shFloor : shLavaFloor)[ct6]
#define TRIFLOOR ((nonbitrunc ? shFloor : shTriFloor)[ct6])
#define TURTLEFLOOR shTurtleFloor[nonbitrunc ? 2 : ct6]
#define TURTLEFLOOR shTurtleFloor[nbtplain ? 2 : ct6]
#define ROSEFLOOR shRoseFloor[ct6]
#define ECT ((euclid&&!a4)?2:ct6)
@ -3515,7 +3534,7 @@ NEWSHAPE
#define MFLOOR2 shMFloor2[ct6]
#define STARFLOOR shStarFloor[ECT]
#define DRAGONFLOOR shDragonFloor[ECT]
#define SWITCHFLOOR shSwitchFloor[nonbitrunc?2:ct6]
#define SWITCHFLOOR shSwitchFloor[nbtplain?2:ct6]
// fix Warp
// fix Kraken

View File

@ -102,7 +102,7 @@ void initgame() {
if(isGravityLand(firstland) && !tactic::on) firstland = laCrossroads;
cwt.c = currentmap->gamestart(); cwt.spin = 0; cwt.mirrored = false;
cwt.c->land = (geometry && !safety) ? specialland : firstland;
cwt.c->land = ((geometry || whirl::whirl) && !safety) ? specialland : firstland;
chaosAchieved = false;
@ -1107,9 +1107,10 @@ void restartGame(char switchWhat, bool push, bool keep_screens) {
tour::on = !tour::on;
}
#endif
if(switchWhat == '7') {
if(switchWhat == '7' || switchWhat == 'w') {
if(euclid6) geometry = gNormal;
nonbitrunc = !nonbitrunc;
whirl::whirl = (switchWhat == 'w');
resetGeometry();
#if CAP_TEXTURE
if(texture::config.tstate == texture::tsActive)
@ -1123,6 +1124,7 @@ void restartGame(char switchWhat, bool push, bool keep_screens) {
else geometry = targetgeometry;
if(chaosmode && (euclid || sphere || quotient)) chaosmode = false;
if(nonbitrunc && euclid6) nonbitrunc = false;
if(whirl::whirl && (S3 != 3 || elliptic)) whirl::whirl = false;
resetGeometry();
#if CAP_TEXTURE