Compare commits

...
11 Commits
Author SHA1 Message Date
Byroks 024f0b9c42 Squashed commit of the following:
commit 250fc499ae
Author: Byroks <byroks@gmail.com>
Date:   Thu Nov 30 16:17:04 2023 +0100

    v2.1.0

commit 28595e7dd0
Author: Byroks <byroks@gmail.com>
Date:   Thu Nov 30 15:50:59 2023 +0100

    Make Items with mods equippable (#11)

    Changes:
     + Items that can influence you stats are equippable
     + only equipped items influence your stats
     + Armor now influences your stats
     + move mods into a partial for easier changes

commit 8095785fc2
Author: Byroks <byroks@gmail.com>
Date:   Wed Nov 29 10:14:49 2023 +0100

    Movement stat (#10)

    Changes:
     + make movement stat work and be moddable by effects

commit e141839055
Merge: 14e005c 0bfa224
Author: Byroks <byroks@gmail.com>
Date:   Tue Nov 28 19:50:38 2023 +0100

    Merge branch 'main' into develop

commit 14e005cb0a
Author: Byroks <byroks@gmail.com>
Date:   Tue Nov 28 19:48:14 2023 +0100

    v2.0.0

commit c635c54f24
Author: Byroks <byroks@gmail.com>
Date:   Tue Nov 28 19:42:38 2023 +0100

    Dev Kampfkünste Items & Integration (#7)

    Changes:
     + add kampfkuenste template
     + add kampfkuenste tab
     + make kampfkuenste rollable
     + update localization

commit e27f4209e5
Author: Byroks <byroks@gmail.com>
Date:   Mon Nov 27 20:05:20 2023 +0100

    Squashed commit of the following:

    commit 0bfa224dae
    Author: Byroks <byroks@gmail.com>
    Date:   Mon Nov 27 19:56:05 2023 +0100

        V1.3.1 (#6)

        * v1.3.1

        * v1.3.1

        * update .gitingore

    commit 35a6b0fae9
    Author: Byroks <byroks@gmail.com>
    Date:   Mon Nov 27 19:48:56 2023 +0100

        v1.3.1

    commit db21ca93b0
    Author: Byroks <byroks@gmail.com>
    Date:   Sun Nov 26 13:13:13 2023 +0100

        subtract ap when casting spell

        Changes:
         + subtract AP when casting a spell
2023-11-30 16:19:25 +01:00
ByroksandGitHub 16df142d45 v2.0.0 (#8)
* Squashed commit of the following:

commit 0bfa224dae
Author: Byroks <byroks@gmail.com>
Date:   Mon Nov 27 19:56:05 2023 +0100

    V1.3.1 (#6)

    * v1.3.1

    * v1.3.1

    * update .gitingore

commit 35a6b0fae9
Author: Byroks <byroks@gmail.com>
Date:   Mon Nov 27 19:48:56 2023 +0100

    v1.3.1

commit db21ca93b0
Author: Byroks <byroks@gmail.com>
Date:   Sun Nov 26 13:13:13 2023 +0100

    subtract ap when casting spell

    Changes:
     + subtract AP when casting a spell

* Dev Kampfkünste Items & Integration (#7)

Changes:
 + add kampfkuenste template
 + add kampfkuenste tab
 + make kampfkuenste rollable
 + update localization

* v2.0.0
2023-11-28 19:50:56 +01:00
Byroks 0bfa224dae V1.3.1 (#6)
* v1.3.1

* v1.3.1

* update .gitingore
2023-11-27 20:04:06 +01:00
Byroks 35a6b0fae9 v1.3.1 2023-11-27 19:48:56 +01:00
Byroks db21ca93b0 subtract ap when casting spell
Changes:
 + subtract AP when casting a spell
2023-11-26 13:13:13 +01:00
Byroks 7bf0fd90b0 update verified and maximum version 2023-11-25 19:33:03 +01:00
Byroks a7bdd0434e Delete midgard5-v1.3.0.zip 2023-11-25 16:38:39 +01:00
Byroks 97d4a35cd6 update localize Keys
Changes:
 + update localize Keys, to conform with v11
2023-11-25 16:38:05 +01:00
Byroks c2996aa974 Fix Raufen roll
Changes:
 + fix roll attributes for Raufen
2023-11-25 16:04:17 +01:00
Byroks bf4f49755a adjust iniative roll
Changes:
 + fix iniative stat
2023-11-25 15:54:53 +01:00
ByroksandGitHub 57bffd492a Update de.md 2023-11-25 14:20:47 +01:00
29 changed files with 630 additions and 257 deletions
+1 -1
View File
@@ -5,4 +5,4 @@ package-lock.json
source/packs/ source/packs/
source/generators/ source/generators/
dist dist
midgard5*.zip *.zip
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -520,4 +520,4 @@ exports.clean = clean;
exports.link = linkUserData; exports.link = linkUserData;
exports.package = packageBuild; exports.package = packageBuild;
exports.update = updateManifest; exports.update = updateManifest;
exports.publish = gulp.series(clean, updateManifest, execBuild, bundleModule, packageBuild, gitTaskManifest, gitTaskBuild); exports.publish = gulp.series(clean, updateManifest, execBuild, bundleModule, packageBuild, gitTaskManifest);
+39 -6
View File
@@ -1,14 +1,15 @@
{ {
"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",
"ITEM.type.kampfkunst": "Kampfkünste",
"midgard5.doRoll": "Würfeln", "midgard5.doRoll": "Würfeln",
"midgard5.learn": "Lernen", "midgard5.learn": "Lernen",
@@ -64,6 +65,7 @@
"midgard5.gear": "Ausrüstung", "midgard5.gear": "Ausrüstung",
"midgard5.spells": "Zauber", "midgard5.spells": "Zauber",
"midgard5.effects": "Aktive Effekte", "midgard5.effects": "Aktive Effekte",
"midgard5.kampfkuenste": "Kampfkünste",
"midgard5.class": "Klasse", "midgard5.class": "Klasse",
"midgard5.race": "Rasse", "midgard5.race": "Rasse",
@@ -195,6 +197,8 @@
"midgard5.defensive-weapon": "Verteidigungswaffe", "midgard5.defensive-weapon": "Verteidigungswaffe",
"midgard5.no-skill": "Keine Fertigkeit", "midgard5.no-skill": "Keine Fertigkeit",
"midgard5.magic": "magisch", "midgard5.magic": "magisch",
"midgard5.equipped": "Ausgerüstet",
"midgard5.active": "Aktiv",
"midgard5.rangedWeapon": "Schusswaffe", "midgard5.rangedWeapon": "Schusswaffe",
"midgard5.assignItemToCharacter": "Füge Gegenstand einem Charakter hinzu, um Fähigkeit auwählen zu können", "midgard5.assignItemToCharacter": "Füge Gegenstand einem Charakter hinzu, um Fähigkeit auwählen zu können",
@@ -238,6 +242,35 @@
"midgard5.spell-effectDuration": "Wirkungsdauer", "midgard5.spell-effectDuration": "Wirkungsdauer",
"midgard5.spell-origin": "Ursprung", "midgard5.spell-origin": "Ursprung",
"midgard5.kampfkunst-type": "Kampfkunst Art",
"midgard5.kampfkunst-variante": "Kampfkunst Variante",
"midgard5.kido-type": "Kido Art",
"midgard5.kido-variante": "Kido Variante",
"midgard5.kampfkunst-type-angriff": "Angriffstechnik",
"midgard5.kampfkunst-type-verteidigung": "Verteidigungstechnik",
"midgard5.kampfkunst-type-finte": "Finte",
"midgard5.kampfkunst-type-geist": "Geistestechnik",
"midgard5.kampfkunst-type-schießkunst": "Schießkunst",
"midgard5.kampfkunst-type-fechten": "Fechtkunst",
"midgard5.kido-type-angriff": "Kido Angriffstechnik",
"midgard5.kido-type-verteidigung": "Kido Verteidigungstechnik",
"midgard5.kido-type-finte": "Kido Finte",
"midgard5.kido-type-leib": "Kido Leibestechnik",
"midgard5.kampfkunst-variante-anstuermen": "Anstürmen",
"midgard5.kampfkunst-variante-attackieren": "Attackieren",
"midgard5.kampfkunst-variante-entwaffnen": "Entwaffnen",
"midgard5.kido-variante-anspringen": "Anspringen",
"midgard5.kido-variante-attackieren": "Attackieren",
"midgard5.kido-variante-entwaffnen": "Entwaffnen",
"midgard5.kido-variante-werfen": "Werfen",
"midgard5.kido-variante-ausweichen": "Ausweichen",
"midgard5.kido-variante-blockieren": "Blockieren",
"midgard5.kido-variante-bewegen": "Bewegen",
"midgard5.kido-variante-kontrollieren": "Kontrollieren",
"midgard5.mod-operation-add100": "Addieren (max 100)", "midgard5.mod-operation-add100": "Addieren (max 100)",
"midgard5.mod-operation-add": "Addieren", "midgard5.mod-operation-add": "Addieren",
"midgard5.mod-operation-set": "Basiswert", "midgard5.mod-operation-set": "Basiswert",
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "foundry-system-midgard5", "name": "foundry-system-midgard5",
"version": "1.3.0", "version": "2.1.0",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
@@ -0,0 +1,33 @@
{
"name": "Kampfkunst",
"type": "kampfkunst",
"img": "icons/svg/item-bag.svg",
"data": {
"description": "",
"bonus": 0,
"type": "angriff",
"variante": "none",
"isKido": false,
"skillId": "",
"ap": 0,
"rolls": {
"formulas": {
"0": {
"formula": "1d20 + @i.calc.ew + @i.bonus",
"enabled": true,
"label": "Kampfkunst"
}
},
"output": ""
},
"calc": {}
},
"effects": [],
"folder": null,
"sort": 0,
"permission": {
"default": 0,
"XD0IpWT6bN4AJiYQ": 3
},
"_id": "HQ469FvZkwKfzFff"
}
@@ -13,8 +13,7 @@
"resistanceBody": 0, "resistanceBody": 0,
"spellBonus": 0 "spellBonus": 0
}, },
"equippable": false, "equipped": false,
"equipped": true,
"attributeMod": { "attributeMod": {
"st": 0, "st": 0,
"gs": 0, "gs": 0,
+2
View File
@@ -11,7 +11,9 @@ const preloadTemplates = async (): Promise<Handlebars.TemplateDelegate<any>[]> =
"sheets/character/skills.hbs", "sheets/character/skills.hbs",
"sheets/character/gear.hbs", "sheets/character/gear.hbs",
"sheets/character/spells.hbs", "sheets/character/spells.hbs",
"sheets/character/kampfkuenste.hbs",
"sheets/character/effects.hbs", "sheets/character/effects.hbs",
"sheets/partial/mod.hbs",
"sheets/item/rolls.hbs", "sheets/item/rolls.hbs",
"chat/roll-m5.hbs", "chat/roll-m5.hbs",
]; ];
+2 -1
View File
@@ -145,7 +145,7 @@ export interface M5CharacterCalculatedData {
damageBonus: M5ModResult; damageBonus: M5ModResult;
attackBonus: M5ModResult; attackBonus: M5ModResult;
defenseBonus: M5ModResult; defenseBonus: M5ModResult;
movementBonus: M5ModResult; movement: M5ModResult;
resistanceMind: M5ModResult; resistanceMind: M5ModResult;
resistanceBody: M5ModResult; resistanceBody: M5ModResult;
spellCasting: M5ModResult; spellCasting: M5ModResult;
@@ -170,6 +170,7 @@ export interface M5CharacterCalculatedData {
effects: {}; effects: {};
}; };
spells: {}; spells: {};
kampfkuenste: {};
} }
export function enumKeys<O extends object, K extends keyof O = keyof O>(obj: O): K[] { export function enumKeys<O extends object, K extends keyof O = keyof O>(obj: O): K[] {
+36 -6
View File
@@ -25,7 +25,17 @@ export class M5Character extends Actor {
} }
derivedData( derivedData(
skip: { mods?: boolean; skills?: boolean; weapons?: boolean; defensiveWeapons?: boolean; armor?: boolean; items?: boolean; spells?: boolean; effects?: boolean } = {} skip: {
mods?: boolean;
skills?: boolean;
weapons?: boolean;
defensiveWeapons?: boolean;
armor?: boolean;
items?: boolean;
spells?: boolean;
effects?: boolean;
kampfkuenste?: boolean;
} = {}
): M5CharacterCalculatedData { ): M5CharacterCalculatedData {
let ret: M5CharacterCalculatedData = { let ret: M5CharacterCalculatedData = {
level: 0, level: 0,
@@ -48,7 +58,7 @@ export class M5Character extends Actor {
damageBonus: { value: 0, mods: [] }, damageBonus: { value: 0, mods: [] },
attackBonus: { value: 0, mods: [] }, attackBonus: { value: 0, mods: [] },
defenseBonus: { value: 0, mods: [] }, defenseBonus: { value: 0, mods: [] },
movementBonus: { value: 0, mods: [] }, movement: { value: 0, mods: [] },
resistanceMind: { value: 0, mods: [] }, resistanceMind: { value: 0, mods: [] },
resistanceBody: { value: 0, mods: [] }, resistanceBody: { value: 0, mods: [] },
spellCasting: { value: 0, mods: [] }, spellCasting: { value: 0, mods: [] },
@@ -73,6 +83,7 @@ export class M5Character extends Actor {
effects: {}, effects: {},
}, },
spells: {}, spells: {},
kampfkuenste: {},
} as M5CharacterCalculatedData; } as M5CharacterCalculatedData;
const context = this as any; const context = this as any;
@@ -110,7 +121,7 @@ export class M5Character extends Actor {
ret.stats.damageBonus = this.modResult(Math.floor(ret.attributes.st.value / 20) + Math.floor(ret.attributes.gs.value / 30) - 3); ret.stats.damageBonus = this.modResult(Math.floor(ret.attributes.st.value / 20) + Math.floor(ret.attributes.gs.value / 30) - 3);
ret.stats.attackBonus = this.modResult(ret.attributes.gs.bonus); ret.stats.attackBonus = this.modResult(ret.attributes.gs.bonus);
ret.stats.defenseBonus = this.modResult(ret.attributes.gw.bonus); ret.stats.defenseBonus = this.modResult(ret.attributes.gw.bonus);
ret.stats.movementBonus = this.modResult(0); ret.stats.movement = this.modResult(data.movement);
ret.stats.resistanceMind = this.modResult( ret.stats.resistanceMind = this.modResult(
(data.info.magicUsing ? 2 : 0) + ret.stats.defense.value + (data.info.race === "Mensch" ? ret.attributes.in.bonus : this.raceBonus(data.info.race)) (data.info.magicUsing ? 2 : 0) + ret.stats.defense.value + (data.info.race === "Mensch" ? ret.attributes.in.bonus : this.raceBonus(data.info.race))
); );
@@ -119,7 +130,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);
@@ -127,7 +138,7 @@ export class M5Character extends Actor {
const aggregate = new M5ModAggregate(data, ret); const aggregate = new M5ModAggregate(data, ret);
context.items context.items
?.filter((item) => item.type === "item" || item.type === "effect") ?.filter((item) => (item.type === "item" || item.type === "effect" || item.type === "armor") && item.system.equipped)
.forEach((item) => { .forEach((item) => {
const mods = item.system.mods; const mods = item.system.mods;
//console.log("Actor item mods", mods) //console.log("Actor item mods", mods)
@@ -155,6 +166,7 @@ export class M5Character extends Actor {
label: label, label: label,
magic: item.system.magic, magic: item.system.magic,
calc: item.system.calc, calc: item.system.calc,
equipped: item.system?.equipped,
}; };
}); });
} }
@@ -174,6 +186,7 @@ export class M5Character extends Actor {
label: label, label: label,
magic: item.system.magic, magic: item.system.magic,
calc: item.system.calc, calc: item.system.calc,
equipped: item.system?.equipped,
}; };
}); });
} }
@@ -256,6 +269,7 @@ export class M5Character extends Actor {
label: label, label: label,
magic: item.system.magic, magic: item.system.magic,
calc: item.system.calc, calc: item.system.calc,
equipped: item.system?.equipped,
}; };
}); });
} }
@@ -274,6 +288,22 @@ export class M5Character extends Actor {
}); });
} }
if (!skip?.kampfkuenste) {
context.items
?.filter((item) => item.type === "kampfkunst")
.forEach((item) => {
item.prepareDerivedData();
ret.kampfkuenste[item.id] = {
label: item.name,
isKido: item.system.isKido,
type: item.system.type,
variante: item.system.variante,
calc: item.system.calc,
};
});
}
return ret; return ret;
} }
@@ -386,7 +416,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,
}, },
+81 -92
View File
@@ -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.movement.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 { }
} }
+41 -6
View File
@@ -31,7 +31,7 @@ export class M5Item extends Item {
]; ];
if (character) { if (character) {
const actorCalc = character.derivedData({ skills: true, weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true }); const actorCalc = character.derivedData({ skills: true, weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true, kampfkuenste: true });
if (actorCalc?.skillMods && Object.keys(actorCalc.skillMods).indexOf(itemId) !== -1) { if (actorCalc?.skillMods && Object.keys(actorCalc.skillMods).indexOf(itemId) !== -1) {
pairs = pairs.concat(actorCalc.skillMods[itemId]); pairs = pairs.concat(actorCalc.skillMods[itemId]);
} }
@@ -65,7 +65,7 @@ export class M5Item extends Item {
calc.combatSkills = null; calc.combatSkills = null;
if (actor) { if (actor) {
const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true }); const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true, kampfkuenste: true });
if (actorCalc) { if (actorCalc) {
calc.ew += actorCalc.stats.attackBonus.value; calc.ew += actorCalc.stats.attackBonus.value;
calc.combatSkills = actorCalc.skills.combat; calc.combatSkills = actorCalc.skills.combat;
@@ -89,7 +89,7 @@ export class M5Item extends Item {
calc.combatSkills = null; calc.combatSkills = null;
if (actor) { if (actor) {
const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true }); const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true, kampfkuenste: true });
if (actorCalc) { if (actorCalc) {
calc.ew += actorCalc.stats.defense.value + actorCalc.stats.defenseBonus.value; calc.ew += actorCalc.stats.defense.value + actorCalc.stats.defenseBonus.value;
calc.combatSkills = actorCalc.skills.combat; calc.combatSkills = actorCalc.skills.combat;
@@ -105,16 +105,44 @@ export class M5Item extends Item {
calc.fw += skillData.fw; calc.fw += skillData.fw;
} }
} }
} else if (itemType === "armor") {
itemData.mods[0] = { type: "stat", id: "defenseBonus", operation: "add", value: itemData.stats.defenseBonus };
itemData.mods[1] = { type: "stat", id: "attackBonus", operation: "add", value: itemData.stats.attackBonus };
itemData.mods[2] = { type: "stat", id: "movement", operation: "add", value: itemData.stats.movementBonus };
itemData.mods[3] = { type: "attribute", id: "gw", operation: "add100", value: itemData.attributeMod.gw };
} else if (itemType === "spell") { } else if (itemType === "spell") {
calc.fw = 0; calc.fw = 0;
if (actor) { if (actor) {
const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true }); const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true, kampfkuenste: true });
if (actorCalc) { if (actorCalc) {
calc.ew = actorCalc.stats.spellCasting.value; calc.ew = actorCalc.stats.spellCasting.value;
} }
} }
} else if (itemType === "item" || itemType === "effect") { } else if (itemType === "kampfkunst") {
calc.fw = 0;
calc.bonus = 0;
calc.ew = 0;
calc.generalSkills = null;
if (actor) {
const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true, kampfkuenste: true });
if (actorCalc) {
calc.generalSkills = actorCalc.skills.general;
}
const skill = character.getItem(itemData.skillId);
if (skill) {
skill.prepareDerivedData();
const skillData = skill.system;
calc.ew = skillData.calc.ew;
calc.fw = skillData.fw + calc.bonus;
itemData.rolls.formulas[0].label = skill.name;
}
}
}
if (itemData?.mods) {
calc.mods = {}; calc.mods = {};
Object.keys(itemData?.mods).forEach((key) => { Object.keys(itemData?.mods).forEach((key) => {
const mod = itemData.mods[key]; const mod = itemData.mods[key];
const modCalc = {}; const modCalc = {};
@@ -135,7 +163,7 @@ export class M5Item extends Item {
} }
case M5ModType.SKILL: { case M5ModType.SKILL: {
if (character) { if (character) {
const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true }); const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true, kampfkuenste: true });
if (actorCalc) { if (actorCalc) {
let category = (game as Game).i18n.localize("midgard5.skill"); let category = (game as Game).i18n.localize("midgard5.skill");
Object.keys(actorCalc.skills.general).forEach((skillId) => { Object.keys(actorCalc.skills.general).forEach((skillId) => {
@@ -215,7 +243,14 @@ 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);
console.log(roll);
return roll.toMessage(); return roll.toMessage();
} else { } else {
ChatMessage.create({ ChatMessage.create({
+23 -2
View File
@@ -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: "",
@@ -245,6 +245,27 @@ export class M5Roll {
return new M5Roll(rollData, actor, (game as Game).i18n.localize("midgard5.resistanceMind")); return new M5Roll(rollData, actor, (game as Game).i18n.localize("midgard5.resistanceMind"));
} }
static async initativeRoll(actor: any) {
let newInitiative; // the initiative value for the combatant
// ...
// The intnitiative value is calculated here
// ...
let combatant = game["combat"].getCombatantByActor(actor._id);
if (!combatant) {
await game["combat"].createEmbeddedDocuments("Combatant", [{ actorId: actor._id }]);
combatant = game["combat"].getCombatantByActor(actor._id);
}
const initiatives = {
_id: combatant._id,
initiative: actor.system.calc.attributes.gw.value,
};
await game["combat"].updateEmbeddedDocuments("Combatant", [initiatives]);
}
static resistanceBody(actor: any) { static resistanceBody(actor: any) {
const rollData = actor.getRollData() as M5RollData; const rollData = actor.getRollData() as M5RollData;
rollData.i = { rollData.i = {
+2 -1
View File
@@ -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) => {
@@ -205,7 +206,7 @@ export default class M5CharacterSheet extends ActorSheet {
const item = this.actor.items.get(li.dataset.itemId); const item = this.actor.items.get(li.dataset.itemId);
// limit transfer on personal weapons/armour/gear // limit transfer on personal weapons/armour/gear
if (["skill", "item", "weapon", "defensiveWeapon", "armor", "spell", "effect"].includes(item.type)) { if (["skill", "item", "weapon", "defensiveWeapon", "armor", "spell", "effect", "kampfkunst"].includes(item.type)) {
const dragData = { const dragData = {
type: "Transfer", type: "Transfer",
actorId: this.actor.id, actorId: this.actor.id,
+6 -5
View File
@@ -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": "2.1.0",
"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/v2.1.0/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/v2.1.0/midgard5-v2.1.0.zip",
"initiative": "@calc.attributes.gw.value", "initiative": "@c.calc.attributes.gw.value",
"license": "LICENSE.txt" "license": "LICENSE.txt"
} }
+54 -2
View File
@@ -145,7 +145,7 @@
} }
}, },
"Item": { "Item": {
"types": ["skill", "weapon", "defensiveWeapon", "armor", "spell", "item", "effect"], "types": ["skill", "weapon", "defensiveWeapon", "armor", "spell", "kampfkunst", "item", "effect"],
"templates": { "templates": {
"itemDescription": { "itemDescription": {
"description": "" "description": ""
@@ -232,6 +232,38 @@
"geist": "midgard5.spell-target-geist", "geist": "midgard5.spell-target-geist",
"koerper": "midgard5.spell-target-koerper" "koerper": "midgard5.spell-target-koerper"
} }
},
"kampfkunstSelection": {
"kampfkunstTypeSelection": {
"angriff": "midgard5.kampfkunst-type-angriff",
"verteidigung": "midgard5.kampfkunst-type-verteidigung",
"finte": "midgard5.kampfkunst-type-finte",
"geist": "midgard5.kampfkunst-type-geist",
"schießkunst": "midgard5.kampfkunst-type-schießkunst",
"fechten": "midgard5.kampfkunst-type-fechten"
},
"kidoTypeSelection": {
"angriff": "midgard5.kido-type-angriff",
"verteidigung": "midgard5.kido-type-verteidigung",
"finte": "midgard5.kido-type-finte",
"leib": "midgard5.kido-type-leib"
},
"kampfkunstVarianteSelection": {
"anstuermen": "midgard5.kampfkunst-variante-anstuermen",
"attackieren": "midgard5.kampfkunst-variante-attackieren",
"entwaffnen": "midgard5.kampfkunst-variante-entwaffnen"
},
"kidoVarianteSelection": {
"none": "midgard5.spell-process-none",
"anspringen": "midgard5.kido-variante-anspringen",
"attackieren": "midgard5.kido-variante-attackieren",
"entwaffnen": "midgard5.kido-variante-entwaffnen",
"werfen": "midgard5.kido-variante-werfen",
"ausweichen": "midgard5.kido-variante-ausweichen",
"blockieren": "midgard5.kido-variante-blockieren",
"bewegen": "midgard5.kido-variante-bewegen",
"kontrollieren": "midgard5.kido-variante-kontrollieren"
}
} }
}, },
"skill": { "skill": {
@@ -318,7 +350,8 @@
"formulas": {}, "formulas": {},
"output": "" "output": ""
}, },
"calc": {} "calc": {},
"mods": {}
}, },
"spell": { "spell": {
"templates": ["itemDescription", "spellSelection"], "templates": ["itemDescription", "spellSelection"],
@@ -343,6 +376,25 @@
"output": "" "output": ""
}, },
"calc": {} "calc": {}
},
"kampfkunst": {
"templates": ["itemDescription", "kampfkunstSelection"],
"bonus": 0,
"type": "",
"variante": "",
"isKido": false,
"ap": "",
"rolls": {
"formulas": {
"0": {
"formula": "1d20 + @i.calc.ew + @i.bonus",
"label": "Kampfkunst",
"enabled": true
}
},
"output": ""
},
"calc": {}
} }
} }
} }
+34
View File
@@ -43,6 +43,40 @@
</tr> </tr>
{{/if}} {{/if}}
{{#if (eq iType "kampfkunst")}}
{{#unless i.isKido}}
<tr>
<td>{{localize "midgard5.actor-ap"}}</td>
<td class="roll-spell-details">{{i.ap}}</td>
</tr>
<tr>
<td>{{localize "midgard5.kampfkunst-type"}}</td>
<td class="roll-spell-details">{{localize (m5concat "midgard5.kampfkunst-type-" i.type)}}</td>
</tr>
{{#if (eq i.type "angriff")}}
<tr>
<td>{{localize "midgard5.kampfkunst-variante"}}</td>
<td class="roll-spell-details">{{localize (m5concat "midgard5.kampfkunst-variante-" i.variante)}}</td>
</tr>
{{/if}}
{{else}}
<tr>
<td>{{localize "midgard5.actor-ap"}}</td>
<td class="roll-spell-details">{{i.ap}}</td>
</tr>
<tr>
<td>{{localize "midgard5.kido-type"}}</td>
<td class="roll-spell-details">{{localize (m5concat "midgard5.kido-type-" i.type)}}</td>
</tr>
{{#if (eq i.type "angriff")}}
<tr>
<td>{{localize "midgard5.kido-variante"}}</td>
<td class="roll-spell-details">{{localize (m5concat "midgard5.kido-variante-" i.variante)}}</td>
</tr>
{{/if}}
{{/unless}}
{{/if}}
{{#each rolls as |roll index|}} {{#each rolls as |roll index|}}
{{#if roll.enabled}} {{#if roll.enabled}}
<tr class="roll-row {{roll.css}}"> <tr class="roll-row {{roll.css}}">
+1 -1
View File
@@ -56,7 +56,7 @@
<td>{{localize "midgard5.luckPoints"}}</td> <td>{{localize "midgard5.luckPoints"}}</td>
<td><input name="data.gp" type="text" value="{{data.gp}}" data-dtype="Number" /></td> <td><input name="data.gp" type="text" value="{{data.gp}}" data-dtype="Number" /></td>
<td>{{localize "Bewegungsweite"}}</td> <td>{{localize "Bewegungsweite"}}</td>
<td><input name="data.movement" type="text" value="{{data.movement}}" data-dtype="Number" /></td> <td><input name="data.movement" type="text" value="{{data.calc.stats.movement.value}}" data-dtype="Number" /></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
+7 -2
View File
@@ -1,14 +1,19 @@
<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>
<tbody> <tbody>
{{#each data.calc.gear.effects as |item itemId|}} {{#each data.calc.gear.effects as |item itemId|}}
<tr data-item="{{itemId}}"> <tr data-item="{{itemId}}">
<td class="padding edit-item">{{item.label}}</td> <td class="padding">
<span class="edit-item">{{item.label}}</span>
{{#if item.equipped}}
<span class="spell-process">{{localize "midgard5.active"}}</span>
{{/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}}
+15 -5
View File
@@ -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>
@@ -84,7 +84,12 @@
<tbody> <tbody>
{{#each data.calc.gear.armor as |item itemId|}} {{#each data.calc.gear.armor as |item itemId|}}
<tr data-item="{{itemId}}"> <tr data-item="{{itemId}}">
<td class="padding edit-item">{{item.label}}</td> <td class="padding">
<span class="edit-item">{{item.label}}</span>
{{#if item.equipped}}
<span class="spell-process">{{localize "midgard5.equipped"}}</span>
{{/if}}
</td>
<td class="fixed-value">{{actorItemValue ../actor._id itemId "lpProtection"}}</td> <td class="fixed-value">{{actorItemValue ../actor._id itemId "lpProtection"}}</td>
<td class="fixed-value">{{actorItemValue ../actor._id itemId "apProtection"}}</td> <td class="fixed-value">{{actorItemValue ../actor._id itemId "apProtection"}}</td>
<td class="fixed-value">{{actorItemValue ../actor._id itemId "stats.attackBonus"}}</td> <td class="fixed-value">{{actorItemValue ../actor._id itemId "stats.attackBonus"}}</td>
@@ -100,14 +105,19 @@
<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>
<tbody> <tbody>
{{#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 edit-item">{{item.label}}</td> <td class="padding">
<span class="edit-item">{{item.label}}</span>
{{#if item.equipped}}
<span class="spell-process">{{localize "midgard5.equipped"}}</span>
{{/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}}
@@ -0,0 +1,33 @@
<table>
<thead>
<tr>
<th>{{localize "ITEM.type.kampfkunst"}}</th>
<th>{{localize "midgard5.ew"}}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{{#each data.calc.kampfkuenste as |item itemId|}}
<tr data-item="{{itemId}}">
<td class="padding edit-item">
<span>{{item.label}}</span>
{{#if item.isKido}}
<span class="spell-process">{{localize (m5concat "midgard5.kido-type-" item.type)}}</span>
{{#unless (eq item.type "finte")}}
<span class="spell-process">({{localize (m5concat "midgard5.kido-variante-" item.variante)}})</span>
{{/unless}}
{{else}}
<span class="spell-process">{{localize (m5concat "midgard5.kampfkunst-type-" item.type)}}</span>
{{#if (eq item.type "angriff")}}
<span class="spell-process">({{localize (m5concat "midgard5.kampfkunst-variante-" item.variante)}})</span>
{{/if}}
{{/if}}
</td>
<td class="fixed-value">{{item.calc.ew}}</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>
+7 -1
View File
@@ -9,7 +9,10 @@
<a class="item active" data-tab="base_values">{{ localize "midgard5.base_values" }}</a> <a class="item active" data-tab="base_values">{{ localize "midgard5.base_values" }}</a>
<a class="item" data-tab="skills">{{ localize "midgard5.skills" }}</a> <a class="item" data-tab="skills">{{ localize "midgard5.skills" }}</a>
<a class="item" data-tab="gear">{{ localize "midgard5.gear" }}</a> <a class="item" data-tab="gear">{{ localize "midgard5.gear" }}</a>
{{#if actor.system.info.magicUsing }}
<a class="item" data-tab="spells">{{ localize "midgard5.spells" }}</a> <a class="item" data-tab="spells">{{ localize "midgard5.spells" }}</a>
{{/if}}
<a class="item" data-tab="kampfkuenste">{{ localize "midgard5.kampfkuenste" }}</a>
<a class="item" data-tab="effects">{{ localize "midgard5.effects" }}</a> <a class="item" data-tab="effects">{{ localize "midgard5.effects" }}</a>
</nav> </nav>
@@ -31,9 +34,12 @@
{{> "systems/midgard5/templates/sheets/character/spells.hbs"}} {{> "systems/midgard5/templates/sheets/character/spells.hbs"}}
</div> </div>
<div class="tab base_values flexcol" data-group="primary" data-tab="kampfkuenste">
{{> "systems/midgard5/templates/sheets/character/kampfkuenste.hbs"}}
</div>
<div class="tab base_values flexcol" data-group="primary" data-tab="effects"> <div class="tab base_values flexcol" data-group="primary" data-tab="effects">
{{> "systems/midgard5/templates/sheets/character/effects.hbs"}} {{> "systems/midgard5/templates/sheets/character/effects.hbs"}}
</div> </div>
</section> </section>
</form> </form>
+1 -1
View File
@@ -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>
+18
View File
@@ -6,6 +6,21 @@
<div class="sheet-content"> <div class="sheet-content">
<table> <table>
<tbody> <tbody>
<tr>
<td colspan="4">
<div class="flexrow">
<span>
<input id="data.equipped" type="checkbox" name="data.equipped" {{checked data.equipped}} />
<label for="data.equipped">{{localize "midgard5.equipped"}}</label>
</span>
<span>
<input id="data.magic" type="checkbox" name="data.magic" {{checked data.magic}} />
<label for="data.magic">{{localize "midgard5.magic"}}</label>
</span>
</div>
</td>
</tr>
<tr> <tr>
<td>{{localize "midgard5.actor-lp"}}</td> <td>{{localize "midgard5.actor-lp"}}</td>
<td><input name="data.lpProtection" type="text" value="{{data.lpProtection}}" data-dtype="Number" /></td> <td><input name="data.lpProtection" type="text" value="{{data.lpProtection}}" data-dtype="Number" /></td>
@@ -32,6 +47,9 @@
</tbody> </tbody>
</table> </table>
{{> "systems/midgard5/templates/sheets/partial/mod.hbs" mods=data.mods calc=data.calc}}
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}} {{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div> </div>
</form> </form>
+12 -53
View File
@@ -6,10 +6,20 @@
<div class="sheet-content"> <div class="sheet-content">
<table> <table>
<tr> <tr>
<td> <td colspan=4>
<div class="flexrow">
<span>
<input id="data.equipped" type="checkbox" name="data.equipped" {{checked data.equipped}}>
<label for="data.equipped">{{localize "midgard5.active"}}</label>
</span>
<span>
<input id="data.magic" type="checkbox" name="data.magic" {{checked data.magic}}> <input id="data.magic" type="checkbox" name="data.magic" {{checked data.magic}}>
<label for="data.magic">{{localize "midgard5.magic"}}</label> <label for="data.magic">{{localize "midgard5.magic"}}</label>
</span>
</div>
</td> </td>
</tr>
<tr>
<td> <td>
<div class="flexrow"> <div class="flexrow">
<span>{{localize "midgard5.item-value"}}</span> <span>{{localize "midgard5.item-value"}}</span>
@@ -19,59 +29,8 @@
</tr> </tr>
</table> </table>
<table> {{> "systems/midgard5/templates/sheets/partial/mod.hbs" mods=data.mods calc=data.calc}}
<thead>
<tr>
<th>Mods</th>
<th></th>
<th></th>
<th><button class="add-mod">+</button></th>
</tr>
</thead>
<tbody>
{{#each data.mods as |mod modId|}}
<tr>
<td>
<select class="select-mod-type" name="data.mods.{{modId}}.type" data-type="String">
{{#select mod.type}}
<option value="attribute">{{localize "midgard5.attribute"}}</option>
<option value="stat">{{localize "midgard5.bonus"}}</option>
<option value="skill">{{localize "midgard5.skill"}}</option>
{{/select}}
</select>
</td>
<td>
<select class="select-id" name="data.mods.{{modId}}.id" data-type="String">
{{#select mod.id}}
<option value="">{{localize "midgard5.no-skill"}}</option>
{{#each (lookup ../data.calc.mods modId) as |name key|}}
<option value="{{key}}">{{name}}</option>
{{/each}}
{{/select}}
</select>
</td>
<td>
<select class="select-mod-operation" name="data.mods.{{modId}}.operation" data-type="String">
{{#select mod.operation}}
{{#if (eq mod.type "attribute")}}
<option value="add100">{{localize "midgard5.mod-operation-add100"}}</option>
{{/if}}
<option value="add">{{localize "midgard5.mod-operation-add"}}</option>
<option value="set">{{localize "midgard5.mod-operation-set"}}</option>
<option value="fixed">{{localize "midgard5.mod-operation-fixed"}}</option>
{{/select}}
</select>
</td>
<td>
<input name="data.mods.{{modId}}.value" type="text" value="{{mod.value}}" data-dtype="Number" />
</td>
</tr>
{{/each}}
</tbody>
</table>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}} {{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div> </div>
+12 -53
View File
@@ -6,10 +6,20 @@
<div class="sheet-content"> <div class="sheet-content">
<table> <table>
<tr> <tr>
<td> <td colspan=4>
<div class="flexrow">
<span>
<input id="data.equipped" type="checkbox" name="data.equipped" {{checked data.equipped}}>
<label for="data.equipped">{{localize "midgard5.equipped"}}</label>
</span>
<span>
<input id="data.magic" type="checkbox" name="data.magic" {{checked data.magic}}> <input id="data.magic" type="checkbox" name="data.magic" {{checked data.magic}}>
<label for="data.magic">{{localize "midgard5.magic"}}</label> <label for="data.magic">{{localize "midgard5.magic"}}</label>
</span>
</div>
</td> </td>
</tr>
<tr>
<td> <td>
<div class="flexrow"> <div class="flexrow">
<span>{{localize "midgard5.item-value"}}</span> <span>{{localize "midgard5.item-value"}}</span>
@@ -19,59 +29,8 @@
</tr> </tr>
</table> </table>
<table> {{> "systems/midgard5/templates/sheets/partial/mod.hbs" mods=data.mods calc=data.calc}}
<thead>
<tr>
<th>Mods</th>
<th></th>
<th></th>
<th><button class="add-mod">+</button></th>
</tr>
</thead>
<tbody>
{{#each data.mods as |mod modId|}}
<tr>
<td>
<select class="select-mod-type" name="data.mods.{{modId}}.type" data-type="String">
{{#select mod.type}}
<option value="attribute">{{localize "midgard5.attribute"}}</option>
<option value="stat">{{localize "midgard5.bonus"}}</option>
<option value="skill">{{localize "midgard5.skill"}}</option>
{{/select}}
</select>
</td>
<td>
<select class="select-id" name="data.mods.{{modId}}.id" data-type="String">
{{#select mod.id}}
<option value="">{{localize "midgard5.no-skill"}}</option>
{{#each (lookup ../data.calc.mods modId) as |name key|}}
<option value="{{key}}">{{name}}</option>
{{/each}}
{{/select}}
</select>
</td>
<td>
<select class="select-mod-operation" name="data.mods.{{modId}}.operation" data-type="String">
{{#select mod.operation}}
{{#if (eq mod.type "attribute")}}
<option value="add100">{{localize "midgard5.mod-operation-add100"}}</option>
{{/if}}
<option value="add">{{localize "midgard5.mod-operation-add"}}</option>
<option value="set">{{localize "midgard5.mod-operation-set"}}</option>
<option value="fixed">{{localize "midgard5.mod-operation-fixed"}}</option>
{{/select}}
</select>
</td>
<td>
<input name="data.mods.{{modId}}.value" type="text" value="{{mod.value}}" data-dtype="Number" />
</td>
</tr>
{{/each}}
</tbody>
</table>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}} {{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div> </div>
+99
View File
@@ -0,0 +1,99 @@
<form class="item-sheet {{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-img" src="{{item.img}}" data-edit="img" title="{{item.name}}" />
<h1><input name="name" type="text" value="{{item.name}}" placeholder="Name" /></h1>
</header>
<div class="sheet-content">
<table>
<tbody>
<tr>
<td colspan=4>
<div class="flexrow">
<span>
<input id="data.isKido" type="checkbox" name="data.isKido" {{checked data.isKido}}>
<label for="data.isKido">{{localize "midgard5.kido"}}</label>
</span>
</div>
</td>
</tr>
<tr>
<td>{{localize "midgard5.bonus"}}</td>
<td><input name="data.bonus" type="text" value="{{data.bonus}}" data-dtype="Number" /></td>
<td>{{localize "midgard5.actor-ap"}}</td>
<td><input name="data.ap" type="text" value="{{data.ap}}" data-dtype="String" /></td>
</tr>
<tr>
{{#unless item.system.isKido}}
<td>{{localize "midgard5.kampfkunst-type"}}</td>
<td>
<select class="select-type" name="data.type" data-type="String">
{{#select data.type}}
{{#each data.kampfkunstTypeSelection as |label key|}}
<option value="{{key}}">{{localize label}}</option>
{{/each}}
{{/select}}
</select>
</td>
{{else}}
<td>{{localize "midgard5.kido-type"}}</td>
<td>
<select class="select-type" name="data.type" data-type="String">
{{#select data.type}}
{{#each data.kidoTypeSelection as |label key|}}
<option value="{{key}}">{{localize label}}</option>
{{/each}}
{{/select}}
</select>
</td>
{{/unless}}
{{#unless item.system.isKido}}
{{#if (eq item.system.type "angriff")}}
<td>{{localize "midgard5.kampfkunst-variante"}}</td>
<td>
<select class="select-variante" name="data.variante" data-type="String">
{{#select data.variante}}
{{#each data.kampfkunstVarianteSelection as |label key|}}
<option value="{{key}}">{{localize label}}</option>
{{/each}}
{{/select}}
</select>
</td>
{{/if}}
{{else}}
{{#unless (eq item.system.type "finte")}}
<td>{{localize "midgard5.kido-variante"}}</td>
<td>
<select class="select-variante" name="data.variante" data-type="String">
{{#select data.variante}}
{{#each data.kidoVarianteSelection as |label key|}}
<option value="{{key}}">{{localize label}}</option>
{{/each}}
{{/select}}
</select>
</td>
{{/unless}}
{{/unless}}
</tr>
<td>{{localize "midgard5.skill"}}</td>
<td>
{{!-- {{#if data.calc.skills.general}} --}}
<select class="select-skill" name="data.skillId" data-type="String">
{{#select data.skillId}}
<option value="">{{localize "midgard5.no-skill"}}</option>
{{#each data.calc.generalSkills as |skill key|}}
<option value="{{key}}">{{skill.label}}</option>
{{/each}}
{{/select}}
</select>
{{else}}
<span>{{localize "midgard5.assignItemToCharacter"}}</span>
{{/if}}
</td>
</tbody>
</table>
{{> "systems/midgard5/templates/sheets/item/rolls.hbs"}}
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
</form>
+53
View File
@@ -0,0 +1,53 @@
<table>
<thead>
<tr>
<th>Mods</th>
<th></th>
<th></th>
<th><button class="add-mod">+</button></th>
</tr>
</thead>
<tbody>
{{#each mods as |mod modId|}}
<tr>
<td>
<select class="select-mod-type" name="data.mods.{{modId}}.type" data-type="String">
{{#select mod.type}}
<option value="attribute">{{localize "midgard5.attribute"}}</option>
<option value="stat">{{localize "midgard5.bonus"}}</option>
<option value="skill">{{localize "midgard5.skill"}}</option>
{{/select}}
</select>
</td>
<td>
<select class="select-id" name="data.mods.{{modId}}.id" data-type="String">
{{#select mod.id}}
<option value="">{{localize "midgard5.no-skill"}}</option>
{{#each (lookup ../calc.mods modId) as |name key|}}
<option value="{{key}}">{{name}}</option>
{{/each}}
{{/select}}
</select>
</td>
<td>
<select class="select-mod-operation" name="data.mods.{{modId}}.operation" data-type="String">
{{#select mod.operation}}
{{#if (eq mod.type "attribute")}}
<option value="add100">{{localize "midgard5.mod-operation-add100"}}</option>
{{/if}}
<option value="add">{{localize "midgard5.mod-operation-add"}}</option>
<option value="set">{{localize "midgard5.mod-operation-set"}}</option>
<option value="fixed">{{localize "midgard5.mod-operation-fixed"}}</option>
{{/select}}
</select>
</td>
<td>
<input name="data.mods.{{modId}}.value" type="text" value="{{mod.value}}" data-dtype="Number" />
</td>
</tr>
{{/each}}
</tbody>
</table>