Skill & Sheets Update (#88)

+ Added FW-Increase/Decrease on Weapon and Language Skills
+ Added ItemIcons for Skills, Gear, Spells, Combat and Effects
+ Re-Added Belastungseffect with all mods working nearly smoothless (only bugging on new actors once created; could be commented out if not approvable until better solution exists)

![grafik](/attachments/451f5642-8250-4331-bdb7-04019ce2525c)

Reviewed-on: #88
Reviewed-by: Byroks <byroks@gmail.com>
Co-authored-by: LeFrique <lefrique@live.de>
Co-committed-by: LeFrique <lefrique@live.de>
This commit is contained in:
LeFrique 2024-03-14 20:58:52 +01:00 committed by Le-Frique
parent 43375a19c8
commit af6fdbbf89
7 changed files with 106 additions and 65 deletions

View File

@ -248,6 +248,7 @@
"midgard5.learned-skills": "Gelernte Fertigkeiten",
"midgard5.language": "Sprache",
"midgard5.languages": "Sprachen",
"midgard5.writings": "Schriften",
"midgard5.weapon-skill": "Waffenfertigkeit",
"midgard5.weapon-skills": "Waffenfertigkeiten",
"midgard5.unlearned-skill": "Ungelernte Fertigkeit",

View File

@ -363,6 +363,7 @@ export class M5Character extends Actor {
ret.gear.weapons[item.id] = {
label: label,
icon: item.img,
skillId: item.system.skillId,
magic: item.system.magic,
valuable: item.system?.valuable,
@ -405,6 +406,7 @@ export class M5Character extends Actor {
ret.gear.defensiveWeapons[item.id] = {
label: label,
icon: item.img,
skillId: item.system.skillId,
magic: item.system.magic,
valuable: item.system?.valuable,
@ -448,6 +450,7 @@ export class M5Character extends Actor {
ret.gear.armor[item.id] = {
label: label,
icon: item.img,
magic: item.system.magic,
valuable: item.system?.valuable,
hoarded: item.system?.hoarded,
@ -461,55 +464,39 @@ export class M5Character extends Actor {
};
});
// if (!skip?.encumbrance) {
// const item = context.items.filter((x) => x.name === "Belastung");
// if (ret.stats.encumbrance > ret.stats.heavyLoad) {
// if (item.length === 0) {
// this.createEffect("Belastung", [{ id: "movement", operation: M5ModOperation.DIVISION, type: M5ModType.STAT, value: 2 }]);
// } else if (item.length === 1) {
//if (!skip?.encumbrance) {
//const item = context.items.filter((x) => x.name === "Belastung");
//if (item.length === 0) {
// this.createEffect("Belastung", [
// { id: "movement", operation: M5ModOperation.DIVISION, type: M5ModType.STAT, value: 2 },
// { id: "attackBonus", operation: M5ModOperation.SUBTRACT, type: M5ModType.STAT, value: 4 },
// { id: "defenseBonus", operation: M5ModOperation.SUBTRACT, type: M5ModType.STAT, value: 4 }
// ]);
//} else if (item.length === 2) {
// item[1]?.delete();
//}
//
//if (item.length === 1) {
// item[0]?.update({
// img: "icons/containers/bags/sack-simple-leather-orange.webp" });
// }
//
//if (ret.stats.encumbrance <= ret.stats.heavyLoad) {
// item[0]?.update({
// data: {
// equipped: false,
// }
// });
// }
//
//if (ret.stats.encumbrance > ret.stats.heavyLoad) {
// item[0].update({
// data: {
// equipped: true,
// },
// });
// } else if (item.length === 2) {
// item[1]?.delete();
// }
// } else if (ret.stats.encumbrance <= ret.stats.heavyLoad) {
// if (item.length === 1) {
// item[0]?.update({
// data: {
// equipped: false,
// },
// });
// }
// }
// }
// if (!skip?.encumbrance) {
// const item = context.items.filter((x) => x.name === "Höchstlast");
// if (ret.stats.encumbrance > ret.stats.loadMax) {
// if (item.length === 0) {
// this.createEffect("Höchstlast", [{ id: "ap", operation: M5ModOperation.SUBTRACT, type: M5ModType.STAT, value: 1 }]);
// } else if (item.length === 1) {
// item[0].update({
// data: {
// equipped: true,
// },
// });
// } else if (item.length === 2) {
// item[1]?.delete();
// }
// } else if (ret.stats.encumbrance <= ret.stats.loadMax) {
// if (item.length === 1) {
// item[0]?.update({
// data: {
// equipped: false,
// },
// });
// }
// }
// }
//}
}
if (!skip?.effects) {
@ -526,6 +513,7 @@ export class M5Character extends Actor {
ret.gear.effects[item.id] = {
label: label,
icon: item.img,
magic: item.system.magic,
calc: item.system.calc,
equipped: item.system?.equipped || false,
@ -543,6 +531,7 @@ export class M5Character extends Actor {
const skillMap = ret.skills[item.system.type];
skillMap[item.id] = {
label: item.name,
icon: item.img,
fw: item.system.fw,
attribute: item.system.attribute,
pp: item.system.pp,
@ -570,6 +559,7 @@ export class M5Character extends Actor {
ret.spells[item.id] = {
label: item.name,
icon: item.img,
process: "midgard5.spell-process-" + item.system.process,
calc: item.system.calc,
type: item.system.type,
@ -593,6 +583,7 @@ export class M5Character extends Actor {
ret.kampfkuenste[item.id] = {
label: item.name,
icon: item.img,
isKido: item.system.isKido,
type: item.system.type,
variante: item.system.variante,

View File

@ -54,6 +54,7 @@
<table>
<thead>
<tr>
<th class="title"><img src="/icons/svg/eye.svg" class="table-icon"></th>
<th class="title">{{localize "TYPES.Item.weapon"}}</th>
<th class="title">{{localize "midgard5.ew"}}</th>
<th class="title">{{localize "midgard5.damage"}}</th>
@ -65,6 +66,7 @@
{{#each data.calc.gear.weapons as |item itemId|}}
{{#if item.equipped}}
<tr data-item-id="{{itemId}}" class="item">
<td class="flexpart-img"><img src={{item.icon}} class="flexpart-icon"></td>
<td class="padding edit-item {{#if item.special}}highlight{{/if}}">{{item.label}}{{#if item.special}}(*){{/if}}</td>
<td class="fixed-value">{{item.calc.ew}}</td>
<td class="fixed-value">{{item.damageBase}}</td>
@ -81,6 +83,7 @@
{{/each}}
<tr data-item-id="{{itemId}}">
<td class="flexpart-img"><img src="icons/skills/melee/unarmed-punch-fist-yellow-red.webp" class="flexpart-icon"></td>
<td class="padding edit-item">{{localize "midgard5.brawl"}}</td>
<td class="fixed-value">{{data.calc.stats.brawlFw}}</td>
<td class="fixed-value">1d6 -4</td>
@ -93,6 +96,7 @@
<table>
<thead>
<tr>
<th class="title"><img src="/icons/svg/eye.svg" class="table-icon"></th>
<th class="title">{{localize "TYPES.Item.kampfkunst"}}</th>
<th class="title">{{localize "midgard5.kampfkunst-variante-short"}}</th>
<th class="title">{{localize "midgard5.ew"}}</th>
@ -103,6 +107,7 @@
<tbody class="items-list">
{{#each data.calc.kampfkuenste as |item itemId|}}
<tr data-item-id="{{itemId}}" class="item">
<td class="flexpart-img"><img src={{item.icon}} class="flexpart-icon"></td>
<td class="padding edit-item">{{item.label}}</td>
<td>
{{#if item.isKido}}
@ -131,17 +136,20 @@
<table>
<tr height = 10px></tr>
<tr>
<td class="flexpart-img"><img src="icons/magic/defensive/shield-barrier-glowing-blue.webp" class="flexpart-icon"></td>
<td class="padding edit-item highlight">{{localize "midgard5.defense"}}</td>
<td class="center">{{add data.calc.stats.defense.value data.calc.stats.defenseBonus.value}}</td>
<td class="fixed-value"><button class="roll-button roll-defense-button"></button></td>
</tr>
<tr>
<td class="flexpart-img"><img src="icons/magic/nature/elemental-plant-humanoid.webp" class="flexpart-icon"></td>
<td class="padding edit-item highlight">{{localize "midgard5.resistanceMind"}}</td>
<td class="center">{{data.calc.stats.resistanceMind.value}}</td>
<td class="fixed-value"><button class="roll-button roll-resistanceMind-button"></button></td>
</tr>
<tr>
<td class="flexpart-img"><img src="icons/magic/control/silhouette-hold-change-green.webp" class="flexpart-icon"></td>
<td class="padding edit-item highlight">{{localize "midgard5.resistanceBody"}}</td>
<td class="center">{{data.calc.stats.resistanceBody.value}}</td>
<td class="fixed-value"><button class="roll-button roll-resistanceBody-button"></button></td>
@ -151,6 +159,7 @@
<table>
<thead>
<tr>
<th class="title"><img src="/icons/svg/eye.svg" class="table-icon"></th>
<th class="title">{{localize "TYPES.Item.defensiveWeapon"}}</th>
<th class="title">{{localize "midgard5.ew"}}</th>
<th class="title">{{localize "midgard5.defenseBonus-short"}}</th>
@ -162,6 +171,7 @@
{{#each data.calc.gear.defensiveWeapons as |item itemId|}}
{{#if item.equipped}}
<tr data-item-id="{{itemId}}" class="item">
<td class="flexpart-img"><img src={{item.icon}} class="flexpart-icon"></td>
<td class="padding edit-item">{{item.label}}</td>
<td class="fixed-value">{{item.calc.ew}}</td>
<td class="fixed-value">{{item.defenseBonus}}</td>
@ -182,6 +192,7 @@
<table>
<thead>
<tr>
<th class="title"><img src="/icons/svg/eye.svg" class="table-icon"></th>
<th class="title">{{localize "TYPES.Item.armor"}}</th>
<th class="title">{{localize "midgard5.actor-lp-short"}}</th>
<th class="title center"><img src="/systems/midgard5/assets/icons/icon/battle-gear.svg" class="table-icon"></th>
@ -191,6 +202,7 @@
{{#each data.calc.gear.armor as |item itemId|}}
{{#if item.equipped}}
<tr data-item-id="{{itemId}}" class="item">
<td class="flexpart-img"><img src={{item.icon}} class="flexpart-icon"></td>
<td class="padding">{{item.label}}</td>
<td class="fixed-value">{{lpProtection}}</td>
<td class="change-equipped">

View File

@ -1,6 +1,7 @@
<table>
<thead>
<tr>
<th class="title"><img src="/icons/svg/eye.svg" class="table-icon"></th>
<th class="title">{{localize "TYPES.Item.effect"}}</th>
<td><a class="title add-effect"><i class="fa-regular fa-plus"></i></a></th>
@ -9,6 +10,7 @@
<tbody class="items-list">
{{#each data.calc.gear.effects as |item itemId|}}
<tr data-item-id="{{itemId}}" class="items">
<td class="flexpart-img"><img src={{item.icon}} class="flexpart-icon"></td>
<td class="padding">
<span class="edit-item">{{item.label}}</span>
{{#if item.equipped}}
@ -18,7 +20,9 @@
{{/unless}}
{{/if}}
</td>
{{!--{{#unless (eq item.label "Belastung")}}--}}
<td class="fixed-value"><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
{{!--{{/unless}}--}}
</tr>
{{/each}}
</tbody>

View File

@ -69,6 +69,7 @@
<table>
<thead class="theader">
<tr>
<th class="title"><img src="/icons/svg/eye.svg" class="table-icon"></th>
<th class="title">{{localize "TYPES.Item.item"}}</th>
<th class="title center">{{localize "midgard5.item-quantity"}}</th>
<th class="title center">{{localize "midgard5.item-value"}}</th>
@ -83,6 +84,7 @@
{{#each ../data.calc.gear.items as |item itemId|}}
{{#if (eq item.containerId containerId)}}
<tr data-item-id="{{itemId}}" class="item">
<td class="flexpart-img"><img src={{item.icon}} class="flexpart-icon"></td>
<td class="padding">
<span class="edit-item">{{item.label}}</span>
</td>
@ -116,6 +118,7 @@
{{#each ../data.calc.gear.weapons as |item itemId|}}
{{#if (eq item.containerId containerId)}}
<tr data-item-id="{{itemId}}" class="item">
<td class="flexpart-img"><img src={{item.icon}} class="flexpart-icon"></td>
<td class="padding">
<span class="edit-item">{{item.label}}</span>
</td>
@ -145,6 +148,7 @@
{{#each ../data.calc.gear.defensiveWeapons as |item itemId|}}
{{#if (eq item.containerId containerId)}}
<tr data-item-id="{{itemId}}" class="item">
<td class="flexpart-img"><img src={{item.icon}} class="flexpart-icon"></td>
<td class="padding">
<span class="edit-item">{{item.label}}</span>
</td>
@ -174,6 +178,7 @@
{{#each ../data.calc.gear.armor as |item itemId|}}
{{#if (eq item.containerId containerId)}}
<tr data-item-id="{{itemId}}" class="item">
<td class="flexpart-img"><img src={{item.icon}} class="flexpart-icon"></td>
<td class="padding">
<span class="edit-item">{{item.label}}</span>
</td>
@ -222,6 +227,7 @@
<table>
<thead class="theader">
<tr>
<th class="title"><img src="/icons/svg/eye.svg" class="table-icon"></th>
<th class="title">{{localize "TYPES.Item.container"}}</th>
<th class="title center">{{localize "midgard5.item-value"}}</th>
<th class="title center">{{localize "midgard5.item-weight"}}</th>
@ -234,6 +240,7 @@
<tr height = 10px></tr>
{{#each data.calc.gear.containers as |item itemId|}}
<tr data-item-id="{{itemId}}" class="item">
<td class="flexpart-img"><img src={{item.icon}} class="flexpart-icon"></td>
<td class="padding">
<span class="edit-item">{{item.label}}</span>
</td>
@ -269,6 +276,7 @@
<table>
<thead class="theader">
<tr>
<th class="title"><img src="/icons/svg/eye.svg" class="table-icon"></th>
<th class="title">{{localize "TYPES.Item.item"}}</th>
<th class="title center">{{localize "midgard5.item-quantity"}}</th>
<th class="title center">{{localize "midgard5.item-value"}}</th>
@ -283,6 +291,7 @@
{{#each data.calc.gear.items as |item itemId|}}
{{#if (or ../data.info.showAllItems (eq item.containerId ""))}}
<tr data-item-id="{{itemId}}" class="item">
<td class="flexpart-img"><img src={{item.icon}} class="flexpart-icon"></td>
<td class="padding">
<span class="edit-item">{{item.label}}</span>
</td>
@ -325,6 +334,7 @@
<table>
<thead>
<tr>
<th class="title"><img src="/icons/svg/eye.svg" class="table-icon"></th>
<th class="title">{{localize "TYPES.Item.weapon"}}</th>
<th class="title center">{{localize "midgard5.item-value"}}</th>
<th class="title center">{{localize "midgard5.item-weight"}}</th>
@ -337,6 +347,7 @@
{{#each data.calc.gear.weapons as |item itemId|}}
{{#if (or ../data.info.showAllItems (eq item.containerId ""))}}
<tr data-item-id="{{itemId}}" class="item">
<td class="flexpart-img"><img src={{item.icon}} class="flexpart-icon"></td>
<td class="padding edit-item">{{item.label}}</td>
<td style="text-align: start">
{{#unless (or (eq item.value 0) (eq item.currency ""))}}
@ -370,6 +381,7 @@
<table>
<thead>
<tr>
<th class="title"><img src="/icons/svg/eye.svg" class="table-icon"></th>
<th class="title">{{localize "TYPES.Item.defensiveWeapon"}}</th>
<th class="title center">{{localize "midgard5.item-value"}}</th>
<th class="title center">{{localize "midgard5.item-weight"}}</th>
@ -381,6 +393,7 @@
{{#each data.calc.gear.defensiveWeapons as |item itemId|}}
{{#if (or ../data.info.showAllItems (eq item.containerId ""))}}
<tr data-item-id="{{itemId}}" class="item">
<td class="flexpart-img"><img src={{item.icon}} class="flexpart-icon"></td>
<td class="padding edit-item">{{item.label}}</td>
<td style="text-align: start">
{{#unless (or (eq item.value 0) (eq item.currency ""))}}
@ -414,6 +427,7 @@
<table>
<thead>
<tr>
<th class="title"><img src="/icons/svg/eye.svg" class="table-icon"></th>
<th class="title">{{localize "TYPES.Item.armor"}}</th>
<th class="title center">{{localize "midgard5.item-value"}}</th>
<th class="title center">{{localize "midgard5.item-weight"}}</th>
@ -425,6 +439,7 @@
{{#each data.calc.gear.armor as |item itemId|}}
{{#if (or ../data.info.showAllItems (eq item.containerId ""))}}
<tr data-item-id="{{itemId}}" class="item">
<td class="flexpart-img"><img src={{item.icon}} class="flexpart-icon"></td>
<td class="padding edit-item">{{item.label}}</td>
<td style="text-align: start">
{{#unless (or (eq item.value 0) (eq item.currency ""))}}

View File

@ -6,6 +6,7 @@
<table>
<thead>
<tr>
<th class="title"><img src="/icons/svg/eye.svg" class="table-icon"></th>
<th class="title">{{localize "midgard5.innate-ability"}}</th>
<th class="title">{{localize "midgard5.fw"}}</th>
<th class="title">{{localize "midgard5.bonus"}}</th>
@ -17,6 +18,7 @@
<tbody class="items-list">
{{#each data.calc.skills.innate as |skill skillId|}}
<tr data-item-id="{{skillId}}" class="item">
<td class="flexpart-img"><img src={{skill.icon}} class="flexpart-icon"></td>
<td class="padding edit-item">{{skill.label}}</td>
<td class="fixed-value">{{skill.fw}}</td>
<td class="fixed-value">{{skill.calc.bonus}}</td>
@ -26,14 +28,7 @@
</tr>
{{/each}}
<tr data-item-id="{{itemId}}">
<td class="padding edit-item">{{localize "midgard5.perception"}}</td>
<td class="fixed-value">{{data.calc.stats.perceptionFW}}</td>
<td class="fixed-value">{{data.calc.stats.perception.value}}</td>
<td class="fixed-value">{{add data.calc.stats.perception.value data.calc.stats.perceptionFW}}</td>
<td><button class="roll-button roll-perception-button"></button></td>
<td class="fixed-value"></td>
</tr>
<tr data-item-id="{{itemId}}">
<td class="flexpart-img"><img src="icons/skills/toxins/cup-goblet-poisoned-spilled.webp" class="flexpart-icon"></td>
<td class="padding edit-item">{{localize "midgard5.drinking"}}</td>
<td class="fixed-value">{{data.calc.stats.drinkingFW}}</td>
<td class="fixed-value">{{data.calc.stats.drinking.value}}</td>
@ -41,6 +36,15 @@
<td><button class="roll-button roll-drinking-button"></button></td>
<td class="fixed-value"></td>
</tr>
<tr data-item-id="{{itemId}}">
<td class="flexpart-img"><img src="icons/magic/perception/eye-ringed-green.webp" class="flexpart-icon"></td>
<td class="padding edit-item">{{localize "midgard5.perception"}}</td>
<td class="fixed-value">{{data.calc.stats.perceptionFW}}</td>
<td class="fixed-value">{{data.calc.stats.perception.value}}</td>
<td class="fixed-value">{{add data.calc.stats.perception.value data.calc.stats.perceptionFW}}</td>
<td><button class="roll-button roll-perception-button"></button></td>
<td class="fixed-value"></td>
</tr>
</tbody>
</table>
</div>
@ -84,6 +88,7 @@
<table>
<thead>
<tr>
<th class="title"><img src="/icons/svg/eye.svg" class="table-icon"></th>
<th class="title">{{localize "midgard5.weapon-skill"}}</th>
<th class="title">{{localize "midgard5.fw"}}</th>
<th class="title">{{localize "midgard5.bonus"}}</th>
@ -96,8 +101,13 @@
<tbody class="items-list">
{{#each data.calc.skills.combat as |skill skillId|}}
<tr data-item-id="{{skillId}}" class="item">
<td class="flexpart-img"><img src={{skill.icon}} class="flexpart-icon"></td>
<td class="padding edit-item">{{skill.label}}</td>
<td class="fixed-value">{{skill.fw}}</td>
<td>
<i class="fa fa-minus-circle fw-decrease" style="cursor: pointer"></i>
<span>{{skill.fw}}</span>
<i class="fa fa-plus-circle fw-increase" style="cursor: pointer"></i>
</td>
<td class="fixed-value">{{skill.calc.bonus}}</td>
<td class="fixed-value">{{skill.calc.ew}}</td>
<td class="fixed-value">{{skill.pp}}</td>
@ -110,10 +120,11 @@
</div>
<div class="flexpart">
<div class="flexpart-header"><img src="icons/sundries/scrolls/scroll-runed-worn-tan.webp" class="flexpart-icon">{{localize "midgard5.languages"}}</div>
<div class="flexpart-header"><img src="icons/sundries/scrolls/scroll-runed-worn-tan.webp" class="flexpart-icon">{{localize "midgard5.languages"}} & {{localize "midgard5.writings"}}</div>
<table>
<thead>
<tr>
<th class="title"><img src="/icons/svg/eye.svg" class="table-icon"></th>
<th class="title">{{localize "midgard5.language"}}</th>
<th class="title">{{localize "midgard5.fw"}}</th>
<th class="title">{{localize "midgard5.bonus"}}</th>
@ -126,8 +137,13 @@
<tbody class="items-list">
{{#each data.calc.skills.language as |skill skillId|}}
<tr data-item-id="{{skillId}}" class="item">
<td class="flexpart-img"><img src={{skill.icon}} class="flexpart-icon"></td>
<td class="padding edit-item">{{skill.label}}</td>
<td class="fixed-value">{{skill.fw}}</td>
<td>
<i class="fa fa-minus-circle fw-decrease" style="cursor: pointer"></i>
<span>{{skill.fw}}</span>
<i class="fa fa-plus-circle fw-increase" style="cursor: pointer"></i>
</td>
<td class="fixed-value">{{skill.calc.bonus}}</td>
<td class="fixed-value">{{skill.calc.ew}}</td>
<td class="fixed-value">{{skill.pp}}</td>

View File

@ -30,6 +30,7 @@
<table>
<thead>
<tr>
<th class="title"><img src="/icons/svg/eye.svg" class="table-icon"></th>
<th class="title">{{localize "TYPES.Item.spell"}}</th>
<th class="title">{{localize "midgard5.spell-type"}}</th>
<th class="title">{{localize "midgard5.spell-castDuration-short"}}</th>
@ -40,13 +41,14 @@
<th class="title">{{localize "midgard5.spell-effectDuration-short"}}</th>
<th class="title">{{localize "midgard5.ew"}}</th>
<th class="title"><img src="/systems/midgard5/assets/icons/icon/battle-gear.svg" class="table-icon"></th>
<th class="title"><img src="/icons/svg/d20.svg" class="table-icon"></th></th>
<th class="title"><img src="/icons/svg/d20.svg" class="table-icon"><img src="/icons/svg/d20.svg" class="table-icon"></th></th>
<td><a class="title add-spell"><i class="fa-regular fa-plus"></i></a></th>
</tr>
</thead>
<tbody class="items-list">
{{#each data.calc.spells as |item itemId|}}
<tr data-item-id="{{itemId}}" class="item">
<td class="flexpart-img"><img src={{item.icon}} class="flexpart-icon"></td>
<td class="padding edit-item">
<span>{{item.label}}</span>
<span class="spell-process">{{localize item.process}}</span>
@ -70,8 +72,8 @@
<td class="fixed-value"><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
</tr>
{{/each}}
</tbody>
</table>
</tbody> </table>
</div>
</div>
</div>