diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index 375c4923fc819ac91f08cbd678079aa9b214c66b..ea9907a967bfd6fd04f50546bf8307e609ec849d 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -359,7 +359,6 @@ App.Data.resetOnNGPlus = { thisWeeksIllegalWares: 0, Sweatshops: 0, - milkTap: 0, rivalID: 0, eliteAuctioned: 0, slavesSacrificedThisWeek: 0, diff --git a/src/endWeek/nextWeek/resetGlobals.js b/src/endWeek/nextWeek/resetGlobals.js index 20e0fb51dad53c00688790aea656a2305df7b0ea..e1a63cefc0315c418792ac747d849368bbb0dac8 100644 --- a/src/endWeek/nextWeek/resetGlobals.js +++ b/src/endWeek/nextWeek/resetGlobals.js @@ -62,7 +62,6 @@ App.EndWeek.resetGlobals = function() { V.activeSlave = 0; V.eventSlave = 0; V.subSlave = 0; - V.milkTap = 0; V.relation = 0; V.relative = 0; V.relative2 = 0; diff --git a/src/interaction/slaveOnSlaveFeeding.css b/src/interaction/slaveOnSlaveFeeding.css new file mode 100644 index 0000000000000000000000000000000000000000..e4fb2cc907eab6d4d2fc07e8aef967eeb0ec919a --- /dev/null +++ b/src/interaction/slaveOnSlaveFeeding.css @@ -0,0 +1,7 @@ +table.slave-on-slave-feeding { + width: 90%; +} + +table.slave-on-slave-feeding tr { + vertical-align: top; +} \ No newline at end of file diff --git a/src/interaction/slaveOnSlaveFeedingWorkAround.js b/src/interaction/slaveOnSlaveFeedingWorkAround.js new file mode 100644 index 0000000000000000000000000000000000000000..234b323b5b6333e4d5761fea4a2b1a98d5ee9119 --- /dev/null +++ b/src/interaction/slaveOnSlaveFeedingWorkAround.js @@ -0,0 +1,166 @@ +/** + * Choose which slave will feed the selected slave + * @param {App.Entity.SlaveState} slave + */ +App.UI.SlaveInteract.slaveOnSlaveFeedingSelection = function(slave) { + const el = new DocumentFragment(); + + el.append(intro()); + + tabs(); + + return el; + + function intro() { + const el = new DocumentFragment(); + const {his} = getPronouns(slave); + + App.UI.DOM.appendNewElement("div", el, `${slave.slaveName} is prepped to drink ${his} fill; now you must select a slave capable of producing the required amount of milk or ejaculate.`); + App.UI.DOM.appendNewElement("h2", el, "Select an eligible slave to serve as the tap"); + return el; + } + + function slaveChoice(inflationType) { + const el = new DocumentFragment(); + const twoLiterSlaves = []; + const fourLiterSlaves = []; + const eightLiterSlaves = []; + const {he, his} = getPronouns(slave); + + const table = document.createElement("table"); + table.classList.add("slave-on-slave-feeding"); + + const header = table.createTHead(); + table.append(header); + el.append(table); + + const columnNames = ["2 Liter", "4 Liter", "8 Liter"]; + for (const name of columnNames) { + header.append(App.UI.DOM.makeElement("th", name)); + } + + for (const tapSlave of V.slaves) { + let output; + if (inflationType === "milk") { + output = (tapSlave.lactation > 0) ? Math.trunc(milkAmount(tapSlave) / 14) : 0; + } else if (inflationType === "cum") { + output = (tapSlave.balls > 0 && tapSlave.dick > 0 && tapSlave.chastityPenis !== 1) ? Math.trunc(cumAmount(tapSlave) / 70) : 0; + } else { + throw `inflationType "${inflationType}" not found`; + } + if (tapSlave.ID !== slave.ID && (inflationType !== "milk" || tapSlave.nipples !== "fuckable")) { + if (output >= 2) { + twoLiterSlaves.push(createTapLink(tapSlave, 1, inflationType)); + if (output >= 4 && slave.pregKnown === 0) { + fourLiterSlaves.push(createTapLink(tapSlave, 2, inflationType)); + if (output >= 8) { + eightLiterSlaves.push(createTapLink(tapSlave, 3, inflationType)); + } + } + } + } + } + + if (twoLiterSlaves.length === 0) { + twoLiterSlaves.push(App.UI.DOM.makeElement("td", `You have no slaves capable of producing two liters of ${inflationType}.`)); + } else { + if (slave.pregKnown !== 0) { + fourLiterSlaves.push(App.UI.DOM.makeElement("td", `Due to ${his} pregnancy, ${he} is incapable of keeping down more than two liters of ${inflationType}.`)); + } else { + if (fourLiterSlaves.length === 0) { + fourLiterSlaves.push(App.UI.DOM.makeElement("td", `You have no slaves capable of producing four liters of ${inflationType}.`)); + } + if (eightLiterSlaves.length === 0) { + eightLiterSlaves.push(App.UI.DOM.makeElement("td", `You have no slaves capable of producing eight liters of ${inflationType}.`)); + } + } + } + + const dataRow = document.createElement("tr"); + dataRow.append(makeColumn(twoLiterSlaves)); + dataRow.append(makeColumn(fourLiterSlaves)); + dataRow.append(makeColumn(eightLiterSlaves)); + table.append(dataRow); + + return el; + } + + /** + * @param {App.Entity.SlaveState} tapSlave + * @param {number} inflation + * @param {FC.InflationLiquid} inflationType + */ + function createTapLink(tapSlave, inflation, inflationType) { + const el = document.createElement("div"); + el.append( + App.UI.DOM.link( + tapSlave.slaveName, + () => { + V.milkTap = tapSlave; + slave.inflation = inflation; + slave.inflationType = inflationType; + slave.inflationMethod = 3; + }, + [], + "FSlaveFeed" + ) + ); + const relTerm = relativeTerm(slave, tapSlave); + if (relTerm) { + el.append(` ${relTerm}`); + } + if (tapSlave.relationshipTarget === slave.ID) { + const {wife} = getPronouns(tapSlave); + switch (tapSlave.relationship) { + case 1: + el.append(` friends`); + break; + case 2: + el.append(` best friends`); + break; + case 3: + el.append(` friends with benefits`); + break; + case 4: + el.append(` lover`); + break; + case 5: + el.append(` slave${wife}`); + break; + } + } + if (tapSlave.rivalryTarget === getSlave(V.AS).ID) { + switch (tapSlave.relationship) { + case 1: + el.append(`dislikes`); + break; + case 2: + el.append(`rival`); + break; + case 3: + el.append(`bitterly hates`); + break; + } + } + return el; + } + + function makeColumn(array) { + const td = document.createElement("td"); + for (const cell of array) { + td.append(cell); + } + return td; + } + + function tabs() { + const tabBar = App.UI.DOM.appendNewElement("div", el, '', "tab-bar"); + tabBar.append( + App.UI.tabBar.tabButton('milk', 'Milk Slaves'), + App.UI.tabBar.tabButton('cum', 'Cum Slaves'), + ); + + el.append(App.UI.tabBar.makeTab('milk', slaveChoice("milk"))); + el.append(App.UI.tabBar.makeTab('cum', slaveChoice("cum"))); + } +}; diff --git a/src/interaction/slaveOnSlaveFeedingWorkAround.tw b/src/interaction/slaveOnSlaveFeedingWorkAround.tw new file mode 100644 index 0000000000000000000000000000000000000000..8ff784e0d898b5cb100b5367711fb08fee205336 --- /dev/null +++ b/src/interaction/slaveOnSlaveFeedingWorkAround.tw @@ -0,0 +1,5 @@ +:: SlaveOnSlaveFeedingWorkAround [nobr] + +<<set $nextButton = "Back", $nextLink = "Slave Interact">> + +<<includeDOM App.UI.SlaveInteract.slaveOnSlaveFeedingSelection(getSlave($AS))>> diff --git a/src/npc/interaction/fSlaveFeed.tw b/src/npc/interaction/fSlaveFeed.tw index eb4298fadae8fc69264f8b34f98e71e07046d26b..e778cd5f15f4975649e665bda787d40a44035ec3 100644 --- a/src/npc/interaction/fSlaveFeed.tw +++ b/src/npc/interaction/fSlaveFeed.tw @@ -846,4 +846,4 @@ Next, you see to <<= getSlave($AS).slaveName>>. <<run SetBellySize(getSlave($AS))>> <<set $slaves[$slaveIndices[$milkTap.ID]] = $milkTap>> -<<set $milkTap = 0>> +<<unset $milkTap>> diff --git a/src/pregmod/slaveOnSlaveFeedingWorkAround.tw b/src/pregmod/slaveOnSlaveFeedingWorkAround.tw deleted file mode 100644 index e07be1d49ed61a3050e8cb15f02fbd32c9e345bb..0000000000000000000000000000000000000000 --- a/src/pregmod/slaveOnSlaveFeedingWorkAround.tw +++ /dev/null @@ -1,284 +0,0 @@ -:: SlaveOnSlaveFeedingWorkAround [nobr] - -<<set $nextButton = "Back", $nextLink = "Slave Interact">> - -<<set $milkTap = 0, _descM = "milk", _descC = "cum", _eligibilityMilk2 = 0, _eligibilityMilk4 = 0, _eligibilityMilk8 = 0, _eligibilityCum2 = 0, _eligibilityCum4 = 0, _eligibilityCum8 = 0>> - -<<for _i = 0; _i < $slaves.length; _i++>> /* milk output */ - <<if $slaves[_i].lactation > 0>> - <<set $slaves[_i].milkOutput = 0>> - <<set _milk = milkAmount($slaves[_i])>> - <<set _milk = (_milk/14)>> - <<set _milk = Math.trunc(_milk)>> - <<set $slaves[_i].milkOutput = _milk>> - <<else>> - <<set _milk = 0>> - <<set $slaves[_i].milkOutput = 0>> - <</if>> -<</for>> -<<for _i = 0; _i < $slaves.length; _i++>> /* cum output */ - <<if $slaves[_i].balls > 0 && $slaves[_i].dick > 0 && $slaves[_i].chastityPenis != 1>> - <<set $slaves[_i].cumOutput = 0>> - <<set _cum = cumAmount($slaves[_i])>> - <<set _cum = (_cum/7)>> - <<set _cum = (_cum/10)>> - <<set _cum = Math.trunc(_cum)>> - <<set $slaves[_i].cumOutput = _cum>> - <<else>> - <<set _cum = 0>> - <<set $slaves[_i].cumOutput = 0>> - <</if>> -<</for>> - -<p class="scene-intro"> - <<= getSlave($AS).slaveName>> is prepped to drink $his fill; now you must select a slave capable of producing the required amount of milk or ejaculate. -</p> - -<h2>Select an eligible slave to serve as the tap</h2> - -<h3>Milk Slaves</h3> -<table width=90%> -<tr> - <th> - 2 Liters - </th> - <th> - 4 Liters - </th> - <th> - 8 Liters - </th> -</tr> -<tr valign="top"> - /* 2 Liters */ - <td> - <<for _i = 0; _i < $slaves.length; _i++>> - <div> - <<if $slaves[_i].milkOutput >= 2>> - <<if ($slaves[_i].ID != getSlave($AS).ID) && $slaves[_i].nipples != "fuckable">> - <<set _name = SlaveFullName($slaves[_i])>> - <<print "[[_name|FSlaveFeed][$milkTap = $slaves[" + _i + "], getSlave($AS).inflation = 1, getSlave($AS).inflationType = _descM, getSlave($AS).inflationMethod = 3]]">> - <<if relativeTerm(getSlave($AS), $slaves[_i]) != null>> - <<print relativeTerm(getSlave($AS), $slaves[_i])>> - <</if>> - <<if $slaves[_i].relationshipTarget == getSlave($AS).ID>> - <<switch $slaves[_i].relationship>> - <<case 1>> - friends - <<case 2>> - best friends - <<case 3>> - friends with benefits - <<case 4>> - lover - <<case 5>> - slave $wife - <</switch>> - <</if>> - <<if $slaves[_i].rivalryTarget == getSlave($AS).ID>> - <<switch $slaves[_i].relationship>> - <<case 1>> - dislikes - <<case 2>> - rival - <<case 3>> - bitterly hates - <</switch>> - <</if>> - <<set _eligibilityMilk2 = 1>> - <</if>> - <</if>> - </div> - <</for>> - <<if (_eligibilityMilk2 == 0)>> - <div class="note"> - You have no slaves capable of producing two liters of milk. - </div> - <</if>> - </td> - - <<if getSlave($AS).pregKnown == 0>> - /* 4 Liters */ - <td> - <<for _i = 0; _i < $slaves.length; _i++>> - <div> - <<if $slaves[_i].milkOutput >= 4>> - <<if ($slaves[_i].ID != getSlave($AS).ID) && $slaves[_i].nipples != "fuckable">> - <<set _name = SlaveFullName($slaves[_i])>> - <<print "[[_name|FSlaveFeed][$milkTap = $slaves[" + _i + "], getSlave($AS).inflation = 2, getSlave($AS).inflationType = _descM, getSlave($AS).inflationMethod = 3]]">> - <<if relativeTerm(getSlave($AS), $slaves[_i]) != null>> - <<print relativeTerm(getSlave($AS), $slaves[_i])>> - <</if>> - <<if $slaves[_i].relationshipTarget == getSlave($AS).ID>> - <<switch $slaves[_i].relationship>> - <<case 1>> - friends - <<case 2>> - best friends - <<case 3>> - friends with benefits - <<case 4>> - lover - <<case 5>> - slave $wife - <</switch>> - <</if>> - <<if $slaves[_i].rivalryTarget == getSlave($AS).ID>> - <<switch $slaves[_i].relationship>> - <<case 1>> - dislikes - <<case 2>> - rival - <<case 3>> - bitterly hates - <</switch>> - <</if>> - <<set _eligibilityMilk4 = 1>> - <</if>> - <</if>> - </div> - <</for>> - <<if (_eligibilityMilk4 == 0)>> - <div class="note"> - You have no slaves capable of producing four liters of milk. - </div> - <</if>> - </td> - - /* 8 Liters */ - <td> - <<for _i = 0; _i < $slaves.length; _i++>> - <div> - <<if $slaves[_i].milkOutput >= 8>> - <<if ($slaves[_i].ID != getSlave($AS).ID) && $slaves[_i].nipples != "fuckable">> - <<set _name = SlaveFullName($slaves[_i])>> - <<print "[[_name|FSlaveFeed][$milkTap = $slaves[" + _i + "], getSlave($AS).inflation = 3, getSlave($AS).inflationType = _descM, getSlave($AS).inflationMethod = 3]]">> - <<if relativeTerm(getSlave($AS), $slaves[_i]) != null>> - <<print relativeTerm(getSlave($AS), $slaves[_i])>> - <</if>> - <<if $slaves[_i].relationshipTarget == getSlave($AS).ID>> - <<switch $slaves[_i].relationship>> - <<case 1>> - friends - <<case 2>> - best friends - <<case 3>> - friends with benefits - <<case 4>> - lover - <<case 5>> - slave $wife - <</switch>> - <</if>> - <<if $slaves[_i].rivalryTarget == getSlave($AS).ID>> - <<switch $slaves[_i].relationship>> - <<case 1>> - dislikes - <<case 2>> - rival - <<case 3>> - bitterly hates - <</switch>> - <</if>> - <<set _eligibilityMilk8 = 1>> - <</if>> - <</if>> - </div> - <</for>> - <<if (_eligibilityMilk8 == 0)>> - <div class="note"> - You have no slaves capable of producing eight liters of milk. - </div> - <</if>> - </td> - <<else>> - <td> - Due to $his pregnancy, $he is incapable of keeping down more than two liters of milk. - </td> - <</if>> -</tr> -</table> - -<h3>Cum Slaves</h3> -<table width=90%> - <tr> - <th> - 2 Liters - </th> - <th> - 4 Liters - </th> - <th> - 8 Liters - </th> - </tr> - - <tr valign="top"> - /* 2 Liters */ - <td> - <<for _i = 0; _i < $slaves.length; _i++>> - <div> - <<if $slaves[_i].cumOutput >= 2>> - <<if ($slaves[_i].ID != getSlave($AS).ID)>> - <<set _name = SlaveFullName($slaves[_i])>> - <<print "[[_name|FSlaveFeed][$milkTap = $slaves[" + _i + "], getSlave($AS).inflation = 1, getSlave($AS).inflationType = _descC, getSlave($AS).inflationMethod = 3]]">> - <<set _eligibilityCum2 = 1>> - <</if>> - <</if>> - </div> - <</for>> - <<if (_eligibilityCum2 == 0)>> - <div class="note"> - You have no slaves capable of producing two liters of cum. - </div> - <</if>> - </td> - - <<if getSlave($AS).pregKnown == 0>> - /* 4 Liters */ - <td> - <<for _i = 0; _i < $slaves.length; _i++>> - <div> - <<if $slaves[_i].cumOutput >= 4>> - <<if ($slaves[_i].ID != getSlave($AS).ID)>> - <<set _name = SlaveFullName($slaves[_i])>> - <<print "[[_name|FSlaveFeed][$milkTap = $slaves[" + _i + "], getSlave($AS).inflation = 2, getSlave($AS).inflationType = _descC, getSlave($AS).inflationMethod = 3]]">> - <<set _eligibilityCum4 = 1>> - <</if>> - <</if>> - </div> - <</for>> - - <<if (_eligibilityCum4 == 0)>> - <div class="note"> - You have no slaves capable of producing four liters of cum. - </div> - <</if>> - </td> - - /* 8 Liters */ - <td> - <<for _i = 0; _i < $slaves.length; _i++>> - <div> - <<if $slaves[_i].cumOutput >= 8>> - <<if ($slaves[_i].ID != getSlave($AS).ID)>> - <<set _name = SlaveFullName($slaves[_i])>> - <<print "[[_name|FSlaveFeed][$milkTap = $slaves[" + _i + "], getSlave($AS).inflation = 3, getSlave($AS).inflationType = _descC, getSlave($AS).inflationMethod = 3]]">> - <<set _eligibilityCum8 = 1>> - <</if>> - <</if>> - </div> - <</for>> - <<if (_eligibilityCum8 == 0)>> - <div class="note"> - You have no slaves capable of producing eight liters of cum. - </div> - <</if>> - </td> - <<else>> - <td> - Due to $his pregnancy, $he is incapable of keeping down more than two liters of cum. - </td> - <</if>> - </tr> -</table>