mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 20:11:24 +01:00
Merge branch 'v1.96' into scale-bar-styling
This commit is contained in:
commit
ebb97f78d0
6 changed files with 23 additions and 15 deletions
|
|
@ -1182,7 +1182,7 @@ async function editStates() {
|
|||
|
||||
async function editCultures() {
|
||||
if (customization) return;
|
||||
const Editor = await import("../dynamic/editors/cultures-editor.js?v=1.91.00");
|
||||
const Editor = await import("../dynamic/editors/cultures-editor.js?v=1.95.04");
|
||||
Editor.open();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -244,11 +244,13 @@ function editNamesbase() {
|
|||
|
||||
Names.clearChains();
|
||||
if (override) nameBases = [];
|
||||
const unsafe = new RegExp(/[|/]/, "g");
|
||||
|
||||
data.forEach(base => {
|
||||
const [name, min, max, d, m, names] = base.split("|");
|
||||
const secureNames = names.replace(/[/|]/g, "");
|
||||
nameBases.push({name, min, max, d, m, b: secureNames});
|
||||
const [rawName, min, max, d, m, rawNames] = base.split("|");
|
||||
const name = rawName.replace(unsafe, "");
|
||||
const names = rawNames.replace(unsafe, "");
|
||||
nameBases.push({name, min, max, d, m, b: names});
|
||||
});
|
||||
|
||||
createBasesList();
|
||||
|
|
|
|||
|
|
@ -361,10 +361,10 @@ function regenerateBurgs() {
|
|||
|
||||
const score = new Int16Array(cells.s.map(s => s * Math.random())); // cell score for capitals placement
|
||||
const sorted = cells.i.filter(i => score[i] > 0 && cells.culture[i]).sort((a, b) => score[b] - score[a]); // filtered and sorted array of indexes
|
||||
const existingStatesCount = states.filter(s => s.i && !s.removed).length;
|
||||
const burgsCount =
|
||||
manorsInput.value === "1000"
|
||||
? rn(sorted.length / 5 / (grid.points.length / 10000) ** 0.8) + states.length
|
||||
: +manorsInput.value + states.length;
|
||||
(manorsInput.value === "1000" ? rn(sorted.length / 5 / (grid.points.length / 10000) ** 0.8) : +manorsInput.value) +
|
||||
existingStatesCount;
|
||||
const spacing = (graphWidth + graphHeight) / 150 / (burgsCount ** 0.7 / 66); // base min distance between towns
|
||||
|
||||
for (let i = 0; i < sorted.length && burgs.length < burgsCount; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue