updated gurps

Add combat reflex bonus for new active defense.
Update description for combat reflex bonus
This commit is contained in:
Ken
2022-01-13 23:29:29 -08:00
parent 3964065de8
commit d8f3ee7fef
+84 -16
View File
@@ -4378,6 +4378,20 @@
<ul>
<li>Defense table. Fixed display issues with half and quarter damage notes.</li>
<li>Defense table. Added note section next to dodges to indicate encumberance penalty was applied.</li>
<li>Defense table. Combat Reflexes. If adding a brand new defense, Combat Reflexes will be added in, if checked.</li>
<li>
Defense table. Combat Reflexes. Previously when Combat Reflexes was checked, the Reason for Mod was prepended with <i>+1 from combat reflexes. </i>.
This has been updated to use <i>[+1 from combat reflexes]</i>. This will help show that this description was automatically added after checking
Combat Reflexes. Please don't change this description, since it will be removed when unchecking Combat Reflexes, if it's changed, then the description
will not get deleted.
<ul>
<li>If you have already checked Combat Reflexes, simply uncheck then check Combat Reflexes to update the repeating tables.</li>
<li>
Also, be sure to check your final modifiers and description when checking/unchecking Combat Reflexes, especially if you
manually added in Combat Reflexes or if you used the previous version where the description was prepended with <i>+1 from combat reflexes.</i>
</li>
</ul>
</li>
</ul>
<label class="check"><input type="checkbox" name="attr_announcements_hide" value="1">&nbsp;<b><span data-i18n="hide-until-next-update">Hide until next update</span></b></label>
@@ -10562,11 +10576,12 @@ visualize what it will look like in chat.
<span class="checkbox"></span>
<div class="row row-stats">
<div class="cell col0">
<input type="text" name="attr_name" title="Macro table name: repeating_defense. Field name: name" />
<input type="text" name="attr_name" title="Macro: repeating_defense_{$1}_name. $1 = Row number OR the Row ID." />
<input type="hidden" name="attr_new" value="1" />
</div>
<div class="cell col1">
<input type="hidden" name="attr_defense_type" value="0" />
<select name="attr_type" title="Macro table name: repeating_defense. Field name: type">
<select name="attr_type" title="Macro: repeating_defense_{$1}_type. $1 = Row number OR the Row ID.">
<option value="Dodge" data-i18n="option-dodge">Dodge</option>
<option value="Parry" data-i18n="option-parry">Parry</option>
<option value="Unarmed Parry" data-i18n="option-unarmed-parry">Unarmed Parry</option>
@@ -10580,16 +10595,16 @@ visualize what it will look like in chat.
</select>
</div>
<div class="cell col2">
<input type="text" name="attr_info" title="Macro table name: repeating_defense. Field name: info" />
<input type="text" name="attr_info" title="Macro: repeating_defense_{$1}_info. $1 = Row number OR the Row ID." />
</div>
<div class="cell col2">
<input type="number" step="1" value="10" name="attr_skill" title="Macro table name: repeating_defense. Field name: @{skill}" />
<input type="number" step="1" value="10" name="attr_skill" title="Macro: repeating_defense_{$1}_skill. $1 = Row number OR the Row ID." />
</div>
<div class="cell col2">
<input type="number" step="1" value="0" name="attr_skill_mod" title="Macro table name: repeating_defense. Field name: skill_mod" />
<input type="number" step="1" value="0" name="attr_skill_mod" title="Macro: repeating_defense_{$1}_skill_mod. $1 = Row number OR the Row ID." />
</div>
<div class="cell col3">
<input type="text" name="attr_skill_final" value="@{skill} + @{skill_mod}" disabled="disabled" title="Macro table name: repeating_defense. Field name: skill_final" />
<input type="text" name="attr_skill_final" value="@{skill} + @{skill_mod}" disabled="disabled" title="Macro: repeating_defense_{$1}_skill_final. $1 = Row number OR the Row ID." />
</div>
<div class="cell col4">
<button type="roll" value="@{roll}&{template:skillRoll} {{sheetStyle=@{sheetstyle}}} {{type=Defense Roll (@{type})}} {{defenseType=[[@{defense_type}]]}} {{activeDefense=[[1]]}} {{showSuccessLabel=[[1]]}} {{characterName=@{character_name}}} {{skillName=@{name}}} {{rollResult=[[3d6]]}} {{effectiveSkill=[[{@{skill_final} + @{modifier} + @{defense_roll_modifier}, @{defense_roll_max_nine_value} }kl1]]}} {{useModToll=[[@{use_defense_modifier_tool}]]}} {{maxNine=[[@{defense_roll_max_nine}]]}} {{rollModifier=[[@{defense_roll_modifier}]]}} {{rollModifierSummary=@{defense_roll_modifier_summary}}} {{rollTraitSummary=@{defense_roll_trait_summary}}} {{showNotes=[[@{show_notes}]]}} {{notes=@{info_description} @{notes} }} {{useCriticalPlusTen=[[@{use_critical_plus_10}]]}} {{showRawDefenseNotes=[[@{show_raw_defensive_notes}]]}} {{rawSuccessNote=@{raw_success_note}}} {{rawCriticalSuccessNote=@{raw_critical_success_note}}} {{rawFailNote=@{raw_fail_note}}} {{rawCriticalFailNote=@{raw_critical_fail_note}}} {{customSuccessNote=@{defense_success_note}}} {{customCriticalSuccessNote=@{defense_critical_success_note}}} {{customFailNote=@{defense_fail_note}}} {{customCriticalFailNote=@{defense_critical_fail_note}}}" name="roll_vsSL" />
@@ -10723,7 +10738,7 @@ visualize what it will look like in chat.
</span>
</div>
<div class="cell col-input-wide">
<input type="text" name="attr_defense_mod_reason" title="Field name: defense_mod_reason" />
<input type="text" name="attr_defense_mod_reason" title="Macro: repeating_defense_{$1}_defense_mod_reason. $1 = Row number OR the Row ID." />
</div>
</div>
@@ -10770,7 +10785,7 @@ visualize what it will look like in chat.
</span>
</span>
</div>
<textarea name="attr_info_description" title="Macro table name: repeating_defense. Field name: info_description" style="height: 50px"></textarea>
<textarea name="attr_info_description" title="Macro: repeating_defense_{$1}_info_description. $1 = Row number OR the Row ID." style="height: 50px"></textarea>
</div>
<div class="note-input">
@@ -10782,7 +10797,7 @@ visualize what it will look like in chat.
<span data-i18n="custom-notes-active-defense-tooltip">Add custom notes for this active defense.</span>
</span>
</div>
<textarea name="attr_notes" title="Macro table name: repeating_defense. Field name: notes" style="height: 50px"></textarea>
<textarea name="attr_notes" title="Macro: repeating_defense_{$1}_notes. $1 = Row number OR the Row ID." style="height: 50px"></textarea>
</div>
</div>
@@ -10794,7 +10809,7 @@ visualize what it will look like in chat.
<span data-i18n="success-note-label">Success Note:</span>
</div>
<input type="hidden" name="attr_raw_success_note" />
<textarea name="attr_defense_success_note" title="Macro table name: repeating_defense. Field name: defense_success_note"></textarea>
<textarea name="attr_defense_success_note" title="Macro: repeating_defense_{$1}_defense_success_note. $1 = Row number OR the Row ID."></textarea>
</div>
<div class="note-input">
@@ -10802,7 +10817,7 @@ visualize what it will look like in chat.
<span data-i18n="critical-success-note-label">Critical Success Note:</span>
</div>
<input type="hidden" name="attr_raw_critical_success_note" />
<textarea name="attr_defense_critical_success_note" title="Macro table name: repeating_defense. Field name: defense_critical_success_note"></textarea>
<textarea name="attr_defense_critical_success_note" title="Macro: repeating_defense_{$1}_defense_critical_success_note. $1 = Row number OR the Row ID."></textarea>
</div>
</div>
@@ -10814,7 +10829,7 @@ visualize what it will look like in chat.
<span data-i18n="fail-note-label">Fail Note:</span>
</div>
<input type="hidden" name="attr_raw_fail_note" />
<textarea name="attr_defense_fail_note" title="Macro table name: repeating_defense. Field name: defense_fail_note"></textarea>
<textarea name="attr_defense_fail_note" title="Macro: repeating_defense_{$1}_defense_fail_note. $1 = Row number OR the Row ID."></textarea>
</div>
<div class="note-input">
@@ -10822,7 +10837,7 @@ visualize what it will look like in chat.
<span data-i18n="critical-fail-note-label">Critical Fail Note:</span>
</div>
<input type="hidden" name="attr_raw_critical_fail_note" />
<textarea name="attr_defense_critical_fail_note" title="Macro table name: repeating_defense. Field name: defense_critical_fail_note"></textarea>
<textarea name="attr_defense_critical_fail_note" title="Macro: repeating_defense_{$1}_defense_critical_fail_note. $1 = Row number OR the Row ID."></textarea>
</div>
</div>
@@ -13633,6 +13648,20 @@ visualize what it will look like in chat.
<ul>
<li>Defense table. Fixed display issues with half and quarter damage notes.</li>
<li>Defense table. Added note section next to dodges to indicate encumberance penalty was applied.</li>
<li>Defense table. Combat Reflexes. If adding a brand new defense, Combat Reflexes will be added in, if checked.</li>
<li>
Defense table. Combat Reflexes. Previously when Combat Reflexes was checked, the Reason for Mod was prepended with <i>+1 from combat reflexes. </i>.
This has been updated to use <i>[+1 from combat reflexes]</i>. This will help show that this description was automatically added after checking
Combat Reflexes. Please don't change this description, since it will be removed when unchecking Combat Reflexes, if it's changed, then the description
will not get deleted.
<ul>
<li>If you have already checked Combat Reflexes, simply uncheck then check Combat Reflexes to update the repeating tables.</li>
<li>
Also, be sure to check your final modifiers and description when checking/unchecking Combat Reflexes, especially if you
manually added in Combat Reflexes or if you used the previous version where the description was prepended with <i>+1 from combat reflexes.</i>
</li>
</ul>
</li>
</ul>
<h4>Version: 2.7.4</h4>
@@ -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) => {