rebalance mountains
This commit is contained in:
parent
780458f88f
commit
1ea595fbda
3 changed files with 23 additions and 6 deletions
|
@ -5,4 +5,4 @@ export const BEACH = 1;
|
|||
export const LIGHT_FOREST = 2;
|
||||
export const DENSE_FOREST = 3;
|
||||
export const MOUNTAIN = 4;
|
||||
export const ICECAP = 9;
|
||||
export const ICECAP = 6;
|
||||
|
|
|
@ -8,6 +8,25 @@ export type LobeGeneratorConstructor = (
|
|||
basePos: number
|
||||
) => LobeGenerator;
|
||||
|
||||
/** form mountain */
|
||||
export const SMALL_MOUNTAIN: LobeGeneratorConstructor =
|
||||
(islands: IslandGrid, basePos: number) => () => {
|
||||
const islandTiles = islands.floodSearch(basePos, (tile) => tile > WATER);
|
||||
|
||||
const edgeTiles = islandTiles.filter(
|
||||
(pos) => islands.data[pos] == WATER || islands.data[pos] == BEACH
|
||||
);
|
||||
islands.dropWithin(edgeTiles);
|
||||
|
||||
const mountainTiles = islands.floodSearch(
|
||||
basePos,
|
||||
(tile) => tile > MOUNTAIN
|
||||
);
|
||||
islands.dropWithin(mountainTiles);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
/** form mountain with icecap */
|
||||
export const BIG_MOUNTAIN: LobeGeneratorConstructor =
|
||||
(islands: IslandGrid, basePos: number) => () => {
|
||||
|
@ -150,7 +169,7 @@ export const NO_ISLAND: LobeGeneratorConstructor =
|
|||
};
|
||||
|
||||
export const BIG_ISLANDS = [BIG_MOUNTAIN, BIG_BEACH, HILLY_FOREST];
|
||||
export const ROCKY_ISLANDS = [BIG_MOUNTAIN, HILLY_FOREST];
|
||||
export const ROCKY_ISLANDS = [SMALL_MOUNTAIN, BIG_MOUNTAIN, HILLY_FOREST];
|
||||
export const GREEN_ISLANDS = [
|
||||
SCATTERED_FOREST,
|
||||
CONTIGUOUS_FOREST,
|
||||
|
@ -158,6 +177,7 @@ export const GREEN_ISLANDS = [
|
|||
];
|
||||
export const SMALL_ISLANDS = [SMALL_BEACH, SCATTERED_FOREST, ERODED_BEACH];
|
||||
export const ALL_ISLANDS = [
|
||||
SMALL_MOUNTAIN,
|
||||
BIG_MOUNTAIN,
|
||||
SMALL_BEACH,
|
||||
BIG_BEACH,
|
||||
|
|
|
@ -22,10 +22,7 @@ export function renderIslands(
|
|||
cx.fillStyle = "#008800";
|
||||
break;
|
||||
case MOUNTAIN:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case MOUNTAIN + 1:
|
||||
cx.fillStyle = "#666666";
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Add table
Reference in a new issue