diff --git a/devNotes/usefulJSFunctionDocumentation.md b/devNotes/usefulJSFunctionDocumentation.md index e8a9181daa3bab7b22f465b7de7b2face8cd12c6..2fe079407eaddab86f4ae8aa5444a5316bf21a5e 100644 --- a/devNotes/usefulJSFunctionDocumentation.md +++ b/devNotes/usefulJSFunctionDocumentation.md @@ -201,6 +201,9 @@ lipsDesc(slave) // Returns the description of the slave's lips. bellyDesc(slave, withNoun, pregReference) // Returns the description of the slave's belly. +penetrationTool(slave, includeClit) // Returns the description of the part of body that a slave/PC uses to penetrate, if he can, or a description for his dildo. + + relationshipChecks [script] All work as expected with <<if X.rivalryTarget == $slaves[$i].ID>> preceding them. rivalryTerm(id) // Returns the rivalry term for the input. e.g. lines 99-100 of brothelReport. //<<if $Madam.rivalryTarget == $slaves[$i].ID>> diff --git a/src/js/storyJS.js b/src/js/storyJS.js index 4a4fca2ffd7d09cef42ffeb6a52d9592a8cb0820..47a7d7a66461ce70a9e8fc0a78d01691df2f5f23 100644 --- a/src/js/storyJS.js +++ b/src/js/storyJS.js @@ -754,3 +754,24 @@ globalThis.pregNumberName = function(nmbr1, nmbr2) { } return pt; }; + +/** Returns the description of the part of body a slave/PC uses to penetrate, if they can, or a description for "dildo" + * @param {FC.HumanState} slave + * @param {boolean} includeClit + * @returns {string} +*/ +globalThis.penetrationTool = function(slave, includeClit = true) { + if (!slave || !slave.hasOwnProperty("dick")) { + return "ERROR"; + } + if (slave.dick > 0 && canPenetrate(slave)) { + return dickDesc(slave); + } + if (slave.clit >= 3 && includeClit) { + return clitDesc(slave); + } + let adj = ["big", "fat", "huge", "large", "long", "realistic"]; + let use = (slave.vagina === 0) ? ["strap-on", "", ""] : ["double-sided", "strap-on double", "double-headed", "double-ended", "strapless double"]; + let noun = ["dildo", "dildo", "dildo", "dildo", "fake cock", "vibrator", "vibrator"]; + return `${jsEither(adj)} ${jsEither(use)} ${jsEither(noun)}`; +} \ No newline at end of file