Fixes from 29th of june

This commit is contained in:
LeRatierBretonnien 2023-06-30 22:20:44 +02:00
parent 297c94adb7
commit 8f10b9825e
4 changed files with 16 additions and 10 deletions

View File

@ -398,19 +398,24 @@ export class Hero6Actor extends Actor {
}
game.combat.rebuildInitiative()
}
async disableAbortAction() {
await this.setFlag("world", "abort-action", { state: false, count: 0 })
}
async abortAction() {
if (this.getFlag("world", "abort-action")) {
await this.setFlag("world", "abort-action", false)
let abort = this.getFlag("world", "abort-action")
if ( abort.state) {
await this.setFlag("world", "abort-action", { state: false, count: 0 })
} else {
await this.setFlag("world", "abort-action", true)
await this.setFlag("world", "abort-action", { state: true, count: 0 })
}
game.combat.rebuildInitiative()
}
getHoldAction() {
return this.getFlag("world", "hold-action")
}
getAbortAction() {
return this.getFlag("world", "abort-action")
getAbortAction() {
let abort = this.getFlag("world", "abort-action")
return abort?.state || false
}
/* -------------------------------------------- */
@ -422,7 +427,7 @@ export class Hero6Actor extends Actor {
}
/* -------------------------------------------- */
getSegments() {
let index = [ Math.min(Math.max(this.system.characteristics.spd.value, 1), 12) ] // Security bounds
let index = [Math.min(Math.max(this.system.characteristics.spd.value, 1), 12)] // Security bounds
return __speed2Segments[index]
}
/* -------------------------------------------- */

View File

@ -80,6 +80,7 @@ export class Hero6Combat extends Combat {
}
if (c.actor.getAbortAction()) {
name = c.actor.name + " (A)"
c.actor.disableAbortAction()
}
updList.push({ _id: id, name: name, initiative: baseInit, holdAction: c.holdAction })
} else {

View File

@ -91,7 +91,7 @@
"styles": [
"styles/simple.css"
],
"version": "10.0.42",
"version": "10.0.43",
"compatibility": {
"minimum": "10",
"verified": "10",
@ -99,7 +99,7 @@
},
"title": "Hero System v6 for FoundrtVTT (Official)",
"manifest": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/raw/branch/main/system.json",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/archive/fvtt-hero-system-6-v10.0.42.zip",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/archive/fvtt-hero-system-6-v10.0.43.zip",
"url": "https://www.uberwald.me/gitea/uberwald/",
"background": "images/ui/hro6_welcome_page.webp",
"id": "fvtt-hero-system-6"

View File

@ -183,8 +183,8 @@
<input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.spd.value" value="{{characteristics.spd.value}}" data-dtype="Number" />
<span class="item-field-label-very-short">&nbsp;</span>
<button class="chat-card-button item-field-label-medium hold-action">Hold action</button>
<button class="chat-card-button item-field-label-medium abort-action">Abort action</button>
<button class="chat-card-button item-field-label-medium hold-action">Hold/Unhold</button>
<button class="chat-card-button item-field-label-medium abort-action">Abort/Unabort</button>
<span class="">&nbsp;</span>
<label class="item-field-label-long">Presence attack</label>