Add ranged attacks for monsters
Release Creation / build (release) Successful in 1m13s

This commit is contained in:
2026-04-29 22:24:42 +02:00
parent 8123b53f75
commit ec0e522145
4 changed files with 33 additions and 1 deletions
+19
View File
@@ -67,6 +67,7 @@ Hooks.once("init", () => {
SYSTEM,
rollMoonStandalone: (actor = null) => CelestopolRoll.rollMoonStandalone(actor),
manageFactionAspects: (actor = null) => _manageFactionAspects(actor),
resetFactionAspects: () => _resetFactionAspects(),
getFactionAspectState: () => _getFactionAspectState(),
getFactionAspectSummary: (actor = null) => _getFactionAspectSummary(actor),
getFactionDisplayLabel: (value) => _getFactionDisplayLabel(value),
@@ -1218,6 +1219,24 @@ async function _setFactionAspectState(state) {
return cleanState
}
async function _resetFactionAspects() {
if (!game.user.isGM) {
ui.notifications.warn(game.i18n.localize("CELESTOPOL.FactionAspect.gmOnly"))
return
}
const confirmed = await foundry.applications.api.DialogV2.confirm({
window: { title: game.i18n.localize("CELESTOPOL.FactionAspect.resetTitle") },
content: `<p>${game.i18n.localize("CELESTOPOL.FactionAspect.resetConfirm")}</p>`,
yes: { label: game.i18n.localize("CELESTOPOL.FactionAspect.resetConfirmYes"), icon: "fas fa-redo" },
no: { label: game.i18n.localize("Cancel"), icon: "fas fa-times" },
rejectClose: false,
})
if (!confirmed) return
const state = _getFactionAspectState()
await _setFactionAspectState({ ...state, activatedAspects: [] })
ui.notifications.info(game.i18n.localize("CELESTOPOL.FactionAspect.resetSuccess"))
}
function _refreshFactionAspectSheets() {
for (const actor of game.actors.contents) {
if (actor.type !== "character") continue