mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-19 19:54:47 +00:00
removed the obsolete *MovR functions
This commit is contained in:
parent
ef89c7ed9d
commit
661743a19b
10
bigstuff.cpp
10
bigstuff.cpp
@ -289,14 +289,14 @@ void generateTreasureIsland(cell *c) {
|
||||
qlo = i; qhi = i;
|
||||
while(true && qc < MAX_EDGE) {
|
||||
qlo--;
|
||||
c2 = createMovR(c, qlo);
|
||||
c2 = c->cmodmove(qlo);
|
||||
if(!eubinary && !c2->master->alt) break;
|
||||
if(celldistAlt(c2) >= celldistAlt(c)) break;
|
||||
ctab[qc++] = c2;
|
||||
}
|
||||
while(true && qc < MAX_EDGE) {
|
||||
qhi++;
|
||||
c2 = createMovR(c, qhi);
|
||||
c2 = c->cmodmove(qhi);
|
||||
if(!eubinary && !c2->master->alt) break;
|
||||
if(celldistAlt(c2) >= celldistAlt(c)) break;
|
||||
ctab[qc++] = c2;
|
||||
@ -310,7 +310,7 @@ void generateTreasureIsland(cell *c) {
|
||||
printf("vs %d\n", celldistAlt(c));
|
||||
return;
|
||||
}
|
||||
cell* c2 = createMovR(c, (qlo+qhi)/2);
|
||||
cell* c2 = c->cmodmove((qlo+qhi)/2);
|
||||
generateTreasureIsland(c2);
|
||||
if(!src) {
|
||||
c->wall = c2->wall;
|
||||
@ -553,7 +553,7 @@ void buildEquidistant(cell *c) {
|
||||
int q = (bsid+j+42) % c2->type;
|
||||
cell *c3 = c2->move(q);
|
||||
if(coastval(c3, b) < mcv) {
|
||||
cell *c4 = createMovR(c2, bsid+1);
|
||||
cell *c4 = c2->cmodmove(bsid+1);
|
||||
if(c4->land == laNone && c2->mpdist <= BARLEV) setdist(c4, BARLEV, c2);
|
||||
buildEquidistant(c4);
|
||||
mcv2 = coastval(c4, b);
|
||||
@ -562,7 +562,7 @@ void buildEquidistant(cell *c) {
|
||||
q = (bsid-j+MODFIXER) % c2->type;
|
||||
c3 = c2->move(q);
|
||||
if(coastval(c3, b) < mcv) {
|
||||
cell *c4 = createMovR(c2, bsid-1);
|
||||
cell *c4 = c2->cmodmove(bsid-1);
|
||||
if(c4->land == laNone && c2->mpdist <= BARLEV) setdist(c4, BARLEV, c2);
|
||||
buildEquidistant(c4);
|
||||
mcv2 = coastval(c4, b);
|
||||
|
10
cell.cpp
10
cell.cpp
@ -161,16 +161,6 @@ cell *createMov(cell *c, int d) {
|
||||
return c->move(d);
|
||||
}
|
||||
|
||||
cell *createMovR(cell *c, int d) {
|
||||
d %= MODFIXER; d += MODFIXER; d %= c->type;
|
||||
return createMov(c, d);
|
||||
}
|
||||
|
||||
cell *getMovR(cell *c, int d) {
|
||||
d %= MODFIXER; d += MODFIXER; d %= c->type;
|
||||
return c->move(d);
|
||||
}
|
||||
|
||||
void eumerge(cell* c1, int s1, cell *c2, int s2, bool mirror) {
|
||||
if(!c2) return;
|
||||
c1->move(s1) = c2; c1->c.setspin(s1, s2, mirror);
|
||||
|
2
game.cpp
2
game.cpp
@ -5275,7 +5275,7 @@ void sideAttack(cell *mf, int dir, eMonster who, int bonus, eItem orb) {
|
||||
if(!items[orb]) return;
|
||||
if(who != moPlayer && !items[itOrbEmpathy]) return;
|
||||
for(int k: {-1, 1}) {
|
||||
cell *mt = getMovR(mf, dir + k*bonus);
|
||||
cell *mt = mf->modmove(dir + k*bonus);
|
||||
eMonster m = mt->monst;
|
||||
flagtype f = AF_SIDE;
|
||||
if(items[itOrbSlaying]) f|= AF_CRUSH;
|
||||
|
2
hyper.h
2
hyper.h
@ -3184,8 +3184,6 @@ namespace princess {
|
||||
|
||||
int eudist(int sx, int sy);
|
||||
|
||||
cell *createMovR(cell *c, int d);
|
||||
|
||||
bool ishept(cell *c);
|
||||
int cdist50(cell *c);
|
||||
bool polarb50(cell *c);
|
||||
|
12
landgen.cpp
12
landgen.cpp
@ -1736,15 +1736,15 @@ void giantLandSwitch(cell *c, int d, cell *from) {
|
||||
}
|
||||
else if(ishept(c) && hrand(100) < (doCross?20:8) && !c->monst) {
|
||||
buildRedWall(c, 80);
|
||||
int i = hrand(S7);
|
||||
buildRedWall(createMovR(c, i), 33);
|
||||
cellwalker cw(c, hrand(S7));
|
||||
buildRedWall(cw.cpeek(), 33);
|
||||
if(hrand(2) == 0)
|
||||
buildRedWall(createMovR(createMovR(c, i), c->c.spin(i)+(hrand(2)?2:4)), 20);
|
||||
i = (i + 3 + hrand(2)) % S7;
|
||||
buildRedWall((cw + wstep + (hrand(2)?2:4)).cpeek(), 20);
|
||||
cw += rev;
|
||||
if(hrand(6) < 4)
|
||||
buildRedWall(createMovR(c, i), 33);
|
||||
buildRedWall(cw.cpeek(), 33);
|
||||
if(hrand(2) == 0)
|
||||
buildRedWall(createMovR(createMovR(c, i), c->c.spin(i)+(hrand(2)?2:4)), 20);
|
||||
buildRedWall((cw + wstep + (hrand(2)?2:4)).cpeek(), 20);
|
||||
}
|
||||
}
|
||||
if(d == 7 && c->wall == waNone)
|
||||
|
14
shmup.cpp
14
shmup.cpp
@ -1946,7 +1946,7 @@ void movePlayer(monster *m, int delta) {
|
||||
double bestd = 9999;
|
||||
pushmonsters();
|
||||
for(int di=-1; di<2; di+=2) {
|
||||
cell *c = getMovR(c2, sd+di);
|
||||
cell *c = c2->modmove(sd+di);
|
||||
if(!c) continue;
|
||||
if(m->isVirtual || !gmatrix.count(c)) continue;
|
||||
double d = intval(gmatrix[c] * C0, m->pat * C0);
|
||||
@ -2227,8 +2227,8 @@ int reflect(cell*& c2, cell*& mbase, transmatrix& nat) {
|
||||
int d = mirror::mirrordir(c2);
|
||||
if(d != -1) {
|
||||
for(int k=0; k<7; k++) {
|
||||
cell *ca = createMovR(c2, d-k);
|
||||
cell *cb = createMovR(c2, d+k);
|
||||
cell *ca = c2->cmodmove(d-k);
|
||||
cell *cb = c2->cmodmove(d+k);
|
||||
if(ca->land == laMirror && inmirror(cb)) {
|
||||
reflectmatrix(nat, ca, cb, true);
|
||||
reflections++;
|
||||
@ -2238,11 +2238,11 @@ int reflect(cell*& c2, cell*& mbase, transmatrix& nat) {
|
||||
}
|
||||
else {
|
||||
for(int k=0; k<6; k++) {
|
||||
cell *cb = createMovR(c2, k+1);
|
||||
cell *cc = createMovR(c2, k+2);
|
||||
cell *cb = c2->cmodmove(k+1);
|
||||
cell *cc = c2->cmodmove(k+2);
|
||||
if(cb->land != laMirrorWall || cc->land != laMirrorWall) continue;
|
||||
cell *ca = createMovR(c2, k);
|
||||
cell *cd = createMovR(c2, k+3);
|
||||
cell *ca = c2->cmodmove(k);
|
||||
cell *cd = c2->cmodmove(k+3);
|
||||
if(reflectmatrix(nat, cc, ca, true)) reflections++;
|
||||
for(int limit=0; limit<10 && reflectmatrix(nat, cb, cd, true) && (reflections++, reflectmatrix(nat, cc, ca, true)); limit++) reflections+=2;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user