Skip to content

Commit

Permalink
Merge pull request #13125 from Djjus/dev-wfrp4e-1.72c
Browse files Browse the repository at this point in the history
[Warhammer 4e Character Sheet] Update 1.72c
  • Loading branch information
NorWhal authored Jul 25, 2024
2 parents da015cf + 10b49de commit 1095c5d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
5 changes: 5 additions & 0 deletions Warhammer 4e Character Sheet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ Note conditions are not intended for out of combat situations, GM simply makes t
///// ============ Change Log ============ /////


July 25th 2024 v1.72c

- Critical Damage Rules Houserule 3#: Changed spells RT crit button, will now Default to Elemental table on the drop down menu.


June 28th 2024 v1.72b

- Fix issue with Failed Melee test not showing Dual Wield and Furious Assault text and follow up buttons. They now display irrelevant of roll outcome.
Expand Down
19 changes: 12 additions & 7 deletions Warhammer 4e Character Sheet/Warhammer 4e Character Sheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,8 @@
<input class="hidden" type="textarea" name="attr_RT-trapblade" value="[r](~@{character_name}|strengthroll)" />
<input class="hidden" type="textarea" name="attr_RT-crit" value="[l](~@{character_name}|CriticalTest)" />
<input class="hidden" type="textarea" name="attr_RT-critical" value="[l](~@{character_name}|CriticalRoll)" />
<input class="hidden" type="textarea" name="attr_RT-critcast" value="[l](~@{character_name}|CriticalRollcast)" />
<button type="action" class="hidden" name="act_CriticalRollcast" />
<input class="hidden" type="textarea" name="attr_RT-fumble" value="[l](~@{character_name}|FumbleTest)" />
<input class="hidden" type="textarea" name="attr_RT-minor" value="[J](~@{character_name}|Minor)" />
<input class="hidden" type="textarea" name="attr_RT-major" value="[`](~@{character_name}|Major)" />
Expand Down Expand Up @@ -48038,7 +48040,7 @@

if (skill === "spellcast") {rollDmgPart = '';
if (qspell > 0) {prefix = eventInfo.triggerName.slice(8, -11);} else {prefix = eventInfo.triggerName.slice(8, -10);}}
if (skill === "spellcastdmg") {rollDmgPart = ' {{hitlocation=true}} {{spelldamage=[[@{prefix2-_spelldamage}+@{prefix2-_spelldamagewb}]]}} {{RTcrit=@{RT-critical}}}';
if (skill === "spellcastdmg") {rollDmgPart = ' {{hitlocation=true}} {{spelldamage=[[@{prefix2-_spelldamage}+@{prefix2-_spelldamagewb}]]}} {{RTcrit=@{RT-critcast}}}';
if (qspell > 0) {prefix = eventInfo.triggerName.slice(8, -14);} else {prefix = eventInfo.triggerName.slice(8, -13);}}

prermod = parseInt(v.Quick_Spell_Mod) - (parseInt(v.Quick_Spell_LoreMod)*10);
Expand Down Expand Up @@ -48122,10 +48124,10 @@
if (skill === "spellcastreroll") {rollDmgPart = ' {{reroll=[1](~@{character_name}|prefix2-_spellcastreroll)}}';
var accumod = '@{LastRollAccuExtSL}';
var prefix = eventInfo.triggerName.slice(8, -16);}
if (skill === "spellcastdmg") {rollDmgPart = ' {{hitlocation=true}} {{spelldamage=[[@{prefix2-_spelldamage}+@{prefix2-_spelldamagewb}]]}} {{RTcrit=@{RT-critical}}} {{reroll=[1](~@{character_name}|prefix2-_spellcastdmgreroll)}}';
if (skill === "spellcastdmg") {rollDmgPart = ' {{hitlocation=true}} {{spelldamage=[[@{prefix2-_spelldamage}+@{prefix2-_spelldamagewb}]]}} {{RTcrit=@{RT-critcast}}} {{reroll=[1](~@{character_name}|prefix2-_spellcastdmgreroll)}}';
var accumod = '@{prefix2-_spellchannelsl}';
var prefix = eventInfo.triggerName.slice(8, -13);}
if (skill === "spellcastdmgreroll") {rollDmgPart = ' {{hitlocation=true}} {{spelldamage=[[@{prefix2-_spelldamage}+@{prefix2-_spelldamagewb}]]}} {{RTcrit=@{RT-critical}}} {{reroll=[1](~@{character_name}|prefix2-_spellcastdmgreroll)}}';
if (skill === "spellcastdmgreroll") {rollDmgPart = ' {{hitlocation=true}} {{spelldamage=[[@{prefix2-_spelldamage}+@{prefix2-_spelldamagewb}]]}} {{RTcrit=@{RT-critcast}}} {{reroll=[1](~@{character_name}|prefix2-_spellcastdmgreroll)}}';
var accumod = '@{LastRollAccuExtSL}';
var prefix = eventInfo.triggerName.slice(8, -19);}

Expand Down Expand Up @@ -48445,10 +48447,10 @@
if (skill === "spellcastreroll") {rollDmgPart = ' {{reroll=[1](~@{character_name}|prefix2-_spellcastreroll)}}';
var accumod = '@{LastRollAccuExtSL}';
var prefix = eventInfo.triggerName.slice(8, -16);}
if (skill === "spellcastdmg") {rollDmgPart = ' {{hitlocation=true}} {{spelldamage=[[@{prefix2-_spelldamage}+@{prefix2-_spelldamagewb}]]}} {{RTcrit=@{RT-critical}}} {{reroll=[1](~@{character_name}|prefix2-_spellcastdmgreroll)}}';
if (skill === "spellcastdmg") {rollDmgPart = ' {{hitlocation=true}} {{spelldamage=[[@{prefix2-_spelldamage}+@{prefix2-_spelldamagewb}]]}} {{RTcrit=@{RT-critcast}}} {{reroll=[1](~@{character_name}|prefix2-_spellcastdmgreroll)}}';
var accumod = '@{prefix2-_spellchannelsl}';
var prefix = eventInfo.triggerName.slice(8, -13);}
if (skill === "spellcastdmgreroll") {rollDmgPart = ' {{hitlocation=true}} {{spelldamage=[[@{prefix2-_spelldamage}+@{prefix2-_spelldamagewb}]]}} {{RTcrit=@{RT-critical}}} {{reroll=[1](~@{character_name}|prefix2-_spellcastdmgreroll)}}';
if (skill === "spellcastdmgreroll") {rollDmgPart = ' {{hitlocation=true}} {{spelldamage=[[@{prefix2-_spelldamage}+@{prefix2-_spelldamagewb}]]}} {{RTcrit=@{RT-critcast}}} {{reroll=[1](~@{character_name}|prefix2-_spellcastdmgreroll)}}';
var accumod = '@{LastRollAccuExtSL}';
var prefix = eventInfo.triggerName.slice(8, -19);}

Expand Down Expand Up @@ -49801,16 +49803,19 @@
});
});

on('clicked:criticalroll', (eventInfo) => {
on('clicked:criticalroll clicked:criticalrollcast', (eventInfo) => {
getAttrs(["initiative_houserule", "CritTable"], function(v) {

if (v.CritTable == 2) {roll = '{{table=[[?{Crit Type|Weapon,0|Unarmed,1|Elemental/Magic,2}]]}} {{critlocation=[[?{Choose a Hit Location|Random (1d100),[[1d100]]|Head,1|Right Arm,10|Left Arm,30|Body,46|Right Leg,85|Left Leg,96}]]}} {{critv2=[[(1d100)+?{Crit Roll Modifier|0}]]}}' ;} else {roll = ' {{critlocation=[[?{Choose a Hit Location|Random (1d100),[[1d100]]|Head,1|Right Arm,10|Left Arm,30|Body,46|Right Leg,85|Left Leg,96}]]}} {{critv2=[[(1d100)+?{Crit Roll Modifier|0}]]}}';}
if (v.CritTable == 2) {roll = '{{table=[[>table<]]}} {{critlocation=[[?{Choose a Hit Location|Random (1d100),[[1d100]]|Head,1|Right Arm,10|Left Arm,30|Body,46|Right Leg,85|Left Leg,96}]]}} {{critv2=[[(1d100)+?{Crit Roll Modifier|0}]]}}' ;} else {roll = ' {{critlocation=[[?{Choose a Hit Location|Random (1d100),[[1d100]]|Head,1|Right Arm,10|Left Arm,30|Body,46|Right Leg,85|Left Leg,96}]]}} {{critv2=[[(1d100)+?{Crit Roll Modifier|0}]]}}';}

roll += ' {{unconscious=[[@{UnconsciousMod}]]}} {{title=Critical Roll}} {{character_name=@{character_name}}} {{attacktype=[[0]]}} {{critroll=[[(1d100)+?{Crit Roll Modifier|0}]]}} {{modvalue=[[?{Crit Roll Modifier|0}]]}} {{critdmgbonus=[[@{Talent_StrikeToInjureLvl} [STRIKE TO INJURE]]]}} {{critname=[[0]]}} {{critdisc=[[0]]}} {{critdmg=[[0]]}} {{critname2=[[0]]}} {{critdisc2=[[0]]}} {{critdmg2=[[0]]}}';
var trigger = eventInfo.triggerName.slice(8);
var prefix = trigger.split('_').slice(0,3).join('_') + '_';
let rollBegins = '@{Whisper} &{template:whfrp2e}';
let rollPart = roll;

if (trigger === "criticalroll") {rollPart = roll.replaceAll('>table<', `(?{Crit Type|Weapon,0|Unarmed,1|Elemental/Magic,2})`); console.log("Roll");} else if
(trigger === "criticalrollcast") {rollPart = roll.replaceAll('>table<', `(?{Crit Type|Elemental/Magic,2|Weapon,0|Unarmed,1})`); console.log("RollCast");}

if (v.CritTable == 1) {rollPart += ' {{table=[[0]]}} {{critv2=[[(1d100)+?{Crit Roll Modifier|0}]]}}';}
if (v.CritTable == 0) {rollPart += ' {{table=[[0]]}}';}
Expand Down

0 comments on commit 1095c5d

Please sign in to comment.