mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Feature/201 new roll type (#218)
* Action Roll DiceSet type * Fix * Remove console log * Tmp fix for non consistent resource * fix
This commit is contained in:
parent
22bf348c12
commit
19cc10a3c9
19 changed files with 283 additions and 156 deletions
|
|
@ -268,7 +268,8 @@ export default class DhpActor extends Actor {
|
|||
async diceRoll(config) {
|
||||
config.source = {...(config.source ?? {}), actor: this.uuid};
|
||||
config.data = this.getRollData();
|
||||
return await this.rollClass.build(config);
|
||||
const rollClass = config.roll.lite ? CONFIG.Dice.daggerheart['DHRoll'] : this.rollClass;
|
||||
return await rollClass.build(config);
|
||||
}
|
||||
|
||||
get rollClass() {
|
||||
|
|
@ -421,13 +422,14 @@ export default class DhpActor extends Actor {
|
|||
break;
|
||||
default:
|
||||
updates.actor.resources[`system.resources.${r.type}.value`] = Math.max(
|
||||
Math.min(this.system.resources[r.type].value + r.value, this.system.resources[r.type].max),
|
||||
Math.min(this.system.resources[r.type].value + r.value, (this.system.resources[r.type].maxTotal ?? this.system.resources[r.type].max)),
|
||||
0
|
||||
);
|
||||
break;
|
||||
}
|
||||
});
|
||||
Object.values(updates).forEach(async u => {
|
||||
console.log(updates, u)
|
||||
if (Object.keys(u.resources).length > 0) {
|
||||
if (game.user.isGM) {
|
||||
await u.target.update(u.resources);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue