Skip to content

Commit

Permalink
v0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Moerill committed Jun 10, 2020
1 parent ddf4760 commit 214478c
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 25 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# v0.7.0
* (5e): Added settings option to support for "maximum crits": Changes behaviour of critical damage rolls to maximize the damage of the extra dice for criticals! Thanks to @bsleys for adding this feature!

# v0.6.1
* Forgot to update module.json to show compatibility with newest FVTT version....

Expand Down
4 changes: 2 additions & 2 deletions dist/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mess",
"title": "Mess - Moerills enhancing super-suit(e)",
"description": "This module is a mix of QoL changes, enhancements for my game and stuff i play around with. For a complete feature list check the URL down below.",
"version": "0.6.1",
"version": "0.7.0",
"minimumCoreVersion": "0.6.0",
"compatibleCoreVersion": "0.6.2",
"author": "Moerill",
Expand All @@ -28,5 +28,5 @@
],
"manifest": "https://raw.githubusercontent.com/Moerill/mess/master/src/module.json",
"url": "https://github.com/Moerill/mess",
"download": "https://github.com/Moerill/mess/releases/download/v0.6.1/mess.zip"
"download": "https://github.com/Moerill/mess/releases/download/v0.7.0/mess.zip"
}
6 changes: 3 additions & 3 deletions dist/scripts/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/scripts/index.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/templates/welcome-screen.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ <h2></h2>
<p style="text-align: right">Want to support development? <a href="https://github.com/Moerill/token-mold#support-the-development">Click here</a></p>
<h2></h2>
<h1>Changelog</h1>
<h2>v0.7.0</h2>
<ul>
<li>(5e): Added settings option to support for "maximum crits": Changes behaviour of critical damage rolls to maximize the damage of the extra dice for criticals! Thanks to BSleys for adding this feature!</li>
</ul>
<h2>v0.6.0</h2>
<ul>
<li>New Feature: You can now specify your items chat flavor using rollable Tables!
Expand Down
32 changes: 26 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "module-template",
"version": "0.6.1",
"version": "0.7.0",
"description": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
4 changes: 2 additions & 2 deletions src/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mess",
"title": "Mess - Moerills enhancing super-suit(e)",
"description": "This module is a mix of QoL changes, enhancements for my game and stuff i play around with. For a complete feature list check the URL down below.",
"version": "0.6.1",
"version": "0.7.0",
"minimumCoreVersion": "0.6.0",
"compatibleCoreVersion": "0.6.2",
"author": "Moerill",
Expand All @@ -28,5 +28,5 @@
],
"manifest": "https://raw.githubusercontent.com/Moerill/mess/master/src/module.json",
"url": "https://github.com/Moerill/mess",
"download": "https://github.com/Moerill/mess/releases/download/v0.6.1/mess.zip"
"download": "https://github.com/Moerill/mess/releases/download/v0.7.0/mess.zip"
}
2 changes: 1 addition & 1 deletion src/scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ Hooks.on('init', function() {
// options.forEach(e => e.condition = false)
// return [];
// })
// })
// })
17 changes: 12 additions & 5 deletions src/scripts/rolls/dice.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,18 @@ export async function rollToHit(ev) {
span.classList.add('crit');
card.querySelector('.mess-chat-dmg .mess-chat-roll-type').innerHTML += ' - Crit!'
card.querySelectorAll('.mess-button-dmg').forEach((e, idx) => {
const formula = e.dataset.formula;
const r = new Roll(formula);
r.alter(0, 2);
e.innerHTML = `<i class="fas fa-dice-d20"></i> ${r.formula}`
e.dataset.formula = r.formula;
const rgx = new RegExp(Die.rgx.die, "g");
const formula = e.dataset.formula.replace(rgx, (match, nd, d, mods) => {
if (game.settings.get('mess', 'max-critical'))
mods = " + " + nd * d + (mods || "");
else {
nd = nd * 2;
mods = mods || "";
}
return nd + "d" + d + mods;
});
e.innerHTML = `<i class="fas fa-dice-d20"></i> ${formula}`;
e.dataset.formula = formula;
});
}
if (d20 <= fumble)
Expand Down
13 changes: 9 additions & 4 deletions src/scripts/rolls/modify-rolling.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ export default function() {
* Initializes all the hoohks!
*/
function setupHooks() {
CONFIG.Item.entityClass.chatListeners = chatListeners.bind(CONFIG.Item.entityClass);

Hooks.on('preCreateChatMessage', preCreateChatMessageHook);
Hooks.on('renderActorSheet', actorSheetHook);

// Bind my own chatListeners to the item class and execute them.
Hooks.on('ready', chatListeners.bind(CONFIG.Item.entityClass));
// Hooks.on('ready', chatListeners.bind(CONFIG.Item.entityClass));


}

/**
Expand Down Expand Up @@ -268,8 +272,9 @@ async function actorSheetHook(app, html, data) {
/**
* My own chat listeners
*/
function chatListeners() {
const html = $(document.getElementById('chat-log'));
function chatListeners(html) {
if (!html)
html = $(document.getElementById('chat-log'));
html.on('click', '.card-buttons button', onChatCardAction.bind(this));
// html.on('click', '.item-name', this._onChatCardToggleContent.bind(this));

Expand Down Expand Up @@ -323,7 +328,7 @@ async function onDblClickTarget(ev) {
if (!token || !token.visible) return false;

const pos = token.center;
canvas.animatePan({x: pos.x, y: pos.y})
canvas.animatePan({x: pos.x, y: pos.y});
}

async function getTargetToken(ev) {
Expand Down
10 changes: 10 additions & 0 deletions src/scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ export class MessSettings extends FormApplication {
default: true,
type: Object
});

game.settings.register('mess', 'max-critical', {
name: "Activate maximum critical rolls.",
hint: "Changes behaviour of critical damage rolls to maximize the damage of the extra dice for criticals!",
scope: "world",
config: isDnD,
default: false,
type: Boolean,
onChange: () => location.reload()
});
}

static get defaultOptions() {
Expand Down
4 changes: 4 additions & 0 deletions src/templates/welcome-screen.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ <h2></h2>
<p style="text-align: right">Want to support development? <a href="https://github.com/Moerill/token-mold#support-the-development">Click here</a></p>
<h2></h2>
<h1>Changelog</h1>
<h2>v0.7.0</h2>
<ul>
<li>(5e): Added settings option to support for "maximum crits": Changes behaviour of critical damage rolls to maximize the damage of the extra dice for criticals! Thanks to BSleys for adding this feature!</li>
</ul>
<h2>v0.6.0</h2>
<ul>
<li>New Feature: You can now specify your items chat flavor using rollable Tables!
Expand Down

0 comments on commit 214478c

Please sign in to comment.