From 321ba7d3d6c61dc3ee602ebeacfc782e31c78433 Mon Sep 17 00:00:00 2001 From: macniel Date: Mon, 20 Oct 2025 18:11:52 +0200 Subject: [PATCH] restores drag and drop functionality for items onto character sheet --- src/module/data/character.mjs | 4 +- src/module/data/equipment.mjs | 19 ++- src/module/sheets/character/advsf.mjs | 12 +- src/module/sheets/character/equipment.mjs | 3 +- src/module/sheets/characterSheet.mjs | 18 ++- src/module/sheets/equipmentSheet.mjs | 111 ++++++++++++------ src/packs/_source/munition/balläster-m.json | 24 ++-- src/packs/_source/munition/eisenwalder-m.json | 24 ++-- src/packs/_source/munition/elfenbogen-m.json | 24 ++-- .../_source/munition/kompositbogen-m.json | 24 ++-- src/packs/_source/munition/kriegsbogen-m.json | 24 ++-- src/packs/_source/munition/kurzbogen-m.json | 24 ++-- src/packs/_source/munition/langbogen-m.json | 24 ++-- .../_source/munition/leichte-armbrust-m.json | 24 ++-- .../_source/munition/windenarmbrust-m.json | 24 ++-- src/packs/_source/ruestzeug/buckler.json | 14 +-- .../_source/ruestzeug/dicke-kleidung.json | 23 ++-- .../_source/ruestzeug/garether-platte.json | 23 ++-- .../ruestzeug/horasischer-reiterharnisch.json | 25 ++-- .../_source/ruestzeug/kettenhemd-halbarm.json | 25 ++-- .../ruestzeug/komplette-gestechruestung.json | 25 ++-- src/packs/_source/ruestzeug/kroetenhaut.json | 23 ++-- src/packs/_source/ruestzeug/kuerass.json | 25 ++-- .../_source/ruestzeug/langes-kettenhemd.json | 25 ++-- .../_source/ruestzeug/lederharnisch.json | 25 ++-- .../_source/ruestzeug/leichte-platte.json | 25 ++-- .../_source/ruestzeug/schuppenpanzer.json | 25 ++-- .../_source/ruestzeug/spiegelpanzer.json | 25 ++-- .../ruestzeug/wattierte-unterkleidung.json | 10 +- .../ruestzeug/wattierter-waffenrock.json | 23 ++-- src/style/molecules/_droppables.scss | 27 +++++ .../item/equipment/tab-ammunition.hbs | 15 +++ src/templates/item/equipment/tab-armor.hbs | 47 +++++++- .../item/equipment/tab-container.hbs | 7 -- src/templates/item/equipment/tab-meta.hbs | 4 +- src/templates/item/equipment/tab-settings.hbs | 25 ++++ src/templates/ui/partial-equipment-button.hbs | 2 +- 37 files changed, 434 insertions(+), 417 deletions(-) create mode 100644 src/style/molecules/_droppables.scss create mode 100644 src/templates/item/equipment/tab-ammunition.hbs delete mode 100644 src/templates/item/equipment/tab-container.hbs create mode 100644 src/templates/item/equipment/tab-settings.hbs diff --git a/src/module/data/character.mjs b/src/module/data/character.mjs index 433c8865..fc0ed27d 100644 --- a/src/module/data/character.mjs +++ b/src/module/data/character.mjs @@ -1,12 +1,12 @@ +import {Equipment} from "../documents/equipment.mjs"; + const { SchemaField, NumberField, StringField, HTMLField, - EmbeddedDocumentField, DocumentIdField, ArrayField, - ForeignDocumentField } = foundry.data.fields; export class PlayerCharacterDataModel extends foundry.abstract.TypeDataModel { diff --git a/src/module/data/equipment.mjs b/src/module/data/equipment.mjs index 7025da9a..0e4a1ea8 100644 --- a/src/module/data/equipment.mjs +++ b/src/module/data/equipment.mjs @@ -1,7 +1,8 @@ import BaseItem from "./base-item.mjs"; +import {Equipment} from "../documents/equipment.mjs"; const { - ArrayField, NumberField, StringField, HTMLField + ArrayField, EmbeddedCollectionField, SchemaField, NumberField, StringField, HTMLField } = foundry.data.fields; export class EquipmentDataModel extends BaseItem { @@ -34,9 +35,23 @@ export class EquipmentDataModel extends BaseItem { rangedAttackDamage: new StringField(), rangedReloadTime: new NumberField({required: false}), - armorValue: new NumberField({required: false}), + armorValue: new SchemaField({ + total: new NumberField({required: true, initial: 0}), + arme: new NumberField({required: true, initial: 0}), + beine: new NumberField({required: true, initial: 0}), + rücken: new NumberField({required: true, initial: 0}), + bauch: new NumberField({required: true, initial: 0}), + brust: new NumberField({required: true, initial: 0}), + kopf: new NumberField({required: true, initial: 0}), + }, {required: false}), armorHandicap: new NumberField({required: false}), + + ammunition: new SchemaField({ + max: new NumberField({required: true, initial: 1}), + count: new NumberField({required: true, initial: 1}), + }, {required: false}), } } + } diff --git a/src/module/sheets/character/advsf.mjs b/src/module/sheets/character/advsf.mjs index 7b77ed96..018cbf53 100644 --- a/src/module/sheets/character/advsf.mjs +++ b/src/module/sheets/character/advsf.mjs @@ -35,8 +35,16 @@ export default { return context }, - _onRender: (context, options) => { - + _onRender: (context, options, thisObject) => { + new foundry.applications.ux.DragDrop.implementation({ + dropSelector: ".advantages, .special-abilities", + permissions: { + drop: thisObject._canDragDrop.bind(thisObject) + }, + callbacks: { + drop: thisObject._onDrop.bind(thisObject), + } + }).bind(thisObject.element); }, _getTabConfig: (group) => { group.tabs.push({id: "advsf", group: "sheet", label: "Vorteile"}) diff --git a/src/module/sheets/character/equipment.mjs b/src/module/sheets/character/equipment.mjs index 47957a1d..9e474974 100644 --- a/src/module/sheets/character/equipment.mjs +++ b/src/module/sheets/character/equipment.mjs @@ -137,7 +137,8 @@ export default { }, callbacks: { dragstart: thisObject._onDragStart.bind(thisObject), - drop: thisObject._onDrop.bind(thisObject) + drop: thisObject._onDrop.bind(thisObject), + dragover: thisObject._onDragOver.bind(thisObject) } }).bind(thisObject.element); diff --git a/src/module/sheets/characterSheet.mjs b/src/module/sheets/characterSheet.mjs index 73613520..d39318cc 100644 --- a/src/module/sheets/characterSheet.mjs +++ b/src/module/sheets/characterSheet.mjs @@ -369,7 +369,7 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { _onRender(context, options) { Meta._onRender(context, options, this.element) Social._onRender(context, options, this.element) - Advsf._onRender(context, options, this.element) + Advsf._onRender(context, options, this) Combat._onRender(context, options, this.element) Effects._onRender(context, options, this.element) Equipment._onRender(context, options, this) @@ -378,6 +378,11 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { Spells._onRender(context, options, this.element) } + async _canDragDrop() { + return true + } + + // TODO needs to be fixed once Character Sheet is migrated to ActorSheetV2 async _onDrop(event) { const data = TextEditor.implementation.getDragEventData(event); @@ -389,11 +394,14 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { const documentClass = foundry.utils.getDocumentClass(data.type); if (documentClass) { const document = await documentClass.fromDropData(data); - await this._onDropDocument(event, document); - // No duplication by moving items from one actor to another - if (document.parent) { - document.parent.items.get(document._id).delete() + if (document.type === "Equipment" || document.type === "Advantage" || document.type === "Spell" || document.type === "Liturgy" || document.type === "ActiveEffect" || document.type === "SpecialAbility") { + // No duplication by moving items from one actor to another + if (document.parent && document.parent !== this.actor) { + document.parent.items.get(document._id).delete() + } + + await this._onDropDocument(event, document); } } } diff --git a/src/module/sheets/equipmentSheet.mjs b/src/module/sheets/equipmentSheet.mjs index a5c3f878..d087fd4c 100644 --- a/src/module/sheets/equipmentSheet.mjs +++ b/src/module/sheets/equipmentSheet.mjs @@ -56,12 +56,16 @@ export class EquipmentSheet extends HandlebarsApplicationMixin(DocumentSheetV2) ranged: { template: `systems/DSA_4-1/templates/item/equipment/tab-ranged.hbs` }, - container: { - template: `systems/DSA_4-1/templates/item/equipment/tab-container.hbs` + ammunition: { + template: `systems/DSA_4-1/templates/item/equipment/tab-ammunition.hbs` }, armor: { template: `systems/DSA_4-1/templates/item/equipment/tab-armor.hbs` - } + }, + settings: { + template: `systems/DSA_4-1/templates/item/equipment/tab-settings.hbs` + }, + } /** @@ -84,6 +88,17 @@ export class EquipmentSheet extends HandlebarsApplicationMixin(DocumentSheetV2) } }) + // manage categories into array + normalisedFormData['system.category'] = [] + if (normalisedFormData.isMelee) normalisedFormData['system.category'].push("Nahkampfwaffe") + delete normalisedFormData.isMelee + if (normalisedFormData.isRanged) normalisedFormData['system.category'].push("Fernkampfwaffe") + delete normalisedFormData.isRanged + if (normalisedFormData.isAmmunition) normalisedFormData['system.category'].push("Munition") + delete normalisedFormData.isAmmunition + if (normalisedFormData.isArmor) normalisedFormData['system.category'].push("Rüstung") + delete normalisedFormData.isArmor + await this.document.update(normalisedFormData) // Note: formData.object } @@ -98,12 +113,12 @@ export class EquipmentSheet extends HandlebarsApplicationMixin(DocumentSheetV2) case 'ranged': this.#prepareRangedContext(context) break; - case 'container': - this.#prepareContainerContext(context) - break; case 'armor': this.#prepareArmorContext(context) break; + case 'settings': + this.#prepareSettingsContext(context) + break; } context.tab = context.tabs[partId] return context @@ -123,7 +138,6 @@ export class EquipmentSheet extends HandlebarsApplicationMixin(DocumentSheetV2) Nahkampfwaffe: "Nahkampfwaffe", Fernkampfwaffe: "Fernkampfwaffe", Behälter: "Behälter", - Rüstung: "Rüstung", }, entries: equipmentData.category, targetField: "category" @@ -171,7 +185,7 @@ export class EquipmentSheet extends HandlebarsApplicationMixin(DocumentSheetV2) } } - #prepareContainerContext(context) { + #prepareAmmunitionContext(context) { } @@ -179,44 +193,49 @@ export class EquipmentSheet extends HandlebarsApplicationMixin(DocumentSheetV2) } + #prepareSettingsContext(context) { + context.isMelee = this.document.system.category.includes("Nahkampfwaffe") + context.isRanged = this.document.system.category.includes("Fernkampfwaffe") + context.isAmmunition = this.document.system.category.includes("Munition") + context.isArmor = this.document.system.category.includes("Rüstung") + } + /** * Adds Tabs based on the items nature * - * @param {String} tabGroup + * @param {String} group * @private */ - _prepareTabs(tabGroup) { + _getTabsConfig(group) { - const currentTabs = super._prepareTabs(tabGroup) + const tabs = foundry.utils.deepClone(super._getTabsConfig(group)) const category = this.document.system.category /** * * @type {[{ApplicationTab}]} */ - let tabs = currentTabs if (category.includes("Nahkampfwaffe")) { - tabs.melee = { - id: 'melee', group: tabGroup, label: 'Nahkampfwaffe' - } + tabs.tabs.push({ + id: 'melee', group: group, label: 'Nahkampfwaffe' + }) } if (category.includes("Fernkampfwaffe")) { - tabs.ranged = { - id: 'ranged', group: tabGroup, label: 'Fernkampfwaffe' - } - } - if (category.includes("Behälter")) { - tabs.container = { - id: 'container', group: tabGroup, label: 'Behälter' - } + tabs.tabs.push({ + id: 'ranged', group: group, label: 'Fernkampfwaffe' + }) } if (category.includes("Rüstung")) { - tabs.armor = { - id: 'armor', group: tabGroup, label: 'Rüstung' - } + tabs.tabs.push({ + id: 'armor', group: group, label: 'Rüstung' + }) } + tabs.tabs.push({ + id: 'settings', group: group, label: 'Einstellungen' + }) + return tabs } @@ -226,6 +245,8 @@ export class EquipmentSheet extends HandlebarsApplicationMixin(DocumentSheetV2) const context = await super._prepareContext(options) context.price = context.document.system.price context.weight = context.document.system.weight + context.inventoryItems = [] + context.containerVolume = context.document.system.containerVolume return context } @@ -238,14 +259,38 @@ export class EquipmentSheet extends HandlebarsApplicationMixin(DocumentSheetV2) * @protected */ _onRender(context, options) { - this.element.querySelector('.array-editor select').addEventListener('change', (evt) => { - const addingValue = evt.currentTarget.value - const fieldToTarget = evt.currentTarget.dataset.targetField - const newSkills = [...this.document.system[fieldToTarget], addingValue] - this.document.update({system: {[fieldToTarget]: newSkills}}) - evt.currentTarget.value = "" - }) + new foundry.applications.ux.DragDrop.implementation({ + dropSelector: ".inventory-table", + permissions: { + drop: this._canDragDrop.bind(this) + }, + callbacks: { + drop: this._onDrop.bind(this) + } + }).bind(this.element); + } + + _canDragDrop(event) { + console.log(event) + return true + } + + async _onDrop(event) { + const data = TextEditor.implementation.getDragEventData(event); + + // Dropped Documents + const documentClass = foundry.utils.getDocumentClass(data.type); + if (documentClass) { + + const document = await documentClass.fromDropData(data) + + console.log(document, document.parent) + + // Dropped Documents + + document.update({"parent": this.document}) + } } } diff --git a/src/packs/_source/munition/balläster-m.json b/src/packs/_source/munition/balläster-m.json index 27ef87dc..14817e5e 100644 --- a/src/packs/_source/munition/balläster-m.json +++ b/src/packs/_source/munition/balläster-m.json @@ -2,24 +2,14 @@ "name": "Munition (Balläster)", "image": "systems/DSA_4-1/assets/arsenal/arrow3.png", "category": [ - "Gegenstand" + "Gegenstand", + "Munition" ], "weight": 0.125, "price": 0.6, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 0, - "armorHandicap": 0, - "description": "" + "description": "", + "ammunition": { + "max": 1, + "count": 1 + } } diff --git a/src/packs/_source/munition/eisenwalder-m.json b/src/packs/_source/munition/eisenwalder-m.json index 008ca7b9..3d9780ac 100644 --- a/src/packs/_source/munition/eisenwalder-m.json +++ b/src/packs/_source/munition/eisenwalder-m.json @@ -2,24 +2,14 @@ "name": "Munition (Eisenwalder)", "image": "systems/DSA_4-1/assets/arsenal/arrow3.png", "category": [ - "Gegenstand" + "Gegenstand", + "Munition" ], "weight": 0, "price": 1.5, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 0, - "armorHandicap": 0, - "description": "" + "description": "", + "ammunition": { + "max": 10, + "count": 10 + } } diff --git a/src/packs/_source/munition/elfenbogen-m.json b/src/packs/_source/munition/elfenbogen-m.json index 64c590fb..2aef5eaa 100644 --- a/src/packs/_source/munition/elfenbogen-m.json +++ b/src/packs/_source/munition/elfenbogen-m.json @@ -2,24 +2,14 @@ "name": "Munition (Elfenbogen)", "image": "systems/DSA_4-1/assets/arsenal/arrow2.png", "category": [ - "Gegenstand" + "Gegenstand", + "Munition" ], "weight": 0.075, "price": 0.4, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 0, - "armorHandicap": 0, - "description": "" + "description": "", + "ammunition": { + "max": 1, + "count": 1 + } } diff --git a/src/packs/_source/munition/kompositbogen-m.json b/src/packs/_source/munition/kompositbogen-m.json index cd73f87a..055aae0c 100644 --- a/src/packs/_source/munition/kompositbogen-m.json +++ b/src/packs/_source/munition/kompositbogen-m.json @@ -2,24 +2,14 @@ "name": "Munition (Kompositbogen)", "image": "systems/DSA_4-1/assets/arsenal/arrow1.png", "category": [ - "Gegenstand" + "Gegenstand", + "Munition" ], "weight": 0.05, "price": 0.25, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 0, - "armorHandicap": 0, - "description": "" + "description": "", + "ammunition": { + "max": 1, + "count": 1 + } } diff --git a/src/packs/_source/munition/kriegsbogen-m.json b/src/packs/_source/munition/kriegsbogen-m.json index 08ddb371..66e7a9ac 100644 --- a/src/packs/_source/munition/kriegsbogen-m.json +++ b/src/packs/_source/munition/kriegsbogen-m.json @@ -2,24 +2,14 @@ "name": "Munition (Kriegsbogen)", "image": "systems/DSA_4-1/assets/arsenal/arrow1.png", "category": [ - "Gegenstand" + "Gegenstand", + "Munition" ], "weight": 0.1, "price": 0.6, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 0, - "armorHandicap": 0, - "description": "" + "description": "", + "ammunition": { + "max": 1, + "count": 1 + } } diff --git a/src/packs/_source/munition/kurzbogen-m.json b/src/packs/_source/munition/kurzbogen-m.json index 2e174c37..5ac2fc28 100644 --- a/src/packs/_source/munition/kurzbogen-m.json +++ b/src/packs/_source/munition/kurzbogen-m.json @@ -2,24 +2,14 @@ "name": "Munition (Kurzbogen)", "image": "systems/DSA_4-1/assets/arsenal/arrow1.png", "category": [ - "Gegenstand" + "Gegenstand", + "Munition" ], "weight": 0.05, "price": 0.25, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 0, - "armorHandicap": 0, - "description": "" + "description": "", + "ammunition": { + "max": 1, + "count": 1 + } } diff --git a/src/packs/_source/munition/langbogen-m.json b/src/packs/_source/munition/langbogen-m.json index 5d8978a7..fc89dfbf 100644 --- a/src/packs/_source/munition/langbogen-m.json +++ b/src/packs/_source/munition/langbogen-m.json @@ -2,24 +2,14 @@ "name": "Munition (Langbogen)", "image": "systems/DSA_4-1/assets/arsenal/arrow1.png", "category": [ - "Gegenstand" + "Gegenstand", + "Munition" ], "weight": 0.075, "price": 0.4, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 0, - "armorHandicap": 0, - "description": "" + "description": "", + "ammunition": { + "max": 1, + "count": 1 + } } diff --git a/src/packs/_source/munition/leichte-armbrust-m.json b/src/packs/_source/munition/leichte-armbrust-m.json index e61e3b5f..fc700dfa 100644 --- a/src/packs/_source/munition/leichte-armbrust-m.json +++ b/src/packs/_source/munition/leichte-armbrust-m.json @@ -2,24 +2,14 @@ "name": "Munition (Leichte Armbrust)", "image": "systems/DSA_4-1/assets/arsenal/arrow3.png", "category": [ - "Gegenstand" + "Gegenstand", + "Munition" ], "weight": 0.075, "price": 1.5, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 0, - "armorHandicap": 0, - "description": "" + "description": "", + "ammunition": { + "max": 1, + "count": 1 + } } diff --git a/src/packs/_source/munition/windenarmbrust-m.json b/src/packs/_source/munition/windenarmbrust-m.json index 3086a929..5cf359bd 100644 --- a/src/packs/_source/munition/windenarmbrust-m.json +++ b/src/packs/_source/munition/windenarmbrust-m.json @@ -2,24 +2,14 @@ "name": "Munition (Windenarmbrust)", "image": "systems/DSA_4-1/assets/arsenal/arrow3.png", "category": [ - "Gegenstand" + "Gegenstand", + "Munition" ], "weight": 0.1, "price": 2, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 0, - "armorHandicap": 0, - "description": "" + "description": "", + "ammunition": { + "max": 1, + "count": 1 + } } diff --git a/src/packs/_source/ruestzeug/buckler.json b/src/packs/_source/ruestzeug/buckler.json index 8915102f..c7ea362d 100644 --- a/src/packs/_source/ruestzeug/buckler.json +++ b/src/packs/_source/ruestzeug/buckler.json @@ -8,21 +8,13 @@ "weight": 1, "price": 40, "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 1, + "iniModifier": -1, + "attackModifier": -2, + "parryModifier": -1, "meleeAttackModifier": 0, "meleeAttackModifierIncrement": 0, "meleeSkills": [ "Schilde" ], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 1, - "armorHandicap": 1, "description": "" } diff --git a/src/packs/_source/ruestzeug/dicke-kleidung.json b/src/packs/_source/ruestzeug/dicke-kleidung.json index e0a41a1a..d4fd700a 100644 --- a/src/packs/_source/ruestzeug/dicke-kleidung.json +++ b/src/packs/_source/ruestzeug/dicke-kleidung.json @@ -7,20 +7,15 @@ ], "weight": 3, "price": 0, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 1, + "armorValue": { + "total": 1, + "kopf": 0, + "brust": 1, + "rücken": 1, + "bauch": 1, + "arme": 1, + "beine": 1 + }, "armorHandicap": 1, "description": "" } diff --git a/src/packs/_source/ruestzeug/garether-platte.json b/src/packs/_source/ruestzeug/garether-platte.json index e4dcc56d..52a1bfde 100644 --- a/src/packs/_source/ruestzeug/garether-platte.json +++ b/src/packs/_source/ruestzeug/garether-platte.json @@ -7,20 +7,15 @@ ], "weight": 14, "price": 750, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 6, + "armorValue": { + "total": 5, + "kopf": 0, + "brust": 6, + "rücken": 5, + "bauch": 6, + "arme": 5, + "beine": 4 + }, "armorHandicap": 4, "description": "" } diff --git a/src/packs/_source/ruestzeug/horasischer-reiterharnisch.json b/src/packs/_source/ruestzeug/horasischer-reiterharnisch.json index 478b77b7..edc31c64 100644 --- a/src/packs/_source/ruestzeug/horasischer-reiterharnisch.json +++ b/src/packs/_source/ruestzeug/horasischer-reiterharnisch.json @@ -7,20 +7,15 @@ ], "weight": 17, "price": 1000, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 8, - "armorHandicap": 5, + "armorValue": { + "total": 6, + "kopf": 3, + "brust": 7, + "rücken": 5, + "bauch": 7, + "arme": 5, + "beine": 5 + }, + "armorHandicap": 4, "description": "" } diff --git a/src/packs/_source/ruestzeug/kettenhemd-halbarm.json b/src/packs/_source/ruestzeug/kettenhemd-halbarm.json index 7f18342b..df24043e 100644 --- a/src/packs/_source/ruestzeug/kettenhemd-halbarm.json +++ b/src/packs/_source/ruestzeug/kettenhemd-halbarm.json @@ -7,20 +7,15 @@ ], "weight": 6.5, "price": 150, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 3, - "armorHandicap": 3, + "armorValue": { + "total": 3, + "kopf": 0, + "brust": 4, + "rücken": 4, + "bauch": 4, + "arme": 2, + "beine": 1 + }, + "armorHandicap": 2, "description": "" } diff --git a/src/packs/_source/ruestzeug/komplette-gestechruestung.json b/src/packs/_source/ruestzeug/komplette-gestechruestung.json index 77e2e1d3..4d6468b2 100644 --- a/src/packs/_source/ruestzeug/komplette-gestechruestung.json +++ b/src/packs/_source/ruestzeug/komplette-gestechruestung.json @@ -7,20 +7,15 @@ ], "weight": 30, "price": 2500, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 12, - "armorHandicap": 10, + "armorValue": { + "total": 8, + "kopf": 8, + "brust": 8, + "rücken": 7, + "bauch": 8, + "arme": 7, + "beine": 7 + }, + "armorHandicap": 8, "description": "" } diff --git a/src/packs/_source/ruestzeug/kroetenhaut.json b/src/packs/_source/ruestzeug/kroetenhaut.json index c32534f9..b38e0f29 100644 --- a/src/packs/_source/ruestzeug/kroetenhaut.json +++ b/src/packs/_source/ruestzeug/kroetenhaut.json @@ -7,20 +7,15 @@ ], "weight": 4, "price": 60, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 3, + "armorValue": { + "total": 2, + "kopf": 0, + "brust": 3, + "rücken": 2, + "bauch": 2, + "arme": 1, + "beine": 0 + }, "armorHandicap": 2, "description": "" } diff --git a/src/packs/_source/ruestzeug/kuerass.json b/src/packs/_source/ruestzeug/kuerass.json index 36cd7334..c026a910 100644 --- a/src/packs/_source/ruestzeug/kuerass.json +++ b/src/packs/_source/ruestzeug/kuerass.json @@ -7,20 +7,15 @@ ], "weight": 4, "price": 110, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 3, - "armorHandicap": 2, + "armorValue": { + "total": 2, + "kopf": 0, + "brust": 5, + "rücken": 1, + "bauch": 2, + "arme": 0, + "beine": 0 + }, + "armorHandicap": 1, "description": "" } diff --git a/src/packs/_source/ruestzeug/langes-kettenhemd.json b/src/packs/_source/ruestzeug/langes-kettenhemd.json index fe571b4c..c43d1723 100644 --- a/src/packs/_source/ruestzeug/langes-kettenhemd.json +++ b/src/packs/_source/ruestzeug/langes-kettenhemd.json @@ -7,20 +7,15 @@ ], "weight": 10, "price": 180, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 4, - "armorHandicap": 4, + "armorValue": { + "total": 3, + "kopf": 0, + "brust": 4, + "rücken": 4, + "bauch": 4, + "arme": 3, + "beine": 2 + }, + "armorHandicap": 2, "description": "" } diff --git a/src/packs/_source/ruestzeug/lederharnisch.json b/src/packs/_source/ruestzeug/lederharnisch.json index a6e06681..2cd665b8 100644 --- a/src/packs/_source/ruestzeug/lederharnisch.json +++ b/src/packs/_source/ruestzeug/lederharnisch.json @@ -7,20 +7,15 @@ ], "weight": 4.5, "price": 80, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 3, - "armorHandicap": 3, + "armorValue": { + "total": 2, + "kopf": 0, + "brust": 3, + "rücken": 3, + "bauch": 3, + "arme": 0, + "beine": 0 + }, + "armorHandicap": 1, "description": "" } diff --git a/src/packs/_source/ruestzeug/leichte-platte.json b/src/packs/_source/ruestzeug/leichte-platte.json index b3312630..bbfe4310 100644 --- a/src/packs/_source/ruestzeug/leichte-platte.json +++ b/src/packs/_source/ruestzeug/leichte-platte.json @@ -7,20 +7,15 @@ ], "weight": 7.5, "price": 250, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 4, - "armorHandicap": 3, + "armorValue": { + "total": 3, + "kopf": 0, + "brust": 5, + "rücken": 4, + "bauch": 5, + "arme": 0, + "beine": 2 + }, + "armorHandicap": 2, "description": "" } diff --git a/src/packs/_source/ruestzeug/schuppenpanzer.json b/src/packs/_source/ruestzeug/schuppenpanzer.json index 508c6f19..476a8da7 100644 --- a/src/packs/_source/ruestzeug/schuppenpanzer.json +++ b/src/packs/_source/ruestzeug/schuppenpanzer.json @@ -7,20 +7,15 @@ ], "weight": 12, "price": 1000, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 5, - "armorHandicap": 5, + "armorValue": { + "total": 4, + "kopf": 0, + "brust": 5, + "rücken": 5, + "bauch": 5, + "arme": 3, + "beine": 3 + }, + "armorHandicap": 4, "description": "" } diff --git a/src/packs/_source/ruestzeug/spiegelpanzer.json b/src/packs/_source/ruestzeug/spiegelpanzer.json index 9a04ba63..d3273d63 100644 --- a/src/packs/_source/ruestzeug/spiegelpanzer.json +++ b/src/packs/_source/ruestzeug/spiegelpanzer.json @@ -7,20 +7,15 @@ ], "weight": 10, "price": 1000, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 5, - "armorHandicap": 4, + "armorValue": { + "total": 4, + "kopf": 0, + "brust": 5, + "rücken": 5, + "bauch": 5, + "arme": 3, + "beine": 2 + }, + "armorHandicap": 3, "description": "" } diff --git a/src/packs/_source/ruestzeug/wattierte-unterkleidung.json b/src/packs/_source/ruestzeug/wattierte-unterkleidung.json index defd8026..589ac6be 100644 --- a/src/packs/_source/ruestzeug/wattierte-unterkleidung.json +++ b/src/packs/_source/ruestzeug/wattierte-unterkleidung.json @@ -20,7 +20,15 @@ "rangedRangeDamageModifier": "", "rangedAttackDamage": "", "rangedReloadTime": 0, - "armorValue": 1, + "armorValue": { + "total": 1.5, + "kopf": 0, + "brust": 1, + "rücken": 1, + "bauch": 1, + "arme": 1, + "beine": 1 + }, "armorHandicap": 1, "description": "" } diff --git a/src/packs/_source/ruestzeug/wattierter-waffenrock.json b/src/packs/_source/ruestzeug/wattierter-waffenrock.json index c2aeb7a4..28d54f5f 100644 --- a/src/packs/_source/ruestzeug/wattierter-waffenrock.json +++ b/src/packs/_source/ruestzeug/wattierter-waffenrock.json @@ -7,20 +7,15 @@ ], "weight": 3, "price": 40, - "breakFactor": 0, - "iniModifier": 0, - "attackModifier": 0, - "parryModifier": 0, - "meleeAttackModifier": 0, - "meleeAttackModifierIncrement": 0, - "meleeSkills": [], - "meleeAttackDamage": "", - "rangedSkills": [], - "rangedRangeModifier": "", - "rangedRangeDamageModifier": "", - "rangedAttackDamage": "", - "rangedReloadTime": 0, - "armorValue": 2, + "armorValue": { + "total": 2, + "kopf": 0, + "brust": 2, + "rücken": 2, + "bauch": 2, + "arme": 1, + "beine": 1 + }, "armorHandicap": 2, "description": "" } diff --git a/src/style/molecules/_droppables.scss b/src/style/molecules/_droppables.scss new file mode 100644 index 00000000..a3eabd6a --- /dev/null +++ b/src/style/molecules/_droppables.scss @@ -0,0 +1,27 @@ +.droppable { + + .inventory-table { + position: relative; + } + + .inventory-table::after { + + content: 'Gegenstände hier fallen lassen'; + pointer-events: none; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + border-radius: 8px; + border-style: dashed; + border-color: gray; + line-height: 34px; + height: 34px; + vertical-align: middle; + text-align: center; + background-color: rgba(0, 0, 0, 0.4); + color: gray; + } + +} \ No newline at end of file diff --git a/src/templates/item/equipment/tab-ammunition.hbs b/src/templates/item/equipment/tab-ammunition.hbs new file mode 100644 index 00000000..bc18aed5 --- /dev/null +++ b/src/templates/item/equipment/tab-ammunition.hbs @@ -0,0 +1,15 @@ +
+
+
+ + +
+
+
\ No newline at end of file diff --git a/src/templates/item/equipment/tab-armor.hbs b/src/templates/item/equipment/tab-armor.hbs index 7bfcd6de..90e476cf 100644 --- a/src/templates/item/equipment/tab-armor.hbs +++ b/src/templates/item/equipment/tab-armor.hbs @@ -3,11 +3,48 @@ data-group="{{tabs.armor.group}}">
-
- -
+
+ Rüstungswerte + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
-
+ {{!-- categories are now in their on tab --}}
+
+
+ Art des Gegenstands + + + + +
+
+ \ No newline at end of file diff --git a/src/templates/ui/partial-equipment-button.hbs b/src/templates/ui/partial-equipment-button.hbs index 63c98791..63c733a8 100644 --- a/src/templates/ui/partial-equipment-button.hbs +++ b/src/templates/ui/partial-equipment-button.hbs @@ -12,7 +12,7 @@ {{#each this}} - + {{this.name}} {{this.quantity}} {{#if this.worn}}({{/if}}{{this.weight}}{{#if this.worn}}){{/if}}