Nouveaux items Arme et Armure (DataModel + feuille + CSS)
Items: - CelestopolWeapon : degats (0/1/2/X), portee (contact/courte/longue), description - CelestopolArmure : protection (1-2), malus (0-2), description Config: - WEAPON_DAMAGE_TYPES et WEAPON_RANGE_TYPES ajoutés dans system.mjs - Enregistrement des DataModels, sheets et templates dans fvtt-celestopol.mjs - system.json : types weapon et armure avec htmlFields UI: - weapon.hbs : badge de dégâts avec hint, sélecteurs portée/dégâts - armure.hbs : blocs protection + malus art-déco - items.less : styles .weapon et .armure i18n: clés Weapon.*, Armure.*, Sheet.weapon, Sheet.armure Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -76,3 +76,29 @@ export class CelestopolEquipment extends foundry.abstract.TypeDataModel {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class CelestopolWeapon extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields
|
||||
const reqInt = { required: true, nullable: false, integer: true }
|
||||
return {
|
||||
degats: new fields.StringField({ required: true, nullable: false, initial: "0",
|
||||
choices: Object.keys(SYSTEM.WEAPON_DAMAGE_TYPES) }),
|
||||
portee: new fields.StringField({ required: true, nullable: false, initial: "contact",
|
||||
choices: Object.keys(SYSTEM.WEAPON_RANGE_TYPES) }),
|
||||
description: new fields.HTMLField({ required: true, textSearch: true }),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class CelestopolArmure extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields
|
||||
const reqInt = { required: true, nullable: false, integer: true }
|
||||
return {
|
||||
protection: new fields.NumberField({ ...reqInt, initial: 1, min: 1, max: 2 }),
|
||||
malus: new fields.NumberField({ ...reqInt, initial: 0, min: 0, max: 2 }),
|
||||
description: new fields.HTMLField({ required: true, textSearch: true }),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user