Implement initiative rolling within Foundry
This commit is contained in:
parent
1002b1387c
commit
914b6e5862
4 changed files with 28 additions and 3 deletions
|
|
@ -96,5 +96,10 @@ export class ActorHandler extends Actor {
|
||||||
return this.proxyFunction("_preUpdate", ...args);
|
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")};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1 +1,11 @@
|
||||||
export default {};
|
/** @this {Actor} */
|
||||||
|
function getRollData() {
|
||||||
|
const data = {
|
||||||
|
initiative: this.system.initiative ?? 0,
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
getRollData,
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,14 @@ async function preUntypedEmbed(item) {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** @this {Actor} */
|
||||||
|
function getRollData() {
|
||||||
|
const data = {
|
||||||
|
initiative: this.system.stats.hands ?? 0,
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
atAspectLimit,
|
atAspectLimit,
|
||||||
createCustomItem,
|
createCustomItem,
|
||||||
|
|
@ -142,4 +150,5 @@ export default {
|
||||||
genericEmbeddedDelete,
|
genericEmbeddedDelete,
|
||||||
preAspectEmbed,
|
preAspectEmbed,
|
||||||
preUntypedEmbed,
|
preUntypedEmbed,
|
||||||
|
getRollData,
|
||||||
};
|
};
|
||||||
|
|
@ -35,5 +35,6 @@
|
||||||
"extensions": ["css", "hbs", "json", "js", "mjs", "svg"],
|
"extensions": ["css", "hbs", "json", "js", "mjs", "svg"],
|
||||||
"paths": ["templates", "langs", ".styles", "module", "assets"]
|
"paths": ["templates", "langs", ".styles", "module", "assets"]
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"initiative": "@initiative"
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue