Skip to content
Snippets Groups Projects
Commit 14ced087 authored by lowercasedonkey's avatar lowercasedonkey
Browse files

simplify school check

parent e40f25c6
No related branches found
No related tags found
1 merge request!8134simplify school check
......@@ -186,72 +186,28 @@ App.Markets.bulkSlaveIntro = function() {
/* Discount calculation. Gives 5% on top of slave school discount */
let discount = 475;
let opinion;
switch (V.market.slaveMarket) {
case "TSS":
if (V.TSS.schoolUpgrade !== 0) {
discount = 375;
}
break;
case "TUO":
if (V.TUO.schoolUpgrade !== 0) {
discount = 375;
}
break;
case "GRI":
if (V.GRI.schoolUpgrade !== 0) {
discount = 375;
}
break;
case "SCP":
if (V.SCP.schoolUpgrade !== 0) {
discount = 375;
}
break;
case "LDE":
if (V.LDE.schoolUpgrade !== 0) {
discount = 375;
}
break;
case "TGA":
if (V.TGA.schoolUpgrade !== 0) {
discount = 375;
}
break;
case "HA":
if (V.HA.schoolUpgrade !== 0) {
discount = 375;
}
break;
case "NUL":
if (V.NUL.schoolUpgrade !== 0) {
discount = 375;
}
break;
case "TCR":
if (V.TCR.schoolUpgrade !== 0) {
discount = 375;
}
break;
case "TFS":
if (V.TFS.schoolUpgrade !== 0) {
discount = 300;
} else {
discount = 380;
}
break;
case "corporate":
if (V.corp.Market === 1) {
discount = 350;
}
break;
case "neighbor":
if (V.market.numArcology >= V.arcologies.length) {
V.market.numArcology = 1;
}
opinion = App.Neighbor.opinion(0, V.market.numArcology);
opinion = Math.clamp(Math.trunc(opinion/20), -10, 10);
discount -= (opinion * 25);
break;
if (V.market.slaveMarket === "TFS") {
if (V.TFS.schoolUpgrade !== 0) {
discount = 300;
} else {
discount = 380;
}
} else if (V.market.slaveMarket === "corporate") {
if (V.corp.Market === 1) {
discount = 350;
}
} else if (V.market.slaveMarket === "neighbor") {
if (V.market.numArcology >= V.arcologies.length) {
V.market.numArcology = 1;
}
opinion = App.Neighbor.opinion(0, V.market.numArcology);
opinion = Math.clamp(Math.trunc(opinion/20), -10, 10);
discount -= (opinion * 25);
} else if (App.Data.misc.schools.includes(V.market.slaveMarket)) {
if (V[V.market.slaveMarket].schoolUpgrade !== 0) {
discount = 375;
}
}
return discount;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment