Zaubertab ergänzen #79 + Kampftab ergänzen #78 #87

Merged
oskaloq merged 1 commits from Anpassungen-Zauber-und-Kampftabs into develop 2024-03-13 22:22:56 +01:00
8 changed files with 163 additions and 27 deletions

View File

@ -17,7 +17,8 @@
"midgard5.phase-movement": "Bewegungsphase", "midgard5.phase-movement": "Bewegungsphase",
"midgard5.no-encounter": "Kein Kampf", "midgard5.no-encounter": "Kein Kampf",
"midgard5.encounter-not-started": "Kein aktiver Kampf", "midgard5.encounter-not-started": "Kein aktiver Kampf",
"midgard5.initiative": "Handlungsrang", "midgard5.initiative": "Initiative",
"midgard5.actionrank": "Handlungsrang",
"midgard5.combat-join": "Kampf Beitreten/Handlungsrang zurücksetzen", "midgard5.combat-join": "Kampf Beitreten/Handlungsrang zurücksetzen",
"midgard5.combat-ranged": "Fernangriff", "midgard5.combat-ranged": "Fernangriff",
@ -311,10 +312,15 @@
"midgard5.spell-type": "Art", "midgard5.spell-type": "Art",
"midgard5.spell-process": "Prozess", "midgard5.spell-process": "Prozess",
"midgard5.spell-castDuration": "Zauberdauer", "midgard5.spell-castDuration": "Zauberdauer",
"midgard5.spell-castDuration-short": "Zd",
"midgard5.spell-range": "Reichweite", "midgard5.spell-range": "Reichweite",
"midgard5.spell-range-short": "Rw",
"midgard5.spell-effectTarget": "Wirkunsziel", "midgard5.spell-effectTarget": "Wirkunsziel",
"midgard5.spell-effectTarget-short": "Wz",
"midgard5.spell-effectArea": "Wirkungsbereich", "midgard5.spell-effectArea": "Wirkungsbereich",
"midgard5.spell-effectArea-short": "Wb",
"midgard5.spell-effectDuration": "Wirkungsdauer", "midgard5.spell-effectDuration": "Wirkungsdauer",
"midgard5.spell-effectDuration-short": "Wd",
"midgard5.spell-origin": "Ursprung", "midgard5.spell-origin": "Ursprung",
"midgard5.spell-agens": "Agens", "midgard5.spell-agens": "Agens",
"midgard5.spell-reagens": "Reagens", "midgard5.spell-reagens": "Reagens",

View File

@ -81,6 +81,15 @@ Hooks.once("init", async () => {
return false; return false;
}); });
Handlebars.registerHelper("skillEwInList", (skillName: string, list: any) => {
for (let key in list) {
if (list[key]?.label?.toLowerCase() === skillName?.toLowerCase()) {
return list[key].calc.ew;
}
}
return false;
});
Handlebars.registerHelper("stripHtml", function (param) { Handlebars.registerHelper("stripHtml", function (param) {
var regex = /(<([^>]+)>)/gi; var regex = /(<([^>]+)>)/gi;
return param.replace(regex, ""); return param.replace(regex, "");

View File

@ -572,6 +572,14 @@ export class M5Character extends Actor {
label: item.name, label: item.name,
process: "midgard5.spell-process-" + item.system.process, process: "midgard5.spell-process-" + item.system.process,
calc: item.system.calc, calc: item.system.calc,
type: item.system.type,
castDuration: item.system.castDuration || 0,
ap: item.system.ap || 0,
range: item.system.range|| 0,
effectTarget: item.system.effectTarget,
effectArea: item.system.effectArea,
effectDuration: item.system.effectDuration || 0,
equipped: item.system?.equipped || false,
}; };
}); });
} }

View File

@ -264,7 +264,8 @@
"umgebung": "midgard5.spell-target-umgebung", "umgebung": "midgard5.spell-target-umgebung",
"geist": "midgard5.spell-target-geist", "geist": "midgard5.spell-target-geist",
"koerper": "midgard5.spell-target-koerper" "koerper": "midgard5.spell-target-koerper"
} },
"spellSpecialization": "none"
}, },
"kampfkunstSelection": { "kampfkunstSelection": {
"kampfkunstTypeSelection": { "kampfkunstTypeSelection": {

View File

@ -8,9 +8,22 @@
<tr> <tr>
<td>{{localize "midgard5.movementRange"}}</td> <td>{{localize "midgard5.movementRange"}}</td>
<td class="fixed-value">{{data.calc.stats.movement.value}}</td> <td class="fixed-value">{{data.calc.stats.movement.value}}</td>
<td></td>
<td class="fixed-value"></td>
</tr>
<tr>
<td>{{localize "midgard5.initiative"}}</td> <td>{{localize "midgard5.initiative"}}</td>
<td class="fixed-value">
{{#if (isSkillInList (localizeMidgard "anfuehren") data.calc.skills.general)}}
{{skillEwInList (localizeMidgard "anfuehren") data.calc.skills.general}}
{{else}}
{{skillEw actor._id data.skills.general.anfuehren}}
{{/if}}
</td>
<td>{{localize "midgard5.actionrank"}}</td>
<td class="fixed-value"><a class="join-combat">{{data.calc.attributes.gw.value}}</a></td> <td class="fixed-value"><a class="join-combat">{{data.calc.attributes.gw.value}}</a></td>
</tr> </tr>
<tr>
<td>{{localize "midgard5.defense"}}</td> <td>{{localize "midgard5.defense"}}</td>
<td class="fixed-value">{{data.calc.stats.defense.value}}</td> <td class="fixed-value">{{data.calc.stats.defense.value}}</td>
<td>{{localize "midgard5.defenseBonus"}}</td> <td>{{localize "midgard5.defenseBonus"}}</td>
@ -28,7 +41,7 @@
<div class="flexcolumn-2"> <div class="flexcolumn-2">
<div class="flexpart" style="padding: 0 0.5rem;"> <div class="flexpart" style="padding: 0 0.5rem;">
<div class="flexpart-header">{{localize "midgard5.initiative"}}</div> <div class="flexpart-header">{{localize "midgard5.actionrank"}}</div>
<button class="wide-button join-combat">{{localize "midgard5.combat-join"}}</button> <button class="wide-button join-combat">{{localize "midgard5.combat-join"}}</button>
<button class="wide-button ranged-combat">{{localize "midgard5.combat-ranged"}}</button> <button class="wide-button ranged-combat">{{localize "midgard5.combat-ranged"}}</button>
<button class="wide-button spell-combat">{{localize "midgard5.combat-spell"}}</button> <button class="wide-button spell-combat">{{localize "midgard5.combat-spell"}}</button>
@ -196,4 +209,44 @@
</table> </table>
</div> </div>
</div> </div>
{{#if actor.system.info.magicUsing }}
<div class="flexcolumn-2">
<div class="flexpart">
<div class="flexpart-header"><img src="icons/magic/symbols/star-inverted-yellow.webp" class="flexpart-icon">{{localize "TYPES.Item.spell"}}</div>
<table>
<thead>
<tr>
<th class="title">{{localize "TYPES.Item.spell"}}</th>
<th class="title">{{localize "midgard5.spell-castDuration"}}</th>
<th class="title">{{localize "midgard5.actor-ap"}}</th>
<th class="title">{{localize "midgard5.ew"}}</th>
<th class="title center"><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>
</tr>
</thead>
<tbody class="items-list">
{{#each data.calc.spells as |item itemId|}}
{{#if item.equipped}}
<tr data-item-id="{{itemId}}" class="item">
<td class="padding edit-item {{#if item.special}}highlight{{/if}}">{{item.label}}{{#if item.special}}(*){{/if}}</td>
<td class="fixed-value">{{item.castDuration}}</td>
<td class="fixed-value">{{item.ap}}</td>
<td class="fixed-value">{{item.calc.ew}}</td>
<td class="change-equipped">
{{#if item.equipped}}
<i class="fa-solid fa-circle-check"></i>
{{else}}
<i class="fa-regular fa-circle"></i>
{{/if}}
</td>
<td><button class="roll-button roll-weapon-button"></button></td>
</tr>
{{/if}}
{{/each}}
</tbody>
</table>
</div>
</div>
{{/if}}
</div> </div>

View File

@ -59,6 +59,7 @@
</div> </div>
</div> </div>
{{#unless (eq (count data.calc.gear.containers) 0)}}
<h3>{{localize "midgard5.itemsInContainers"}}</h3> <h3>{{localize "midgard5.itemsInContainers"}}</h3>
<div class="flexbox"> <div class="flexbox">
{{#each data.calc.gear.containers as |container containerId|}} {{#each data.calc.gear.containers as |container containerId|}}
@ -205,6 +206,9 @@
</div> </div>
{{/each}} {{/each}}
</div> </div>
{{/unless}}
<h3> <h3>
{{localize "midgard5.allItems"}} {{localize "midgard5.allItems"}}

View File

@ -67,7 +67,7 @@
<i class="fa fa-minus-circle fw-decrease" style="cursor: pointer"></i> <i class="fa fa-minus-circle fw-decrease" style="cursor: pointer"></i>
<span>{{skill.fw}}</span> <span>{{skill.fw}}</span>
<i class="fa fa-plus-circle fw-increase" style="cursor: pointer"></i> <i class="fa fa-plus-circle fw-increase" style="cursor: pointer"></i>
{{!-- {{</td><td class="fixed-value">{{skill.fw}}</td>}} --}} </td>
<td class="fixed-value">{{skill.calc.bonus}}</td> <td class="fixed-value">{{skill.calc.bonus}}</td>
<td class="fixed-value">{{skill.calc.ew}}</td> <td class="fixed-value">{{skill.calc.ew}}</td>
<td class="fixed-value">{{skill.pp}}</td> <td class="fixed-value">{{skill.pp}}</td>

View File

@ -1,23 +1,78 @@
<table> <div class="flexbox">
<thead>
<tr> <div class="flexcolumn-1">
<th class="title">{{localize "TYPES.Item.spell"}}</th> <div class="flexpart">
<th class="title">{{localize "midgard5.ew"}}</th> <div class="flexpart-header"><img src="icons/magic/symbols/star-inverted-yellow.webp" class="flexpart-icon">{{localize "midgard5.spellCasting"}}</div>
<th class="title"></th> <table>
<td><a class="title add-spell"><i class="fa-regular fa-plus"></i></a></th> <tr height = 10px></tr>
</tr> <tr>
</thead> <td bgcolor="#eaead7" class="padding edit-item highlight" >{{localize "midgard5.spellCasting"}}</td>
<tbody class="items-list"> <td bgcolor="#eaead7" class="center">{{data.calc.stats.spellCasting.value}}</td>
{{#each data.calc.spells as |item itemId|}} <td bgcolor="#eaead7" class="fixed-value" style="border-right: 1px solid black;"><button class="roll-button roll-weapon-button" /></td>
<tr data-item-id="{{itemId}}" class="item"> <td class="padding edit-item highlight">{{localize "midgard5.defense"}}</td>
<td class="padding edit-item"> <td class="center">{{add data.calc.stats.defense.value data.calc.stats.defenseBonus.value}}</td>
<span>{{item.label}}</span> <td class="fixed-value" style="border-right: 1px solid black;"><button class="roll-button roll-defense-button"></button></td>
<span class="spell-process">{{localize item.process}}</span> <td bgcolor="#eaead7" class="padding edit-item highlight">{{localize "midgard5.resistanceMind"}}</td>
</td> <td bgcolor="#eaead7" class="center">{{data.calc.stats.resistanceMind.value}}</td>
<td class="fixed-value">{{item.calc.ew}}</td> <td bgcolor="#eaead7" class="fixed-value" style="border-right: 1px solid black;"><button class="roll-button roll-resistanceMind-button"></button></td>
<td class="fixed-value"><button class="roll-button roll-weapon-button" /></td> <td class="padding edit-item highlight">{{localize "midgard5.resistanceBody"}}</td>
<td class="fixed-value"><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td> <td class="center">{{data.calc.stats.resistanceBody.value}}</td>
</tr> <td class="fixed-value"><button class="roll-button roll-resistanceBody-button"></button></td>
{{/each}} </tr>
</tbody> </table>
</table> </div>
</div>
<div class="flexcolumn-1">
<div class="flexpart">
<div class="flexpart-header"><img src="icons/sundries/books/book-turquoise-moon.webp" class="flexpart-icon">{{localize "TYPES.Item.spell"}}</div>
<table>
<thead>
<tr>
<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>
<th class="title">{{localize "midgard5.actor-ap-short"}}</th>
<th class="title">{{localize "midgard5.spell-range-short"}}</th>
<th class="title">{{localize "midgard5.spell-effectTarget"}}</th>
<th class="title">{{localize "midgard5.spell-effectArea-short"}}</th>
<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>
<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="padding edit-item">
<span>{{item.label}}</span>
<span class="spell-process">{{localize item.process}}</span>
</td>
<td class="fixed-value">{{localize (m5concat 'midgard5.spell-type-' item.type)}}</td>
<td class="fixed-value">{{item.castDuration}}</td>
<td class="fixed-value">{{item.ap}}</td>
<td class="fixed-value">{{item.range}}</td>
<td class="fixed-value">{{localize (m5concat 'midgard5.spell-target-' item.effectTarget)}}</td>
<td class="fixed-value">{{item.effectArea}}</td>
<td class="fixed-value">{{item.effectDuration}}</td>
<td class="fixed-value">{{item.calc.ew}}</td>
<td class="change-equipped">
{{#if item.equipped}}
<i class="fa-solid fa-circle-check"></i>
{{else}}
<i class="fa-regular fa-circle"></i>
{{/if}}
</td>
<td class="fixed-value"><button class="roll-button roll-weapon-button" /></td>
<td class="fixed-value"><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
</tr>
{{/each}}
</tbody>
</table>
</div>
</div>
</div>
</div>