Skip to content
Snippets Groups Projects
Commit 567af4c7 authored by lowercasedonkey's avatar lowercasedonkey
Browse files

fixes

parent 19719852
No related branches found
No related tags found
1 merge request!7611Markets to JS
/**
*
* @param {*} slaveMarket
*
* @param {string} slaveMarket
* @param {object} [param1]
* @param {string} [param1.numArcology]
* @param {number} [param1.numArcology]
* @param {string} [param1.sTitleSingular]
* @param {string} [param1.sTitlePlural]
* @param {number} [param1.costMod]
*/
App.Markets.generic = function(slaveMarket, { numArcology, sTitleSingular = "slave", sTitlePlural = "slaves", costMod = 1 } = {}) {
App.Markets.generic = function(slaveMarket, {numArcology, sTitleSingular = "slave", sTitlePlural = "slaves", costMod = 1} = {}) {
const el = new DocumentFragment();
const marketResult = generateMarketSlave(slaveMarket, (numArcology || 1));
const slave = marketResult.slave;
......@@ -44,7 +45,7 @@ App.Markets.generic = function(slaveMarket, { numArcology, sTitleSingular = "sla
}
function choices() {
const { him, his } = getPronouns(slave);
const {him, his} = getPronouns(slave);
const el = document.createElement("p");
let title = {};
if (sTitleSingular === "prisoner") {
......@@ -72,7 +73,7 @@ App.Markets.generic = function(slaveMarket, { numArcology, sTitleSingular = "sla
title.decline,
() => {
V.slavesSeen += 1;
jQuery("#slave-markets").empty().append(App.Markets[market]);
jQuery("#slave-markets").empty().append(App.Markets[slaveMarket]);
},
)
);
......@@ -88,7 +89,7 @@ App.Markets.generic = function(slaveMarket, { numArcology, sTitleSingular = "sla
V.introType = "multi";
V.slavesSeen += 1;
student();
jQuery("#slave-markets").empty().append(App.Markets[market]);
jQuery("#slave-markets").empty().append(App.Markets[slaveMarket]);
},
)
);
......@@ -141,13 +142,13 @@ App.Markets.generic = function(slaveMarket, { numArcology, sTitleSingular = "sla
);
}
el.append(App.Desc.longSlave(slave, { market: market }));
el.append(App.Desc.longSlave(slave, {market: slaveMarket}));
return el;
function student() {
if ([App.Data.misc.schools].includes(market)) {
V[market].schoolSale = 0;
V[market].studentsBought += 1;
if ([App.Data.misc.schools].includes(slaveMarket)) {
V[slaveMarket].schoolSale = 0;
V[slaveMarket].studentsBought += 1;
}
}
}
......
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