mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
parent
b9b657e985
commit
f7a29c0029
12 changed files with 117 additions and 115 deletions
|
|
@ -69,7 +69,7 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel {
|
|||
}
|
||||
|
||||
get hitTargets() {
|
||||
return this.currentTargets.filter(t => (t.hit || !this.targetSelection));
|
||||
return this.currentTargets.filter(t => (t.hit || !this.hasRoll || !this.targetSelection));
|
||||
}
|
||||
|
||||
async updateTargets() {
|
||||
|
|
@ -120,6 +120,8 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel {
|
|||
}
|
||||
if(this.hasSave) this.setPendingSaves();
|
||||
}
|
||||
|
||||
this.canViewSecret = this.parent.speakerActor?.testUserPermission(game.user, 'OBSERVER');
|
||||
}
|
||||
|
||||
getTargetList() {
|
||||
|
|
|
|||
|
|
@ -170,7 +170,8 @@ export default class D20Roll extends DHRoll {
|
|||
.map(d => {
|
||||
return {
|
||||
dice: d.denomination,
|
||||
value: d.total
|
||||
value: d.total,
|
||||
results: d.results
|
||||
};
|
||||
});
|
||||
data.modifierTotal = this.calculateTotalModifiers(roll);
|
||||
|
|
|
|||
|
|
@ -597,7 +597,7 @@ export default class DhpActor extends Actor {
|
|||
async modifyResource(resources) {
|
||||
if (!resources.length) return;
|
||||
|
||||
if (resources.find(r => r.type === 'stress')) this.convertStressDamageToHP(resources);
|
||||
if (resources.find(r => r.key === 'stress')) this.convertStressDamageToHP(resources);
|
||||
let updates = {
|
||||
actor: { target: this, resources: {} },
|
||||
armor: { target: this.system.armor, resources: {} },
|
||||
|
|
@ -664,14 +664,14 @@ export default class DhpActor extends Actor {
|
|||
}
|
||||
|
||||
convertStressDamageToHP(resources) {
|
||||
const stressDamage = resources.find(r => r.type === 'stress'),
|
||||
const stressDamage = resources.find(r => r.key === 'stress'),
|
||||
newValue = this.system.resources.stress.value + stressDamage.value;
|
||||
if (newValue <= this.system.resources.stress.max) return;
|
||||
const hpDamage = resources.find(r => r.type === 'hitPoints');
|
||||
const hpDamage = resources.find(r => r.key === 'hitPoints');
|
||||
if (hpDamage) hpDamage.value++;
|
||||
else
|
||||
resources.push({
|
||||
type: 'hitPoints',
|
||||
key: 'hitPoints',
|
||||
value: 1
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue