From c0599a5c2f52b3d4b593821373a3d98bed089e10 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Fri, 9 Oct 2020 19:59:31 -0400 Subject: [PATCH] simplify muscles by reversing list --- .../specificMarkets/customSlaveMarket.js | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/markets/specificMarkets/customSlaveMarket.js b/src/markets/specificMarkets/customSlaveMarket.js index 7ecc19c512f..31dc104cb35 100644 --- a/src/markets/specificMarkets/customSlaveMarket.js +++ b/src/markets/specificMarkets/customSlaveMarket.js @@ -99,30 +99,25 @@ App.Markets["Custom Slave"] = function() { const el = document.createElement("div"); const slaveProperty = "muscles"; const choices = new Map([ - ["-97", "Frail"], - ["-51", "Very weak"], - ["-21", "Weak"], - ["0", "Normal"], - ["20", "Toned"], - ["45", "Well built"], + ["96", "Ripped"], ["65", "Muscular"], - ["96", "Ripped"] + ["45", "Well built"], + ["20", "Toned"], + ["0", "Normal"], + ["-21", "Weak"], + ["-51", "Very weak"], + ["-97", "Frail"], ]); createDescription(el, description, slaveProperty); el.append(choicesMaker(slaveProperty, choices, description)); function description() { - // Obnoxiously, the old check is reversed, so I'm working around it by reporting the previous value to the one that hits. - let savedText = "frail"; for (const [value, text] of choices) { - if (slave.muscles < Number(value)) { - return `${savedText}.`; - } else { - savedText = text; + if (slave.muscles >= Number(value)) { + return `${text}.`; } } - return "Ripped."; } return el; -- GitLab