1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-11 14:56:00 +00:00

mirrors now flip Alchemist Lab colors (may be a bit unpredictable in minimal quotient)

This commit is contained in:
Zeno Rogue
2022-04-26 14:42:07 +02:00
parent 49d7ab3ed3
commit 7adb3dac5a
5 changed files with 39 additions and 15 deletions

View File

@@ -1331,7 +1331,7 @@ EX int neighborId(cell *ofWhat, cell *whichOne) {
EX int mine_adjacency_rule = 0;
EX map<cell*, vector<cell*>> adj_memo;
EX map<cell*, vector<pair<cell*, bool>>> adj_memo;
EX bool geometry_has_alt_mine_rule() {
if(S3 >= OINF) return false;
@@ -1340,17 +1340,17 @@ EX bool geometry_has_alt_mine_rule() {
return true;
}
EX vector<cell*> adj_minefield_cells(cell *c) {
vector<cell*> res;
EX vector<pair<cell*, bool>> adj_minefield_cells_with_orientation(cell *c) {
vector<pair<cell*, bool>> res;
if(mine_adjacency_rule == 0 || !geometry_has_alt_mine_rule())
forCellCM(c2, c) res.push_back(c2);
forCellIdCM(c2, i, c) res.emplace_back(c2, c->c.mirror(i));
else if(WDIM == 2) {
cellwalker cw(c, 0);
cw += wstep;
cw++;
cellwalker cw1 = cw;
do {
res.push_back(cw.at);
res.emplace_back(cw.at, cw.mirrored);
cw += wstep;
cw++;
if(cw.cpeek() == c) cw++;
@@ -1373,7 +1373,7 @@ EX vector<cell*> adj_minefield_cells(cell *c) {
auto& vertices1 = ss1.vertices_only_local;
for(hyperpoint h: vertices) for(hyperpoint h2: vertices1)
if(hdist(h, T * h2) < 1e-6) shares = true;
if(shares) res.push_back(c1);
if(shares) res.emplace_back(c1, det(T) < 0);
}
if(shares || c == c1) forCellIdEx(c2, i, c1) {
if(cl.listed(c2)) continue;
@@ -1387,6 +1387,13 @@ EX vector<cell*> adj_minefield_cells(cell *c) {
return res;
}
EX vector<cell*> adj_minefield_cells(cell *c) {
vector<cell*> res;
auto ori = adj_minefield_cells_with_orientation(c);
for(auto p: ori) res.push_back(p.first);
return res;
}
EX vector<int> reverse_directions(cell *c, int dir) {
if(PURE && !(kite::in() && WDIM == 2)) return reverse_directions(c->master, dir);
int d = c->degree();