mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-04-05 02:07:03 +00:00
new linepattern Tri Walls
This commit is contained in:
parent
66671145a9
commit
b8059c0528
@ -439,16 +439,27 @@ EX bool mod_allowed() {
|
||||
return cheater || autocheat || arcm::in() || arb::in() || tour::on;
|
||||
}
|
||||
|
||||
EX bool distances_legal(cell *c) {
|
||||
if(mod_allowed()) return true;
|
||||
switch(distance_from) {
|
||||
case dfPlayer:
|
||||
return true;
|
||||
case dfStart:
|
||||
return bt::in();
|
||||
case dfWorld:
|
||||
return c && among(c->land, laOcean, laIvoryTower, laEndorian, laDungeon, laTemple, laWhirlpool, laCanvas);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
EX int curr_dist(cell *c) {
|
||||
if(!distances_legal(c)) return 0;
|
||||
switch(distance_from) {
|
||||
case dfPlayer:
|
||||
return c->cpdist < INFD ? c->cpdist : celldistance(cwt.at, c);
|
||||
case dfStart:
|
||||
if(!mod_allowed()) return 0;
|
||||
return celldist(c);
|
||||
case dfWorld:
|
||||
if(!mod_allowed() && !among(c->land, laOcean, laIvoryTower, laEndorian, laDungeon, laTemple, laWhirlpool, laCanvas))
|
||||
return 0;
|
||||
if((isCyclic(c->land) || among(c->land, laCanvas, laCaribbean, laStorms, laRlyeh))) {
|
||||
if(eubinary || c->master->alt) return celldistAlt(c);
|
||||
return UNKNOWN;
|
||||
@ -1060,7 +1071,7 @@ EX int hyperbolic_celldistance(cell *c1, cell *c2) {
|
||||
else {
|
||||
if(cl1 == cr2 || cr1 == cl2) found_distance = d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(d >= found_distance) {
|
||||
if(sl_used == sibling_limit && IRREGULAR) {
|
||||
|
30
pattern2.cpp
30
pattern2.cpp
@ -2890,7 +2890,12 @@ EX namespace linepatterns {
|
||||
}
|
||||
)
|
||||
);
|
||||
EX linepattern patTriRings = linepattern("lines of equal distance", 0xFFFFFF00, trees_known,
|
||||
|
||||
bool trees_legal() {
|
||||
return (bt::in() || trees_known()) && distances_legal(nullptr);
|
||||
}
|
||||
|
||||
EX linepattern patTriRings = linepattern("lines of equal distance", 0xFFFFFF00, trees_legal,
|
||||
ALLCELLS(
|
||||
if(valence() == 3) {
|
||||
forCellIdEx(c2, i, c) {
|
||||
@ -2907,7 +2912,7 @@ EX namespace linepatterns {
|
||||
}
|
||||
)
|
||||
);
|
||||
EX linepattern patTriTree = linepattern("tessellation tree", 0xFFFFFF00, trees_known,
|
||||
EX linepattern patTriTree = linepattern("tessellation tree", 0xFFFFFF00, trees_legal,
|
||||
ALLCELLS(
|
||||
cell *parent = ts::right_parent(c, curr_dist);
|
||||
if(gmatrix.count(parent)) {
|
||||
@ -2918,6 +2923,23 @@ EX namespace linepatterns {
|
||||
)
|
||||
);
|
||||
|
||||
EX linepattern patTriWalls = linepattern("tessellation walls", 0xFF000000, trees_legal,
|
||||
ALLCELLS(
|
||||
if(gmatrix.count(c)) {
|
||||
celldrawer cd;
|
||||
cd.c = c;
|
||||
cd.V = V;
|
||||
for(int t=0; t<c->type; t++) {
|
||||
cell *c1 = c->move(t);
|
||||
if(!c1) continue;
|
||||
if(c1 == ts::right_parent(c, curr_dist)) continue;
|
||||
if(c == ts::right_parent(c1, curr_dist)) continue;
|
||||
cd.draw_grid_edge(t, col, 2 + vid.linequality);
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
linepattern patCircles("circles", 0xFFFFFF00, always_available,
|
||||
ATCENTER(
|
||||
for(int i=15; i<=180; i+=15) {
|
||||
@ -2991,7 +3013,7 @@ EX namespace linepatterns {
|
||||
);
|
||||
|
||||
#if HDR
|
||||
extern linepattern patTriTree, patTriRings, patDual;
|
||||
extern linepattern patTriTree, patTriRings, patTriWalls, patDual;
|
||||
#endif
|
||||
|
||||
EX vector<linepattern*> patterns = {
|
||||
@ -2999,7 +3021,7 @@ EX namespace linepatterns {
|
||||
|
||||
&patTree, &patAltTree, &patZebraTriangles, &patZebraLines,
|
||||
&patVine, &patPalacelike, &patPalace, &patPower, &patHorocycles,
|
||||
&patTriRings, &patTriTree,
|
||||
&patTriRings, &patTriTree, &patTriWalls,
|
||||
&patGoldbergTree, &patIrregularMaster, &patGoldbergSep, &patHeawood, &patArcm,
|
||||
&patCircles, &patRadii, &patMeridians, &patParallels, &patSublines, &patUltra
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user