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

workaround to js

parent fd614f1a
No related branches found
No related tags found
No related merge requests found
...@@ -30,3 +30,12 @@ new App.DomPassage("Fat Grafting", ...@@ -30,3 +30,12 @@ new App.DomPassage("Fat Grafting",
return App.UI.SlaveInteract.fatGraft(getSlave(V.AS)); return App.UI.SlaveInteract.fatGraft(getSlave(V.AS));
} }
); );
new App.DomPassage(
"Slave Slave Swap Workaround",
() => {
V.nextButton = "Abort Operation";
V.nextLink = "Main";
return bodySwapSelection(getSlave(V.AS));
}
);
...@@ -256,3 +256,71 @@ globalThis.bodySwapName = function(soul, body) { ...@@ -256,3 +256,71 @@ globalThis.bodySwapName = function(soul, body) {
soul.origBodyOwner = body.origBodyOwner; soul.origBodyOwner = body.origBodyOwner;
} }
}; };
/**
*
* @param {App.Entity.SlaveState} soul
* @returns {DocumentFragment}
*/
globalThis.bodySwapSelection = function(soul) {
const {him} = getPronouns(soul);
const el = new DocumentFragment();
const cost = 10000;
App.UI.DOM.appendNewElement("div", el, `The surgeon awaits the pair of slaves to be strapped into the surgery. So far only ${soul.slaveName} is prepped:`, "scene-intro");
App.UI.DOM.appendNewElement("div", el, `Select ${(V.seeExtreme) ? `Select an eligible slave (any slave who is not a fuckdoll)` : `a slave`} who will be trading bodies with ${him}. This operation will cost ${cashFormat(cost)}.`);
for (const body of V.slaves) {
const slaveDiv = document.createElement("div");
slaveDiv.append(
App.UI.DOM.link(
body.slaveName,
() => {
V.swappingSlave = body;
cashX(forceNeg(cost), "slaveSurgery", body);
},
[],
"Slave Slave Swap"
)
);
const relTerm = relativeTerm(soul, body);
if (relTerm) {
slaveDiv.append(` ${relTerm}`);
}
if (body.relationshipTarget === soul.ID) {
const {wife} = getPronouns(body);
switch (body.relationship) {
case 1:
slaveDiv.append(` friends`);
break;
case 2:
slaveDiv.append(` best friends`);
break;
case 3:
slaveDiv.append(` friends with benefits`);
break;
case 4:
slaveDiv.append(` lover`);
break;
case 5:
slaveDiv.append(` soul${wife}`);
break;
}
}
if (body.rivalryTarget === soul.ID) {
switch (body.relationship) {
case 1:
slaveDiv.append(`dislikes`);
break;
case 2:
slaveDiv.append(`rival`);
break;
case 3:
slaveDiv.append(`bitterly hates`);
break;
}
}
el.append(slaveDiv);
}
return el;
};
:: Slave Slave Swap Workaround [nobr]
<<set $nextButton = "Abort Operation", $nextLink = "Main">>
The surgeon awaits the pair of slaves to be strapped into the surgery. So far only <<= getSlave($AS).slaveName>> is prepped:
<br>
//Select the slave who will be trading bodies with $him. 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 ($slaves[_i].ID != $AS)>>
<<set _name = SlaveFullName($slaves[_i])>>
<br>[[_name|Slave Slave Swap][$swappingSlave = $slaves[_i], cashX(-10000, "slaveSurgery", $slaves[_i])]]
<</if>>
<</if>>
<</if>>
<</capture>>
<</for>>
\ No newline at end of file
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