This commit is contained in:
hjmaier 2021-02-07 20:28:31 +01:00
parent 61c5eab2da
commit 8a9627c278
13 changed files with 330 additions and 0 deletions

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# Midgard 5 für FoundryVTT
Midgard M5

17
lang/de.json Normal file
View File

@ -0,0 +1,17 @@
{
"ACTOR.TypeCharacter": "Spielfigur",
"ACTOR.TypeNpc": "Kreatur / Nichtspielerfigur",
"ACTOR.TypeVehicle": "Transportmittel / Pferd etc.",
"ITEM.TypeItem": "Gegenstand",
"midgard5.description": "Beschreibung",
"midgard5.item.value": "Wert",
"midgard5.quantity": "Menge",
"midgard5.ismagic": "Ist Magisch",
"midgard5.lp": "Lebenspunkte",
"midgard5.ap": "Ausdauerpunkte",
"midgard5.gw": "Gewandheit",
"midgard5.bonus": "Bonus",
"midgard5.aktuell": "Akt.",
"midgard5.maximum": "Max.",
"midgard5.attrvalue": "Wert"
}

16
less/Character-sheet.less Normal file
View File

@ -0,0 +1,16 @@
// main: midgard5.less
.midgard5.sheet.character {
form {
display: flex;
flex-direction: column;
}
.sheet-content {
height: 100%;
display: flex;
flex-direction: column;
.editor {
height: 100%;
}
}
}

16
less/item-sheet.less Normal file
View File

@ -0,0 +1,16 @@
// main: midgard5.less
.midgard5.sheet.item {
form {
display: flex;
flex-direction: column;
}
.sheet-content {
height: 100%;
display: flex;
flex-direction: column;
.editor {
height: 100%;
}
}
}

4
less/midgard5.less Normal file
View File

@ -0,0 +1,4 @@
//out: ../midgard5.css
@import "./item-sheet.less";
@import "./Character-sheet.less";

24
midgard5.css Normal file
View File

@ -0,0 +1,24 @@
.midgard5.sheet.item form {
display: flex;
flex-direction: column;
}
.midgard5.sheet.item .sheet-content {
height: 100%;
display: flex;
flex-direction: column;
}
.midgard5.sheet.item .sheet-content .editor {
height: 100%;
}
.midgard5.sheet.character form {
display: flex;
flex-direction: column;
}
.midgard5.sheet.character .sheet-content {
height: 100%;
display: flex;
flex-direction: column;
}
.midgard5.sheet.character .sheet-content .editor {
height: 100%;
}

12
midgard5.js Normal file
View File

@ -0,0 +1,12 @@
import m5ItemSheet from "./module/sheets/m5ItemSheet.js";
import m5CharacterSheet from "./module/sheets/m5CharacterSheet.js";
Hooks.once("init", function () {
console.log("M5 | Initialisierung Midgard 5");
Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("midgard5", m5ItemSheet, { makeDefault: true });
Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("midgard5", m5CharacterSheet, { makeDefault: true });
});

View File

@ -0,0 +1,15 @@
export default class m5CharacterSheet extends ActorSheet {
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
template: "systems/midgard5/templates/sheets/m5Character-Sheet.hbs",
width: 530,
height: 400,
classes: ["midgard5", "sheet", "character"]
});
}
// get template() {
// return 'systems/midgard5/templates/sheets/m5Character-Sheet.hbs';
// }
}

View File

@ -0,0 +1,14 @@
export default class m5ItemSheet extends ItemSheet {
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
width: 530,
height: 340,
classes: ["midgard5", "sheet", "item"]
});
}
get template() {
return 'systems/midgard5/templates/sheets/m5Item-Sheet.hbs';
}
}

31
system.json Normal file
View File

@ -0,0 +1,31 @@
{
"name": "midgard5",
"title": "Midgard 5. Edition",
"description": "Midgard 5. Edition",
"version": 0.01,
"minimumCoreVersion": "0.7.9",
"compatibleCoreVersion": "0.7.9",
"templateVersion": 2,
"author": "Hans-Joachim Maier",
"esmodules": [
"midgard5.js"
],
"styles": [
"midgard5.css"
],
"packs": [],
"languages": [
{
"lang": "de",
"name": "Deutsch",
"path": "lang/de.json"
}
],
"gridDistance": 1,
"gridUnits": "m",
"primaryTokenAttribute": "lp",
"secondaryTokenAttribute": "ap",
"url": "https://github.com/GateKept/flatpacktemplate",
"manifest": "https://github.com/GateKept/flatpacktemplate/blob/master/system.json",
"initiative": "@gw.value + @gw.bonus"
}

75
template.json Normal file
View File

@ -0,0 +1,75 @@
{
"Actor":{
"types":[
"npc",
"character"
],
"templates":{
"characterDescription": {
"description": " "
},
"characterBars":{
"lp":{
"value":10,
"min":0,
"max":10
},
"ap":{
"value":5,
"min":0,
"max":5
}
},
"attributes":{
"gw": {
"value": 50,
"bonus": 0
}
}
},
"character":{
"templates": [
"characterBars",
"attributes",
"characterDescription"
]
},
"npc":{
"templates": [
"characterBars",
"attributes",
"characterDescription"
]
},
"vehicle":{
"templates": [
"characterBars",
"attributes"
]
}
},
"Item":{
"types":[
"item"
],
"templates":{
"itemDescription": {
"description": " "
}
},
"item":{
"templates":[
"itemDescription"
],
"quantity":1,
"weight":0,
"magic":false,
"attributes":{
},
"groups":{
}
}
}
}

View File

@ -0,0 +1,77 @@
<form class="actor-sheet {{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img src="{{actor.img}}" data-edit="img" title="{{actor.name}}" height="64" width="64" />
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="Name" /></h1>
</header>
<div class="sheet-content">
<table>
<tr>
<th>{{localize "midgard5.lp"}}</th>
<th>{{localize "midgard5.ap"}}</th>
<th>{{localize "midgard5.gw"}}</th>
</tr>
<tr>
<td>
<table>
<tr>
<th>{{localize "midgard5.aktuell"}}</th>
<th>{{localize "midgard5.maximum"}}</th>
</tr>
<td>
<input name="data.lp.value" type="text" value="{{data.lp.value}}" data-dtype="Number" />
</td>
<td>
<input name="data.lp.max" type="text" value="{{data.lp.max}}" data-dtype="Number" />
</td>
</table>
</td>
<td>
<table>
<tr>
<th>{{localize "midgard5.aktuell"}}</th>
<th>{{localize "midgard5.maximum"}}</th>
</tr>
<td>
<input name="data.ap.value" type="text" value="{{data.ap.value}}" data-dtype="Number" />
</td>
<td>
<input name="data.ap.max" type="text" value="{{data.ap.max}}" data-dtype="Number" />
</td>
</table>
</td>
<td>
<table>
<tr>
<th>{{localize "midgard5.attrvalue"}}</th>
<th>{{localize "midgard5.bonus"}}</th>
</tr>
<td>
<input name="data.gw.value" type="text" value="{{data.gw.value}}" data-dtype="Number" />
</td>
<td>
<input name="data.gw.bonus" type="text" value="{{data.gw.bonus}}" data-dtype="Number" />
</td>
</table>
</td>
</tr>
</table>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
{{!-- <section class="items">
<h3>Owned Items</h3>
<ol class="actor-items">
{{#each actor.items as |item id|}}
<li class="actor-item" data-item-id="{{id}}">
<div class="item-name">
<img src="{{item.img}}" title="{{item.name}}" width="24" height="24" />
<h4>{{item.name}}</h4>
</div>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ol>
</section> --}}
</form>

View File

@ -0,0 +1,27 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img src="{{item.img}}" data-edit="img" title="{{item.name}}" height="64" width="64"/>
<h1><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
</header>
<div class="sheet-content">
<table>
<tr>
<th>{{localize "midgard5.quantity"}}</th>
<th>{{localize "midgard5.item.value"}}</th>
<th>{{localize "midgard5.ismagic"}}</th>
</tr>
<tr>
<td>
<input name="data.quantity" type="text" value="{{data.quantity}}" data-dtype="Number" />
</td>
<td>
<input name="data.weight" type="text" value="{{data.weight}}" data-dtype="Number" />
</td>
<td>
<input name="data.magic" type="checkbox" {{checked data.magic}} />
</td>
</tr>
</table>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
</form>