Char creation process finalized

This commit is contained in:
2022-11-26 21:00:40 +01:00
parent dad117fc17
commit 45e856a30b
3 changed files with 277 additions and 15 deletions

View File

@@ -282,9 +282,9 @@ export class PegasusActor extends Actor {
}
/* -------------------------------------------- */
getStatus(statusKey) {
if ( statusKey == "nrg") {
if (statusKey == "nrg") {
return duplicate(this.system.nrg)
}
}
return duplicate(this.system.secondary[statusKey])
}
@@ -479,6 +479,29 @@ export class PegasusActor extends Actor {
let update = { _id: item.id, "data.activated": !item.system.activated }
await this.updateEmbeddedDocuments('Item', [update]) // Updates one EmbeddedEntity
}
}
/* -------------------------------------------- */
setHandInformation( info) {
this.update( {'system.biodata.preferredhand': info} )
}
/* -------------------------------------------- */
increaseRoleAbility() {
}
/* -------------------------------------------- */
addCDP( value) {
let cdp = this.system.biodata.cdp
cdp += value
this.update( {'system.biodata.cdp': cdp})
}
/* -------------------------------------------- */
addPPP(value) {
let ppp = duplicate(this.system.ppp)
ppp.availablePPP += value
this.update({ 'system.ppp': ppp })
}
/* -------------------------------------------- */
@@ -1558,14 +1581,14 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */
async modStatus(key, inc = 1) {
if ( key == "nrg") {
if (key == "nrg") {
let nrg = duplicate(this.system.nrg)
nrg.mod += parseInt(inc)
await this.update({ [`data.nrg`]: nrg })
await this.update({ [`data.nrg`]: nrg })
} else {
let status = duplicate(this.system.secondary[key])
status.bonus += parseInt(inc)
await this.update({ [`data.secondary.${key}`]: status })
await this.update({ [`data.secondary.${key}`]: status })
}
}