This commit is contained in:
2022-07-27 22:26:48 +02:00
parent 0c86b7f694
commit fb3bde9bc7
3 changed files with 18 additions and 22 deletions

View File

@ -979,8 +979,6 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */
async computeNRGHealth() {
if (this.isToken) return
if (this.isOwner || game.user.isGM) {
let updates = {}
let phyDiceValue = PegasusUtility.getDiceValue(this.data.data.statistics.phy.value) + this.data.data.secondary.health.bonus + this.data.data.statistics.phy.mod;
@ -1044,7 +1042,7 @@ export class PegasusActor extends Actor {
if (moralitythreshold != this.data.data.biodata.moralitythreshold) {
updates['data.biodata.moralitythreshold'] = moralitythreshold
}
if (!this.warnMorality && this.data.data.biodata.morality >= moralitythreshold-2) {
if (!this.warnMorality && this.data.data.biodata.morality <= moralitythreshold-2) {
ChatMessage.create( {content: "WARNING: Your character is dangerously close to becoming corrupted and defeated. Start on a path of redemption!"} )
this.warnMorality = true
}
@ -1059,8 +1057,7 @@ export class PegasusActor extends Actor {
}
//console.log("UPD", updates, this.data.data.biodata)
await this.update(updates)
this.computeThreatLevel()
this.computeThreatLevel()
}
if (this.isOwner || game.user.isGM) {