diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index e617d41b4df29f79102d08671f31fb87d230e0c2..bb5a6e949ce65fff7a11d456a0bda6e56843b287 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -514,6 +514,7 @@ App.Data.resetOnNGPlus = { defaultRules: [], /** @type {Object.<string, number[]>} */ rulesToApplyOnce: {}, + raDefaultMode : 0, REFeminizationCheckinIDs: [], REMILFCheckinIDs: [], diff --git a/js/medicine/surgery/structural/amputation.js b/js/medicine/surgery/structural/amputation.js index c63759897847efdc40f3312f0898ebb30cef3b1a..efc3f2b4a56183fe70725f0b4cd522fb46b20f6a 100644 --- a/js/medicine/surgery/structural/amputation.js +++ b/js/medicine/surgery/structural/amputation.js @@ -217,8 +217,13 @@ App.Medicine.Surgery.Reactions.Amputate = class extends App.Medicine.Surgery.Sim const {He, him} = getPronouns(slave); if (slave.behavioralFlaw === "arrogant") { - reaction.longReaction.last() - .push(`<span class="flaw break">${He} can hardly be arrogant relying on others to feed, bathe and carry ${him}.</span>`); + const r = `<span class="flaw break">${He} can hardly be arrogant relying on others to feed, bathe and carry ${him}.</span>`; + if (reaction.longReaction.length > 0) { + reaction.longReaction.last() + .push(r); + } else { + reaction.longReaction.push([r]); + } slave.behavioralFlaw = "none"; } diff --git a/js/medicine/surgery/voice/mute.js b/js/medicine/surgery/voice/mute.js index 6d1f5195f891d7815f95f21d25a2fed34ba53080..ba9062fcb60448e6ece070de6e36f46001eee4dc 100644 --- a/js/medicine/surgery/voice/mute.js +++ b/js/medicine/surgery/voice/mute.js @@ -40,8 +40,13 @@ App.Medicine.Surgery.Reactions.Mute = class extends App.Medicine.Surgery.SimpleR const {He} = getPronouns(slave); if (slave.behavioralFlaw === "bitchy") { - reaction.longReaction.last() - .push(`<span class="green">${He} can hardly make sharp remarks without a voice.</span>`); + const r = `<span class="green">${He} can hardly make sharp remarks without a voice.</span>`; + if (reaction.longReaction.length > 0) { + reaction.longReaction.last() + .push(r); + } else { + reaction.longReaction.push([r]); + } slave.behavioralFlaw = "none"; } diff --git a/src/gui/options/options.js b/src/gui/options/options.js index 41848665b7ffb3da12bda4b004cb34a047f5da94..19b5ca8aee23b2ef4460fd1ff68d77c691c86c5a 100644 --- a/src/gui/options/options.js +++ b/src/gui/options/options.js @@ -882,6 +882,9 @@ App.Intro.display = function(isIntro) { options.addOption("Purchase options are", "purchaseStyle") .addValue("Links", 'link').addValue("Buttons", 'button'); + options.addOption("Default Rules Assistant mode is", "raDefaultMode") + .addValue("Simple", 0).addValue("Advanced", 1); + el.append(options.render()); r = []; diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js index e4c8ce1d38063260571f8ef274b2b19fdbf67d99..920978bc9d64cd0d87b7009cfe35f20095660dbe 100644 --- a/src/js/DefaultRules.js +++ b/src/js/DefaultRules.js @@ -1655,15 +1655,15 @@ globalThis.DefaultRules = function(slave) { if (!isAmputee(slave) && App.RA.shallShrink(slave.muscles, rule.muscles, 8)) { if (slave.diet !== "slimming") { slave.diet = "slimming"; - message(`${slave.slaveName} has been put on a slimming exercise regime.`, sourceRecord.muscles); + message(`${slave.slaveName} has been put on a slimming exercise regime.`, sourceRecord.muscles.val); } } else if (!isAmputee(slave) && App.RA.shallGrow(slave.muscles, rule.muscles, 2)) { if (slave.diet !== "muscle building") { slave.diet = "muscle building"; - message(`${slave.slaveName} has been put on a muscle building exercise regime.`, sourceRecord.muscles); + message(`${slave.slaveName} has been put on a muscle building exercise regime.`, sourceRecord.muscles.val); } } else if (!isAmputee(slave) && ["slimming", "muscle building"].includes(slave.diet)) { - message(`${slave.slaveName} is at the target musculature, so ${his} diet has been normalized.`, sourceRecord.muscles); + message(`${slave.slaveName} is at the target musculature, so ${his} diet has been normalized.`, sourceRecord.muscles.val); dietRule(slave, rule); } else { dietRule(slave, rule); @@ -1759,10 +1759,10 @@ globalThis.DefaultRules = function(slave) { function dietPills(slave) { if (slave.drugs === "appetite suppressors" && slave.diet !== "restricted") { slave.drugs = "no drugs"; - message(`${slave.slaveName} no longer needs to lose weight, so ${he}'s no longer being given appetite suppressors.`, [sourceRecord.diet, sourceRecord.weight.max, sourceRecord.weight.min]); + message(`${slave.slaveName} no longer needs to lose weight, so ${he}'s no longer being given appetite suppressors.`, [sourceRecord.diet, sourceRecord.weight?.max, sourceRecord.weight?.min]); } else if (slave.diet === "restricted" && V.arcologies[0].FSSlimnessEnthusiastResearch === 1 && slave.drugs === "no drugs") { slave.drugs = "appetite suppressors"; - message(`${slave.slaveName} needs to lose weight, so ${he} will be given weight loss pills.`, [sourceRecord.diet, sourceRecord.weight.max, sourceRecord.weight.min]); + message(`${slave.slaveName} needs to lose weight, so ${he} will be given weight loss pills.`, [sourceRecord.diet, sourceRecord.weight?.max, sourceRecord.weight?.min]); } } } diff --git a/src/js/rulesAssistant.js b/src/js/rulesAssistant.js index 418306d23c7d3c34f6bd07c918b3e0b5309e05e1..29e230629bde8a2ff769e3ebd18f746b502fe6a6 100644 --- a/src/js/rulesAssistant.js +++ b/src/js/rulesAssistant.js @@ -179,7 +179,7 @@ App.RA.newRule = function() { function emptyConditions() { return { activation: ["devotion", 20, "gt", 1, "and"], - advancedMode: false, + advancedMode: V.raDefaultMode === 1, selectedSlaves: [], excludedSlaves: [], applyRuleOnce: false, diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js index 332569d1cd990916b5ced71b380c2cedcc710979..261fe8c59d0676310191a168179182bc4cecb745 100644 --- a/src/js/rulesAssistantOptions.js +++ b/src/js/rulesAssistantOptions.js @@ -87,11 +87,22 @@ App.RA.options = (function() { } function changeName(name) { - if (name === current_rule.name) { return; } + if (name === current_rule.name) { + return; + } current_rule.name = name; reload(); } + function duplicate() { + const clonedRule = _.cloneDeep(current_rule); + clonedRule.ID = generateNewID(); + clonedRule.name = `Copy of ${clonedRule.name}`; + V.currentRule = clonedRule.ID; + V.defaultRules.push(clonedRule); + reload(); + } + // reload the passage function reload() { saveSettings(); @@ -105,7 +116,7 @@ App.RA.options = (function() { * Save the settings for this rule. */ function saveSettings() { - if(current_rule){ + if (current_rule) { App.RA.Activation.Editor.save(current_rule.condition); } } @@ -1159,9 +1170,11 @@ App.RA.options = (function() { const rule = JSON.parse(text); if (Array.isArray(rule)) { rule.forEach(r => { + r.ID = generateNewID(); V.defaultRules.push(App.Entity.Utils.RARuleDatatypeCleanup(r)); }); } else { + rule.ID = generateNewID(); V.defaultRules.push(App.Entity.Utils.RARuleDatatypeCleanup(rule)); } reload(); @@ -1242,6 +1255,7 @@ App.RA.options = (function() { this.appendChild(new OptionsItem("Lower Priority", lowerPriority)); this.appendChild(new OptionsItem("Higher Priority", higherPriority)); this.appendChild(new OptionsItem("Rename", rename(this))); + this.appendChild(new OptionsItem("Duplicate", duplicate)); this.appendChild(new OptionsItem("Export this rule", () => this.appendChild(new ExportField(current_rule)))); this.appendChild(new OptionsItem("Export all rules", () => this.appendChild(new ExportField(...V.defaultRules)))); this.appendChild(new OptionsItem("Import rule(s)", () => this.appendChild(new NewRuleField())));