Merge branch 'develop'
This commit is contained in:
commit
8a3c632c7d
|
|
@ -91,6 +91,10 @@
|
||||||
"midgard5.origin": "Heimat",
|
"midgard5.origin": "Heimat",
|
||||||
"midgard5.faith": "Glaube",
|
"midgard5.faith": "Glaube",
|
||||||
|
|
||||||
|
"midgard5.currency-gold": "Gold",
|
||||||
|
"midgard5.currency-silver": "Silber",
|
||||||
|
"midgard5.currency-copper": "Kupfer",
|
||||||
|
|
||||||
"midgard5.exp-overall": "Erfahrungsschatz",
|
"midgard5.exp-overall": "Erfahrungsschatz",
|
||||||
"midgard5.exp-available": "Erfahrungspunkte",
|
"midgard5.exp-available": "Erfahrungspunkte",
|
||||||
"midgard5.grace": "Göttliche Gnade",
|
"midgard5.grace": "Göttliche Gnade",
|
||||||
|
|
@ -197,8 +201,8 @@
|
||||||
"midgard5.enduranceBonus": "Ausdauerbonus",
|
"midgard5.enduranceBonus": "Ausdauerbonus",
|
||||||
"midgard5.lpProtection": "Rüstungsschutz (LP)",
|
"midgard5.lpProtection": "Rüstungsschutz (LP)",
|
||||||
"midgard5.apProtection": "Rüstungsschutz (AP)",
|
"midgard5.apProtection": "Rüstungsschutz (AP)",
|
||||||
"midgard5.perception" : "Wahrnehmung",
|
"midgard5.perception": "Wahrnehmung",
|
||||||
"midgard5.drinking" : "Trinken",
|
"midgard5.drinking": "Trinken",
|
||||||
|
|
||||||
"midgard5.new-skill": "Neue Fertigkeit",
|
"midgard5.new-skill": "Neue Fertigkeit",
|
||||||
"midgard5.special": "Spezial",
|
"midgard5.special": "Spezial",
|
||||||
|
|
@ -287,6 +291,7 @@
|
||||||
"midgard5.kido-variante-kontrollieren": "Kontrollieren",
|
"midgard5.kido-variante-kontrollieren": "Kontrollieren",
|
||||||
|
|
||||||
"midgard5.mod-operation-add100": "Addieren (max 100)",
|
"midgard5.mod-operation-add100": "Addieren (max 100)",
|
||||||
|
"midgard5.mod-operation-roll": "Wurf Modifikation",
|
||||||
"midgard5.mod-operation-add": "Addieren",
|
"midgard5.mod-operation-add": "Addieren",
|
||||||
"midgard5.mod-operation-set": "Basiswert",
|
"midgard5.mod-operation-set": "Basiswert",
|
||||||
"midgard5.mod-operation-fixed": "Fester Wert",
|
"midgard5.mod-operation-fixed": "Fester Wert",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "foundry-system-midgard5",
|
"name": "foundry-system-midgard5",
|
||||||
"version": "2.3.0",
|
"version": "2.3.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ export enum M5Stats {
|
||||||
PROTECTION_LP = "lpProtection",
|
PROTECTION_LP = "lpProtection",
|
||||||
PROTECTION_AP = "apProtection",
|
PROTECTION_AP = "apProtection",
|
||||||
PERCEPTION = "perception",
|
PERCEPTION = "perception",
|
||||||
DRINKING = "drinking"
|
DRINKING = "drinking",
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum M5ModType {
|
export enum M5ModType {
|
||||||
|
|
@ -96,6 +96,7 @@ export enum M5ModType {
|
||||||
|
|
||||||
export enum M5ModOperation {
|
export enum M5ModOperation {
|
||||||
ADD_100 = "add100",
|
ADD_100 = "add100",
|
||||||
|
ROLL = "roll",
|
||||||
ADD = "add",
|
ADD = "add",
|
||||||
SET = "set",
|
SET = "set",
|
||||||
FIXED = "fixed",
|
FIXED = "fixed",
|
||||||
|
|
|
||||||
|
|
@ -67,9 +67,9 @@ export class M5Character extends Actor {
|
||||||
brawlFw: 0,
|
brawlFw: 0,
|
||||||
poisonResistance: { value: 0, mods: [] },
|
poisonResistance: { value: 0, mods: [] },
|
||||||
enduranceBonus: 0,
|
enduranceBonus: 0,
|
||||||
perception: {value: 0, mods: []},
|
perception: { value: 0, mods: [] },
|
||||||
perceptionFW: 0,
|
perceptionFW: 0,
|
||||||
drinking: {value: 0, mods: []},
|
drinking: { value: 0, mods: [] },
|
||||||
drinkingFW: 0,
|
drinkingFW: 0,
|
||||||
},
|
},
|
||||||
skillMods: {},
|
skillMods: {},
|
||||||
|
|
@ -171,12 +171,24 @@ export class M5Character extends Actor {
|
||||||
if (item.system.magic) {
|
if (item.system.magic) {
|
||||||
label += "*";
|
label += "*";
|
||||||
}
|
}
|
||||||
|
let rollable = false;
|
||||||
|
|
||||||
|
// console.log(item.system.rolls.formulas.map((p) => p.enabled));
|
||||||
|
for (let key in item.system.rolls.formulas) {
|
||||||
|
rollable = item.system.rolls.formulas[key].enabled;
|
||||||
|
if (rollable) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
ret.gear.items[item.id] = {
|
ret.gear.items[item.id] = {
|
||||||
label: label,
|
label: label,
|
||||||
magic: item.system.magic,
|
magic: item.system.magic,
|
||||||
calc: item.system.calc,
|
calc: item.system.calc,
|
||||||
equipped: item.system?.equipped,
|
equipped: item.system?.equipped,
|
||||||
|
value: item.system.value || 0,
|
||||||
|
currency: item.system.currency || "",
|
||||||
|
quantity: item.system.quantity || 0,
|
||||||
|
rollExist: rollable,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -258,7 +258,6 @@ export class M5Item extends Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
const roll = new M5Roll(rollData, this.actor, item.name);
|
const roll = new M5Roll(rollData, this.actor, item.name);
|
||||||
console.log(roll);
|
|
||||||
return roll.toMessage();
|
return roll.toMessage();
|
||||||
} else {
|
} else {
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { Evaluated } from "@league-of-foundry-developers/foundry-vtt-types/src/foundry/client/dice/roll";
|
import { Evaluated } from "@league-of-foundry-developers/foundry-vtt-types/src/foundry/client/dice/roll";
|
||||||
import { M5Character } from "../actors/M5Character";
|
import { M5Character } from "../actors/M5Character";
|
||||||
import { M5EwResult, M5RollData, M5RollResult, M5SkillUnlearned, M5Stats } from "../M5Base";
|
import { M5EwResult, M5ModOperation, M5ModType, M5RollData, M5RollResult, M5SkillUnlearned, M5Stats } from "../M5Base";
|
||||||
import { stat } from "fs";
|
import { stat } from "fs";
|
||||||
|
|
||||||
export class M5Roll {
|
export class M5Roll {
|
||||||
|
|
@ -115,31 +115,20 @@ export class M5Roll {
|
||||||
return ChatMessage.create(chatData);
|
return ChatMessage.create(chatData);
|
||||||
}
|
}
|
||||||
|
|
||||||
static fromAttribute(actor: any, attributeKey: string) {
|
|
||||||
const character = actor as M5Character;
|
|
||||||
const attribute = character.attribute(attributeKey);
|
|
||||||
|
|
||||||
const rollData = actor.getRollData() as M5RollData;
|
|
||||||
rollData.i = attribute.value + attribute.bonus;
|
|
||||||
rollData.rolls["0"] = {
|
|
||||||
formula: "@i - 1d100",
|
|
||||||
enabled: true,
|
|
||||||
label: (game as Game).i18n.localize("midgard5.pw"),
|
|
||||||
result: "",
|
|
||||||
total: 0,
|
|
||||||
totalStr: "",
|
|
||||||
dice: {},
|
|
||||||
css: "",
|
|
||||||
} as M5RollResult;
|
|
||||||
|
|
||||||
return new M5Roll(rollData, actor, (game as Game).i18n.localize(`midgard5.actor-${attributeKey}-long`));
|
|
||||||
}
|
|
||||||
|
|
||||||
static fromAttributeValue(actor: any, attributeKey: string, attributeValue: number) {
|
static fromAttributeValue(actor: any, attributeKey: string, attributeValue: number) {
|
||||||
const rollData = actor.getRollData() as M5RollData;
|
const rollData = actor.getRollData() as M5RollData;
|
||||||
|
const itemData = actor.items.filter((x) => x.type === "effect").map((y) => y.system.mods);
|
||||||
|
rollData.c = 0;
|
||||||
|
for (let effectKey in itemData) {
|
||||||
|
for (let modkey in itemData[effectKey])
|
||||||
|
if (itemData[effectKey][modkey].type === M5ModType.ATTRIBUTE && itemData[effectKey][modkey].operation === M5ModOperation.ROLL) {
|
||||||
|
rollData.c += itemData[effectKey][modkey].value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rollData.i = attributeValue;
|
rollData.i = attributeValue;
|
||||||
rollData.rolls["0"] = {
|
rollData.rolls["0"] = {
|
||||||
formula: "@i - 1d100",
|
formula: "@i - 1d100 - @c",
|
||||||
enabled: true,
|
enabled: true,
|
||||||
label: (game as Game).i18n.localize("midgard5.pw"),
|
label: (game as Game).i18n.localize("midgard5.pw"),
|
||||||
result: "",
|
result: "",
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,60 @@ export default class M5CharacterSheet extends ActorSheet {
|
||||||
item.sheet.render(true);
|
item.sheet.render(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
html.find(".quantity-increase").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.quantity) {
|
||||||
|
item.system.quantity = 0;
|
||||||
|
}
|
||||||
|
item.system.quantity += 1;
|
||||||
|
this.render();
|
||||||
|
});
|
||||||
|
|
||||||
|
html.find(".quantity-decrease").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.quantity > 0) {
|
||||||
|
item.system.quantity -= 1;
|
||||||
|
}
|
||||||
|
this.render();
|
||||||
|
});
|
||||||
|
|
||||||
|
html.find(".roll-consumable-item").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.quantity > 0) {
|
||||||
|
item.system.quantity -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
await item.roll();
|
||||||
|
this.render();
|
||||||
|
});
|
||||||
|
|
||||||
html.find(".item-delete").on("click", async (event) => {
|
html.find(".item-delete").on("click", async (event) => {
|
||||||
let row = event.target.parentElement;
|
let row = event.target.parentElement;
|
||||||
let itemId = row.dataset["item"];
|
let itemId = row.dataset["item"];
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
"name": "midgard5",
|
"name": "midgard5",
|
||||||
"title": "Midgard 5. Edition",
|
"title": "Midgard 5. Edition",
|
||||||
"description": "The German RPG Midgard 5. Edition",
|
"description": "The German RPG Midgard 5. Edition",
|
||||||
"version": "2.3.0",
|
"version": "2.3.1",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "10",
|
"minimum": "10",
|
||||||
"verified": "11",
|
"verified": "11",
|
||||||
|
|
@ -154,8 +154,8 @@
|
||||||
"primaryTokenAttribute": "lp",
|
"primaryTokenAttribute": "lp",
|
||||||
"secondaryTokenAttribute": "ap",
|
"secondaryTokenAttribute": "ap",
|
||||||
"url": "https://github.com/Byroks/foundry-vtt-system-midgard5",
|
"url": "https://github.com/Byroks/foundry-vtt-system-midgard5",
|
||||||
"manifest": "https://github.com/Byroks/foundry-vtt-system-midgard5/releases/download/v2.3.0/system.json",
|
"manifest": "https://github.com/Byroks/foundry-vtt-system-midgard5/releases/download/v2.3.1/system.json",
|
||||||
"download": "https://github.com/Byroks/foundry-vtt-system-midgard5/releases/download/v2.3.0/midgard5-v2.3.0.zip",
|
"download": "https://github.com/Byroks/foundry-vtt-system-midgard5/releases/download/v2.3.1/midgard5-v2.3.1.zip",
|
||||||
"initiative": "@c.calc.attributes.gw.value",
|
"initiative": "@c.calc.attributes.gw.value",
|
||||||
"license": "LICENSE.txt"
|
"license": "LICENSE.txt"
|
||||||
}
|
}
|
||||||
|
|
@ -16,7 +16,10 @@
|
||||||
"caste": "",
|
"caste": "",
|
||||||
"occupation": "",
|
"occupation": "",
|
||||||
"origin": "",
|
"origin": "",
|
||||||
"faith": ""
|
"faith": "",
|
||||||
|
"gold": 0,
|
||||||
|
"silver": 0,
|
||||||
|
"copper": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"characterBars": {
|
"characterBars": {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,20 @@
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="title" style="text-align: center">{{localize "midgard5.currency-gold"}}</th>
|
||||||
|
<th class="title" style="text-align: center">{{localize "midgard5.currency-silver"}}</th>
|
||||||
|
<th class="title" style="text-align: center">{{localize "midgard5.currency-copper"}}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="fixed-value"><input type="number" name="data.info.gold" value="{{data.info.gold}}"></td>
|
||||||
|
<td class="fixed-value"><input type="number" name="data.info.silver" value="{{data.info.silver}}"></td>
|
||||||
|
<td class="fixed-value"><input type="number" name="data.info.copper" value="{{data.info.copper}}"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -106,10 +123,14 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="title">{{localize "TYPES.Item.item"}}</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>
|
||||||
|
<th class="title"></th>
|
||||||
<th class="title"></th>
|
<th class="title"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
</tr>
|
||||||
{{#each data.calc.gear.items as |item itemId|}}
|
{{#each data.calc.gear.items as |item itemId|}}
|
||||||
<tr data-item="{{itemId}}">
|
<tr data-item="{{itemId}}">
|
||||||
<td class="padding">
|
<td class="padding">
|
||||||
|
|
@ -118,6 +139,17 @@
|
||||||
<span class="spell-process">{{localize "midgard5.equipped"}}</span>
|
<span class="spell-process">{{localize "midgard5.equipped"}}</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</td>
|
</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 class="fixed-value">{{#if item.rollExist}}<button class="roll-button roll-consumable-item"></button>{{/if}}</td>
|
||||||
<td class="fixed-value"><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
|
<td class="fixed-value"><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
|
||||||
|
|
@ -19,16 +19,34 @@
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div class="flexrow">
|
||||||
|
<span>{{localize "midgard5.item-quantity"}}</span>
|
||||||
|
<input id="data.quantity" type="number" name="data.quantity" value="{{data.quantity}}">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
<span>{{localize "midgard5.item-value"}}</span>
|
<span>{{localize "midgard5.item-value"}}</span>
|
||||||
<input name="data.value" type="text" value="{{data.value}}" data-dtype="Number" />
|
<input name="data.value" type="number" value="{{data.value}}" data-dtype="Number" />
|
||||||
|
<select class="select-mod-operation" name="data.currency" data-type="String">
|
||||||
|
{{#select data.currency}}
|
||||||
|
<option value=""></option>
|
||||||
|
<option value="copper">{{localize "midgard5.currency-copper"}}</option>
|
||||||
|
<option value="silver">{{localize "midgard5.currency-silver"}}</option>
|
||||||
|
<option value="gold">{{localize "midgard5.currency-gold"}}</option>
|
||||||
|
{{/select}}
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
{{> "systems/midgard5/templates/sheets/item/rolls.hbs"}}
|
||||||
|
|
||||||
{{> "systems/midgard5/templates/sheets/partial/mod.hbs" mods=data.mods calc=data.calc}}
|
{{> "systems/midgard5/templates/sheets/partial/mod.hbs" mods=data.mods calc=data.calc}}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@
|
||||||
{{#select mod.operation}}
|
{{#select mod.operation}}
|
||||||
{{#if (eq mod.type "attribute")}}
|
{{#if (eq mod.type "attribute")}}
|
||||||
<option value="add100">{{localize "midgard5.mod-operation-add100"}}</option>
|
<option value="add100">{{localize "midgard5.mod-operation-add100"}}</option>
|
||||||
|
<option value="roll">{{localize "midgard5.mod-operation-roll"}}</option>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<option value="add">{{localize "midgard5.mod-operation-add"}}</option>
|
<option value="add">{{localize "midgard5.mod-operation-add"}}</option>
|
||||||
<option value="set">{{localize "midgard5.mod-operation-set"}}</option>
|
<option value="set">{{localize "midgard5.mod-operation-set"}}</option>
|
||||||
|
|
@ -48,7 +49,7 @@
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<input name="data.mods.{{modId}}.value" type="text" value="{{mod.value}}" data-dtype="Number" />
|
<input name="data.mods.{{modId}}.value" type="number" value="{{mod.value}}" data-dtype="Number" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue