From 3d8bd9a02477456754e64ae1ea52c22948888fea Mon Sep 17 00:00:00 2001 From: Ken Date: Tue, 15 Mar 2022 22:38:22 -0700 Subject: [PATCH] update gurps ctive Defenses. Added the option to Dodge or Current Dodge as a link type. --- GURPS/gurps.css | 14 ++++++++++++ GURPS/gurps.html | 50 +++++++++++++++++++++++++++++++++++------- GURPS/translation.json | 3 +++ 3 files changed, 59 insertions(+), 8 deletions(-) diff --git a/GURPS/gurps.css b/GURPS/gurps.css index 2b92fd7189..2916753a39 100644 --- a/GURPS/gurps.css +++ b/GURPS/gurps.css @@ -2781,6 +2781,20 @@ input.sheet-box-techniques-new[value="0"] + div.sheet-techniques-revised { display: block; } +.sheet-active-defense .repcontainer .repitem .sheet-notebox input[name="attr_defense_row_type"][value="DODGE"] ~ .sheet-active-defense-formula .sheet-formula-as-is, +.sheet-active-defense .repcontainer .repitem .sheet-notebox input[name="attr_defense_row_type"][value="CURRENT_DODGE"] ~ .sheet-active-defense-formula .sheet-formula-as-is + { + display: none!important; +} + +.sheet-active-defense .repcontainer .repitem .sheet-notebox input[name="attr_defense_row_type"][value="DODGE"] ~ .sheet-active-defense-formula .sheet-formula-base-dodge { + display: block; +} + +.sheet-active-defense .repcontainer .repitem .sheet-notebox input[name="attr_defense_row_type"][value="CURRENT_DODGE"] ~ .sheet-active-defense-formula .sheet-formula-current-dodge { + display: block; +} + .sheet-active-defense .repcontainer .repitem .sheet-notebox input[name="attr_type"][value="Parry"] ~ .sheet-active-defense-formula .sheet-formula-parry, .sheet-active-defense .repcontainer .repitem .sheet-notebox input[name="attr_type"][value="Unarmed Parry"] ~ .sheet-active-defense-formula .sheet-formula-parry { display: block; diff --git a/GURPS/gurps.html b/GURPS/gurps.html index c21dc372ce..0ad5d79952 100644 --- a/GURPS/gurps.html +++ b/GURPS/gurps.html @@ -4371,6 +4371,9 @@ Active Defenses. When adding a brand new active defense, the Combat Reflexes bonus is now applied to the final base skill instead of adding a modifier bonus. Missed feature when converting Combat Reflexes in Version 2.7.8. +
  • + Active Defenses. Added the option to Dodge or Current Dodge as a link type. +
  • @@ -10610,6 +10613,7 @@ visualize what it will look like in chat.
    +
    Combat Reflexes: @@ -10673,6 +10683,8 @@ visualize what it will look like in chat. + +
    @@ -13662,6 +13674,9 @@ visualize what it will look like in chat. Active Defenses. When adding a brand new active defense, the Combat Reflexes bonus is now applied to the final base skill instead of adding a modifier bonus. Missed feature when converting Combat Reflexes in Version 2.7.8. +
  • + Active Defenses. Added the option to Dodge or Current Dodge as a link type. +
  • Version: 2.7.8

    @@ -23252,11 +23267,13 @@ visualize what it will look like in chat. // check if combat reflex was applied to active defense. on("change:repeating_defense:defense_combat_reflexes", event => { - getAttrs(["repeating_defense_defense_combat_reflexes"], values => { + getAttrs(["repeating_defense_defense_combat_reflexes", "repeating_defense_defense_row_type"], values => { - const useReflexes = values.repeating_defense_defense_combat_reflexes === "1"; + const isDodge = values.repeating_defense_defense_row_type == "DODGE" || values.repeating_defense_defense_row_type == "CURRENT_DODGE"; - const reflexBonus = useReflexes ? 1 : 0; + const useReflexes = values.repeating_defense_defense_combat_reflexes === "1" && isDodge === false; + + const reflexBonus = useReflexes ? "1" : "0"; setAttrs({ repeating_defense_defense_combat_reflexes_bonus: reflexBonus @@ -23463,6 +23480,10 @@ visualize what it will look like in chat. method = "attribute"; break; + case "CURRENT_DODGE": + method = "attribute"; + break; + case "SPEED": method = "attribute"; break; @@ -23637,6 +23658,10 @@ visualize what it will look like in chat. fieldName = "dodge"; break; + case "CURRENT_DODGE": + fieldName = "current_dodge"; + break; + case "10": default: fieldName = "base_attribute_level"; @@ -23680,7 +23705,16 @@ visualize what it will look like in chat. updateFields["repeating_defense_defense_formula_level"] = calculatedSkillLevel; updateFields["repeating_defense_skill"] = calculatedSkillLevel; - + + // if dodge or current dodge is selected as the skill link make sure to turn OFF combat reflexes + if (rowType === "DODGE" || rowType === "CURRENT_DODGE") { + + updateFields["repeating_defense_defense_combat_reflexes"] = ""; + + updateFields["repeating_defense_defense_combat_reflexes_bonus"] = "0"; + + } + } setAttrs(updateFields, { silent: true }); @@ -24439,7 +24473,7 @@ visualize what it will look like in chat. if (isNew) { - let checked = "0"; + let checked = ""; let bonus = 0; @@ -24447,12 +24481,12 @@ visualize what it will look like in chat. checked = "1"; - bonus = 1; + bonus = "1"; } const fields = { - defense_combat_reflexes: checked, - defense_combat_reflexes_bonus: bonus, + repeating_defense_defense_combat_reflexes: checked, + repeating_defense_defense_combat_reflexes_bonus: bonus, repeating_defense_new: 0 }; diff --git a/GURPS/translation.json b/GURPS/translation.json index dc073eac7a..a470357926 100644 --- a/GURPS/translation.json +++ b/GURPS/translation.json @@ -858,8 +858,11 @@ "power-parry-description": "3 + (Innate Attack Skill + Talent)/2, rounded down.", "power-block-physical-description": "3 + (HT + Talent)/2, rounded down.", "power-block-mental-description": "3 + (WILL + Talent)/2, rounded down.", + "formula-base-dodge-description": "Base Dodge attribute affected by Combat Reflexes.", + "formula-current-dodge-description": "Current Dodge affected by Combat Reflexes, HP, FP, and Encumbrance.", "option-melee-weapon": "Melee Weapon", "option-basic-speed": "Basic Speed", + "option-current-dodge": "Current Dodge", "talent-level-label": "Talent Level:", "formula-level-label": "Formula Level:", "abbreviation-information-notes": "INFO Notes",