Fix shield definition

This commit is contained in:
LeRatierBretonnien 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 = ` export const ASCII = `
······················································································································ ······················································································································
: : : :
@ -78,7 +96,8 @@ export const SYSTEM = {
SPELL_RANGE: SPELL.RANGE, SPELL_RANGE: SPELL.RANGE,
WEAPON_TYPE: WEAPON.WEAPON_TYPE, WEAPON_TYPE: WEAPON.WEAPON_TYPE,
WEAPON_CLASS: WEAPON.WEAPON_CLASS, WEAPON_CLASS: WEAPON.WEAPON_CLASS,
COMBAT_PROGRESSION_DICE: WEAPON.COMBAT_PROGRESSION_DICE, COMBAT_PROGRESSION_DICE: DICE_VALUES,
SHIELD_DEFENSE_DICE: DEFENSE_DICE_VALUES,
MONEY, MONEY,
ASCII, ASCII,
ROLL_TYPE, ROLL_TYPE,

View File

@ -4,16 +4,6 @@ export const WEAPON_TYPE = {
"ranged": "LETHALFANTASY.Weapon.WeaponType.ranged" "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 = { export const WEAPON_CLASS = {
"longblade": "LETHALFANTASY.Weapon.WeaponClass.longblade", "longblade": "LETHALFANTASY.Weapon.WeaponClass.longblade",
"shortblade": "LETHALFANTASY.Weapon.WeaponClass.shortblade", "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 } const requiredInteger = { required: true, nullable: false, integer: true }
schema.description = new fields.HTMLField({ required: true, textSearch: 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.movementreduction = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
schema.standing = new fields.SchemaField({ schema.standing = new fields.SchemaField({
min: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 }), min: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 }),
max: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 }) max: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })

View File

@ -6,7 +6,7 @@
"download": "#{DOWNLOAD}#", "download": "#{DOWNLOAD}#",
"url": "#{URL}#", "url": "#{URL}#",
"license": "LICENSE", "license": "LICENSE",
"version": "12.0.6", "version": "12.0.7",
"authors": [ "authors": [
{ {
"name": "Uberwald", "name": "Uberwald",

View File

@ -6,20 +6,20 @@
<div class="flexrow"> <div class="flexrow">
<div class="align-top"> <div class="align-top">
{{formField systemFields.defense value=system.defense}} {{formField systemFields.defense value=system.defense}}
{{formField systemFields.movementreduction value=system.movementreduction}}
<label>Standing</label> <div class="shift-right">&nbsp;
<div class="shift-right"> </div>
{{formField systemFields.standing.fields.min value=system.standing.min}}
{{formField systemFields.standing.fields.max value=system.standing.min}}
</div>
<label>Cover vs ranged attacks</label>
<div class="shift-right">
<label>Standing </label>
<div class="flexrow">{{formField systemFields.standing.fields.min value=system.standing.min}} &nbsp;...&nbsp;30</div>
</div>
<div class="shift-right">
<label>Crouching</label> <label>Crouching</label>
<div class="shift-right"> <div class="flexrow">{{formField systemFields.crouching.fields.min value=system.crouching.min}} &nbsp;...&nbsp;30</div>
{{formField systemFields.crouching.fields.min value=system.crouching.min}} </div>
{{formField systemFields.crouching.fields.max value=system.crouching.min}}
</div>
</div> </div>
<div class="align-top"> <div class="align-top">
@ -51,11 +51,11 @@
<fieldset> <fieldset>
<legend>{{localize "LETHALFANTASY.Label.description"}}</legend> <legend>{{localize "LETHALFANTASY.Label.description"}}</legend>
{{formInput {{formInput
systemFields.description systemFields.description
enriched=enrichedDescription enriched=enrichedDescription
value=system.description value=system.description
name="system.description" name="system.description"
toggled="false" toggled="false"
}} }}
</fieldset> </fieldset>
</section> </section>