Corrections sur creatures/npc et armes de vehicules

This commit is contained in:
2022-10-10 08:46:41 +02:00
parent 815b5ff2ac
commit 985d393de5
20 changed files with 568 additions and 27 deletions

View File

@ -52,9 +52,13 @@ export class BoLActor extends Actor {
/* -------------------------------------------- */
prepareDerivedData() {
super.prepareDerivedData()
this.updateResourcesData()
this.manageHealthState();
if ( this.type == "vehicle") {
} else {
super.prepareDerivedData()
this.updateResourcesData()
this.manageHealthState();
}
}
/* -------------------------------------------- */
@ -244,9 +248,11 @@ export class BoLActor extends Actor {
get shields() {
return this.items.filter(i => i.type === "item" && i.system.category === "equipment" && i.system.subtype === "shield");
}
get vehicleWeapons() {
return this.items.filter(i => i.type === "item" && i.system.category === "vehicleweapon" )
}
get weapons() {
return this.items.filter(i => i.type === "item" && i.system.category === "equipment" && i.system.subtype === "weapon");
return this.items.filter(i => i.type === "item" && i.system.category === "equipment" && i.system.subtype === "weapon")
}
get protections() {
return this.armors.concat(this.helms).concat(this.shields)
@ -395,25 +401,26 @@ export class BoLActor extends Actor {
/*-------------------------------------------- */
heroReroll() {
if (this.type == 'character') {
if (this.villainy == 'character') {
return this.system.resources.hero.value > 0;
} else {
if (this.system.type == 'adversary') {
if (this.system.villainy == 'adversary') {
return this.system.resources.hero.value > 0;
}
}
return false
}
/*-------------------------------------------- */
getResourcesFromType() {
let resources = {};
if (this.type == 'encounter') {
resources['hp'] = this.system.resources.hp;
if (this.system.type != 'base') {
if (this.system.chartype != 'base') {
resources['faith'] = this.system.resources.faith
resources['power'] = this.system.resources.power
}
if (this.system.type == 'adversary') {
if (this.system.chartype == 'adversary') {
resources['hero'] = duplicate(this.system.resources.hero)
resources['hero'].label = "BOL.resources.villainy"
}