Pets and misc changes
This commit is contained in:
parent
4a3523d6cf
commit
b30aa18a27
15 changed files with 244 additions and 32 deletions
|
|
@ -62,6 +62,26 @@ async function createCustomSpell() {
|
|||
}]);
|
||||
};
|
||||
|
||||
/** @this {Actor} */
|
||||
async function createCustomPet() {
|
||||
const body = new URLSearchParams({
|
||||
number: 1,
|
||||
animal: `Cat`,
|
||||
"X-Requested-With": "fetch"
|
||||
})
|
||||
const r = await fetch(
|
||||
`https://randommer.io/pet-names`,
|
||||
{
|
||||
method: "POST",
|
||||
body
|
||||
}
|
||||
);
|
||||
await createCustomItem.bind(this)([{
|
||||
type: `pet`,
|
||||
name: (await r.json())[0] ?? game.i18n.localize(`dotdungeon.defaults.pet.name`),
|
||||
}]);
|
||||
};
|
||||
|
||||
/** @this {Actor} */
|
||||
async function atAspectLimit() {
|
||||
let limit = game.settings.get(`dotdungeon`, `aspectLimit`);
|
||||
|
|
@ -90,6 +110,7 @@ export default {
|
|||
createCustomItem,
|
||||
createCustomAspect,
|
||||
createCustomSpell,
|
||||
createCustomPet,
|
||||
genericEmbeddedDelete,
|
||||
preAspectEmbed,
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue