mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-19 02:21:24 +01:00
feat: zones - proselytism - check population
This commit is contained in:
parent
f618892068
commit
8fc50d7925
1 changed files with 6 additions and 2 deletions
|
|
@ -139,7 +139,11 @@ window.Zones = (function () {
|
||||||
if (!religion) return;
|
if (!religion) return;
|
||||||
|
|
||||||
const targetBorderCells = cells.i.filter(
|
const targetBorderCells = cells.i.filter(
|
||||||
i => cells.religion[i] !== religion.i && cells.c[i].some(c => cells.religion[c] === religion.i)
|
i =>
|
||||||
|
cells.h[i] < 20 &&
|
||||||
|
cells.pop[i] &&
|
||||||
|
cells.religion[i] !== religion.i &&
|
||||||
|
cells.c[i].some(c => cells.religion[c] === religion.i)
|
||||||
);
|
);
|
||||||
const startCell = ra(targetBorderCells);
|
const startCell = ra(targetBorderCells);
|
||||||
if (!startCell) return;
|
if (!startCell) return;
|
||||||
|
|
@ -157,7 +161,7 @@ window.Zones = (function () {
|
||||||
cells.c[cellId].forEach(neibCellId => {
|
cells.c[cellId].forEach(neibCellId => {
|
||||||
if (usedCells[neibCellId]) return;
|
if (usedCells[neibCellId]) return;
|
||||||
if (cells.religion[neibCellId] !== targetReligionId) return;
|
if (cells.religion[neibCellId] !== targetReligionId) return;
|
||||||
if (cells.h[neibCellId] < 20) return;
|
if (cells.h[neibCellId] < 20 || !cells.pop[i]) return;
|
||||||
usedCells[neibCellId] = 1;
|
usedCells[neibCellId] = 1;
|
||||||
queue.push(neibCellId);
|
queue.push(neibCellId);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue