Implement initiative rolling within Foundry

This commit is contained in:
Oliver-Akins 2024-02-10 01:03:49 -07:00
parent 1002b1387c
commit 914b6e5862
4 changed files with 28 additions and 3 deletions

View file

@ -96,5 +96,10 @@ export class ActorHandler extends Actor {
return this.proxyFunction("_preUpdate", ...args);
};
useRestDie() { return this.proxyFunction("useRestDie"); };
getRollData() {
if (!this.fn?.getRollData) return {};
return this.fn?.getRollData.bind(this)();
};
useRestDie() {return this.proxyFunction("useRestDie")};
};

View file

@ -1 +1,11 @@
export default {};
/** @this {Actor} */
function getRollData() {
const data = {
initiative: this.system.initiative ?? 0,
};
return data;
};
export default {
getRollData,
};

View file

@ -132,6 +132,14 @@ async function preUntypedEmbed(item) {
};
};
/** @this {Actor} */
function getRollData() {
const data = {
initiative: this.system.stats.hands ?? 0,
};
return data;
};
export default {
atAspectLimit,
createCustomItem,
@ -142,4 +150,5 @@ export default {
genericEmbeddedDelete,
preAspectEmbed,
preUntypedEmbed,
getRollData,
};

View file

@ -35,5 +35,6 @@
"extensions": ["css", "hbs", "json", "js", "mjs", "svg"],
"paths": ["templates", "langs", ".styles", "module", "assets"]
}
}
},
"initiative": "@initiative"
}