Skip to content
Snippets Groups Projects
Commit cb7b0cb4 authored by Pregmodder's avatar Pregmodder
Browse files

Merge branch 'fix-bulkSlave-cost-not-displayed' into 'pregmod-master'

fix bulkSlave cost not displayed

Closes #2914 and #2831

See merge request !8876
parents 852ffcdf 98d02883
No related branches found
No related tags found
1 merge request!8876fix bulkSlave cost not displayed
...@@ -4,7 +4,6 @@ App.Markets.bulkSlaveIntro = function() { ...@@ -4,7 +4,6 @@ App.Markets.bulkSlaveIntro = function() {
const discount = getDiscount(); const discount = getDiscount();
let seed; let seed;
let p; let p;
let spent;
if (V.market.newSlaves.length === 0) { if (V.market.newSlaves.length === 0) {
bulkSlaveGenerate(); bulkSlaveGenerate();
...@@ -46,7 +45,7 @@ App.Markets.bulkSlaveIntro = function() { ...@@ -46,7 +45,7 @@ App.Markets.bulkSlaveIntro = function() {
} else { } else {
r.push(`With all your discounts factored in you got a <span class="yellowgreen">${(500 - discount) / 5}%</span> discount;`); r.push(`With all your discounts factored in you got a <span class="yellowgreen">${(500 - discount) / 5}%</span> discount;`);
} }
r.push(`You spent <span class="yellowgreen">${cashFormat(spent)}</span> on your new slaves.`); r.push(`You spent`, App.UI.DOM.cashFormat(V.market.totalCost), `on your new slaves.`);
break; break;
case "inStock": case "inStock":
r.push(`You clear out ${App.Markets.marketName(V.market.slaveMarket, V.market.numArcology)} of its stock of ${V.market.newSlaves.length} slaves.`); r.push(`You clear out ${App.Markets.marketName(V.market.slaveMarket, V.market.numArcology)} of its stock of ${V.market.newSlaves.length} slaves.`);
...@@ -57,7 +56,7 @@ App.Markets.bulkSlaveIntro = function() { ...@@ -57,7 +56,7 @@ App.Markets.bulkSlaveIntro = function() {
} else { } else {
r.push(`With all your discounts factored in you got a <span class="yellowgreen">${(500 - discount) / 5}%</span> discount`); r.push(`With all your discounts factored in you got a <span class="yellowgreen">${(500 - discount) / 5}%</span> discount`);
} }
r.push(`You spent <span class="yellowgreen">${cashFormat(spent)}</span> on your new slaves.`); r.push(`You spent`, App.UI.DOM.cashFormat(V.market.totalCost), `on your new slaves.`);
break; break;
case "liquidator": case "liquidator":
r.push(`Your new pair of slaves look frightened and uncertain, but seem encouraged by each other's presence.`); r.push(`Your new pair of slaves look frightened and uncertain, but seem encouraged by each other's presence.`);
...@@ -160,7 +159,7 @@ App.Markets.bulkSlaveIntro = function() { ...@@ -160,7 +159,7 @@ App.Markets.bulkSlaveIntro = function() {
} else { } else {
cashX(forceNeg(_slaveCost), "slaveTransfer", slave); cashX(forceNeg(_slaveCost), "slaveTransfer", slave);
V.market.newSlaves.push(slave); V.market.newSlaves.push(slave);
spent += _slaveCost; V.market.totalCost += _slaveCost;
} }
} }
......
...@@ -81,6 +81,7 @@ App.Markets.purchaseFramework = function(slaveMarket, {sTitleSingular = "slave", ...@@ -81,6 +81,7 @@ App.Markets.purchaseFramework = function(slaveMarket, {sTitleSingular = "slave",
title.buyAndKeepShopping, title.buyAndKeepShopping,
() => { () => {
cashX(forceNeg(cost), "slaveTransfer", slave); cashX(forceNeg(cost), "slaveTransfer", slave);
V.market.totalCost += cost;
V.market.newSlaves.push(slave); V.market.newSlaves.push(slave);
V.market.introType = "multi"; V.market.introType = "multi";
student(); student();
...@@ -99,6 +100,7 @@ App.Markets.purchaseFramework = function(slaveMarket, {sTitleSingular = "slave", ...@@ -99,6 +100,7 @@ App.Markets.purchaseFramework = function(slaveMarket, {sTitleSingular = "slave",
title.buyJustHer, title.buyJustHer,
() => { () => {
cashX(forceNeg(cost), "slaveTransfer", slave); cashX(forceNeg(cost), "slaveTransfer", slave);
V.market.totalCost += cost;
V.market.newSlaves.push(slave); V.market.newSlaves.push(slave);
V.nextButton = "Continue"; V.nextButton = "Continue";
V.returnTo = "Main"; V.returnTo = "Main";
...@@ -116,6 +118,7 @@ App.Markets.purchaseFramework = function(slaveMarket, {sTitleSingular = "slave", ...@@ -116,6 +118,7 @@ App.Markets.purchaseFramework = function(slaveMarket, {sTitleSingular = "slave",
() => { () => {
student(); student();
cashX(forceNeg(cost), "slaveTransfer", slave); cashX(forceNeg(cost), "slaveTransfer", slave);
V.market.totalCost += cost;
V.market.newSlaves.push(slave); V.market.newSlaves.push(slave);
}, },
[], [],
...@@ -157,6 +160,7 @@ App.Markets.purchaseFramework = function(slaveMarket, {sTitleSingular = "slave", ...@@ -157,6 +160,7 @@ App.Markets.purchaseFramework = function(slaveMarket, {sTitleSingular = "slave",
* @property {number} newSlavesDone * @property {number} newSlavesDone
* @property {number} numSlaves * @property {number} numSlaves
* @property {number} numArcology * @property {number} numArcology
* @property {number} totalCost
*/ */
/** @this {marketGlobal} */ /** @this {marketGlobal} */
...@@ -169,6 +173,7 @@ App.Markets.GlobalVariable = function() { ...@@ -169,6 +173,7 @@ App.Markets.GlobalVariable = function() {
this.newSlavesDone = 0; this.newSlavesDone = 0;
this.numSlaves = 0; this.numSlaves = 0;
this.numArcology = 0; this.numArcology = 0;
this.totalCost = 0;
return this; return this;
}; };
......
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