diff --git a/src/endWeek/saRules_old.js b/src/endWeek/saRules_old.js index 6e2f30847207fd7aa49238d21357f4b2b16a35d9..85ed0e37dc10a9d5ddf6a3459f0ef1bd62cd1c0b 100644 --- a/src/endWeek/saRules_old.js +++ b/src/endWeek/saRules_old.js @@ -1081,6 +1081,11 @@ rival.counter.penetrative += fuckCount; V.penetrativeTotal += fuckCount; } + + if (!App.Utils.sexAllowed(slave, rival)) { + r += `As the rules do not permit ${slave.slaveName} and ${rival.slaveName} to have sex, ${he} is <span class="yellow">severely punished.</span> `; + slave.trust -= 4; + } } } SimpleSexAct.Slave(slave, 4); @@ -1156,6 +1161,11 @@ rival.counter.penetrative += fuckCount; V.penetrativeTotal += fuckCount; } + + if (!App.Utils.sexAllowed(slave, rival)) { + r += `As the rules do not permit ${slave.slaveName} and ${rival.slaveName} to have sex, ${he} is <span class="yellow">severely punished.</span> `; + slave.trust -= 4; + } } } SimpleSexAct.Slave(slave, 4); @@ -1201,6 +1211,11 @@ slave.rivalryTarget = rival.ID; rival.rivalryTarget = slave.ID; SimpleSexAct.Slave(rival, 4); + + if (!App.Utils.sexAllowed(slave, rival)) { + r += `As the rules do not permit ${slave.slaveName} and ${rival.slaveName} to have sex, ${he} is <span class="yellow">severely punished.</span> `; + slave.trust -= 4; + } } } SimpleSexAct.Slave(slave, 7); diff --git a/src/js/utilJS.js b/src/js/utilJS.js index 44b6cb949fc224c38aa95340c8f24d1373d1da26..bd73b7fa9825cb60708905655c7105429288c1ec 100644 --- a/src/js/utilJS.js +++ b/src/js/utilJS.js @@ -3244,6 +3244,8 @@ window.disobedience = function(slave) { * @returns {App.Entity.SlaveState | undefined} */ window.randomRapeRivalryTarget = function(slave, predicate) { + const willIgnoreRules = disobedience(rapist) > jsRandom(0, 100); + function canBeARapeRival(s) { return (s.devotion <= 95 && s.energy <= 95 && !s.rivalry && !s.fuckdoll && s.fetish !== "mindbroken"); } @@ -3251,7 +3253,8 @@ window.randomRapeRivalryTarget = function(slave, predicate) { function canRape(rapist, rapee) { const opportunity = (assignmentVisible(rapist) && assignmentVisible(rapee)) || rapist.assignment === rapee.assignment; const desire = !(rapist.relationship >= 3 && rapist.relationshipTarget === rapee.id); - return opportunity && desire; + const permission = willIgnoreRules || App.Utils.sexAllowed(rapist, rapee); + return opportunity && desire && permission; } if (typeof predicate !== 'function') { @@ -3260,7 +3263,7 @@ window.randomRapeRivalryTarget = function(slave, predicate) { const arr = V.slaves.filter((s) => { return canBeARapeRival(s) && canRape(slave, s); }).shuffle(); return arr.find(predicate); -} +}; /** * Topological sorting algorithm diff --git a/src/utility/saRulesWidgets.tw b/src/utility/saRulesWidgets.tw index 9875b5bdd95078b45c87d543589992d0f77d843f..28932d0984fbf21c7045876e790fb7ae04b20b98 100644 --- a/src/utility/saRulesWidgets.tw +++ b/src/utility/saRulesWidgets.tw @@ -447,6 +447,10 @@ and <<set _fuckCount = random(1,3)>> <<set _rival.counter.penetrative += _fuckCount, $penetrativeTotal += _fuckCount>> <</if>> + <<if !App.Utils.sexAllowed($slaves[$i], _rival)>> + As the rules do not permit $slaves[$i].slaveName and _rival.slaveName to have sex, $he is @@.yellow;severely punished.@@ + <<set $slaves[$i].trust -= 4>> + <</if>> <</if>> <</if>> <<run SimpleSexAct.Slave($slaves[$i], 4)>> @@ -502,6 +506,10 @@ and <<set _fuckCount = random(1,3)>> <<set _rival.counter.penetrative += _fuckCount, $penetrativeTotal += _fuckCount>> <</if>> + <<if !App.Utils.sexAllowed($slaves[$i], _rival)>> + As the rules do not permit $slaves[$i].slaveName and _rival.slaveName to have sex, $he is @@.yellow;severely punished.@@ + <<set $slaves[$i].trust -= 4>> + <</if>> <</if>> <</if>> <<run SimpleSexAct.Slave($slaves[$i], 4)>> @@ -538,6 +546,10 @@ and $He repeatedly rapes a reluctant <<= SlaveFullName(_rival)>>; $he can't seem to keep $his hand<<if (hasBothArms($slaves[$i]) || !hasAnyArms($slaves[$i]))>>s<</if>><<if (!hasAnyArms($slaves[$i]))>> (so to speak)<</if>> off the poor slave, who can't avoid $him. Not surprisingly, _rival.slaveName resents this, and $slaves[$i].slaveName's ongoing sexual abuse @@.lightsalmon;starts a rivalry@@ between them. <<set $slaves[$i].rivalry = 1, _rival.rivalry = 1, $slaves[$i].rivalryTarget = _rival.ID, _rival.rivalryTarget = $slaves[$i].ID>> <<run SimpleSexAct.Slave(_rival, 4)>> + <<if !App.Utils.sexAllowed($slaves[$i], _rival)>> + As the rules do not permit $slaves[$i].slaveName and _rival.slaveName to have sex, $he is @@.yellow;severely punished.@@ + <<set $slaves[$i].trust -= 4>> + <</if>> <</if>> <</if>> <<run SimpleSexAct.Slave($slaves[$i], 7)>>