Gods, screen and bugfixes

This commit is contained in:
2022-02-20 10:12:25 +01:00
parent 83188e6aae
commit f63692b6b5
28 changed files with 62 additions and 17 deletions

View File

@ -312,13 +312,16 @@ export class BoLActor extends Actor {
/*-------------------------------------------- */
async manageHealthState() {
if (this.data.data.resources.hp.value <= 0 && this.data.lastHP != this.data.data.resources.hp.value) {
this.data.lastHP = this.data.data.resources.hp.value
ChatMessage.create({
alias: this.name,
whisper: BoLUtility.getWhisperRecipientsAndGMs(this.name),
content: await renderTemplate('systems/bol/templates/chat/chat-vitality-zero.hbs', { name: this.name, hp: this.data.lastHP} )
})
let lastHP = await this.getFlag("world", "lastHP")
if ( lastHP != this.data.data.resources.hp.value ) {
await this.setFlag("world", "lastHP", this.data.data.resources.hp.value)
if (this.data.data.resources.hp.value <= 0 ) {
ChatMessage.create({
alias: this.name,
whisper: BoLUtility.getWhisperRecipientsAndGMs(this.name),
content: await renderTemplate('systems/bol/templates/chat/chat-vitality-zero.hbs', { name: this.name, hp: this.data.data.resources.hp.value} )
})
}
}
}