Add ranged attacks for monsters
This commit is contained in:
@@ -67,6 +67,7 @@ Hooks.once("init", () => {
|
|||||||
SYSTEM,
|
SYSTEM,
|
||||||
rollMoonStandalone: (actor = null) => CelestopolRoll.rollMoonStandalone(actor),
|
rollMoonStandalone: (actor = null) => CelestopolRoll.rollMoonStandalone(actor),
|
||||||
manageFactionAspects: (actor = null) => _manageFactionAspects(actor),
|
manageFactionAspects: (actor = null) => _manageFactionAspects(actor),
|
||||||
|
resetFactionAspects: () => _resetFactionAspects(),
|
||||||
getFactionAspectState: () => _getFactionAspectState(),
|
getFactionAspectState: () => _getFactionAspectState(),
|
||||||
getFactionAspectSummary: (actor = null) => _getFactionAspectSummary(actor),
|
getFactionAspectSummary: (actor = null) => _getFactionAspectSummary(actor),
|
||||||
getFactionDisplayLabel: (value) => _getFactionDisplayLabel(value),
|
getFactionDisplayLabel: (value) => _getFactionDisplayLabel(value),
|
||||||
@@ -1218,6 +1219,24 @@ async function _setFactionAspectState(state) {
|
|||||||
return cleanState
|
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() {
|
function _refreshFactionAspectSheets() {
|
||||||
for (const actor of game.actors.contents) {
|
for (const actor of game.actors.contents) {
|
||||||
if (actor.type !== "character") continue
|
if (actor.type !== "character") continue
|
||||||
|
|||||||
+6
-1
@@ -189,7 +189,12 @@
|
|||||||
"renforts": "Renforts",
|
"renforts": "Renforts",
|
||||||
"renseignements": "Renseignements",
|
"renseignements": "Renseignements",
|
||||||
"ressources": "Ressources",
|
"ressources": "Ressources",
|
||||||
"surveillance": "Surveillance"
|
"surveillance": "Surveillance",
|
||||||
|
"resetButton": "Réinitialiser",
|
||||||
|
"resetTitle": "Réinitialiser les Aspects de faction",
|
||||||
|
"resetConfirm": "Voulez-vous réinitialiser tous les Aspects de faction mobilisés ? Cette action efface la réserve de scénario en cours.",
|
||||||
|
"resetConfirmYes": "Réinitialiser",
|
||||||
|
"resetSuccess": "Aspects de faction réinitialisés pour le nouveau scénario."
|
||||||
},
|
},
|
||||||
"Track": {
|
"Track": {
|
||||||
"blessures": "Blessures",
|
"blessures": "Blessures",
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ export default class CelestopolCharacterSheet extends CelestopolActorSheet {
|
|||||||
supprimerXpLog: CelestopolCharacterSheet.#onSupprimerXpLog,
|
supprimerXpLog: CelestopolCharacterSheet.#onSupprimerXpLog,
|
||||||
rollMoonDie: CelestopolCharacterSheet.#onRollMoonDie,
|
rollMoonDie: CelestopolCharacterSheet.#onRollMoonDie,
|
||||||
manageFactionAspects: CelestopolCharacterSheet.#onManageFactionAspects,
|
manageFactionAspects: CelestopolCharacterSheet.#onManageFactionAspects,
|
||||||
|
resetFactionAspects: CelestopolCharacterSheet.#onResetFactionAspects,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,6 +246,10 @@ export default class CelestopolCharacterSheet extends CelestopolActorSheet {
|
|||||||
await game.celestopol?.manageFactionAspects(this.document)
|
await game.celestopol?.manageFactionAspects(this.document)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async #onResetFactionAspects() {
|
||||||
|
await game.celestopol?.resetFactionAspects()
|
||||||
|
}
|
||||||
|
|
||||||
/** Ouvre un dialogue pour dépenser de l'XP. */
|
/** Ouvre un dialogue pour dépenser de l'XP. */
|
||||||
static async #onDepenseXp() {
|
static async #onDepenseXp() {
|
||||||
const actor = this.document
|
const actor = this.document
|
||||||
|
|||||||
@@ -7,6 +7,9 @@
|
|||||||
<a class="faction-aspect-manage" data-action="manageFactionAspects">
|
<a class="faction-aspect-manage" data-action="manageFactionAspects">
|
||||||
<i class="fa-solid fa-sliders"></i> {{localize "CELESTOPOL.FactionAspect.manage"}}
|
<i class="fa-solid fa-sliders"></i> {{localize "CELESTOPOL.FactionAspect.manage"}}
|
||||||
</a>
|
</a>
|
||||||
|
<a class="faction-aspect-reset" data-action="resetFactionAspects">
|
||||||
|
<i class="fa-solid fa-rotate-left"></i> {{localize "CELESTOPOL.FactionAspect.resetButton"}}
|
||||||
|
</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user