mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
[PR][Feature] Actor Sizes (#1433)
* Added support for adversary actor sizes * . * . * Finished token implementation * Fixed token-config * Updated SRD adversaries * . * Added size to Beastform tokenData * Fixed sizing for evolved beastforms * Beastform compendium update * .
This commit is contained in:
parent
7926c614e3
commit
8178fa5738
176 changed files with 1198 additions and 203 deletions
|
|
@ -74,16 +74,27 @@ export default class DhpActor extends Actor {
|
|||
/**@inheritdoc */
|
||||
async _preCreate(data, options, user) {
|
||||
if ((await super._preCreate(data, options, user)) === false) return false;
|
||||
const update = {};
|
||||
|
||||
// Set default token size. Done here as we do not want to set a datamodel default, since that would apply the sizing to third party actor modules that aren't set up with the size system.
|
||||
if (this.system.metadata.usesSize && !data.system?.size) {
|
||||
Object.assign(update, {
|
||||
system: {
|
||||
size: CONFIG.DH.ACTOR.tokenSize.medium.id
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Configure prototype token settings
|
||||
const prototypeToken = {};
|
||||
if (['character', 'companion', 'party'].includes(this.type))
|
||||
Object.assign(prototypeToken, {
|
||||
sight: { enabled: true },
|
||||
actorLink: true,
|
||||
disposition: CONST.TOKEN_DISPOSITIONS.FRIENDLY
|
||||
Object.assign(update, {
|
||||
prototypeToken: {
|
||||
sight: { enabled: true },
|
||||
actorLink: true,
|
||||
disposition: CONST.TOKEN_DISPOSITIONS.FRIENDLY
|
||||
}
|
||||
});
|
||||
this.updateSource({ prototypeToken });
|
||||
this.updateSource(update);
|
||||
}
|
||||
|
||||
_onUpdate(changes, options, userId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue