v1.5.49 - select emblem shape on culture level

This commit is contained in:
Azgaar 2021-02-21 15:55:52 +03:00
parent 7b1e463c92
commit bfc881bda9
6 changed files with 84 additions and 40 deletions

View file

@ -56,7 +56,6 @@
c.code = getCode(c.name);
cells.culture[cell] = i+1;
if (emblemShape === "random") c.shield = getRandomShield();
else if (emblemShape !== "culture" && emblemShape !== "state") c.shield = emblemShape;
});
function placeCenter(v) {
@ -147,10 +146,9 @@
const color = d3.color(d3.scaleSequential(d3.interpolateRainbow)(Math.random())).hex();
// define emblem shape
const emblemShape = document.getElementById("emblemShape").value;
let shield = culture.shield;
const emblemShape = document.getElementById("emblemShape").value;
if (emblemShape === "random") shield = getRandomShield();
else if (emblemShape !== "culture" && emblemShape !== "state") shield = emblemShape;
pack.cultures.push({name, color, base, center, i, expansionism:1, type:"Generic", cells:0, area:0, rural:0, urban:0, origin:0, code, shield});
}
@ -420,19 +418,8 @@
}
const getRandomShield = function() {
const shields = {
types: {basic: 10, regional: 2, historical: 1, specific: 1, banner: 1, simple: 2, fantasy: 1, middleEarth: 0},
basic: {heater: 12, spanish: 6, french: 1},
regional: {horsehead: 1, horsehead2: 1, polish: 1, hessen: 1, swiss: 1},
historical: {boeotian: 1, roman: 2, kite: 1, oldFrench: 5, renaissance: 2, baroque: 2},
specific: {targe: 1, targe2: 0, pavise: 5, wedged: 10},
banner: {flag: 1, pennon: 0, guidon: 0, banner: 0, dovetail: 1, gonfalon: 5, pennant: 0},
simple: {round: 12, oval: 6, vesicaPiscis: 1, square: 1, diamond: 2, no: 0},
fantasy: {fantasy1: 2, fantasy2: 2, fantasy3: 1, fantasy4: 1, fantasy5: 3},
middleEarth: {noldor: 1, gondor: 1, easterling: 1, erebor: 1, ironHills: 1, urukHai: 1, moriaOrc: 1}
}
const type = rw(shields.types);
return rw(shields[type]);
const type = rw(COA.shields.types);
return rw(COA.shields[type]);
}
return {generate, add, expand, getDefault, getRandomShield};