diff --git a/src/markets/householdLiquidator.js b/src/markets/householdLiquidator.js new file mode 100644 index 0000000000000000000000000000000000000000..1c3a9a3d3f6c4758278c0a3de68b5395e354faec --- /dev/null +++ b/src/markets/householdLiquidator.js @@ -0,0 +1,150 @@ +App.Markets["Household Liquidator"] = function() { + V.encyclopedia = "Household Liquidations"; + V.introType = "liquidator"; + V.newSlavesDone = 0; + + const el = new DocumentFragment(); + let slave; + let r = []; + const _newSlaves = []; + let _totalCost; + if (jsRandom(1, 100) > 50) { + slave = GenerateNewSlave(null, {disableDisability: 1}); + slave.origin = "You bought $him from the household liquidator."; + slave.devotion = jsRandom(-75, -25); + slave.trust = jsRandom(-45, -25); + slave.oldDevotion = slave.devotion; + slave.oldTrust = slave.trust; + setHealth(slave, jsRandom(-50, 20)); + setMissingParents(slave); + slave.canRecruit = 0; + + // Create opposite sex chance of relative + let _oppositeSex = false; + if (slave.genes !== GenerateChromosome()) { + _oppositeSex = true; + } + App.UI.DOM.appendNewElement("p", el, `The household liquidator is offering a set of siblings for sale. You are permitted to inspect both slaves.`); + + let _relativeSlave = generateRelatedSlave(slave, "younger sibling", _oppositeSex); + _newSlaves.push(slave); + _newSlaves.push(_relativeSlave); + + let _slaveCost = slaveCost(slave, false, true); + if (V.slavesSeen > V.slaveMarketLimit) { + _slaveCost += Math.trunc(_slaveCost * ((V.slavesSeen - V.slaveMarketLimit) * 0.1)); + } + _totalCost = _slaveCost * 3; + } else if (jsRandom(1, 100) > 20) { + // Old enough to have a child who can be a slave. + slave = GenerateNewSlave(null, { + minAge: (V.fertilityAge + V.minimumSlaveAge), maxAge: 42, ageOverridesPedoMode: 1, disableDisability: 1 + }); + slave.origin = "You bought $him from the household liquidator."; + slave.devotion = jsRandom(-75, -25); + slave.trust = jsRandom(-45, -25); + slave.oldDevotion = slave.devotion; + slave.oldTrust = slave.trust; + setHealth(slave, jsRandom(-50, 20)); + if (slave.vagina > -1) { + slave.boobs += 100; + } + slave.butt += 1; + if (slave.vagina > -1) { + slave.vagina += 1; + } + if (slave.vagina > -1) { + slave.counter.birthsTotal = 1; + } + slave.canRecruit = 0; + + // Create opposite sex chance of relative + let _oppositeSex = false; + if (slave.genes !== GenerateChromosome()) { + _oppositeSex = true; + } + const {his} = getPronouns(slave); + + r.push(`The household liquidator is offering a ${V.mother} and ${his}`); + if (slave.genes === "XX" && _oppositeSex === true) { + r.push(`son`); + } else if (slave.genes === "XY" && _oppositeSex === true) { + r.push(`daughter`); + } else { + r.push(`${V.daughter}`); + } + r.push(`for sale. You are permitted to inspect both slaves.`); + App.UI.DOM.appendNewElement("p", el, r.join(" ")); + + let _relativeSlave = generateRelatedSlave(slave, "child", _oppositeSex); + _newSlaves.push(slave); + _newSlaves.push(_relativeSlave); + + let _slaveCost = slaveCost(slave, false, true); + if (V.slavesSeen > V.slaveMarketLimit) { + _slaveCost += Math.trunc(_slaveCost * ((V.slavesSeen - V.slaveMarketLimit) * 0.1)); + } + _totalCost = _slaveCost * 3; + } else { + slave = GenerateNewSlave(null, {disableDisability: 1}); + slave.origin = "You bought $him from the household liquidator."; + slave.devotion = jsRandom(-75, -25); + slave.trust = jsRandom(-45, -25); + slave.oldDevotion = slave.devotion; + slave.oldTrust = slave.trust; + setHealth(slave, jsRandom(-50, 20)); + setMissingParents(slave); + slave.canRecruit = 0; + App.UI.DOM.appendNewElement("p", el, `The household liquidator is offering something special: identical twins.The markup is huge, but the merchandise isn't something you see every day.`); + + let _relativeSlave = generateRelatedSlave(slave, "twin"); + _newSlaves.push(slave); + _newSlaves.push(_relativeSlave); + + let _slaveCost = slaveCost(slave, false, true); + if (V.slavesSeen > V.slaveMarketLimit) { + _slaveCost += Math.trunc(_slaveCost * ((V.slavesSeen - V.slaveMarketLimit) * 0.1)); + } + _totalCost = _slaveCost * 4; + } + + el.append(`The price is `); + el.append(App.UI.DOM.cashFormat(_totalCost)); + el.append(`.`); + if (V.slavesSeen > V.slaveMarketLimit) { + el.append(` You have cast such a wide net for slaves this week that it is becoming more expensive to find more for sale. Your reputation helps determine your reach within the slave market.`); + } + + if (V.cash >= _totalCost) { + App.UI.DOM.appendNewElement( + "div", + el, + App.UI.DOM.link( + `Buy their slave contract`, + () => { + V.newSlaves = _newSlaves; + V.newSlaves.forEach((s) => cashX(forceNeg(_totalCost / V.newSlaves.length), "slaveTransfer", s)); + }, + [], + "Bulk Slave Intro" + ) + ); + } else { + el.append(`You lack the necessary funds to buy these slaves.`); + } + App.UI.DOM.appendNewElement( + "div", + el, + App.UI.DOM.link( + `Decline to purchase them and check out another set of slaves`, + () => { + V.slavesSeen += 2; + }, + [], + "Household Liquidator" + ) + ); + App.UI.DOM.appendNewElement("p", el, App.UI.MultipleInspect(_newSlaves, true, "Household Liquidators")); + + return el; +}; diff --git a/src/markets/householdLiquidator.tw b/src/markets/householdLiquidator.tw deleted file mode 100644 index 502ae6acbc4d833a556719f1b5495fc5af9e002c..0000000000000000000000000000000000000000 --- a/src/markets/householdLiquidator.tw +++ /dev/null @@ -1,102 +0,0 @@ -:: Household Liquidator [nobr] - -<<set $nextButton = "Back", $nextLink = "Buy Slaves", $returnTo = "Buy Slaves", $encyclopedia = "Household Liquidations">> -<<set $introType = "liquidator", $newSlavesDone = 0, $newSlaveIndex = 0, _newSlaves = []>> - - -<<if random(1,100) > 50>> - -<<set $activeSlave = GenerateNewSlave(null, {disableDisability: 1})>> -<<set $activeSlave.origin = "You bought $him from the household liquidator.">> -<<set $activeSlave.devotion = random(-75,-25)>> -<<set $activeSlave.trust = random(-45,-25)>> -<<set $activeSlave.oldDevotion = $activeSlave.devotion>> -<<set $activeSlave.oldTrust = $activeSlave.trust>> -<<run setHealth($activeSlave, jsRandom(-50, 20))>> -<<run setMissingParents($activeSlave)>> -<<set $activeSlave.canRecruit = 0>> - -/% Create opposite sex chance of relative %/ -<<set _oppositeSex = 0>> -<<if $activeSlave.genes != GenerateChromosome()>> - <<set _oppositeSex = 1>> -<</if>> - -The household liquidator is offering a set of siblings for sale. You are permitted to inspect both slaves. -<br><br> - -<<set _relativeSlave = generateRelatedSlave($activeSlave, "younger sibling", _oppositeSex)>> -<<run _newSlaves.push($activeSlave), _newSlaves.push(_relativeSlave)>> - -<<set _slaveCost = slaveCost($activeSlave, false, true)>> -<<if $slavesSeen > $slaveMarketLimit>><<set _slaveCost += Math.trunc(_slaveCost*(($slavesSeen-$slaveMarketLimit)*0.1))>><</if>> -<<set _totalCost = _slaveCost*3>> - -<<elseif random(1,100) > 20>> - -<<set $activeSlave = GenerateNewSlave(null, {minAge: ($fertilityAge + $minimumSlaveAge), maxAge: 42, ageOverridesPedoMode: 1, disableDisability: 1})>> -<<set $activeSlave.origin = "You bought $him from the household liquidator.">> -<<set $activeSlave.devotion = random(-75,-25)>> -<<set $activeSlave.trust = random(-45,-25)>> -<<set $activeSlave.oldDevotion = $activeSlave.devotion>> -<<set $activeSlave.oldTrust = $activeSlave.trust>> -<<run setHealth($activeSlave, jsRandom(-50, 20))>> -<<if $activeSlave.vagina > -1>><<set $activeSlave.boobs += 100>><</if>> -<<set $activeSlave.butt += 1>> -<<if $activeSlave.vagina > -1>><<set $activeSlave.vagina += 1>><</if>> -<<if $activeSlave.vagina > -1>><<set $activeSlave.counter.birthsTotal = 1>><</if>> -<<set $activeSlave.canRecruit = 0>> - -/% Create opposite sex chance of relative %/ -<<set _oppositeSex = 0>> -<<if $activeSlave.genes != GenerateChromosome()>> - <<set _oppositeSex = 1>> -<</if>> - -<<setLocalPronouns $activeSlave>> -The household liquidator is offering a $mother and $his <<if $activeSlave.genes == "XX" && _oppositeSex == 1>>son<<elseif $activeSlave.genes == "XY" && _oppositeSex == 1>>daughter<<else>>$daughter<</if>> for sale. You are permitted to inspect both slaves. -<br><br> - -<<set _relativeSlave = generateRelatedSlave($activeSlave, "child", _oppositeSex)>> -<<run _newSlaves.push($activeSlave), _newSlaves.push(_relativeSlave)>> - -<<set _slaveCost = slaveCost($activeSlave, false, true)>> -<<if $slavesSeen > $slaveMarketLimit>><<set _slaveCost += Math.trunc(_slaveCost*(($slavesSeen-$slaveMarketLimit)*0.1))>><</if>> -<<set _totalCost = _slaveCost*3>> - -<<else>> - -<<set $activeSlave = GenerateNewSlave({disableDisability: 1})>> -<<set $activeSlave.origin = "You bought $him from the household liquidator.">> -<<set $activeSlave.devotion = random(-75,-25)>> -<<set $activeSlave.trust = random(-45,-25)>> -<<set $activeSlave.oldDevotion = $activeSlave.devotion>> -<<set $activeSlave.oldTrust = $activeSlave.trust>> -<<run setHealth($activeSlave, jsRandom(-50, 20))>> -<<run setMissingParents($activeSlave)>> -<<set $activeSlave.canRecruit = 0>> - -The household liquidator is offering something special: identical twins. The markup is huge, but the merchandise isn't something you see every day. -<br><br> - -<<set _relativeSlave = generateRelatedSlave($activeSlave, "twin")>> -<<run _newSlaves.push($activeSlave), _newSlaves.push(_relativeSlave)>> - -<<set _slaveCost = slaveCost($activeSlave, false, true)>> -<<if $slavesSeen > $slaveMarketLimit>><<set _slaveCost += Math.trunc(_slaveCost*(($slavesSeen-$slaveMarketLimit)*0.1))>><</if>> -<<set _totalCost = _slaveCost*4>> - -<</if>> - -The price is <<print cashFormatColor(_totalCost)>>. <<if $slavesSeen > $slaveMarketLimit>> You have cast such a wide net for slaves this week that it is becoming more expensive to find more for sale. Your reputation helps determine your reach within the slave market.<</if>> -<br><br> - -<<if $cash >= _totalCost>> - [[Buy their slave contract|Bulk Slave Intro][$newSlaves = _newSlaves, $newSlaves.forEach((s) => cashX(forceNeg(_totalCost/$newSlaves.length), "slaveTransfer", s))]] -<<else>> - //You lack the necessary funds to buy these slaves.// -<</if>> -<br>[[Decline to purchase them and check out another set of slaves|Household Liquidator][$slavesSeen += 2]] -<br><br> - -<<includeDOM App.UI.MultipleInspect(_newSlaves, true, "Household Liquidators")>> diff --git a/src/markets/theMarket/marketData.js b/src/markets/theMarket/marketData.js index ceb678030ce9206e5dc7e23a170aa04bbdb111fb..db5a8909350cd1fc97fcf83e402af787e7d59866 100644 --- a/src/markets/theMarket/marketData.js +++ b/src/markets/theMarket/marketData.js @@ -216,8 +216,7 @@ App.Data.Markets = { }, { title: "Consult the household liquidator", - passage: `Household Liquidator`, - marketType: "", + marketType: "Household Liquidator", note: "Offers slaves close to one another at a very high price.", bulkAvailable: false, get requirements() { return (V.rep > 8000) ? true : `You are not reputable enough to consult the household liquidator.`; }