Skip to content
Snippets Groups Projects
Commit b7236e4d authored by lowercasedonkey's avatar lowercasedonkey
Browse files

incorporate pronounsForSlaveProp

parent bbc583f2
No related branches found
No related tags found
No related merge requests found
......@@ -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}`;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment