Initial import

This commit is contained in:
2024-11-21 23:59:44 +01:00
commit d8ce83bcf2
98 changed files with 120909 additions and 0 deletions

24
module/models/weapon.mjs Normal file
View File

@ -0,0 +1,24 @@
import { SYSTEM } from "../config/system.mjs"
import { CATEGORY } from "../config/weapon.mjs"
export default class LethalFantasyWeapon extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields
const schema = {}
schema.description = new fields.HTMLField({ required: true, textSearch: true })
schema.categorie = new fields.StringField({ required: true, initial: "mains", choices: SYSTEM.WEAPON_CATEGORY })
schema.degats = new fields.StringField({
required: true,
initial: SYSTEM.WEAPON_DAMAGE.UN,
choices: Object.fromEntries(Object.entries(SYSTEM.WEAPON_DAMAGE).map(([key, value]) => [value, { label: `${value}` }])),
})
return schema
}
/** @override */
static LOCALIZATION_PREFIXES = ["TENEBRIS.Weapon"]
get weaponCategory() {
return game.i18n.localize(CATEGORY[this.categorie].label)
}
}