Update to new data bindings, everythings an interface now.
This commit is contained in:
parent
78be1c2370
commit
9385917edd
6 changed files with 40 additions and 50 deletions
|
@ -1,4 +1,4 @@
|
|||
import { DS4ActorData, DS4ActorDataType } from "./actor-data";
|
||||
import { DS4ActorDataType } from "./actor-data";
|
||||
|
||||
/**
|
||||
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
|
||||
|
@ -11,10 +11,9 @@ export class DS4Actor extends Actor<DS4ActorDataType> {
|
|||
this._prepareCombatValues(data);
|
||||
}
|
||||
|
||||
_prepareCombatValues(data: ActorData<DS4ActorDataType>): void {
|
||||
private _prepareCombatValues(data: ActorData<DS4ActorDataType>): void {
|
||||
const hitPointsModifier = getProperty(data, "data.combatValues.hitPoints.modifier") || 0;
|
||||
// data.data seems to get initialized with the enitity's data
|
||||
const actorData = (data.data as unknown) as DS4ActorData;
|
||||
const actorData = data.data;
|
||||
setProperty(
|
||||
data,
|
||||
"data.combatValues.hitPoints.max",
|
||||
|
@ -32,7 +31,7 @@ export class DS4Actor extends Actor<DS4ActorDataType> {
|
|||
);
|
||||
}
|
||||
|
||||
_getArmorValue(): number {
|
||||
private _getArmorValue(): number {
|
||||
return this.data["items"]
|
||||
.filter((item) => ["armor", "shield"].includes(item.type))
|
||||
.filter((item) => item.data.equipped)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue