Initial system import

This commit is contained in:
2025-12-25 23:08:06 +01:00
commit 4beb5806eb
4623 changed files with 682363 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
import { SYSTEM } from "../config/system.mjs"
import HamalronTirageTarot from "../documents/tirage-tarot.mjs"
export default class HamalronPNJ extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields
const requiredInteger = { required: true, nullable: false, integer: true }
const schema = {}
schema.enemyType = new fields.StringField({
required: true,
initial: "mook",
choices: Object.fromEntries(Object.entries(SYSTEM.ENEMY_TYPES).map(([key, val]) => [key, val.label]))
})
schema.description = new fields.HTMLField({ required: true, textSearch: true })
schema.notes = new fields.HTMLField({ required: true, textSearch: true })
return schema
}
/** @override */
static LOCALIZATION_PREFIXES = ["HAMALRON.PNJ"]
async roll(rollType, rollItem) {
let opponentTarget
const hasTarget = opponentTarget !== undefined
let roll = await HamalronTirageTarot.prompt({
rollType,
rollItem,
actorId: this.parent.id,
actorName: this.parent.name,
actorImage: this.parent.img,
traits: this.parent.items.filter(i => i.type === "trait"),
hasTarget,
target: opponentTarget
})
if (!roll) return null
await roll.toMessage({}, { rollMode: roll.options.rollMode })
}
}