mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-04-07 07:57:24 +02:00
Merge branch 'master' into refactor/migrate-military-generator
This commit is contained in:
commit
3f282c74d0
15 changed files with 2885 additions and 1470 deletions
|
|
@ -482,6 +482,12 @@ class MilitaryModule {
|
|||
|
||||
return regiments as MilitaryRegiment[];
|
||||
};
|
||||
|
||||
// remove all existing regiment notes before regenerating
|
||||
for (let i = notes.length - 1; i >= 0; i--) {
|
||||
if (notes[i].id.startsWith("regiment")) notes.splice(i, 1);
|
||||
}
|
||||
|
||||
// get regiments for each state
|
||||
valid.forEach((s) => {
|
||||
s.military = createRegiments(s.temp.platoons, s);
|
||||
|
|
@ -594,7 +600,14 @@ class MilitaryModule {
|
|||
: gauss(options.year - 100, 150, 1, options.year - 6);
|
||||
const conflict = campaign ? ` during the ${campaign.name}` : "";
|
||||
const legend = `Regiment was formed in ${year} ${options.era}${conflict}. ${station}${troops}`;
|
||||
notes.push({ id: `regiment${s.i}-${r.i}`, name: r.name, legend });
|
||||
const id = `regiment${s.i}-${r.i}`;
|
||||
const existing = notes.find(n => n.id === id);
|
||||
if (existing) {
|
||||
existing.name = r.name;
|
||||
existing.legend = legend;
|
||||
} else {
|
||||
notes.push({id, name: r.name, legend});
|
||||
}
|
||||
}
|
||||
|
||||
// get default regiment emblem
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue