mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-19 10:31:24 +01:00
refactor: specify burgs
This commit is contained in:
parent
aa6cefb683
commit
7f57c9af65
14 changed files with 151 additions and 45 deletions
|
|
@ -21,11 +21,12 @@ export function createStates(capitals: TCapitals, cultures: TCultures) {
|
|||
const id = index + 1;
|
||||
const name = getStateName(cellId, capitalName, cultureId, cultures);
|
||||
const color = colors[index];
|
||||
const type = (cultures[cultureId] as ICulture).type;
|
||||
|
||||
const {type, shield: cultureShield} = cultures[cultureId] as ICulture;
|
||||
const expansionism = rn(Math.random() * powerInput + 1, 1);
|
||||
|
||||
const shield = COA.getShield(cultureId, null, cultures);
|
||||
const coa = {...COA.generate(null, null, null, type), shield};
|
||||
const shield = COA.getShield(cultureShield, null);
|
||||
const coa: ICoa = {...COA.generate(null, null, null, type), shield};
|
||||
|
||||
return {i: id, center: cellId, type, name, color, expansionism, capital: capitalId, culture: cultureId, coa};
|
||||
});
|
||||
|
|
@ -34,7 +35,7 @@ export function createStates(capitals: TCapitals, cultures: TCultures) {
|
|||
return [NEUTRALS, ...states];
|
||||
}
|
||||
|
||||
function getStateName(cellId: number, capitalName: string, cultureId: number, cultures: TCultures) {
|
||||
function getStateName(cellId: number, capitalName: string, cultureId: number, cultures: TCultures): string {
|
||||
const useCapitalName = capitalName.length < 9 && each(5)(cellId);
|
||||
const nameBase = cultures[cultureId].base;
|
||||
const basename: string = useCapitalName ? capitalName : Names.getBaseShort(nameBase);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue