diff --git a/src/npc/descriptions/describeBrands.js b/src/npc/descriptions/describeBrands.js index 6ffaaddc6607e90ac77bf07060eb67d9ea3f28c7..d9226091bc6d376b970de8f9ba1ff08106f8936f 100644 --- a/src/npc/descriptions/describeBrands.js +++ b/src/npc/descriptions/describeBrands.js @@ -37,26 +37,29 @@ App.Desc.brand = function(slave, surface) { function desc(part) { const surface = App.Desc.oppositeSides(part); - if (slave.brand[surface.center]) { // center defined, body part has no mirror. - return `${slave.brand[surface.center]} branded into the flesh of ${his} ${surface.center}`; + const centerBrand = slave.brand[surface.center] ? pronounsForSlaveProp(slave, slave.brand[surface.center]) : undefined; + const leftBrand = slave.brand[surface.left] ? pronounsForSlaveProp(slave, slave.brand[surface.left]) : undefined; + const rightBrand = slave.brand[surface.right] ? pronounsForSlaveProp(slave, slave.brand[surface.right]) : undefined; + if (centerBrand) { // center defined, body part has no mirror. + return `${centerBrand} branded into the flesh of ${his} ${surface.center}`; } else { // Center not defined, body part has a mirror. - if (!slave.brand[surface.left] && !slave.brand[surface.right]) { + if (!leftBrand && !rightBrand) { return; // no marks - } else if (part.startsWith("right ") && slave.brand[surface.left]) { + } else if (part.startsWith("right ") && leftBrand) { return; // we already described it on the left - } else if (slave.brand[surface.left] === slave.brand[surface.right]) { + } else if (leftBrand === rightBrand) { // matching places and marks // note that the slave.brand object won't have slave.brand["upper armS"] with an S defined, just the left and right, so we just use the left since we know they match. - return `${slave.brand[surface.left]} branded into the flesh of both ${his} ${surface.both}`; - } else if (slave.brand[surface.left] && slave.brand[surface.right]) { + return `${leftBrand} branded into the flesh of both ${his} ${surface.both}`; + } else if (leftBrand && rightBrand) { // matching places but different marks - return `both ${slave.brand[surface.left]} branded into the flesh of ${his} ${surface.left}, and ${slave.brand[surface.right]} branded into ${his} ${surface.right}`; - } else if (slave.brand[surface.left]) { + return `both ${leftBrand} branded into the flesh of ${his} ${surface.left}, and ${rightBrand} branded into ${his} ${surface.right}`; + } else if (leftBrand) { // left - return `${slave.brand[surface.left]} branded into the flesh of ${his} ${surface.left}`; - } else if (slave.brand[surface.right]) { + return `${leftBrand} branded into the flesh of ${his} ${surface.left}`; + } else if (rightBrand) { // right - return `${slave.brand[surface.right]} branded into the flesh of ${his} ${surface.right}`; + return `${rightBrand} branded into the flesh of ${his} ${surface.right}`; } } }