From e9fd56258a87ad5d71a1649f0c7acfbc81e1f101 Mon Sep 17 00:00:00 2001 From: DCoded <dicoded@email.com> Date: Thu, 3 Mar 2022 13:56:33 -0500 Subject: [PATCH] Added stretchedAnusSize, logic fixes --- devNotes/usefulJSFunctionDocumentation.md | 4 +++- src/events/scheduled/pitFightNonlethal.js | 2 +- src/js/utilsSlave.js | 8 ++++++++ src/npc/interaction/fAnimal.js | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/devNotes/usefulJSFunctionDocumentation.md b/devNotes/usefulJSFunctionDocumentation.md index 7a483acadca..2cebda8a228 100644 --- a/devNotes/usefulJSFunctionDocumentation.md +++ b/devNotes/usefulJSFunctionDocumentation.md @@ -405,6 +405,8 @@ releaseRestricted // returns true if the slave has some kind of rule limiting th ValidateFacilityDecoration() // checks the value of the associated variable and it if it infinite i.e. NA the text description is reset back to standard. /* decoration should be passed as "facilityDecoration" in quotes. For example, ValidateFacilityDecoration("brothelDecoration"). The quotes are important, do not pass it as a story variable. */ + stretchedAnusSize() // Calculates the minimum anus size to accommodate a particular dick size + FSChangePorn() // //Currently unused, widget version routes directly through FSChange() HackingSkillMultiplier() // outputs a value based off of the PC's hacking skill. @@ -420,4 +422,4 @@ releaseRestricted // returns true if the slave has some kind of rule limiting th SkillIncrease() // Depreciates the SugarCube functions. disobedience // Returns a 0-100 value indicating likelihood of a slave ignoring the rules. -``` \ No newline at end of file +``` diff --git a/src/events/scheduled/pitFightNonlethal.js b/src/events/scheduled/pitFightNonlethal.js index 644d994ca33..662e9115b8d 100644 --- a/src/events/scheduled/pitFightNonlethal.js +++ b/src/events/scheduled/pitFightNonlethal.js @@ -707,7 +707,7 @@ App.Facilities.Pit.nonlethalFight = function(fighters) { } else if (canDoAnal(slave)) { seX(slave, 'anal', 'animal'); // @ts-ignore - slave.anus = slave.anus < animal.dick.size ? animal.dick.size : slave.anus; + slave.anus = Math.max(slave.anus, stretchedAnusSize(animal.dick.size)); } else { seX(slave, 'oral', 'animal'); } diff --git a/src/js/utilsSlave.js b/src/js/utilsSlave.js index d0a31962819..4c7a231a05f 100644 --- a/src/js/utilsSlave.js +++ b/src/js/utilsSlave.js @@ -3714,3 +3714,11 @@ App.Utils.showSlaveChanges = function(edited, original, dispatch, crumb = "") { } } }; + +/** Calculates the minimum anus size to accommodate a particular dick size + * @param {number} dickSize + * @returns {FC.AnusType} + */ +globalThis.stretchedAnusSize = function(dickSize) { + return /** @type {FC.AnusType} */ (Math.clamp(dickSize, 0, 4)); +}; diff --git a/src/npc/interaction/fAnimal.js b/src/npc/interaction/fAnimal.js index 276fe9a9fd3..fe8a7fe99ee 100644 --- a/src/npc/interaction/fAnimal.js +++ b/src/npc/interaction/fAnimal.js @@ -113,7 +113,7 @@ App.Interact.fAnimal = function(slave, type) { slave.vagina = Math.max(slave.vagina, animal.dick.size); } else if (act === Acts.ANAL) { // @ts-ignore - slave.anus = Math.max(slave.anus, animal.dick.size); + slave.anus = Math.max(slave.anus, stretchedAnusSize(animal.dick.size)); } if (act !== Acts.ORAL && canGetPregnant(slave) && canBreed(slave, animal)) { -- GitLab