Pets and misc changes

This commit is contained in:
Oliver-Akins 2024-01-26 21:40:27 -07:00
parent 4a3523d6cf
commit b30aa18a27
15 changed files with 244 additions and 32 deletions

View file

@ -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,
};