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 14, 2020
1 parent 1c30a2f commit 65dac28
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/module/utils/sheetUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,12 @@ export function calcModFor(characteristic:number):number {
// return calcModFor(characteristic);
// }

const DEFAULT_TARGET_NUMBER_MODIFIER = "-8";

export function skillRollResultDisplay(rollParts:string[], flavorParts:string[], showEffect:boolean):void {
if (showEffect) {
//So that the result is the Effect of the skill roll.
rollParts.push("-8");
rollParts.push(DEFAULT_TARGET_NUMBER_MODIFIER);
}
const string = showEffect ? game.i18n.localize("TWODSIX.Rolls.Effect") : game.i18n.localize("TWODSIX.Rolls.sum");
flavorParts.push("(" + game.i18n.localize("TWODSIX.Rolls.resultShows") + " " + string + ")");
Expand Down

0 comments on commit 65dac28

Please sign in to comment.