Calcul automatique du niveau des entités
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import { ENTITE_INCARNE, ENTITE_NONINCARNE } from "../constants.js";
|
||||
import { ITEM_TYPES } from "../item.js";
|
||||
import { Misc } from "../misc.js";
|
||||
import { RdDCarac } from "../rdd-carac.js";
|
||||
import { RdDEncaisser } from "../rdd-roll-encaisser.js";
|
||||
import { STATUSES } from "../settings/status-effects.js";
|
||||
import { RdDBaseActorReve } from "./base-actor-reve.js";
|
||||
@ -18,12 +19,23 @@ export class RdDEntite extends RdDBaseActorReve {
|
||||
isEntite(typeentite = []) {
|
||||
return (typeentite.length == 0 || typeentite.includes(this.system.definition.typeentite));
|
||||
}
|
||||
|
||||
isNonIncarnee() { return this.isEntite([ENTITE_NONINCARNE]) }
|
||||
|
||||
getReveActuel() {
|
||||
return Misc.toInt(this.system.carac.reve?.value)
|
||||
}
|
||||
|
||||
getCarac() {
|
||||
const carac = super.getCarac()
|
||||
delete carac.niveau
|
||||
return carac
|
||||
}
|
||||
|
||||
getNiveau() {
|
||||
const reve = this.getReve()
|
||||
return RdDCarac.getCaracDerivee(reve).niveau
|
||||
}
|
||||
getForce() { return this.getReve() }
|
||||
getAgilite() { return this.getReve() }
|
||||
getChance() { return this.getReve() }
|
||||
@ -64,6 +76,7 @@ export class RdDEntite extends RdDBaseActorReve {
|
||||
}
|
||||
return {}
|
||||
}
|
||||
|
||||
async encaisser() {
|
||||
if (this.isNonIncarnee()) {
|
||||
return
|
||||
|
Reference in New Issue
Block a user