mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	inforder:: wall generation
This commit is contained in:
		| @@ -822,6 +822,8 @@ EX bool buildBarrier3D(cell *c, eLand l2, int forced_dir) { | |||||||
|  |  | ||||||
| EX bool buildBarrierNowall(cell *c, eLand l2, int forced_dir IS(NODIR)) { | EX bool buildBarrierNowall(cell *c, eLand l2, int forced_dir IS(NODIR)) { | ||||||
|  |  | ||||||
|  |   if(S3 >= OINF) { c->land = l2; return true; } | ||||||
|  |  | ||||||
|   if(geometry == gBinary4) return false; |   if(geometry == gBinary4) return false; | ||||||
|   #if MAXMDIM >= 4 |   #if MAXMDIM >= 4 | ||||||
|   // 3D binary tilings create walls using their own methods |   // 3D binary tilings create walls using their own methods | ||||||
|   | |||||||
							
								
								
									
										16
									
								
								bigstuff.cpp
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								bigstuff.cpp
									
									
									
									
									
								
							| @@ -179,6 +179,7 @@ void hrmap::generateAlts(heptagon *h, int levs, bool link_cdata) { | |||||||
|     ho->alt = hm; |     ho->alt = hm; | ||||||
|     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->generateAlts(ho, levs-1, link_cdata); | ||||||
|  |     if(S3 >= OINF) preventbarriers(ho->c7); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @@ -532,6 +533,11 @@ EX void buildEquidistant(cell *c) { | |||||||
|     if(cv < mcv) mcv = cv; |     if(cv < mcv) mcv = cv; | ||||||
|     } |     } | ||||||
|      |      | ||||||
|  |   if(S3 == OINF) { | ||||||
|  |     c->landparam = mcv + 1; | ||||||
|  |     return; | ||||||
|  |     } | ||||||
|  |    | ||||||
|   int mcv2 = 0; |   int mcv2 = 0; | ||||||
|    |    | ||||||
|   if(mcv == 0) { |   if(mcv == 0) { | ||||||
| @@ -1289,6 +1295,11 @@ EX int wallchance(cell *c, bool deepOcean) { | |||||||
|     princess::challenge ? 0 : |     princess::challenge ? 0 : | ||||||
|     isElemental(l) ? 4000 :  |     isElemental(l) ? 4000 :  | ||||||
|     (yendor::on && (yendor::generating || !(yendor::clev().flags & YF_WALLS))) ? 0 : |     (yendor::on && (yendor::generating || !(yendor::clev().flags & YF_WALLS))) ? 0 : | ||||||
|  |     (S3 >= OINF && l == laCrossroads) ? 2000 : | ||||||
|  |     (S3 >= OINF && l == laCrossroads2) ? 2500 : | ||||||
|  |     (S3 >= OINF && l == laCrossroads3) ? 3333 : | ||||||
|  |     (S3 >= OINF && l == laCrossroads4) ? 5000 : | ||||||
|  |     (S3 >= OINF && l == laCrossroads5) ? 10000 : | ||||||
|     l == laCrossroads3 ? 10000 :  |     l == laCrossroads3 ? 10000 :  | ||||||
|     l == laCrossroads ? 5000 :  |     l == laCrossroads ? 5000 :  | ||||||
|     l == laCrossroads2 ? 10000 :  |     l == laCrossroads2 ? 10000 :  | ||||||
| @@ -1416,6 +1427,9 @@ EX void buildBigStuff(cell *c, cell *from) { | |||||||
|   else if(weirdhyperbolic && specialland == laElementalWall && hrand(I10000) < 1000 && gp_wall_test())  |   else if(weirdhyperbolic && specialland == laElementalWall && hrand(I10000) < 1000 && gp_wall_test())  | ||||||
|     buildBarrierNowall(c, getNewLand(c->land)); |     buildBarrierNowall(c, getNewLand(c->land)); | ||||||
|  |  | ||||||
|  |   else if(S3 >= OINF && c->land && hrand(I10000) < wallchance(c, deepOcean) && c->bardir != NOBARRIERS) | ||||||
|  |     buildBarrierNowall(c, getNewLand(c->land)); | ||||||
|  |    | ||||||
|   else if(weirdhyperbolic) ; // non-Nowall barriers not implemented yet in weird hyperbolic |   else if(weirdhyperbolic) ; // non-Nowall barriers not implemented yet in weird hyperbolic | ||||||
|    |    | ||||||
|   else if(c->land == laCrossroads2 && BITRUNCATED) |   else if(c->land == laCrossroads2 && BITRUNCATED) | ||||||
| @@ -1542,6 +1556,7 @@ EX bool openplains(cell *c) { | |||||||
|   } |   } | ||||||
|  |  | ||||||
| EX void buildCamelotWall(cell *c) { | EX void buildCamelotWall(cell *c) { | ||||||
|  |   if(S3 >= OINF) { c->wall = waRubble; return; } | ||||||
|   c->wall = waCamelot; |   c->wall = waCamelot; | ||||||
|   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); | ||||||
| @@ -1715,6 +1730,7 @@ EX void moreBigStuff(cell *c) { | |||||||
|         else if(WDIM == 3) { |         else if(WDIM == 3) { | ||||||
|           if(c->master->zebraval != 1) c->wall = waColumn; |           if(c->master->zebraval != 1) c->wall = waColumn; | ||||||
|           } |           } | ||||||
|  |         else if(S3 >= OINF) { } | ||||||
|         else if(weirdhyperbolic && !BITRUNCATED) { |         else if(weirdhyperbolic && !BITRUNCATED) { | ||||||
|           if(hrand(100) < 50) c->wall = waColumn; |           if(hrand(100) < 50) c->wall = waColumn; | ||||||
|           } |           } | ||||||
|   | |||||||
							
								
								
									
										8
									
								
								cell.cpp
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								cell.cpp
									
									
									
									
									
								
							| @@ -18,7 +18,7 @@ struct hrmap { | |||||||
|   virtual vector<cell*>& allcells() { return dcal; } |   virtual vector<cell*>& allcells() { return dcal; } | ||||||
|   virtual void verify() { } |   virtual void verify() { } | ||||||
|   virtual void link_alt(const cellwalker& hs) { } |   virtual void link_alt(const cellwalker& hs) { } | ||||||
|   virtual void generateAlts(heptagon *h, int levs = IRREGULAR ? 1 : S3-3, bool link_cdata = true); |   virtual void generateAlts(heptagon *h, int levs = IRREGULAR ? 1 : S3 >= OINF ? 1 : S3-3, 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); | ||||||
| @@ -764,7 +764,11 @@ cdata *getHeptagonCdata(heptagon *h) { | |||||||
|    |    | ||||||
|   cdata mydata = *getHeptagonCdata(h->cmove(dir)); |   cdata mydata = *getHeptagonCdata(h->cmove(dir)); | ||||||
|  |  | ||||||
|   if(S3 == 4) { |   if(S3 >= OINF) { | ||||||
|  |     setHeptagonRval(h); | ||||||
|  |     affect(mydata, h->rval0, 1);  | ||||||
|  |     } | ||||||
|  |   else if(S3 == 4) { | ||||||
|     heptspin hs(h, 0); |     heptspin hs(h, 0); | ||||||
|     while(dmeq((hs+1).cpeek()->dm4, (hs.at->dm4 - 1))) hs = hs + 1 + wstep + 1; |     while(dmeq((hs+1).cpeek()->dm4, (hs.at->dm4 - 1))) hs = hs + 1 + wstep + 1; | ||||||
|     while(dmeq((hs-1).cpeek()->dm4, (hs.at->dm4 - 1))) hs = hs - 1 + wstep - 1; |     while(dmeq((hs-1).cpeek()->dm4, (hs.at->dm4 - 1))) hs = hs - 1 + wstep - 1; | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								hyper.h
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								hyper.h
									
									
									
									
									
								
							| @@ -408,7 +408,7 @@ typedef function<int(struct cell*)> cellfunction; | |||||||
| // passable flags | // passable flags | ||||||
|  |  | ||||||
| #define SAGEMELT .1 | #define SAGEMELT .1 | ||||||
| #define TEMPLE_EACH (among(geometry, gHoroRec, gHoroHex, gKiteDart3) ? 3 : sol ? 6 : (WDIM == 3 && binarytiling) ? 2 : geometry == gSpace435 ? 4 : (WDIM == 3 && hyperbolic) ? 3 : 6) | #define TEMPLE_EACH (among(geometry, gHoroRec, gHoroHex, gKiteDart3) ? 3 : sol ? 6 : (WDIM == 3 && binarytiling) ? 2 : geometry == gSpace435 ? 4 : (WDIM == 3 && hyperbolic) ? 3 : (S3 == OINF) ? 4 : 6) | ||||||
| #define PT(x, y) ((tactic::on || quotient == 2 || daily::on) ? (y) : inv::on ? min(2*(y),x) : (x)) | #define PT(x, y) ((tactic::on || quotient == 2 || daily::on) ? (y) : inv::on ? min(2*(y),x) : (x)) | ||||||
| #define ROCKSNAKELENGTH 50 | #define ROCKSNAKELENGTH 50 | ||||||
| #define WORMLENGTH 15 | #define WORMLENGTH 15 | ||||||
|   | |||||||
| @@ -1205,6 +1205,7 @@ EX bool geosupport_chessboard() { | |||||||
|     (archimedean && DUAL) ? arcm::current.support_threecolor_bitruncated() : |     (archimedean && DUAL) ? arcm::current.support_threecolor_bitruncated() : | ||||||
| #endif | #endif | ||||||
|     (binarytiling || penrose) ? 0 : |     (binarytiling || penrose) ? 0 : | ||||||
|  |     (S3 >= OINF) ? true : | ||||||
|     (VALENCE % 2 == 0); |     (VALENCE % 2 == 0); | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @@ -1220,6 +1221,7 @@ EX int geosupport_threecolor() { | |||||||
|     if(S7 % 2) return 1; |     if(S7 % 2) return 1; | ||||||
|     return 2; |     return 2; | ||||||
|     } |     } | ||||||
|  |   if(S3 >= OINF) return 0; | ||||||
|   if((S7 % 2 == 0) && (S3 == 3)) |   if((S7 % 2 == 0) && (S3 == 3)) | ||||||
|     return 2; |     return 2; | ||||||
|   if(a46 && PURE) |   if(a46 && PURE) | ||||||
| @@ -1311,6 +1313,7 @@ EX int pattern_threecolor(cell *c) { | |||||||
|     if(a4 && PURE) return eupattern4(c); |     if(a4 && PURE) return eupattern4(c); | ||||||
|     return eupattern(c) % 3; |     return eupattern(c) % 3; | ||||||
|     } |     } | ||||||
|  |   if(S3 >= OINF) return c->master->distance % 3; | ||||||
|   if(S7 == 4 && S3 == 3) { |   if(S7 == 4 && S3 == 3) { | ||||||
|     int codesN[6] = {0,1,2,1,2,0}; |     int codesN[6] = {0,1,2,1,2,0}; | ||||||
|     #if CAP_GP |     #if CAP_GP | ||||||
| @@ -1381,6 +1384,7 @@ EX bool pseudohept(cell *c) { | |||||||
|   if(penrose) return kite::getshape(c->master) == kite::pDart; |   if(penrose) return kite::getshape(c->master) == kite::pDart; | ||||||
|   if(binarytiling) return binary::pseudohept(c); |   if(binarytiling) return binary::pseudohept(c); | ||||||
|   #endif |   #endif | ||||||
|  |   if(S3 >= OINF) return c->master->distance % 3 == 1; | ||||||
|   #if MAXMDIM == 4 |   #if MAXMDIM == 4 | ||||||
|   if(WDIM == 3) { |   if(WDIM == 3) { | ||||||
|     if(geometry == gField435) return false; |     if(geometry == gField435) return false; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue