diff --git a/src/interaction/rename.js b/src/interaction/rename.js new file mode 100644 index 0000000000000000000000000000000000000000..d6f717a5c4c2865cedbe8c21313f91682f3bd81d --- /dev/null +++ b/src/interaction/rename.js @@ -0,0 +1,151 @@ + +App.UI.SlaveInteract.rename = function(slave, {oldName, oldSurname} = {}) { + const r = []; + if (slave.slaveName === V.oldName && slave.slaveSurname === V.oldSurname) { + Engine.play("Slave Interact"); + } else { + /* First time renaming reaction */ + if (slave.slaveName === "" || !(slave.hasOwnProperty("slaveName"))) { + r.push(`${V.oldName} needs to be called something on the records, so V.oldName ${he} stays.`); + slave.slaveName = V.oldName; + } else if (slave.fetish === "mindbroken") { + r.push(`${slave.slaveName} doesn't even recognize that ${he}'s been renamed.It simply does not register.`); + } else if ((V.oldName !== slave.birthName && slave.slaveName === slave.birthName) || (V.oldSurname !== slave.birthSurname && slave.slaveSurname === slave.birthSurname)) { + r.push(`${slave.slaveName}`); + if (slave.devotion > 50) { + r.push(`cheerfully accepts ${his} old name back.`); + } else if (slave.devotion >= -20) { + r.push(`obediently accepts ${his} old name back.`); + } else if (slave.devotion >= -50) { + r.push(`happily accepts ${his} original name.`); + } else if (slave.trust > 20) { + r.push(`scoffs at the notion that ${he} was ever anything other than ${SlaveFullBirthName(slave)}, <span class="orangered">weakening your control over ${him}.</span>`); + slave.trust += 5; + } else { + r.push(`cautiously accepts the return of ${his} name.`); + } + } else if ((V.oldName === slave.birthName && slave.slaveName !== slave.birthName) || (V.oldSurname === slave.birthSurname && slave.slaveSurname !== slave.birthSurname)) { + r.push(`${slave.slaveName}`); + if (slave.devotion > 50) { + r.push(`accepts ${his} new name cheerfully. This attachment to you <span class="hotpink"> increases ${his} devotion.</span>`); + slave.devotion += 4; + } else if (slave.devotion >= -20) { + r.push(`obediently accepts ${his} new name. This surrender to you <span class="hotpink"> increases ${his} obedience.</span>`); + slave.devotion += 4; + } else if (slave.devotion >= -50) { + r.push(`reluctantly accepts ${his} new name.`); + } else { + r.push(`angrily tries to resist ${his} new name, insisting that ${his} name is ${SlaveFullBirthName(slave)}. This resistance <span class="mediumorchid"> increases ${his} rebelliousness.</span>`); + slave.devotion -= 5; + } + } else { + r.push(`Since ${slave.slaveName} has already had a new name `); + if (slave.devotion > 20) { + r.push(`given to`); + } else { + r.push(`forced on`); + } + r.push(` ${him} before, the mere fact of having it changed again doesn't really affect ${him}.`); + } + + let _insultingName = 0; + if (V.oldName !== slave.slaveName && typeof slave.slaveName === "string") { + let _toSearch = slave.slaveName.toLowerCase(); + for (let i = 0; i < setup.badWords.length; i++) { + if (_toSearch.indexOf(setup.badWords[i]) !== -1) { + _insultingName = 1; + break; + } + } + } + if (!_insultingName) { + if (V.oldSurname !== slave.slaveSurname && typeof slave.slaveSurname === "string") { + let _toSearch = slave.slaveSurname.toLowerCase(); + for (i = 0; i < setup.badWords.length; i++) { + if (_toSearch.indexOf(setup.badWords[i]) !== -1) { + _insultingName = 1; + break; + } + } + } + } + if (_insultingName === 1) { + if (slave.fetish === "mindbroken") { + r.push(`${His} new name would be insulting to a normal ${girl}, but ${he} dully accepts that it is an accurate description and goes about ${his} duties.`); + } else if (slave.devotion < -50) { + r.push(`Being given such a degrading name <span class="mediumorchid">further increases ${his} hatred</span> of you.`); + slave.devotion -= 5; + } else if (slave.devotion <= 50) { + r.push(`Being given such a degrading name <span class="gold">terrifies ${him},</span> since ${he} thinks it's fair warning for what ${he}'ll suffer in the future.`); + slave.trust -= 5; + } + } + + /* Wife's surname reaction */ + if (V.oldSurname !== slave.slaveSurname) { + if (slave.relationship >= 5) { + let _i = V.slaveIndices[slave.relationshipTarget]; + if (!_i) { + r.push(`<span class="red">Error, relationshipTarget not found.</span>`); + } + if (V.slaves[_i].slaveSurname) { + const {wife2} = getPronouns(V.slaves[_i]).appendSuffix('2'); + if (slave.slaveSurname === V.slaves[_i].slaveSurname) { + r.push(`${He}'s touched that ${he} now shares a surname with ${his} ${wife2} ${V.slaves[_i].slaveName} ${V.slaves[_i].slaveSurname}, and is <span class="mediumaquamarine">more confident than ever</span> that you intend to keep them together in marital bliss.`); + slave.trust += 5; + } else if (V.oldSurname === V.slaves[_i].slaveSurname) { + r.push(`${He}'s concerned that ${he} no longer shares a surname with ${his} ${wife2} ${V.slaves[_i].slaveName} ${V.slaves[_i].slaveSurname}, and is <span class="gold">very worried</span> that you might be considering splitting them up.`); + slave.trust -= 5; + } + } + } + } + + /* PC's surname reaction */ + if (V.oldSurname !== slave.slaveSurname) { + if (slave.relationship === -3) { + if (V.PC.slaveSurname) { + if (slave.fetish === "mindbroken") { + r.push(`Names are meaningless to ${him} and it is unlikely ${he}'ll remember it.`); + } else if (slave.devotion + slave.trust >= 175) { + if (slave.slaveSurname === V.PC.slaveSurname) { + r.push(`When you tell ${him} that ${he}'s to be known as ${slave.slaveName} ${slave.slaveSurname} now, ${he} starts to cry. ${He} tries to get ${himself} under control and thank you as best ${he} can, `); + if (hasAnyArms(slave)) { + r.push(`wiping at the tears running down ${his} ${slave.skin} cheeks, `); + } + r.push(`but ${he} can't seem to stop weeping as ${he} thanks you over and over. ${He}'s a sex slave, your property, and it's understandable that some doubts about the permanence of ${his} place as your slave ${wife}. This has <span class="mediumaquamarine">helped reassure ${him},</span> and explains the strength of ${his} emotional reaction. The next time you make love to ${him}, ${he} <span class="hotpink">presses ${himself} as close to you as ${he} can,</span> eager to drink in as much of your presence as ${he} can get.`); + slave.devotion += 5, slave.trust += 5; + } else if (V.oldSurname === V.PC.slaveSurname) { + r.push(`${He}'s devastated that you'd rename ${him} something other than your name. ${He}'s <span class="gold">terrified</span> that you intend to discard ${him} as your slave ${V.wife}, and <span class="mediumorchid">saddened</span> that you would take away something that was precious to ${him}.`); + slave.devotion -= 5, slave.trust -= 5; + } + } else if (slave.devotion < -20 && slave.trust > 20) { + if (slave.slaveSurname === V.PC.slaveSurname) { + r.push(`When you tell ${him} that ${he}'s to be known as ${slave.slaveName} ${slave.slaveSurname} now, ${he} shows no reaction. You already took everything from ${him}, what's a name at this point?`); + } else if (V.oldSurname === V.PC.slaveSurname) { + r.push(`${He} doesn't care about losing your surname at first, but it quickly sets in that ${he} may have <span class="gold">pushed ${his} position too far.</span>`); + slave.trust -= 20; + } + } else if (slave.devotion < -20) { + if (slave.slaveSurname === V.PC.slaveSurname) { + r.push(`When you tell ${him} that ${he}'s to be known as ${slave.slaveName} ${slave.slaveSurname} now, ${he} pleads with you not to steal ${his} name. It matters little to you, and ${he} is forced to <span class="hotpink">accept your will.</span>`); + slave.devotion += 5; + } else if (V.oldSurname === V.PC.slaveSurname) { + r.push(`${He}'s <span class="mediumorchid">happy</span> to no longer have to share a name with ${his} tormentor, but the bliss doesn't last long as <span class="gold">dread</span> quickly sets in about what this may mean.`); + slave.devotion += 5, slave.trust -= 10; + } + } else { + if (slave.slaveSurname === V.PC.slaveSurname) { + r.push(`When you tell ${him} that ${he}'s to be known as ${slave.slaveName} ${slave.slaveSurname} now, ${he} nods with approval feeling <span class="mediumaquamarine">that ${he} may hold at least some value in your eyes.</span>`); + slave.trust += 5; + } else if (V.oldSurname === V.PC.slaveSurname) { + r.push(`${He} accepts that you'd rename ${him} something other than your name. ${He}'s <span class="gold">a little scared</span> that you intend to discard ${him} as your slave ${V.wife}, or worse, but realizes this was not only a possibility, but likely.`); + slave.trust -= 5; + } + } + } + } + } + } + return jQuery("#rename").empty().append(r.join(" ")); +}; diff --git a/src/interaction/slaveInteract.js b/src/interaction/slaveInteract.js index c69d9adbe2cf3e348d7b54882e4d5b8e155d43b7..cd8b348989a78f6158a64ff0d45c6ac4c2c1d586 100644 --- a/src/interaction/slaveInteract.js +++ b/src/interaction/slaveInteract.js @@ -2486,14 +2486,19 @@ App.UI.SlaveInteract.custom = (function() { } function intro(slave) { - V.oldName = slave.slaveName; - V.oldSurname = slave.slaveSurname; - let intro = document.createElement('p'); - intro.className = "scene-intro"; - intro.append(`You may enter custom descriptors for your slave's hair color, hair style, tattoos, or anything else here. After typing, press `); - intro.appendChild(App.UI.DOM.makeElement("kbd", "enter")); - intro.append(` to commit your change. These custom descriptors will appear in descriptions of your slave, but will have no gameplay effect. Changing them is free.`); - return intro; + const frag = new DocumentFragment(); + let p; + p = document.createElement('p'); + p.id = "rename"; + frag.append(p); + + p = document.createElement('p'); + p.className = "scene-p"; + p.append(`You may enter custom descriptors for your slave's hair color, hair style, tattoos, or anything else here. After typing, press `); + p.appendChild(App.UI.DOM.makeElement("kbd", "enter")); + p.append(` to commit your change. These custom descriptors will appear in descriptions of your slave, but will have no gameplay effect. Changing them is free.`); + frag.append(p); + return frag; } function playerTitle(slave) {