diff --git a/game.cpp b/game.cpp index a3ae984f..7f13b542 100644 --- a/game.cpp +++ b/game.cpp @@ -4459,6 +4459,7 @@ void removeIvy(cell *c) { void moveivy() { if(isize(ivies) == 0) return; + if(racing::on) return; pathdata pd(moIvyRoot); for(int i=0; i track; map > trackstage; +void fix_cave(cell *c) { + int v = 0; + // if(c->wall == waCavewall) v++; + // if(c->wall == waCavefloor) v--; + forCellEx(c2, c) { + if(c2->wall == waCavewall) v++; + if(c2->wall == waCavefloor) v--; + } + else v--; + if(v>0 && c->wall == waCavefloor) c->wall = waCavewall; + if(v<0 && c->wall == waCavewall) c->wall = waCavefloor; + } + bool bad(cell *c2, cell *c) { + if(c2->land == laCaves) { + forCellEx(c3, c2) fix_cave(c3); + fix_cave(c2); + } if(!passable(c2, c, P_ISPLAYER)) return true; if((c2->land == laCrossroads) ^ (c->land == laCrossroads)) return true; return false; @@ -58,9 +75,13 @@ void generate_track() { cellbydist[0].push_back(s); cell *goal; + + int traversed = 0; while(true) { + traversed++; if(cellbydist.empty()) { + printf("reset after traversing %d\n", traversed); stop_game(); start_game(); return; @@ -193,23 +214,49 @@ void generate_track() { if(c->wall == waMirror || c->wall == waCloud) c->wall = waNone; if(!isIvy(c)) c->monst = moNone; + if(c->monst == moIvyHead) c->monst = moIvyWait; if(inmirror(c->land)) ; - else if(p.first == TWIDTH) - c->wall = waBarrier, + else if(p.first == TWIDTH) { + killMonster(c, moNone, 0); + c->wall = waBarrier; c->land = laBarrier; - else if(p.first > TWIDTH) - c->land = laMemory, + } + else if(p.first > TWIDTH) { + killMonster(c, moNone, 0); + c->land = laMemory; c->wall = waChasm; - if(p.second >= win && p.first < TWIDTH) c->wall = hrand(2) ? waMirror : waCloud; + } + if(p.second >= win && p.first < TWIDTH) { + c->wall = hrand(2) ? waMirror : waCloud; + killMonster(c, moNone, 0); + } } } + for(int i=0; iland == laCaves) { + set hash; + while(true) { + unsigned hashval = 7; + int id = 0; + for(auto s: trackstage) { + fix_cave(s.first); + if(s.first->wall == waCavewall) + hashval = (3+2*(id++)) * hashval + 1; + if(s.first->wall == waCavefloor) + hashval = (3+2*(id++)) * hashval + 2; + } + printf("hashval = %x id = %d\n", hashval, id); + if(hash.count(hashval)) break; + hash.insert(hashval); + } + } if(1) { manual_celllister cl; cl.add(s); @@ -260,7 +307,6 @@ void set_view() { shmup::monster *who = shmup::pc[current_player]; safety = true; - printf("%d\n", ticks); if(!inrec) history.emplace_back(ticks, who->base, who->at, who->footphase); transmatrix at = ggmatrix(who->base) * who->at; @@ -375,9 +421,9 @@ vector race_lands = { laIce, laDesert, - laCrossroads, /* need editing */ - laCaves, /* need fixing */ - laJungle, /* need pacifying Ivy */ + laCrossroads, + laCaves, + laJungle, laMirror, laHell, laDryForest, @@ -386,7 +432,7 @@ vector race_lands = { laElementalWall, laWildWest, laDragon, - laTerracotta, /* disable traps and warriors */ + laTerracotta, laRuins, }; diff --git a/shmup.cpp b/shmup.cpp index 24305a7b..5b7af485 100644 --- a/shmup.cpp +++ b/shmup.cpp @@ -1636,7 +1636,6 @@ void movePlayer(monster *m, int delta) { if(m->vel * mgo < 0) mgo *= 3; m->vel += mgo * delta / 600; playergo[cpid] = m->vel * SCALE * delta / 600; - printf("vel = %lf go = %lf\n", m->vel, playergo[cpid]); } else {