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

Convert husk slave swap as well

parent b6248808
No related branches found
No related tags found
1 merge request!8528Body swap to JS
...@@ -39,3 +39,18 @@ new App.DomPassage( ...@@ -39,3 +39,18 @@ new App.DomPassage(
return bodySwapSelection(getSlave(V.AS)); return bodySwapSelection(getSlave(V.AS));
} }
); );
new App.DomPassage(
"Husk Slave Swap Workaround",
() => {
V.nextButton = "Abort Operation";
if (V.activeSlave.tankBaby !== 3) {
V.nextLink = "Scheduled Event";
V.returnTo = "Scheduled Event";
} else {
V.nextLink = "Main";
V.returnTo = "Incubator";
}
return bodySwapSelection(getSlave(V.AS));
}
);
...@@ -25,14 +25,14 @@ ...@@ -25,14 +25,14 @@
<</if>> <</if>>
<<includeDOM App.UI.newChildIntro($readySlave)>> <<includeDOM App.UI.newChildIntro($readySlave)>>
<<else>> <<else>>
<<set $activeSlave = $readySlave>> /* $activeSlave is used by husk Slave Swap Workaround */ <<set $activeSlave = $readySlave>> /* $activeSlave is used by Husk Slave Swap Workaround */
A husk is ready to be used. A husk is ready to be used.
<br> <br>
//As expected, $he is a complete vegetable, but that is what you wanted after all. You lack the facilities to care for $him in this state, so you should do what you are planning quickly. Or you could sell $him to the Flesh Heap.// //As expected, $he is a complete vegetable, but that is what you wanted after all. You lack the facilities to care for $him in this state, so you should do what you are planning quickly. Or you could sell $him to the Flesh Heap.//
<<set _price = Math.trunc(slaveCost($readySlave)/3)>> <<set _price = Math.trunc(slaveCost($readySlave)/3)>>
<span id="result"> <span id="result">
<<if $cash >= $surgeryCost>> <<if $cash >= $surgeryCost>>
<br>[[Contact the bodyswap surgeon.|husk Slave Swap Workaround]] //Will significantly increase the selected slave's upkeep.// <br>[[Contact the bodyswap surgeon.|Husk Slave Swap Workaround]] //Will significantly increase the selected slave's upkeep.//
<br>[[Sell the husk to Flesh Heap.|Main][cashX(_price, "slaveTransfer")]] <br>[[Sell the husk to Flesh Heap.|Main][cashX(_price, "slaveTransfer")]]
//This body can be bought by the Flesh Heap for <<print cashFormat(_price)>>//. //This body can be bought by the Flesh Heap for <<print cashFormat(_price)>>//.
<<else>> <<else>>
......
...@@ -316,3 +316,46 @@ globalThis.bodySwapSelection = function(soul) { ...@@ -316,3 +316,46 @@ globalThis.bodySwapSelection = function(soul) {
return el; return el;
}; };
/**
*
* @param {App.Entity.SlaveState} body
* @returns {DocumentFragment}
*/
globalThis.huskSwapSelection = function(body) {
const el = new DocumentFragment();
const cost = 10000;
App.UI.DOM.appendNewElement("div", el, `"This operation is neither simple nor is it perfected. There are extreme health risks involved and no guarantee of success. Strap a slave into your remote surgery to consent to the operation. Indentured servants${(V.incubator > 0) || (V.nurseryChildren) ? `and slaves with reserved children`:``} are not eligible."
`, "scene-intro");
App.UI.DOM.appendNewElement("div", el, `Select the slave whose mind will be transferred into the waiting husk. Amputated slaves must not be wearing prosthetics. This operation will cost ${cashFormat(cost)}.`);
for (const soul of V.slaves) {
if (isSlaveAvailable(soul)) {
if (soul.fuckdoll === 0) {
if (!hasAnyProstheticLimbs(soul)) {
if (soul.indenture === -1) {
if (soul.breedingMark === 0 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset") {
if (WombReserveCount(soul) === 0) {
if (soul.ID !== body.ID) {
App.UI.DOM.appendNewElement("div", el,
App.UI.DOM.link(
soul.slaveName,
() => {
V.swappingSlave = soul;
cashX(forceNeg(cost), "slaveSurgery", soul);
},
[],
"Husk Slave Swap"
)
);
}
}
}
}
}
}
}
}
return el;
};
:: husk Slave Swap Workaround [nobr]
<<if $activeSlave.tankBaby != 3>>
<<set $nextButton = "Abort Operation", $nextLink = "Scheduled Event", $returnTo = "Scheduled Event">>
<<else>>
<<set $nextButton = "Abort Operation", $nextLink = "Main", $returnTo = "Incubator">>
<</if>>
"This operation is neither simple nor is it perfected. There are extreme health risks involved and no guarantee of success. Strap a slave into your remote surgery to consent to the operation. Indentured servants<<if ($incubator > 0) || ($nurseryChildren)>> and slaves with reserved children<</if>> are not eligible."
<br>
//Select the slave whose mind will be transferred into the waiting husk. Amputated slaves must not be wearing prosthetics. This operation will cost <<print cashFormat(10000)>>.//
<br><br>
__Select an eligible slave:__
<<for _i = 0; _i < $slaves.length; _i++>>
<<capture _i>>
<<if isSlaveAvailable($slaves[_i])>>
<<if $slaves[_i].fuckdoll == 0>>
<<if !hasAnyProstheticLimbs($slaves[_i])>>
<<if $slaves[_i].indenture == -1>>
<<if $slaves[_i].breedingMark == 0 || $propOutcome == 0 || $eugenicsFullControl == 1 || $arcologies[0].FSRestart == "unset">>
<<if WombReserveCount($slaves[_i]) == 0>>
<<if $slaves[_i].ID != $AS>>
<<set _name = SlaveFullName($slaves[_i])>>
<br>[[_name|Husk Slave Swap][$swappingSlave = $slaves[_i], cashX(-10000, "slaveSurgery", $slaves[_i])]]
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</capture>>
<</for>>
...@@ -73,7 +73,7 @@ A slave came in fitting the description you provided. ...@@ -73,7 +73,7 @@ A slave came in fitting the description you provided.
<<if $cash >= $surgeryCost>> <<if $cash >= $surgeryCost>>
<<link "Accept the offered slave and contact the bodyswap surgeon.">> <<link "Accept the offered slave and contact the bodyswap surgeon.">>
<<set $activeSlave = _husk>> <<set $activeSlave = _husk>>
<<goto "husk Slave Swap Workaround">> <<goto "Husk Slave Swap Workaround">>
<</link>> <</link>>
//Will significantly increase the selected slave's upkeep.// //Will significantly increase the selected slave's upkeep.//
<<else>> <<else>>
......
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