| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- /* indicator table */
- var tableIndicators = [["Criminalité",0],["Religion",0],["Economie",0],["Noblesse",0],["Peuple",0]];
- var currentTurn = 0;
- /* */
- function genAllIndicators() {
- let element = document.querySelector("#indicator");
- element.innerHTML = genTurn() + "<div>" + genListeIndicators() + "</div>";
- }
- /* tour de jeu actuel */
- function genTurn() {
- return '<div><p>Tour : </p><p>' + currentTurn + "</p></div>";
- }
- /* indicator */
- function genListeIndicators() {
- let res = "";
- for (var i = 0; i < tableIndicators.length; i++) {
- res = res + genIndicator(i);
- }
- return res;
- }
- function genIndicator(i) {
- return '<div><p>' + tableIndicators[i][0] + ' : </p><p>' + tableIndicators[i][1] + "</p></div>";
- }
- function updateIndicatorsAddLaws(law) {
- tableIndicators[0][1] = tableIndicators[0][1] + law.effets.cri;
- tableIndicators[1][1] = tableIndicators[1][1] + law.effets.rel;
- tableIndicators[2][1] = tableIndicators[2][1] + law.effets.eco;
- tableIndicators[3][1] = tableIndicators[3][1] + law.effets.nob;
- tableIndicators[4][1] = tableIndicators[4][1] + law.effets.peu;
- }
- function updateIndicatorsRemoveLaws(law) {
- tableIndicators[0][1] = tableIndicators[0][1] - law.effets.cri;
- tableIndicators[1][1] = tableIndicators[1][1] - law.effets.rel;
- tableIndicators[2][1] = tableIndicators[2][1] - law.effets.eco;
- tableIndicators[3][1] = tableIndicators[3][1] - law.effets.nob;
- tableIndicators[4][1] = tableIndicators[4][1] - law.effets.peu;
- }
- function updateIndicatorsUpgradeLaws(law) {
- tableIndicators[0][1] = tableIndicators[0][1] + law.effets.cri;
- tableIndicators[1][1] = tableIndicators[1][1] + law.effets.rel;
- tableIndicators[2][1] = tableIndicators[2][1] + law.effets.eco;
- tableIndicators[3][1] = tableIndicators[3][1] + law.effets.nob;
- tableIndicators[4][1] = tableIndicators[4][1] + law.effets.peu;
- }
|