This commit is contained in:
2022-08-31 22:24:56 +02:00
parent c552411d61
commit eeb0a906e7
4 changed files with 63 additions and 49 deletions

View File

@ -347,7 +347,7 @@ export class BoLActor extends Actor {
spendPowerPoint(ppCost) {
let newPP = this.system.resources.power.value - ppCost
newPP = (newPP < 0) ? 0 : newPP
this.update({ 'data.resources.power.value': newPP })
this.update({ 'system.resources.power.value': newPP })
return newPP
}
@ -355,7 +355,7 @@ export class BoLActor extends Actor {
resetAlchemyStatus(alchemyId) {
let alchemy = this.items.get(alchemyId)
if (alchemy) {
this.updateEmbeddedDocuments('Item', [{ _id: alchemy.id, 'data.properties.pccurrent': 0 }])
this.updateEmbeddedDocuments('Item', [{ _id: alchemy.id, 'system.properties.pccurrent': 0 }])
}
}
@ -369,7 +369,7 @@ export class BoLActor extends Actor {
newPC = (newPC < 0) ? 0 : newPC
this.update({ 'data.resources.alchemypoints.value': newPC })
newPC = alchemy.system.properties.pccurrent + pcCost
await this.updateEmbeddedDocuments('Item', [{ _id: alchemy.id, 'data.properties.pccurrent': newPC }])
await this.updateEmbeddedDocuments('Item', [{ _id: alchemy.id, 'system.properties.pccurrent': newPC }])
} else {
ui.notifications.warn("Plus assez de Points de Création !")
}