Skip to content

Commit

Permalink
Working on issue #102 and #62. Basic support for linking items to ski…
Browse files Browse the repository at this point in the history
…lls, and making skill rolls using the item. If the item has the 'damage' field set to something, follows up with a damage roll.

Can now select a skill on owned items that is saved on the item. Deliberately no filtering of the skill you can select.
If you click an item with a linked skill, it is rolled, emitting a text like: 'Rolling Skillname using Itemname'. If it isn't linked, no roll occurs.
Advanced skill rolls (shift-click) now work.
Added in more of Kevin's layout fixes.
Supports rolling damage for advanced skill rolls as well as simple rolls.
Added support for advanced rolls to them as well (shift-click).
Made any bonus/penalty given in advanced rolls show in the chat flavor text.
TODO Add a setting to not roll damage.
TODO Maybe add a setting to only roll damage on effect > 0? (I.e. on a hit.)
TODO Add a 'permanent modifier' field
TODO Clean up the code (May not be possible. Probably better to rewrite completely for #86. It's horrible.)
  • Loading branch information
xdy committed Sep 13, 2020
1 parent 4d77508 commit caff47e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/module/utils/TwodsixRolls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ export class TwodsixRolls {
data['rollMode'] = form.rollMode.value;
}

if (data['bonus'] && data['bonus'].length > 0) {
rollParts.push(data['bonus']);
const bonus = data['bonus'];
if (bonus && bonus.length > 0) {
rollParts.push(bonus);
flavorParts.push(bonus >= 0 ? "+" + bonus : bonus);
}

if (data['difficulty'] && data['difficulty'].length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion static/templates/actors/parts/actor/actor-skills.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<span class="item skill-container">
<ol class="ol-no-indent">
<li class="item flexrow" data-item-id="{{item._id}}">
<span class="skill-container rollable">
<span class="skill-container">
<span class="mini-dice centre"><img class="rollable" data-label="{{item.name}}" data-roll="2d6+{{data.mod}}+{{data.value}}" src="./systems/twodsix/assets/d6-icon.svg"/></span>
<span class="item-name rollable" data-label="{{item.name}}" data-roll="2d6+{{data.mod}}+{{data.value}}">{{item.name}}</span>
<span class="item-name centre rollable" data-label="{{item.name}}" data-roll="2d6+{{data.mod}}+{{data.value}}">{{data.value}}</span>
Expand Down

0 comments on commit caff47e

Please sign in to comment.