diff --git a/src/descriptions/familySummaries.js b/src/descriptions/familySummaries.js index 0db5e98a7e97e0154092c19964dbf3e8a954fb3c..3f3082a8cea168cc284eea94dc82ec663e5baa8e 100644 --- a/src/descriptions/familySummaries.js +++ b/src/descriptions/familySummaries.js @@ -503,7 +503,7 @@ App.Desc.family = (function() { } else if (twins.length > 1) { r.push(`is `, familySpan(`one of a set of triplets; `, slaveListToText(twins, allowLinks)), ` complete the trio.`); } else { - r.push(`is `, familySpan(`twins with `, conditionalSlaveLink(twins[0], allowLinks), `.`), ``); + r.push(`is `, familySpan(`twins with `, conditionalSlaveLink(twins[0], allowLinks), `.`)); } } @@ -513,7 +513,7 @@ App.Desc.family = (function() { if (sisters.length > 1) { r.push(familySpan(slaveListToText(sisters, allowLinks), ` are ${his} ${sister2}s.`)); } else { - r.push(``, familySpan(``, conditionalSlaveLink(sisters[0], allowLinks), ` is ${his} ${sister2}.`), ``); + r.push(familySpan(conditionalSlaveLink(sisters[0], allowLinks), ` is ${his} ${sister2}.`)); } } @@ -523,7 +523,7 @@ App.Desc.family = (function() { if (brothers.length > 1) { r.push(familySpan(slaveListToText(brothers, allowLinks), ` are ${his} ${sister2}s.`)); } else { - r.push(``, familySpan(``, conditionalSlaveLink(brothers[0], allowLinks), ` is ${his} ${sister2}.`), ``); + r.push(familySpan(conditionalSlaveLink(brothers[0], allowLinks), ` is ${his} ${sister2}.`)); } } @@ -533,7 +533,7 @@ App.Desc.family = (function() { if (halfSisters.length > 1) { r.push(familySpan(slaveListToText(halfSisters, allowLinks), ` are half-${sister2}s to ${him}.`)); } else { - r.push(``, familySpan(``, conditionalSlaveLink(halfSisters[0], allowLinks), ` is a half-${sister2} to ${him}.`), ``); + r.push(familySpan(conditionalSlaveLink(halfSisters[0], allowLinks), ` is a half-${sister2} to ${him}.`)); } } @@ -543,7 +543,7 @@ App.Desc.family = (function() { if (halfBrothers.length > 1) { r.push(familySpan(slaveListToText(halfBrothers, allowLinks), ` are half-${sister2}s to ${him}.`)); } else if (halfBrothers.length > 0) { - r.push(``, familySpan(``, conditionalSlaveLink(halfBrothers[0], allowLinks), ` is a half-${sister2} to ${him}.`), ``); + r.push(familySpan(conditionalSlaveLink(halfBrothers[0], allowLinks), ` is a half-${sister2} to ${him}.`)); } } @@ -563,7 +563,7 @@ App.Desc.family = (function() { if (cousins.length > 1) { r.push(familySpan(slaveListToText(cousins, allowLinks), ` are cousins to ${him}.`)); } else if (cousins.length > 0) { - r.push(``, familySpan(``, conditionalSlaveLink(cousins[0], allowLinks), ` is a cousin to ${him}.`), ``); + r.push(familySpan(conditionalSlaveLink(cousins[0], allowLinks), ` is a cousin to ${him}.`)); } } @@ -686,42 +686,42 @@ App.Desc.family = (function() { if (twins.length > 1) { r.push(`<br>You are `, familySpan(`twins with `, slaveListToText(twins, allowLinks), `.`)); } else if (twins.length > 0) { - r.push(`<br>Your twin is `, familySpan(``, conditionalSlaveLink(twins[0], allowLinks), `.`), ``); + r.push(`<br>Your twin is `, familySpan(conditionalSlaveLink(twins[0], allowLinks), `.`)); } if (sisters.length > 1) { r.push(`<br>`, slaveListToText(sisters, allowLinks), ` are your sisters.`); } else if (sisters.length > 0) { const {sister} = getPronouns(sisters[0]); - r.push(`<br>Your ${sister} is `, familySpan(``, conditionalSlaveLink(sisters[0], allowLinks), `.`), ``); + r.push(`<br>Your ${sister} is `, familySpan(conditionalSlaveLink(sisters[0], allowLinks), `.`)); } if (brothers.length > 1) { r.push(`<br>`, slaveListToText(brothers, allowLinks), ` are your brothers.`); } else if (brothers.length > 0) { const {sister} = getPronouns(brothers[0]); - r.push(`<br>Your ${sister} is `, familySpan(``, conditionalSlaveLink(brothers[0], allowLinks), `.`), ``); + r.push(`<br>Your ${sister} is `, familySpan(conditionalSlaveLink(brothers[0], allowLinks), `.`)); } if (halfSisters.length > 1) { r.push(`<br>`, slaveListToText(halfSisters, allowLinks), ` are your half-sisters.`); } else if (halfSisters.length > 0) { const {sister} = getPronouns(halfSisters[0]); - r.push(`<br>You have one half-${sister}, `, familySpan(``, conditionalSlaveLink(halfSisters[0], allowLinks), `.`), ``); + r.push(`<br>You have one half-${sister}, `, familySpan(conditionalSlaveLink(halfSisters[0], allowLinks), `.`)); } if (halfBrothers.length > 1) { r.push(`<br>`, slaveListToText(halfBrothers, allowLinks), ` are your half-brothers.`); } else if (halfBrothers.length > 0) { const {sister} = getPronouns(halfBrothers[0]); - r.push(`<br>You have one half-${sister}, `, familySpan(``, conditionalSlaveLink(halfBrothers[0], allowLinks), `.`), ``); + r.push(`<br>You have one half-${sister}, `, familySpan(conditionalSlaveLink(halfBrothers[0], allowLinks), `.`)); } if (V.showDistantRelatives) { if (cousins.length > 1) { r.push(`<br>`, slaveListToText(cousins, allowLinks), ` are your cousins.`); } else if (cousins.length > 0) { - r.push(`<br>You have one cousin, `, familySpan(``, conditionalSlaveLink(cousins[0], allowLinks), `.`), ``); + r.push(`<br>You have one cousin, `, familySpan(conditionalSlaveLink(cousins[0], allowLinks), `.`)); } } diff --git a/src/events/scheduled/seNicaeaCouncil.js b/src/events/scheduled/seNicaeaCouncil.js index a84db3a84a94f58bed996f0fb317460d7bfd7fdc..5b8af802a69930e7563daf6c7d691a0edb4e60a1 100644 --- a/src/events/scheduled/seNicaeaCouncil.js +++ b/src/events/scheduled/seNicaeaCouncil.js @@ -66,6 +66,7 @@ App.Events.SENicaeaCouncil = class SENicaeaCouncil extends App.Events.BaseEvent r.push(`but the weak Council may lead to a weak creed.`); } App.Events.addParagraph(node, r); + r = []; } const container = App.UI.DOM.appendNewElement("div", node); diff --git a/src/npc/interaction/killSlave.js b/src/npc/interaction/killSlave.js index bcaa62fd172c0213a9abd3ea5ba96d40207f46f3..18d8b209f17ac69fa35faa28d546b15481695112 100644 --- a/src/npc/interaction/killSlave.js +++ b/src/npc/interaction/killSlave.js @@ -439,19 +439,12 @@ App.UI.SlaveInteract.killSlave = function(slave) { } else { const subDiv = document.createElement("div"); - const daughters = []; const mother = getPronouns(slave).mother; - if (arr.length > 2) { - daughters.push(toSentence(arr)); - } else { - daughters.push(`${getSlave(arr[0]).slaveName} and ${getSlave(arr[1]).slaveName}`); - } - arr.forEach(i => getSlave(i).devotion -= 25); App.Events.addParagraph(subDiv, [ - `${His} children, ${daughters}, are <span class="devotion dec">horrified</span> that you would take their ${mother} from them.` + `${His} children, ${toSentence(arr.map(i => getSlave(i).slaveName))}, are <span class="devotion dec">horrified</span> that you would take their ${mother} from them.` ]); return subDiv; @@ -475,29 +468,12 @@ App.UI.SlaveInteract.killSlave = function(slave) { return subDiv; } else { const subDiv = document.createElement("div"); - - const twins = []; - const sister = getPronouns(slave).sister; - if (arr.length > 2) { - let lastTwin = arr.pop(); - - for (const twin of arr) { - twins.push(`${getSlave(twin).slaveName},`); - - getSlave(twin).devotion -= 30; - } - - twins.push(`and ${getSlave(lastTwin).slaveName}`); - } else { - twins.push(`${getSlave(arr[0]).slaveName} and ${getSlave(arr[1]).slaveName}`); - } - arr.forEach(i => getSlave(i).devotion -= 30); App.Events.addParagraph(subDiv, [ - `${His} twins, ${twins.join(' ')} are <span class="devotion dec">devastated</span> that you would take their ${sister} from them.` + `${His} twins, ${toSentence(arr.map(i => getSlave(i).slaveName))} are <span class="devotion dec">devastated</span> that you would take their ${sister} from them.` ]); return subDiv; @@ -522,26 +498,12 @@ App.UI.SlaveInteract.killSlave = function(slave) { } else { const subDiv = document.createElement("div"); - const sisters = []; - const sister = getPronouns(slave).sister; - if (arr.length > 2) { - let lastSister = arr.pop(); - - for (const sister of arr) { - sisters.push(`${getSlave(sister).slaveName},`); - } - - sisters.push(`and ${getSlave(lastSister).slaveName}`); - } else { - sisters.push(`${getSlave(arr[0]).slaveName} and ${getSlave(arr[1]).slaveName}`); - } - arr.forEach(i => getSlave(i).devotion -= 25); App.Events.addParagraph(subDiv, [ - `${His} sister, ${sisters.join(' ')} are <span class="devotion dec">grief-stricken</span> that you would take their ${sister} from them.` + `${His} sisters, ${toSentence(arr.map(i => getSlave(i).slaveName))} are <span class="devotion dec">grief-stricken</span> that you would take their ${sister} from them.` ]); return subDiv; @@ -566,26 +528,12 @@ App.UI.SlaveInteract.killSlave = function(slave) { } else { const subDiv = document.createElement("div"); - const halfSisters = []; - const sister = getPronouns(slave).sister; - if (arr.length > 2) { - let lastHalfSister = arr.pop(); - - for (const sister of arr) { - halfSisters.push(`${getSlave(sister).slaveName},`); - } - - halfSisters.push(`and ${getSlave(lastHalfSister).slaveName}`); - } else { - halfSisters.push(`${getSlave(arr[0]).slaveName} and ${getSlave(arr[1]).slaveName}`); - } - arr.forEach(i => getSlave(i).devotion -= 20); App.Events.addParagraph(subDiv, [ - `${His} half-sisters, ${halfSisters.join(' ')}, are <span class="devotion dec">saddened</span> that you would take their ${sister} from them.` + `${His} half-sisters, ${toSentence(arr.map(i => getSlave(i).slaveName))}, are <span class="devotion dec">saddened</span> that you would take their ${sister} from them.` ]); return subDiv; @@ -593,11 +541,10 @@ App.UI.SlaveInteract.killSlave = function(slave) { } function getRelationshipEffects(ID) { - if (getSlave(ID).fetish !== "mindbroken") { + const target = getSlave(ID); + if (target.fetish !== "mindbroken") { const subDiv = document.createElement("div"); - const target = getSlave(ID); - App.Events.addParagraph(subDiv, [ `${target.slaveName} is <span class="devotion dec">grief-stricken</span> that you have killed ${getPronouns(target).his} best source of comfort and companionship in a life of bondage.` ]);