Zusammenführung-von-Fertigkeiten,-Waffen-und-Rüstungen-im-Kampf-Tab-#15 (#48)
- Created character description tab - Redesigned skill, gear and combat tab - Weapons, defense weapons and armor is still in the gear tab. If you equip them (now directly possible via click on the equip icon), they appear in the combat tab. Reason: This holds the combat tab clean for combat stuff. Co-authored-by: Ender <harald@drueppels.de> Reviewed-on: #48 Reviewed-by: Byroks <byroks@gmail.com>
This commit was merged in pull request #48.
This commit is contained in:
@@ -6,13 +6,14 @@ const preloadTemplates = async (): Promise<Handlebars.TemplateDelegate<any>[]> =
|
||||
// const templates = [ rootPath + "actor/actor-sheet.hbs" ]
|
||||
// This would map to our local folder of /Assets/Templates/Actor/actor-sheet.hbs
|
||||
const templates: Array<string> = [
|
||||
"sheets/character/description.hbs",
|
||||
"sheets/character/attribute.hbs",
|
||||
"sheets/character/base_values.hbs",
|
||||
"sheets/character/main.hbs",
|
||||
"sheets/character/skills.hbs",
|
||||
"sheets/character/gear.hbs",
|
||||
"sheets/character/spells.hbs",
|
||||
"sheets/character/kampfkuenste.hbs",
|
||||
"sheets/character/combat.hbs",
|
||||
"sheets/character/effects.hbs",
|
||||
"sheets/partial/mod.hbs",
|
||||
"sheets/item/rolls.hbs",
|
||||
|
||||
@@ -319,6 +319,10 @@ export class M5Character extends Actor {
|
||||
hoarded: item.system?.hoarded,
|
||||
value: item.system.value || 0,
|
||||
calc: item.system.calc,
|
||||
special: item.system.special,
|
||||
damageBase: item.system.damageBase,
|
||||
equipped: item.system?.equipped,
|
||||
containerId: item.system.containerId || "",
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -347,7 +351,10 @@ export class M5Character extends Actor {
|
||||
valuable: item.system?.valuable,
|
||||
hoarded: item.system?.hoarded,
|
||||
value: item.system.value || 0,
|
||||
defenseBonus: item.system.stats.defenseBonus,
|
||||
calc: item.system.calc,
|
||||
equipped: item.system?.equipped,
|
||||
containerId: item.system.containerId || "",
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -375,8 +382,10 @@ export class M5Character extends Actor {
|
||||
valuable: item.system?.valuable,
|
||||
hoarded: item.system?.hoarded,
|
||||
value: item.system.value || 0,
|
||||
lpProtection: item.system.lpProtection,
|
||||
calc: item.system.calc,
|
||||
equipped: item.system?.equipped,
|
||||
containerId: item.system.containerId || "",
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@@ -79,14 +79,23 @@ export class M5Item extends Item {
|
||||
calc.special = itemData.special ? 2 : 0;
|
||||
calc.ew = calc.special + itemData.stats.attackBonus;
|
||||
calc.combatSkills = null;
|
||||
calc.containers = null;
|
||||
|
||||
|
||||
if (actor) {
|
||||
const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true, kampfkuenste: true });
|
||||
if (actorCalc) {
|
||||
calc.ew += actorCalc.stats.attackBonus.value;
|
||||
calc.combatSkills = actorCalc.skills.combat;
|
||||
calc.containers = actorCalc.gear.containers;
|
||||
}
|
||||
|
||||
const container = character.getItem(itemData.containerId);
|
||||
//console.log("M5Item.prepareDerivedData:containers", itemData, container?.system)
|
||||
if (container) {
|
||||
container.prepareDerivedData();
|
||||
const containerData = container.system;
|
||||
}
|
||||
|
||||
const skill = character.getItem(itemData.skillId);
|
||||
//console.log("M5Item.prepareDerivedData:weapon", itemData, skill?.system)
|
||||
if (skill) {
|
||||
@@ -103,14 +112,23 @@ export class M5Item extends Item {
|
||||
calc.special = itemData.special ? 2 : 0;
|
||||
calc.ew = calc.special + itemData.stats.defenseBonus;
|
||||
calc.combatSkills = null;
|
||||
calc.containers = null;
|
||||
|
||||
if (actor) {
|
||||
const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true, kampfkuenste: true });
|
||||
if (actorCalc) {
|
||||
calc.ew += actorCalc.stats.defense.value + actorCalc.stats.defenseBonus.value;
|
||||
calc.combatSkills = actorCalc.skills.combat;
|
||||
calc.containers = actorCalc.gear.containers;
|
||||
}
|
||||
|
||||
const container = character.getItem(itemData.containerId);
|
||||
//console.log("M5Item.prepareDerivedData:containers", itemData, container?.system)
|
||||
if (container) {
|
||||
container.prepareDerivedData();
|
||||
const containerData = container.system;
|
||||
}
|
||||
|
||||
const skill = character.getItem(itemData.skillId);
|
||||
//console.log("M5Item.prepareDerivedData:weapon", itemData, skill?.system)
|
||||
if (skill) {
|
||||
@@ -128,6 +146,19 @@ export class M5Item extends Item {
|
||||
itemData.mods[3] = { type: "attribute", id: "gw", operation: "add100", value: itemData.attributeMod.gw };
|
||||
itemData.mods[4] = { type: "stat", id: "lpProtection", operation: "set", value: itemData.lpProtection };
|
||||
itemData.mods[5] = { type: "stat", id: "apProtection", operation: "set", value: itemData.apProtection };
|
||||
calc.containers = null;
|
||||
if (actor) {
|
||||
const actorCalc = actor.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true, kampfkuenste: true });
|
||||
if (actorCalc) {
|
||||
calc.containers = actorCalc.gear.containers;
|
||||
}
|
||||
const container = character.getItem(itemData.containerId);
|
||||
//console.log("M5Item.prepareDerivedData:containers", itemData, container?.system)
|
||||
if (container) {
|
||||
container.prepareDerivedData();
|
||||
const containerData = container.system;
|
||||
}
|
||||
}
|
||||
} else if (itemType === "spell") {
|
||||
calc.fw = 0;
|
||||
if (actor) {
|
||||
|
||||
@@ -246,6 +246,28 @@ export default class M5CharacterSheet extends ActorSheet {
|
||||
const roll = M5Roll.resistanceBody(this.actor);
|
||||
await roll.toMessage();
|
||||
});
|
||||
|
||||
html.find(".change-equipped").on("click", async (event) => {
|
||||
let row = event.target.parentElement;
|
||||
let itemId = row.dataset["item"];
|
||||
while (!itemId) {
|
||||
row = row.parentElement;
|
||||
if (!row) return;
|
||||
itemId = row.dataset["item"];
|
||||
}
|
||||
|
||||
const context = this.actor as any;
|
||||
const item = context.items.get(itemId);
|
||||
if (item.system.equipped === true) {
|
||||
item.system.equipped = false;
|
||||
}
|
||||
else {
|
||||
item.system.equipped = true;
|
||||
}
|
||||
this.render();
|
||||
});
|
||||
|
||||
|
||||
// Drag & Drop
|
||||
const dragDrop = new DragDrop({
|
||||
dragSelector: ".items-list .item",
|
||||
|
||||
@@ -23,6 +23,11 @@
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.flexcolumn-3 {
|
||||
flex: 33%;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.flexcolumn-4 {
|
||||
flex: 25%;
|
||||
flex-wrap: wrap;
|
||||
@@ -167,6 +172,11 @@
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
&.highlight {
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
}
|
||||
}
|
||||
|
||||
.table-icon {
|
||||
@@ -188,22 +198,34 @@
|
||||
width: 5rem;
|
||||
}
|
||||
|
||||
input.checkbox {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
}
|
||||
|
||||
.new-skill {
|
||||
font-style: italic;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
color: rgba(255, 255, 255);
|
||||
|
||||
button {
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
button.roll-button {
|
||||
.roll-button {
|
||||
background: url(/icons/svg/d20-black.svg) no-repeat;
|
||||
background-size: 24px 24px;
|
||||
background-size: 1rem 1rem;
|
||||
border: #000000 solid 0px;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
}
|
||||
|
||||
.learn-button {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
height: 1rem;
|
||||
width: 4rem;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
font-size: smaller;
|
||||
text-align: center;
|
||||
line-height: 0.8rem;
|
||||
}
|
||||
|
||||
span.spell-process {
|
||||
@@ -256,15 +278,23 @@
|
||||
}
|
||||
}
|
||||
|
||||
.biography {
|
||||
margin: 0.5rem 0.5rem 0.5rem 0.5rem;
|
||||
height: 180px;
|
||||
background-color: #eaead7;
|
||||
}
|
||||
|
||||
.attributes {
|
||||
padding: 0.5rem 0.5rem 0.5rem 0.5rem;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-bottom: 0.5rem;
|
||||
background-color: beige;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
|
||||
.attribute {
|
||||
flex: 0 0 7rem;
|
||||
flex: 0 0 6rem;
|
||||
margin: 0;
|
||||
border: 1px solid @attributeBorderColor;
|
||||
//border-bottom: none;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
"characterDescription": {
|
||||
"info": {
|
||||
"description": "",
|
||||
"background": "",
|
||||
"class": "",
|
||||
"race": "",
|
||||
"magicUsing": false,
|
||||
@@ -203,7 +204,7 @@
|
||||
},
|
||||
"equippable": {
|
||||
"equippable": false,
|
||||
"equipped": true
|
||||
"equipped": false
|
||||
},
|
||||
"valuable": {
|
||||
"valuable": false,
|
||||
|
||||
Reference in New Issue
Block a user