1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-20 08:27:39 +00:00

more elegant cellwalkers

This commit is contained in:
Zeno Rogue
2018-03-24 12:59:01 +01:00
parent 2c09c5ee56
commit ac37b6df99
20 changed files with 371 additions and 467 deletions

View File

@@ -720,7 +720,8 @@ void handleInput(int delta) {
int dir = multi::whereto[i].d;
if(dir == MD_UNDECIDED) return NULL;
if(dir == MD_USE_ORB) return multi::whereto[i].tgt;
if(dir >= 0) { cwspin(cwti, dir); cwstep(cwti); }
if(dir >= 0)
cwti = cwti + dir + wstep;
return cwti.c;
}
@@ -1653,11 +1654,9 @@ void movePlayer(monster *m, int delta) {
}
visibleFor(300);
cellwalker push(c2, dirfromto(c2, m->base));
cwspin(push, 3 * -subdir); cwstep(push);
push = push + 3 * (-subdir) + wstep;
if(!canPushThumperOn(push.c, c2, m->base) && c2->type == 7) {
cwstep(push);
cwspin(push, 1 * -subdir);
cwstep(push);
push = push + wstep - subdir + wstep;
}
if(!canPushThumperOn(push.c, c2, m->base)) {
go = false;
@@ -3457,7 +3456,7 @@ void virtualRebase(cell*& base, transmatrix& at, bool tohex) {
heptspin hs;
hs.h = h;
hs.spin = d;
heptspin hs2 = hsstep(hs, 0);
heptspin hs2 = hs + wstep;
transmatrix V2 = spin((nonbitrunc?M_PI:0)-hs2.spin*2*M_PI/S7) * invheptmove[d];
if(nonbitrunc) V2 = V2 * spin(M_PI);
double newz = (V2 * at * C0) [2];