mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
refactor: start files migration nightmare
This commit is contained in:
parent
c4736cc640
commit
bc65e0e207
64 changed files with 1990 additions and 816 deletions
|
|
@ -1,4 +1,4 @@
|
|||
"use strict";
|
||||
import {TIME} from "/src/config/logging";
|
||||
|
||||
window.Markers = (function () {
|
||||
let config = [];
|
||||
|
|
@ -20,6 +20,7 @@ window.Markers = (function () {
|
|||
list: function to select candidates
|
||||
add: function to add marker legend
|
||||
*/
|
||||
// prettier-ignore
|
||||
return [
|
||||
{type: "volcanoes", icon: "🌋", dx: 52, px: 13, min: 10, each: 500, multiplier: 1, list: listVolcanoes, add: addVolcano},
|
||||
{type: "hot-springs", icon: "♨️", dy: 52, min: 30, each: 1200, multiplier: 1, list: listHotSprings, add: addHotSpring},
|
||||
|
|
@ -199,7 +200,13 @@ window.Markers = (function () {
|
|||
function listBridges({cells, burgs}) {
|
||||
const meanFlux = d3.mean(cells.fl.filter(fl => fl));
|
||||
return cells.i.filter(
|
||||
i => !occupied[i] && cells.burg[i] && cells.t[i] !== 1 && burgs[cells.burg[i]].population > 20 && cells.r[i] && cells.fl[i] > meanFlux
|
||||
i =>
|
||||
!occupied[i] &&
|
||||
cells.burg[i] &&
|
||||
cells.t[i] !== 1 &&
|
||||
burgs[cells.burg[i]].population > 20 &&
|
||||
cells.r[i] &&
|
||||
cells.fl[i] > meanFlux
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -441,7 +448,21 @@ window.Markers = (function () {
|
|||
"rat tails",
|
||||
"pig ears"
|
||||
];
|
||||
const types = ["hot", "cold", "fire", "ice", "smoky", "misty", "shiny", "sweet", "bitter", "salty", "sour", "sparkling", "smelly"];
|
||||
const types = [
|
||||
"hot",
|
||||
"cold",
|
||||
"fire",
|
||||
"ice",
|
||||
"smoky",
|
||||
"misty",
|
||||
"shiny",
|
||||
"sweet",
|
||||
"bitter",
|
||||
"salty",
|
||||
"sour",
|
||||
"sparkling",
|
||||
"smelly"
|
||||
];
|
||||
const drinks = [
|
||||
"wine",
|
||||
"brandy",
|
||||
|
|
@ -469,7 +490,11 @@ window.Markers = (function () {
|
|||
const typeName = P(0.3) ? "inn" : "tavern";
|
||||
const isAnimalThemed = P(0.7);
|
||||
const animal = ra(animals);
|
||||
const name = isAnimalThemed ? (P(0.6) ? ra(colors) + " " + animal : ra(adjectives) + " " + animal) : ra(adjectives) + " " + capitalize(typeName);
|
||||
const name = isAnimalThemed
|
||||
? P(0.6)
|
||||
? ra(colors) + " " + animal
|
||||
: ra(adjectives) + " " + animal
|
||||
: ra(adjectives) + " " + capitalize(typeName);
|
||||
const meal = isAnimalThemed && P(0.3) ? animal : ra(courses);
|
||||
const course = `${ra(methods)} ${meal}`.toLowerCase();
|
||||
const drink = `${P(0.5) ? ra(types) : ra(colors)} ${ra(drinks)}`.toLowerCase();
|
||||
|
|
@ -478,18 +503,26 @@ window.Markers = (function () {
|
|||
}
|
||||
|
||||
function listLighthouses({cells}) {
|
||||
return cells.i.filter(i => !occupied[i] && cells.harbor[i] > 6 && cells.c[i].some(c => cells.h[c] < 20 && cells.road[c]));
|
||||
return cells.i.filter(
|
||||
i => !occupied[i] && cells.harbor[i] > 6 && cells.c[i].some(c => cells.h[c] < 20 && cells.road[c])
|
||||
);
|
||||
}
|
||||
|
||||
function addLighthouse(id, cell) {
|
||||
const {cells} = pack;
|
||||
|
||||
const proper = cells.burg[cell] ? pack.burgs[cells.burg[cell]].name : Names.getCulture(cells.culture[cell]);
|
||||
notes.push({id, name: getAdjective(proper) + " Lighthouse" + name, legend: `A lighthouse to serve as a beacon for ships in the open sea`});
|
||||
notes.push({
|
||||
id,
|
||||
name: getAdjective(proper) + " Lighthouse" + name,
|
||||
legend: `A lighthouse to serve as a beacon for ships in the open sea`
|
||||
});
|
||||
}
|
||||
|
||||
function listWaterfalls({cells}) {
|
||||
return cells.i.filter(i => cells.r[i] && !occupied[i] && cells.h[i] >= 50 && cells.c[i].some(c => cells.h[c] < 40 && cells.r[c]));
|
||||
return cells.i.filter(
|
||||
i => cells.r[i] && !occupied[i] && cells.h[i] >= 50 && cells.c[i].some(c => cells.h[c] < 40 && cells.r[c])
|
||||
);
|
||||
}
|
||||
|
||||
function addWaterfall(id, cell) {
|
||||
|
|
@ -509,7 +542,9 @@ window.Markers = (function () {
|
|||
}
|
||||
|
||||
function listBattlefields({cells}) {
|
||||
return cells.i.filter(i => !occupied[i] && cells.state[i] && cells.pop[i] > 2 && cells.h[i] < 50 && cells.h[i] > 25);
|
||||
return cells.i.filter(
|
||||
i => !occupied[i] && cells.state[i] && cells.pop[i] > 2 && cells.h[i] < 50 && cells.h[i] > 25
|
||||
);
|
||||
}
|
||||
|
||||
function addBattlefield(id, cell) {
|
||||
|
|
@ -555,7 +590,9 @@ window.Markers = (function () {
|
|||
}
|
||||
|
||||
function listSeaMonsters({cells, features}) {
|
||||
return cells.i.filter(i => !occupied[i] && cells.h[i] < 20 && cells.road[i] && features[cells.f[i]].type === "ocean");
|
||||
return cells.i.filter(
|
||||
i => !occupied[i] && cells.h[i] < 20 && cells.road[i] && features[cells.f[i]].type === "ocean"
|
||||
);
|
||||
}
|
||||
|
||||
function addSeaMonster(id, cell) {
|
||||
|
|
@ -589,7 +626,17 @@ window.Markers = (function () {
|
|||
"horrifying",
|
||||
"feared"
|
||||
];
|
||||
const subjects = ["Locals", "Elders", "Inscriptions", "Tipplers", "Legends", "Whispers", "Rumors", "Journeying folk", "Tales"];
|
||||
const subjects = [
|
||||
"Locals",
|
||||
"Elders",
|
||||
"Inscriptions",
|
||||
"Tipplers",
|
||||
"Legends",
|
||||
"Whispers",
|
||||
"Rumors",
|
||||
"Journeying folk",
|
||||
"Tales"
|
||||
];
|
||||
const species = [
|
||||
"Ogre",
|
||||
"Troll",
|
||||
|
|
@ -625,13 +672,21 @@ window.Markers = (function () {
|
|||
const monster = ra(species);
|
||||
const toponym = Names.getCulture(cells.culture[cell]);
|
||||
const name = `${toponym} ${monster}`;
|
||||
const legend = `${ra(subjects)} speak of a ${ra(adjectives)} ${monster} who inhabits ${toponym} hills and ${ra(modusOperandi)}`;
|
||||
const legend = `${ra(subjects)} speak of a ${ra(adjectives)} ${monster} who inhabits ${toponym} hills and ${ra(
|
||||
modusOperandi
|
||||
)}`;
|
||||
notes.push({id, name, legend});
|
||||
}
|
||||
|
||||
// Sacred mountains spawn on lonely mountains
|
||||
function listSacredMountains({cells}) {
|
||||
return cells.i.filter(i => !occupied[i] && cells.h[i] >= 70 && cells.c[i].some(c => cells.culture[c]) && cells.c[i].every(c => cells.h[c] < 60));
|
||||
return cells.i.filter(
|
||||
i =>
|
||||
!occupied[i] &&
|
||||
cells.h[i] >= 70 &&
|
||||
cells.c[i].some(c => cells.culture[c]) &&
|
||||
cells.c[i].every(c => cells.h[c] < 60)
|
||||
);
|
||||
}
|
||||
|
||||
function addSacredMountain(id, cell) {
|
||||
|
|
@ -674,7 +729,9 @@ window.Markers = (function () {
|
|||
|
||||
// Sacred palm groves spawn on oasises
|
||||
function listSacredPalmGroves({cells}) {
|
||||
return cells.i.filter(i => !occupied[i] && cells.culture[i] && cells.biome[i] === 1 && cells.pop[i] > 1 && cells.road[i]);
|
||||
return cells.i.filter(
|
||||
i => !occupied[i] && cells.culture[i] && cells.biome[i] === 1 && cells.pop[i] > 1 && cells.road[i]
|
||||
);
|
||||
}
|
||||
|
||||
function addSacredPalmGrove(id, cell) {
|
||||
|
|
@ -765,7 +822,20 @@ window.Markers = (function () {
|
|||
function addStatue(id, cell) {
|
||||
const {cells} = pack;
|
||||
|
||||
const variants = ["Statue", "Obelisk", "Monument", "Column", "Monolith", "Pillar", "Megalith", "Stele", "Runestone", "Sculpture", "Effigy", "Idol"];
|
||||
const variants = [
|
||||
"Statue",
|
||||
"Obelisk",
|
||||
"Monument",
|
||||
"Column",
|
||||
"Monolith",
|
||||
"Pillar",
|
||||
"Megalith",
|
||||
"Stele",
|
||||
"Runestone",
|
||||
"Sculpture",
|
||||
"Effigy",
|
||||
"Idol"
|
||||
];
|
||||
const scripts = {
|
||||
cypriot: "𐠁𐠂𐠃𐠄𐠅𐠈𐠊𐠋𐠌𐠍𐠎𐠏𐠐𐠑𐠒𐠓𐠔𐠕𐠖𐠗𐠘𐠙𐠚𐠛𐠜𐠝𐠞𐠟𐠠𐠡𐠢𐠣𐠤𐠥𐠦𐠧𐠨𐠩𐠪𐠫𐠬𐠭𐠮𐠯𐠰𐠱𐠲𐠳𐠴𐠵𐠷𐠸𐠼𐠿 ",
|
||||
geez: "ሀለሐመሠረሰቀበተኀነአከወዐዘየደገጠጰጸፀፈፐ ",
|
||||
|
|
@ -820,7 +890,16 @@ window.Markers = (function () {
|
|||
}
|
||||
|
||||
function addCircuses(id, cell) {
|
||||
const adjectives = ["Fantastical", "Wonderous", "Incomprehensible", "Magical", "Extraordinary", "Unmissable", "World-famous", "Breathtaking"];
|
||||
const adjectives = [
|
||||
"Fantastical",
|
||||
"Wonderous",
|
||||
"Incomprehensible",
|
||||
"Magical",
|
||||
"Extraordinary",
|
||||
"Unmissable",
|
||||
"World-famous",
|
||||
"Breathtaking"
|
||||
];
|
||||
|
||||
const adjective = ra(adjectives);
|
||||
const name = `Travelling ${adjective} Circus`;
|
||||
|
|
@ -932,8 +1011,26 @@ window.Markers = (function () {
|
|||
function addDances(id, cell) {
|
||||
const {cells, burgs} = pack;
|
||||
const burgName = burgs[cells.burg[cell]].name;
|
||||
const socialTypes = ["gala", "dance", "performance", "ball", "soiree", "jamboree", "exhibition", "carnival", "festival", "jubilee"];
|
||||
const people = ["great and the good", "nobility", "local elders", "foreign dignitaries", "spiritual leaders", "suspected revolutionaries"];
|
||||
const socialTypes = [
|
||||
"gala",
|
||||
"dance",
|
||||
"performance",
|
||||
"ball",
|
||||
"soiree",
|
||||
"jamboree",
|
||||
"exhibition",
|
||||
"carnival",
|
||||
"festival",
|
||||
"jubilee"
|
||||
];
|
||||
const people = [
|
||||
"great and the good",
|
||||
"nobility",
|
||||
"local elders",
|
||||
"foreign dignitaries",
|
||||
"spiritual leaders",
|
||||
"suspected revolutionaries"
|
||||
];
|
||||
const socialType = ra(socialTypes);
|
||||
|
||||
const name = `${burgName} ${socialType}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue