Update fight options
All checks were successful
Release Creation / build (release) Successful in 53s
All checks were successful
Release Creation / build (release) Successful in 53s
This commit is contained in:
@@ -375,6 +375,15 @@ export default class CthulhuEternalUtils {
|
||||
document.documentElement.style.setProperty('--background-image-base', `linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)), url("../assets/ui/${era}_background_main.webp")`);
|
||||
}
|
||||
|
||||
static getTarget() {
|
||||
if (game.user.targets && game.user.targets.size === 1) {
|
||||
for (let target of game.user.targets) {
|
||||
return target
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
static applyWounds(message, event) {
|
||||
let woundData = message.getFlag("fvtt-cthulhu-eternal", "woundData")
|
||||
if (!woundData) {
|
||||
@@ -387,10 +396,11 @@ export default class CthulhuEternalUtils {
|
||||
return
|
||||
}
|
||||
// Get the targetted actorId from the HTML select event
|
||||
let targetActorId = event.target.value
|
||||
let targetActor = game.actors.get(targetActorId)
|
||||
let targetCombatantId = event.target.value
|
||||
let combatant = game.combat.combatants.get(targetCombatantId)
|
||||
let targetActor = combatant.token?.actor || game.actors.get(combatant.actorId)
|
||||
if (!targetActor) {
|
||||
ui.notifications.error(game.i18n.localize("CTHULHUETERNAL.Notifications.noTargetActorFound") + targetActorId)
|
||||
ui.notifications.error(game.i18n.localize("CTHULHUETERNAL.Notifications.noTargetActorFound") + targetCombatantId)
|
||||
return
|
||||
}
|
||||
targetActor.applyWounds(woundData)
|
||||
|
||||
Reference in New Issue
Block a user