Skip to content

Commit

Permalink
V 0.4.0 (#11)
Browse files Browse the repository at this point in the history
Upgrade to support FoundryVtt version 11
Bugfix for the bonus/malus dice
  • Loading branch information
rpgRackNar authored Feb 22, 2024
1 parent 665e307 commit 8a9b78b
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 8 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Change Log

## [0.4.0] - 2024-02-22

### Added

### Changed

- Upgrade to support FoundryVtt version 11

### Fixed

- Bug with the bonus/malus dice in the dice roller popup

## [0.3.0] - 2023-02-09

### Added
Expand Down
3 changes: 2 additions & 1 deletion supers/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"fromTempCompetency": "temporäre Kompetenzwürfel",
"max": "max",
"name": "name",
"none": "keine"
"none": "keine",
"RollAtLeastOneDie": "Würfle mindestens einen Würfel"
}
}
3 changes: 2 additions & 1 deletion supers/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"name": "name",
"none": "none",
"remove": "remove",
"uncounted": "uncounted"
"uncounted": "uncounted",
"RollAtLeastOneDie": "Roll at least one die"
}
}
8 changes: 4 additions & 4 deletions supers/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
}
],
"compatibility": {
"maximum": 10,
"minimum": 9,
"verified": "10.291"
"maximum": 11,
"minimum": 11,
"verified": "11.315"
},
"description": "Supers!",
"download": "https://github.com/RackNarDev/supers-rpg-foundryvtt/releases/latest/download/supers.zip",
Expand Down Expand Up @@ -77,5 +77,5 @@
"templateVersion": 2,
"title": "Supers!",
"url": "https://github.com/RackNarDev/supers-rpg-foundryvtt",
"version": "0.3.0"
"version": "0.4.0"
}
10 changes: 8 additions & 2 deletions supers/system/rollDialog.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {parseToPositiveNumber} from './validate.js';
import {parseToPositiveNumber, parseToPositiveOrNegativeNumber} from './validate.js';

const template = 'systems/supers/dialogs/dice-roll.hbs';

Expand All @@ -19,10 +19,16 @@ export const rollDialog = async (actor, options, onSuccess) => {
const tempCompetencyDice = parseToPositiveNumber(html.find('#s_dd_temp-cd').val());
const actorCompetencyDice = parseToPositiveNumber(html.find('#s_dd-a-cd').val());
const otherPoolCompetencyDice = parseToPositiveNumber(html.find('#s_dd_op-cd').val());
const bonusDice = parseToPositiveNumber(html.find('#s_dd_bd').val());
const bonusDice = parseToPositiveOrNegativeNumber(html.find('#s_dd_bd').val());

options.diceAmount = options.diceAmount
+ tempCompetencyDice + actorCompetencyDice + otherPoolCompetencyDice + bonusDice;

if (options.diceAmount < 1) {
ui.notifications.error(game.i18n.format('SUPERS.RollAtLeastOneDie'));
return;
}

options.modifierDice = {tempCompetencyDice, actorCompetencyDice, otherPoolCompetencyDice, bonusDice};

if (actor.system.Competency) {
Expand Down
5 changes: 5 additions & 0 deletions supers/system/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ export const parseToPositiveNumber = v => {
let t= Math.abs(parseInt(v));
return isNaN(t) ? 0 : t;
}

export const parseToPositiveOrNegativeNumber = v => {
let t= parseInt(v);
return isNaN(t) ? 0 : t;
}

0 comments on commit 8a9b78b

Please sign in to comment.