Initial import

This commit is contained in:
2026-03-07 17:19:40 +01:00
commit 03bc0b7043
69 changed files with 3263 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
export default class OathHammerActor extends Actor {
async _preCreate(data, options, user) {
await super._preCreate(data, options, user)
const prototypeToken = {}
if (this.type === "character") {
Object.assign(prototypeToken, {
sight: { enabled: true },
actorLink: true,
disposition: CONST.TOKEN_DISPOSITIONS.FRIENDLY,
})
this.updateSource({ prototypeToken })
}
if (this.type === "npc") {
Object.assign(prototypeToken, {
sight: { enabled: false },
actorLink: false,
disposition: CONST.TOKEN_DISPOSITIONS.HOSTILE,
})
this.updateSource({ prototypeToken })
}
}
getArmorRating() {
let rating = 0
for (const item of this.items) {
if (item.type === "armor" && item.system.equipped) {
rating += Number(item.system.armorRating) || 0
}
if (item.type === "shield" && item.system.equipped) {
rating += Number(item.system.shieldBonus) || 0
}
}
return rating
}
}