diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw index de1b06004458e671148e4897aadc79abdcd29fcf..043b157a22ef6a9a6cb2592bb5cb5afa0a17f5a6 100644 --- a/src/init/storyInit.tw +++ b/src/init/storyInit.tw @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with thi <<set $returnTo = "init", $nextButton = "Continue", $nextLink = "Alpha disclaimer">> <<unset $releaseID>> -<<set $ver = "0.10.7", $pmodVer = "2.2.X", $releaseID = 1042>> +<<set $ver = "0.10.7", $pmodVer = "2.2.X", $releaseID = 1043>> <<if ndef $pmodVer>><<set $pmodVer = "2.2.X">><</if>> /* This needs to be broken down into individual files that can be added to StoryInit instead. */ diff --git a/src/js/rulesAssistant.js b/src/js/rulesAssistant.js index 6d2db438933c0bcf567979507844c53591478516..d56e0ab09a2cdd553cceecb47c120e08be8396ba 100644 --- a/src/js/rulesAssistant.js +++ b/src/js/rulesAssistant.js @@ -184,8 +184,12 @@ window.ruleAppliesP = function ruleAppliesP(cond, slave) { // assignment / facility / special slaves / specific slaves check let assignment = slave.assignment; if (assignment === "be your Concubine") assignment = "serve in the master suite"; + + if (cond.specialSlaves !== -1) { // not "Include", which means "doesn't matter" + flag = flag && (cond.specialSlaves == isLeaderP(slave)); // eslint-disable-line eqeqeq + } + flag = flag && - !(cond.excludeSpecialSlaves && isLeaderP(slave)) && (cond.assignment.length === 0 || cond.assignment.includes(assignment)) && (cond.selectedSlaves.length === 0 || cond.selectedSlaves.includes(slave.ID)) && !(cond.excludedSlaves.includes(slave.ID)); @@ -200,7 +204,7 @@ window.emptyDefaultRule = function emptyDefaultRule() { condition: { function: false, data: {}, - excludeSpecialSlaves: false, + specialSlaves: -1, assignment: [], selectedSlaves: [], excludedSlaves: [], diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js index 2b61cf819ea041c8828c3563df4443d660adb56c..3a43cab5f74854ca1944b80a3fff7b8cebf1d40a 100644 --- a/src/js/rulesAssistantOptions.js +++ b/src/js/rulesAssistantOptions.js @@ -507,7 +507,7 @@ window.rulesAssistantOptions = (function() { super("Activation Condition"); this.appendChild(new ConditionFunction()); this.appendChild(new AssignmentInclusion()); - this.appendChild(new SpecialExclusion()); + this.appendChild(new SpecialInclusion()); this.appendChild(new SpecificInclusionExclusion()); } } @@ -827,15 +827,16 @@ window.rulesAssistantOptions = (function() { } } - class SpecialExclusion extends List { + class SpecialInclusion extends List { constructor() { const items = [ - ["Yes", true], - ["No", false] + ["Include", -1], + ["Exclude", 0], + ["Only", 1] ]; - super("Exclude special slaves", items); - this.setValue(current_rule.condition.excludeSpecialSlaves); - this.onchange = (value) => current_rule.condition.excludeSpecialSlaves = value; + super("Special slaves", items); + this.setValue(current_rule.condition.specialSlaves); + this.onchange = (value) => current_rule.condition.specialSlaves = value; } } diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index 7389d62645c0084ca176bd48d60f05cb95f7cc34..35e6d589d50ae2bb2ac66b42e9c8f10ae5107529 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -3557,8 +3557,19 @@ Done! <<set $abbreviateHormoneBalance = 2>> <</if>> -<<if $releaseID < 1036>> - <<set $releaseID = 1036>> +<<if $releaseID < 1043>> + <<for _rule range $defaultRules>> + <<if _rule.condition.excludeSpecialSlaves>> + <<set _rule.condition.specialSlaves = 0>> + <<else>> + <<set _rule.condition.specialSlaves = -1>> + <</if>> + <<run delete _rule.condition.excludeSpecialSlaves>> + <</for>> +<</if>> + +<<if $releaseID < 1043>> + <<set $releaseID = 1043>> <</if>> <<set $HackingSkillMultiplier = HackingSkillMultiplier()>>