mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	improvements in ls::single
This commit is contained in:
		
							
								
								
									
										49
									
								
								bigstuff.cpp
									
									
									
									
									
								
							
							
						
						
									
										49
									
								
								bigstuff.cpp
									
									
									
									
									
								
							| @@ -42,7 +42,7 @@ EX int getAnthraxData(cell *c, bool b) { | |||||||
| EX int roundTableRadius(cell *c) { | EX int roundTableRadius(cell *c) { | ||||||
|   if(eubinary) return 28; |   if(eubinary) return 28; | ||||||
|   #if CAP_COMPLEX2 |   #if CAP_COMPLEX2 | ||||||
|   if(tactic::on) return getAnthraxData(c, true); |   if(ls::single()) return getAnthraxData(c, true); | ||||||
|   #endif |   #endif | ||||||
|   if(!c->master->alt) return 28; |   if(!c->master->alt) return 28; | ||||||
|   return c->master->alt->alt->emeraldval & GRAIL_RADIUS_MASK; |   return c->master->alt->alt->emeraldval & GRAIL_RADIUS_MASK; | ||||||
| @@ -60,7 +60,7 @@ EX int celldistAltRelative(cell *c) { | |||||||
|     return celldist(c) - 3; |     return celldist(c) - 3; | ||||||
|     } |     } | ||||||
|   #if CAP_COMPLEX2 |   #if CAP_COMPLEX2 | ||||||
|   if(tactic::on) return getAnthraxData(c, false); |   if(ls::single()) return getAnthraxData(c, false); | ||||||
|   #endif |   #endif | ||||||
|   return celldistAlt(c) - roundTableRadius(c); |   return celldistAlt(c) - roundTableRadius(c); | ||||||
|   } |   } | ||||||
| @@ -847,7 +847,7 @@ EX int edgeDepth(cell *c) { | |||||||
|   } |   } | ||||||
|  |  | ||||||
| EX int getHauntedDepth(cell *c) { | EX int getHauntedDepth(cell *c) { | ||||||
|   if((tactic::on || euclid) && c->land == laHaunted) return celldist(c); |   if((ls::single() || euclid) && c->land == laHaunted) return celldist(c); | ||||||
|   if(c->land == laHaunted) return c->landparam; |   if(c->land == laHaunted) return c->landparam; | ||||||
|   if(c->land == laHauntedWall) return 0; |   if(c->land == laHauntedWall) return 0; | ||||||
|   if(c->land == laHauntedBorder || c->land == laGraveyard) return -c->landparam; |   if(c->land == laHauntedBorder || c->land == laGraveyard) return -c->landparam; | ||||||
| @@ -1546,6 +1546,15 @@ EX void build_walls(cell *c, cell *from) { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | EX void start_camelot(cell *c) { | ||||||
|  |   int rtr = newRoundTableRadius(); | ||||||
|  |   heptagon *alt = createAlternateMap(c, rtr+(hyperbolic && WDIM == 3 ? 11 : 14), hsOrigin); | ||||||
|  |   if(alt) { | ||||||
|  |     alt->emeraldval = rtr; | ||||||
|  |     alt->fiftyval = c->land; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |  | ||||||
| EX void build_horocycles(cell *c, cell *from) { | EX void build_horocycles(cell *c, cell *from) { | ||||||
|  |  | ||||||
|   bool deepOcean = deep_ocean_at(c, from); |   bool deepOcean = deep_ocean_at(c, from); | ||||||
| @@ -1562,14 +1571,8 @@ EX void build_horocycles(cell *c, cell *from) { | |||||||
|       !(hyperbolic && WDIM == 3 && !reg3::in_rule()) &&  |       !(hyperbolic && WDIM == 3 && !reg3::in_rule()) &&  | ||||||
|       #endif |       #endif | ||||||
|       (quickfind(laCamelot) || peace::on || (hrand(I2000) < (c->land == laCrossroads4 ? 800 : 200) && horo_ok() &&  |       (quickfind(laCamelot) || peace::on || (hrand(I2000) < (c->land == laCrossroads4 ? 800 : 200) && horo_ok() &&  | ||||||
|       items[itEmerald] >= U5 && !tactic::on && !racing::on))) { |       items[itEmerald] >= U5 && !tactic::on && !racing::on)))  | ||||||
|       int rtr = newRoundTableRadius(); |       start_camelot(c); | ||||||
|       heptagon *alt = createAlternateMap(c, rtr+(hyperbolic && WDIM == 3 ? 11 : 14), hsOrigin); |  | ||||||
|       if(alt) { |  | ||||||
|         alt->emeraldval = rtr; |  | ||||||
|         alt->fiftyval = c->land; |  | ||||||
|         } |  | ||||||
|       } |  | ||||||
|  |  | ||||||
|     if(c->land == laRlyeh && ctof(c) && horo_ok() &&  |     if(c->land == laRlyeh && ctof(c) && horo_ok() &&  | ||||||
|       (quickfind(laTemple) || peace::on || (hrand(I2000) < 100 &&  |       (quickfind(laTemple) || peace::on || (hrand(I2000) < 100 &&  | ||||||
| @@ -1687,7 +1690,7 @@ EX eMonster camelot_monster() { | |||||||
|  |  | ||||||
| EX void buildCamelot(cell *c) { | EX void buildCamelot(cell *c) { | ||||||
|   int d = celldistAltRelative(c); |   int d = celldistAltRelative(c); | ||||||
|   if(tactic::on || (d <= 14 && roundTableRadius(c) > 20)) { |   if(ls::single() || (d <= 14 && roundTableRadius(c) > 20)) { | ||||||
|     if(!eubinary) currentmap->generateAlts(c->master); |     if(!eubinary) currentmap->generateAlts(c->master); | ||||||
|     preventbarriers(c); |     preventbarriers(c); | ||||||
|     if(d == 10) { |     if(d == 10) { | ||||||
| @@ -1727,7 +1730,7 @@ EX void buildCamelot(cell *c) { | |||||||
|         } |         } | ||||||
|       } |       } | ||||||
|     if(d == 0) c->wall = waRoundTable; |     if(d == 0) c->wall = waRoundTable; | ||||||
|     if(celldistAlt(c) == 0 && !tactic::on) c->item = itHolyGrail; |     if(celldistAlt(c) == 0 && !ls::single()) c->item = itHolyGrail; | ||||||
|     if(d < 0 && hrand(7000) <= 10 + items[itHolyGrail] * 5) |     if(d < 0 && hrand(7000) <= 10 + items[itHolyGrail] * 5) | ||||||
|       c->monst = camelot_monster(); |       c->monst = camelot_monster(); | ||||||
|     if(d == 1) { |     if(d == 1) { | ||||||
| @@ -1739,12 +1742,12 @@ EX void buildCamelot(cell *c) { | |||||||
|         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; | ||||||
|       } |       } | ||||||
|     if(tactic::on && d >= 2 && d <= 8 && hrand(1000) < 10) |     if(ls::single() && d >= 2 && d <= 8 && hrand(1000) < 10) | ||||||
|       c->item = itOrbSafety; |       c->item = itOrbSafety; | ||||||
|     if(d == 5 && tactic::on) |     if(d == 5 && ls::single()) | ||||||
|       c->item = itGreenStone; |       c->item = itGreenStone; | ||||||
|     if(d <= 10) c->land = laCamelot; |     if(d <= 10) c->land = laCamelot; | ||||||
|     if(d > 10 && !eubinary && !tactic::on) { |     if(d > 10 && !eubinary && !ls::single()) { | ||||||
|       setland(c, eLand(c->master->alt->alt->fiftyval)); |       setland(c, eLand(c->master->alt->alt->fiftyval)); | ||||||
|       if(c->land == laNone) printf("Camelot\n"); // NONEDEBUG |       if(c->land == laNone) printf("Camelot\n"); // NONEDEBUG | ||||||
|       } |       } | ||||||
| @@ -1814,7 +1817,7 @@ EX void moreBigStuff(cell *c) { | |||||||
|     } |     } | ||||||
|    |    | ||||||
|   else if((c->land == laRlyeh && !euclid) || c->land == laTemple) if(!(bt::in() && specialland != laTemple && c->land == laRlyeh)) { |   else if((c->land == laRlyeh && !euclid) || c->land == laTemple) if(!(bt::in() && specialland != laTemple && c->land == laRlyeh)) { | ||||||
|     if(eubinary || in_s2xe() || (c->master->alt && (tactic::on || masterAlt(c) <= horo_gen_distance()))) { |     if(eubinary || in_s2xe() || (c->master->alt && (ls::single() || masterAlt(c) <= horo_gen_distance()))) { | ||||||
|       if(!eubinary && !ls::any_chaos()) currentmap->generateAlts(c->master); |       if(!eubinary && !ls::any_chaos()) currentmap->generateAlts(c->master); | ||||||
|       preventbarriers(c); |       preventbarriers(c); | ||||||
|       int d = celldistAlt(c); |       int d = celldistAlt(c); | ||||||
| @@ -1885,24 +1888,24 @@ EX void moreBigStuff(cell *c) { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|   if((c->land == laOvergrown && !euclid) || c->land == laClearing) if(!(bt::in() && specialland != laClearing)) { |   if((c->land == laOvergrown && !euclid) || c->land == laClearing) if(!(bt::in() && specialland != laClearing)) { | ||||||
|     if(eubinary || (c->master->alt && (tactic::on || masterAlt(c) <= horo_gen_distance()))) { |     if(eubinary || (c->master->alt && (ls::single() || masterAlt(c) <= horo_gen_distance()))) { | ||||||
|       if(!eubinary) currentmap->generateAlts(c->master); |       if(!eubinary) currentmap->generateAlts(c->master); | ||||||
|       preventbarriers(c); |       preventbarriers(c); | ||||||
|       int d = celldistAlt(c); |       int d = celldistAlt(c); | ||||||
|       if(d <= 0) { |       if(d <= 0) { | ||||||
|         c->land = laClearing, c->wall = waNone; // , c->monst = moNone, c->item = itNone; |         c->land = laClearing, c->wall = waNone; // , c->monst = moNone, c->item = itNone; | ||||||
|         } |         } | ||||||
|       else if(d == 1 && !tactic::on && !eubinary) |       else if(d == 1 && !ls::single() && !eubinary) | ||||||
|         c->wall = waSmallTree, c->monst = moNone, c->item = itNone, c->landparam = 1; |         c->wall = waSmallTree, c->monst = moNone, c->item = itNone, c->landparam = 1; | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   if((c->land == laJungle && !euclid) || c->land == laMountain) if(!(bt::in() && specialland != laMountain)) { |   if((c->land == laJungle && !euclid) || c->land == laMountain) if(!(bt::in() && specialland != laMountain)) { | ||||||
|     if(eubinary || (c->master->alt && (tactic::on || masterAlt(c) <= horo_gen_distance()))) { |     if(eubinary || (c->master->alt && (ls::single() || masterAlt(c) <= horo_gen_distance()))) { | ||||||
|       if(!eubinary) currentmap->generateAlts(c->master); |       if(!eubinary) currentmap->generateAlts(c->master); | ||||||
|       preventbarriers(c); |       preventbarriers(c); | ||||||
|       int d = celldistAlt(c); |       int d = celldistAlt(c); | ||||||
|       if(d <= 0 || (firstland == laMountain && tactic::on)) { |       if(d <= 0 || (specialland == laMountain && ls::single())) { | ||||||
|         c->land = laMountain, c->wall = waNone; // , c->monst = moNone, c->item = itNone; |         c->land = laMountain, c->wall = waNone; // , c->monst = moNone, c->item = itNone; | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
| @@ -1910,9 +1913,7 @@ EX void moreBigStuff(cell *c) { | |||||||
|  |  | ||||||
|   if(among(c->land, laOcean, laWhirlpool, laBrownian)) if(!(bt::in() && specialland != laWhirlpool)) { |   if(among(c->land, laOcean, laWhirlpool, laBrownian)) if(!(bt::in() && specialland != laWhirlpool)) { | ||||||
|     bool fullwhirlpool = false; |     bool fullwhirlpool = false; | ||||||
|     if(tactic::on && specialland == laWhirlpool) |     if(ls::single() && specialland == laWhirlpool) | ||||||
|       fullwhirlpool = true; |  | ||||||
|     if(yendor::on && yendor::clev().l == laWhirlpool) |  | ||||||
|       fullwhirlpool = true; |       fullwhirlpool = true; | ||||||
|     if(eubinary || (c->master->alt && (fullwhirlpool || masterAlt(c) <= 2))) { |     if(eubinary || (c->master->alt && (fullwhirlpool || masterAlt(c) <= 2))) { | ||||||
|       if(!eubinary) currentmap->generateAlts(c->master); |       if(!eubinary) currentmap->generateAlts(c->master); | ||||||
|   | |||||||
| @@ -410,7 +410,7 @@ EX ld orbprizefun(int tr) { | |||||||
|   } |   } | ||||||
|  |  | ||||||
| EX ld orbcrossfun(int tr) { | EX ld orbcrossfun(int tr) { | ||||||
|   if(tactic::on) return 1; |   if(tactic::on || (ls::single() && isCrossroads(specialland))) return 1; | ||||||
|   if(tr < 10) return 0; |   if(tr < 10) return 0; | ||||||
|   if(tr > 25) return 1; |   if(tr > 25) return 1; | ||||||
|   return (tr*2 + 50) / 100.; |   return (tr*2 + 50) / 100.; | ||||||
| @@ -571,7 +571,7 @@ EX void placeCrossroadOrbs(cell *c) { | |||||||
|       else continue; |       else continue; | ||||||
|       } |       } | ||||||
|      |      | ||||||
|     if(tactic::on && isCrossroads(specialland)) { |     if(ls::single() && isCrossroads(specialland)) { | ||||||
|       if(oi.flags & orbgenflags::NO_TACTIC) |       if(oi.flags & orbgenflags::NO_TACTIC) | ||||||
|         continue; |         continue; | ||||||
|       else mintreas = 0; |       else mintreas = 0; | ||||||
|   | |||||||
| @@ -212,7 +212,7 @@ EX void initgame() { | |||||||
|   pregen();   |   pregen();   | ||||||
|   setdist(cwt.at, BARLEV, NULL); |   setdist(cwt.at, BARLEV, NULL); | ||||||
|  |  | ||||||
|   if((tactic::on || yendor::on || peace::on) && isCyclic(firstland)) { |   if(isCyclic(specialland)) { | ||||||
|     #if CAP_COMPLEX2 |     #if CAP_COMPLEX2 | ||||||
|     camelot::anthraxBonus = items[itHolyGrail]; |     camelot::anthraxBonus = items[itHolyGrail]; | ||||||
|     #endif |     #endif | ||||||
| @@ -221,10 +221,14 @@ EX void initgame() { | |||||||
|      |      | ||||||
|     setdist(cwt.at->move(0), BARLEV-1, cwt.at); |     setdist(cwt.at->move(0), BARLEV-1, cwt.at); | ||||||
|     if(!sphere && !eubinary && !quotient) { |     if(!sphere && !eubinary && !quotient) { | ||||||
|  |       if(specialland == laCamelot)  | ||||||
|  |         start_camelot(cwt.at); | ||||||
|  |       else { | ||||||
|         heptagon *h = createAlternateMap(cwt.at, 2, hsA); |         heptagon *h = createAlternateMap(cwt.at, 2, hsA); | ||||||
|         if(!h) printf("FAIL\n"); |         if(!h) printf("FAIL\n"); | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|  |     } | ||||||
|    |    | ||||||
|   if(tactic::on && firstland == laPower) { |   if(tactic::on && firstland == laPower) { | ||||||
|     items[itOrbSpeed] = 30; |     items[itOrbSpeed] = 30; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue