[Feature] Group Roll Rework (#1785)

* Initial

* .

* Improvements

* .

* Renamed 'Main Charater' to 'Leader'

* Localization fixes

* .

* Fixed roll sound coming when canceling a roll. Fixed the leader PART not being disabled when the player isn't the leader
This commit is contained in:
WBHarry 2026-04-11 11:14:36 +02:00 committed by GitHub
parent 97636fa134
commit a897037dc4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 1214 additions and 455 deletions

View file

@ -1,6 +1,5 @@
import DHAbilityUse from './abilityUse.mjs';
import DHActorRoll from './actorRoll.mjs';
import DHGroupRoll from './groupRoll.mjs';
import DHSystemMessage from './systemMessage.mjs';
export const config = {
@ -9,6 +8,5 @@ export const config = {
damageRoll: DHActorRoll,
dualityRoll: DHActorRoll,
fateRoll: DHActorRoll,
groupRoll: DHGroupRoll,
systemMessage: DHSystemMessage
};

View file

@ -1,39 +0,0 @@
import { abilities } from '../../config/actorConfig.mjs';
export default class DHGroupRoll extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
leader: new fields.EmbeddedDataField(GroupRollMemberField),
members: new fields.ArrayField(new fields.EmbeddedDataField(GroupRollMemberField))
};
}
get totalModifier() {
return this.members.reduce((acc, m) => {
if (m.manualSuccess === null) return acc;
return acc + (m.manualSuccess ? 1 : -1);
}, 0);
}
}
class GroupRollMemberField extends foundry.abstract.DataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
actor: new fields.ObjectField(),
trait: new fields.StringField({ choices: abilities }),
difficulty: new fields.StringField(),
result: new fields.ObjectField({ nullable: true, initial: null }),
manualSuccess: new fields.BooleanField({ nullable: true, initial: null })
};
}
/* Can be expanded if we handle automation of success/failure */
get success() {
return manualSuccess;
}
}