This commit is contained in:
Azgaar 2019-09-10 09:43:31 +03:00
parent 5a1b747da8
commit 6bd0ce5533

View file

@ -99,15 +99,14 @@
if (religionsTree.find(x, y, s) !== undefined) continue; // to close to existing religion if (religionsTree.find(x, y, s) !== undefined) continue; // to close to existing religion
// add "Old" to name of the folk religion on this culture // add "Old" to name of the folk religion on this culture
const folk = religions.find(r => expansion === "culture" && r.culture === culture && r.type === "Folk"); const folk = religions.find(r => r.culture === culture && r.type === "Folk");
if (folk && folk.name.slice(0,3) !== "Old") folk.name = "Old " + folk.name; if (folk && expansion === "culture" && folk.name.slice(0,3) !== "Old") folk.name = "Old " + folk.name;
const origin = religions.find(r => r.culture === culture && r.type === "Folk").i || 0; const origin = folk ? folk.i : 0;
const expansionism = rand(3, 8); const expansionism = rand(3, 8);
const color = getMixedColor(religions[origin].color, .3, 0); // `url(#hatch${rand(0,5)})`; const color = getMixedColor(religions[origin].color, .3, 0); // `url(#hatch${rand(0,5)})`;
religions.push({i: religions.length, name, color, culture, type:"Organized", form, deity, expansion, expansionism, center, origin}); religions.push({i: religions.length, name, color, culture, type:"Organized", form, deity, expansion, expansionism, center, origin});
religionsTree.add([x, y]); religionsTree.add([x, y]);
//debug.append("circle").attr("cx", x).attr("cy", y).attr("r", 2).attr("fill", "blue");
} }
// generate cults // generate cults