diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js index 7a549a27da9d2bab0c5ffbded1dfdf8f0e8ea6bd..a9ea412c1350a322ea78a534724943870f3d878c 100644 --- a/src/js/DefaultRules.js +++ b/src/js/DefaultRules.js @@ -2852,12 +2852,12 @@ window.DefaultRules = (function() { if ((rule.autoBrand === 1)) { if ((slave.health > -20)) { if (slave.earShape === "none" && rule.brandTarget !== "ears") { + let brandPlace = ""; // Brand location needs to be split into a left and right if (["ankles", "calves", "feet", "hands", "lower arms", "shoulders", "upper arms", "wrists", "cheeks", "ears", "buttocks", "breasts"].includes(rule.brandTarget)) { let left; let right; - let brandPlace = ""; if (rule.brandTarget === "ankles") { left = "left ankle"; right = "right ankle"; @@ -2940,31 +2940,6 @@ window.DefaultRules = (function() { } } - // Apply brands: - if (["left", "right"].includes(brandPlace)) { - if (slave.devotion < 18) { - slave.devotion -= 5; - } - slave.trust -= 5; - slave.health -= 10; - if (brandPlace === "left") { - slave.brand[left] = rule.brandDesign; - r += `<br>${slave.slaveName} has been branded on the ${left}, with <span class="gold">fear</span>${slave.devotion < 18 ? `, <span class="mediumorchid">regard,</span>` : ``} and <span class="red">health</span> consequences. Their ${right} already had this brand.`; - } else if (brandPlace === "right") { - slave.brand[right] = rule.brandDesign; - r += `<br>${slave.slaveName} has been branded on the ${right}, with <span class="gold">fear</span>${slave.devotion < 18 ? `, <span class="mediumorchid">regard,</span>` : ``} and <span class="red">health</span> consequences. Their ${left} already had this brand.`; - } - } else if (brandPlace === "both") { - slave.brand[left] = rule.brandDesign; - slave.brand[right] = rule.brandDesign; - if ((slave.devotion < 18)) { - slave.devotion -= 10; - } - slave.trust -= 10; - slave.health -= 20; - r += `<br>${slave.slaveName} has been branded on both ${rule.brandTarget}, with <span class="gold">fear</span>${slave.devotion < 18 ? `, <span class="mediumorchid">regard,</span>` : ``} and <span class="red">health</span> consequences.`; - } - // Brand location does NOT need to be split into a left and right, (and may or may not contain left OR right already.) } else if (slave.brand[rule.brandTarget] !== rule.brandDesign) { if ( @@ -2973,16 +2948,40 @@ window.DefaultRules = (function() { (!hasLimb(slave, "left leg") && ["left thigh", "left calf", "left ankle", "left foot"].includes(rule.brandTarget)) || (!hasLimb(slave, "right leg") && ["right thigh", "right calf", "right ankle", "rightfoot"].includes(rule.brandTarget)) ) { - // no brand needed due to amp. + brandPlace = ""; } else { + brandPlace = "anywhere"; + } + } + + // Apply brands: + if (["left", "right", "anywhere"].includes(brandPlace)) { + if (slave.devotion < 18) { + slave.devotion -= 5; + } + slave.trust -= 5; + slave.health -= 10; + r += `<br>${slave.slaveName} has been branded on the `; + if (brandPlace === "left") { + slave.brand[left] = rule.brandDesign; + r += `${left}`; + } else if (brandPlace === "right") { + slave.brand[right] = rule.brandDesign; + r += `${right}`; + } else if (brandPlace === "anywhere") { slave.brand[rule.brandTarget] = rule.brandDesign; - 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.`; + r += `${rule.brandTarget}`; } + r += `, with <span class="gold">fear</span>${slave.devotion < 18 ? `, <span class="mediumorchid">regard,</span>` : ``} and <span class="red">health</span> consequences.`; + } else if (brandPlace === "both") { + slave.brand[left] = rule.brandDesign; + slave.brand[right] = rule.brandDesign; + if ((slave.devotion < 18)) { + slave.devotion -= 10; + } + slave.trust -= 10; + slave.health -= 20; + r += `<br>${slave.slaveName} has been branded on both ${rule.brandTarget}, with <span class="gold">fear</span>${slave.devotion < 18 ? `, <span class="mediumorchid">regard,</span>` : ``} and <span class="red">health</span> consequences.`; } } }