From 8ad27c709e1630ba26bb51d23064663e16ba7d27 Mon Sep 17 00:00:00 2001 From: lowercase-donkey <lowercasedonkey@gmail.com> Date: Wed, 29 May 2019 15:03:42 -0400 Subject: [PATCH] restored both to ra and handle it correctly --- src/js/DefaultRules.js | 56 ++++++++++++++++++++++++++++----- src/js/rulesAssistantOptions.js | 43 +++++++++++++++++-------- 2 files changed, 78 insertions(+), 21 deletions(-) diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js index 71f4dc5377c..347f52cb00a 100644 --- a/src/js/DefaultRules.js +++ b/src/js/DefaultRules.js @@ -2802,16 +2802,56 @@ window.DefaultRules = (function() { } } if ((rule.autoBrand === 1)) { - if ((slave.brand === 0)) { + if (jQuery.isEmptyObject(slave.brand)) { if ((slave.health > -20)) { - slave.brand = V.brandDesign.RA; - slave.brandLocation = V.brandTarget.RA; - if ((slave.devotion < 18)) { - slave.devotion -= 5; + if (["ankles", "calves", "feet", "hands", "lower arms", "shoulders", "upper arms", "wrists", "cheeks", "ears"].includes(V.brandTarget.RA)) { + let left; + let right; + if (V.brandTarget.RA === "ankles") { + left = "left ankle"; + right = "right ankle"; + } else if (V.brandTarget.RA === "calves") { + left = "left calf"; + right = "right calf"; + } else if (V.brandTarget.RA === "feet") { + left = "left foot"; + right = "right foot"; + } else if (V.brandTarget.RA === "hands") { + left = "left hand"; + right = "right hand"; + } else if (V.brandTarget.RA === "lower arms") { + left = "left lower arm"; + right = "right lower arm"; + } else if (V.brandTarget.RA === "upper arms") { + left = "left upper arm"; + right = "right upper arm"; + } else if (V.brandTarget.RA === "wrists") { + left = "left wrist"; + right = "right wrist"; + } else if (V.brandTarget.RA === "cheeks") { + left = "left cheek"; + right = "right cheek"; + } else if (V.brandTarget.RA === "ears") { + left = "left ear"; + right = "right ear"; + } + slave.brand[left] = V.brandDesign.RA; + slave.brand[right] = V.brandDesign.RA; + if ((slave.devotion < 18)) { + slave.devotion -= 10; + } + slave.trust -= 10; + slave.health -= 20; + r += `<br>${slave.slaveName} has been branded on both ${V.brandTarget.RA}, with <span class="gold">fear</span>${slave.devotion < 18 ? `, <span class="mediumorchid">regard,</span>` : ``} and <span class="red">health</span> consequences.`; + } else { + slave.brand[V.brandTarget.RA] = V.brandDesign.RA; + if ((slave.devotion < 18)) { + slave.devotion -= 5; + } + slave.trust -= 5; + slave.health -= 10; + r += `<br>${slave.slaveName} has been branded, with <span class="gold">fear</span>${slave.devotion < 18 ? `, <span class="mediumorchid">regard,</span>` : ``} and <span class="red">health</span> consequences.`; } - slave.trust -= 5; - slave.health -= 10; - r += `<br>${slave.slaveName} has been branded, with <span class="gold">fear</span>${slave.devotion < 18 ? `, <span class="mediumorchid">regard,</span>` : ``} and <span class="red">health</span> consequences.`; } } } diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js index fb46ccad104..d6031d7c899 100644 --- a/src/js/rulesAssistantOptions.js +++ b/src/js/rulesAssistantOptions.js @@ -2981,82 +2981,99 @@ window.rulesAssistantOptions = (function() { // Head const cheeks = new ListSubSection(this, "Cheeks", [ ["Left", "left cheek"], - ["Right", "right cheek"] + ["Right", "right cheek"], + ["Both", "cheeks"] ]); this.appendChild(cheeks); const ears = new ListSubSection(this, "Ears", [ ["Left", "left ear"], - ["Right", "right ear"] + ["Right", "right ear"], + ["Both", "ears"] + ]); this.appendChild(ears); // Torso const breasts = new ListSubSection(this, "Breasts", [ ["Left", "left breast"], - ["Right", "right breast"] + ["Right", "right breast"], + ["Both", "breasts"] + ]); this.appendChild(breasts); // Arms const shoulders = new ListSubSection(this, "Shoulders", [ ["Left", "left shoulder"], - ["Right", "right shoulder"] + ["Right", "right shoulder"], + ["Both", "shoulders"] + ]); this.appendChild(shoulders); const upper_arms = new ListSubSection(this, "Arms, upper", [ ["Left", "left upper arm"], - ["Right", "right upper arm"] + ["Right", "right upper arm"], + ["Both", "upper arms"] + ]); this.appendChild(upper_arms); const lower_arms = new ListSubSection(this, "Arms, lower", [ ["Left", "left lower arm"], - ["Right", "right lower arm"] + ["Right", "right lower arm"], + ["Both", "lower arms"] ]); this.appendChild(lower_arms); const wrist = new ListSubSection(this, "Wrist", [ ["Left", "left wrist"], - ["Right", "right wrist"] + ["Right", "right wrist"], + ["Both", "wrists"] ]); this.appendChild(wrist); const hand = new ListSubSection(this, "Hand", [ ["Left", "left hand"], - ["Right", "right hand"] + ["Right", "right hand"], + ["Both", "hands"] ]); this.appendChild(hand); // Legs const buttocks = new ListSubSection(this, "Buttocks", [ ["Left", "left buttock"], - ["Right", "right buttock"] + ["Right", "right buttock"], + ["Both", "buttocks"] ]); this.appendChild(buttocks); const thigh = new ListSubSection(this, "Thigh", [ ["Left", "left thigh"], - ["Right", "right thigh"] + ["Right", "right thigh"], + ["Both", "thighs"] ]); this.appendChild(thigh); const calf = new ListSubSection(this, "Calf", [ ["Left", "left calf"], - ["Right", "right calf"] + ["Right", "right calf"], + ["Both", "calves"] ]); this.appendChild(calf); const ankle = new ListSubSection(this, "Ankle", [ ["Left", "left ankle"], - ["Right", "right ankle"] + ["Right", "right ankle"], + ["Both", "ankles"] ]); this.appendChild(ankle); const feet = new ListSubSection(this, "Feet", [ ["Left", "left foot"], - ["Right", "right foot"] + ["Right", "right foot"], + ["Both", "feet"] ]); this.appendChild(feet); -- GitLab