From 25dfec5cfb3f14b11bffa41948f9566771a199ca Mon Sep 17 00:00:00 2001 From: Svornost <11434-svornost@users.noreply.gitgud.io> Date: Sun, 23 Feb 2020 15:24:29 -0800 Subject: [PATCH] Swap order of relationship/rivalry and relation. It was built to be easy to change/add/remove elements, so most of this commit is just changing the examples. --- devNotes/Useful JS Function Documentation.txt | 2 +- src/js/relationshipChecks.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/devNotes/Useful JS Function Documentation.txt b/devNotes/Useful JS Function Documentation.txt index e42c5767a48..2afb2f932ab 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 54ec0490609..754618b2dd0 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) ? ", " : " "; } -- GitLab