diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js index 865c8a92f9bbfbfe63a3c97d26e883f3968b0440..eee279a64b79f0d95ec9e9399c1b7eef12a4f12c 100644 --- a/src/js/DefaultRules.js +++ b/src/js/DefaultRules.js @@ -31,6 +31,7 @@ window.DefaultRules = (function() { ProcessDildos(slave, rule); ProcessDickAccessories(slave, rule); ProcessAnalAccessories(slave, rule); + ProcessChastity(slave, rule); ProcessShoes(slave, rule); ProcessBellyAccessories(slave, rule); ProcessLegAccessory(slave, rule); @@ -756,6 +757,45 @@ window.DefaultRules = (function() { } } + /** @param {App.Entity.SlaveState} slave */ + function ProcessChastity(slave, rule) { + // apply chastity to slave + if ((rule.chastityVagina !== undefined) && (rule.chastityVagina !== "no default setting")) { + if (slave.vagina > -1) { + if ((slave.chastityVagina !== rule.chastityVagina)) { + slave.chastityVagina = rule.chastityVagina; + if (rule.chastityVagina === 1) { + r += `<br>${slave.slaveName} has been given a chastity belt to wear.`; + } else { + r += `<br>${slave.slaveName}'s vaginal chastity has been removed.`; + } + } + } + } + if ((rule.chastityPenis !== undefined) && (rule.chastityPenis !== "no default setting")) { + if (slave.dick > 0) { + if ((slave.chastityPenis !== rule.chastityPenis)) { + slave.chastityPenis = rule.chastityPenis; + if (rule.chastityPenis === 1) { + r += `<br>${slave.slaveName} has been given a chastity cage to wear.`; + } else { + r += `<br>${slave.slaveName}'s chastity cage has been removed.`; + } + } + } + } + if ((rule.chastityAnus !== undefined) && (rule.chastityAnus !== "no default setting")) { + if ((slave.chastityAnus !== rule.chastityAnus)) { + slave.chastityAnus = rule.chastityAnus; + if (rule.chastityAnus === 1) { + r += `<br>${slave.slaveName} has been given anal chastity to wear.`; + } else { + r += `<br>${slave.slaveName}'s anal chastity has been removed.`; + } + } + } + } + /** @param {App.Entity.SlaveState} slave */ function ProcessShoes(slave, rule) { // apply shoes to slave diff --git a/src/js/rulesAssistant.js b/src/js/rulesAssistant.js index 9566b01f61a7b23d2869694cfeed7a72ddcc295f..403795f53396981dd0d2a258686b31c1b5e030f8 100644 --- a/src/js/rulesAssistant.js +++ b/src/js/rulesAssistant.js @@ -217,6 +217,9 @@ window.emptyDefaultRule = function emptyDefaultRule() { collar: "no default setting", shoes: "no default setting", legAccessory: "no default setting", + chastityVagina: "no default setting", + chastityAnus: "no default setting", + chastityPenis: "no default setting", virginAccessory: "no default setting", aVirginAccessory: "no default setting", vaginalAccessory: "no default setting", diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js index 56c6c9526f84e7fdf489add8944026b07aa92551..b9794392eb1f70ff7e613eabbb96892e075f0502 100644 --- a/src/js/rulesAssistantOptions.js +++ b/src/js/rulesAssistantOptions.js @@ -914,13 +914,16 @@ window.rulesAssistantOptions = (function() { this.appendChild(new ShoeList()); this.appendChild(new CorsetList()); this.appendChild(new LeggingsList()); + this.appendChild(new VagChastityList()); this.appendChild(new VagAccVirginsList()); this.appendChild(new VagAccAVirginsList()); this.appendChild(new VagAccOtherList()); if (V.seeDicks !== 0 || V.makeDicks !== 0) { + this.appendChild(new DickChastityList()); this.appendChild(new DickAccVirginsList()); this.appendChild(new DickAccOtherList()); } + this.appendChild(new AnalChastityList()); this.appendChild(new ButtplugsVirginsList()); this.appendChild(new ButtplugsOtherList()); this.appendChild(new ButtplugAttachmentsList()); @@ -1292,6 +1295,19 @@ window.rulesAssistantOptions = (function() { } } + class VagChastityList extends List { + constructor() { + const chaste = [ + ["no default setting", "no default setting"], + ["none", 0], + ["chastity", 1], + ]; + super("Vaginal chastity", chaste); + this.setValue(current_rule.set.chastityVagina); + this.onchange = (value) => current_rule.set.chastityVagina = value; + } + } + class VagAccVirginsList extends List { constructor() { const accs = []; @@ -1337,6 +1353,19 @@ window.rulesAssistantOptions = (function() { } } + class DickChastityList extends List { + constructor() { + const items = [ + ["no default setting", "no default setting"], + ["none", 0], + ["chastity cage", 1], + ]; + super("Penile chastity", items); + this.setValue(current_rule.set.chastityPenis); + this.onchange = (value) => current_rule.set.chastityPenis = value; + } + } + class DickAccVirginsList extends List { constructor() { super("Dick accessories for anal virgins", setup.dickAccessories.map(i => [i.name, i.value])); @@ -1353,6 +1382,19 @@ window.rulesAssistantOptions = (function() { } } + class AnalChastityList extends List { + constructor() { + const items = [ + ["no default setting", "no default setting"], + ["none", 0], + ["chastity", 1], + ]; + super("Anal chastity", items); + this.setValue(current_rule.set.chastityAnus); + this.onchange = (value) => current_rule.set.chastityAnus = value; + } + } + class ButtplugsVirginsList extends List { constructor() { const accs = [];