Add skills as items
This commit is contained in:
parent
ab59b19e56
commit
c7f6a38acf
12
lang/de.json
12
lang/de.json
|
|
@ -8,7 +8,16 @@
|
|||
"ITEM.TypeArmor": "Rüstung",
|
||||
"ITEM.TypeSpell": "Zauber",
|
||||
|
||||
"midgard5.roll": "Würfeln",
|
||||
"midgard5.learn": "Lernen",
|
||||
|
||||
"midgard5.description": "Beschreibung",
|
||||
"midgard5.attribute": "Leiteigenschaft",
|
||||
"midgard5.skill": "Fertigkeit",
|
||||
"midgard5.skill-value": "Fertigkeitswert",
|
||||
"midgard5.fw": "FW",
|
||||
"midgard5.bonus": "Bonus",
|
||||
"midgard5.ew": "EW",
|
||||
|
||||
"midgard5.item-value": "Wert",
|
||||
"midgard5.item-quantity": "Menge",
|
||||
|
|
@ -36,7 +45,6 @@
|
|||
"midgard5.actor-wk": "Wk",
|
||||
"midgard5.actor-wk-long": "Willenskraft",
|
||||
|
||||
"midgard5.bonus": "Bonus",
|
||||
"midgard5.aktuell": "Akt.",
|
||||
"midgard5.maximum": "Max.",
|
||||
"midgard5.attrvalue": "Wert",
|
||||
|
|
@ -48,7 +56,7 @@
|
|||
|
||||
"midgard5.class": "Klasse",
|
||||
"midgard5.race": "Rasse",
|
||||
"midgard5.magic_using": "zauberkundig",
|
||||
"midgard5.magicUsing": "zauberkundig",
|
||||
"midgard5.gender": "Geschlecht",
|
||||
"midgard5.weight": "Gewicht",
|
||||
"midgard5.height": "Größe",
|
||||
|
|
|
|||
|
|
@ -1,12 +1,22 @@
|
|||
import Logger from "./utils/Logger"
|
||||
import M5ItemSheet from "./module/sheets/M5ItemSheet"
|
||||
import M5CharacterSheet from "./module/sheets/M5CharacterSheet"
|
||||
import preloadTemplates from "./PreloadTemplates"
|
||||
import M5Character from "./module/actors/M5Character"
|
||||
import { M5Character } from "./module/actors/M5Character"
|
||||
import { M5Skill } from "./module/M5Base"
|
||||
import { M5ItemSheet } from "./module/sheets/M5ItemSheet"
|
||||
import { M5Item } from "./module/items/M5Item"
|
||||
|
||||
Hooks.once("init", async () => {
|
||||
Logger.log("M5 | Initialisierung Midgard 5")
|
||||
|
||||
Handlebars.registerHelper("eq", (lhs: any, rhs: any) => {
|
||||
return lhs === rhs
|
||||
})
|
||||
|
||||
Handlebars.registerHelper("array", (arr: any[], index: number) => {
|
||||
return arr[index]
|
||||
})
|
||||
|
||||
Handlebars.registerHelper("localizeMidgard", (str: string) => {
|
||||
const template = Handlebars.compile("{{localize value}}")
|
||||
return template({
|
||||
|
|
@ -14,6 +24,20 @@ Hooks.once("init", async () => {
|
|||
})
|
||||
})
|
||||
|
||||
Handlebars.registerHelper("skillBonus", (actorId: string, skill: M5Skill) => {
|
||||
const actor = (game as Game).actors.get(actorId) as M5Character
|
||||
if (!actor || !skill)
|
||||
console.log("Handlebars.skillBonus", actor, skill)
|
||||
return actor.skillBonus(skill).toString()
|
||||
})
|
||||
|
||||
Handlebars.registerHelper("skillEw", (actorId: string, skill: M5Skill) => {
|
||||
const actor = (game as Game).actors.get(actorId) as M5Character
|
||||
if (!actor || !skill)
|
||||
console.log("Handlebars.skillEw", actor, skill)
|
||||
return actor.skillEw(skill).toString()
|
||||
})
|
||||
|
||||
// Default Sheet für Items definieren und das Standardsheet deaktivieren
|
||||
Items.unregisterSheet("core", ItemSheet)
|
||||
Items.registerSheet("midgard5", M5ItemSheet, { makeDefault: true })
|
||||
|
|
@ -23,6 +47,7 @@ Hooks.once("init", async () => {
|
|||
Actors.registerSheet("midgard5", M5CharacterSheet, { makeDefault: true })
|
||||
|
||||
CONFIG.Actor.documentClass = M5Character
|
||||
CONFIG.Item.documentClass = M5Item
|
||||
|
||||
//RegisterSettings();
|
||||
await preloadTemplates()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
export interface M5Skill {
|
||||
fw: number
|
||||
attribute: string
|
||||
}
|
||||
|
||||
export interface M5SkillUnlearned extends M5Skill {
|
||||
initial: number
|
||||
}
|
||||
|
||||
export interface M5SkillLearned extends M5Skill {
|
||||
skill: string
|
||||
type: string
|
||||
}
|
||||
|
||||
export interface M5Attribute {
|
||||
value: number
|
||||
bonus: number
|
||||
}
|
||||
|
|
@ -1,16 +1,4 @@
|
|||
|
||||
export interface M5Skill {
|
||||
label: string
|
||||
skill: string
|
||||
attribute: string
|
||||
fw: number
|
||||
ew: number
|
||||
}
|
||||
|
||||
export interface M5Attribute {
|
||||
value: number
|
||||
bonus: number
|
||||
}
|
||||
import { M5Attribute, M5Skill, M5SkillLearned } from "../M5Base"
|
||||
|
||||
export interface M5CharacterCalculatedData {
|
||||
level: number,
|
||||
|
|
@ -29,10 +17,11 @@ export interface M5CharacterCalculatedData {
|
|||
enduranceBonus: number
|
||||
},
|
||||
skills: {
|
||||
general: {}
|
||||
}
|
||||
}
|
||||
|
||||
export default class M5Character extends Actor {
|
||||
export class M5Character extends Actor {
|
||||
|
||||
// constructor(
|
||||
// data: ConstructorParameters<typeof foundry.documents.BaseActor>[0],
|
||||
|
|
@ -61,7 +50,6 @@ export default class M5Character extends Actor {
|
|||
|
||||
prepareDerivedData() {
|
||||
const context = (this as any).data;
|
||||
//console.log(context)
|
||||
|
||||
context.data.calc = {
|
||||
level: 0,
|
||||
|
|
@ -79,7 +67,9 @@ export default class M5Character extends Actor {
|
|||
poisonResistance: 0,
|
||||
enduranceBonus: 0
|
||||
},
|
||||
skills: {}
|
||||
skills: {
|
||||
general: {}
|
||||
}
|
||||
} as M5CharacterCalculatedData
|
||||
|
||||
const data = context.data
|
||||
|
|
@ -98,10 +88,19 @@ export default class M5Character extends Actor {
|
|||
calc.stats.movementBonus = 0
|
||||
calc.stats.resistanceMind = calc.stats.defense
|
||||
calc.stats.resistanceBody = calc.stats.defense + 1
|
||||
calc.stats.spellCasting = M5Character.spellCastingFromLevel(calc.level) + M5Character.attributeBonus(data.attributes.zt)
|
||||
calc.stats.spellCasting = (data.info.magicUsing ? M5Character.spellCastingFromLevel(calc.level) : 3) + M5Character.attributeBonus(data.attributes.zt)
|
||||
calc.stats.brawl = Math.floor((st + gw) / 20)
|
||||
calc.stats.poisonResistance = 30 + Math.floor(ko / 2)
|
||||
calc.stats.enduranceBonus = Math.floor(ko/10) + Math.floor(st/20)
|
||||
|
||||
//console.log("prepareDerivedData", context)
|
||||
context.items?.filter(item => item.data.type === "skill").forEach(item => {
|
||||
calc.skills.general[item.data.name] = {
|
||||
fw: item.data.data.fw,
|
||||
attribute: item.data.data.attribute,
|
||||
id: item.data._id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
static readonly levelThreshold: Array<number> = [0, 100, 250, 500, 750, 1000, 1250, 1500, 1750, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 6000, 7000, 8000, 9000, 10000, 12500, 15000, 17500, 20000, 22500, 25000, 30000, 35000, 40000, 45000, 50000, 55000, 60000, 65000, 70000, 75000, 80000, 85000, 90000, 95000, 100000, 105000, 110000, 115000, 120000, 125000, 130000, 135000, 140000, 145000, 150000, 155000, 160000, 165000, 170000, 175000, 180000, 185000, 190000, 195000, 200000, 205000, 210000, 215000, 220000, 225000, 230000, 235000, 240000, 245000, 250000, 255000, 260000, 265000, 270000, 275000, 280000]
|
||||
|
|
@ -140,49 +139,20 @@ export default class M5Character extends Actor {
|
|||
return ret ? ret[1] : M5Character.spellCastingThreshold[M5Character.spellCastingThreshold.length - 1][1]
|
||||
}
|
||||
|
||||
attributeStrength() {
|
||||
const data = (this as any).data.data
|
||||
return M5Character.attributeMinMax(data.data.attributes.st)
|
||||
skillBonus(skill: M5Skill, skillName?: string) {
|
||||
const attribute = this.attribute(skill.attribute)
|
||||
let ret = attribute ? M5Character.attributeBonus(attribute) : 0
|
||||
return ret
|
||||
}
|
||||
|
||||
attributeDexterity() {
|
||||
const data = (this as any).data.data
|
||||
return M5Character.attributeMinMax(data.data.attributes.gs)
|
||||
skillEw(skill: M5Skill, skillName?: string) {
|
||||
const bonus = this.skillBonus(skill, skillName)
|
||||
return skill.fw + bonus
|
||||
}
|
||||
|
||||
attributeAgility() {
|
||||
const data = (this as any).data.data
|
||||
return M5Character.attributeMinMax(data.data.attributes.gw)
|
||||
}
|
||||
|
||||
attributeConstitution() {
|
||||
const data = (this as any).data.data
|
||||
return M5Character.attributeMinMax(data.data.attributes.ko)
|
||||
}
|
||||
|
||||
attributeIntelligence() {
|
||||
const data = (this as any).data.data
|
||||
return M5Character.attributeMinMax(data.data.attributes.in)
|
||||
}
|
||||
|
||||
attributeMagic() {
|
||||
const data = (this as any).data.data
|
||||
return M5Character.attributeMinMax(data.data.attributes.zt)
|
||||
}
|
||||
|
||||
attributeBeauty() {
|
||||
const data = (this as any).data.data
|
||||
return M5Character.attributeMinMax(data.data.attributes.au)
|
||||
}
|
||||
|
||||
attributeCharisma() {
|
||||
const data = (this as any).data.data
|
||||
return M5Character.attributeMinMax(data.data.attributes.pa)
|
||||
}
|
||||
|
||||
attributeWillpower() {
|
||||
const data = (this as any).data.data
|
||||
return M5Character.attributeMinMax(data.data.attributes.wk)
|
||||
attribute(name: string): M5Attribute {
|
||||
const context = (this as any).data
|
||||
return context.data.attributes[name]
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,65 @@
|
|||
import { M5Character } from "../actors/M5Character"
|
||||
import { M5Skill } from "../M5Base"
|
||||
|
||||
export class M5Item extends Item {
|
||||
static readonly SKILL = "skill"
|
||||
|
||||
getRollData() {
|
||||
if (!this.actor)
|
||||
return null
|
||||
|
||||
const actor = this.actor as any
|
||||
const context = (this as any).data
|
||||
|
||||
let ret = null
|
||||
if (context.type === "skill") {
|
||||
const character = actor as M5Character
|
||||
const actorData = actor.data.data
|
||||
const itemData = context.data as M5Skill
|
||||
|
||||
ret = {
|
||||
fw: itemData.fw,
|
||||
bonus: M5Character.attributeBonus(character.attribute(itemData.attribute))
|
||||
}
|
||||
} else {
|
||||
ret = actor.getRollData()
|
||||
ret.item = foundry.utils.deepClone(context.data)
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
async roll() {
|
||||
const item = (this as any).data
|
||||
|
||||
// Initialize chat data.
|
||||
const speaker = ChatMessage.getSpeaker({ actor: this.actor })
|
||||
const rollMode = (game as Game).settings.get('core', 'rollMode')
|
||||
const label = `[${item.type}] ${item.name}`
|
||||
|
||||
// If there's no roll data, send a chat message.
|
||||
if (!item.data.formula) {
|
||||
ChatMessage.create({
|
||||
speaker: speaker,
|
||||
rollMode: rollMode,
|
||||
flavor: label,
|
||||
content: item.data.description ?? ''
|
||||
})
|
||||
} else { // Otherwise, create a roll and send a chat message from it.
|
||||
// Retrieve roll data.
|
||||
const rollData = this.getRollData()
|
||||
|
||||
// Invoke the roll and submit it to chat.
|
||||
const roll = new Roll(item.data.formula, rollData)
|
||||
// If you need to store the value first, uncomment the next line.
|
||||
// let result = await roll.roll({async: true})
|
||||
roll.toMessage({
|
||||
speaker: speaker,
|
||||
rollMode: rollMode,
|
||||
flavor: label,
|
||||
})
|
||||
return roll
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
import Logger from "../../utils/Logger"
|
||||
import M5Character, { M5Attribute } from "../actors/M5Character"
|
||||
import { M5Character } from "../actors/M5Character"
|
||||
import { M5Item } from "../items/M5Item"
|
||||
import { M5SkillLearned, M5SkillUnlearned } from "../M5Base"
|
||||
|
||||
export default class M5CharacterSheet extends ActorSheet {
|
||||
|
||||
|
|
@ -27,7 +29,7 @@ export default class M5CharacterSheet extends ActorSheet {
|
|||
context.actor = actorData;
|
||||
context.data = actorData.data;
|
||||
|
||||
//console.log("Sheet Promise", context)
|
||||
//console.log("Sheet Promise", context.actor, context.data)
|
||||
return context
|
||||
})
|
||||
}
|
||||
|
|
@ -35,8 +37,29 @@ export default class M5CharacterSheet extends ActorSheet {
|
|||
override activateListeners(html: JQuery) {
|
||||
super.activateListeners(html)
|
||||
|
||||
html.find(".roll-button").on("click", async (event) => {
|
||||
html.find(".edit-skill").on("click", async (event) => {
|
||||
const row = event.target.parentElement
|
||||
let skillId = row.dataset["skill"]
|
||||
|
||||
const context = this.actor.data
|
||||
const item = context.items.get(skillId)
|
||||
item.sheet.render(true)
|
||||
})
|
||||
|
||||
html.find(".roll-learned-button").on("click", async (event) => {
|
||||
const row = event.target.parentElement.parentElement
|
||||
let skillId = row.dataset["skill"]
|
||||
|
||||
const actor = this.actor as any
|
||||
const context = this.actor.data
|
||||
const data = context.data
|
||||
|
||||
const item = context.items.get(skillId) as M5Item
|
||||
await item.roll()
|
||||
})
|
||||
|
||||
html.find(".roll-general-button").on("click", async (event) => {
|
||||
const row = event.target.parentElement.parentElement
|
||||
let skillName = row.dataset["skill"]
|
||||
|
||||
const actor = this.actor as M5Character
|
||||
|
|
@ -45,10 +68,10 @@ export default class M5CharacterSheet extends ActorSheet {
|
|||
|
||||
const skill = data.skills.general[skillName]
|
||||
const attribute = data.attributes[skill.attribute]
|
||||
console.log(skill, attribute)
|
||||
//console.log(skill, attribute)
|
||||
|
||||
const r = new Roll("1d20 + @fw + @bonus", {
|
||||
fw: skill.fw + 12,
|
||||
fw: skill.fw,
|
||||
bonus: M5Character.attributeBonus(attribute)
|
||||
})
|
||||
await r.evaluate().then(value => {
|
||||
|
|
@ -62,5 +85,38 @@ export default class M5CharacterSheet extends ActorSheet {
|
|||
return ChatMessage.create(chatData)
|
||||
})
|
||||
})
|
||||
|
||||
html.find(".learn-button").on("click", async (event) => {
|
||||
const row = event.target.parentElement.parentElement
|
||||
let skillName = row.dataset["skill"]
|
||||
|
||||
const data = this.actor.data.data
|
||||
const unlearnedSkill = data.skills.general[skillName] as M5SkillUnlearned
|
||||
|
||||
const itemData = {
|
||||
name: (game as Game).i18n.localize("midgard5." + skillName),
|
||||
type: "skill",
|
||||
data: {
|
||||
fw: unlearnedSkill.initial,
|
||||
attribute: unlearnedSkill.attribute,
|
||||
skill: skillName,
|
||||
type: "general"
|
||||
} as M5SkillLearned
|
||||
}
|
||||
|
||||
this.actor.createEmbeddedDocuments("Item", [itemData]).then(docs => {
|
||||
const item = docs[0]
|
||||
//console.log("createEmbeddedDocuments", item.data)
|
||||
})
|
||||
})
|
||||
|
||||
// Drag & Drop
|
||||
// const dragDropSkill = new DragDrop({
|
||||
// dragSelector: ".items-list .item",
|
||||
// dropSelector: ".sheet-body",
|
||||
// permissions: { dragstart: this._canDragStart.bind(this), drop: this._canDragDrop.bind(this) },
|
||||
// callbacks: { dragstart: this._onTransferItemDragStart.bind(this), drop: this._onTransferItemDrop.bind(this) },
|
||||
// })
|
||||
// dragDrop.bind(html[0])
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,40 @@
|
|||
export default class M5ItemSheet extends ItemSheet {
|
||||
|
||||
export class M5ItemSheet extends ItemSheet {
|
||||
|
||||
static get defaultOptions() {
|
||||
return mergeObject(super.defaultOptions, {
|
||||
width: 530,
|
||||
height: 340,
|
||||
classes: ["midgard5", "sheet", "item"]
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
get template() {
|
||||
return 'systems/midgard5/templates/sheets/m5Item-Sheet.hbs';
|
||||
//console.log("M5ItemSheet", this.item.data.type)
|
||||
const path = "systems/midgard5/templates/sheets/item"
|
||||
return `${path}/${this.item.data.type}.hbs`
|
||||
}
|
||||
|
||||
override getData(options?: Partial<ItemSheet.Options>): ItemSheet.Data<ItemSheet.Options> | Promise<ItemSheet.Data<ItemSheet.Options>> {
|
||||
return Promise.resolve(super.getData()).then(value => {
|
||||
const context = value as any
|
||||
|
||||
// Use a safe clone of the item data for further operations.
|
||||
const itemData = context.item.data
|
||||
|
||||
// Retrieve the roll data for TinyMCE editors.
|
||||
context.rollData = {}
|
||||
let actor = this.object?.parent ?? null
|
||||
if (actor) {
|
||||
context.rollData = actor.getRollData()
|
||||
}
|
||||
|
||||
// Add the actor's data to context.data for easier access, as well as flags.
|
||||
context.data = itemData.data
|
||||
context.flags = itemData.flags
|
||||
|
||||
return context
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,4 +40,18 @@
|
|||
text-align: right;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
td {
|
||||
&.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&.padding {
|
||||
padding: 0 1rem 0 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
input.skill {
|
||||
width: 5rem;
|
||||
}
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
"description": "",
|
||||
"class": "",
|
||||
"race": "",
|
||||
"magic_using": false,
|
||||
"magicUsing": false,
|
||||
"gender": "",
|
||||
"weight": "",
|
||||
"height": "",
|
||||
|
|
@ -81,59 +81,58 @@
|
|||
"skills": {
|
||||
"skills": {
|
||||
"preferredCombatSkill": "",
|
||||
"learned": [],
|
||||
"general": {
|
||||
"akrobatik": { "fw": 0, "attribute": "gw" },
|
||||
"alchimie": { "fw": 0, "attribute": "in" },
|
||||
"anfuehren": { "fw": 0, "attribute": "pa" },
|
||||
"athletik": { "fw": 0, "attribute": "st" },
|
||||
"balancieren": { "fw": 0, "attribute": "gw" },
|
||||
"beidhaendigerKampf": { "fw": 0, "attribute": "gs" },
|
||||
"beredsamkeit": { "fw": 0, "attribute": "pa" },
|
||||
"betaeuben": { "fw": 0, "attribute": "gs" },
|
||||
"bootfahren": { "fw": 0, "attribute": "gs" },
|
||||
"ersteHilfe": { "fw": 0, "attribute": "gs" },
|
||||
"etikette": { "fw": 0, "attribute": "in" },
|
||||
"fallenEntdecken": { "fw": 0, "attribute": "in" },
|
||||
"fallenmechanik": { "fw": 0, "attribute": "gs" },
|
||||
"faelschen": { "fw": 0, "attribute": "gs" },
|
||||
"fechten": { "fw": 0, "attribute": "gs" },
|
||||
"gassenwissen": { "fw": 0, "attribute": "in" },
|
||||
"gaukeln": { "fw": 0, "attribute": "gs" },
|
||||
"gelaendelauf": { "fw": 0, "attribute": "gw" },
|
||||
"geraetekunde": { "fw": 0, "attribute": "in" },
|
||||
"geschaeftssinn": { "fw": 0, "attribute": "in" },
|
||||
"gluecksspiel": { "fw": 0, "attribute": "gs" },
|
||||
"heilkunde": { "fw": 0, "attribute": "in" },
|
||||
"kampfInVollruestung": { "fw": 0, "attribute": "st" },
|
||||
"klettern": { "fw": 0, "attribute": "st" },
|
||||
"landeskunde": { "fw": 0, "attribute": "in" },
|
||||
"laufen": { "fw": 0, "attribute": "ko" },
|
||||
"lesenVonZauberschrift": { "fw": 0, "attribute": "in" },
|
||||
"meditieren": { "fw": 0, "attribute": "wk" },
|
||||
"menschenkenntnis": { "fw": 0, "attribute": "in" },
|
||||
"meucheln": { "fw": 0, "attribute": "gs" },
|
||||
"musizieren": { "fw": 0, "attribute": "gs" },
|
||||
"naturkunde": { "fw": 0, "attribute": "in" },
|
||||
"pflanzenkunde": { "fw": 0, "attribute": "in" },
|
||||
"reiten": { "fw": 0, "attribute": "gw" },
|
||||
"reiterkampf": { "fw": 0, "attribute": "gw" },
|
||||
"scharfschiessen": { "fw": 0, "attribute": "gs" },
|
||||
"schleichen": { "fw": 0, "attribute": "gw" },
|
||||
"schloesserOeffnen": { "fw": 0, "attribute": "gs" },
|
||||
"schwimmen": { "fw": 0, "attribute": "gw" },
|
||||
"seilkunst": { "fw": 0, "attribute": "gs" },
|
||||
"spurensuche": { "fw": 0, "attribute": "in" },
|
||||
"stehlen": { "fw": 0, "attribute": "gs" },
|
||||
"tarnen": { "fw": 0, "attribute": "gw" },
|
||||
"tauchen": { "fw": 0, "attribute": "ko" },
|
||||
"tierkunde": { "fw": 0, "attribute": "in" },
|
||||
"ueberleben": { "fw": 0, "attribute": "in" },
|
||||
"verfuehren": { "fw": 0, "attribute": "pa" },
|
||||
"verhoeren": { "fw": 0, "attribute": "pa" },
|
||||
"verstellen": { "fw": 0, "attribute": "pa" },
|
||||
"wagenlenken": { "fw": 0, "attribute": "gs" },
|
||||
"zauberkunde": { "fw": 0, "attribute": "in" }
|
||||
"akrobatik": { "fw": 6, "attribute": "gw", "initial": 8 },
|
||||
"alchimie": { "fw": 0, "attribute": "in", "initial": 8 },
|
||||
"anfuehren": { "fw": 6, "attribute": "pa", "initial": 8 },
|
||||
"athletik": { "fw": 0, "attribute": "st", "initial": 8 },
|
||||
"balancieren": { "fw": 6, "attribute": "gw", "initial": 8 },
|
||||
"beidhaendigerKampf": { "fw": 0, "attribute": "gs", "initial": 8 },
|
||||
"beredsamkeit": { "fw": 3, "attribute": "pa", "initial": 8 },
|
||||
"betaeuben": { "fw": 6, "attribute": "gs", "initial": 8 },
|
||||
"bootfahren": { "fw": 3, "attribute": "gs", "initial": 8 },
|
||||
"ersteHilfe": { "fw": 0, "attribute": "gs", "initial": 8 },
|
||||
"etikette": { "fw": 0, "attribute": "in", "initial": 8 },
|
||||
"fallenEntdecken": { "fw": 0, "attribute": "in", "initial": 8 },
|
||||
"fallenmechanik": { "fw": 0, "attribute": "gs", "initial": 8 },
|
||||
"faelschen": { "fw": 0, "attribute": "gs", "initial": 8 },
|
||||
"fechten": { "fw": 0, "attribute": "gs", "initial": 8 },
|
||||
"gassenwissen": { "fw": 0, "attribute": "in", "initial": 8 },
|
||||
"gaukeln": { "fw": 0, "attribute": "gs", "initial": 8 },
|
||||
"gelaendelauf": { "fw": 6, "attribute": "gw", "initial": 8 },
|
||||
"geraetekunde": { "fw": 0, "attribute": "in", "initial": 8 },
|
||||
"geschaeftssinn": { "fw": 0, "attribute": "in", "initial": 8 },
|
||||
"gluecksspiel": { "fw": 0, "attribute": "gs", "initial": 8 },
|
||||
"heilkunde": { "fw": 0, "attribute": "in", "initial": 8 },
|
||||
"kampfInVollruestung": { "fw": 0, "attribute": "st", "initial": 8 },
|
||||
"klettern": { "fw": 6, "attribute": "st", "initial": 8 },
|
||||
"landeskunde": { "fw": 6, "attribute": "in", "initial": 8 },
|
||||
"laufen": { "fw": 0, "attribute": "ko", "initial": 8 },
|
||||
"lesenVonZauberschrift": { "fw": 0, "attribute": "in", "initial": 8 },
|
||||
"meditieren": { "fw": 0, "attribute": "wk", "initial": 8 },
|
||||
"menschenkenntnis": { "fw": 3, "attribute": "in", "initial": 8 },
|
||||
"meucheln": { "fw": 0, "attribute": "gs", "initial": 8 },
|
||||
"musizieren": { "fw": 0, "attribute": "gs", "initial": 8 },
|
||||
"naturkunde": { "fw": 0, "attribute": "in", "initial": 8 },
|
||||
"pflanzenkunde": { "fw": 0, "attribute": "in", "initial": 8 },
|
||||
"reiten": { "fw": 6, "attribute": "gw", "initial": 8 },
|
||||
"reiterkampf": { "fw": 0, "attribute": "gw", "initial": 8 },
|
||||
"scharfschiessen": { "fw": 0, "attribute": "gs", "initial": 8 },
|
||||
"schleichen": { "fw": 3, "attribute": "gw", "initial": 8 },
|
||||
"schloesserOeffnen": { "fw": 0, "attribute": "gs", "initial": 8 },
|
||||
"schwimmen": { "fw": 3, "attribute": "gw", "initial": 8 },
|
||||
"seilkunst": { "fw": 3, "attribute": "gs", "initial": 8 },
|
||||
"spurensuche": { "fw": 0, "attribute": "in", "initial": 8 },
|
||||
"stehlen": { "fw": 3, "attribute": "gs", "initial": 8 },
|
||||
"tarnen": { "fw": 3, "attribute": "gw", "initial": 8 },
|
||||
"tauchen": { "fw": 6, "attribute": "ko", "initial": 8 },
|
||||
"tierkunde": { "fw": 0, "attribute": "in", "initial": 8 },
|
||||
"ueberleben": { "fw": 6, "attribute": "in", "initial": 8 },
|
||||
"verfuehren": { "fw": 3, "attribute": "pa", "initial": 8 },
|
||||
"verhoeren": { "fw": 3, "attribute": "pa", "initial": 8 },
|
||||
"verstellen": { "fw": 3, "attribute": "pa", "initial": 8 },
|
||||
"wagenlenken": { "fw": 3, "attribute": "gs", "initial": 8 },
|
||||
"zauberkunde": { "fw": 0, "attribute": "in", "initial": 8 }
|
||||
},
|
||||
"combat": {}
|
||||
}
|
||||
|
|
@ -150,10 +149,10 @@
|
|||
}
|
||||
},
|
||||
"Item": {
|
||||
"types": ["item", "weapon", "armor", "spell"],
|
||||
"types": ["skill", "item", "weapon", "armor", "spell"],
|
||||
"templates": {
|
||||
"itemDescription": {
|
||||
"description": " "
|
||||
"description": ""
|
||||
},
|
||||
"stats": {
|
||||
"damageBonus": 0,
|
||||
|
|
@ -163,7 +162,28 @@
|
|||
"resistanceMind": 0,
|
||||
"resistanceBody": 0,
|
||||
"spellBonus": 0
|
||||
},
|
||||
"attributeSelection": {
|
||||
"attributes": {
|
||||
"st": { "short": "midgard5.actor-st", "long": "midgard5.actor-st-long" },
|
||||
"gs": { "short": "midgard5.actor-gs", "long": "midgard5.actor-gs-long" },
|
||||
"gw": { "short": "midgard5.actor-gw", "long": "midgard5.actor-gw-long" },
|
||||
"ko": { "short": "midgard5.actor-ko", "long": "midgard5.actor-ko-long" },
|
||||
"in": { "short": "midgard5.actor-in", "long": "midgard5.actor-in-long" },
|
||||
"zt": { "short": "midgard5.actor-zt", "long": "midgard5.actor-zt-long" },
|
||||
"au": { "short": "midgard5.actor-au", "long": "midgard5.actor-au-long" },
|
||||
"pa": { "short": "midgard5.actor-pa", "long": "midgard5.actor-pa-long" },
|
||||
"wk": { "short": "midgard5.actor-wk", "long": "midgard5.actor-wk-long" }
|
||||
}
|
||||
}
|
||||
},
|
||||
"skill": {
|
||||
"templates": ["itemDescription", "attributeSelection"],
|
||||
"fw": 0,
|
||||
"attribute": "st",
|
||||
"skill": "",
|
||||
"type": "general",
|
||||
"formula": "1d20 + @fw + @bonus"
|
||||
},
|
||||
"item": {
|
||||
"templates": ["itemDescription"],
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
<div class="flexrow">
|
||||
<span class="flex0">{{localize "midgard5.class"}}</span>
|
||||
<input class="flex3" name="data.info.class" type="text" value="{{data.info.class}}" data-dtype="String" />
|
||||
<input id="data.info.magic_using" type="checkbox" name="data.info.magic_using" {{checked data.info.magic_using}}>
|
||||
<label class="flex0" for="data.info.magic_using">{{localize "midgard5.magic_using"}}</label>
|
||||
<input id="data.info.magicUsing" type="checkbox" name="data.info.magicUsing" {{checked data.info.magicUsing}}>
|
||||
<label class="flex0" for="data.info.magicUsing">{{localize "midgard5.magicUsing"}}</label>
|
||||
<span class="level-display">Grad {{data.calc.level}}</span>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,49 @@
|
|||
<h3>Ungelernte Fertigkeiten</h3>
|
||||
<ol class="attributes-list">
|
||||
{{#each actor.data.skills.general as |skill key|}}
|
||||
<li class="attribute flexrow" data-skill="{{key}}">
|
||||
<div class="roll-button">Roll </div>
|
||||
<span class="attribute-label flexrow" name="data.skills.{{key}}.label">{{localizeMidgard key}}</span>
|
||||
<div class="attribute-editbox flexrow">
|
||||
<input class="attribute-value" type="text" name="data.skills.general.{{key}}.fw" value="{{skill.fw}}" data-dtype="Number" readonly />
|
||||
</div>
|
||||
</li>
|
||||
<h3>Gelernte Fertigkeiten</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{localize "midgard5.skill"}}</th>
|
||||
<th>{{localize "midgard5.fw"}}</th>
|
||||
<th>{{localize "midgard5.bonus"}}</th>
|
||||
<th>{{localize "midgard5.ew"}}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each data.calc.skills.general as |skill label|}}
|
||||
<tr data-skill="{{skill.id}}">
|
||||
<td class="padding edit-skill">{{label}}</td>
|
||||
<td class="center">{{skill.fw}}</td>
|
||||
<td class="center">{{skillBonus ../actor._id skill}}</td>
|
||||
<td class="center">{{skillEw ../actor._id skill}}</td>
|
||||
<td><button class="roll-learned-button">{{localize "midgard5.roll"}}</button></td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</ol>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3>Ungelernte Fertigkeiten</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>{{localize "midgard5.skill"}}</th>
|
||||
<th>{{localize "midgard5.fw"}}</th>
|
||||
<th>{{localize "midgard5.bonus"}}</th>
|
||||
<th>{{localize "midgard5.ew"}}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each actor.data.skills.general as |skill key|}}
|
||||
<tr data-skill="{{key}}">
|
||||
<td><button class="learn-button">{{localize "midgard5.learn"}}</button></td>
|
||||
<td class="padding">{{localizeMidgard key}}</td>
|
||||
<td class="center">{{skill.fw}}</td>
|
||||
<td class="center">{{skillBonus ../actor._id skill}}</td>
|
||||
<td class="center">{{skillEw ../actor._id skill}}</td>
|
||||
<td><button class="roll-general-button">{{localize "midgard5.roll"}}</button></td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<form class="{{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">
|
||||
<div class="flexrow">
|
||||
<span>{{localize "midgard5.skill-value"}}</span>
|
||||
<input name="data.fw" type="text" value="{{data.fw}}" data-dtype="Number" />
|
||||
|
||||
<span>{{localize "midgard5.attribute"}}</span>
|
||||
<select class="select-attribute" name="data.attribute" data-type="String">
|
||||
{{#select data.attribute}}
|
||||
{{#each data.attributes as |attribute key|}}
|
||||
<option value="{{key}}">{{localize attribute.long}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||
</div>
|
||||
</form>
|
||||
Loading…
Reference in New Issue