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

View File

@ -183,6 +183,6 @@
"templateVersion": 96, "templateVersion": 96,
"title": "Pegasus RPG", "title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-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" "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" <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}}" class="padd-right update-field" data-field-name="data.nrg.value" value="{{data.nrg.value}}"
data-dtype="Number" /> 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" <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}}" class="padd-right update-field" data-field-name="data.nrg.mod" value="{{data.nrg.mod}}"
data-dtype="Number" /> data-dtype="Number" />