Compare commits

..

No commits in common. "ad28cf48f383859022bcb80803a6e670e7ca749c" and "32503a03c11654c2cb7a7a71485e7a9c288ef75f" have entirely different histories.

23 changed files with 808 additions and 505 deletions

View File

@ -198,14 +198,13 @@ Hooks.once("init", () => {
}) })
Hooks.on('dropActorSheetData', (actor, sheet, data) => { Hooks.on('dropActorSheetData', (actor, sheet, data) => {
/*if (data.uuid) { if (data.uuid) {
if (actor.type === "character") { if (actor.type === "character") {
return true return CharacterSheet.onDroppedData(actor, sheet, data);
} else { } else {
return GroupSheet.onDroppedData(actor, sheet, data); return GroupSheet.onDroppedData(actor, sheet, data);
} }
}*/ }
return true
}) })
Hooks.once("ready", async function () { Hooks.once("ready", async function () {

View File

@ -1,7 +1,6 @@
import {importCharacter} from "../xml-import/xml-import.mjs"; import {importCharacter} from "../xml-import/xml-import.mjs";
import {LiturgyData} from "../data/miracle/liturgydata.mjs"; import {LiturgyData} from "../data/miracle/liturgydata.mjs";
import {Zonenruestung, Zonenwunde, Wunde} from "../data/Trefferzone.js"; import {Zonenruestung, Zonenwunde} from "../data/Trefferzone.js";
import {PlayerCharacterDataModel} from "../data/character.mjs";
export class Character extends Actor { export class Character extends Actor {
@ -242,48 +241,6 @@ export class Character extends Actor {
return data; return data;
} }
findEquipmentOnSlot(slot, setNumber) {
return this.items.get(this.system.heldenausruestung[setNumber ?? this.system.setEquipped]?.[slot])
}
getEquipmentSetUpdateObject() {
const updateObject = {}
Array.from(this.system.heldenausruestung).forEach((equipmentSet, index) => {
updateObject[`system.heldenausruestung.${index}.links`] = equipmentSet.links;
updateObject[`system.heldenausruestung.${index}.rechts`] = equipmentSet.rechts;
updateObject[`system.heldenausruestung.${index}.brust`] = equipmentSet.brust;
updateObject[`system.heldenausruestung.${index}.bauch`] = equipmentSet.bauch;
updateObject[`system.heldenausruestung.${index}.ruecken`] = equipmentSet.ruecken;
updateObject[`system.heldenausruestung.${index}.kopf`] = equipmentSet.kopf;
updateObject[`system.heldenausruestung.${index}.fernkampf`] = equipmentSet.fernkampf;
updateObject[`system.heldenausruestung.${index}.munition`] = equipmentSet.munition;
updateObject[`system.heldenausruestung.${index}.armlinks`] = equipmentSet.armlinks;
updateObject[`system.heldenausruestung.${index}.armrechts`] = equipmentSet.armrechts;
updateObject[`system.heldenausruestung.${index}.beinlinks`] = equipmentSet.beinlinks;
updateObject[`system.heldenausruestung.${index}.beinrechts`] = equipmentSet.beinrechts;
})
return updateObject;
}
isWorn(itemId) {
const slots = PlayerCharacterDataModel.getSlots()
const set = this.system.heldenausruestung[this.system.setEquipped]
if (set) {
for (const slot of slots) {
const equipmentSlotId = set[slot]
if (equipmentSlotId === itemId) {
return slot
}
}
}
return false
}
/** /**
* *
* @param amount * @param amount

View File

@ -68,21 +68,21 @@ export class ActionManager {
type: ActionManager.ATTACK, type: ActionManager.ATTACK,
cost: ActionManager.REGULAR, cost: ActionManager.REGULAR,
source: ActionManager.DEFAULT, source: ActionManager.DEFAULT,
eval: () => this.#hatWaffeinHand() eval: () => true
}, },
{ {
name: "Schnellschuss", name: "Schnellschuss",
type: ActionManager.INTERACTION, type: ActionManager.INTERACTION,
cost: ActionManager.CONTINUING, cost: ActionManager.CONTINUING,
source: ActionManager.DEFAULT, source: ActionManager.DEFAULT,
eval: () => this.#hatFernkampfWaffeinHand() eval: () => true
}, },
{ {
name: "Schnellschuss (Scharfschütze)", name: "Schnellschuss (Scharfschütze)",
type: ActionManager.INTERACTION, type: ActionManager.INTERACTION,
cost: ActionManager.CONTINUING, cost: ActionManager.CONTINUING,
source: ActionManager.SF, source: ActionManager.SF,
eval: () => this.#hatFernkampfWaffeinHand() && this.#hatSonderfertigkeit("Scharfschütze") eval: () => this.#hatSonderfertigkeit("Scharfschütze")
}, },
{ {
name: "Abwehraktion", name: "Abwehraktion",
@ -110,14 +110,7 @@ export class ActionManager {
type: ActionManager.ATTACK, type: ActionManager.ATTACK,
cost: ActionManager.REGULAR, cost: ActionManager.REGULAR,
source: ActionManager.SF, source: ActionManager.SF,
eval: () => this.#hatFernkampfWaffeinHand() && this.#hatSonderfertigkeit("Finte") eval: () => this.#hatSonderfertigkeit("Finte")
},
{
name: "Wuchtschlag",
type: ActionManager.ATTACK,
cost: ActionManager.REGULAR,
source: ActionManager.DEFAULT,
eval: () => true
}, },
{ {
name: "Wuchtschlag", name: "Wuchtschlag",
@ -169,21 +162,21 @@ export class ActionManager {
type: ActionManager.INTERACTION, type: ActionManager.INTERACTION,
cost: ActionManager.CONTINUING, cost: ActionManager.CONTINUING,
source: ActionManager.SF, source: ActionManager.SF,
eval: () => this.#hatMunition() && this.#hatFernkampfWaffeinHand("Bogen") && this.#hatSonderfertigkeit("Schnellladen (Bogen)") eval: () => this.#hatSonderfertigkeit("Schnellladen (Bogen)")
}, },
{ {
name: "Schnellladen (Armbrust)", name: "Schnellladen (Armbrust)",
type: ActionManager.INTERACTION, type: ActionManager.INTERACTION,
cost: ActionManager.CONTINUING, cost: ActionManager.CONTINUING,
source: ActionManager.SF, source: ActionManager.SF,
eval: () => this.#hatMunition() && this.#hatFernkampfWaffeinHand("Armbrust") && this.#hatSonderfertigkeit("Schnellladen (Armbrust)") eval: () => this.#hatSonderfertigkeit("Schnellladen (Armbrust)")
}, },
{ {
name: "Nachladen", name: "Nachladen",
type: ActionManager.INTERACTION, type: ActionManager.INTERACTION,
cost: ActionManager.CONTINUING, cost: ActionManager.CONTINUING,
source: ActionManager.DEFAULT, source: ActionManager.DEFAULT,
eval: () => this.#hatMunition() eval: () => true
}, },
{ {
name: "Talenteinsatz", name: "Talenteinsatz",
@ -208,26 +201,6 @@ export class ActionManager {
} }
] ]
#hatWaffeinHand() {
const item = this.actor.findEquipmentOnSlot("links") ?? this.actor.findEquipmentOnSlot("rechts")
console.log(item)
return item
}
#hatMunition() {
const item = this.actor.findEquipmentOnSlot("munition")
const weapon = this.actor.findEquipmentOnSlot("fernkampf")
console.log(item?.system.quantity, weapon)
return item
}
#hatFernkampfWaffeinHand(art) {
const item = this.actor.findEquipmentOnSlot("fernkampf")
console.log(item)
return item
}
#hatSonderfertigkeitBeginnendMit(name) { #hatSonderfertigkeitBeginnendMit(name) {
return this.actor.system.sonderfertigkeiten?.find(p => p.name.startsWith(name)) != null return this.actor.system.sonderfertigkeiten?.find(p => p.name.startsWith(name)) != null
} }

View File

@ -1,45 +0,0 @@
export default {
_prepareContext: async (context, options, object) => {
const actorData = context.document
context.system = actorData.system
context.flags = actorData.flags
context.derived = context.document.system
context.originalName = actorData.name
context.name = context.derived.name ?? actorData.name
context.effects = actorData.effects ?? []
context.advantages = []
actorData.itemTypes.Advantage.forEach((item) => {
context.advantages.push({
id: item._id,
name: item.name,
value: item.system.value,
options: item.system.auswahl,
description: item.system.description,
isAdvantage: !item.system.nachteil,
isDisadvantage: item.system.nachteil,
isBadAttribute: item.system.schlechteEigenschaft
})
}
)
context.specialAbilities = []
actorData.itemTypes.SpecialAbility.forEach((item) => {
context.specialAbilities.push({
id: item._id,
name: item.name,
});
}
);
return context
},
_onRender: (context, options) => {
},
_getTabConfig: (group) => {
group.tabs.push({id: "advsf", group: "sheet", label: "Vorteile"})
},
template: `systems/DSA_4-1/templates/actor/character/tab-advsf.hbs`
}

View File

@ -0,0 +1,128 @@
export default {
_prepareContext: async (context, options, object) => {
const actorData = context.document
context.system = actorData.system
context.flags = actorData.flags
context.derived = context.document.system
context.originalName = actorData.name
context.name = context.derived.name ?? actorData.name
context.effects = actorData.effects ?? []
context.advantages = []
const getModsOfAttribute = async (keyPath, object) => {
let returnValue = [];
Array.from(object.appliedEffects).forEach(
(e) =>
e.changes.filter(c => c.key === keyPath).forEach(change => {
returnValue.push({
name: e.name,
value: change.value > 0 ? "+" + change.value : "" + change.value,
icon: e.icon,
})
}))
return returnValue
}
context.mods = {
"mu": await getModsOfAttribute('system.attribute.mu.mod', actorData),
"kl": await getModsOfAttribute('system.attribute.kl.mod', actorData),
"in": await getModsOfAttribute('system.attribute.in.mod', actorData),
"ch": await getModsOfAttribute('system.attribute.ch.mod', actorData),
"ff": await getModsOfAttribute('system.attribute.ff.mod', actorData),
"ge": await getModsOfAttribute('system.attribute.ge.mod', actorData),
"ko": await getModsOfAttribute('system.attribute.ko.mod', actorData),
"kk": await getModsOfAttribute('system.attribute.kk.mod', actorData),
"at": await getModsOfAttribute('system.at.mod', actorData),
"pa": await getModsOfAttribute('system.pa.mod', actorData),
"fk": await getModsOfAttribute('system.fk.mod', actorData),
}
context.attributes = [
{
eigenschaft: "mu",
name: "MU",
tooltip: "Mut",
wert: context.derived.attribute.mu.aktuell ?? 0,
},
{
eigenschaft: "kl",
name: "KL",
tooltip: "Klugheit",
wert: context.derived.attribute.kl.aktuell ?? 0,
},
{
eigenschaft: "in",
name: "IN",
tooltip: "Intuition",
wert: context.derived.attribute.in.aktuell ?? 0,
},
{
eigenschaft: "ch",
name: "CH",
tooltip: "Charisma",
wert: context.derived.attribute.ch.aktuell ?? 0,
},
{
eigenschaft: "ff",
name: "FF",
tooltip: "Fingerfertigkeit",
wert: context.derived.attribute.ff.aktuell ?? 0,
},
{
eigenschaft: "ge",
name: "GE",
tooltip: "Geschicklichkeit",
wert: context.derived.attribute.ge.aktuell ?? 0,
},
{
eigenschaft: "ko",
name: "KO",
tooltip: "Konstitution",
wert: context.derived.attribute.ko.aktuell ?? 0,
},
{
eigenschaft: "kk",
name: "KK",
tooltip: "Körperkraft",
wert: context.derived.attribute.kk.aktuell ?? 0,
},
]
Object.values(actorData.items).forEach((item) => {
if (item.type === "Advantage") {
context.advantages.push({
id: item._id,
name: item.name,
value: item.system.value,
options: item.system.auswahl,
description: item.system.description,
isAdvantage: !item.system.nachteil,
isDisadvantage: item.system.nachteil,
isBadAttribute: item.system.schlechteEigenschaft
})
}
}
)
context.specialAbilities = []
Object.values(actorData.items).forEach((item) => {
if (item.type === "SpecialAbility") {
context.specialAbilities.push({
id: item._id,
name: item.name,
});
}
}
);
return context
},
_onRender: (context, options) => {
},
_getTabConfig: (group) => {
group.tabs.push({id: "attributes", group: "sheet", label: "Eigenschaften"})
},
template: `systems/DSA_4-1/templates/actor/character/tab-attributes.hbs`
}

View File

@ -12,6 +12,22 @@ export default {
context.name = context.derived.name ?? actorData.name context.name = context.derived.name ?? actorData.name
context.effects = actorData.effects ?? [] context.effects = actorData.effects ?? []
const isWorn = (itemId, object) => {
const slots = PlayerCharacterDataModel.getSlots()
const set = object.system.heldenausruestung[object.system.setEquipped]
if (set) {
for (const slot of slots) {
const equipmentSlotId = set[slot]
if (equipmentSlotId === itemId) {
return slot
}
}
}
return false
}
context.equipments = [] context.equipments = []
context.carryingweight = 0 context.carryingweight = 0
actorData.itemTypes.Equipment.forEach((item, index) => { actorData.itemTypes.Equipment.forEach((item, index) => {
@ -19,7 +35,7 @@ export default {
// worn items are halved weight // worn items are halved weight
let effectiveWeight = item.system.weight ?? 0 let effectiveWeight = item.system.weight ?? 0
if (context.document.isWorn(item._id)) { if (isWorn(item._id, object)) {
effectiveWeight = item.system.weight ? item.system.weight / 2 : 0 effectiveWeight = item.system.weight ? item.system.weight / 2 : 0
} }
@ -30,7 +46,7 @@ export default {
name: item.name, name: item.name,
icon: item.img ?? "", icon: item.img ?? "",
weight: item.system.weight, weight: item.system.weight,
worn: context.document.isWorn(item._id) worn: isWorn(item._id, object)
}) })
context.carryingweight += item.system.quantity * effectiveWeight; context.carryingweight += item.system.quantity * effectiveWeight;
@ -126,118 +142,57 @@ export default {
return context return context
}, },
_onRender: (context, options, thisObject) => { _onRender: (context, options, element) => {
const mapAllSets = () => {
const updateObject = {}
Array.from(context.document.system.heldenausruestung).forEach((equipmentSet, index) => {
updateObject[`system.heldenausruestung.${index}.links`] = equipmentSet.links;
updateObject[`system.heldenausruestung.${index}.rechts`] = equipmentSet.rechts;
updateObject[`system.heldenausruestung.${index}.brust`] = equipmentSet.brust;
updateObject[`system.heldenausruestung.${index}.bauch`] = equipmentSet.bauch;
updateObject[`system.heldenausruestung.${index}.ruecken`] = equipmentSet.ruecken;
updateObject[`system.heldenausruestung.${index}.kopf`] = equipmentSet.kopf;
updateObject[`system.heldenausruestung.${index}.fernkampf`] = equipmentSet.fernkampf;
updateObject[`system.heldenausruestung.${index}.munition`] = equipmentSet.munition;
updateObject[`system.heldenausruestung.${index}.armlinks`] = equipmentSet.armlinks;
updateObject[`system.heldenausruestung.${index}.armrechts`] = equipmentSet.armrechts;
updateObject[`system.heldenausruestung.${index}.beinlinks`] = equipmentSet.beinlinks;
updateObject[`system.heldenausruestung.${index}.beinrechts`] = equipmentSet.beinrechts;
new foundry.applications.ux.DragDrop.implementation({ })
dragSelector: ".inventory-table .equipment", return updateObject;
dropSelector: ".inventory-table", }
permissions: {
dragstart: thisObject._canDragStart.bind(thisObject), new foundry.applications.ux.ContextMenu(element, '.equipped', [
drop: thisObject._canDragDrop.bind(thisObject) {
}, name: "Gegenstand vom Set entfernen",
callbacks: { callback: (event) => {
dragstart: thisObject._onDragStart.bind(thisObject), const {setId, target, actor} = event[0].dataset
drop: thisObject._onDrop.bind(thisObject)
const updateObject = mapAllSets()
updateObject[`system.heldenausruestung.${setId}.${target}`] = null;
object.update(updateObject);
},
condition: () => true
} }
}).bind(thisObject.element); ], {
jQuery: false
});
new ContextMenu( new foundry.applications.ux.ContextMenu(element, '.equipment', [
thisObject.element, {
".equipment", name: "Aus dem Inventar entfernen",
[ icon: '<i class="fa-solid fa-trash"></i>',
{ callback: (event) => {
name: "Abrüsten", // TODO find id on heldenausruestung to remove the worn items as well
icon: '<i class="fa-solid fa-suitcase"></i>', object.deleteEmbeddedDocuments('Item', [event[0].dataset.id])
callback: (target) => {
const {itemId} = target.dataset
const itemSlot = thisObject.document.isWorn(itemId)
const updateObject = thisObject.document.getEquipmentSetUpdateObject()
delete updateObject[`system.heldenausruestung.${thisObject.document.system.setEquipped}.${itemSlot}`]
thisObject.document.update(updateObject)
},
condition: (target) => {
const {itemId} = target.dataset
const itemIsWorn = thisObject.document.isWorn(itemId)
return itemIsWorn
}
}, },
{ condition: () => true
name: "Ausrüsten (Munition)", }
], {
callback: (target) => { jQuery: false
const updateObject = thisObject.document.getEquipmentSetUpdateObject() });
updateObject[`system.heldenausruestung.${thisObject.document.system.setEquipped}.munition`] = target.dataset.itemId
thisObject.document.update(updateObject)
},
condition: (target) => {
const {itemId} = target.dataset
const item = thisObject.document.items.get(itemId)
console.log(item.system.category)
return !thisObject.document.isWorn(itemId)
}
},
{
name: "Ausrüsten",
callback: (target) => {
//thisObject.deleteEmbeddedDocuments('Item', [event.dataset.id])
},
condition: (target) => {
const {itemId} = target.dataset
const item = thisObject.document.items.get(itemId)
return !thisObject.document.isWorn(itemId) && item.system.category.indexOf("Rüstung") != -1
}
},
{
name: "Ausrüsten (Rechte Hand)",
callback: (target) => {
const updateObject = thisObject.document.getEquipmentSetUpdateObject()
updateObject[`system.heldenausruestung.${thisObject.document.system.setEquipped}.rechts`] = target.dataset.itemId
thisObject.document.update(updateObject)
},
condition: (target) => {
const {itemId} = target.dataset
const item = thisObject.document.items.get(itemId)
return !thisObject.document.isWorn(itemId) && item.system.category.indexOf("Nahkampfwaffe") != -1
}
},
{
name: "Ausrüsten (Linke Hand)",
callback: (target) => {
const updateObject = thisObject.document.getEquipmentSetUpdateObject()
updateObject[`system.heldenausruestung.${thisObject.document.system.setEquipped}.links`] = target.dataset.itemId
thisObject.document.update(updateObject)
},
condition: (target) => {
const {itemId} = target.dataset
const item = thisObject.document.items.get(itemId)
return !thisObject.document.isWorn(itemId) && item.system.category.indexOf("Nahkampfwaffe") != -1
}
},
{
name: "Ausrüsten (Fernkampf)",
callback: (target) => {
const updateObject = thisObject.document.getEquipmentSetUpdateObject()
updateObject[`system.heldenausruestung.${thisObject.document.system.setEquipped}.fernkampf`] = target.dataset.itemId
thisObject.document.update(updateObject)
},
condition: (target) => {
const {itemId} = target.dataset
const item = thisObject.document.items.get(itemId)
return !thisObject.document.isWorn(itemId) && item.system.category.indexOf("Fernkampfwaffe") != -1
}
},
{
name: "Aus dem Inventar entfernen",
icon: '<i class="fa-solid fa-trash"></i>',
callback: (target) => {
thisObject.deleteEmbeddedDocuments('Item', [target.dataset.id])
},
condition: (target) => {
const {itemId} = target.dataset
!thisObject.document.isWorn(itemId)
}
}
], {jQuery: false});
}, },
_getTabConfig: (group) => { _getTabConfig: (group) => {
group.tabs.push({id: "equipment", group: "sheet", label: "Ausrüstung"}) group.tabs.push({id: "equipment", group: "sheet", label: "Ausrüstung"})

View File

@ -1,4 +1,4 @@
import Advsf from "./character/advsf.mjs" import Attributes from "./character/attributes.mjs"
import Combat from "./character/combat.mjs" import Combat from "./character/combat.mjs"
import Effects from "./character/effects.mjs" import Effects from "./character/effects.mjs"
import Equipment from "./character/equipment.mjs" import Equipment from "./character/equipment.mjs"
@ -55,8 +55,8 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
social: { social: {
template: Social.template template: Social.template
}, },
advsf: { attributes: {
template: Advsf.template template: Attributes.template
}, },
combat: { combat: {
template: Combat.template template: Combat.template
@ -118,14 +118,8 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
} }
} }
/** static #openEmbeddedDocument(documentId) {
* this.object.items.get(documentId).sheet.render(true)
* @param {MouseEvent} event
*/
static #openEmbeddedDocument(event) {
const dataset = event.target.parentElement.dataset
const id = dataset.itemId ?? dataset.id
this.document.items.get(id).sheet.render(true)
} }
/** /**
@ -146,7 +140,7 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
const tabs = foundry.utils.deepClone(super._getTabsConfig(group)) const tabs = foundry.utils.deepClone(super._getTabsConfig(group))
Meta._getTabConfig(tabs, this); Meta._getTabConfig(tabs, this);
Social._getTabConfig(tabs, this); Social._getTabConfig(tabs, this);
Advsf._getTabConfig(tabs, this) Attributes._getTabConfig(tabs, this)
Combat._getTabConfig(tabs, this) Combat._getTabConfig(tabs, this)
Equipment._getTabConfig(tabs, this) Equipment._getTabConfig(tabs, this)
Skills._getTabConfig(tabs, this) Skills._getTabConfig(tabs, this)
@ -160,6 +154,9 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
switch (partId) { switch (partId) {
case "form": case "form":
const findEquipmentOnSlot = (slot, setNumber, object) => {
return object.items.get(object.system.heldenausruestung[setNumber]?.[slot])
}
const actorData = context.document const actorData = context.document
context.system = actorData.system context.system = actorData.system
@ -213,9 +210,9 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
context.aupcurrent = actorData.system.aup.aktuell ?? 0 context.aupcurrent = actorData.system.aup.aktuell ?? 0
const fernkampf = actorData.findEquipmentOnSlot("fernkampf", actorData.system.setEquipped, actorData) const fernkampf = findEquipmentOnSlot("fernkampf", actorData.system.setEquipped, actorData)
const links = actorData.findEquipmentOnSlot("links", actorData.system.setEquipped, actorData) const links = findEquipmentOnSlot("links", actorData.system.setEquipped, actorData)
const rechts = actorData.findEquipmentOnSlot("rechts", actorData.system.setEquipped, actorData) const rechts = findEquipmentOnSlot("rechts", actorData.system.setEquipped, actorData)
context.attacks = []; context.attacks = [];
if (fernkampf) { if (fernkampf) {
@ -225,8 +222,8 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
context.attacks.push({ context.attacks.push({
name: obj.name, name: obj.name,
using: fernkampf.name, using: fernkampf.name,
atroll: `1d20cs<${this.document.system.fk.aktuell + obj.system.at}`, atroll: `1d20cs<${object.system.fk.aktuell + obj.system.at}`,
at: `${this.document.system.fk.aktuell + obj.system.at}`, at: `${object.system.fk.aktuell + obj.system.at}`,
tproll: `${fernkampf.system.rangedAttackDamage}`, // TODO consider adding TP/KK mod and Range mod tproll: `${fernkampf.system.rangedAttackDamage}`, // TODO consider adding TP/KK mod and Range mod
tp: `${fernkampf.system.rangedAttackDamage}`, tp: `${fernkampf.system.rangedAttackDamage}`,
iniroll: `(${context.inidice})d6 + ${context.inivalue + fernkampf.system.iniModifier ?? 0}`, iniroll: `(${context.inidice})d6 + ${context.inivalue + fernkampf.system.iniModifier ?? 0}`,
@ -247,9 +244,9 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
context.attacks.push({ context.attacks.push({
name: obj.name, name: obj.name,
using: links.name, using: links.name,
atroll: `1d20cs<${this.document.system.at.links.aktuell + obj.system.at + links.system.attackModifier}`, // TODO consider adding W/M atroll: `1d20cs<${object.system.at.links.aktuell + obj.system.at + links.system.attackModifier}`, // TODO consider adding W/M
at: `${object.system.at.links.aktuell + obj.system.at + links.system.attackModifier}`, at: `${object.system.at.links.aktuell + obj.system.at + links.system.attackModifier}`,
paroll: `1d20cs<${this.document.system.pa.links.aktuell + obj.system.pa + links.system.parryModifier}`, // TODO consider adding W/M paroll: `1d20cs<${object.system.pa.links.aktuell + obj.system.pa + links.system.parryModifier}`, // TODO consider adding W/M
pa: `${object.system.pa.links.aktuell + obj.system.pa + links.system.parryModifier}`, pa: `${object.system.pa.links.aktuell + obj.system.pa + links.system.parryModifier}`,
tproll: `${links.system.meleeAttackDamage}`, // TODO consider adding TP/KK mod tproll: `${links.system.meleeAttackDamage}`, // TODO consider adding TP/KK mod
tp: `${links.system.meleeAttackDamage}`, tp: `${links.system.meleeAttackDamage}`,
@ -271,9 +268,9 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
context.attacks.push({ context.attacks.push({
name: obj.name, name: obj.name,
using: rechts.name, using: rechts.name,
atroll: `1d20cs<${this.document.system.at.rechts.aktuell + obj.system.at + rechts.system.attackModifier}`, // TODO consider adding W/M atroll: `1d20cs<${object.system.at.rechts.aktuell + obj.system.at + rechts.system.attackModifier}`, // TODO consider adding W/M
at: `${object.system.at.rechts.aktuell + obj.system.at + rechts.system.attackModifier}`, at: `${object.system.at.rechts.aktuell + obj.system.at + rechts.system.attackModifier}`,
paroll: `1d20cs<${this.document.system.pa.rechts.aktuell + obj.system.pa + rechts.system.parryModifier}`, // TODO consider adding W/M paroll: `1d20cs<${object.system.pa.rechts.aktuell + obj.system.pa + rechts.system.parryModifier}`, // TODO consider adding W/M
pa: `${object.system.pa.rechts.aktuell + obj.system.pa + rechts.system.parryModifier}`, pa: `${object.system.pa.rechts.aktuell + obj.system.pa + rechts.system.parryModifier}`,
tproll: `${rechts.system.meleeAttackDamage}`, // TODO consider adding TP/KK mod tproll: `${rechts.system.meleeAttackDamage}`, // TODO consider adding TP/KK mod
tp: `${rechts.system.meleeAttackDamage}`, tp: `${rechts.system.meleeAttackDamage}`,
@ -336,31 +333,31 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
break; break;
case "meta": case "meta":
await Meta._prepareContext(context, this.document) await Meta._prepareContext(context, this.object)
break break
case "social": case "social":
await Social._prepareContext(context, this.document) await Social._prepareContext(context, this.object)
break break
case "advsf": case "attributes":
await Advsf._prepareContext(context, this.document) await Attributes._prepareContext(context, this.object)
break break
case "combat": case "combat":
await Combat._prepareContext(context, this.document) await Combat._prepareContext(context, this.object)
break break
case "equipment": case "equipment":
await Equipment._prepareContext(context, this.document) await Equipment._prepareContext(context, this.object)
break break
case "skills": case "skills":
await Skills._prepareContext(context, this.document) await Skills._prepareContext(context, this.object)
break break
case "spells": case "spells":
await Spells._prepareContext(context, this.document) await Spells._prepareContext(context, this.object)
break break
case "liturgies": case "liturgies":
await Liturgies._prepareContext(context, this.document) await Liturgies._prepareContext(context, this.object)
break break
case "effects": case "effects":
await Effects._prepareContext(context, this.document) await Effects._prepareContext(context, this.object)
break break
} }
return context return context
@ -369,35 +366,215 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
_onRender(context, options) { _onRender(context, options) {
Meta._onRender(context, options, this.element) Meta._onRender(context, options, this.element)
Social._onRender(context, options, this.element) Social._onRender(context, options, this.element)
Advsf._onRender(context, options, this.element) Attributes._onRender(context, options, this.element)
Combat._onRender(context, options, this.element) Combat._onRender(context, options, this.element)
Effects._onRender(context, options, this.element) Effects._onRender(context, options, this.element)
Equipment._onRender(context, options, this) Equipment._onRender(context, options, this.element)
Liturgies._onRender(context, options, this.element) Liturgies._onRender(context, options, this.element)
Skills._onRender(context, options, this.element) Skills._onRender(context, options, this.element)
Spells._onRender(context, options, this.element) Spells._onRender(context, options, this.element)
} }
// TODO needs to be fixed once Character Sheet is migrated to ActorSheetV2 /* showAdjustAttributeDialog(attributeName, attributeField, previousValue) {
async _onDrop(event) { const thisActor = this;
const data = TextEditor.implementation.getDragEventData(event); const myContent = `
const actor = this.actor; Value:
const allowed = Hooks.call("dropActorSheetData", actor, this, data); <input id="attributeValue" type="number" value="${previousValue}" />
if (allowed === false) return; `;
// Dropped Documents function updateAttribute(html) {
const documentClass = foundry.utils.getDocumentClass(data.type); const value = html.find("input#attributeValue").val();
if (documentClass) { const attribute = {}
const document = await documentClass.fromDropData(data); attribute[attributeField.toLowerCase()] = {
await this._onDropDocument(event, document); aktuell: value
}
// No duplication by moving items from one actor to another thisActor.object.update({system: {attribute}})
if (document.parent) {
document.parent.items.get(document._id).delete()
} }
}
}
new Dialog({
title: `${attributeName} ändern auf`,
content: myContent,
buttons: {
button1: {
label: "Ändern",
callback: (html) => {
updateAttribute(html)
},
icon: `<i class="fas fa-check"></i>`
}
}
}).render(true);
}*/
/*
activateListeners(html) {
super.activateListeners(html);
const tabs = new foundry.applications.ux.Tabs({
navSelector: ".paperdoll-tabs.tabs",
contentSelector: ".sheet-body.paperdoll-sets",
initial: "set" + (this.object.system.setEquipped + 1)
});
tabs.bind(html[0]);
html.on('click', '.attribute.rollable', (evt) => {
this._onAttributeRoll(evt);
});
html.on('click', '[data-operation="switchSet"]', (evt) => {
const {id} = evt.currentTarget.dataset;
console.log(id);
this.object.update({"system.setEquipped": id})
})
html.on('click', '[data-operation="removeEffect"]', (evt) => {
const {actorId, effectId} = evt.currentTarget.dataset;
if (game.user.isGM) {
this.object.items.get(effectId).delete();
}
})
html.on('click', '.talent.rollable', (evt) => {
this._onTalentRoll(evt);
});
html.on('click', '.sidebar-element.rollable', (evt) => {
this._onRoll(evt);
});
// TODO: merge into click.clickable handler
html.on('click', '.talent .name', (evt) => {
this.openEmbeddedDocument(evt.target.dataset.id);
evt.stopPropagation();
})
// TODO: merge into click.clickable handler
html.on('click', '.advantage .name', (evt) => {
this.openEmbeddedDocument(evt.target.dataset.id);
evt.stopPropagation();
})
// TODO: merge into click.clickable handler
html.on('click', '.equipment', (evt) => {
this.openEmbeddedDocument(evt.target.parentElement.dataset.id);
evt.stopPropagation();
})
html.on('click', '.clickable', async (evt) => {
const {id, operation} = evt.currentTarget.dataset;
if (operation === "openActorSheet") {
this.openEmbeddedDocument(id);
evt.stopPropagation();
}
})
new foundry.applications.ux.ContextMenu(html[0], '.talent.rollable', [
{
name: "Entfernen",
icon: '<i class="fa-solid fa-trash"></i>',
callback: (event) => {
this.object.deleteEmbeddedDocuments('Item', [event[0].dataset.id])
},
condition: () => true
}
], {
jQuery: false
});
new foundry.applications.ux.ContextMenu(html[0], '.attribute.rollable', [
{
name: "Anpassen",
icon: '<i class="fa-solid fa-pen"></i>',
callback: (event) => {
this.showAdjustAttributeDialog(event[0].dataset.name, event[0].dataset.label, event[0].dataset.value)
},
condition: () => true
}
], {
jQuery: false
});
let handler = evt => {
const talentId = evt.target.dataset.id
evt.dataTransfer.setData("application/json", JSON.stringify({
talentId
}));
this._onDragStart(evt)
}
// Find all items on the character sheet.
html.find('.talent.rollable').each((i, li) => {
// Add draggable attribute and dragstart listener.
li.setAttribute("draggable", true);
li.addEventListener("dragstart", handler, false);
});
html.on('click', '[data-operation="addWounds"]', async (evt) => {
const {value} = evt.currentTarget.dataset
this.object.update({"system.wunden.aktuell": value})
})
html.on('click', '[data-operation="reduceWounds"]', async (evt) => {
const {value} = evt.currentTarget.dataset
this.object.update({"system.wunden.aktuell": value})
})
html.on('click', '.liturgy.rollable', async (evt) => {
evt.stopPropagation();
const {id, rank, lkp, deity} = evt.currentTarget.dataset;
const document = await this.object.items.get(id)
const data = {};
data.rank = rank;
data.lkp = lkp;
data.deity = deity;
data.variations = [];
const ranks = LiturgyData.ranks
ranks.forEach(rank => {
if (document.system.auswirkung[rank]) {
data.variations.push({
rank,
effect: document.system.auswirkung[rank]
})
}
})
data.mods = [];
const htmlContent = await renderTemplate('systems/DSA_4-1/templates/dialog/modify-liturgy.hbs', data);
const dialogData = {
title: document.name,
content: htmlContent,
data: {},
buttons: {
submit: {
label: "Wirken",
icon: '<i class="fas fa-die"></i>',
callback: (html) => {
},
},
},
}
dialogData.render = new ModifyLiturgy(data).handleRender
const dialog = new Dialog(dialogData, {
classes: ['dsa41', 'dialog', 'liturgy'],
height: 480
})
dialog.render(true);
return false;
})
}
*/
} }
export default CharacterSheet export default CharacterSheet

View File

@ -79,17 +79,14 @@ export class GroupSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
return s return s
} }
static async #openEmbeddedDocument(evt) {
static #openEmbeddedDocument(event) { const {documentId} = evt.srcElement.dataset
const dataset = event.target.parentElement.dataset this.document.items.get(documentId).sheet.render(true)
const id = dataset.itemId ?? dataset.id
this.document.items.get(id).sheet.render(true)
} }
static async #openActorDocument(evt) {
static async #openActorDocument(event) { const {id} = evt.srcElement.dataset
const dataset = event.target.parentElement.dataset evt.stopPropagation()
const id = dataset.itemId ?? dataset.id
game.actors.get(id).sheet.render(true) game.actors.get(id).sheet.render(true)
} }
@ -314,6 +311,7 @@ export class GroupSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
if (document.parent) { if (document.parent) {
document.parent.items.get(document._id).delete() document.parent.items.get(document._id).delete()
} }
await this._onDropDocument(event, document);
} }
} }

View File

@ -4,7 +4,7 @@
label, label,
.sheet-tabs.tabs a, .sheet-tabs.tabs a,
h2, h3 { h2 {
font-family: Gentium, sans-serif; font-family: Gentium, sans-serif;
font-weight: bold; font-weight: bold;
font-size: 12pt; font-size: 12pt;

View File

@ -82,7 +82,7 @@
@include attributes.tab; @include attributes.tab;
} }
.tab.equipment.active { .inventory.active {
@include inventory.tab; @include inventory.tab;
} }

View File

@ -1,80 +1,121 @@
@mixin tab { @mixin tab {
height: 100%; height: 100%;
.advantages-and-specialabilities { .attribute {
padding: 8px 0;
display: flex;
gap: 0 8px;
height: unset; label {
display: unset; width: 120px;
gap: 0; text-align: right;
padding: unset; vertical-align: middle;
line-height: 24px;
}
.advantages, .special-abilities { input {
margin-bottom: 16px; max-width: 80px;
text-align: right;
}
ul { .mod {
list-style-type: none; color: grey;
padding: 0; text-shadow: 0 -1px 0 #ccc;
margin: 0; box-Shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
text-indent: 0; border-radius: 4px;
height: 24px;
width: 24px;
background: linear-gradient(0deg, rgba(24, 24, 24, 1) 0%, rgba(80, 80, 80, 1) 100%);;
display: inline-block;
text-align: center;
vertical-align: middle;
line-height: 24px;
margin-left: 4px;
}
li { }
display: inline-block;
.attributes-overview {
columns: 2;
gap: 0 16px;
}
.resource-overview {
.attribute {
}
}
.advantages, .special-abilities {
margin-bottom: 16px;
ul {
list-style-type: none;
padding: 0;
margin: 0;
text-indent: 0;
li {
display: inline-block;
}
.advantage, .special-ability {
position: relative;
border: 1px solid gold;
box-shadow: 2px 2px 4px #000;
border-radius: 8px;
height: 24px;
color: gold;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
display: inline-block;
padding: 0 8px;
margin-left: 0;
margin-bottom: 4px;
background-image: url("../../assets/velvet_button.png");
background-repeat: repeat-y;
background-size: cover;
span {
position: relative;
z-index: 2;
line-height: 24px;
vertical-align: middle;
} }
.advantage, .special-ability { &.special-ability {
position: relative; &::after {
border: 1px solid gold; background: rgba(128, 0, 96, 0.5);
box-shadow: 2px 2px 4px #000; }
}
&::after {
content: "";
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
border-radius: 8px; border-radius: 8px;
height: 24px; background: rgba(0, 128, 0, 0.5);
color: gold; }
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
display: inline-block;
padding: 0 8px;
margin-left: 0;
margin-bottom: 4px;
background-image: url("../../assets/velvet_button.png");
background-repeat: repeat-y;
background-size: cover;
span { & + .advantage, & + .special-ability {
position: relative; margin-left: 8px;
z-index: 2; }
line-height: 24px;
vertical-align: middle;
}
&.special-ability { &.disadvantage {
&::after { font-style: italic;
background: rgba(128, 0, 96, 0.5);
}
}
&::after { &::after {
content: ""; background: rgba(128, 0, 0, 0.5);
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
border-radius: 8px;
background: rgba(0, 128, 0, 0.5);
}
& + .advantage, & + .special-ability {
margin-left: 8px;
}
&.disadvantage {
font-style: italic;
&::after {
background: rgba(128, 0, 0, 0.5);
}
} }
} }
} }
} }
} }
} }

View File

@ -5,39 +5,16 @@
grid-template-columns: 1fr 320px; grid-template-columns: 1fr 320px;
grid-template-rows: 32px 32px 1fr; grid-template-rows: 32px 32px 1fr;
grid-template-areas: "res res" "wounds wounds" "actions actions"; grid-template-areas: "res res" "wounds wounds" "actions actions";
padding: 8px; gap: 10px;
gap: 8px;
div.combatline { .tab-resources {
grid-area: res; grid-area: res;
display: flex;
flex-direction: row;
justify-self: center;
height: unset;
padding: 0;
gap: 0 8px;
input {
width: 48px;
height: 32px;
}
span, label {
line-height: 32px;
height: 32px;
vertical-align: middle;
}
} }
.wounds { .wounds {
position: relative; position: relative;
height: 24px; height: 24px;
display: flex; display: flex;
flex-direction: unset;
gap: unset;
padding: unset;
margin-bottom: 8px; margin-bottom: 8px;
padding-left: 130px; padding-left: 130px;
grid-area: wounds; grid-area: wounds;
@ -50,7 +27,7 @@
width: 120px; width: 120px;
bottom: 0; bottom: 0;
vertical-align: middle; vertical-align: middle;
text-align: left; text-align: right;
height: 24px; height: 24px;
display: inline-block; display: inline-block;
z-index: 2; z-index: 2;
@ -92,14 +69,8 @@
.actions { .actions {
grid-area: actions; grid-area: actions;
padding: 0;
.grid-of-actions {
display: unset;
}
} }
&.zones { &.zones {
grid-template-areas: "res res" "wounds wounds" "actions paperdoll"; grid-template-areas: "res res" "wounds wounds" "actions paperdoll";

View File

@ -1,44 +1,41 @@
@mixin tab { @mixin tab {
display: grid;
& > div { grid-template-columns: 1fr 320px;
display: grid; grid-template-rows: 74px 1fr;
grid-template-columns: 1fr 320px; gap: 10px;
grid-template-rows: 74px 1fr; height: 100%;
gap: 10px; grid-template-areas:
height: 100%;
grid-template-areas:
"capacity capacity" "capacity capacity"
"inventory equipment"; "inventory equipment";
.capacity { .capacity {
grid-area: capacity; grid-area: capacity;
.resource { .resource {
position: relative; position: relative;
border: 1px inset #ccc; border: 1px inset #ccc;
background-color: rgba(0, 0, 0, 0.2); background-color: rgba(0, 0, 0, 0.2);
height: 8px; height: 8px;
span.fill {
position: absolute;
left: 0;
top: 0;
bottom: 0;
background: linear-gradient(to bottom, #0bad29 0%, #11f128 50%, #0cde24 51%, #6ff77b 100%);
}
span.fill {
position: absolute;
left: 0;
top: 0;
bottom: 0;
background: linear-gradient(to bottom, #0bad29 0%, #11f128 50%, #0cde24 51%, #6ff77b 100%);
} }
} }
}
.inventory { .inventory {
grid-area: inventory; grid-area: inventory;
.equipment:hover { .equipment:hover {
.item-name { .item-name {
text-shadow: 0 0 10px rgb(255 0 0); text-shadow: 0 0 10px rgb(255 0 0);
}
} }
} }
} }

View File

@ -1,22 +0,0 @@
<section class="tab {{tabs.advsf.id}} {{tabs.advsf.cssClass}}"
data-tab="{{tabs.advsf.id}}"
data-group="{{tabs.advsf.group}}">
<div class="advantages-and-specialabilities">
<div class="advantages">
<h3>Vor- und Nachteile</h3>
<ul>
{{#each this.advantages}}
<li>{{> "systems/DSA_4-1/templates/ui/partial-advantage-button.hbs" this}}</li>
{{/each}}
</ul>
</div>
<div class="special-abilities">
<h3>Sonderfertigkeiten</h3>
<ul>
{{#each this.specialAbilities}}
<li>{{> "systems/DSA_4-1/templates/ui/partial-sf-button.hbs" this}}</li>
{{/each}}
</ul>
</div>
</div>
</section>

View File

@ -0,0 +1,161 @@
<section class="tab {{tabs.attributes.id}} {{tabs.attributes.cssClass}}"
data-tab="{{tabs.attributes.id}}"
data-group="{{tabs.attributes.group}}">
<div class="attributes-overview">
<div class="attribute">
<label>Mut</label>
<input value="{{this.system.attribute.mu.aktuell}}">
<div class="mods">
{{#each this.mods.mu}}
<span class="mod" title="{{this.name}}">{{this.value}}</span>
{{/each}}
</div>
</div>
<div class="attribute">
<label>Klugheit</label>
<input value="{{this.system.attribute.kl.aktuell}}">
<div class="mods">
{{#each this.mods.kl}}
<span class="mod" title="{{this.name}}">{{this.value}}</span>
{{/each}}
</div>
</div>
<div class="attribute">
<label>Intuition</label>
<input value="{{this.system.attribute.in.aktuell}}">
<div class="mods">
{{#each this.mods.in}}
<span class="mod" title="{{this.name}}">{{this.value}}</span>
{{/each}}
</div>
</div>
<div class="attribute">
<label>Charisma</label>
<input value="{{this.system.attribute.ch.aktuell}}">
<div class="mods">
{{#each this.mods.ch}}
<span class="mod" title="{{this.name}}">{{this.value}}</span>
{{/each}}
</div>
</div>
<div class="attribute">
<label>Fingerfertigkeit</label>
<input value="{{this.system.attribute.ff.aktuell}}">
<div class="mods">
{{#each this.mods.ff}}
<span class="mod" title="{{this.name}}">{{this.value}}</span>
{{/each}}
</div>
</div>
<div class="attribute">
<label>Geschicklichkeit</label>
<input value="{{this.system.attribute.ge.aktuell}}">
<div class="mods">
{{#each this.mods.ge}}
<span class="mod" title="{{this.name}}">{{this.value}}</span>
{{/each}}
</div>
</div>
<div class="attribute">
<label>Konstitution</label>
<input value="{{this.system.attribute.ko.aktuell}}">
<div class="mods">
{{#each this.mods.ko}}
<span class="mod" title="{{this.name}}">{{this.value}}</span>
{{/each}}
</div>
</div>
<div class="attribute">
<label>Körperkraft</label>
<input value="{{this.system.attribute.kk.aktuell}}">
<div class="mods">
{{#each this.mods.kk}}
<span class="mod" title="{{this.name}}">{{this.value}}</span>
{{/each}}
</div>
</div>
<div class="attribute">
<label>Sozialstatus</label>
<input value="{{this.system.attribute.so.aktuell}}">
</div>
<div class="attribute">
<label>AT-Basis</label>
<input value="{{derived.at.basis}}">
<div class="mods">
{{#each this.mods.at}}
<span class="mod" title="{{this.name}}">{{this.value}}</span>
{{/each}}
</div>
</div>
<div class="attribute">
<label>PA-Basis</label>
<input value="{{derived.pa.basis}}">
<div class="mods">
{{#each this.mods.pa}}
<span class="mod" title="{{this.name}}">{{this.value}}</span>
{{/each}}
</div>
</div>
<div class="attribute">
<label>FK-Basis</label>
<input value="{{derived.fk.basis}}">
<div class="mods">
{{#each this.mods.fk}}
<span class="mod" title="{{this.name}}">{{this.value}}</span>
{{/each}}
</div>
</div>
</div>
<div class="resources-overview">
<div class="attribute">
<label>Lebensenergie</label>
<input value="{{actor.system.lep.aktuell}}">
<input value="{{actor.system.lep.max}}">
</div>
{{#if ausdauer}}
<div class="attribute">
<label>Ausdauer</label>
<input value="{{actor.system.aup.aktuell}}">
<input value="{{actor.system.aup.max}}">
</div>
{{/if}}
{{#if hasSpells}}
<div class="attribute">
<label>Astralenergie</label>
<input value="{{actor.system.asp.aktuell}}">
<input value="{{actor.system.asp.max}}">
</div>
{{/if}}
{{#if hasLiturgies}}
<div class="attribute">
<label>Karmaenergie</label>
<input value="{{actor.system.kap.aktuell}}">
<input value="{{actor.system.kap.max}}">
</div>
{{/if}}
</div>
<div class="advantages">
<h3>Vor- und Nachteile</h3>
<ul>
{{#each this.advantages}}
<li>{{> "systems/DSA_4-1/templates/ui/partial-advantage-button.hbs" this}}</li>
{{/each}}
</ul>
</div>
<div class="special-abilities">
<h3>Sonderfertigkeiten</h3>
<ul>
{{#each this.specialAbilities}}
<li>{{> "systems/DSA_4-1/templates/ui/partial-sf-button.hbs" this}}</li>
{{/each}}
</ul>
</div>
</section>

View File

@ -2,7 +2,7 @@
data-tab="{{tabs.combat.id}}" data-tab="{{tabs.combat.id}}"
data-group="{{tabs.combat.group}}"> data-group="{{tabs.combat.group}}">
<div class="combatline"> <div class="tab-resources">
<div class="initiaitve"> <div class="initiaitve">
<label>Initiative:</label> <label>Initiative:</label>
@ -12,16 +12,16 @@
</div> </div>
<div class="lebensenergie"> <div class="lebensenergie">
<label>Lebensenergie:</label> <label>Lebensenergie:</label>
<input type="number" name="system.lep.aktuell" value="{{this.system.lep.aktuell}}"/> <input type="number" name="system.lep.aktuell" value="{{actor.system.lep.aktuell}}"/>
<span class="inline">von</span> <span class="inline">von</span>
<input type="number" disabled value="{{this.system.lep.max}}"/> <input type="number" disabled value="{{actor.system.lep.max}}"/>
</div> </div>
{{#if ausdauer}} {{#if ausdauer}}
<div class="ausdauer"> <div class="ausdauer">
<label>Ausdauerpunkte:</label> <label>Ausdauerpunkte:</label>
<input type="number" name="system.aup.aktuell" value="{{this.system.aup.aktuell}}"/> <input type="number" name="system.aup.aktuell" value="{{actor.system.aup.aktuell}}"/>
<span class="inline">von</span> <span class="inline">von</span>
<input type="number" disabled value="{{this.system.aup.max}}"/> <input type="number" disabled value="{{actor.system.aup.max}}"/>
</div> </div>
{{/if}} {{/if}}
{{#if (not zonenruestung)}} {{#if (not zonenruestung)}}
@ -54,11 +54,9 @@
<div class="actions"> <div class="actions">
<h3>Aktionen im Kampf</h3> <h3>Aktionen im Kampf</h3>
<div class="grid-of-actions">
{{#each this.actions}} {{#each this.actions}}
{{> "systems/DSA_4-1/templates/ui/partial-action-button.hbs" this}} {{> "systems/DSA_4-1/templates/ui/partial-action-button.hbs" this}}
{{/each}} {{/each}}
</div>
</div> </div>
{{#if (or trefferzonen zonenruestung)}} {{#if (or trefferzonen zonenruestung)}}

View File

@ -16,25 +16,47 @@
{{> "systems/DSA_4-1/templates/ui/partial-equipment-button.hbs" equipments}} {{> "systems/DSA_4-1/templates/ui/partial-equipment-button.hbs" equipments}}
</div> </div>
<!-- TODO: fix paperdoll
<div class="paperdoll"> <div class="paperdoll">
<h3>Ausrüstung</h3> <h3>Ausrüstung</h3>
{{!-- Set Tab Navigation --}} {{!-- Set Tab Navigation --}}
<nav class="sheet-tabs paperdoll-tabs tabs" data-group="secondary">
{{!-- Sheet Tab Navigation --}} {{#each this.sets}}
<nav class="sets-tabs tabs{{#if verticalTabs}} vertical{{/if}}" <a class="item" data-tab="{{this.tab}}">{{this.name}}</a>
aria-roledescription="{{localize "SHEETS.FormNavLabel"}}">
{{#each sets as |tab|}}
<a data-action="tab" data-group="{{tab.group}}" data-tab="{{tab.id}}"
{{#if tab.cssClass}}class="{{tab.cssClass}}"{{/if}}
{{#if tab.tooltip}}data-tooltip="{{tab.tooltip}}"{{/if}}>
{{#if tab.icon}}<i class="{{tab.icon}}" inert></i>{{/if}}
{{#if tab.label}}<span>{{localize tab.label}}</span>{{/if}}
</a>
{{/each}} {{/each}}
</nav> </nav>
{{!-- Set Body --}}
<section class="sheet-body paperdoll-sets">
{{#each this.sets}}
<div class="tab {{this.tab}}" data-group="secondary" data-tab="{{this.tab}}">
<div class="paperdoll">
<svg
width="280"
height="530"
viewBox="0 0 70 140"
xmlns="http://www.w3.org/2000/svg">
<path class="paperdoll-image"
d="m 22.868053,0.6591628 0.658626,-0.52687462 6.270125,4.42573652 3.97809,0.5795595 0.605938,-4.58379633 11.828915,2.02846193 0.07905,2.3182421 3.556578,-0.9220267 6.691636,3.7671414 2.292014,3.7671454 -4.030787,0.05268 0.89573,3.951549 -1.106491,2.23921 -3.345818,-0.632247 0.869387,4.241332 v 2.476303 l 1.422627,-0.02634 0.500563,1.343527 h 3.29312 l 1.975878,3.424677 0.05267,2.818774 2.371046,6.243447 6.665292,14.72611 1.949534,0.658592 0.34249,4.794545 -0.289802,1.606966 0.922074,1.765023 -0.395167,2.897805 2.002222,6.743979 1.027449,1.949433 -0.737657,5.031644 -3.925413,4.399394 -0.922074,-0.553222 0.579595,-1.844054 -1.896847,1.264499 -0.526897,-0.790314 1.475315,-1.369869 -1.36994,-5.690236 -0.974762,4.083275 -1.053803,-0.342473 -0.790345,-3.108552 0.579584,-2.370933 0.526907,-0.658592 -0.263459,-0.500527 0.289803,-1.554277 0.948418,-2.739737 -0.447865,-2.212876 -1.106492,-0.974715 -1.554356,-1.501588 -2.423744,-4.030581 0.711314,-1.264496 -3.793683,-5.532171 -0.02638,-1.554275 -1.475326,-1.554276 -1.185522,-3.213929 -0.869387,-0.763967 -3.029682,4.820892 -1.159179,0.447843 0.447865,0.974716 -0.790345,0.974716 -0.21076,2.002118 0.368823,1.343527 -0.289792,1.923087 1.71243,2.397274 0.02638,1.791371 1.23821,1.975774 2.950651,13.013779 -0.421522,0.684934 2.713536,14.278264 7.113157,18.150786 1.132835,0.0791 3.767339,9.19394 -2.344701,0.73762 1.92318,7.42891 -1.738774,3.87253 1.001116,3.79348 2.687192,4.10961 -0.68497,2.44996 -10.643392,0.079 -0.684969,-8.42997 1.106491,-1.42257 -1.659742,-1.47524 0.07905,-2.00211 -1.949535,-2.18653 -0.55325,-3.84617 -1.422628,0.15805 -0.500553,-7.71869 1.02745,-1.05374 -2.133941,-4.21499 0.421521,-2.42362 -4.32059,-6.322483 -1.317252,-4.056921 -9.247098,-17.702946 -0.395178,0.210749 -3.609266,18.783038 -1.975878,3.635422 -0.289802,10.721871 0.764011,-0.0264 2.397389,7.71869 -4.663069,0.97472 -0.737658,6.74398 -2.212983,1.92309 1.422638,6.74397 -1.896847,3.10855 -4.504997,0.34248 -0.105385,-0.86934 -3.714641,1.2118 -8.140618,0.21075 -0.131729,-2.00212 8.483107,-5.47948 0.711314,-1.89674 -0.316146,-2.18653 0.869386,-0.71128 -1.027449,-1.36986 1.659732,-6.55958 -2.502775,-0.76396 1.317252,-3.42469 -0.289792,-1.2645 2.397389,-3.05585 2.107608,-12.592278 -0.948419,-7.349881 0.316136,-13.90946 -1.554356,-1.159119 4.504996,-21.153968 0.316147,-4.557454 0.948418,-3.345646 -2.160295,2.924147 -4.847487,4.135956 1.264565,1.080091 -3.42485,2.397275 -3.29313,2.766082 -0.68497,1.923087 -1.791461,-0.57956 -1.001116,1.633307 0.07905,4.87358 L 9.168636,68.889233 4.2948053,70.180074 1.5812697,67.466679 0.13228831,66.070468 2.9775532,60.801731 6.5868297,58.825953 6.692205,57.245334 8.0884885,56.059869 v -1.923064 l 2.9769935,-7.824067 2.897953,0.553216 7.323918,-8.166536 v -0.500531 l 3.872714,-4.689172 -0.263448,-2.028463 2.766234,-5.1897 5.163622,-1.448903 0.158063,-1.844055 -0.922074,-2.291899 0.948428,-5.95367 -0.658626,-4.294017 -4.926518,-3.9515498 z"/>
</svg>
{{#each this.slots}}
<div class="equipped {{this.target}}" data-set-id="{{../index}}"
data-target="{{this.target}}" data-actor="{{../../actor.id}}"><img
src="{{this.icon}}"/></div>
{{/each}}
{{#if (eq ../actor.system.setEquipped @index)}}
<button disabled="disabled">Ausgerüstet</button>
{{else}}
<button data-operation="switchSet" data-id="{{@index}}">Wechseln</button>
{{/if}}
</div>
</div>
{{/each}}
</section>
</div>
</div>
-->
</div> </div>
</section> </section>

View File

@ -37,7 +37,7 @@
data-lkp="{{../lkp}}" data-deity="{{this.deity}}"> data-lkp="{{../lkp}}" data-deity="{{this.deity}}">
{{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }} {{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }}
</td> </td>
<td class="clickable" data-id="{{this.id}}" data-action="openActorSheet"> <td class="clickable" data-id="{{this.id}}" data-operation="openActorSheet">
{{this.name}}</td> {{this.name}}</td>
<td></td> <td></td>
</tr> </tr>
@ -56,7 +56,7 @@
data-lkp="{{../lkp}}" data-deity="{{this.deity}}"> data-lkp="{{../lkp}}" data-deity="{{this.deity}}">
{{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }} {{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }}
</td> </td>
<td class="clickable" data-id="{{this.id}}" data-action="openActorSheet"> <td class="clickable" data-id="{{this.id}}" data-operation="openActorSheet">
{{this.name}}</td> {{this.name}}</td>
<td></td> <td></td>
</tr> </tr>
@ -77,7 +77,7 @@
{{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }} {{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }}
</td> </td>
<td class="clickable" data-id="{{this.id}}" <td class="clickable" data-id="{{this.id}}"
data-action="openActorSheet">{{this.name}}</td> data-operation="openActorSheet">{{this.name}}</td>
</tr> </tr>
{{/each}} {{/each}}
{{/if}} {{/if}}
@ -96,7 +96,7 @@
{{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }} {{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }}
</td> </td>
<td class="clickable" data-id="{{this.id}}" <td class="clickable" data-id="{{this.id}}"
data-action="openActorSheet">{{this.name}}</td> data-operation="openActorSheet">{{this.name}}</td>
</tr> </tr>
{{/each}} {{/each}}
{{/if}} {{/if}}
@ -115,7 +115,7 @@
{{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }} {{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }}
</td> </td>
<td class="clickable" data-id="{{this.id}}" <td class="clickable" data-id="{{this.id}}"
data-action="openActorSheet">{{this.name}}</td> data-operation="openActorSheet">{{this.name}}</td>
</tr> </tr>
{{/each}}{{/if}} {{/each}}{{/if}}
{{#if this.countV}} {{#if this.countV}}
@ -133,7 +133,7 @@
{{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }} {{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }}
</td> </td>
<td class="clickable" data-id="{{this.id}}" <td class="clickable" data-id="{{this.id}}"
data-action="openActorSheet">{{this.name}}</td> data-operation="openActorSheet">{{this.name}}</td>
</tr> </tr>
{{/each}} {{/each}}
{{/if}} {{/if}}
@ -152,7 +152,7 @@
{{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }} {{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }}
</td> </td>
<td class="clickable" data-id="{{this.id}}" <td class="clickable" data-id="{{this.id}}"
data-action="openActorSheet">{{this.name}}</td> data-operation="openActorSheet">{{this.name}}</td>
</tr> </tr>
{{/each}} {{/each}}
{{/if}}{{#if this.countVII}} {{/if}}{{#if this.countVII}}
@ -170,7 +170,7 @@
{{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }} {{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }}
</td> </td>
<td class="clickable" data-id="{{this.id}}" <td class="clickable" data-id="{{this.id}}"
data-action="openActorSheet">{{this.name}}</td> data-operation="openActorSheet">{{this.name}}</td>
</tr> </tr>
{{/each}} {{/each}}
{{/if}}{{#if this.countVIII}} {{/if}}{{#if this.countVIII}}
@ -188,7 +188,7 @@
{{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }} {{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }}
</td> </td>
<td class="clickable" data-id="{{this.id}}" <td class="clickable" data-id="{{this.id}}"
data-action="openActorSheet">{{this.name}}</td> data-operation="openActorSheet">{{this.name}}</td>
</tr> </tr>
{{/each}} {{/each}}
{{/if}} {{/if}}

View File

@ -1,29 +0,0 @@
<section class="tab {{sets.set1.id}} {{sets.set1.cssClass}}"
data-tab="{{sets.set1.id}}"
data-group="{{sets.set1.group}}">
<div class="paperdoll">
<svg
width="280"
height="530"
viewBox="0 0 70 140"
xmlns="http://www.w3.org/2000/svg">
<path class="paperdoll-image"
d="m 22.868053,0.6591628 0.658626,-0.52687462 6.270125,4.42573652 3.97809,0.5795595 0.605938,-4.58379633 11.828915,2.02846193 0.07905,2.3182421 3.556578,-0.9220267 6.691636,3.7671414 2.292014,3.7671454 -4.030787,0.05268 0.89573,3.951549 -1.106491,2.23921 -3.345818,-0.632247 0.869387,4.241332 v 2.476303 l 1.422627,-0.02634 0.500563,1.343527 h 3.29312 l 1.975878,3.424677 0.05267,2.818774 2.371046,6.243447 6.665292,14.72611 1.949534,0.658592 0.34249,4.794545 -0.289802,1.606966 0.922074,1.765023 -0.395167,2.897805 2.002222,6.743979 1.027449,1.949433 -0.737657,5.031644 -3.925413,4.399394 -0.922074,-0.553222 0.579595,-1.844054 -1.896847,1.264499 -0.526897,-0.790314 1.475315,-1.369869 -1.36994,-5.690236 -0.974762,4.083275 -1.053803,-0.342473 -0.790345,-3.108552 0.579584,-2.370933 0.526907,-0.658592 -0.263459,-0.500527 0.289803,-1.554277 0.948418,-2.739737 -0.447865,-2.212876 -1.106492,-0.974715 -1.554356,-1.501588 -2.423744,-4.030581 0.711314,-1.264496 -3.793683,-5.532171 -0.02638,-1.554275 -1.475326,-1.554276 -1.185522,-3.213929 -0.869387,-0.763967 -3.029682,4.820892 -1.159179,0.447843 0.447865,0.974716 -0.790345,0.974716 -0.21076,2.002118 0.368823,1.343527 -0.289792,1.923087 1.71243,2.397274 0.02638,1.791371 1.23821,1.975774 2.950651,13.013779 -0.421522,0.684934 2.713536,14.278264 7.113157,18.150786 1.132835,0.0791 3.767339,9.19394 -2.344701,0.73762 1.92318,7.42891 -1.738774,3.87253 1.001116,3.79348 2.687192,4.10961 -0.68497,2.44996 -10.643392,0.079 -0.684969,-8.42997 1.106491,-1.42257 -1.659742,-1.47524 0.07905,-2.00211 -1.949535,-2.18653 -0.55325,-3.84617 -1.422628,0.15805 -0.500553,-7.71869 1.02745,-1.05374 -2.133941,-4.21499 0.421521,-2.42362 -4.32059,-6.322483 -1.317252,-4.056921 -9.247098,-17.702946 -0.395178,0.210749 -3.609266,18.783038 -1.975878,3.635422 -0.289802,10.721871 0.764011,-0.0264 2.397389,7.71869 -4.663069,0.97472 -0.737658,6.74398 -2.212983,1.92309 1.422638,6.74397 -1.896847,3.10855 -4.504997,0.34248 -0.105385,-0.86934 -3.714641,1.2118 -8.140618,0.21075 -0.131729,-2.00212 8.483107,-5.47948 0.711314,-1.89674 -0.316146,-2.18653 0.869386,-0.71128 -1.027449,-1.36986 1.659732,-6.55958 -2.502775,-0.76396 1.317252,-3.42469 -0.289792,-1.2645 2.397389,-3.05585 2.107608,-12.592278 -0.948419,-7.349881 0.316136,-13.90946 -1.554356,-1.159119 4.504996,-21.153968 0.316147,-4.557454 0.948418,-3.345646 -2.160295,2.924147 -4.847487,4.135956 1.264565,1.080091 -3.42485,2.397275 -3.29313,2.766082 -0.68497,1.923087 -1.791461,-0.57956 -1.001116,1.633307 0.07905,4.87358 L 9.168636,68.889233 4.2948053,70.180074 1.5812697,67.466679 0.13228831,66.070468 2.9775532,60.801731 6.5868297,58.825953 6.692205,57.245334 8.0884885,56.059869 v -1.923064 l 2.9769935,-7.824067 2.897953,0.553216 7.323918,-8.166536 v -0.500531 l 3.872714,-4.689172 -0.263448,-2.028463 2.766234,-5.1897 5.163622,-1.448903 0.158063,-1.844055 -0.922074,-2.291899 0.948428,-5.95367 -0.658626,-4.294017 -4.926518,-3.9515498 z"/>
</svg>
{{#each this.slots}}
<div class="equipped {{this.target}}" data-set-id="{{../index}}"
data-target="{{this.target}}" data-actor="{{../../actor.id}}"><img
src="{{this.icon}}"/></div>
{{/each}}
{{#if (eq ../actor.system.setEquipped @index)}}
<button disabled="disabled">Ausgerüstet</button>
{{else}}
<button data-operation="switchSet" data-id="{{@index}}">Wechseln</button>
{{/if}}
</div>
</section>

View File

@ -32,7 +32,7 @@
<td class="spell rollable"> <td class="spell rollable">
{{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }} {{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }}
</td> </td>
<td class="clickable" data-id="{{this.id}}" data-action="openActorSheet"> <td class="clickable" data-id="{{this.id}}" data-operation="openActorSheet">
<span>{{this.name}}</span></td> <span>{{this.name}}</span></td>
<td>{{this.eigenschaft1}}</td> <td>{{this.eigenschaft1}}</td>
<td>{{this.eigenschaft2}}</td> <td>{{this.eigenschaft2}}</td>

View File

@ -2,6 +2,27 @@
data-tab="{{tabs.inventory.id}}" data-tab="{{tabs.inventory.id}}"
data-group="{{tabs.inventory.group}}"> data-group="{{tabs.inventory.group}}">
{{> "systems/DSA_4-1/templates/ui/partial-equipment-button.hbs" inventoryItems}} <table class="inventory-table">
<thead>
<tr>
<th colspan="2"></th>
<th>Anzahl</th>
<th>Gewicht</th>
</tr>
</thead>
<tbody>
{{#each inventoryItems}}
<tr class="equipment" data-item-id="{{this.id}}" draggable="true">
<td class="icon"><img alt="" src="{{this.icon}}" width="16" height="16"></td>
<td class="name">{{this.name}}</td>
<td class="quantity">{{this.quantity}}</td>
<td class="weight">{{this.weight}}</td>
</tr>
{{/each}}
</tbody>
</table>
</div>
</section> </section>

View File

@ -6,7 +6,7 @@
{{#each this.characters}} {{#each this.characters}}
{{#if this.isVisible}} {{#if this.isVisible}}
<div class="character"> <div class="character">
<div class="header clickable" data-id="{{this.id}}" data-action="openActorSheet"> <div class="header clickable" data-id="{{this.id}}" data-operation="openActorSheet">
<img class="profile-img" src="{{this.img}}" style="object-fit: cover;" <img class="profile-img" src="{{this.img}}" style="object-fit: cover;"
title="{{this.name}}" alt="{{this.name}}"/> title="{{this.name}}" alt="{{this.name}}"/>
<span class="name">{{this.name}}</span> <span class="name">{{this.name}}</span>
@ -24,7 +24,8 @@
{{#each this.fields.head}} {{#each this.fields.head}}
<th> <th>
<div class="character"> <div class="character">
<div class="header clickable" data-id="{{this.id}}" data-action="openActorDocument"> <div class="header clickable" data-id="{{this.id}}"
data-operation="openActorSheet">
<img class="profile-img" src="{{this.img}}" style="object-fit: cover;" <img class="profile-img" src="{{this.img}}" style="object-fit: cover;"
title="{{this.name}}" alt="{{this.name}}"/> title="{{this.name}}" alt="{{this.name}}"/>
<span class="name">{{this.name}}</span> <span class="name">{{this.name}}</span>

View File

@ -11,7 +11,7 @@
{{#each this}} {{#each this}}
<tr class="equipment" data-item-id="{{this.id}}" draggable="true" data-action="openEmbeddedDocument"> <tr class="equipment" data-item-id="{{this.id}}" draggable="true">
<td class="icon"><img alt="" src="{{this.icon}}" width="16" height="16"></td> <td class="icon"><img alt="" src="{{this.icon}}" width="16" height="16"></td>
<td class="name">{{this.name}}</td> <td class="name">{{this.name}}</td>
<td class="quantity">{{this.quantity}}</td> <td class="quantity">{{this.quantity}}</td>