diff --git a/GURPS/gurps.html b/GURPS/gurps.html index 81d7b8f679..c24eb5fac2 100644 --- a/GURPS/gurps.html +++ b/GURPS/gurps.html @@ -4378,6 +4378,20 @@ @@ -10562,11 +10576,12 @@ visualize what it will look like in chat.
- + +
- @@ -10580,16 +10595,16 @@ visualize what it will look like in chat.
- +
- +
- +
- +
- +
@@ -10770,7 +10785,7 @@ visualize what it will look like in chat. - +
@@ -10782,7 +10797,7 @@ visualize what it will look like in chat. Add custom notes for this active defense.
- + @@ -10794,7 +10809,7 @@ visualize what it will look like in chat. Success Note: - +
@@ -10802,7 +10817,7 @@ visualize what it will look like in chat. Critical Success Note:
- + @@ -10814,7 +10829,7 @@ visualize what it will look like in chat. Fail Note: - +
@@ -10822,7 +10837,7 @@ visualize what it will look like in chat. Critical Fail Note:
- + @@ -13633,6 +13648,20 @@ visualize what it will look like in chat.

Version: 2.7.4

@@ -19010,10 +19039,10 @@ visualize what it will look like in chat. const useCombatReflexes = values.combat_reflexes === "1"; // this is needed to check if the sheet has never used the new repeating defenses modifier for combat reflexes - // we DON'T to subtract values if it's new + // we DON'T want to subtract values if it's new const applyToModifierColumnIsNew = values.apply_combat_reflexes_to_mod_is_new === "1"; - const combatReflexesDescription = "+1 from combat reflexes. "; + const combatReflexesDescription = "[+1 from combat reflexes]"; getSectionIDs("repeating_defense", ids => { @@ -19043,7 +19072,7 @@ visualize what it will look like in chat. activeDefenseModifier = 1; // add combat reflexes description - newModifierDescription = combatReflexesDescription + currentModifierDescription; + newModifierDescription = combatReflexesDescription + " " + currentModifierDescription; } else if (applyToModifierColumnIsNew) { @@ -24047,6 +24076,45 @@ visualize what it will look like in chat. // Active Defense Methods //------------------------------------ + // check for new repeating defense, if new check to add combat reflexes modifier + on("change:repeating_defense:name", event => { + + getAttrs(["repeating_defense_new", "repeating_defense_skill_mod", "repeating_defense_defense_mod_reason", "combat_reflexes"], values => { + + const isNew = values.repeating_defense_new === "1"; + + const addCombatReflexes = values.combat_reflexes === "1"; + + const combatReflexesDescription = "[+1 from combat reflexes]"; + + const currentDescription = String(values.repeating_defense_defense_mod_reason); + + let currentMod = Number(values.repeating_defense_skill_mod); + + if (Number.isNaN(currentMod)) { + currentMod = 0; + } + + if (isNew && addCombatReflexes) { + + const newMod = currentMod + 1; + + const newDescription = `${combatReflexesDescription} ${currentDescription}`; + + fields = { + repeating_defense_skill_mod: newMod, + repeating_defense_defense_mod_reason: newDescription, + repeating_defense_new: 0 + }; + + setAttrs(fields); + + } + + }); + + }); + // check if an repeating active defense type changed // update raw success/fail notes based on selected defense Type on("change:repeating_defense:type", (event) => {