diff --git a/src/js/rulesAssistant.js b/src/js/rulesAssistant.js index 855c872d11ccae5328f3620951666c7f5d0b3324..df9badcf3b0fe6d141eff1e2c4dd7bf373fe3334 100644 --- a/src/js/rulesAssistant.js +++ b/src/js/rulesAssistant.js @@ -200,8 +200,20 @@ window.ruleAppliesP = function ruleAppliesP(cond, slave) { flag = false; break; case "between": // between two values of a slave's attribute + let slaveAttribute = slave[cond.data.attribute]; + if (slaveAttribute === undefined && cond.data.attribute.includes(".")) { + slaveAttribute = cond.data.attribute + .split(".") + .reduce( + (reduceSlave, attribute) => + (reduceSlave && reduceSlave[attribute] !== undefined) + ? reduceSlave[attribute] + : undefined, + slave + ); + } flag = between( - slave[cond.data.attribute], + slaveAttribute, cond.data.value[0], cond.data.value[1]); break; diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js index 1af018ebdafa0fd2c380d901e30e824ea78b137f..32d58812fad17797e762699bb7170379911dcf4c 100644 --- a/src/js/rulesAssistantOptions.js +++ b/src/js/rulesAssistantOptions.js @@ -1133,7 +1133,7 @@ window.rulesAssistantOptions = (function() { ["Custom", "custom"], ["Devotion", "devotion"], ["Trust", "trust"], - ["Health", "health.health"], + ["Health", "health.condition"], ["Sex", "genes"], ["Sex drive", "energy"], ["Height", "height"], @@ -1180,7 +1180,7 @@ window.rulesAssistantOptions = (function() { return [ "devotion", "trust", - "health.health", + "health.condition", "energy", "height", "weight", @@ -1344,7 +1344,7 @@ window.rulesAssistantOptions = (function() { return ({ "devotion": "Very Hateful: (-∞, -95), Hateful: [-95, -50), Resistant: [-50, -20), Ambivalent: [-20, 20], Accepting: (20, 50], Devoted: (50, 95], Worshipful: (95, ∞)", "trust": "Extremely terrified: (-∞, -95), Terrified: [-95, -50), Frightened: [-50, -20), Fearful: [-20, 20], Careful: (20, 50], Trusting: (50, 95], Total trust: (95, ∞)", - "health.health": "Death: (-∞, -100), Near Death: [-100, -90), Extremely Unhealthy: [-90, -50), Unhealthy: [-50, -20), Healthy: [-20, 20], Very Healthy: (20, 50], Extremely Healthy: (50, 90], Unnaturally Healthy: (90, ∞)", + "health.condition": "Death: (-∞, -100), Near Death: [-100, -90), Extremely Unhealthy: [-90, -50), Unhealthy: [-50, -20), Healthy: [-20, 20], Very Healthy: (20, 50], Extremely Healthy: (50, 90], Unnaturally Healthy: (90, ∞)", "energy": "Frigid: (-∞, 20], Poor: (20, 40], Average: (40, 60], Powerful: (60, 80], Sex Addict: (80, 100), Nympho: 100", "weight": "Emaciated: (-∞, -95), Skinny: [-95, -30), Thin: [-30, -10), Average: [-10, 10], Plush: (10, 30], Fat: (30, 95], Overweight: (95, ∞)", "lactation": "None: 0, 1: Natural, 2: Lactation implant",