Managedeletion

This commit is contained in:
sladecraven 2022-07-30 22:44:44 +02:00
parent a4abedd4b3
commit 74a2b434c7
3 changed files with 20 additions and 12 deletions

View File

@ -836,6 +836,7 @@ export class PegasusActor extends Actor {
// Severe Trauma management
if (this.getTraumaState() == "severetrauma") {
if ( !this.severeTraumaMessage) {
let chatData = {
user: game.user.id,
rollMode: game.settings.get("core", "rollMode"),
@ -843,6 +844,8 @@ export class PegasusActor extends Actor {
}
chatData.content = `<div>${this.name} is suffering from Severe Trauma and cannot use Perks at this time.</div`
ChatMessage.create(chatData)
this.severeTraumaMessage = true
}
this.updateEmbeddedDocuments('Item', [{ _id: itemId, 'data.status': "ready", 'data.used1': false, 'data.used2': false, 'data.used3': false }])
return
}
@ -1040,9 +1043,14 @@ 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 < 0) {
if ( !this.isToken) {
if (this.warnMorality != this.data.data.biodata.morality && this.data.data.biodata.morality < 0) {
console.log("CHAR", this)
ChatMessage.create({ content: "WARNING: Your character is dangerously close to becoming corrupted and defeated. Start on a path of redemption!" })
this.warnMorality = true
}
if (this.warnMorality != this.data.data.biodata.morality) {
this.warnMorality = this.data.data.biodata.morality
}
}
let race = this.getRace()

View File

@ -183,6 +183,6 @@
"templateVersion": 96,
"title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
"version": "0.6.6",
"version": "0.6.7",
"background" : "./images/ui/pegasus_welcome_page.webp"
}

View File

@ -384,7 +384,7 @@
<span class="small-label padd-right packed-left">&nbsp;Current</span><input type="text"
class="padd-right update-field" data-field-name="data.nrg.value" value="{{data.nrg.value}}"
data-dtype="Number" />
<a class="current-nrg-minus plus-minus-button">&nbsp;-</a>/<a class="current-nrg-plus plus-minus-button">+</a>
<a class="current-nrg-plus plus-minus-button">+</a>/<a class="current-nrg-minus plus-minus-button">&nbsp;-</a>
<span class="small-label padd-right packed-left">&nbsp;Mod</span><input type="text"
class="padd-right update-field" data-field-name="data.nrg.mod" value="{{data.nrg.mod}}"
data-dtype="Number" />