Skip to content
Snippets Groups Projects
Commit b385616d authored by Pregmodder's avatar Pregmodder
Browse files

Merge branch 'fDance' into 'pregmod-master'

FDance to JS

See merge request pregmodfan/fc-pregmod!9172
parents 0c8ee140 c46cd769
No related branches found
No related tags found
No related merge requests found
......@@ -9,8 +9,6 @@ new App.DomPassage("Slave Interact",
);
/* ### Single Interaction ### */
new App.DomPassage("FAnimal", () => App.Interact.fAnimal(getSlave(V.AS), V.animalType));
new App.DomPassage("SlaveOnSlaveFeeding",
() => {
V.nextButton = "Back";
......
......@@ -292,16 +292,17 @@ App.UI.SlaveInteract.work = function(slave) {
// Goal: Be able to write the entire "use her" block with only dom fragments.
let el = document.createElement('div');
/*
Array of objects. Each object follows the form: {
text: "Link text",
scene: "scene to include",
goto: if another passage is needed
updateSlave: update slave itself if needed, like {trust: 2},
update: updates V.,
note: if a note must appear after the link
}
*/
/**
* @typedef {Object} sexOption
* @property {string} text "Link text"
* @property {string|Node} [scene]
* @property {string} [goto] if another passage is needed
* @property {Object} [updateSlave] update slave itself if needed, like {trust: 2},
* @property {Object} [update] updates V.,
* @property {string} [note] if a note must appear after the link
* @property {string} [disabled]
*/
/** @type {sexOption[]} */
const sexOptions = [];
const fillFaceOptions = [];
const fillAssOptions = [];
......@@ -347,7 +348,7 @@ App.UI.SlaveInteract.work = function(slave) {
sexOptions.push({text: `Use ${his} mouth`, scene: `FLips`});
sexOptions.push({text: `Kiss ${him}`, scene: `FKiss`});
if (hasAnyLegs(slave)) {
sexOptions.push({text: `Have ${him} dance for you`, scene: `FDance`});
sexOptions.push({text: `Have ${him} dance for you`, scene: App.Interact.dance(slave)});
}
sexOptions.push({text: `Play with ${his} tits`, scene: `FBoobs`});
......@@ -545,21 +546,21 @@ App.UI.SlaveInteract.work = function(slave) {
if (V.farmyardKennels > 0 && V.active.canine) {
sexOptions.push({
text: `Have a ${V.active.canine.species} mount ${him}`,
scene: `FAnimal`,
scene: App.Interact.fAnimal(slave, V.animalType),
update: {animalType: "canine"}
});
}
if (V.farmyardStables > 0 && V.active.hooved) {
sexOptions.push({
text: `Let a ${V.active.hooved.species} mount ${him}`,
scene: `FAnimal`,
scene: App.Interact.fAnimal(slave, V.animalType),
update: {animalType: "hooved"}
});
}
if (V.farmyardCages > 0 && V.active.feline) {
sexOptions.push({
text: `Have a ${V.active.feline.species} mount ${him}`,
scene: `FAnimal`,
scene: App.Interact.fAnimal(slave, V.animalType),
update: {animalType: "feline"}
});
}
......@@ -801,9 +802,13 @@ App.UI.SlaveInteract.work = function(slave) {
// just play the passage, no need to refresh anything here
Engine.play(sexOption.goto);
} else if (sexOption.scene) {
// Run scene and store render results temporarily
let frag = App.UI.DOM.renderPassage(sexOption.scene);
let frag;
if (typeof sexOption.scene === "string") {
// Run scene and store render results temporarily
frag = App.UI.DOM.renderPassage(sexOption.scene);
} else {
frag = sexOption.scene;
}
// Refresh (clears scene display)
refresh();
......
/**
* @param {App.Entity.SlaveState} slave
* @param {string} type
* @returns {DocumentFragment}
*/
App.Interact.fAnimal = function(slave, type) {
const frag = new DocumentFragment();
......
:: FAnimal [nobr no-history]
/* TODO: This passage only exists because siWork is not currently set up to handle pure DOM scenes. Remove this once fixed. */
<<includeDOM App.Interact.fAnimal(getSlave($AS), $animalType)>>
This diff is collapsed.
This diff is collapsed.
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