diff --git a/devNotes/Useful JS Function Documentation.txt b/devNotes/Useful JS Function Documentation.txt index e42c5767a488d8498aceb5965356fb54c3115448..2afb2f932ab210dcade087d8199f6cca23bd4a0e 100644 --- a/devNotes/Useful JS Function Documentation.txt +++ b/devNotes/Useful JS Function Documentation.txt @@ -180,7 +180,7 @@ relationshipChecks [script] All work as expected with <<if X.rivalryTarget == $s Would print '$He loves being your wife.' contextualIntro(context, actor, insertComma=false) - Introduces an actor by using any meaningful relationship(s) with an already on-screen actor, and their name. - Returns strings like: "your husband John", "his mother and growing rival Alice", or "her twin sister and best friend Carla". + Returns strings like: "your husband John", "his growing rival and mother Alice", or "her best friend and twin sister Carla". If there is no known relationship between them, retuns the name alone. If insertComma is true, it will generate "her father, Dave" instead of "her father Dave". Use this function instead of just printing the slave's name when you'd like to let the player to know if two actors are related, even though it's not going to have any mechanical impact on the scene. diff --git a/src/js/relationshipChecks.js b/src/js/relationshipChecks.js index 54ec0490609a6fda550fc3d049053e67de59dfe2..754618b2dd0a69e210a1c86193907bc859b11c30 100644 --- a/src/js/relationshipChecks.js +++ b/src/js/relationshipChecks.js @@ -62,7 +62,7 @@ window.PCrelationshipTerm = function(id) { /** * Introduces an actor by using any meaningful relationship(s) with an already on-screen actor, and their name. - * Returns strings like: "your husband John", "his mother and growing rival Alice", or "her twin sister and best friend Carla". + * Returns strings like: "your husband John", "his growing rival and mother Alice", or "her best friend and twin sister Carla". * If there is no known relationship between them, retuns the name alone. * Use this function instead of just printing the slave's name when you'd like to let the player to know if two actors are related, * even though it's not going to have any mechanical impact on the scene. @@ -81,11 +81,6 @@ window.contextualIntro = function(context, actor, insertComma=false) { return s; }; - const _relative = relativeTerm(context, actor); - if (_relative) { - r += preamble() + _relative; - } - if (context.relationship > 0 && context.relationshipTarget === actor.ID) { r += preamble() + relationshipTerm(context); } else if (context === V.PC && actor.relationship < -1) { @@ -96,6 +91,11 @@ window.contextualIntro = function(context, actor, insertComma=false) { r += preamble() + rivalryTerm(context); } + const _relative = relativeTerm(context, actor); + if (_relative) { + r += preamble() + _relative; + } + if (r !== ``) { r += (insertComma || actor === V.PC) ? ", " : " "; }