From f9b49a87f6a0ff9730aae9009be78a1f17faa578 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Wed, 5 Aug 2020 00:41:37 -0400 Subject: [PATCH] remove PCTitle global --- js/003-data/gameVariableData.js | 1 - src/events/reDevotees.js | 3 +- src/npc/generate/slaveGenerationJS.js | 2 +- src/player/js/playerJS.js | 51 ++++++++++++++------------- src/pregmod/managePersonalAffairs.tw | 3 +- src/pregmod/reMaleCitizenHookup.tw | 2 +- src/uncategorized/reCitizenHookup.tw | 2 +- src/uncategorized/reputation.tw | 4 +-- 8 files changed, 32 insertions(+), 36 deletions(-) diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index 08b56ff0ac1..a44211698d5 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -25,7 +25,6 @@ App.Data.defaultGameStateVariables = { freshPC: 0, IsInPrimePC: 3, IsPastPrimePC: 5000, - PCTitle: "", playerAging: 2, // Save diff --git a/src/events/reDevotees.js b/src/events/reDevotees.js index dd997e8f98e..6a5312b8082 100644 --- a/src/events/reDevotees.js +++ b/src/events/reDevotees.js @@ -36,7 +36,6 @@ App.Events.REDevotees = class REDevotees extends App.Events.BaseEvent { ]); function opera() { - PCTitle(); let t = []; t.push(`You reserve a box at an upcoming operetta; classical Italian music is enjoying a renaissance these days. The doormen at the fashionable opera house promptly widen the velvet ropes so that you and your party may proceed unimpeded. Their quick thinking is necessary, since there are five of you walking sedately up the steps: you in the middle, impeccable in`); if (V.PC.title === 1) { @@ -44,7 +43,7 @@ App.Events.REDevotees = class REDevotees extends App.Events.BaseEvent { } else { t.push(`a fine and noble lady's tuxedo;`); } - t.push(`and ${slaveList}, all dressed in the gorgeous fashion of the seventeenth century, all plunging necklines, piled hair, and ruffled petticoats. The splendid master of ceremonies clears his throat and announces in a sonorous voice, "${V.PCTitle}." The ostentation <span class="reputation inc">turns every head and catches every eye.</span>`); + t.push(`and ${slaveList}, all dressed in the gorgeous fashion of the seventeenth century, all plunging necklines, piled hair, and ruffled petticoats. The splendid master of ceremonies clears his throat and announces in a sonorous voice, "${PCTitle()}." The ostentation <span class="reputation inc">turns every head and catches every eye.</span>`); for (const s of devotees) { repX(600, "event", s); } diff --git a/src/npc/generate/slaveGenerationJS.js b/src/npc/generate/slaveGenerationJS.js index 8d33c9caab8..e1e6d496d4c 100644 --- a/src/npc/generate/slaveGenerationJS.js +++ b/src/npc/generate/slaveGenerationJS.js @@ -1454,7 +1454,7 @@ globalThis.checkForGingering = function(slave, market = 0) { if (V.gingeringDetection === "mercenary") { r += `The nervous seller confirms this in response to a direct inquiry. Your intimidating reputation from your <span class="springgreen">extensive combat training</span> has its uses.`; } else if (V.gingeringDetection === "force") { - r += `The nervous seller confirms this in response to a direct inquiry. Your reputation as a <span class="springgreen"> ${V.PCTitle ? "man" : "woman"} of blood</span> has its uses.`; + r += `The nervous seller confirms this in response to a direct inquiry. Your reputation as a <span class="springgreen"> ${PCTitle() ? "man" : "woman"} of blood</span> has its uses.`; } } } /* gingering detected */ diff --git a/src/player/js/playerJS.js b/src/player/js/playerJS.js index bd80ac8d127..52fc84d514d 100644 --- a/src/player/js/playerJS.js +++ b/src/player/js/playerJS.js @@ -43,51 +43,51 @@ globalThis.PlayerName = function() { globalThis.PCTitle = function() { const titles = []; - V.PCTitle = PlayerName(); + let title = PlayerName(); if (V.cheater === 1) { - V.PCTitle = (`${V.PCTitle} the Cheater`); + title = (`${title} the Cheater`); } else if (V.arcologies[0].FSRestart > 10) { - V.PCTitle = (`${V.PCTitle} of the Societal Elite`); + title = (`${title} of the Societal Elite`); } else if (V.rep > 18000) { - V.PCTitle = (`${V.PCTitle} the Great`); + title = (`${title} the Great`); } else if (V.rep > 17000) { - V.PCTitle = (`the exalted ${V.PCTitle}`); + title = (`the exalted ${title}`); } else if (V.rep > 16000) { - V.PCTitle = (`the illustrious ${V.PCTitle}`); + title = (`the illustrious ${title}`); } else if (V.rep > 15000) { - V.PCTitle = (`the prestigious ${V.PCTitle}`); + title = (`the prestigious ${title}`); } else if (V.rep > 14000) { - V.PCTitle = (`the renowned ${V.PCTitle}`); + title = (`the renowned ${title}`); } else if (V.rep > 13000) { - V.PCTitle = (`the famed ${V.PCTitle}`); + title = (`the famed ${title}`); } else if (V.rep > 12000) { - V.PCTitle = (`the celebrated ${V.PCTitle}`); + title = (`the celebrated ${title}`); } else if (V.rep > 11000) { - V.PCTitle = (`the honored ${V.PCTitle}`); + title = (`the honored ${title}`); } else if (V.rep > 10000) { - V.PCTitle = (`the acclaimed ${V.PCTitle}`); + title = (`the acclaimed ${title}`); } else if (V.rep > 9000) { - V.PCTitle = (`the eminent ${V.PCTitle}`); + title = (`the eminent ${title}`); } else if (V.rep > 8250) { - V.PCTitle = (`the prominent ${V.PCTitle}`); + title = (`the prominent ${title}`); } else if (V.rep > 7500) { - V.PCTitle = (`the distinguished ${V.PCTitle}`); + title = (`the distinguished ${title}`); } else if (V.rep > 6750) { - V.PCTitle = (`the admired ${V.PCTitle}`); + title = (`the admired ${title}`); } else if (V.rep > 6000) { - V.PCTitle = (`the esteemed ${V.PCTitle}`); + title = (`the esteemed ${title}`); } else if (V.rep > 5250) { - V.PCTitle = (`the respected ${V.PCTitle}`); + title = (`the respected ${title}`); } else if (V.rep > 4500) { - V.PCTitle = (`the known ${V.PCTitle}`); + title = (`the known ${title}`); } else if (V.rep > 3750) { - V.PCTitle = (`the recognized ${V.PCTitle}`); + title = (`the recognized ${title}`); } else if (V.rep > 3000) { - V.PCTitle = (`the rumored ${V.PCTitle}`); + title = (`the rumored ${title}`); } - V.PCTitle = (`${V.PCTitle}, `); + title = (`${title}, `); if (V.PC.name === "FC Dev") { titles.push("the Creator"); @@ -622,13 +622,14 @@ globalThis.PCTitle = function() { } if (titles.length === 1) { - V.PCTitle += titles[0]; + title += titles[0]; } else if (titles.length === 2) { - V.PCTitle += `${titles[0]} and ${titles[1]}`; + title += `${titles[0]} and ${titles[1]}`; } else { titles[titles.length - 1] = `and ${titles[titles.length - 1]}`; - V.PCTitle += titles.join(", "); + title += titles.join(", "); } + return title; }; /** diff --git a/src/pregmod/managePersonalAffairs.tw b/src/pregmod/managePersonalAffairs.tw index 5fc4806a070..5c63c2215ce 100644 --- a/src/pregmod/managePersonalAffairs.tw +++ b/src/pregmod/managePersonalAffairs.tw @@ -1,7 +1,6 @@ :: Manage Personal Affairs [nobr jump-to-safe jump-from-safe] <<set $nextButton = "Back", $nextLink = "Main", $encyclopedia = "Being in Charge">> -<<run PCTitle()>> <<set _ML = $marrying.length>> @@ -310,7 +309,7 @@ <h3>Name</h3> <p> - On formal occasions, you are announced as $PCTitle. By slaves, however, you prefer to be called <<= properMaster()>>. + On formal occasions, you are announced as <<= PCTitle()>>. By slaves, however, you prefer to be called <<= properMaster()>>. <div> <span id="result"> <<if ndef $PC.customTitle>> diff --git a/src/pregmod/reMaleCitizenHookup.tw b/src/pregmod/reMaleCitizenHookup.tw index 9e8cef1467e..e367400379a 100644 --- a/src/pregmod/reMaleCitizenHookup.tw +++ b/src/pregmod/reMaleCitizenHookup.tw @@ -201,7 +201,7 @@ He's yours for the taking, if you want him, and if his praise and proximity were <<default>> flirt with you quite hard without crossing any lines between a citizen and an arcology owner. <</switch>> -He's clearly attracted to you; even the most consummate actor would have difficulty fooling you, and his breath is a little quick, his pupils are a bit dilated, and he's blushing cutely. But he's no fool, either. A casual liaison with <<run PCTitle()>>$PCTitle would be a tremendous social boost for him. +He's clearly attracted to you; even the most consummate actor would have difficulty fooling you, and his breath is a little quick, his pupils are a bit dilated, and he's blushing cutely. But he's no fool, either. A casual liaison with <<= PCTitle()>> would be a tremendous social boost for him. <br><br> <span id="result"> diff --git a/src/uncategorized/reCitizenHookup.tw b/src/uncategorized/reCitizenHookup.tw index 5d8dd99b878..978e1071a04 100644 --- a/src/uncategorized/reCitizenHookup.tw +++ b/src/uncategorized/reCitizenHookup.tw @@ -222,7 +222,7 @@ She's yours for the taking, if you want her, and if her praise and proximity wer <<default>> flirt with you quite hard without crossing any lines between a citizen and an arcology owner. <</switch>> -She's clearly attracted to you; even the most consummate actress would have difficulty fooling you, and her breath is a little quick, her pupils are a bit dilated, and she's blushing cutely. But she's no fool, either. A casual liaison with <<run PCTitle()>>$PCTitle would be a tremendous social boost for her. +She's clearly attracted to you; even the most consummate actress would have difficulty fooling you, and her breath is a little quick, her pupils are a bit dilated, and she's blushing cutely. But she's no fool, either. A casual liaison with <<= PCTitle()>> would be a tremendous social boost for her. <br><br> <span id="result"> diff --git a/src/uncategorized/reputation.tw b/src/uncategorized/reputation.tw index ef23627c08f..a3293606f3f 100644 --- a/src/uncategorized/reputation.tw +++ b/src/uncategorized/reputation.tw @@ -3,9 +3,7 @@ <<if $useTabs == 0>>__Reputation__<</if>> <br> -<<run PCTitle()>> - -On formal occasions, you are announced as $PCTitle. +On formal occasions, you are announced as <<= PCTitle>>. <<if $arcologies[0].FSChattelReligionist != "unset">> <<if $arcologies[0].FSChattelReligionistCreed == 1>> -- GitLab