diff --git a/css/fvtt-lethal-fantasy.css b/css/fvtt-lethal-fantasy.css index 5b21d5b..a3f77e0 100644 --- a/css/fvtt-lethal-fantasy.css +++ b/css/fvtt-lethal-fantasy.css @@ -1178,6 +1178,45 @@ i.lethalfantasy { margin-left: 4px; margin-right: 4px; } +.lethalfantasy .tab.monster-combat .ranged-attacks { + grid-template-columns: 1fr; +} +.lethalfantasy .tab.monster-combat .ranged-attacks .attack .name { + min-width: 10rem; + max-width: 10rem; +} +.lethalfantasy .tab.monster-combat .ranged-attacks .attack .damage-dice { + width: 5rem; + max-width: 5rem; +} +.lethalfantasy .tab.monster-combat .ranged-attacks .ranged-weapon-range { + margin-top: 8px; + border-top: 1px solid var(--color-border-light-tertiary, #ccc); + padding-top: 6px; +} +.lethalfantasy .tab.monster-combat .ranged-attacks .ranged-weapon-range > label { + font-weight: bold; + margin-bottom: 4px; + display: block; +} +.lethalfantasy .tab.monster-combat .ranged-attacks .ranged-weapon-range .range-fields { + display: flex; + flex-wrap: wrap; + gap: 6px; +} +.lethalfantasy .tab.monster-combat .ranged-attacks .ranged-weapon-range .range-fields .range-field { + display: flex; + flex-direction: column; + align-items: center; +} +.lethalfantasy .tab.monster-combat .ranged-attacks .ranged-weapon-range .range-fields .range-field label { + font-size: 0.7rem; + white-space: nowrap; +} +.lethalfantasy .tab.monster-combat .ranged-attacks .ranged-weapon-range .range-fields .range-field input { + width: 3.5rem; + text-align: center; +} .lethalfantasy .tab.monster-combat .armors { display: grid; grid-template-columns: repeat(3, 1fr); diff --git a/lang/en.json b/lang/en.json index c08acef..1870fda 100644 --- a/lang/en.json +++ b/lang/en.json @@ -462,6 +462,13 @@ "notes": "Notes", "pc": "PC", "perception": "Perception", + "pointBlank": "Point blank", + "short": "Short", + "medium": "Medium", + "long": "Long", + "extreme": "Extreme", + "outOfSkill": "Out of skill", + "range": "Range", "rangeDefenseDialog": "Ranged defense dialog", "rangeDefenseRoll": "Ranged defense roll", "rangedAttackDefense": "Ranged attack defense", diff --git a/module/models/monster.mjs b/module/models/monster.mjs index 4dd165e..3579ee4 100644 --- a/module/models/monster.mjs +++ b/module/models/monster.mjs @@ -74,7 +74,6 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel damageDice: new fields.StringField({ required: true, nullable: false, initial: "1D6" }), damageModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }), enabled: new fields.BooleanField({ initial: true, required: true, nullable: false }), - range: new fields.StringField({ required: false, nullable: true, initial: "" }), noExplode: new fields.BooleanField({ initial: initialNoExplode, required: true, nullable: false }), } return new fields.SchemaField(schema, { label }) @@ -143,6 +142,15 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel attack4: attackField("4") }) + schema.rangedWeaponRange = new fields.SchemaField({ + pointBlank: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 }), + short: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 }), + medium: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 }), + long: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 }), + extreme: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 }), + outOfSkill: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 }) + }) + return schema } diff --git a/styles/monster.less b/styles/monster.less index 209bb42..f6f04af 100644 --- a/styles/monster.less +++ b/styles/monster.less @@ -410,6 +410,48 @@ } } + .ranged-attacks { + grid-template-columns: 1fr; + .attack { + .name { + min-width: 10rem; + max-width: 10rem; + } + .damage-dice { + width: 5rem; + max-width: 5rem; + } + } + .ranged-weapon-range { + margin-top: 8px; + border-top: 1px solid var(--color-border-light-tertiary, #ccc); + padding-top: 6px; + > label { + font-weight: bold; + margin-bottom: 4px; + display: block; + } + .range-fields { + display: flex; + flex-wrap: wrap; + gap: 6px; + .range-field { + display: flex; + flex-direction: column; + align-items: center; + label { + font-size: 0.7rem; + white-space: nowrap; + } + input { + width: 3.5rem; + text-align: center; + } + } + } + } + } + .armors { display: grid; grid-template-columns: repeat(3, 1fr); diff --git a/templates/monster-combat.hbs b/templates/monster-combat.hbs index b74a708..be014a2 100644 --- a/templates/monster-combat.hbs +++ b/templates/monster-combat.hbs @@ -101,9 +101,6 @@
-
- -
@@ -128,6 +125,36 @@ {{/each}} + +
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
{{/if}}