added weary rolls for adversaries + additional roll-template for custom messages

This commit is contained in:
Bodo Hüsemann
2022-02-13 22:19:56 +01:00
parent b64badf9aa
commit c7b02fc24a
3 changed files with 111 additions and 123 deletions
+8 -1
View File
@@ -6,9 +6,16 @@ This is a rewrite based on the early 2e (basic) and 1e edition that also include
## 02.04.00 (Build 7)
### New Features
- adversary sheet and rolls include weary modifier
- new roll-template to denote non-roll messages. Format &{template:msg} {{header=Generic Header}} {{sub1=Subheadline1}} {{sub2=Subheadline2}} {{msg=This is a test}}
### Sheet fixes
- fixed common bonus dice not tied to stance anymore
- fixed common bonus dice pick up stance bonus
- fixed targeted adversary attack rolls don't pickup target's stance in bonus dice query
- set default favourill to "normal" for new characters and adversaries
### CSS fixes
+30 -48
View File
@@ -1,27 +1,4 @@
@import url('https://fonts.googleapis.com/css2?family=Uncial+Antiqua&display=swap');
/*
import url('https://fonts.cdnfonts.com/css/aniron');
@font-face {
font-family: 'AnorinFace';
src: url('https://fonts.cdnfonts.com/css/aniron');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'NanumSquareRound';
src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_two@1.0/NanumSquareRound.woff') format('woff');
font-weight: normal;
font-style: normal;
}
@font-face {font-family: "AnironOwf";
src: url("//db.onlinewebfonts.com/t/767cb11dc1ee01154718463adc3a1d1e.eot");
src: url("//db.onlinewebfonts.com/t/767cb11dc1ee01154718463adc3a1d1e.eot?#iefix") format("embedded-opentype"),
url("//db.onlinewebfonts.com/t/767cb11dc1ee01154718463adc3a1d1e.woff2") format("woff2"),
url("//db.onlinewebfonts.com/t/767cb11dc1ee01154718463adc3a1d1e.woff") format("woff"),
url("//db.onlinewebfonts.com/t/767cb11dc1ee01154718463adc3a1d1e.ttf") format("truetype"),
url("//db.onlinewebfonts.com/t/767cb11dc1ee01154718463adc3a1d1e.svg#Aniron") format("svg");
}
*/
/* reset all
.ui-dialog .charsheet select,
.ui-dialog .charsheet textarea,
@@ -37,7 +14,8 @@ import url('https://fonts.cdnfonts.com/css/aniron');
font-weight: normal;
}
.charsheet,
.sheet-rolltemplate-tor {
.sheet-rolltemplate-tor,
.sheet-rolltemplate-msg {
/* Define CSS variables */
--red: rgb(176, 33, 30);
--gray: rgb(65, 64, 64);
@@ -873,20 +851,22 @@ import url('https://fonts.cdnfonts.com/css/aniron');
}
/* Roll Template */
.sheet-rolltemplate-tor {
margin-left: -37px;
.sheet-rolltemplate-tor,
.sheet-rolltemplate-msg {
margin-left: -7px;
padding-top: 10px;
background: transparent;
}
.sheet-rolltemplate-tor div,
.sheet-rolltemplate-tor span {
.sheet-rolltemplate-msg div,
.sheet-rolltemplate-tor span,
.sheet-rolltemplate-msg span {
font-family: Papyrus, 'Book Antiqua', Palatino, serif, sans-serif;
font-weight: bold;
font-size: 13px;
}
.sheet-rolltemplate-tor {
margin-left: -7px;
}
.sheet-rolltemplate-tor .sheet-container {
.sheet-rolltemplate-tor .sheet-container,
.sheet-rolltemplate-msg .sheet-container {
background: var(--background);
background-color: var(--yellow);
border: 5px solid transparent;
@@ -898,22 +878,30 @@ import url('https://fonts.cdnfonts.com/css/aniron');
border-top: 1px solid #000;
height: 205px;
}
.sheet-rolltemplate-msg .sheet-contentmin {
border-top: 1px solid #000;
padding-top: 10px;
height: min-content;
}
.sheet-rolltemplate-tor .sheet-red,
.sheet-rolltemplate-tor .sheet-red span {
color: black;
}
/* Header formatting - title and subtitle */
.sheet-rolltemplate-tor .sheet-header {
.sheet-rolltemplate-tor .sheet-header,
.sheet-rolltemplate-msg .sheet-header {
/* change text-align to center to center the header text */
text-align: left;
color: black;
padding: 5px;
}
.sheet-rolltemplate-tor .sheet-footer {
.sheet-rolltemplate-tor .sheet-footer,
.sheet-rolltemplate-msg .sheet-footer {
padding: 5px;
margin-top: -5px;
}
.sheet-rolltemplate-tor .sheet-title {
.sheet-rolltemplate-tor .sheet-title,
.sheet-rolltemplate-msg .sheet-title {
font-family: 'Uncial Antiqua', "Palatino Linotype", "Book Antiqua", Palatino, serif, sans-serif;
font-weight: lighter;
line-height: 1;
@@ -921,20 +909,18 @@ import url('https://fonts.cdnfonts.com/css/aniron');
font-size: medium;
line-height: 25px;
}
.sheet-rolltemplate-tor .sheet-subtitle {
.sheet-rolltemplate-tor .sheet-subtitle,
.sheet-rolltemplate-msg .sheet-subtitle {
font-size: 13px;
}
.sheet-rolltemplate-tor .sheet-subtitle2 {
font-size: 13px;
}
.sheet-rolltemplate-tor span,
.sheet-rolltemplate-tor div {
font-size: 13px;
}
.sheet-rolltemplate-tor .sheet-text-center {
.sheet-rolltemplate-tor .sheet-text-center,
.sheet-rolltemplate-msg .sheet-text-center {
text-align: center;
}
.sheet-rolltemplate-tor .sheet-center {
.sheet-rolltemplate-tor .sheet-center,
.sheet-rolltemplate-msg .sheet-center {
display: inline-flex;
box-sizing: border-box;
flex-wrap: nowrap;
@@ -969,19 +955,15 @@ import url('https://fonts.cdnfonts.com/css/aniron');
border: 4px solid transparent;
background-color: var(--yellow);
border-image-source: var(--borderbrown);
/*border-image-source: url('https://raw.githubusercontent.com/bhuesemann/roll20-character-sheets/tor2e_02-00-00/The%20One%20Ring%202e/images/box-border-brown-rttd.png');*/
/*border-image-source: url('https://raw.githubusercontent.com/roll20/roll20-character-sheets/master/The%20One%20Ring%202e/images/box-border-brown-rttd.png');*/
border-image-slice: 24 24 24 24;
border-image-repeat: repeat;
width: 30px;
height: 30px;
transform: rotate(45deg);
/*transform: rotate(45deg);*/
}
.sheet-rolltemplate-tor div.sheet-die-result span.sheet-rotated-box span {
background-color: var(--yellow);
transform: rotate(-45deg);
/*transform: rotate(-45deg);*/
border: 0;
}
.sheet-rolltemplate-tor .sheet-die-title.sheet-target-number {
+73 -74
View File
@@ -1,4 +1,4 @@
<input type="hidden" name="attr_version" value="02-03-00" />
<input type="hidden" name="attr_version" value="02-04-00" />
<input type="hidden" class="sheet-tabstoggle" name="attr_sheetTab" />
<input type="checkbox" name="attr_parsedrolls" value="1" class="hidden config-parsed-rolls" checked="checked" hidden
readonly />
@@ -260,11 +260,6 @@
<button type='roll' name='roll_axes_target' class="parsed-rolls crosshair"
value='@{axes_target_action}'
title="Use this button when you have an adversary token to target."></button>
<!-- remove if stable
<button type="action" name="act_axes" id="roll_axes" class="parsed-rolls"
title="Use this button when you have a Parry Rating that you can enter manually."></button>
<button type="action" name="act_axes_target" id="roll_axes_target" class="parsed-rolls crosshair"
title="Use this button when you have an adversary token to target. "></button>-->
</span>
&nbsp;
<label data-i18n="axes">Axes</label>
@@ -296,11 +291,6 @@
<button type='roll' name='roll_bows_target' class="parsed-rolls crosshair"
value='@{bows_target_action}'
title="Use this button when you have an adversary token to target."></button>
<!-- remove if stable
<button type="action" name="act_bows" id="roll_bows" class="parsed-rolls"
title="Use this button when you have a Parry Rating that you can enter manually."></button>
<button type="action" name="act_bows_target" id="roll_bows_target" class="parsed-rolls crosshair"
title="Use this button when you have an adversary token to target. "></button>-->
</span>
&nbsp;
<label data-i18n="bows">Bows</label>
@@ -333,12 +323,6 @@
<button type='roll' name='roll_spears_target' class="parsed-rolls crosshair"
value='@{spears_target_action}'
title="Use this button when you have an adversary token to target."></button>
<!-- remove if stable
<button type="action" name="act_spears" id="roll_spears" class="parsed-rolls"
title="Use this button when you have a Parry Rating that you can enter manually."></button>
<button type="action" name="act_spears_target" id="roll_spears_target"
class="parsed-rolls crosshair"
title="Use this button when you have an adversary token to target. "></button>-->
</span>
&nbsp;
<label data-i18n="spears">Spears</label>
@@ -371,12 +355,6 @@
<button type='roll' name='roll_swords_target' class="parsed-rolls crosshair"
value='@{swords_target_action}'
title="Use this button when you have an adversary token to target."></button>
<!--remove if stable
<button type="action" name="act_swords" id="roll_swords" class="parsed-rolls"
title="Use this button when you have a Parry Rating that you can enter manually."></button>
<button type="action" name="act_swords_target" id="roll_swords_target"
class="parsed-rolls crosshair"
title="Use this button when you have an adversary token to target. "></button>-->
</span>
&nbsp;
<label data-i18n="swords">Swords</label>
@@ -972,6 +950,8 @@
<label><input name="attr_favorill" type="checkbox" value="{2t[feat]}kh1">Favoured</label>
<label><input name="attr_favorill" type="checkbox" value="{2t[feat]}kl1">Ill Fav.</label>
</span>
<br />
<label><input name="attr_weary" type="checkbox" value=1>Weary</label>
</div>
</div>
<div class="adversary-attributes">
@@ -1009,7 +989,7 @@
<span />
<span />
<button type="roll" class="table-rolls"
value="/me rolls protection against ?{Injury|16}.\n/roll 1t[lm-feat] + @{armourprot}t[normal]"
value="/me rolls protection against ?{Injury|16}.\n/roll 1t[lm-feat] + @{armourprot}t[@{wearytype}]"
name="armourcheck"></button>
<input type='hidden' name='attr_protection_action' value=''>
@@ -1025,11 +1005,10 @@
<label class="center" data-i18n-title="weapon-injury" title="inj">Injury</label>
<label class="left" data-i18n-title="special-damage" title="special-damage">Special damage</label>
<span>
<button type="roll" class="table-rolls"
value="/me attacks against parry ?{Parry|0}.\n/roll 1t[lm-feat] + [[(@{weapon_rating_1}+?{Bonus Dice|0})]]t[normal]"
name="roll_weapon1"></button>
<button type="roll" class="table-rolls crosshair"
value="/me attacks @{target|name} against parry @{target|totalparry}.\n/roll 1t[lm-feat] + [[(@{weapon_rating_1}+?{Bonus Dice|0}+@{target|stanceattackbonus})]]t[normal]"
<input type="hidden" name="attr_adv_weapon1_roll1" value="" />
<button type="roll" class="table-rolls" value="@{adv_weapon1_roll1}" name="roll_weapon1"></button>
<input type="hidden" name="attr_adv_weapon1_roll2" value="" />
<button type="roll" class="table-rolls crosshair" value="@{adv_weapon1_roll2}"
name="roll_weapon1_target"></button>
<span class="parsed-rolls">
<input type='hidden' name='attr_adv_weapon1_action' value=''>
@@ -1042,12 +1021,6 @@
<button type='roll' name='roll_adv_weapon1_target' class="parsed-rolls crosshair"
value='@{adv_weapon1_target_action}'
title="Use this button when you have an player token to target."></button>
<!-- remove if stable
<button type="action" name="act_adv_weapon1" id="roll_adv_weapon1" class="parsed-rolls"
title="Use this button when you have a Parry Rating that you can enter manually."></button>
<button type="action" name="act_adv_weapon1_target" id="roll_adv_weapon1_target"
class="parsed-rolls crosshair"
title="Use this button when you have an adversary token to target. "></button>-->
</span>
<input name="attr_weapon_skill_name_1" type="text">
</span>
@@ -1056,16 +1029,10 @@
<input name="attr_weapon_injury_1" value="0" class="number" type="number">
<input name="attr_weapon_special_damage_1" type="text">
<span>
<!--<input type="hidden" name="attr_adv_weapon2_roll1" />
<button type="roll" class="table-rolls" name="roll_adv_weapon2_roll1_check" value="@{adv_adv_weapon2_roll1}"></button> -->
<button type="roll" class="table-rolls"
value="/me attacks against parry ?{Parry|0}.\n/roll 1t[lm-feat] + [[(@{weapon_rating_2}+?{Bonus Dice|0})]]t[normal]"
name="roll_weapon2"></button>
<!--<input type="hidden" name="attr_adv_weapon2_roll2" />
<button type="roll" class="table-rolls crosshair" name="roll_adv_weapon2_roll2_check"
value="@{adv_weapon2_roll2}"></button>-->
<button type="roll" class="table-rolls crosshair"
value="/me attacks @{target|name} against parry @{target|totalparry}.\n/roll 1t[lm-feat] + [[(@{weapon_rating_2}+?{Bonus Dice|0}+@{target|stanceattackbonus})]]t[normal]"
<input type="hidden" name="attr_adv_weapon2_roll1" value="" />
<button type="roll" class="table-rolls" value="@{adv_weapon2_roll1}" name="roll_weapon2"></button>
<input type="hidden" name="attr_adv_weapon2_roll2" value="" />
<button type="roll" class="table-rolls crosshair" value="@{adv_weapon2_roll2}"
name="roll_weapon2_target"></button>
<span class="parsed-rolls">
<input type='hidden' name='attr_adv_weapon2_action' value=''>
@@ -1078,12 +1045,6 @@
<button type='roll' name='roll_adv_weapon2_target' class="parsed-rolls crosshair"
value='@{adv_weapon2_target_action}'
title="Use this button when you have an player token to target."></button>
<!-- remove if stable
<button type="action" name="act_adv_weapon2" id="roll_adv_weapon2" class="parsed-rolls"
title="Use this button when you have a Parry Rating that you can enter manually."></button>
<button type="action" name="act_adv_weapon2_target" id="roll_adv_weapon2_target"
class="parsed-rolls crosshair"
title="Use this button when you have an adversary token to target. "></button>-->
</span>
<input name="attr_weapon_skill_name_2" type="text">
</span>
@@ -1163,7 +1124,7 @@
const stripaction = (str) => {
return str.replace(/_action/g,'');
};
// ASYNC ATTRIBUTE METHODS (see https://app.roll20.net/forum/post/10346883/adventures-with-startroll)
const asw = (() => {
const setActiveCharacterId = function(charId){
@@ -1289,13 +1250,12 @@
}
} else if ( rolltype.startsWith("combat") ) {
favId = favourill_id;
stanceattackmodStr = "0"
if ( rolltype.includes("target") ) {
if (lm){
// totalparry includes shield, stance and other bonus
parrymodStr = `{{parrymod=[[${target.parrytotal}]]}}`
// we include targets stance modifier
stanceattackmodStr = target.stanceattackbonus;
stanceAttackBonus = target.stanceattackbonus;
} else {
parrymodStr = `{{parrymod=[[${target.parry}]]}}`
}
@@ -1328,7 +1288,7 @@
}
*/
modifiers = rolltype !== "custom" ? await getQuery(`?{Bonus dice|${rolltype.startsWith("combat") ? modifiers : 0}}`) : 0;
modifiers = rolltype !== "custom" ? await getQuery(`?{Bonus dice|${rolltype.startsWith("combat") ? stanceAttackBonus : 0}}`) : 0;
// add stance attack modifier
modifiers = int(modifiers);
let modStr = modifiers == 0 ? "" : (modifiers > 0 ? `{{modification=+${modifiers}}}` : `{{modification=${modifiers}}}`);
@@ -1354,7 +1314,7 @@
// SUCCESS DICE ROLL DATA
successdice = int(dice) + int(modifiers);
successdice = successdice < 0 ? 0 : successdice;
successStr = `[[${successdice}+${stanceattackmodStr}]]d6${closefitStr}`;
successStr = `[[${successdice}]]d6${closefitStr}`;
// WEAPON INFO & ADDITIONAL INFO
// Weapon info
@@ -1505,6 +1465,18 @@
});
});
/*==========================
defaults
============================*/
on('sheet:opened', function() {
getAttrs(["favourill_id"], function(values){
let favourill_id = values.favourill_id || 1;
setAttrs({
favourill_id: favourill_id,
});
});
});
/*==========================
Action Roll Button Updates
============================*/
@@ -1534,23 +1506,16 @@
// weary roll table change
on("change:weary sheet:opened", function() {
getAttrs(["weary", "wearytype", "sheetTab"], function(values) {
if (values.sheetTab === "isPC"){
let weary = values.weary||0;
if (weary === "on" || weary == 1) {
wearytype = "weary";
}
else {
wearytype = "normal";
}
setAttrs({
wearytype: wearytype,
});
} else {
// setting default for adversaries and if sheet is opened the first time
setAttrs({
wearytype: "normal",
});
};
let weary = values.weary||0;
if (weary === "on" || weary == 1) {
wearytype = "weary";
}
else {
wearytype = "normal";
}
setAttrs({
wearytype: wearytype,
});
});
});
@@ -1925,6 +1890,24 @@
});
});
// table adversary weapon rolls (to reflect the active stance attack bonus)
const advweaponattrs = ["adv_weapon1", "adv_weapon2"];
on(`change:stance sheet:opened`, function() {
getAttrs([""], function(values) {
advweaponattrs.forEach(advweaponattr => {
index = int(advweaponattr.slice(-1)); // last char
let roll1 =
`/me attacks against parry ?{Parry|0}.\n/roll 1t[lm-feat] + [[(@{weapon_rating_${index}}+?{Bonus Dice|0})]]t[@{wearytype}]`;
let roll2 =
`/me attacks @{target|name} against parry @{target|totalparry}.\n/roll 1t[lm-feat] + [[(@{weapon_rating_${index}}+?{Bonus Dice|@{target|stanceattackbonus}})]]t[@{wearytype}]`;
setAttrs({
[`${advweaponattr}_roll1`]: roll1,
[`${advweaponattr}_roll2`]: roll2,
});
});
});
});
// parsed adversary combat proficiency rolls
// act_adv_weapon1_target
on('clicked:adv_weapon1_action clicked:adv_weapon1_target_action clicked:adv_weapon2_action clicked:adv_weapon2_target_action ', async (ev) => {
@@ -2050,8 +2033,24 @@
{{/rollTotal() favorill 3}}
</div>
</rolltemplate>
<rolltemplate class="sheet-rolltemplate-msg">
<div class="sheet-container">
<div class="sheet-header">
{{#header}}<div class="sheet-title sheet-text-center">{{header}}</div>{{/header}}
{{#sub1}}<div class="sheet-subtitle sheet-text-center">{{sub1}}</div>{{/sub1}}
{{#sub2}}<div class="sheet-subtitle sheet-text-center">{{sub2}}</div>{{/sub2}}
</div>
{{#msg}}
<div class="sheet-contentmin">
<div class="sheet-main">{{msg}}</div>
</div>
{{/msg}}
</div>
</rolltemplate>
<rolltemplate class="sheet-rolltemplate-tor">
<div class="sheet-container sheet-color-{{color}}">
<div class="sheet-container">
<div class="sheet-header">
{{#character-name}}<div class="sheet-title sheet-text-center">{{character-name}}</div>{{/character-name}}
{{#roll-name}}<div class="sheet-subtitle sheet-text-center">{{roll-name}}</div>{{/roll-name}}