diff --git a/devNotes/usefulJSFunctionDocumentation.md b/devNotes/usefulJSFunctionDocumentation.md index 7a483acadca3fab27ef5907f18652f6b8016479f..2cebda8a228188b14c1fce2511c038756176f711 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 644d994ca331647fe056c9104a7bc37ce2a13766..662e9115b8d2dbf41af0494abd9576b438a34371 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 d0a31962819c6e907d6f4a9070adba31304c6c13..4c7a231a05f5a81df63cd610d5e910263523cd01 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 276fe9a9fd3a757892266eeffb2447e837d693c3..fe8a7fe99ee48421f038e97dddc7842bef7a4680 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)) {