mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-25 01:20:37 +00:00
changed names generateAlts to extend_altmap and createAlternateMap to create_altmap
This commit is contained in:
parent
0e71e67ba6
commit
bc79fd05df
46
bigstuff.cpp
46
bigstuff.cpp
@ -121,7 +121,7 @@ EX cell *findcompass(cell *c) {
|
|||||||
|
|
||||||
while(inscreenrange(c)) {
|
while(inscreenrange(c)) {
|
||||||
if(!eubinary && !sphere && !quotient)
|
if(!eubinary && !sphere && !quotient)
|
||||||
currentmap->generateAlts(c->master);
|
currentmap->extend_altmap(c->master);
|
||||||
forCellEx(c2, c) if(compassDist(c2) < d) {
|
forCellEx(c2, c) if(compassDist(c2) < d) {
|
||||||
c = c2;
|
c = c2;
|
||||||
d = compassDist(c2);
|
d = compassDist(c2);
|
||||||
@ -171,8 +171,8 @@ namespace altmap {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void hrmap::generateAlts(heptagon *h, int levs, bool link_cdata) {
|
void hrmap::extend_altmap(heptagon *h, int levs, bool link_cdata) {
|
||||||
if(hybri) { PIU ( generateAlts(h, levs, link_cdata) ); }
|
if(hybri) { PIU ( extend_altmap(h, levs, link_cdata) ); }
|
||||||
if(!h->alt) return;
|
if(!h->alt) return;
|
||||||
preventbarriers(h->c7);
|
preventbarriers(h->c7);
|
||||||
if(h->c7) forCellEx(c2, h->c7) preventbarriers(c2);
|
if(h->c7) forCellEx(c2, h->c7) preventbarriers(c2);
|
||||||
@ -201,7 +201,7 @@ void hrmap::generateAlts(heptagon *h, int levs, bool link_cdata) {
|
|||||||
ho->alt = hm;
|
ho->alt = hm;
|
||||||
altmap::relspin(hm) = gmod(h->c.spin(i) - h->alt->c.spin(ir), hm->type);
|
altmap::relspin(hm) = gmod(h->c.spin(i) - h->alt->c.spin(ir), hm->type);
|
||||||
if(link_cdata) hm->cdata = (cdata*) ho;
|
if(link_cdata) hm->cdata = (cdata*) ho;
|
||||||
if(levs) currentmap->generateAlts(ho, levs-1, link_cdata);
|
if(levs) currentmap->extend_altmap(ho, levs-1, link_cdata);
|
||||||
if(S3 >= OINF) preventbarriers(ho->c7);
|
if(S3 >= OINF) preventbarriers(ho->c7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -215,12 +215,12 @@ EX int hrandom_adjacent(cellwalker cw) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
EX heptagon *createAlternateMap(cell *c, int rad, hstate firststate, int special IS(0)) {
|
EX heptagon *create_altmap(cell *c, int rad, hstate firststate, int special IS(0)) {
|
||||||
|
|
||||||
if(hybri) {
|
if(hybri) {
|
||||||
if(hybrid::under_class() == gcSphere) return NULL;
|
if(hybrid::under_class() == gcSphere) return NULL;
|
||||||
c = hybrid::get_where(c).first;
|
c = hybrid::get_where(c).first;
|
||||||
return PIU ( createAlternateMap(c, rad, firststate, special) );
|
return PIU ( create_altmap(c, rad, firststate, special) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for direction
|
// check for direction
|
||||||
@ -311,7 +311,7 @@ EX heptagon *createAlternateMap(cell *c, int rad, hstate firststate, int special
|
|||||||
alt->cdata = (cdata*) h;
|
alt->cdata = (cdata*) h;
|
||||||
|
|
||||||
for(int d=rad; d>=0; d--) {
|
for(int d=rad; d>=0; d--) {
|
||||||
currentmap->generateAlts(cx[d]->master);
|
currentmap->extend_altmap(cx[d]->master);
|
||||||
preventbarriers(cx[d]);
|
preventbarriers(cx[d]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,7 +356,7 @@ EX void generateTreasureIsland(cell *c) {
|
|||||||
int qlo, qhi;
|
int qlo, qhi;
|
||||||
for(int i=0; i<c->type; i++) {
|
for(int i=0; i<c->type; i++) {
|
||||||
cell *c2 = createMov(c, i);
|
cell *c2 = createMov(c, i);
|
||||||
if(!eubinary) currentmap->generateAlts(c2->master);
|
if(!eubinary) currentmap->extend_altmap(c2->master);
|
||||||
if(greater_alt(c, c2)) {
|
if(greater_alt(c, c2)) {
|
||||||
ctab.push_back(c2);
|
ctab.push_back(c2);
|
||||||
qlo = i; qhi = i;
|
qlo = i; qhi = i;
|
||||||
@ -1396,15 +1396,15 @@ EX bool have_alt(cell *c) {
|
|||||||
|
|
||||||
/** \brief generate alts around c if necessary */
|
/** \brief generate alts around c if necessary */
|
||||||
EX void gen_alt(cell *c) {
|
EX void gen_alt(cell *c) {
|
||||||
if(!eubinary) currentmap->generateAlts(c->master);
|
if(!eubinary) currentmap->extend_altmap(c->master);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \brief generate alts around c and further if necessary */
|
/** \brief generate alts around c and further if necessary */
|
||||||
EX void gen_alt_around(cell *c) {
|
EX void gen_alt_around(cell *c) {
|
||||||
if(!eubinary) {
|
if(!eubinary) {
|
||||||
currentmap->generateAlts(c->master);
|
currentmap->extend_altmap(c->master);
|
||||||
for(int i=0; i<c->master->type; i++)
|
for(int i=0; i<c->master->type; i++)
|
||||||
currentmap->generateAlts(c->master->move(i));
|
currentmap->extend_altmap(c->master->move(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1648,7 +1648,7 @@ EX void build_walls(cell *c, cell *from) {
|
|||||||
|
|
||||||
EX void start_camelot(cell *c) {
|
EX void start_camelot(cell *c) {
|
||||||
int rtr = newRoundTableRadius();
|
int rtr = newRoundTableRadius();
|
||||||
heptagon *alt = createAlternateMap(c, ls::single() ? 2 : rtr+(hyperbolic && WDIM == 3 ? 11 : 14), ls::single() ? hsA : hsOrigin);
|
heptagon *alt = create_altmap(c, ls::single() ? 2 : rtr+(hyperbolic && WDIM == 3 ? 11 : 14), ls::single() ? hsA : hsOrigin);
|
||||||
if(alt) {
|
if(alt) {
|
||||||
altmap::radius(alt) = rtr;
|
altmap::radius(alt) = rtr;
|
||||||
altmap::orig_land(alt) = c->land;
|
altmap::orig_land(alt) = c->land;
|
||||||
@ -1675,25 +1675,25 @@ EX void build_horocycles(cell *c, cell *from) {
|
|||||||
start_camelot(c);
|
start_camelot(c);
|
||||||
|
|
||||||
if(c->land == laRlyeh && can_start_horo(c) && (quickfind(laTemple) || peace::on || (hrand(I2000) < 100 && items[itStatue] >= U5)))
|
if(c->land == laRlyeh && can_start_horo(c) && (quickfind(laTemple) || peace::on || (hrand(I2000) < 100 && items[itStatue] >= U5)))
|
||||||
createAlternateMap(c, horo_gen_distance(), hsA);
|
create_altmap(c, horo_gen_distance(), hsA);
|
||||||
|
|
||||||
if(c->land == laJungle && can_start_horo(c) && (quickfind(laMountain) || (hrand(I2000) < 100 && landUnlocked(laMountain))))
|
if(c->land == laJungle && can_start_horo(c) && (quickfind(laMountain) || (hrand(I2000) < 100 && landUnlocked(laMountain))))
|
||||||
createAlternateMap(c, horo_gen_distance(), hsA);
|
create_altmap(c, horo_gen_distance(), hsA);
|
||||||
|
|
||||||
if(c->land == laOvergrown && can_start_horo(c) && (quickfind(laClearing) || (hrand(I2000) < 25 && items[itMutant] >= U5 && isLandIngame(laClearing)))) {
|
if(c->land == laOvergrown && can_start_horo(c) && (quickfind(laClearing) || (hrand(I2000) < 25 && items[itMutant] >= U5 && isLandIngame(laClearing)))) {
|
||||||
heptagon *h = createAlternateMap(c, horo_gen_distance(), hsA);
|
heptagon *h = create_altmap(c, horo_gen_distance(), hsA);
|
||||||
if(h) clearing::bpdata[h].root = NULL;
|
if(h) clearing::bpdata[h].root = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(stdhyperbolic && c->land == laStorms && can_start_horo(c) && hrand(2000) < 1000) {
|
if(stdhyperbolic && c->land == laStorms && can_start_horo(c) && hrand(2000) < 1000) {
|
||||||
heptagon *h = createAlternateMap(c, horo_gen_distance(), hsA);
|
heptagon *h = create_altmap(c, horo_gen_distance(), hsA);
|
||||||
if(h) altmap::which(h->alt) = hrand(2);
|
if(h) altmap::which(h->alt) = hrand(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(c->land == laOcean && deepOcean && !generatingEquidistant && !peace::on && can_start_horo(c) &&
|
if(c->land == laOcean && deepOcean && !generatingEquidistant && !peace::on && can_start_horo(c) &&
|
||||||
(quickfind(laWhirlpool) || (
|
(quickfind(laWhirlpool) || (
|
||||||
hrand(2000) < (PURE ? 500 : 1000))))
|
hrand(2000) < (PURE ? 500 : 1000))))
|
||||||
createAlternateMap(c, horo_gen_distance(), hsA);
|
create_altmap(c, horo_gen_distance(), hsA);
|
||||||
|
|
||||||
#if CAP_COMPLEX2
|
#if CAP_COMPLEX2
|
||||||
if(c->land == laOcean && deepOcean && !generatingEquidistant && hrand(10000) < 20 && no_barriers_in_radius(c, 2) && hyperbolic && !quotient && !tactic::on && !safety)
|
if(c->land == laOcean && deepOcean && !generatingEquidistant && hrand(10000) < 20 && no_barriers_in_radius(c, 2) && hyperbolic && !quotient && !tactic::on && !safety)
|
||||||
@ -1701,18 +1701,18 @@ EX void build_horocycles(cell *c, cell *from) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(c->land == laCaribbean && can_start_horo(c))
|
if(c->land == laCaribbean && can_start_horo(c))
|
||||||
createAlternateMap(c, horo_gen_distance(), hsA);
|
create_altmap(c, horo_gen_distance(), hsA);
|
||||||
|
|
||||||
if(c->land == laCanvas && can_start_horo(c) && ls::any_order())
|
if(c->land == laCanvas && can_start_horo(c) && ls::any_order())
|
||||||
createAlternateMap(c, horo_gen_distance(), hsA);
|
create_altmap(c, horo_gen_distance(), hsA);
|
||||||
|
|
||||||
if(c->land == laPalace && can_start_horo(c) && !princess::generating && !shmup::on && multi::players == 1 && !weirdhyperbolic &&
|
if(c->land == laPalace && can_start_horo(c) && !princess::generating && !shmup::on && multi::players == 1 && !weirdhyperbolic &&
|
||||||
(princess::forceMouse ? canReachPlayer(from, moMouse) :
|
(princess::forceMouse ? canReachPlayer(from, moMouse) :
|
||||||
(hrand(2000) < (peace::on ? 100 : 20))) &&
|
(hrand(2000) < (peace::on ? 100 : 20))) &&
|
||||||
(princess::challenge || kills[moVizier] || peace::on)) {
|
(princess::challenge || kills[moVizier] || peace::on)) {
|
||||||
createAlternateMap(c, PRADIUS0, hsOrigin, waPalace);
|
create_altmap(c, PRADIUS0, hsOrigin, waPalace);
|
||||||
celllister cl(c, 5, 1000000, NULL);
|
celllister cl(c, 5, 1000000, NULL);
|
||||||
for(cell *c: cl.lst) if(c->master->alt) currentmap->generateAlts(c->master);
|
for(cell *c: cl.lst) if(c->master->alt) currentmap->extend_altmap(c->master);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1786,7 +1786,7 @@ EX void buildCamelot(cell *c) {
|
|||||||
if(d == 10) {
|
if(d == 10) {
|
||||||
if(weirdhyperbolic ? hrand(100) < 50 : pseudohept(c)) buildCamelotWall(c);
|
if(weirdhyperbolic ? hrand(100) < 50 : pseudohept(c)) buildCamelotWall(c);
|
||||||
else {
|
else {
|
||||||
if(!eubinary) for(int i=0; i<S7; i++) currentmap->generateAlts(c->master->move(i));
|
if(!eubinary) for(int i=0; i<S7; i++) currentmap->extend_altmap(c->master->move(i));
|
||||||
int q = 0;
|
int q = 0;
|
||||||
if(weirdhyperbolic) {
|
if(weirdhyperbolic) {
|
||||||
for(int t=0; t<c->type; t++) createMov(c, t);
|
for(int t=0; t<c->type; t++) createMov(c, t);
|
||||||
@ -1827,7 +1827,7 @@ EX void buildCamelot(cell *c) {
|
|||||||
// roughly as many knights as table cells
|
// roughly as many knights as table cells
|
||||||
if(hrand(1000000) < 1000000 / expansion.get_growth() && !reptilecheat)
|
if(hrand(1000000) < 1000000 / expansion.get_growth() && !reptilecheat)
|
||||||
c->monst = moKnight;
|
c->monst = moKnight;
|
||||||
if(!eubinary) for(int i=0; i<S7; i++) currentmap->generateAlts(c->master->move(i));
|
if(!eubinary) for(int i=0; i<S7; i++) currentmap->extend_altmap(c->master->move(i));
|
||||||
for(int i=0; i<c->type; i++)
|
for(int i=0; i<c->type; i++)
|
||||||
if(c->move(i) && celldistAltRelative(c->move(i)) < d)
|
if(c->move(i) && celldistAltRelative(c->move(i)) < d)
|
||||||
c->mondir = (i+3) % 6;
|
c->mondir = (i+3) % 6;
|
||||||
|
2
cell.cpp
2
cell.cpp
@ -21,7 +21,7 @@ struct hrmap {
|
|||||||
virtual void verify() { }
|
virtual void verify() { }
|
||||||
virtual void on_dim_change() { }
|
virtual void on_dim_change() { }
|
||||||
virtual bool link_alt(heptagon *h, heptagon *alt, hstate firststate, int dir);
|
virtual bool link_alt(heptagon *h, heptagon *alt, hstate firststate, int dir);
|
||||||
virtual void generateAlts(heptagon *h, int levs = default_levs(), bool link_cdata = true);
|
virtual void extend_altmap(heptagon *h, int levs = default_levs(), bool link_cdata = true);
|
||||||
heptagon *may_create_step(heptagon *h, int direction) {
|
heptagon *may_create_step(heptagon *h, int direction) {
|
||||||
if(h->move(direction)) return h->move(direction);
|
if(h->move(direction)) return h->move(direction);
|
||||||
return create_step(h, direction);
|
return create_step(h, direction);
|
||||||
|
@ -689,7 +689,7 @@ void compute_horocycle(heptagon *alt) {
|
|||||||
set<heptagon*> region;
|
set<heptagon*> region;
|
||||||
for(int i=0; i<LOOKUP-1; i++) {
|
for(int i=0; i<LOOKUP-1; i++) {
|
||||||
for(auto h: hs[i]) {
|
for(auto h: hs[i]) {
|
||||||
currentmap->generateAlts(h);
|
currentmap->extend_altmap(h);
|
||||||
for(int j=0; j<S7; j++) {
|
for(int j=0; j<S7; j++) {
|
||||||
if(h->move(j)->alt->alt != master->alt->alt) continue;
|
if(h->move(j)->alt->alt != master->alt->alt) continue;
|
||||||
region.insert(h->move(j));
|
region.insert(h->move(j));
|
||||||
@ -760,7 +760,7 @@ EX int celldist(cell *c, bool alts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(doalts == 0) {
|
if(doalts == 0) {
|
||||||
currentmap->generateAlts(master);
|
currentmap->extend_altmap(master);
|
||||||
for(int i=0; i<S7; i++) if(master->move(i)->alt == master->alt->move[0] && periodmap[master->move(i)].celldists[true].empty())
|
for(int i=0; i<S7; i++) if(master->move(i)->alt == master->alt->move[0] && periodmap[master->move(i)].celldists[true].empty())
|
||||||
compute_horocycle(master);
|
compute_horocycle(master);
|
||||||
}
|
}
|
||||||
|
@ -1718,7 +1718,7 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
|
|||||||
if(fargen) {
|
if(fargen) {
|
||||||
if(!eubinary) {
|
if(!eubinary) {
|
||||||
if(c->master->alt && masterAlt(c) <= 2) {
|
if(c->master->alt && masterAlt(c) <= 2) {
|
||||||
if(!eubinary) currentmap->generateAlts(c->master);
|
if(!eubinary) currentmap->extend_altmap(c->master);
|
||||||
preventbarriers(c);
|
preventbarriers(c);
|
||||||
int d = celldistAlt(c);
|
int d = celldistAlt(c);
|
||||||
if(d <= 0)
|
if(d <= 0)
|
||||||
|
@ -378,7 +378,7 @@ struct hrmap_quotient : hrmap_standard {
|
|||||||
for(int i=0; i<TOT; i++) {
|
for(int i=0; i<TOT; i++) {
|
||||||
if(i >= isize(by_dist)) { printf("too fast\n"); exit(1); }
|
if(i >= isize(by_dist)) { printf("too fast\n"); exit(1); }
|
||||||
for(int a=0; a<S7; a++) if(by_dist[i]->move(a)->alt == NULL) by_dist.push_back(by_dist[i]->move(a));
|
for(int a=0; a<S7; a++) if(by_dist[i]->move(a)->alt == NULL) by_dist.push_back(by_dist[i]->move(a));
|
||||||
currentmap->generateAlts(by_dist[i], 0, false);
|
currentmap->extend_altmap(by_dist[i], 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i=0; i<TOT; i++) {
|
for(int i=0; i<TOT; i++) {
|
||||||
|
2
reg3.cpp
2
reg3.cpp
@ -1524,7 +1524,7 @@ EX namespace reg3 {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void generateAlts(heptagon* h, int levs, bool link_cdata) override {
|
void extend_altmap(heptagon* h, int levs, bool link_cdata) override {
|
||||||
if(reducers.count(h)) {
|
if(reducers.count(h)) {
|
||||||
heptspin hs(h, reducers[h]);
|
heptspin hs(h, reducers[h]);
|
||||||
reducers.erase(h);
|
reducers.erase(h);
|
||||||
|
@ -227,7 +227,7 @@ EX void initgame() {
|
|||||||
if(specialland == laCamelot)
|
if(specialland == laCamelot)
|
||||||
start_camelot(cwt.at);
|
start_camelot(cwt.at);
|
||||||
else {
|
else {
|
||||||
heptagon *h = createAlternateMap(cwt.at, 2, hsA);
|
heptagon *h = create_altmap(cwt.at, 2, hsA);
|
||||||
if(!h) printf("FAIL\n");
|
if(!h) printf("FAIL\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user