Fix shield definition

This commit is contained in:
2024-12-21 20:32:18 +01:00
parent da665ad955
commit 98242fe0a0
5 changed files with 43 additions and 33 deletions

View File

@ -49,6 +49,24 @@ export const MONEY = {
}
}
export const DICE_VALUES = {
"d3": "D3",
"d4": "D4",
"d6": "D6",
"d8": "D8",
"d10": "D10",
"d12": "D12",
"d20": "D20"
}
export const DEFENSE_DICE_VALUES = {
"d3": "D3",
"d4": "D4",
"d6": "D6",
"d8": "D8",
"d10": "D10"
}
export const ASCII = `
······················································································································
: :
@ -78,7 +96,8 @@ export const SYSTEM = {
SPELL_RANGE: SPELL.RANGE,
WEAPON_TYPE: WEAPON.WEAPON_TYPE,
WEAPON_CLASS: WEAPON.WEAPON_CLASS,
COMBAT_PROGRESSION_DICE: WEAPON.COMBAT_PROGRESSION_DICE,
COMBAT_PROGRESSION_DICE: DICE_VALUES,
SHIELD_DEFENSE_DICE: DEFENSE_DICE_VALUES,
MONEY,
ASCII,
ROLL_TYPE,

View File

@ -4,16 +4,6 @@ export const WEAPON_TYPE = {
"ranged": "LETHALFANTASY.Weapon.WeaponType.ranged"
}
export const COMBAT_PROGRESSION_DICE = {
"d3": "D3",
"d4": "D4",
"d6": "D6",
"d8": "D8",
"d10": "D10",
"d12": "D12",
"d20": "D20"
}
export const WEAPON_CLASS = {
"longblade": "LETHALFANTASY.Weapon.WeaponClass.longblade",
"shortblade": "LETHALFANTASY.Weapon.WeaponClass.shortblade",

View File

@ -6,8 +6,9 @@ export default class LethalFantasyShield extends foundry.abstract.TypeDataModel
const requiredInteger = { required: true, nullable: false, integer: true }
schema.description = new fields.HTMLField({ required: true, textSearch: true })
schema.defense = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: -50 })
schema.defense = new fields.StringField({required: true, initial: "d4", choices: SYSTEM.SHIELD_DEFENSE_DICE})
schema.movementreduction = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
schema.standing = new fields.SchemaField({
min: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 }),
max: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })