diff --git a/lang/fr.json b/lang/fr.json index bfddd7b..f78eb30 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -233,7 +233,10 @@ "portee": "Portée", "rangeContact": "Contact", "rangeCourte": "Courte portée", - "rangeLongue": "Longue portée" + "rangeLongue": "Longue portée", + "type": "Type", + "typeMelee": "Mêlée", + "typeDistance": "Distance" }, "Armure": { "protection": "Protection", diff --git a/module/applications/sheets/item-sheets.mjs b/module/applications/sheets/item-sheets.mjs index 05ebf84..f8a519f 100644 --- a/module/applications/sheets/item-sheets.mjs +++ b/module/applications/sheets/item-sheets.mjs @@ -82,6 +82,7 @@ export class CelestopolWeaponSheet extends CelestopolItemSheet { const ctx = await super._prepareContext() ctx.damageTypes = SYSTEM.WEAPON_DAMAGE_TYPES ctx.rangeTypes = SYSTEM.WEAPON_RANGE_TYPES + ctx.combatTypes = SYSTEM.WEAPON_COMBAT_TYPES ctx.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML( this.document.system.description, { async: true }) return ctx diff --git a/module/config/system.mjs b/module/config/system.mjs index 839537d..3cf93ab 100644 --- a/module/config/system.mjs +++ b/module/config/system.mjs @@ -140,6 +140,12 @@ export const EQUIPMENT_TYPES = { vehicule: { id: "vehicule", label: "CELESTOPOL.Equipment.vehicule" }, } +/** Types d'armes (mêlée / distance). */ +export const WEAPON_COMBAT_TYPES = { + melee: { id: "melee", label: "CELESTOPOL.Weapon.typeMelee" }, + distance: { id: "distance", label: "CELESTOPOL.Weapon.typeDistance" }, +} + /** Niveaux de dégâts des armes (règles p. ?). */ export const WEAPON_DAMAGE_TYPES = { "0": { id: "0", label: "CELESTOPOL.Weapon.degats0", hint: "CELESTOPOL.Weapon.degats0Hint" }, @@ -171,4 +177,5 @@ export const SYSTEM = { EQUIPMENT_TYPES, WEAPON_DAMAGE_TYPES, WEAPON_RANGE_TYPES, + WEAPON_COMBAT_TYPES, } diff --git a/module/models/items.mjs b/module/models/items.mjs index 7510f61..ec687c5 100644 --- a/module/models/items.mjs +++ b/module/models/items.mjs @@ -82,6 +82,8 @@ export class CelestopolWeapon extends foundry.abstract.TypeDataModel { const fields = foundry.data.fields const reqInt = { required: true, nullable: false, integer: true } return { + type: new fields.StringField({ required: true, nullable: false, initial: "melee", + choices: Object.keys(SYSTEM.WEAPON_COMBAT_TYPES) }), 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", diff --git a/templates/weapon.hbs b/templates/weapon.hbs index 1a96ae0..072d863 100644 --- a/templates/weapon.hbs +++ b/templates/weapon.hbs @@ -6,6 +6,16 @@