Merge pull request #10950 from bhuesemann/tor2e_03-01-00

[The One Ring 2e] - 3.01.00 - extended msg rolltemplate and support to post fell-abilities into chat
This commit is contained in:
David
2022-08-22 13:59:02 -04:00
committed by GitHub
5 changed files with 107 additions and 11 deletions
+2 -3
View File
@@ -4,9 +4,7 @@ This is an UNOFFICIAL charactersheet for playing "The One Ring" second Ed. from
There is no game content or images in this system.
Should you wish to populate the system with game content for your own use please purchase the rules.
**Important:** For the rolls to work properly, follow the instructions on [The One Ring wiki page](https://wiki.roll20.net/The_One_Ring#Rollable_Tables) to set up custom rollable tables for your game.
More info: [Readme](https://github.com/Roll20/roll20-character-sheets/blob/master/The%20One%20Ring/README.md) and [wiki page](https://wiki.roll20.net/The_One_Ring).
More info: [Readme](https://github.com/Roll20/roll20-character-sheets/blob/master/The%20One%20Ring%202e/readme.md) and [wiki page](https://wiki.roll20.net/The_One_Ring_2e).
## Core Features ##
@@ -24,6 +22,7 @@ More info: [Readme](https://github.com/Roll20/roll20-character-sheets/blob/maste
- General attributes, combat and fell abilities
- Rolls for attack and protection
- Attacks with optionally selecting target and integrating target's parry
- Import Adversary from json
## Upgrade from 2e (basic) version ##
+4
View File
@@ -4,6 +4,10 @@ This is a rewrite based on the early 2e (basic) and 1e edition that also include
# Release History
## 03.01.00 (Build 21)
- added header-alt, sub1-alt, sub2-alt to custom roll template msg
- added button to post adversary fell ability into chat
## 03.00.00 (Build 20)
- added adversary json importer
+30 -6
View File
@@ -925,6 +925,16 @@
opacity: 0.8;
}
.ui-dialog .charsheet button[class~="chat"]::before {
/* change D12 to target-appropriate crosshairs */
font-family: "Pictos" !important;
content: "q" !important;
font-size: 1.1em;
color: rgb(40, 40, 40);
font-weight: normal;
opacity: 0.8;
}
.ui-dialog .charsheet :is(button[type="roll"][class~="table-rolls"],
button[type="roll"][class~="parsed-rolls"],
button[type="action"][class~="parsed-rolls"])::before {
@@ -1014,8 +1024,9 @@
.charsheet .adversary-combat-proficiencies {
display: grid;
grid-template-columns: 250px 60px 60px 60px auto;
grid-template-columns: 220px 60px 60px 60px auto;
grid-template-rows: repeat(3, 1fr);
grid-gap: 0px;
}
.charsheet .adversary-combat-proficiencies input[type="text"],
@@ -1033,7 +1044,7 @@
.charsheet .adversary-fell-abilities {
display: grid;
grid-template-columns: 200px 1fr;
grid-template-columns: 35px 190px auto;
grid-template-rows: repeat(4, auto);
justify-items: left;
grid-gap: 0px;
@@ -1089,8 +1100,7 @@
}
.sheet-rolltemplate-msg .sheet-contentmin {
border-top: 1px solid #000;
padding-top: 10px;
padding-top: 5px;
height: min-content;
}
@@ -1110,7 +1120,10 @@
/* change text-align to center to center the header text */
text-align: left;
color: black;
padding: 5px;
}
.sheet-rolltemplate-msg .sheet-header-sep {
border-bottom: 1px solid #000;
}
.sheet-rolltemplate-tor .sheet-footer,
@@ -1120,7 +1133,8 @@
}
.sheet-rolltemplate-tor .sheet-title,
.sheet-rolltemplate-msg .sheet-title {
.sheet-rolltemplate-msg .sheet-title,
.sheet-rolltemplate-msg .sheet-title-alt {
font-family: 'Uncial Antiqua', "Palatino Linotype", "Book Antiqua", Palatino, serif, sans-serif;
font-weight: lighter;
line-height: 1;
@@ -1129,11 +1143,21 @@
line-height: 25px;
}
.sheet-rolltemplate-msg .sheet-header .sheet-title-alt span {
border: 0px !important;
background-color: transparent !important;
}
.sheet-rolltemplate-tor .sheet-subtitle,
.sheet-rolltemplate-msg .sheet-subtitle {
font-size: 13px;
}
.sheet-rolltemplate-msg .sheet-header .sheet-subtitle-alt span {
border: 0px !important;
background-color: transparent !important;
}
.sheet-rolltemplate-tor .sheet-text-center,
.sheet-rolltemplate-msg .sheet-text-center {
text-align: center;
+70 -1
View File
@@ -1327,10 +1327,12 @@
</div>
<div class="adversary-fell-abilities">
<h1 data-i18n="fell-ability">Fell Ability</h1>
<span/>
<label class="empf-black left" data-i18n="description">Description</label>
</div>
<fieldset class="repeating_fell-abilities">
<div class="adversary-fell-abilities">
<button type='action' name='act_adv-fell' class="parsed-rolls chat"></button>
<input name="attr_fell_ability" type="text" />
<textarea name="attr_fell_ability_desc" type="text" />
</div>
@@ -1461,6 +1463,24 @@
}
}
const rollMessage = async ({header, header_alt, sub1, sub1_alt, sub2, sub2_alt, msg, msg_alt} = {}) => {
header = header === undefined ? "" : `{{header=${header}}}`;
header_alt = header_alt === undefined ? "" : `{{header-alt=${header_alt}}}`;
sub1 = sub1 === undefined ? "" : `{{sub1=${sub1}}}`;
sub1_alt = sub1_alt === undefined ? "" : `{{sub1-alt=${sub1_alt}}}`;
sub2 = sub2 === undefined ? "" : `{{sub2=${sub2}}}`;
sub2_alt = sub2_alt === undefined ? "" : `{{sub2-alt=${sub2_alt}}}`;
msg = msg === undefined ? "" : `{{msg=${msg}}}`;
msg_alt = msg_alt === undefined ? "" : `{{msg-alt=${msg_alt}}}`;
let rollBase = `&{template:msg} ${header}${header_alt}${sub1}${sub1_alt}${sub2_alt}${msg}${msg_alt}`;
let targetRoll = await startRoll(rollBase);
clog (`targetRoll: ${JSON.stringify(targetRoll)})`);
finishRoll(targetRoll.rollId);
clog (`targetRoll: ${JSON.stringify(targetRoll)})`);
return;
};
// isolated target call
const getTarget = async () => {
const rxGrab = /^0\[(.*)\]\s*$/;
@@ -2365,7 +2385,9 @@
clog(`Completed first roll: weapon_${index}`);
});
// Custom roll
/*==================
Custom Roll
====================*/
on('clicked:customroll', async (ev) => {
clog(`Starting first roll`);
let data = await asw.getAttrs(['character_name', 'customfeatdie', 'customtn', 'customsuccessdice', 'customrollname', 'favourill_id']),
@@ -2379,6 +2401,24 @@
clog(`Completed first roll`);
});
/*==================
Adversary Fell Abilities
====================*/
on('clicked:repeating_fell-abilities:adv-fell', async (ev) => {
const source = (ev.sourceAttribute).slice(0, -8);
clog(`${source}fell_ability_desc`);
let data = await asw.getAttrs([`${source}fell_ability`, `${source}fell_ability_desc`]),
fell_ability = data[`${source}fell_ability`],
fell_ability_desc = data[`${source}fell_ability_desc`];
// remove last dot from fell_ability if it exists
fell_ability = fell_ability.replace(/\.$/, '');
clog(`${fell_ability}: ${fell_ability_desc}`);
await rollMessage({header:fell_ability, msg:fell_ability_desc});
});
/*==================
Adversary Import
====================*/
on(`change:notes sheet:opened`, function() {
getAttrs(["notes", "sheetTab"], function(values) {
if (values.sheetTab ==="isAdversary"){
@@ -2701,6 +2741,26 @@
}
}
if (build < 20) {
attrs["build"] = 21;
let releaselog = {msg:""};
hlog(`Release 03.01.00 - ${new Date().toLocaleString()}`, releaselog);
if (v.sheettab === "isPC"){
getAttrs(['releaselog'], function(values){
hlog(`
### Features
- msg custom rolltemplate: added header-alt, sub1-alt, sub2-alt and fixe horizontal line hides correctly
- added button to post fell abilities of adversaries to chat
`, releaselog);
hlog("==============", releaselog);
attrs['releaselog'] = releaselog.msg + values['releaselog'];
if (Object.keys(attrs).length) {
setAttrs(attrs);
}
});
}
}
/*
if (build === 9) {
attrs["build"] = 8;
@@ -2732,9 +2792,18 @@
<div class="sheet-container">
<div class="sheet-header">
{{#header}}<div class="sheet-title sheet-text-center">{{header}}</div>{{/header}}
{{#header-alt}}<div class="sheet-title-alt sheet-text-center">{{header-alt}}</div>{{/header-alt}}
{{#sub1}}<div class="sheet-subtitle sheet-text-center">{{sub1}}</div>{{/sub1}}
{{#sub1-alt}}<div class="sheet-subtitle-alt sheet-text-center">{{sub1-alt}}</div>{{/sub1-alt}}
{{#sub2}}<div class="sheet-subtitle sheet-text-center">{{sub2}}</div>{{/sub2}}
{{#sub2-alt}}<div class="sheet-subtitle-alt sheet-text-center">{{sub2-alt}}</div>{{/sub2-alt}}
</div>
{{#header}}{{^sub1}}{{^sub2}}{{#msg}}<div class="sheet-header-sep"/>{{/msg}}{{/sub2}}{{/sub1}}{{/header}}
{{#sub1}}{{^sub2}}{{#msg}}<div class="sheet-header-sep"/>{{/msg}}{{/sub2}}{{/sub1}}
{{#sub2}}{{#msg}}<div class="sheet-header-sep"/>{{/msg}}{{/sub2}}
{{#header-alt}}{{^sub1-alt}}{{^sub2-alt}}{{#msg-alt}}<div class="sheet-header-sep"/>{{/msg-alt}}{{/sub2-alt}}{{/sub1-alt}}{{/header-alt}}
{{#sub1-alt}}{{^sub2-alt}}{{#msg-alt}}<div class="sheet-header-sep"/>{{/msg-alt}}{{/sub2-alt}}{{/sub1-alt}}
{{#sub2-alt}}{{#msg-alt}}<div class="sheet-header-sep"/>{{/msg-alt}}{{/sub2-alt}}
{{#msg}}
<div class="sheet-contentmin">
<div class="sheet-main">{{msg}}</div>
+1 -1
View File
@@ -1,6 +1,6 @@
{
"title": "The One Ring 2e",
"version": "3.0.0",
"version": "3.1.0",
"html": "sheet.html",
"css": "sheet.css",
"authors": "Bodo Hüsemann, Richard W, Michael (aka Aragent) I, Paul Venner, Michael Heilemann, Stefan Unterhuber, Stuart Johnson, David Domínguez, Eric Le Bourvellec",