Vereinfachter-NPC/Kreaturen-Bogen (#107)

Ich habe mal den ersten Entwurf eines NPC Bogens fertiggestellt. Ist jetzt ein eigener Actor Type geworden und nicht nur ein alternativer Char Bogen:
Einfach beim Erstellen eines neuen Actors NPC wählen.

Co-authored-by: Ender <harald@drueppels.de>
Co-authored-by: LeFrique <lefrique@live.de>
Co-authored-by: Byroks <byroks@gmail.com>
Reviewed-on: #107
Reviewed-by: Le-Frique <lefrique@live.de>
This commit is contained in:
oskaloq 2024-05-14 11:38:20 +02:00
parent 37d6ba12e7
commit 3ecd2c6c1e
17 changed files with 636 additions and 54 deletions

View File

@ -283,6 +283,7 @@
"rangedWeapon": "Schusswaffe",
"assignItemToCharacter": "Füge Gegenstand einem Charakter hinzu, um hier etwas auswählen zu können",
"showAll": "Alle anzeigen",
"showUnlearned": "Ungelernte Fertigkeiten",
"wealthAndWeight": "Vermögen und Lasten",
"itemsInContainers": "Gegenstände in Aufbewahrung",
"allItems": "Alle Gegenstände",

View File

@ -15,6 +15,11 @@ const preloadTemplates = async (): Promise<Handlebars.TemplateDelegate<any>[]> =
"sheets/character/spells.hbs",
"sheets/character/combat.hbs",
"sheets/character/effects.hbs",
"sheets/npc/main.hbs",
"sheets/npc/combat.hbs",
"sheets/npc/properties.hbs",
"sheets/npc/description.hbs",
"sheets/npc/attribute.hbs",
"sheets/partial/mod.hbs",
"sheets/item/rolls.hbs",
"chat/roll-m5.hbs",

View File

@ -162,6 +162,7 @@ export interface M5AttributeCalculated extends M5ModResult {
export interface M5CharacterCalculatedData {
level: number;
movement: number;
attributes: {
st: M5AttributeCalculated;
gs: M5AttributeCalculated;

View File

@ -314,7 +314,7 @@ export class M5Item extends Item {
return ret;
}
async roll() {
async roll(toggleAutomatedRoll = false) {
const item = this as any;
// Initialize chat data.
@ -341,6 +341,8 @@ export class M5Item extends Item {
}
});
const roll = new M5Roll(rollData, this.actor, item.name, item.id);
if (await roll.toMessage(toggleAutomatedRoll)) {
if (item.type === "spell" || item.type === "kampfkunst") {
if (this.actor["system"].ap.value >= item.system.ap) {
this.actor["update"]({
@ -352,9 +354,7 @@ export class M5Item extends Item {
});
}
}
const roll = new M5Roll(rollData, this.actor, item.name, item.id);
return roll.toMessage();
}
} else {
ChatMessage.create({
speaker: speaker,

View File

@ -142,18 +142,26 @@ export class M5Roll {
return renderTemplate(M5Roll.TEMPLATE_PATH, this.data);
}
async toMessage() {
async toMessage(toggleAutomatedRoll = false) {
let automatedRoll = (game as Game).settings.get("midgard5", "automatedRoll");
automatedRoll = toggleAutomatedRoll ? !automatedRoll : automatedRoll;
const rMode = (game as Game).settings.get("core", "rollMode");
if (!automatedRoll) {
let checkOptions = await this.popUp({ isPW: this.data.rolls[0].label === (game as Game).i18n.localize("midgard5.pw") });
if (checkOptions["cancelled"]) {
return;
} else {
const rMode = checkOptions["rollMode"];
this.data.b = checkOptions;
}
} else {
this.data.b = { difficulty: 20, modifier: 0 };
}
if (!this._evaluated) await this.evaluate();
const faces = this.pool.dice.map((x) => x.faces);
const rMode = checkOptions["rollMode"] || (game as Game).settings.get("core", "rollMode");
const chatData = {
type: CONST.CHAT_MESSAGE_TYPES.ROLL,
content: await this.render(),

View File

@ -7,7 +7,6 @@ import { M5Roll } from "../rolls/M5Roll";
export default class M5CharacterSheet extends ActorSheet {
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
template: "systems/midgard5/templates/sheets/character/main.hbs",
width: 1000,
height: 800,
classes: ["midgard5", "sheet", "character"],
@ -21,7 +20,15 @@ export default class M5CharacterSheet extends ActorSheet {
});
}
// get template() {
get template() {
//console.log("M5CharacterSheet", this.actor.data.type)
if (this.actor.type === "npc") {
return "systems/midgard5/templates/sheets/npc/main.hbs";
}
else {
return "systems/midgard5/templates/sheets/character/main.hbs";
}
}
// return "systems/midgard5/templates/character_sheet/main.hbs"
// }Options extends ActorSheet.Options = ActorSheet.Options, Data extends object = ActorSheet.Data<Options>
@ -78,7 +85,8 @@ export default class M5CharacterSheet extends ActorSheet {
let attributeValue = target ? parseInt(target.dataset.value) : null;
let attributeStr = target ? target.dataset.attribute : null;
const roll = M5Roll.fromAttributeValue(this.actor, attributeStr, attributeValue);
await roll.toMessage();
let toggleAutomatedRoll = (event.shiftKey)
await roll.toMessage(toggleAutomatedRoll);
});
html.find(".edit-item").on("click", async (event) => {
@ -138,7 +146,8 @@ export default class M5CharacterSheet extends ActorSheet {
});
}
await item.roll();
let toggleAutomatedRoll = (event.shiftKey)
await item.roll(toggleAutomatedRoll);
this.render();
});
@ -158,7 +167,8 @@ export default class M5CharacterSheet extends ActorSheet {
const actor = this.actor as any;
const item = actor.items.get(skillId) as M5Item;
await item.roll();
let toggleAutomatedRoll = (event.shiftKey)
await item.roll(toggleAutomatedRoll);
});
html.find(".roll-general-button").on("click", async (event) => {
@ -169,7 +179,8 @@ export default class M5CharacterSheet extends ActorSheet {
const unlearnedSkill = data.skills.general[skillName] as M5SkillUnlearned;
const roll = M5Roll.fromUnlearnedSkill(this.actor, unlearnedSkill, skillName);
await roll.toMessage();
let toggleAutomatedRoll = (event.shiftKey)
await roll.toMessage(toggleAutomatedRoll);
});
html.find(".learn-button").on("click", async (event) => {
@ -267,48 +278,57 @@ export default class M5CharacterSheet extends ActorSheet {
const context = this.actor as any;
const item = context.items.get(itemId) as M5Item;
await item.roll();
let toggleAutomatedRoll = (event.shiftKey)
await item.roll(toggleAutomatedRoll);
this.render();
});
html.find(".roll-brawl-button").on("click", async (event) => {
const roll = M5Roll.brawl(this.actor);
await roll.toMessage();
let toggleAutomatedRoll = (event.shiftKey)
await roll.toMessage(toggleAutomatedRoll);
});
html.find(".roll-cleanSpell-button").on("click", async (event) => {
const roll = M5Roll.cleanSpell(this.actor);
await roll.toMessage();
let toggleAutomatedRoll = (event.shiftKey)
await roll.toMessage(toggleAutomatedRoll);
});
html.find(".roll-deprivationCold-button").on("click", async (event) => {
const roll = M5Roll.deprivationCold(this.actor);
await roll.toMessage();
let toggleAutomatedRoll = (event.shiftKey)
await roll.toMessage(toggleAutomatedRoll);
});
html.find(".roll-deprivationHeat-button").on("click", async (event) => {
const roll = M5Roll.deprivationHeat(this.actor);
await roll.toMessage();
let toggleAutomatedRoll = (event.shiftKey)
await roll.toMessage(toggleAutomatedRoll);
});
html.find(".roll-deprivationFood-button").on("click", async (event) => {
const roll = M5Roll.deprivationFood(this.actor);
await roll.toMessage();
let toggleAutomatedRoll = (event.shiftKey)
await roll.toMessage(toggleAutomatedRoll);
});
html.find(".roll-defense-button").on("click", async (event) => {
const roll = M5Roll.defense(this.actor);
await roll.toMessage();
let toggleAutomatedRoll = (event.shiftKey)
await roll.toMessage(toggleAutomatedRoll);
});
html.find(".roll-resistanceMind-button").on("click", async (event) => {
const roll = M5Roll.resistanceMind(this.actor);
await roll.toMessage();
let toggleAutomatedRoll = (event.shiftKey)
await roll.toMessage(toggleAutomatedRoll);
});
html.find(".roll-resistanceBody-button").on("click", async (event) => {
const roll = M5Roll.resistanceBody(this.actor);
await roll.toMessage();
let toggleAutomatedRoll = (event.shiftKey)
await roll.toMessage(toggleAutomatedRoll);
});
html.find(".change-equipped").on("click", async (event) => {

View File

@ -13,4 +13,13 @@ export const loadSettings = async function () {
default: true,
type: Boolean,
});
(game as Game).settings.register("midgard5", "automatedRoll", {
name: "Automatische Würfelwürfe",
hint: "Falls aktiv, wird bei Würfelwürfen kein Dialog gezeigt. Das Verhalten kann mit gleichzeitig gedrückter Shift Taste umgekehrt werden.",
scope: "world",
config: true,
default: false,
type: Boolean,
});
};

View File

@ -0,0 +1,23 @@
// main: midgard5.less
@borderGroove: 2px groove #eeede0;
@attributeBorderColor: rgba(0, 0, 0, 0.5);
.midgard5 {
.sheet-npc {
.attribute-header {
align-items: center;
text-align: center;
font-weight: bold;
border: 0px solid transparent;
}
.attribute-value {
align-items: center;
text-align: center;
border: 0px solid transparent;
}
.fixed-value {
width: 3rem;
text-align: center;
}
}
}

View File

@ -1,15 +1,18 @@
{
"Actor": {
"types": ["character"],
"types": [
"character",
"npc"
],
"templates": {
"characterDescription": {
"info": {
"description": "",
"background": "",
"class": {},
"npc-class": "",
"race": "",
"magicUsing": false,
"showAllItems": false,
"gender": "",
"weight": "",
"height": "",
@ -19,9 +22,12 @@
"occupation": "",
"origin": "",
"faith": "",
"level": 1,
"gold": 0,
"silver": 0,
"copper": 0
"copper": 0,
"showAllItems": false,
"showUnlearned": false
}
},
"characterBars": {
@ -44,6 +50,8 @@
"gp": 0
},
"attributes": {
"level": 1,
"movement": 24,
"attributes": {
"st": { "value": 50, "bonus": 0 },
"gs": { "value": 50, "bonus": 0 },
@ -53,7 +61,8 @@
"zt": { "value": 50, "bonus": 0 },
"au": { "value": 50, "bonus": 0 },
"pa": { "value": 50, "bonus": 0 },
"wk": { "value": 50, "bonus": 0 }
"wk": { "value": 50, "bonus": 0 },
"git": { "value": 50, "bonus": 0 }
}
},
"skills": {
@ -156,6 +165,10 @@
"character": {
"templates": ["characterBars", "attributes", "characterDescription", "characterHeader", "skills", "gear"],
"calc": {}
},
"npc": {
"templates": ["characterBars", "attributes", "characterDescription", "skills", "gear"],
"calc": {}
}
},
"Item": {
@ -376,6 +389,7 @@
"hoarded": false,
"skillId": "",
"damageBase": "1d6",
"ew": 5,
"rolls": {
"formulas": {
"0": {

View File

@ -234,7 +234,7 @@
<th class="title center">{{localize "midgard5.capacity"}}</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>
<td><a class="title add-container"><i class="fa-regular fa-plus"></i></a></th>
<th><a class="title add-container"><i class="fa-regular fa-plus"></i></a></th>
</tr>
</thead>
<tbody class="items-list">
@ -289,7 +289,7 @@
<th class="title center">{{localize "midgard5.item-weight"}}</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-item"><i class="fa-regular fa-plus"></i></a></th>
<th><a class="title add-item"><i class="fa-regular fa-plus"></i></a></th>
</tr>
</thead>
<tbody class="items-list">
@ -345,7 +345,7 @@
<th class="title center">{{localize "midgard5.item-value"}}</th>
<th class="title center">{{localize "midgard5.item-weight"}}</th>
<th class="title"><img src="/systems/midgard5/assets/icons/icon/battle-gear.svg" class="table-icon"></th>
<td><a class="title add-weapon"><i class="fa-regular fa-plus"></i></a></th>
<th><a class="title add-weapon"><i class="fa-regular fa-plus"></i></a></th>
</tr>
</thead>
@ -392,7 +392,7 @@
<th class="title center">{{localize "midgard5.item-value"}}</th>
<th class="title center">{{localize "midgard5.item-weight"}}</th>
<th class="title"><img src="/systems/midgard5/assets/icons/icon/battle-gear.svg" class="table-icon"></th>
<td><a class="title add-defensiveWeapon"><i class="fa-regular fa-plus"></i></a></th>
<th><a class="title add-defensiveWeapon"><i class="fa-regular fa-plus"></i></a></th>
</tr>
</thead>
<tbody class="items-list">
@ -438,7 +438,7 @@
<th class="title center">{{localize "midgard5.item-value"}}</th>
<th class="title center">{{localize "midgard5.item-weight"}}</th>
<th class="title"><img src="/systems/midgard5/assets/icons/icon/battle-gear.svg" class="table-icon"></th>
<td><a class="title add-armor"><i class="fa-regular fa-plus"></i></a></th>
<th><a class="title add-armor"><i class="fa-regular fa-plus"></i></a></th>
</tr>
</thead>
<tbody class="items-list">

View File

@ -49,18 +49,6 @@
</table>
<table style="width: 100%;">
<tr>
<td class="attribute">{{localize "midgard5.actor-st"}}</td>
<td class="attribute">{{localize "midgard5.actor-gs"}}</td>
<td class="attribute">{{localize "midgard5.actor-gw"}}</td>
<td class="attribute">{{localize "midgard5.actor-ko"}}</td>
<td class="attribute">{{localize "midgard5.actor-in"}}</td>
<td class="attribute">{{localize "midgard5.actor-zt"}}</td>
<td class="attribute">{{localize "midgard5.actor-au"}}</td>
<td class="attribute">{{localize "midgard5.actor-pa"}}</td>
<td class="attribute">{{localize "midgard5.actor-wk"}}</td>
<td class="attribute">{{localize "midgard5.actor-git"}}</td>
</tr>
<tr>
<td class="attribute-value roll-attribute-button" data-attribute="st" data-value="{{data.calc.attributes.st.value}}">{{data.calc.attributes.st.value}}</td>
<td class="attribute-value roll-attribute-button" data-attribute="gs" data-value="{{data.calc.attributes.gs.value}}">{{data.calc.attributes.gs.value}}</td>
@ -73,6 +61,18 @@
<td class="attribute-value roll-attribute-button" data-attribute="wk" data-value="{{data.calc.attributes.wk.value}}">{{data.calc.attributes.wk.value}}</td>
<td class="attribute-value roll-attribute-button" data-attribute="git" data-value="{{data.calc.stats.poisonResistance.value}}">{{data.calc.stats.poisonResistance.value}}</td>
</tr>
<tr>
<td class="attribute">{{localize "midgard5.actor-st"}}</td>
<td class="attribute">{{localize "midgard5.actor-gs"}}</td>
<td class="attribute">{{localize "midgard5.actor-gw"}}</td>
<td class="attribute">{{localize "midgard5.actor-ko"}}</td>
<td class="attribute">{{localize "midgard5.actor-in"}}</td>
<td class="attribute">{{localize "midgard5.actor-zt"}}</td>
<td class="attribute">{{localize "midgard5.actor-au"}}</td>
<td class="attribute">{{localize "midgard5.actor-pa"}}</td>
<td class="attribute">{{localize "midgard5.actor-wk"}}</td>
<td class="attribute">{{localize "midgard5.actor-git"}}</td>
</tr>
</table>
</div>

View File

@ -77,6 +77,7 @@
</div>
</div>
{{#if (eq data.types.actor)}}
<div class="flexcolumn-1">
<div class="flexpart">
<div class="flexpart-header">{{localize "midgard5.pp"}} {{localize "midgard5.spells"}}</div>
@ -103,4 +104,5 @@
</table>
</div>
</div>
{{/if}}
</div>

View File

@ -0,0 +1,4 @@
<div class="sheet-npc" style="flex: 1 0 20%" data-attribute="{{attributeId}}">
<div class="attribute-header">{{localize (m5concat "midgard5.actor-" attributeId "-long")}}</div>
<div class="attribute-value"> <input class="attribute-footer-value" name="data.attributes.{{attributeId}}.value" value="{{attribute.value}}" type="text" data-dtype="Number" /></div>
</div>

View File

@ -0,0 +1,233 @@
<div class="flexbox">
<div class="flexcolumn-3">
<div class="flexpart">
<div class="flexpart-header"><img src="icons/magic/time/arrows-circling-pink.webp" class="flexpart-icon">{{localize "midgard5.calculated-values"}}</div>
<table>
<tr height = 10px></tr>
<tr>
<td>{{localize "midgard5.movementRange"}}</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 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>
</tr>
</table>
</div>
</div>
<div class="flexcolumn-3">
<div class="flexpart" style="padding: 0 0.5rem;">
<div class="flexpart-header">{{localize "midgard5.actionrank"}}</div>
<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 spell-combat">{{localize "midgard5.combat-spell"}}</button>
</div>
</div>
<div class="flexcolumn-3">
<div class="flexpart">
<div class="flexpart-header"><img src="icons/magic/life/cross-worn-green.webp" class="flexpart-icon">{{localize "TYPES.Item.effect"}}</div>
<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>
</tr>
</thead>
<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}}
<span class="spell-process">{{localize "midgard5.active"}}</span>
{{#unless (or (eq item.duration.unit "") (eq item.duration.unit "limitless"))}}
<span class="spell-process">{{item.duration.time}} {{localize (concat "midgard5.time-" item.duration.unit)}}</span>
{{/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>
</table>
</div>
</div>
<div class="flexcolumn-3">
<div class="flexpart">
<div class="flexpart-header"><img src="icons/skills/melee/hand-grip-sword-white-brown.webp" class="flexpart-icon">{{localize "midgard5.attack"}}</div>
<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>
<th class="title"><img src="/icons/svg/d20.svg" class="table-icon"></th>
<td><a class="title add-weapon"><i class="fa-regular fa-plus"></i></a></th>
</tr>
</thead>
<tbody class="items-list">
{{#each data.calc.gear.weapons 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 {{#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>
<td><button class="roll-button roll-weapon-button"></button></td>
<td><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
</tr>
{{/each}}
</tbody>
</table>
<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.ew"}}</th>
<th class="title"><img src="/icons/svg/d20.svg" class="table-icon"></th>
<th><a class="title add-combat-skill"><i class="fa-regular fa-plus"></i></th>
</tr>
</thead>
<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.calc.ew}}</td>
<td><button class="roll-button roll-learned-button"></button></td>
<td><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
</tr>
{{/each}}
</tbody>
</table>
</div>
</div>
<div class="flexcolumn-3">
<div class="flexpart">
<div class="flexpart-header"><img src="icons/skills/melee/shield-block-gray-orange.webp" class="flexpart-icon">{{localize "midgard5.defense"}}</div>
<table>
<tr height = 10px></tr>
<tr>
<td class="padding 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="padding 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="padding 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>
</tr>
</table>
<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"><img src="/icons/svg/d20.svg" class="table-icon"></th>
<th><a class="title add-defensiveWeapon"><i class="fa-regular fa-plus"></i></a></th>
</tr>
</thead>
<tbody class="items-list">
{{#each data.calc.gear.defensiveWeapons 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 class="fixed-value">{{item.calc.ew}}</td>
<td><button class="roll-button roll-weapon-button"></button></td>
<td><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
</tr>
{{/each}}
</tbody>
</table>
<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><a class="title add-armor"><i class="fa-regular fa-plus"></i></a></th>
</tr>
</thead>
<tbody class="items-list">
{{#each data.calc.gear.armor 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 class="fixed-value">{{lpProtection}}</td>
<td><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
</tr>
{{/each}}
</tbody>
</table>
</div>
</div>
{{#if actor.system.info.magicUsing }}
<div class="flexcolumn-3">
<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>
<tr height = 10px></tr>
<tr>
<td class="padding highlight">{{localize "midgard5.spellCasting"}}</td>
<td class="center">{{data.calc.stats.spellCasting.value}}</td>
<td class="fixed-value"><button class="roll-button roll-defense-button"></button></td>
</tr>
</table>
<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.ew"}}</th>
<th class="title"><img src="/icons/svg/d20.svg" class="table-icon"></th>
<th><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 {{#if item.special}}highlight{{/if}}">{{item.label}}{{#if item.special}}(*){{/if}}</td>
<td class="fixed-value">{{item.calc.ew}}</td>
<td><button class="roll-button roll-weapon-button"></button></td>
<td><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
</tr>
{{/each}}
</tbody>
</table>
</div>
</div>
{{/if}}
</div>

View File

@ -0,0 +1,18 @@
<div class="flexbox">
<div class="flexcolumn-1">
<div class="flexpart" style="height: 250px;">
<div class="flexpart-header"><img src="icons/environment/wilderness/mine-interior-dungeon-door.webp" class="flexpart-icon" />{{localize "midgard5.description"}}</div>
<br />
<div class="biography">{{editor data.info.description target="data.info.description" button=true owner=owner editable=editable}}</div>
</div>
</div>
<div class="flexcolumn-1">
<div class="flexpart" style="height: 250px;">
<div class="flexpart-header"><img src="icons/environment/people/group.webp" class="flexpart-icon" />{{localize "midgard5.background"}}</div>
<br />
<div class="biography">{{editor data.info.background target="data.info.background" button=true owner=owner editable=editable}}</div>
</div>
</div>
</div>

View File

@ -0,0 +1,127 @@
<form class="actor-sheet {{cssClass}}" autocomplete="off">
<header class="flexbox" style="background-color: beige; padding: 5px; border: 2px solid black;">
<!-- Logo -->
<div class="flexcolumn-5" style="height: 200px;">
<img class="profile-img" src="/systems/midgard5/assets/icons/backgrounds/bg1.webp" alt="Midgard">
</div>
<!-- Name, Class, Level, Race, Occupation -->
<div class="flexcolumn-2" style="margin:0px 5px 0px 5px;">
<table class="bordered">
<tr>
<td >{{localize "midgard5.actor-name"}}</td>
<td colspan="3"><input name="name" type="text" value="{{actor.name}}" data-dtype="String" /></td>
</tr>
<tr>
<td >{{localize "midgard5.class"}}</td>
<td ><input name="data.info.npc-class" type="text" value="{{data.info.npc-class}}" data-dtype="String" /></td>
<td >{{localize "midgard5.level"}}</td>
<td>{{data.calc.level}}</td>
</table>
<table style="font-weight: bold;">
<tr height = 10px></tr>
<tr>
<td ><input name="data.info.race" type="text" value="{{data.info.race}}" data-dtype="String" /></td>
<td ><input name="data.info.occupation" type="text" value="{{data.info.occupation}}" data-dtype="String" /></td>
</tr>
<tr>
<td style="text-align: center; font-size: small">{{localize "midgard5.race"}}</td>
<td style="text-align: center; font-size: small">{{localize "midgard5.occupation"}}</td>
</tr>
</table>
<table style="width: 100%;">
<tr>
<td class="attribute-value roll-attribute-button" data-attribute="st" data-value="{{data.attributes.st.value}}">{{data.attributes.st.value}}</td>
<td class="attribute-value roll-attribute-button" data-attribute="gs" data-value="{{data.attributes.gs.value}}">{{data.attributes.gs.value}}</td>
<td class="attribute-value roll-attribute-button" data-attribute="gw" data-value="{{data.attributes.gw.value}}">{{data.attributes.gw.value}}</td>
<td class="attribute-value roll-attribute-button" data-attribute="ko" data-value="{{data.attributes.ko.value}}">{{data.attributes.ko.value}}</td>
<td class="attribute-value roll-attribute-button" data-attribute="in" data-value="{{data.attributes.in.value}}">{{data.attributes.in.value}}</td>
<td class="attribute-value roll-attribute-button" data-attribute="zt" data-value="{{data.attributes.zt.value}}">{{data.attributes.zt.value}}</td>
<td class="attribute-value roll-attribute-button" data-attribute="au" data-value="{{data.attributes.au.value}}">{{data.attributes.au.value}}</td>
<td class="attribute-value roll-attribute-button" data-attribute="pa" data-value="{{data.attributes.pa.value}}">{{data.attributes.pa.value}}</td>
<td class="attribute-value roll-attribute-button" data-attribute="wk" data-value="{{data.attributes.wk.value}}">{{data.attributes.wk.value}}</td>
<td class="attribute-value roll-attribute-button" data-attribute="git" data-value="{{data.attributes.git.value}}">{{data.attributes.git.value}}</td>
</tr>
<tr>
<td class="attribute">{{localize "midgard5.actor-st"}}</td>
<td class="attribute">{{localize "midgard5.actor-gs"}}</td>
<td class="attribute">{{localize "midgard5.actor-gw"}}</td>
<td class="attribute">{{localize "midgard5.actor-ko"}}</td>
<td class="attribute">{{localize "midgard5.actor-in"}}</td>
<td class="attribute">{{localize "midgard5.actor-zt"}}</td>
<td class="attribute">{{localize "midgard5.actor-au"}}</td>
<td class="attribute">{{localize "midgard5.actor-pa"}}</td>
<td class="attribute">{{localize "midgard5.actor-wk"}}</td>
<td class="attribute">{{localize "midgard5.actor-git"}}</td>
</tr>
</table>
</div>
<!-- Profilbild -->
<div class="flexcolumn-5" style="height: 200px;text-align: center;" >
<img class="profile-img" src="{{actor.img}}" data-edit="img" title="{{actor.name}}" />
</div>
<!-- LP + AP -->
<div class="flexcolumn-1">
<table>
<tr>
<td><b>{{localize "midgard5.actor-lp-short"}}</b></td>
<td colspan="9">
<div class="health-bar">
<input name="data.lp.value" type="text" value="{{data.lp.value}}" data-dtype="Number" />
{{#times data.lp.max}}
{{#if (lt this ../data.lp.value)}}
<div class="lp-bar-item update-lp" data-value="{{this}}"></div>
{{else}}
<div class="lp-bar-item-empty update-lp" data-value="{{this}}"></div>
{{/if}}
{{/times}}
<div class="max-value">{{data.lp.max}}</div>
</div>
</td>
</tr>
<tr>
<td><b>{{localize "midgard5.actor-ap-short"}}</b></td>
<td colspan="9">
<div class="health-bar">
<input name="data.ap.value" type="text" value="{{data.ap.value}}" data-dtype="Number" />
{{#times data.ap.max}}
{{#if (lt this ../data.ap.value)}}
<div class="ap-bar-item update-ap" data-value="{{this}}"></div>
{{else}}
<div class="ap-bar-item-empty update-ap" data-value="{{this}}"></div>
{{/if}}
{{/times}}
<div class="max-value">{{data.ap.max}}</div>
</div>
</td>
</tr>
</table>
</div>
</header>
{{!-- Character Sheet Navigation --}}
<nav class="sheet-navigation tabs" data-group="primary">
<a class="item active" data-tab="combat">{{ localize "midgard5.combat" }}</a>
<a class="item" data-tab="properties">{{ localize "midgard5.attributes" }}</a>
<a class="item" data-tab="description">{{ localize "midgard5.description" }}</a>
</nav>
<section class="sheet-content">
<div class="tab combat flexcol" data-group="primary" data-tab="combat">
{{> "systems/midgard5/templates/sheets/npc/combat.hbs"}}
</div>
<div class="tab properties flexcol" data-group="primary" data-tab="properties">
{{> "systems/midgard5/templates/sheets/npc/properties.hbs"}}
</div>
<div class="tab description flexcol" data-group="primary" data-tab="description">
{{> "systems/midgard5/templates/sheets/npc/description.hbs"}}
</div>
</section>
</form>

View File

@ -0,0 +1,117 @@
<div class="flexbox">
<div class="flexcolumn-1">
<div class="flexpart-header"><img src="icons/skills/melee/maneuver-sword-katana-yellow.webp" class="flexpart-icon">{{localize "midgard5.attributes"}}</div>
<div class="flexpart">
<div class="attributes">
{{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="st" attribute=data.attributes.st}}
{{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="gs" attribute=data.attributes.gs}}
{{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="gw" attribute=data.attributes.gw}}
{{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="ko" attribute=data.attributes.ko}}
{{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="in" attribute=data.attributes.in}}
{{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="zt" attribute=data.attributes.zt}}
{{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="au" attribute=data.attributes.au}}
{{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="pa" attribute=data.attributes.pa}}
{{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="wk" attribute=data.attributes.wk}}
{{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="git" attribute=data.attributes.git}}
<div class="sheet-npc">
<div class="attribute-header">{{localize "midgard5.movementRange"}}</div>
<div class="attribute-value"><input name="data.movement" type="text" value="{{data.calc.stats.movement.mods.0.value}}" data-dtype="Number" /></div>
</div>
<div class="sheet-npc">
<div class="attribute-header">{{localize "midgard5.exp-overall"}}</div>
<div class="attribute-value"><input name="data.es" type="text" value="{{data.es}}" data-dtype="Number" /></div>
</div>
<div class="sheet-npc">
<div class="attribute-header">{{localize "midgard5.actor-lp-short"}} {{localize "midgard5.maximum"}}</div>
<div class="attribute-value"><input name="data.lp.max" type="text" value="{{data.lp.max}}" data-dtype="Number" /></div>
</div>
<div class="sheet-npc">
<div class="attribute-header">{{localize "midgard5.actor-ap-short"}} {{localize "midgard5.maximum"}}</div>
<div class="attribute-value"><input name="data.ap.max" type="text" value="{{data.ap.max}}" data-dtype="Number" /></div>
</div>
<div class="sheet-npc">
<div class="attribute-header">{{localize "midgard5.magicUsing"}}</div>
<div class="attribute-value"><input id="data.info.magicUsing" type="checkbox" name="data.info.magicUsing" {{checked data.info.magicUsing}}></div>
</div>
</div>
</div>
</div>
<div class="flexcolumn-2">
<div class="flexpart">
<div class="flexpart-header"><img src="icons/sundries/gaming/dice-pair-white-green.webp" class="flexpart-icon">{{localize "midgard5.skills"}}</div>
<input id="data.info.showUnlearned" class="checkbox" type="checkbox" name="data.info.showUnlearned" {{checked data.info.showUnlearned}} style="float: right;">
<label for="data.info.showUnlearned" style="font-size: small; font-weight: normal; font-style: italic; float: right;">{{localize "midgard5.showUnlearned"}}&nbsp;</label>
<table>
<thead>
<tr>
<th class="title">{{localize "midgard5.skills"}}</th>
<th class="title">{{localize "midgard5.ew"}}</th>
<th class="title"><img src="/icons/svg/d20.svg" class="table-icon"></th>
<th><a class="title add-general-skill"><i class="fa-regular fa-plus"></i></a></th>
</tr>
</thead>
<tbody>
{{#each data.calc.skills.general as |skill skillId|}}
<tr data-item-id="{{skillId}}" class="item">
<td class="padding edit-item">{{skill.label}}</td>
<td class="fixed-value"><input type="text" value="{{skill.fw}}" data-dtype="Number" /></td>
<td><button class="roll-button roll-learned-button"></button></td>
<td><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
</tr>
{{/each}}
{{#unless (not data.info.showUnlearned)}}
{{#each data.skills.general as |skill key|}}
{{#unless (isSkillInList (localizeMidgard key) ../actor.system.calc.skills.general) }}
<tr data-skill="{{key}}">
<td class="padding" style="font-style: italic;">{{localizeMidgard key}}</td>
<td class="fixed-value"><input type="text" value="{{skill.fw}}" data-dtype="Number" /></td>
<td><button class="roll-button roll-general-button"></button></td>
<td><a class="learn-button" title="Learn Skill"><i class="fa-regular fa-plus"></i></a></td>
</tr>
{{/unless}}
{{/each}}
{{/unless}}
</tbody>
</table>
</div>
</div>
<div class="flexcolumn-2">
<div class="flexpart">
<div class="flexpart-header"><img src="icons/tools/hand/scale-balances-merchant-brown.webp" class="flexpart-icon">{{localize "midgard5.gear"}}</div>
<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>
<td><a class="title add-item"><i class="fa-regular fa-plus"></i></a></th>
</tr>
</thead>
<tbody class="items-list">
<tr height = 10px></tr>
{{#each data.calc.gear.items 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>
<td>
<i class="fa fa-minus-circle quantity-decrease" style="cursor: pointer"></i>
<span>{{item.quantity}}</span>
<i class="fa fa-plus-circle quantity-increase" style="cursor: pointer"></i>
</td>
<td style="text-align: start">
{{#unless (or (eq item.value 0) (eq item.currency ""))}}
<span class="spell-process">{{item.value}} {{localize (m5concat "midgard5.currency-" item.currency)}}</span>
{{/unless}}
</td>
<td><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
</tr>
{{/each}}
</tbody>
</table>
</div>
</div>
</div>