diff --git a/src/js/assayJS.js b/src/js/assayJS.js index 3e4d868891266afe5e50cb12e934b676bbea274f..7a2ca939872fce77d319f4dfd7ec7a8dbab96a87 100644 --- a/src/js/assayJS.js +++ b/src/js/assayJS.js @@ -410,6 +410,15 @@ globalThis.getNonlocalPronouns = function(dickRatio) { return getPronouns(slave); }; +/** Get the origin for a given slave, with the correct pronouns. + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +globalThis.getSlaveOrigins = function(slave) { + const pronouns = getPronouns(slave); + return slave.origin.replace(/\$([A-Z]?[a-z]+)/g, (match, cap1) => pronouns[cap1] || match); +}; + /** Get the written title for a given slave, without messing with global state. * @param {App.Entity.SlaveState} slave * @returns {string} diff --git a/src/npc/descriptions/longSlave.js b/src/npc/descriptions/longSlave.js index 48ad254048e37fac86aa71e5cc95c2a348ed617f..bd2be1610781afaa893821ec4abfda1da4a26638 100644 --- a/src/npc/descriptions/longSlave.js +++ b/src/npc/descriptions/longSlave.js @@ -169,7 +169,7 @@ App.Desc.longSlave = function({slave = V.activeSlave, saleDescription = V.saleDe if (saleDescription === 0) { if (slave.origin !== 0) { - r.push(`${slave.origin}`); + r.push(getSlaveOrigins(slave)); } }