diff --git a/devNotes/twine JS.txt b/devNotes/twine JS.txt index f262fa23b97e6464e4b73081aa7e3a1596815fce..3fbd0cb38772e11a7c9e6474e4b2ec56e4fc5e76 100644 --- a/devNotes/twine JS.txt +++ b/devNotes/twine JS.txt @@ -31575,6 +31575,20 @@ window.nationalityToRace = function nationalityToRace(slave) { slave.race = hashChoice(setup.raceSelector[slave.nationality] || setup.raceSelector[""]); }; +window.raceToNationality = function raceToNationality(slave) { + /* consider this placeholder until raceNationalities gets fixed up */ + const V = State.variables; + slave.nationality = hashChoice(V.nationalities); + /* Maximum of 100 attempts */ + for (var i = 0; setup.raceSelector[slave.nationality] && !(slave.race in setup.raceSelector[slave.nationality]) && i < 100; i++) { + slave.nationality = hashChoice(V.nationalities); + } + /* No success after 100 attempts, so just randomize according to race */ + if (setup.raceSelector[slave.nationality] && !(slave.race in setup.raceSelector[slave.nationality]) && i == 100) { + slave.nationality = hashChoice(setup[slave.race.toLowerCase().replace(/[ -]/g, '')+'Nationalities']); + } +}; + window.generateName = function generateName(nationality, race, male, filter) { filter = filter || _.stubTrue; /* default: allow all */ const lookup = (male ? setup.malenamePoolSelector : setup.namePoolSelector); @@ -31777,7 +31791,13 @@ window.nationalityToAccent = function nationalityToAccent(slave) { slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 1, 2]) : naturalAccent; break; case "Bosnian": - slave.accent = naturalAccent; + if (V.language === "Croatian") { + slave.accent = jsEither([0, 1, 1, 1, 1, 2]); + } else if (V.language === "Serbian") { + slave.accent = jsEither([0, 1, 1, 1, 1, 2]); + } else { + slave.accent = naturalAccent; + } break; case "Brazilian": slave.accent = (V.language === "Portuguese") ? jsEither([0, 1, 1, 1, 1, 2]) : naturalAccent; @@ -31891,7 +31911,13 @@ window.nationalityToAccent = function nationalityToAccent(slave) { slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 1, 2]) : naturalAccent; break; case "Croatian": - slave.accent = naturalAccent; + if (V.language === "Bosnian") { + slave.accent = jsEither([0, 1, 1, 1, 1, 2]); + } else if (V.language === "Serbian") { + slave.accent = jsEither([0, 1, 1, 1, 1, 2]); + } else { + slave.accent = naturalAccent; + } break; case "Cuban": slave.accent = (V.language === "Spanish") ? jsEither([0, 1, 1, 1, 1, 2]) : naturalAccent; @@ -32234,7 +32260,9 @@ window.nationalityToAccent = function nationalityToAccent(slave) { slave.accent = naturalAccent; break; case "Luxembourgian": - if (V.language === "German") { + if (V.language === "Luxembourgish") { + slave.accent = jsEither([0, 0, 0, 0, 0, 0, 1]); + } else if (V.language === "German") { slave.accent = jsEither([0, 1, 1, 1, 1, 2]); } else if (V.language === "French") { slave.accent = jsEither([0, 1, 1, 1, 1, 2]); @@ -32246,10 +32274,22 @@ window.nationalityToAccent = function nationalityToAccent(slave) { slave.accent = naturalAccent; break; case "Malagasy": - slave.accent = naturalAccent; + if (V.language === "French") { + slave.accent = jsEither([0, 1, 1, 1, 1, 2]); + } else if (V.language === "English") { + slave.accent = jsEither([0, 1, 2, 2, 2, 3, 3]); + } else { + slave.accent = naturalAccent; + } break; case "Malawian": - slave.accent = naturalAccent; + if (V.language === "English") { + slave.accent = jsEither([0, 1, 1, 1, 1, 2]); + } else if (V.language === "Chichewa") { + slave.accent = jsEither([0, 0, 0, 0, 0, 0, 1]); + } else { + slave.accent = naturalAccent; + } break; case "Malaysian": slave.accent = (V.language === "Malay") ? jsEither([0, 0, 0, 0, 0, 0, 1]) : naturalAccent; @@ -32488,7 +32528,13 @@ window.nationalityToAccent = function nationalityToAccent(slave) { slave.accent = (V.language === "French") ? jsEither([0, 1, 1, 1, 1, 2]) : naturalAccent; break; case "Serbian": - slave.accent = naturalAccent; + if (V.language === "Bosnian") { + slave.accent = jsEither([0, 1, 1, 1, 1, 2]); + } else if (V.language === "Serbian") { + slave.accent = jsEither([0, 1, 1, 1, 1, 2]); + } else { + slave.accent = naturalAccent; + } break; case "Seychellois": if (V.language === "French") { diff --git a/src/facilities/nursery/longChildDescription.tw b/src/facilities/nursery/longChildDescription.tw index c78360913b5f68cbfb04f96a094c841b68cfe0dd..2e083f4cbbd4c163c6ed6fe92fc205211f25a3a8 100644 --- a/src/facilities/nursery/longChildDescription.tw +++ b/src/facilities/nursery/longChildDescription.tw @@ -105,17 +105,17 @@ is <</if>> <<if $activeSlave.birthName !== "" || $activeSlave.birthSurname !== "">> <<if $activeSlave.devotion > 95>> - $he adores $his slave name and affects to have forgotten that $he was ever called + $He adores $his slave name and affects to have forgotten that $he was ever called <<elseif $activeSlave.devotion > 50>> - $he uses $his slave name automatically and gives no sign that $he was ever called + $He uses $his slave name automatically and gives no sign that $he was ever called <<elseif $activeSlave.devotion > 20>> - $he uses $his slave name despite once being known as + $He uses $his slave name despite once being known as <<elseif $activeSlave.devotion >= -20>> - $he uses $his slave name hesitantly since $he was once called + $He uses $his slave name hesitantly since $he was once called <<elseif $activeSlave.devotion >= -50>> - $he uses $his slave name with resentment since $he prefers $his original name, + $He uses $his slave name with resentment since $he prefers $his original name, <<else>> - $he uses $his slave name only when constantly punished, since $he feels $his real name is + $He uses $his slave name only when constantly punished, since $he feels $his real name is <</if>> <<if $activeSlave.birthName === "">> $activeSlave.birthSurname. diff --git a/src/js/slaveGenerationJS.tw b/src/js/slaveGenerationJS.tw index e33945d90b64ea8e737b4d1449658bd1c99b5ee3..2443056b4c2fabc9064e126fdbe6ec0579b74852 100644 --- a/src/js/slaveGenerationJS.tw +++ b/src/js/slaveGenerationJS.tw @@ -14,7 +14,7 @@ window.raceToNationality = function raceToNationality(slave) { } /* No success after 100 attempts, so just randomize according to race */ if (setup.raceSelector[slave.nationality] && !(slave.race in setup.raceSelector[slave.nationality]) && i == 100) { - slave.nationality = Object.keys(setup[slave.race.toLowerCase().replace(/[ -]/g, '')+'Nationalities']).random(); + slave.nationality = hashChoice(setup[slave.race.toLowerCase().replace(/[ -]/g, '')+'Nationalities']); } }; diff --git a/src/uncategorized/longSlaveDescription.tw b/src/uncategorized/longSlaveDescription.tw index 01e8c40d62ecfb321107c21997777d1f50bd0bc7..c55eb2c2d72610f3c2bbca67b148083d25089836 100644 --- a/src/uncategorized/longSlaveDescription.tw +++ b/src/uncategorized/longSlaveDescription.tw @@ -328,17 +328,17 @@ is <</if>> <<if $activeSlave.birthName !== "" || $activeSlave.birthSurname !== "">> <<if $activeSlave.devotion > 95>> - $he adores $his slave name and affects to have forgotten that $he was ever called + $He adores $his slave name and affects to have forgotten that $he was ever called <<elseif $activeSlave.devotion > 50>> - $he uses $his slave name automatically and gives no sign that $he was ever called + $He uses $his slave name automatically and gives no sign that $he was ever called <<elseif $activeSlave.devotion > 20>> - $he uses $his slave name despite once being known as + $He uses $his slave name despite once being known as <<elseif $activeSlave.devotion >= -20>> - $he uses $his slave name hesitantly since $he was once called + $He uses $his slave name hesitantly since $he was once called <<elseif $activeSlave.devotion >= -50>> - $he uses $his slave name with resentment since $he prefers $his original name, + $He uses $his slave name with resentment since $he prefers $his original name, <<else>> - $he uses $his slave name only when constantly punished, since $he feels $his real name is + $He uses $his slave name only when constantly punished, since $he feels $his real name is <</if>> <<if $activeSlave.birthName === "">> $activeSlave.birthSurname. diff --git a/src/uncategorized/remoteSurgery.tw b/src/uncategorized/remoteSurgery.tw index 6324f4503ced6cfddbc3b985436c712de403bb81..205335989d71ecd0f00e947f16e5086a6bfded40 100644 --- a/src/uncategorized/remoteSurgery.tw +++ b/src/uncategorized/remoteSurgery.tw @@ -1701,7 +1701,7 @@ Work on $him structurally: $He is no longer in $his native body. <</if>> <<if $activeSlave.indenture == -1>> - [[Swap " + $his + " body with another of your stock|Slave Slave Swap Workaround]] + [["Swap " + $his + " body with another of your stock"|Slave Slave Swap Workaround]] <<else>> //Indentured servants must remain in their own bodies.// <</if>>