From b7dc1609d8070bce2d5477e86a26e27a622478d1 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Sat, 29 Aug 2020 19:03:44 -0400 Subject: [PATCH] fixes --- src/markets/specialSlave.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/markets/specialSlave.js b/src/markets/specialSlave.js index 4583ed5e86f..1db6c8bf33c 100644 --- a/src/markets/specialSlave.js +++ b/src/markets/specialSlave.js @@ -77,7 +77,12 @@ App.Markets.specialSlave = function() { if (V.cheatMode) { let oneSlaveCost = (s) => { let cost = slaveCost(s); return cost + (10 * Math.trunc((cost / 10) * 2)); }; - let allHeroSlaves = App.Utils.buildHeroArray().map((s) => { return {slave: App.Utils.getHeroSlave(s), cost: oneSlaveCost(s)}; }); + let allHeroSlaves = App.Utils.buildHeroArray().map( + (hs) => { + const slave = App.Utils.getHeroSlave(hs); + return {slave: slave, cost: oneSlaveCost(slave), ID: hs.ID}; + } + ); let totalCost = allHeroSlaves.reduce((acc, s) => acc += s.cost, 0); if (V.cash > totalCost) { @@ -85,12 +90,12 @@ App.Markets.specialSlave = function() { "div", el, App.UI.DOM.link( - `Buy all of them for ${App.UI.DOM.cashFormat(totalCost)}`, + `Buy all of them for ${cashFormat(totalCost)}`, () => { for (const hero of allHeroSlaves) { cashX(forceNeg(hero.cost), "slaveTransfer", hero.slave); newSlave(hero.slave); - V.heroSlavesPurchased.push(hero.slave.ID); + V.heroSlavesPurchased.push(hero.ID); } refresh(); } @@ -101,7 +106,7 @@ App.Markets.specialSlave = function() { "div", el, App.UI.DOM.disabledLink( - `Buy all of them for ${App.UI.DOM.cashFormat(totalCost)}`, + `Buy all of them for ${cashFormat(totalCost)}`, [`Cannot afford`] ) ); -- GitLab