Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46d1809eeb | ||
|
|
20f63d459a | ||
|
|
35a6b0fae9 | ||
|
|
db21ca93b0 | ||
|
|
7bf0fd90b0 | ||
|
|
a7bdd0434e | ||
|
|
97d4a35cd6 | ||
|
|
c2996aa974 | ||
|
|
bf4f49755a | ||
|
|
57bffd492a |
+1
-1
@@ -5,4 +5,4 @@ package-lock.json
|
|||||||
source/packs/
|
source/packs/
|
||||||
source/generators/
|
source/generators/
|
||||||
dist
|
dist
|
||||||
midgard5*.zip
|
*.zip
|
||||||
+1
-1
@@ -6,7 +6,7 @@ _**Warnung:** Das System befindet sich noch in der Entwicklung._
|
|||||||
|
|
||||||
Gehe auf die Setup-Seite deiner Foundry VTT Instanz. Klicke im Reiter **Game Systems** auf den Button **Install System**. In dem dann geöffneten Dialog, unten in der Zeile **Manifest URL** den Link zur aktuellen (oder gewünschten) Version der _system.json_ eintragen und auf **Install** klicken:
|
Gehe auf die Setup-Seite deiner Foundry VTT Instanz. Klicke im Reiter **Game Systems** auf den Button **Install System**. In dem dann geöffneten Dialog, unten in der Zeile **Manifest URL** den Link zur aktuellen (oder gewünschten) Version der _system.json_ eintragen und auf **Install** klicken:
|
||||||
|
|
||||||
https://github.com/michaelstein/foundry-vtt-system-midgard5/releases/download/v1.0.1/system.json
|
https://github.com/byroks/foundry-vtt-system-midgard5/releases/download/v1.3.0/system.json
|
||||||
|
|
||||||
Danach kann eine Spielwelt mit dem System erstellt werden.
|
Danach kann eine Spielwelt mit dem System erstellt werden.
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"ACTOR.TypeCharacter": "Charakter",
|
"TYPES.Actor.character": "Charakter",
|
||||||
"ACTOR.TypeNpc": "Kreatur / Nichtspielerfigur",
|
"ACTOR.TypeNpc": "Kreatur / Nichtspielerfigur",
|
||||||
"ACTOR.TypeVehicle": "Transportmittel / Pferd etc.",
|
"ACTOR.TypeVehicle": "Transportmittel / Pferd etc.",
|
||||||
|
|
||||||
"ITEM.TypeItem": "Gegenstand",
|
"TYPES.Item.item": "Gegenstand",
|
||||||
"ITEM.TypeWeapon": "Waffe",
|
"TYPES.Item.weapon": "Waffe",
|
||||||
"ITEM.TypeDefensiveWeapon": "Verteidigungswaffe",
|
"ITEM.TypeDefensiveWeapon": "Verteidigungswaffe",
|
||||||
"ITEM.TypeArmor": "Rüstung",
|
"TYPES.Item.armor": "Rüstung",
|
||||||
"ITEM.TypeSpell": "Zauber",
|
"TYPES.Item.spell": "Zauber",
|
||||||
"ITEM.TypeEffect": "Aktive Effekte",
|
"TYPES.Item.effect": "Aktive Effekte",
|
||||||
|
|
||||||
"midgard5.doRoll": "Würfeln",
|
"midgard5.doRoll": "Würfeln",
|
||||||
"midgard5.learn": "Lernen",
|
"midgard5.learn": "Lernen",
|
||||||
|
|||||||
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "foundry-system-midgard5",
|
"name": "foundry-system-midgard5",
|
||||||
"version": "1.3.0",
|
"version": "1.3.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ export class M5Character extends Actor {
|
|||||||
);
|
);
|
||||||
ret.stats.spellCasting = this.modResult((data.info.magicUsing ? M5Character.spellCastingFromLevel(ret.level) : 3) + ret.attributes.zt.bonus);
|
ret.stats.spellCasting = this.modResult((data.info.magicUsing ? M5Character.spellCastingFromLevel(ret.level) : 3) + ret.attributes.zt.bonus);
|
||||||
ret.stats.brawl = this.modResult(Math.floor((ret.attributes.st.value + ret.attributes.gw.value) / 20));
|
ret.stats.brawl = this.modResult(Math.floor((ret.attributes.st.value + ret.attributes.gw.value) / 20));
|
||||||
ret.stats.brawlEw = ret.stats.brawl.value + ret.stats.attackBonus.value;
|
ret.stats.brawlEw = ret.stats.brawl.value + ret.stats.attackBonus.value + (data.info.race === "Zwerg" ? 1 : 0);
|
||||||
ret.stats.poisonResistance = this.modResult(30 + Math.floor(ret.attributes.ko.value / 2));
|
ret.stats.poisonResistance = this.modResult(30 + Math.floor(ret.attributes.ko.value / 2));
|
||||||
ret.stats.enduranceBonus = Math.floor(ret.attributes.ko.value / 10) + Math.floor(ret.attributes.st.value / 20);
|
ret.stats.enduranceBonus = Math.floor(ret.attributes.ko.value / 10) + Math.floor(ret.attributes.st.value / 20);
|
||||||
|
|
||||||
@@ -386,7 +386,7 @@ export class M5Character extends Actor {
|
|||||||
value: value,
|
value: value,
|
||||||
mods: [
|
mods: [
|
||||||
{
|
{
|
||||||
item: (game as Game).i18n.localize("ACTOR.TypeCharacter"),
|
item: (game as Game).i18n.localize("TYPES.Actor.character"),
|
||||||
operation: M5ModOperation.SET,
|
operation: M5ModOperation.SET,
|
||||||
value: value,
|
value: value,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,158 +1,147 @@
|
|||||||
import { M5Attribute, M5AttributeCalculated, M5Attributes, M5CharacterCalculatedData, M5ItemMod, M5ModOperation, M5ModResult, M5ModSource, M5ModType, M5Stats, M5ModPair } from "../M5Base"
|
import { M5Attribute, M5AttributeCalculated, M5Attributes, M5CharacterCalculatedData, M5ItemMod, M5ModOperation, M5ModResult, M5ModSource, M5ModType, M5Stats, M5ModPair } from "../M5Base";
|
||||||
|
|
||||||
export default class M5ModAggregate {
|
export default class M5ModAggregate {
|
||||||
private attributes = new Map<string, Array<M5ModPair>>()
|
private attributes = new Map<string, Array<M5ModPair>>();
|
||||||
private stats = new Map<string, Array<M5ModPair>>()
|
private stats = new Map<string, Array<M5ModPair>>();
|
||||||
private skills = new Map<string, Array<M5ModPair>>()
|
private skills = new Map<string, Array<M5ModPair>>();
|
||||||
|
|
||||||
constructor(public data: any, public calc: M5CharacterCalculatedData) {
|
constructor(public data: any, public calc: M5CharacterCalculatedData) {
|
||||||
const characterString = (game as Game).i18n.localize("ACTOR.TypeCharacter")
|
const characterString = (game as Game).i18n.localize("TYPES.Actor.character");
|
||||||
|
|
||||||
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.ST, operation: M5ModOperation.SET, value: data.attributes.st.value }, characterString)
|
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.ST, operation: M5ModOperation.SET, value: data.attributes.st.value }, characterString);
|
||||||
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.GS, operation: M5ModOperation.SET, value: data.attributes.gs.value }, characterString)
|
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.GS, operation: M5ModOperation.SET, value: data.attributes.gs.value }, characterString);
|
||||||
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.GW, operation: M5ModOperation.SET, value: data.attributes.gw.value }, characterString)
|
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.GW, operation: M5ModOperation.SET, value: data.attributes.gw.value }, characterString);
|
||||||
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.KO, operation: M5ModOperation.SET, value: data.attributes.ko.value }, characterString)
|
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.KO, operation: M5ModOperation.SET, value: data.attributes.ko.value }, characterString);
|
||||||
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.IN, operation: M5ModOperation.SET, value: data.attributes.in.value }, characterString)
|
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.IN, operation: M5ModOperation.SET, value: data.attributes.in.value }, characterString);
|
||||||
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.ZT, operation: M5ModOperation.SET, value: data.attributes.zt.value }, characterString)
|
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.ZT, operation: M5ModOperation.SET, value: data.attributes.zt.value }, characterString);
|
||||||
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.AU, operation: M5ModOperation.SET, value: data.attributes.au.value }, characterString)
|
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.AU, operation: M5ModOperation.SET, value: data.attributes.au.value }, characterString);
|
||||||
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.PA, operation: M5ModOperation.SET, value: data.attributes.pa.value }, characterString)
|
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.PA, operation: M5ModOperation.SET, value: data.attributes.pa.value }, characterString);
|
||||||
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.WK, operation: M5ModOperation.SET, value: data.attributes.wk.value }, characterString)
|
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.WK, operation: M5ModOperation.SET, value: data.attributes.wk.value }, characterString);
|
||||||
|
|
||||||
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.ST, operation: M5ModOperation.ADD_100, value: data.attributes.st.bonus }, characterString)
|
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.ST, operation: M5ModOperation.ADD_100, value: data.attributes.st.bonus }, characterString);
|
||||||
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.GS, operation: M5ModOperation.ADD_100, value: data.attributes.gs.bonus }, characterString)
|
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.GS, operation: M5ModOperation.ADD_100, value: data.attributes.gs.bonus }, characterString);
|
||||||
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.GW, operation: M5ModOperation.ADD_100, value: data.attributes.gw.bonus }, characterString)
|
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.GW, operation: M5ModOperation.ADD_100, value: data.attributes.gw.bonus }, characterString);
|
||||||
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.KO, operation: M5ModOperation.ADD_100, value: data.attributes.ko.bonus }, characterString)
|
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.KO, operation: M5ModOperation.ADD_100, value: data.attributes.ko.bonus }, characterString);
|
||||||
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.IN, operation: M5ModOperation.ADD_100, value: data.attributes.in.bonus }, characterString)
|
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.IN, operation: M5ModOperation.ADD_100, value: data.attributes.in.bonus }, characterString);
|
||||||
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.ZT, operation: M5ModOperation.ADD_100, value: data.attributes.zt.bonus }, characterString)
|
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.ZT, operation: M5ModOperation.ADD_100, value: data.attributes.zt.bonus }, characterString);
|
||||||
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.AU, operation: M5ModOperation.ADD_100, value: data.attributes.au.bonus }, characterString)
|
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.AU, operation: M5ModOperation.ADD_100, value: data.attributes.au.bonus }, characterString);
|
||||||
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.PA, operation: M5ModOperation.ADD_100, value: data.attributes.pa.bonus }, characterString)
|
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.PA, operation: M5ModOperation.ADD_100, value: data.attributes.pa.bonus }, characterString);
|
||||||
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.WK, operation: M5ModOperation.ADD_100, value: data.attributes.wk.bonus }, characterString)
|
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.WK, operation: M5ModOperation.ADD_100, value: data.attributes.wk.bonus }, characterString);
|
||||||
|
|
||||||
this.push({ type: M5ModType.STAT, id: M5Stats.DEFENSE, operation: M5ModOperation.SET, value: calc.stats.defenseBonus.value }, characterString)
|
this.push({ type: M5ModType.STAT, id: M5Stats.DEFENSE, operation: M5ModOperation.SET, value: calc.stats.defenseBonus.value }, characterString);
|
||||||
this.push({ type: M5ModType.STAT, id: M5Stats.ATTACK, operation: M5ModOperation.SET, value: calc.stats.attackBonus.value }, characterString)
|
this.push({ type: M5ModType.STAT, id: M5Stats.ATTACK, operation: M5ModOperation.SET, value: calc.stats.attackBonus.value }, characterString);
|
||||||
this.push({ type: M5ModType.STAT, id: M5Stats.DAMAGE, operation: M5ModOperation.SET, value: calc.stats.damageBonus.value }, characterString)
|
this.push({ type: M5ModType.STAT, id: M5Stats.DAMAGE, operation: M5ModOperation.SET, value: calc.stats.damageBonus.value }, characterString);
|
||||||
this.push({ type: M5ModType.STAT, id: M5Stats.MOVEMENT, operation: M5ModOperation.SET, value: calc.stats.movementBonus.value }, characterString)
|
this.push({ type: M5ModType.STAT, id: M5Stats.MOVEMENT, operation: M5ModOperation.SET, value: calc.stats.movementBonus.value }, characterString);
|
||||||
this.push({ type: M5ModType.STAT, id: M5Stats.RESISTANCE_MIND, operation: M5ModOperation.SET, value: calc.stats.resistanceMind.value }, characterString)
|
this.push({ type: M5ModType.STAT, id: M5Stats.RESISTANCE_MIND, operation: M5ModOperation.SET, value: calc.stats.resistanceMind.value }, characterString);
|
||||||
this.push({ type: M5ModType.STAT, id: M5Stats.RESISTANCE_BODY, operation: M5ModOperation.SET, value: calc.stats.resistanceBody.value }, characterString)
|
this.push({ type: M5ModType.STAT, id: M5Stats.RESISTANCE_BODY, operation: M5ModOperation.SET, value: calc.stats.resistanceBody.value }, characterString);
|
||||||
this.push({ type: M5ModType.STAT, id: M5Stats.SPELL_CASTING, operation: M5ModOperation.SET, value: calc.stats.spellCasting.value }, characterString)
|
this.push({ type: M5ModType.STAT, id: M5Stats.SPELL_CASTING, operation: M5ModOperation.SET, value: calc.stats.spellCasting.value }, characterString);
|
||||||
this.push({ type: M5ModType.STAT, id: M5Stats.BRAWL, operation: M5ModOperation.SET, value: calc.stats.brawl.value }, characterString)
|
this.push({ type: M5ModType.STAT, id: M5Stats.BRAWL, operation: M5ModOperation.SET, value: calc.stats.brawl.value }, characterString);
|
||||||
this.push({ type: M5ModType.STAT, id: M5Stats.POISON_RESISTANCE, operation: M5ModOperation.SET, value: calc.stats.poisonResistance.value }, characterString)
|
this.push({ type: M5ModType.STAT, id: M5Stats.POISON_RESISTANCE, operation: M5ModOperation.SET, value: calc.stats.poisonResistance.value }, characterString);
|
||||||
this.push({ type: M5ModType.STAT, id: M5Stats.LP, operation: M5ModOperation.SET, value: calc.stats.lp.value }, characterString)
|
this.push({ type: M5ModType.STAT, id: M5Stats.LP, operation: M5ModOperation.SET, value: calc.stats.lp.value }, characterString);
|
||||||
this.push({ type: M5ModType.STAT, id: M5Stats.AP, operation: M5ModOperation.SET, value: calc.stats.ap.value }, characterString)
|
this.push({ type: M5ModType.STAT, id: M5Stats.AP, operation: M5ModOperation.SET, value: calc.stats.ap.value }, characterString);
|
||||||
}
|
}
|
||||||
|
|
||||||
push(mod: M5ItemMod, source: string) {
|
push(mod: M5ItemMod, source: string) {
|
||||||
if (!mod?.id || mod.id === "")
|
if (!mod?.id || mod.id === "") return;
|
||||||
return
|
|
||||||
|
|
||||||
let map: Map<string, Array<M5ModPair>> = null
|
let map: Map<string, Array<M5ModPair>> = null;
|
||||||
if (mod.type === M5ModType.ATTRIBUTE)
|
if (mod.type === M5ModType.ATTRIBUTE) map = this.attributes;
|
||||||
map = this.attributes
|
else if (mod.type === M5ModType.STAT) map = this.stats;
|
||||||
else if (mod.type === M5ModType.STAT)
|
else if (mod.type === M5ModType.SKILL) map = this.skills;
|
||||||
map = this.stats
|
|
||||||
else if (mod.type === M5ModType.SKILL)
|
|
||||||
map = this.skills
|
|
||||||
|
|
||||||
if (map) {
|
if (map) {
|
||||||
const pair: M5ModPair = {
|
const pair: M5ModPair = {
|
||||||
mod: mod,
|
mod: mod,
|
||||||
source: source
|
source: source,
|
||||||
}
|
};
|
||||||
|
|
||||||
if (map.has(mod.id))
|
if (map.has(mod.id)) map.get(mod.id).push(pair);
|
||||||
map.get(mod.id).push(pair)
|
else map.set(mod.id, [pair]);
|
||||||
else
|
|
||||||
map.set(mod.id, [pair])
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
calculate() {
|
calculate() {
|
||||||
const calc = this.calc
|
const calc = this.calc;
|
||||||
|
|
||||||
this.attributes.forEach((pairs, id) => {
|
this.attributes.forEach((pairs, id) => {
|
||||||
const res = M5ModAggregate.processPairs(pairs)
|
const res = M5ModAggregate.processPairs(pairs);
|
||||||
calc.attributes[id] = {
|
calc.attributes[id] = {
|
||||||
value: res.value,
|
value: res.value,
|
||||||
bonus: M5ModAggregate.attributeBonus(res.value),
|
bonus: M5ModAggregate.attributeBonus(res.value),
|
||||||
mods: res.mods
|
mods: res.mods,
|
||||||
} as M5AttributeCalculated
|
} as M5AttributeCalculated;
|
||||||
//console.log("calc.attributes." + id, calc.attributes[id])
|
//console.log("calc.attributes." + id, calc.attributes[id])
|
||||||
})
|
});
|
||||||
|
|
||||||
this.stats.forEach((pairs, id) => {
|
this.stats.forEach((pairs, id) => {
|
||||||
const res = M5ModAggregate.processPairs(pairs)
|
const res = M5ModAggregate.processPairs(pairs);
|
||||||
calc.stats[id] = res
|
calc.stats[id] = res;
|
||||||
})
|
});
|
||||||
|
|
||||||
const ret = {}
|
const ret = {};
|
||||||
this.skills.forEach((pairs, id) => {
|
this.skills.forEach((pairs, id) => {
|
||||||
ret[id] = pairs
|
ret[id] = pairs;
|
||||||
})
|
});
|
||||||
|
|
||||||
return ret
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static pairAsSource(pair: M5ModPair): M5ModSource {
|
static pairAsSource(pair: M5ModPair): M5ModSource {
|
||||||
return {
|
return {
|
||||||
operation: pair.mod.operation,
|
operation: pair.mod.operation,
|
||||||
value: pair.mod.value,
|
value: pair.mod.value,
|
||||||
item: pair.source
|
item: pair.source,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static processPairs(arr: Array<M5ModPair>): M5ModResult {
|
static processPairs(arr: Array<M5ModPair>): M5ModResult {
|
||||||
let ret: M5ModResult = {
|
let ret: M5ModResult = {
|
||||||
mods: [],
|
mods: [],
|
||||||
value: 0
|
value: 0,
|
||||||
}
|
};
|
||||||
|
|
||||||
let mods = arr.filter(pair => pair.mod.operation === M5ModOperation.FIXED).sort((a, b) => b.mod.value - a.mod.value)
|
let mods = arr.filter((pair) => pair.mod.operation === M5ModOperation.FIXED).sort((a, b) => b.mod.value - a.mod.value);
|
||||||
let pair = mods.length === 0 ? null : mods[0]
|
let pair = mods.length === 0 ? null : mods[0];
|
||||||
|
|
||||||
if (pair) {
|
if (pair) {
|
||||||
ret.mods.push(this.pairAsSource(pair))
|
ret.mods.push(this.pairAsSource(pair));
|
||||||
ret.value = pair.mod.value
|
ret.value = pair.mod.value;
|
||||||
} else {
|
} else {
|
||||||
mods = arr.filter(pair => pair.mod.operation === M5ModOperation.SET).sort((a, b) => b.mod.value - a.mod.value)
|
mods = arr.filter((pair) => pair.mod.operation === M5ModOperation.SET).sort((a, b) => b.mod.value - a.mod.value);
|
||||||
if (mods.length !== 0) {
|
if (mods.length !== 0) {
|
||||||
ret.mods.push(this.pairAsSource(mods[0]))
|
ret.mods.push(this.pairAsSource(mods[0]));
|
||||||
ret.value = mods[0].mod.value
|
ret.value = mods[0].mod.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
mods = arr.filter(pair => pair.mod.operation === M5ModOperation.ADD_100)
|
mods = arr.filter((pair) => pair.mod.operation === M5ModOperation.ADD_100);
|
||||||
if (mods.length !== 0) {
|
if (mods.length !== 0) {
|
||||||
ret.mods = ret.mods.concat(mods.map(this.pairAsSource))
|
ret.mods = ret.mods.concat(mods.map(this.pairAsSource));
|
||||||
const bonus = mods.map(p => p.mod.value).reduce((a, b) => a + b, 0)
|
const bonus = mods.map((p) => p.mod.value).reduce((a, b) => a + b, 0);
|
||||||
ret.value = Math.min(100, Math.max(0, ret.value + bonus))
|
ret.value = Math.min(100, Math.max(0, ret.value + bonus));
|
||||||
}
|
}
|
||||||
|
|
||||||
mods = arr.filter(pair => pair.mod.operation === M5ModOperation.ADD)
|
mods = arr.filter((pair) => pair.mod.operation === M5ModOperation.ADD);
|
||||||
if (mods.length !== 0) {
|
if (mods.length !== 0) {
|
||||||
ret.mods = ret.mods.concat(mods.map(this.pairAsSource))
|
ret.mods = ret.mods.concat(mods.map(this.pairAsSource));
|
||||||
const bonus = mods.map(p => p.mod.value).reduce((a, b) => a + b, 0)
|
const bonus = mods.map((p) => p.mod.value).reduce((a, b) => a + b, 0);
|
||||||
ret.value = Math.max(0, ret.value + bonus)
|
ret.value = Math.max(0, ret.value + bonus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static attributeMinMax(attribute: M5Attribute) {
|
static attributeMinMax(attribute: M5Attribute) {
|
||||||
return Math.min(100, Math.max(0, attribute.value + attribute.bonus))
|
return Math.min(100, Math.max(0, attribute.value + attribute.bonus));
|
||||||
}
|
}
|
||||||
|
|
||||||
static attributeBonus(value: number) {
|
static attributeBonus(value: number) {
|
||||||
if (value > 95)
|
if (value > 95) return 2;
|
||||||
return 2
|
if (value > 80) return 1;
|
||||||
if (value > 80)
|
if (value > 20) return 0;
|
||||||
return 1
|
if (value > 5) return -1;
|
||||||
if (value > 20)
|
return -2;
|
||||||
return 0
|
|
||||||
if (value > 5)
|
|
||||||
return -1
|
|
||||||
return -2
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//static modToString(mod: M5ItemMod): string { }
|
//static modToString(mod: M5ItemMod): string { }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,6 +215,12 @@ export class M5Item extends Item {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (item.type === "spell" || item.type === "kampfkunst") {
|
||||||
|
if (this.actor["system"].ap.value >= item.system.ap) {
|
||||||
|
this.actor["system"].ap.value -= item.system.ap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const roll = new M5Roll(rollData, this.actor, item.name);
|
const roll = new M5Roll(rollData, this.actor, item.name);
|
||||||
return roll.toMessage();
|
return roll.toMessage();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ export class M5Roll {
|
|||||||
};
|
};
|
||||||
|
|
||||||
rollData.rolls["0"] = {
|
rollData.rolls["0"] = {
|
||||||
formula: "1d20 + @c.calc.stats.brawl + @c.calc.stats.attackBonus + @i.attackBonus",
|
formula: "1d20 + @c.calc.stats.brawlEw",
|
||||||
enabled: true,
|
enabled: true,
|
||||||
label: (game as Game).i18n.localize("midgard5.attack"),
|
label: (game as Game).i18n.localize("midgard5.attack"),
|
||||||
result: "",
|
result: "",
|
||||||
@@ -192,7 +192,7 @@ export class M5Roll {
|
|||||||
} as M5RollResult;
|
} as M5RollResult;
|
||||||
|
|
||||||
rollData.rolls["1"] = {
|
rollData.rolls["1"] = {
|
||||||
formula: "1d6 - 4 + @c.calc.stats.damageBonus + @i.damageBonus",
|
formula: "1d6 - 4 + @c.calc.stats.damageBonus.value",
|
||||||
enabled: true,
|
enabled: true,
|
||||||
label: (game as Game).i18n.localize("midgard5.damage"),
|
label: (game as Game).i18n.localize("midgard5.damage"),
|
||||||
result: "",
|
result: "",
|
||||||
|
|||||||
@@ -160,6 +160,7 @@ export default class M5CharacterSheet extends ActorSheet {
|
|||||||
const context = this.actor as any;
|
const context = this.actor as any;
|
||||||
const item = context.items.get(itemId) as M5Item;
|
const item = context.items.get(itemId) as M5Item;
|
||||||
await item.roll();
|
await item.roll();
|
||||||
|
this.render();
|
||||||
});
|
});
|
||||||
|
|
||||||
html.find(".roll-brawl-button").on("click", async (event) => {
|
html.find(".roll-brawl-button").on("click", async (event) => {
|
||||||
|
|||||||
+6
-5
@@ -3,10 +3,11 @@
|
|||||||
"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": "1.3.0",
|
"version": "1.3.1",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "10",
|
"minimum": "10",
|
||||||
"verified": "10"
|
"verified": "11",
|
||||||
|
"maximum": "11"
|
||||||
},
|
},
|
||||||
"authors": [{"name": "Byroks"}],
|
"authors": [{"name": "Byroks"}],
|
||||||
"scripts": ["bundle.js"],
|
"scripts": ["bundle.js"],
|
||||||
@@ -88,8 +89,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/v1.3.0/system.json",
|
"manifest": "https://github.com/Byroks/foundry-vtt-system-midgard5/releases/download/v1.3.1/system.json",
|
||||||
"download": "https://github.com/Byroks/foundry-vtt-system-midgard5/releases/download/v1.3.0/midgard5-v1.3.0.zip",
|
"download": "https://github.com/Byroks/foundry-vtt-system-midgard5/releases/download/v1.3.1/midgard5-v1.3.1.zip",
|
||||||
"initiative": "@calc.attributes.gw.value",
|
"initiative": "@c.calc.attributes.gw.value",
|
||||||
"license": "LICENSE.txt"
|
"license": "LICENSE.txt"
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{localize "ITEM.TypeEffect"}}</th>
|
<th>{{localize "TYPES.Item.effect"}}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{localize "ITEM.TypeWeapon"}}</th>
|
<th>{{localize "TYPES.Item.weapon"}}</th>
|
||||||
<th class="fixed-value">{{localize "midgard5.ew"}}</th>
|
<th class="fixed-value">{{localize "midgard5.ew"}}</th>
|
||||||
<th class="fixed-value"></th>
|
<th class="fixed-value"></th>
|
||||||
<th class="fixed-value"></th>
|
<th class="fixed-value"></th>
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{localize "ITEM.TypeArmor"}}</th>
|
<th>{{localize "TYPES.Item.armor"}}</th>
|
||||||
<th class="fixed-value">{{localize "midgard5.actor-lp-short"}}</th>
|
<th class="fixed-value">{{localize "midgard5.actor-lp-short"}}</th>
|
||||||
<th class="fixed-value">{{localize "midgard5.actor-ap-short"}}</th>
|
<th class="fixed-value">{{localize "midgard5.actor-ap-short"}}</th>
|
||||||
<th class="fixed-value">{{localize "midgard5.attackBonus-short"}}</th>
|
<th class="fixed-value">{{localize "midgard5.attackBonus-short"}}</th>
|
||||||
@@ -100,7 +100,7 @@
|
|||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{localize "ITEM.TypeItem"}}</th>
|
<th>{{localize "TYPES.Item.item"}}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{localize "ITEM.TypeSpell"}}</th>
|
<th>{{localize "TYPES.Item.spell"}}</th>
|
||||||
<th>{{localize "midgard5.ew"}}</th>
|
<th>{{localize "midgard5.ew"}}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
|
|||||||
Reference in New Issue
Block a user