forked from public/foundryvtt-reve-de-dragon
Feuille de véhicule avec compteurs
This commit is contained in:
@ -1779,6 +1779,18 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
async vehicleIncDec(name, inc) {
|
||||
if (!this.isVehicule() || !['resistance', 'structure'].includes(name)) {
|
||||
return
|
||||
}
|
||||
const value = this.system.etat[name].value;
|
||||
const max = this.system.etat[name].max;
|
||||
const newValue = value + inc;
|
||||
if (0 <= newValue && newValue <=max) {
|
||||
await this.update({ [`system.etat.${name}.value`]: newValue })
|
||||
}
|
||||
}
|
||||
|
||||
isDead() {
|
||||
return !this.isEntite() && this.system.sante.vie.value < -this.getSConst()
|
||||
|
Reference in New Issue
Block a user