Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
024f0b9c42 | ||
|
|
16df142d45 | ||
|
|
0bfa224dae | ||
|
|
35a6b0fae9 | ||
|
|
db21ca93b0 | ||
|
|
7bf0fd90b0 | ||
|
|
a7bdd0434e | ||
|
|
97d4a35cd6 | ||
|
|
c2996aa974 | ||
|
|
bf4f49755a | ||
|
|
57bffd492a |
+1
-1
@@ -5,4 +5,4 @@ package-lock.json
|
||||
source/packs/
|
||||
source/generators/
|
||||
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:
|
||||
|
||||
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.
|
||||
|
||||
|
||||
+1
-1
@@ -520,4 +520,4 @@ exports.clean = clean;
|
||||
exports.link = linkUserData;
|
||||
exports.package = packageBuild;
|
||||
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
@@ -1,14 +1,15 @@
|
||||
{
|
||||
"ACTOR.TypeCharacter": "Charakter",
|
||||
"TYPES.Actor.character": "Charakter",
|
||||
"ACTOR.TypeNpc": "Kreatur / Nichtspielerfigur",
|
||||
"ACTOR.TypeVehicle": "Transportmittel / Pferd etc.",
|
||||
|
||||
"ITEM.TypeItem": "Gegenstand",
|
||||
"ITEM.TypeWeapon": "Waffe",
|
||||
"TYPES.Item.item": "Gegenstand",
|
||||
"TYPES.Item.weapon": "Waffe",
|
||||
"ITEM.TypeDefensiveWeapon": "Verteidigungswaffe",
|
||||
"ITEM.TypeArmor": "Rüstung",
|
||||
"ITEM.TypeSpell": "Zauber",
|
||||
"ITEM.TypeEffect": "Aktive Effekte",
|
||||
"TYPES.Item.armor": "Rüstung",
|
||||
"TYPES.Item.spell": "Zauber",
|
||||
"TYPES.Item.effect": "Aktive Effekte",
|
||||
"ITEM.type.kampfkunst": "Kampfkünste",
|
||||
|
||||
"midgard5.doRoll": "Würfeln",
|
||||
"midgard5.learn": "Lernen",
|
||||
@@ -64,6 +65,7 @@
|
||||
"midgard5.gear": "Ausrüstung",
|
||||
"midgard5.spells": "Zauber",
|
||||
"midgard5.effects": "Aktive Effekte",
|
||||
"midgard5.kampfkuenste": "Kampfkünste",
|
||||
|
||||
"midgard5.class": "Klasse",
|
||||
"midgard5.race": "Rasse",
|
||||
@@ -195,6 +197,8 @@
|
||||
"midgard5.defensive-weapon": "Verteidigungswaffe",
|
||||
"midgard5.no-skill": "Keine Fertigkeit",
|
||||
"midgard5.magic": "magisch",
|
||||
"midgard5.equipped": "Ausgerüstet",
|
||||
"midgard5.active": "Aktiv",
|
||||
"midgard5.rangedWeapon": "Schusswaffe",
|
||||
"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-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-add": "Addieren",
|
||||
"midgard5.mod-operation-set": "Basiswert",
|
||||
|
||||
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "foundry-system-midgard5",
|
||||
"version": "1.3.0",
|
||||
"version": "2.1.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"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,
|
||||
"spellBonus": 0
|
||||
},
|
||||
"equippable": false,
|
||||
"equipped": true,
|
||||
"equipped": false,
|
||||
"attributeMod": {
|
||||
"st": 0,
|
||||
"gs": 0,
|
||||
|
||||
@@ -11,7 +11,9 @@ const preloadTemplates = async (): Promise<Handlebars.TemplateDelegate<any>[]> =
|
||||
"sheets/character/skills.hbs",
|
||||
"sheets/character/gear.hbs",
|
||||
"sheets/character/spells.hbs",
|
||||
"sheets/character/kampfkuenste.hbs",
|
||||
"sheets/character/effects.hbs",
|
||||
"sheets/partial/mod.hbs",
|
||||
"sheets/item/rolls.hbs",
|
||||
"chat/roll-m5.hbs",
|
||||
];
|
||||
|
||||
@@ -145,7 +145,7 @@ export interface M5CharacterCalculatedData {
|
||||
damageBonus: M5ModResult;
|
||||
attackBonus: M5ModResult;
|
||||
defenseBonus: M5ModResult;
|
||||
movementBonus: M5ModResult;
|
||||
movement: M5ModResult;
|
||||
resistanceMind: M5ModResult;
|
||||
resistanceBody: M5ModResult;
|
||||
spellCasting: M5ModResult;
|
||||
@@ -170,6 +170,7 @@ export interface M5CharacterCalculatedData {
|
||||
effects: {};
|
||||
};
|
||||
spells: {};
|
||||
kampfkuenste: {};
|
||||
}
|
||||
|
||||
export function enumKeys<O extends object, K extends keyof O = keyof O>(obj: O): K[] {
|
||||
|
||||
@@ -25,7 +25,17 @@ export class M5Character extends Actor {
|
||||
}
|
||||
|
||||
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 {
|
||||
let ret: M5CharacterCalculatedData = {
|
||||
level: 0,
|
||||
@@ -48,7 +58,7 @@ export class M5Character extends Actor {
|
||||
damageBonus: { value: 0, mods: [] },
|
||||
attackBonus: { value: 0, mods: [] },
|
||||
defenseBonus: { value: 0, mods: [] },
|
||||
movementBonus: { value: 0, mods: [] },
|
||||
movement: { value: 0, mods: [] },
|
||||
resistanceMind: { value: 0, mods: [] },
|
||||
resistanceBody: { value: 0, mods: [] },
|
||||
spellCasting: { value: 0, mods: [] },
|
||||
@@ -73,6 +83,7 @@ export class M5Character extends Actor {
|
||||
effects: {},
|
||||
},
|
||||
spells: {},
|
||||
kampfkuenste: {},
|
||||
} as M5CharacterCalculatedData;
|
||||
|
||||
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.attackBonus = this.modResult(ret.attributes.gs.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(
|
||||
(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.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.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);
|
||||
|
||||
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) => {
|
||||
const mods = item.system.mods;
|
||||
//console.log("Actor item mods", mods)
|
||||
@@ -155,6 +166,7 @@ export class M5Character extends Actor {
|
||||
label: label,
|
||||
magic: item.system.magic,
|
||||
calc: item.system.calc,
|
||||
equipped: item.system?.equipped,
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -174,6 +186,7 @@ export class M5Character extends Actor {
|
||||
label: label,
|
||||
magic: item.system.magic,
|
||||
calc: item.system.calc,
|
||||
equipped: item.system?.equipped,
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -256,6 +269,7 @@ export class M5Character extends Actor {
|
||||
label: label,
|
||||
magic: item.system.magic,
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -386,7 +416,7 @@ export class M5Character extends Actor {
|
||||
value: value,
|
||||
mods: [
|
||||
{
|
||||
item: (game as Game).i18n.localize("ACTOR.TypeCharacter"),
|
||||
item: (game as Game).i18n.localize("TYPES.Actor.character"),
|
||||
operation: M5ModOperation.SET,
|
||||
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 {
|
||||
private attributes = new Map<string, Array<M5ModPair>>()
|
||||
private stats = new Map<string, Array<M5ModPair>>()
|
||||
private skills = new Map<string, Array<M5ModPair>>()
|
||||
private attributes = new Map<string, Array<M5ModPair>>();
|
||||
private stats = new Map<string, Array<M5ModPair>>();
|
||||
private skills = new Map<string, Array<M5ModPair>>();
|
||||
|
||||
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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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_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.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.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.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.DAMAGE, operation: M5ModOperation.SET, value: calc.stats.damageBonus.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_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.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.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);
|
||||
}
|
||||
|
||||
push(mod: M5ItemMod, source: string) {
|
||||
if (!mod?.id || mod.id === "")
|
||||
return
|
||||
if (!mod?.id || mod.id === "") return;
|
||||
|
||||
let map: Map<string, Array<M5ModPair>> = null
|
||||
if (mod.type === M5ModType.ATTRIBUTE)
|
||||
map = this.attributes
|
||||
else if (mod.type === M5ModType.STAT)
|
||||
map = this.stats
|
||||
else if (mod.type === M5ModType.SKILL)
|
||||
map = this.skills
|
||||
let map: Map<string, Array<M5ModPair>> = null;
|
||||
if (mod.type === M5ModType.ATTRIBUTE) map = this.attributes;
|
||||
else if (mod.type === M5ModType.STAT) map = this.stats;
|
||||
else if (mod.type === M5ModType.SKILL) map = this.skills;
|
||||
|
||||
if (map) {
|
||||
const pair: M5ModPair = {
|
||||
mod: mod,
|
||||
source: source
|
||||
}
|
||||
source: source,
|
||||
};
|
||||
|
||||
if (map.has(mod.id))
|
||||
map.get(mod.id).push(pair)
|
||||
else
|
||||
map.set(mod.id, [pair])
|
||||
if (map.has(mod.id)) map.get(mod.id).push(pair);
|
||||
else map.set(mod.id, [pair]);
|
||||
}
|
||||
}
|
||||
|
||||
calculate() {
|
||||
const calc = this.calc
|
||||
const calc = this.calc;
|
||||
|
||||
this.attributes.forEach((pairs, id) => {
|
||||
const res = M5ModAggregate.processPairs(pairs)
|
||||
const res = M5ModAggregate.processPairs(pairs);
|
||||
calc.attributes[id] = {
|
||||
value: res.value,
|
||||
bonus: M5ModAggregate.attributeBonus(res.value),
|
||||
mods: res.mods
|
||||
} as M5AttributeCalculated
|
||||
mods: res.mods,
|
||||
} as M5AttributeCalculated;
|
||||
//console.log("calc.attributes." + id, calc.attributes[id])
|
||||
})
|
||||
});
|
||||
|
||||
this.stats.forEach((pairs, id) => {
|
||||
const res = M5ModAggregate.processPairs(pairs)
|
||||
calc.stats[id] = res
|
||||
})
|
||||
const res = M5ModAggregate.processPairs(pairs);
|
||||
calc.stats[id] = res;
|
||||
});
|
||||
|
||||
const ret = {}
|
||||
const ret = {};
|
||||
this.skills.forEach((pairs, id) => {
|
||||
ret[id] = pairs
|
||||
})
|
||||
ret[id] = pairs;
|
||||
});
|
||||
|
||||
return ret
|
||||
return ret;
|
||||
}
|
||||
|
||||
static pairAsSource(pair: M5ModPair): M5ModSource {
|
||||
return {
|
||||
operation: pair.mod.operation,
|
||||
value: pair.mod.value,
|
||||
item: pair.source
|
||||
}
|
||||
item: pair.source,
|
||||
};
|
||||
}
|
||||
|
||||
static processPairs(arr: Array<M5ModPair>): M5ModResult {
|
||||
let ret: M5ModResult = {
|
||||
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 pair = mods.length === 0 ? null : mods[0]
|
||||
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];
|
||||
|
||||
if (pair) {
|
||||
ret.mods.push(this.pairAsSource(pair))
|
||||
ret.value = pair.mod.value
|
||||
ret.mods.push(this.pairAsSource(pair));
|
||||
ret.value = pair.mod.value;
|
||||
} 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) {
|
||||
ret.mods.push(this.pairAsSource(mods[0]))
|
||||
ret.value = mods[0].mod.value
|
||||
ret.mods.push(this.pairAsSource(mods[0]));
|
||||
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) {
|
||||
ret.mods = ret.mods.concat(mods.map(this.pairAsSource))
|
||||
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.mods = ret.mods.concat(mods.map(this.pairAsSource));
|
||||
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));
|
||||
}
|
||||
|
||||
mods = arr.filter(pair => pair.mod.operation === M5ModOperation.ADD)
|
||||
mods = arr.filter((pair) => pair.mod.operation === M5ModOperation.ADD);
|
||||
if (mods.length !== 0) {
|
||||
ret.mods = ret.mods.concat(mods.map(this.pairAsSource))
|
||||
const bonus = mods.map(p => p.mod.value).reduce((a, b) => a + b, 0)
|
||||
ret.value = Math.max(0, ret.value + bonus)
|
||||
ret.mods = ret.mods.concat(mods.map(this.pairAsSource));
|
||||
const bonus = mods.map((p) => p.mod.value).reduce((a, b) => a + b, 0);
|
||||
ret.value = Math.max(0, ret.value + bonus);
|
||||
}
|
||||
}
|
||||
|
||||
return ret
|
||||
return ret;
|
||||
}
|
||||
|
||||
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) {
|
||||
if (value > 95)
|
||||
return 2
|
||||
if (value > 80)
|
||||
return 1
|
||||
if (value > 20)
|
||||
return 0
|
||||
if (value > 5)
|
||||
return -1
|
||||
return -2
|
||||
if (value > 95) return 2;
|
||||
if (value > 80) return 1;
|
||||
if (value > 20) return 0;
|
||||
if (value > 5) return -1;
|
||||
return -2;
|
||||
}
|
||||
|
||||
//static modToString(mod: M5ItemMod): string { }
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export class M5Item extends Item {
|
||||
];
|
||||
|
||||
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) {
|
||||
pairs = pairs.concat(actorCalc.skillMods[itemId]);
|
||||
}
|
||||
@@ -65,7 +65,7 @@ export class M5Item extends Item {
|
||||
calc.combatSkills = null;
|
||||
|
||||
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) {
|
||||
calc.ew += actorCalc.stats.attackBonus.value;
|
||||
calc.combatSkills = actorCalc.skills.combat;
|
||||
@@ -89,7 +89,7 @@ export class M5Item extends Item {
|
||||
calc.combatSkills = null;
|
||||
|
||||
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) {
|
||||
calc.ew += actorCalc.stats.defense.value + actorCalc.stats.defenseBonus.value;
|
||||
calc.combatSkills = actorCalc.skills.combat;
|
||||
@@ -105,16 +105,44 @@ export class M5Item extends Item {
|
||||
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") {
|
||||
calc.fw = 0;
|
||||
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) {
|
||||
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 = {};
|
||||
|
||||
Object.keys(itemData?.mods).forEach((key) => {
|
||||
const mod = itemData.mods[key];
|
||||
const modCalc = {};
|
||||
@@ -135,7 +163,7 @@ export class M5Item extends Item {
|
||||
}
|
||||
case M5ModType.SKILL: {
|
||||
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) {
|
||||
let category = (game as Game).i18n.localize("midgard5.skill");
|
||||
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);
|
||||
console.log(roll);
|
||||
return roll.toMessage();
|
||||
} else {
|
||||
ChatMessage.create({
|
||||
|
||||
@@ -181,7 +181,7 @@ export class M5Roll {
|
||||
};
|
||||
|
||||
rollData.rolls["0"] = {
|
||||
formula: "1d20 + @c.calc.stats.brawl + @c.calc.stats.attackBonus + @i.attackBonus",
|
||||
formula: "1d20 + @c.calc.stats.brawlEw",
|
||||
enabled: true,
|
||||
label: (game as Game).i18n.localize("midgard5.attack"),
|
||||
result: "",
|
||||
@@ -192,7 +192,7 @@ export class M5Roll {
|
||||
} as M5RollResult;
|
||||
|
||||
rollData.rolls["1"] = {
|
||||
formula: "1d6 - 4 + @c.calc.stats.damageBonus + @i.damageBonus",
|
||||
formula: "1d6 - 4 + @c.calc.stats.damageBonus.value",
|
||||
enabled: true,
|
||||
label: (game as Game).i18n.localize("midgard5.damage"),
|
||||
result: "",
|
||||
@@ -245,6 +245,27 @@ export class M5Roll {
|
||||
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) {
|
||||
const rollData = actor.getRollData() as M5RollData;
|
||||
rollData.i = {
|
||||
|
||||
@@ -160,6 +160,7 @@ export default class M5CharacterSheet extends ActorSheet {
|
||||
const context = this.actor as any;
|
||||
const item = context.items.get(itemId) as M5Item;
|
||||
await item.roll();
|
||||
this.render();
|
||||
});
|
||||
|
||||
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);
|
||||
|
||||
// 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 = {
|
||||
type: "Transfer",
|
||||
actorId: this.actor.id,
|
||||
|
||||
+6
-5
@@ -3,10 +3,11 @@
|
||||
"name": "midgard5",
|
||||
"title": "Midgard 5. Edition",
|
||||
"description": "The German RPG Midgard 5. Edition",
|
||||
"version": "1.3.0",
|
||||
"version": "2.1.0",
|
||||
"compatibility": {
|
||||
"minimum": "10",
|
||||
"verified": "10"
|
||||
"verified": "11",
|
||||
"maximum": "11"
|
||||
},
|
||||
"authors": [{"name": "Byroks"}],
|
||||
"scripts": ["bundle.js"],
|
||||
@@ -88,8 +89,8 @@
|
||||
"primaryTokenAttribute": "lp",
|
||||
"secondaryTokenAttribute": "ap",
|
||||
"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",
|
||||
"download": "https://github.com/Byroks/foundry-vtt-system-midgard5/releases/download/v1.3.0/midgard5-v1.3.0.zip",
|
||||
"initiative": "@calc.attributes.gw.value",
|
||||
"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/v2.1.0/midgard5-v2.1.0.zip",
|
||||
"initiative": "@c.calc.attributes.gw.value",
|
||||
"license": "LICENSE.txt"
|
||||
}
|
||||
+54
-2
@@ -145,7 +145,7 @@
|
||||
}
|
||||
},
|
||||
"Item": {
|
||||
"types": ["skill", "weapon", "defensiveWeapon", "armor", "spell", "item", "effect"],
|
||||
"types": ["skill", "weapon", "defensiveWeapon", "armor", "spell", "kampfkunst", "item", "effect"],
|
||||
"templates": {
|
||||
"itemDescription": {
|
||||
"description": ""
|
||||
@@ -232,6 +232,38 @@
|
||||
"geist": "midgard5.spell-target-geist",
|
||||
"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": {
|
||||
@@ -318,7 +350,8 @@
|
||||
"formulas": {},
|
||||
"output": ""
|
||||
},
|
||||
"calc": {}
|
||||
"calc": {},
|
||||
"mods": {}
|
||||
},
|
||||
"spell": {
|
||||
"templates": ["itemDescription", "spellSelection"],
|
||||
@@ -343,6 +376,25 @@
|
||||
"output": ""
|
||||
},
|
||||
"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": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,40 @@
|
||||
</tr>
|
||||
{{/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|}}
|
||||
{{#if roll.enabled}}
|
||||
<tr class="roll-row {{roll.css}}">
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<td>{{localize "midgard5.luckPoints"}}</td>
|
||||
<td><input name="data.gp" type="text" value="{{data.gp}}" data-dtype="Number" /></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>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{localize "ITEM.TypeEffect"}}</th>
|
||||
<th>{{localize "TYPES.Item.effect"}}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each data.calc.gear.effects as |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>
|
||||
</tr>
|
||||
{{/each}}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{localize "ITEM.TypeWeapon"}}</th>
|
||||
<th>{{localize "TYPES.Item.weapon"}}</th>
|
||||
<th class="fixed-value">{{localize "midgard5.ew"}}</th>
|
||||
<th class="fixed-value"></th>
|
||||
<th class="fixed-value"></th>
|
||||
@@ -71,7 +71,7 @@
|
||||
<table>
|
||||
<thead>
|
||||
<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-ap-short"}}</th>
|
||||
<th class="fixed-value">{{localize "midgard5.attackBonus-short"}}</th>
|
||||
@@ -84,7 +84,12 @@
|
||||
<tbody>
|
||||
{{#each data.calc.gear.armor as |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 "apProtection"}}</td>
|
||||
<td class="fixed-value">{{actorItemValue ../actor._id itemId "stats.attackBonus"}}</td>
|
||||
@@ -100,14 +105,19 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{localize "ITEM.TypeItem"}}</th>
|
||||
<th>{{localize "TYPES.Item.item"}}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each data.calc.gear.items as |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>
|
||||
</tr>
|
||||
{{/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>
|
||||
@@ -9,7 +9,10 @@
|
||||
<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="gear">{{ localize "midgard5.gear" }}</a>
|
||||
{{#if actor.system.info.magicUsing }}
|
||||
<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>
|
||||
</nav>
|
||||
|
||||
@@ -31,9 +34,12 @@
|
||||
{{> "systems/midgard5/templates/sheets/character/spells.hbs"}}
|
||||
</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">
|
||||
{{> "systems/midgard5/templates/sheets/character/effects.hbs"}}
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</form>
|
||||
@@ -1,7 +1,7 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{localize "ITEM.TypeSpell"}}</th>
|
||||
<th>{{localize "TYPES.Item.spell"}}</th>
|
||||
<th>{{localize "midgard5.ew"}}</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
|
||||
@@ -6,6 +6,21 @@
|
||||
<div class="sheet-content">
|
||||
<table>
|
||||
<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>
|
||||
<td>{{localize "midgard5.actor-lp"}}</td>
|
||||
<td><input name="data.lpProtection" type="text" value="{{data.lpProtection}}" data-dtype="Number" /></td>
|
||||
@@ -32,6 +47,9 @@
|
||||
</tbody>
|
||||
</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}}
|
||||
</div>
|
||||
</form>
|
||||
@@ -6,10 +6,20 @@
|
||||
<div class="sheet-content">
|
||||
<table>
|
||||
<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}}>
|
||||
<label for="data.magic">{{localize "midgard5.magic"}}</label>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="flexrow">
|
||||
<span>{{localize "midgard5.item-value"}}</span>
|
||||
@@ -19,59 +29,8 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<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>
|
||||
{{> "systems/midgard5/templates/sheets/partial/mod.hbs" mods=data.mods calc=data.calc}}
|
||||
|
||||
<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}}
|
||||
</div>
|
||||
|
||||
@@ -6,10 +6,20 @@
|
||||
<div class="sheet-content">
|
||||
<table>
|
||||
<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}}>
|
||||
<label for="data.magic">{{localize "midgard5.magic"}}</label>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="flexrow">
|
||||
<span>{{localize "midgard5.item-value"}}</span>
|
||||
@@ -19,59 +29,8 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<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>
|
||||
{{> "systems/midgard5/templates/sheets/partial/mod.hbs" mods=data.mods calc=data.calc}}
|
||||
|
||||
<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}}
|
||||
</div>
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user