From 76ca542cbbc05bcb89c1ddf098402c3d317a371e Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Wed, 4 Jan 2023 22:09:09 +0100 Subject: [PATCH] Initial Import --- lang/en.json | 12 +- modules/warhero-actor-sheet.js | 13 +- modules/warhero-actor.js | 82 ++++++------- modules/warhero-combat.js | 4 +- modules/warhero-commands.js | 14 +-- modules/warhero-hotbar.js | 4 +- modules/warhero-item-sheet.js | 22 ++-- modules/warhero-item.js | 16 +-- modules/warhero-main.js | 56 ++++----- modules/warhero-npc-sheet.js | 10 +- modules/warhero-roll-dialog.js | 14 +-- modules/warhero-token.js | 4 +- modules/warhero-utility.js | 102 ++++++++-------- system.json | 178 ++-------------------------- template.json | 93 ++++++--------- templates/item-armor-sheet.html | 66 ++--------- templates/item-condition-sheet.html | 37 +----- templates/item-equipment-sheet.html | 10 +- templates/item-feat-sheet.html | 35 ------ templates/item-money-sheet.html | 8 +- templates/item-poison-sheet.html | 4 +- templates/item-race-sheet.html | 4 +- templates/item-shield-sheet.html | 27 ++--- templates/item-skill-sheet.html | 87 +------------- templates/item-spell-sheet.html | 4 +- templates/item-weapon-sheet.html | 56 ++------- 26 files changed, 265 insertions(+), 697 deletions(-) delete mode 100644 templates/item-feat-sheet.html diff --git a/lang/en.json b/lang/en.json index 077404a..f1a771a 100644 --- a/lang/en.json +++ b/lang/en.json @@ -1,3 +1,13 @@ { - + "WH.conf.short": "Short", + "WH.conf.long": "Long", + "WH.conf.twohanded": "Two-Handed", + "WH.conf.shooting": "Shooting", + "WH.conf.throwing": "Throwing", + "WH.conf.lightarmor" : "Light", + "WH.conf.mediumarmor": "Medium", + "WH.conf.heavyarmor": "Heavy", + "WH.conf.lightshield": "Light", + "WH.conf.mediumshield": "Medium", + "WH.conf.towershield": "Tower" } \ No newline at end of file diff --git a/modules/warhero-actor-sheet.js b/modules/warhero-actor-sheet.js index b24299a..3e187cc 100644 --- a/modules/warhero-actor-sheet.js +++ b/modules/warhero-actor-sheet.js @@ -3,17 +3,17 @@ * @extends {ActorSheet} */ -import { CrucibleUtility } from "./crucible-utility.js"; +import { WarheroUtility } from "./warhero-utility.js"; /* -------------------------------------------- */ -export class CrucibleActorSheet extends ActorSheet { +export class WarheroActorSheet extends ActorSheet { /** @override */ static get defaultOptions() { return mergeObject(super.defaultOptions, { - classes: ["fvtt-crucible-rpg", "sheet", "actor"], - template: "systems/fvtt-crucible-rpg/templates/actor-sheet.html", + classes: ["fvtt-warhero", "sheet", "actor"], + template: "systems/fvtt-warhero/templates/actor-sheet.html", width: 960, height: 720, tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "skills" }], @@ -46,13 +46,10 @@ export class CrucibleActorSheet extends ActorSheet { equippedWeapons: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquippedWeapons()) ), equippedArmor: this.actor.getEquippedArmor(), equippedShield: this.actor.getEquippedShield(), - feats: duplicate(this.actor.getFeats()), subActors: duplicate(this.actor.getSubActors()), race: duplicate(this.actor.getRace()), moneys: duplicate(this.actor.getMoneys()), encCapacity: this.actor.getEncumbranceCapacity(), - saveRolls: this.actor.getSaveRoll(), - conditions: this.actor.getConditions(), description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}), notes: await TextEditor.enrichHTML(this.object.system.biodata.notes, {async: true}), containersTree: this.actor.containersTree, @@ -91,7 +88,7 @@ export class CrucibleActorSheet extends ActorSheet { // Delete Inventory Item html.find('.item-delete').click(ev => { const li = $(ev.currentTarget).parents(".item") - CrucibleUtility.confirmDelete(this, li) + WarheroUtility.confirmDelete(this, li) }) html.find('.item-add').click(ev => { let dataType = $(ev.currentTarget).data("type") diff --git a/modules/warhero-actor.js b/modules/warhero-actor.js index 76d9806..5c49b98 100644 --- a/modules/warhero-actor.js +++ b/modules/warhero-actor.js @@ -1,6 +1,6 @@ /* -------------------------------------------- */ -import { CrucibleUtility } from "./crucible-utility.js"; -import { CrucibleRollDialog } from "./crucible-roll-dialog.js"; +import { WarheroUtility } from "./warhero-utility.js"; +import { WarheroRollDialog } from "./warhero-roll-dialog.js"; /* -------------------------------------------- */ const coverBonusTable = { "nocover": 0, "lightcover": 2, "heavycover": 4, "entrenchedcover": 6 }; @@ -16,7 +16,7 @@ const __subkey2title = { * Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system. * @extends {Actor} */ -export class CrucibleActor extends Actor { +export class WarheroActor extends Actor { /* -------------------------------------------- */ /** @@ -43,7 +43,7 @@ export class CrucibleActor extends Actor { } if (data.type == 'character') { - const skills = await CrucibleUtility.loadCompendium("fvtt-crucible-rpg.skills"); + const skills = await WarheroUtility.loadCompendium("fvtt-warhero.skills"); data.items = skills.map(i => i.toObject()) } if (data.type == 'npc') { @@ -113,41 +113,41 @@ export class CrucibleActor extends Actor { /* -------------------------------------------- */ getMoneys() { let comp = this.items.filter(item => item.type == 'money'); - CrucibleUtility.sortArrayObjectsByName(comp) + WarheroUtility.sortArrayObjectsByName(comp) return comp; } /* -------------------------------------------- */ getFeats() { let comp = duplicate(this.items.filter(item => item.type == 'feat') || []); - CrucibleUtility.sortArrayObjectsByName(comp) + WarheroUtility.sortArrayObjectsByName(comp) return comp; } /* -------------------------------------------- */ getFeatsWithDie() { let comp = duplicate(this.items.filter(item => item.type == 'feat' && item.system.isfeatdie) || []); - CrucibleUtility.sortArrayObjectsByName(comp) + WarheroUtility.sortArrayObjectsByName(comp) return comp; } getFeatsWithSL() { let comp = duplicate(this.items.filter(item => item.type == 'feat' && item.system.issl) || []); - CrucibleUtility.sortArrayObjectsByName(comp) + WarheroUtility.sortArrayObjectsByName(comp) return comp; } /* -------------------------------------------- */ getLore() { let comp = duplicate(this.items.filter(item => item.type == 'spell') || []); - CrucibleUtility.sortArrayObjectsByName(comp) + WarheroUtility.sortArrayObjectsByName(comp) return comp; } getEquippedWeapons() { let comp = duplicate(this.items.filter(item => item.type == 'weapon' && item.system.equipped) || []); - CrucibleUtility.sortArrayObjectsByName(comp) + WarheroUtility.sortArrayObjectsByName(comp) return comp; } /* -------------------------------------------- */ getArmors() { let comp = duplicate(this.items.filter(item => item.type == 'armor') || []); - CrucibleUtility.sortArrayObjectsByName(comp) + WarheroUtility.sortArrayObjectsByName(comp) return comp; } getEquippedArmor() { @@ -160,7 +160,7 @@ export class CrucibleActor extends Actor { /* -------------------------------------------- */ getShields() { let comp = duplicate(this.items.filter(item => item.type == 'shield') || []); - CrucibleUtility.sortArrayObjectsByName(comp) + WarheroUtility.sortArrayObjectsByName(comp) return comp; } getEquippedShield() { @@ -190,13 +190,13 @@ export class CrucibleActor extends Actor { /* -------------------------------------------- */ getConditions() { let comp = duplicate(this.items.filter(item => item.type == 'condition') || []); - CrucibleUtility.sortArrayObjectsByName(comp) + WarheroUtility.sortArrayObjectsByName(comp) return comp; } /* -------------------------------------------- */ getWeapons() { let comp = duplicate(this.items.filter(item => item.type == 'weapon') || []); - CrucibleUtility.sortArrayObjectsByName(comp) + WarheroUtility.sortArrayObjectsByName(comp) return comp; } /* -------------------------------------------- */ @@ -212,9 +212,9 @@ export class CrucibleActor extends Actor { getSkills() { let comp = duplicate(this.items.filter(item => item.type == 'skill') || []) for (let skill of comp) { - CrucibleUtility.updateSkill(skill) + WarheroUtility.updateSkill(skill) } - CrucibleUtility.sortArrayObjectsByName(comp) + WarheroUtility.sortArrayObjectsByName(comp) return comp } @@ -273,17 +273,17 @@ export class CrucibleActor extends Actor { return { reflex: { "label": "Reflex Save", - "img": "systems/fvtt-crucible-rpg/images/icons/saves/reflex_save.webp", + "img": "systems/fvtt-warhero/images/icons/saves/reflex_save.webp", "value": this.system.abilities.agi.value + this.system.abilities.wit.value }, fortitude: { "label": "Fortitude Save", - "img": "systems/fvtt-crucible-rpg/images/icons/saves/fortitude_save.webp", + "img": "systems/fvtt-warhero/images/icons/saves/fortitude_save.webp", "value": this.system.abilities.str.value + this.system.abilities.con.value }, willpower: { "label": "Willpower Save", - "img": "systems/fvtt-crucible-rpg/images/icons/saves/will_save.webp", + "img": "systems/fvtt-warhero/images/icons/saves/will_save.webp", "value": this.system.abilities.int.value + this.system.abilities.cha.value } } @@ -309,7 +309,7 @@ export class CrucibleActor extends Actor { // Compute whole enc let enc = 0 for (let item of equipments) { - //item.data.idrDice = CrucibleUtility.getDiceFromLevel(Number(item.data.idr)) + //item.data.idrDice = WarheroUtility.getDiceFromLevel(Number(item.data.idr)) if (item.system.equipped) { if (item.system.iscontainer) { enc += item.system.contentsEnc @@ -343,8 +343,8 @@ export class CrucibleActor extends Actor { /* -------------------------------------------- */ async incDecHP(formula) { - let dmgRoll = new Roll(formula+"[crucible-orange]").roll({ async: false }) - await CrucibleUtility.showDiceSoNice(dmgRoll, game.settings.get("core", "rollMode")) + let dmgRoll = new Roll(formula+"[warhero-orange]").roll({ async: false }) + await WarheroUtility.showDiceSoNice(dmgRoll, game.settings.get("core", "rollMode")) let hp = duplicate(this.system.secondary.hp) hp.value = Number(hp.value) + Number(dmgRoll.total) this.update({ 'system.secondary.hp': hp }) @@ -431,7 +431,7 @@ export class CrucibleActor extends Actor { /* -------------------------------------------- */ syncRoll(rollData) { this.lastRollId = rollData.rollId; - CrucibleUtility.saveRollData(rollData); + WarheroUtility.saveRollData(rollData); } /* -------------------------------------------- */ @@ -540,7 +540,7 @@ export class CrucibleActor extends Actor { return } - let rollData = CrucibleUtility.getBasicRollData() + let rollData = WarheroUtility.getBasicRollData() rollData.alias = this.name rollData.actorImg = this.img rollData.actorId = this.id @@ -600,7 +600,7 @@ export class CrucibleActor extends Actor { ui.notifications.warn("You are targetting a token with a skill : please use a Weapon instead.") return } - CrucibleUtility.rollCrucible(rollData) + WarheroUtility.rollWarhero(rollData) } /* -------------------------------------------- */ @@ -612,7 +612,7 @@ export class CrucibleActor extends Actor { return } skill = duplicate(skill) - CrucibleUtility.updateSkill(skill) + WarheroUtility.updateSkill(skill) let abilityKey = skill.system.ability let rollData = this.getCommonRollData(abilityKey) rollData.mode = "skill" @@ -634,7 +634,7 @@ export class CrucibleActor extends Actor { let skill = this.items.find(item => item.name.toLowerCase() == weapon.system.skill.toLowerCase()) if (skill) { skill = duplicate(skill) - CrucibleUtility.updateSkill(skill) + WarheroUtility.updateSkill(skill) let abilityKey = skill.system.ability let rollData = this.getCommonRollData(abilityKey) rollData.mode = "weapon" @@ -644,8 +644,8 @@ export class CrucibleActor extends Actor { if (!rollData.forceDisadvantage) { // This is an attack, check if disadvantaged rollData.forceDisadvantage = this.isAttackDisadvantage() } - /*if (rollData.weapon.system.isranged && rollData.tokensDistance > CrucibleUtility.getWeaponMaxRange(rollData.weapon) ) { - ui.notifications.warn(`Your target is out of range of your weapon (max: ${CrucibleUtility.getWeaponMaxRange(rollData.weapon)} - current : ${rollData.tokensDistance})` ) + /*if (rollData.weapon.system.isranged && rollData.tokensDistance > WarheroUtility.getWeaponMaxRange(rollData.weapon) ) { + ui.notifications.warn(`Your target is out of range of your weapon (max: ${WarheroUtility.getWeaponMaxRange(rollData.weapon)} - current : ${rollData.tokensDistance})` ) return }*/ this.startRoll(rollData) @@ -663,7 +663,7 @@ export class CrucibleActor extends Actor { let skill = this.items.find(item => item.name.toLowerCase() == weapon.system.skill.toLowerCase()) if (skill) { skill = duplicate(skill) - CrucibleUtility.updateSkill(skill) + WarheroUtility.updateSkill(skill) let abilityKey = skill.system.ability let rollData = this.getCommonRollData(abilityKey) rollData.defenderTokenId = undefined // Cleanup @@ -693,10 +693,10 @@ export class CrucibleActor extends Actor { rollData.mode = "rangeddefense" if ( attackRollData) { rollData.attackRollData = duplicate(attackRollData) - rollData.effectiveRange = CrucibleUtility.getWeaponRange(attackRollData.weapon) + rollData.effectiveRange = WarheroUtility.getWeaponRange(attackRollData.weapon) rollData.tokensDistance = attackRollData.tokensDistance // QoL copy } - rollData.sizeDice = CrucibleUtility.getSizeDice(this.system.biodata.size) + rollData.sizeDice = WarheroUtility.getSizeDice(this.system.biodata.size) rollData.distanceBonusDice = 0 //Math.max(0, Math.floor((rollData.tokensDistance - rollData.effectiveRange) + 0.5)) rollData.hasCover = "none" rollData.situational = "none" @@ -731,36 +731,36 @@ export class CrucibleActor extends Actor { let messages = ["Armor applied"] if (rollData) { - if (CrucibleUtility.isArmorLight(armor) && CrucibleUtility.isWeaponPenetrating(rollData.attackRollData.weapon)) { + if (WarheroUtility.isArmorLight(armor) && WarheroUtility.isWeaponPenetrating(rollData.attackRollData.weapon)) { return { armorIgnored: true, nbSuccess: 0, messages: ["Armor ignored : Penetrating weapons ignore Light Armors."] } } - if (CrucibleUtility.isWeaponPenetrating(rollData.attackRollData.weapon)) { + if (WarheroUtility.isWeaponPenetrating(rollData.attackRollData.weapon)) { messages.push("Armor reduced by 1 (Penetrating weapon)") reduce = 1 } - if (CrucibleUtility.isWeaponLight(rollData.attackRollData.weapon)) { + if (WarheroUtility.isWeaponLight(rollData.attackRollData.weapon)) { messages.push("Armor with advantage (Light weapon)") advantage = true } - if (CrucibleUtility.isWeaponHeavy(rollData.attackRollData.weapon)) { + if (WarheroUtility.isWeaponHeavy(rollData.attackRollData.weapon)) { messages.push("Armor with disadvantage (Heavy weapon)") disadvantage = true } - if (CrucibleUtility.isWeaponHack(rollData.attackRollData.weapon)) { + if (WarheroUtility.isWeaponHack(rollData.attackRollData.weapon)) { messages.push("Armor reduced by 1 (Hack weapon)") reduce = 1 } - if (CrucibleUtility.isWeaponUndamaging(rollData.attackRollData.weapon)) { + if (WarheroUtility.isWeaponUndamaging(rollData.attackRollData.weapon)) { messages.push("Armor multiplied by 2 (Undamaging weapon)") multiply = 2 } } let diceColor = armor.system.absorprionroll - let armorResult = await CrucibleUtility.getRollTableFromDiceColor(diceColor, false) + let armorResult = await WarheroUtility.getRollTableFromDiceColor(diceColor, false) console.log("Armor log", armorResult) let armorValue = Math.max(0, (Number(armorResult.text) + reduce) * multiply) if (advantage || disadvantage) { - let armorResult2 = await CrucibleUtility.getRollTableFromDiceColor(diceColor, false) + let armorResult2 = await WarheroUtility.getRollTableFromDiceColor(diceColor, false) let armorValue2 = Math.max(0, (Number(armorResult2.text) + reduce) * multiply) if (advantage) { armorValue = (armorValue2 > armorValue) ? armorValue2 : armorValue @@ -801,7 +801,7 @@ export class CrucibleActor extends Actor { /* -------------------------------------------- */ async startRoll(rollData) { this.syncRoll(rollData) - let rollDialog = await CrucibleRollDialog.create(this, rollData) + let rollDialog = await WarheroRollDialog.create(this, rollData) rollDialog.render(true) } diff --git a/modules/warhero-combat.js b/modules/warhero-combat.js index 04a38be..7f60afe 100644 --- a/modules/warhero-combat.js +++ b/modules/warhero-combat.js @@ -1,7 +1,7 @@ -import { CrucibleUtility } from "./crucible-utility.js"; +import { WarheroUtility } from "./warhero-utility.js"; /* -------------------------------------------- */ -export class CrucibleCombat extends Combat { +export class WarheroCombat extends Combat { /* -------------------------------------------- */ async rollInitiative(ids, formula = undefined, messageOptions = {} ) { diff --git a/modules/warhero-commands.js b/modules/warhero-commands.js index d1a6566..0362e23 100644 --- a/modules/warhero-commands.js +++ b/modules/warhero-commands.js @@ -1,19 +1,19 @@ /* -------------------------------------------- */ -import { CrucibleUtility } from "./crucible-utility.js"; -import { CrucibleRollDialog } from "./crucible-roll-dialog.js"; +import { WarheroUtility } from "./warhero-utility.js"; +import { WarheroRollDialog } from "./warhero-roll-dialog.js"; /* -------------------------------------------- */ const __saveFirstToKey = { r: "reflex", f: "fortitude", w: "willpower"} /* -------------------------------------------- */ -export class CrucibleCommands { +export class WarheroCommands { static init() { if (!game.system.cruciblerpg.commands) { - const crucibleCommands = new CrucibleCommands(); - crucibleCommands.registerCommand({ path: ["/rtarget"], func: (content, msg, params) => CrucibleCommands.rollTarget(msg, params), descr: "Launch the target roll window" }); - crucibleCommands.registerCommand({ path: ["/rsave"], func: (content, msg, params) => CrucibleCommands.rollSave(msg, params), descr: "Performs a save roll" }); + const crucibleCommands = new WarheroCommands(); + crucibleCommands.registerCommand({ path: ["/rtarget"], func: (content, msg, params) => WarheroCommands.rollTarget(msg, params), descr: "Launch the target roll window" }); + crucibleCommands.registerCommand({ path: ["/rsave"], func: (content, msg, params) => WarheroCommands.rollSave(msg, params), descr: "Performs a save roll" }); game.system.cruciblerpg.commands = crucibleCommands; } } @@ -93,7 +93,7 @@ export class CrucibleCommands { if (command && command.func) { const result = command.func(content, msg, params); if (result == false) { - CrucibleCommands._chatAnswer(msg, command.descr); + WarheroCommands._chatAnswer(msg, command.descr); } return true; } diff --git a/modules/warhero-hotbar.js b/modules/warhero-hotbar.js index c7e2d5a..8fc3158 100644 --- a/modules/warhero-hotbar.js +++ b/modules/warhero-hotbar.js @@ -1,8 +1,8 @@ -export class CrucibleHotbar { +export class WarheroHotbar { static async addToHotbar(item, slot) { - let command = `game.system.cruciblerpg.CrucibleHotbar.rollMacro("${item.name}", "${item.type}");`; + let command = `game.system.cruciblerpg.WarheroHotbar.rollMacro("${item.name}", "${item.type}");`; let macro = game.macros.contents.find(m => (m.name === item.name) && (m.command === command)); if (!macro) { macro = await Macro.create({ diff --git a/modules/warhero-item-sheet.js b/modules/warhero-item-sheet.js index b942ed8..57b842e 100644 --- a/modules/warhero-item-sheet.js +++ b/modules/warhero-item-sheet.js @@ -1,17 +1,17 @@ -import { CrucibleUtility } from "./crucible-utility.js"; +import { WarheroUtility } from "./warhero-utility.js"; /** * Extend the basic ItemSheet with some very simple modifications * @extends {ItemSheet} */ -export class CrucibleItemSheet extends ItemSheet { +export class WarheroItemSheet extends ItemSheet { /** @override */ static get defaultOptions() { return mergeObject(super.defaultOptions, { - classes: ["fvtt-crucible-rpg", "sheet", "item"], - template: "systems/fvtt-crucible-rpg/templates/item-sheet.html", + classes: ["fvtt-warhero", "sheet", "item"], + template: "systems/fvtt-warhero/templates/item-sheet.html", dragDrop: [{ dragSelector: null, dropSelector: null }], width: 620, height: 550, @@ -50,7 +50,7 @@ export class CrucibleItemSheet extends ItemSheet { async getData() { if ( this.object.type == "skill") { - CrucibleUtility.updateSkill(this.object) + WarheroUtility.updateSkill(this.object) } let objectData = duplicate(this.object.system) @@ -63,8 +63,8 @@ export class CrucibleItemSheet extends ItemSheet { name: this.object.name, editable: this.isEditable, cssClass: this.isEditable ? "editable" : "locked", - weaponSkills: CrucibleUtility.getWeaponSkills(), - shieldSkills: CrucibleUtility.getShieldSkills(), + weaponSkills: WarheroUtility.getWeaponSkills(), + shieldSkills: WarheroUtility.getShieldSkills(), description: await TextEditor.enrichHTML(this.object.system.description, {async: true}), data: itemData, limited: this.object.limited, @@ -92,7 +92,7 @@ export class CrucibleItemSheet extends ItemSheet { /* -------------------------------------------- */ postItem() { - let chatData = duplicate(CrucibleUtility.data(this.item)); + let chatData = duplicate(WarheroUtility.data(this.item)); if (this.actor) { chatData.actor = { id: this.actor.id }; } @@ -107,8 +107,8 @@ export class CrucibleItemSheet extends ItemSheet { payload: chatData, }); - renderTemplate('systems/fvtt-crucible-rpg/templates/post-item.html', chatData).then(html => { - let chatOptions = CrucibleUtility.chatDataSetup(html); + renderTemplate('systems/fvtt-warhero/templates/post-item.html', chatData).then(html => { + let chatOptions = WarheroUtility.chatDataSetup(html); ChatMessage.create(chatOptions) }); } @@ -159,7 +159,7 @@ export class CrucibleItemSheet extends ItemSheet { /* -------------------------------------------- */ get template() { let type = this.item.type; - return `systems/fvtt-crucible-rpg/templates/item-${type}-sheet.html`; + return `systems/fvtt-warhero/templates/item-${type}-sheet.html`; } /* -------------------------------------------- */ diff --git a/modules/warhero-item.js b/modules/warhero-item.js index 6158d52..63e1b45 100644 --- a/modules/warhero-item.js +++ b/modules/warhero-item.js @@ -1,19 +1,19 @@ -import { CrucibleUtility } from "./crucible-utility.js"; +import { WarheroUtility } from "./warhero-utility.js"; export const defaultItemImg = { - skill: "systems/fvtt-crucible-rpg/images/icons/icon_skill.webp", - armor: "systems/fvtt-crucible-rpg/images/icons/icon_armour.webp", - weapon: "systems/fvtt-crucible-rpg/images/icons/icon_weapon.webp", - equipment: "systems/fvtt-crucible-rpg/images/icons/icon_equipment.webp", - race: "systems/fvtt-crucible-rpg/images/icons/icon_race.webp", - money: "systems/fvtt-crucible-rpg/images/icons/icon_money.webp", + skill: "systems/fvtt-warhero/images/icons/icon_skill.webp", + armor: "systems/fvtt-warhero/images/icons/icon_armour.webp", + weapon: "systems/fvtt-warhero/images/icons/icon_weapon.webp", + equipment: "systems/fvtt-warhero/images/icons/icon_equipment.webp", + race: "systems/fvtt-warhero/images/icons/icon_race.webp", + money: "systems/fvtt-warhero/images/icons/icon_money.webp", } /** * Extend the basic ItemSheet with some very simple modifications * @extends {ItemSheet} */ -export class CrucibleItem extends Item { +export class WarheroItem extends Item { constructor(data, context) { if (!data.img) { diff --git a/modules/warhero-main.js b/modules/warhero-main.js index a4c2a1c..d4204a1 100644 --- a/modules/warhero-main.js +++ b/modules/warhero-main.js @@ -1,5 +1,5 @@ /** - * Crucible system + * Warhero system * Author: Uberwald * Software License: Prop */ @@ -8,15 +8,15 @@ /* -------------------------------------------- */ // Import Modules -import { CrucibleActor } from "./crucible-actor.js"; -import { CrucibleItemSheet } from "./crucible-item-sheet.js"; -import { CrucibleActorSheet } from "./crucible-actor-sheet.js"; -import { CrucibleNPCSheet } from "./crucible-npc-sheet.js"; -import { CrucibleUtility } from "./crucible-utility.js"; -import { CrucibleCombat } from "./crucible-combat.js"; -import { CrucibleItem } from "./crucible-item.js"; -import { CrucibleHotbar } from "./crucible-hotbar.js" -import { CrucibleCommands } from "./crucible-commands.js" +import { WarheroActor } from "./warhero-actor.js"; +import { WarheroItemSheet } from "./warhero-item-sheet.js"; +import { WarheroActorSheet } from "./warhero-actor-sheet.js"; +import { WarheroNPCSheet } from "./warhero-npc-sheet.js"; +import { WarheroUtility } from "./warhero-utility.js"; +import { WarheroCombat } from "./warhero-combat.js"; +import { WarheroItem } from "./warhero-item.js"; +import { WarheroHotbar } from "./warhero-hotbar.js" +import { WarheroCommands } from "./warhero-commands.js" /* -------------------------------------------- */ /* Foundry VTT Initialization */ @@ -25,16 +25,16 @@ import { CrucibleCommands } from "./crucible-commands.js" /************************************************************************************/ Hooks.once("init", async function () { - console.log(`Initializing Crucible RPG`); + console.log(`Initializing Warhero RPG`); game.system.cruciblerpg = { - CrucibleHotbar, - CrucibleCommands + WarheroHotbar, + WarheroCommands } /* -------------------------------------------- */ // preload handlebars templates - CrucibleUtility.preloadHandlebarsTemplates(); + WarheroUtility.preloadHandlebarsTemplates(); /* -------------------------------------------- */ // Set an initiative formula for the system @@ -44,27 +44,27 @@ Hooks.once("init", async function () { }; /* -------------------------------------------- */ - game.socket.on("system.fvtt-crucible-rpg", data => { - CrucibleUtility.onSocketMesssage(data) + game.socket.on("system.fvtt-warhero", data => { + WarheroUtility.onSocketMesssage(data) }); /* -------------------------------------------- */ // Define custom Entity classes - CONFIG.Combat.documentClass = CrucibleCombat - CONFIG.Actor.documentClass = CrucibleActor - CONFIG.Item.documentClass = CrucibleItem - //CONFIG.Token.objectClass = CrucibleToken + CONFIG.Combat.documentClass = WarheroCombat + CONFIG.Actor.documentClass = WarheroActor + CONFIG.Item.documentClass = WarheroItem + //CONFIG.Token.objectClass = WarheroToken /* -------------------------------------------- */ // Register sheet application classes Actors.unregisterSheet("core", ActorSheet); - Actors.registerSheet("fvtt-crucible", CrucibleActorSheet, { types: ["character"], makeDefault: true }); - Actors.registerSheet("fvtt-crucible", CrucibleNPCSheet, { types: ["npc"], makeDefault: false }); + Actors.registerSheet("fvtt-crucible", WarheroActorSheet, { types: ["character"], makeDefault: true }); + Actors.registerSheet("fvtt-crucible", WarheroNPCSheet, { types: ["npc"], makeDefault: false }); Items.unregisterSheet("core", ItemSheet); - Items.registerSheet("fvtt-crucible", CrucibleItemSheet, { makeDefault: true }); + Items.registerSheet("fvtt-crucible", WarheroItemSheet, { makeDefault: true }); - CrucibleUtility.init() + WarheroUtility.init() }); /* -------------------------------------------- */ @@ -73,7 +73,7 @@ function welcomeMessage() { user: game.user.id, whisper: [game.user.id], content: `
- Welcome to the Crucible RPG. + Welcome to the Warhero RPG. ` }); } @@ -98,9 +98,9 @@ Hooks.once("ready", function () { } welcomeMessage(); - CrucibleUtility.ready() - CrucibleCommands.init() - CrucibleHotbar.initDropbar() + WarheroUtility.ready() + WarheroCommands.init() + WarheroHotbar.initDropbar() }) diff --git a/modules/warhero-npc-sheet.js b/modules/warhero-npc-sheet.js index 5485ace..e4d1c8c 100644 --- a/modules/warhero-npc-sheet.js +++ b/modules/warhero-npc-sheet.js @@ -3,17 +3,17 @@ * @extends {ActorSheet} */ -import { CrucibleUtility } from "./crucible-utility.js"; +import { WarheroUtility } from "./warhero-utility.js"; /* -------------------------------------------- */ -export class CrucibleNPCSheet extends ActorSheet { +export class WarheroNPCSheet extends ActorSheet { /** @override */ static get defaultOptions() { return mergeObject(super.defaultOptions, { - classes: ["crucible-rpg", "sheet", "actor"], - template: "systems/fvtt-crucible-rpg/templates/npc-sheet.html", + classes: ["warhero-rpg", "sheet", "actor"], + template: "systems/fvtt-warhero/templates/npc-sheet.html", width: 640, height: 720, tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }], @@ -88,7 +88,7 @@ export class CrucibleNPCSheet extends ActorSheet { // Delete Inventory Item html.find('.item-delete').click(ev => { const li = $(ev.currentTarget).parents(".item") - CrucibleUtility.confirmDelete(this, li) + WarheroUtility.confirmDelete(this, li) }) html.find('.item-add').click(ev => { let dataType = $(ev.currentTarget).data("type") diff --git a/modules/warhero-roll-dialog.js b/modules/warhero-roll-dialog.js index c2ed025..50d350c 100644 --- a/modules/warhero-roll-dialog.js +++ b/modules/warhero-roll-dialog.js @@ -1,14 +1,14 @@ -import { CrucibleUtility } from "./crucible-utility.js"; +import { WarheroUtility } from "./warhero-utility.js"; -export class CrucibleRollDialog extends Dialog { +export class WarheroRollDialog extends Dialog { /* -------------------------------------------- */ static async create(actor, rollData) { - let options = { classes: ["CrucibleDialog"], width: 540, height: 340, 'z-index': 99999 }; - let html = await renderTemplate('systems/fvtt-crucible-rpg/templates/roll-dialog-generic.html', rollData); + let options = { classes: ["WarheroDialog"], width: 540, height: 340, 'z-index': 99999 }; + let html = await renderTemplate('systems/fvtt-warhero/templates/roll-dialog-generic.html', rollData); - return new CrucibleRollDialog(actor, rollData, html, options); + return new WarheroRollDialog(actor, rollData, html, options); } /* -------------------------------------------- */ @@ -39,12 +39,12 @@ export class CrucibleRollDialog extends Dialog { /* -------------------------------------------- */ roll() { - CrucibleUtility.rollCrucible(this.rollData) + WarheroUtility.rollWarhero(this.rollData) } /* -------------------------------------------- */ async refreshDialog() { - const content = await renderTemplate("systems/fvtt-crucible-rpg/templates/roll-dialog-generic.html", this.rollData) + const content = await renderTemplate("systems/fvtt-warhero/templates/roll-dialog-generic.html", this.rollData) this.data.content = content this.render(true) } diff --git a/modules/warhero-token.js b/modules/warhero-token.js index ee8975e..30d9ea4 100644 --- a/modules/warhero-token.js +++ b/modules/warhero-token.js @@ -1,6 +1,6 @@ -import { CrucibleUtility } from "./crucible-utility.js"; +import { WarheroUtility } from "./warhero-utility.js"; /* -------------------------------------------- */ -export class CrucibleToken extends Token { +export class WarheroToken extends Token { } diff --git a/modules/warhero-utility.js b/modules/warhero-utility.js index bf870fd..f3cdc0e 100644 --- a/modules/warhero-utility.js +++ b/modules/warhero-utility.js @@ -1,32 +1,24 @@ /* -------------------------------------------- */ -import { CrucibleCombat } from "./crucible-combat.js"; -import { CrucibleCommands } from "./crucible-commands.js"; +import { WarheroCombat } from "./warhero-combat.js"; +import { WarheroCommands } from "./warhero-commands.js"; /* -------------------------------------------- */ -const __level2Dice = ["d0", "d4", "d6", "d8", "d10", "d12"]; -const __name2DiceValue = { "0": 0, "d0": 0, "d4": 4, "d6": 6, "d8": 8, "d10": 10, "d12": 12 } -const __skillLevel2Dice = ["0d8", "1d8", "2d8", "3d8", "4d8", '6d8', "8d8", "10d8"] -const __color2RollTable = { - blue: "Blue Armor Die", black: "Black Armor Die", green: "Green Armor Die", purple: "Purple Armor Die", - white: "White Armor Die", red: "Red Armor Die", blackgreen: "Black & Green Armor Dice" -} -const __size2Dice = [{ nb: 0, dice: "d0" }, { nb: 5, dice: "d8" }, { nb: 3, dice: "d8" }, { nb: 2, dice: "d8" }, { nb: 1, dice: "d8" }, { nb: 1, dice: "d6" }, { nb: 1, noAddFirst: true, dice: "d6" }] /* -------------------------------------------- */ -export class CrucibleUtility { +export class WarheroUtility { /* -------------------------------------------- */ static async init() { - Hooks.on('renderChatLog', (log, html, data) => CrucibleUtility.chatListeners(html)); + Hooks.on('renderChatLog', (log, html, data) => WarheroUtility.chatListeners(html)); /*Hooks.on("dropCanvasData", (canvas, data) => { - CrucibleUtility.dropItemOnToken(canvas, data) + WarheroUtility.dropItemOnToken(canvas, data) });*/ this.rollDataStore = {} this.defenderStore = {} - CrucibleCommands.init(); + WarheroCommands.init(); Handlebars.registerHelper('count', function (list) { return list.length; @@ -57,7 +49,7 @@ export class CrucibleUtility { /*-------------------------------------------- */ static gameSettings() { - /*game.settings.register("fvtt-crucible-rpg", "dice-color-skill", { + /*game.settings.register("fvtt-warhero", "dice-color-skill", { name: "Dice color for skills", hint: "Set the dice color for skills", scope: "world", @@ -68,7 +60,7 @@ export class CrucibleUtility { }) Hooks.on('renderSettingsConfig', (event) => { - const element = event.element[0].querySelector(`[name='fvtt-crucible-rpg.dice-color-skill']`) + const element = event.element[0].querySelector(`[name='fvtt-warhero.dice-color-skill']`) if (!element) return // Replace placeholder element console.log("Element Found !!!!") @@ -78,7 +70,7 @@ export class CrucibleUtility { /*-------------------------------------------- */ static addDiceColors() { game.dice3d.addColorset({ - name: 'crucible-orange', + name: 'warhero-orange', category: "crucible", foreground: '#9F8003', background: "#FFA500", @@ -86,7 +78,7 @@ export class CrucibleUtility { }, "preferred"); game.dice3d.addColorset({ - name: 'crucible-purple', + name: 'warhero-purple', category: "crucible", foreground: '#9F8003', background: "#800080", @@ -94,7 +86,7 @@ export class CrucibleUtility { }, "preferred"); game.dice3d.addColorset({ - name: 'crucible-darkgreen', + name: 'warhero-darkgreen', category: "crucible", foreground: '#9F8003', background: "#006400", @@ -123,12 +115,12 @@ export class CrucibleUtility { /* -------------------------------------------- */ static async ready() { - const skills = await CrucibleUtility.loadCompendium("fvtt-crucible-rpg.skills") + const skills = await WarheroUtility.loadCompendium("fvtt-warhero.skills") this.skills = skills.map(i => i.toObject()) this.weaponSkills = duplicate(this.skills.filter(item => item.system.isweaponskill)) this.shieldSkills = duplicate(this.skills.filter(item => item.system.isshieldskill)) - const rollTables = await CrucibleUtility.loadCompendium("fvtt-crucible-rpg.rolltables") + const rollTables = await WarheroUtility.loadCompendium("fvtt-warhero.rolltables") this.rollTables = rollTables.map(i => i.toObject()) this.addDiceColors() @@ -143,7 +135,7 @@ export class CrucibleUtility { /* -------------------------------------------- */ static async loadCompendium(compendium, filter = item => true) { - let compendiumData = await CrucibleUtility.loadCompendiumData(compendium) + let compendiumData = await WarheroUtility.loadCompendiumData(compendium) return compendiumData.filter(filter) } @@ -222,7 +214,7 @@ export class CrucibleUtility { static async getRollTableFromDiceColor(diceColor, displayChat = true) { let rollTableName = __color2RollTable[diceColor] if (rollTableName) { - const pack = game.packs.get("fvtt-crucible-rpg.rolltables") + const pack = game.packs.get("fvtt-warhero.rolltables") const index = await pack.getIndex() const entry = index.find(e => e.name === rollTableName) let table = await pack.getDocument(entry._id) @@ -237,7 +229,7 @@ export class CrucibleUtility { /* -------------------------------------------- */ static async getCritical(level, weapon) { - const pack = game.packs.get("fvtt-crucible-rpg.rolltables") + const pack = game.packs.get("fvtt-warhero.rolltables") let tableName = "Crit " + level + " (" + this.upperFirst(weapon.system.damage) + ")" const index = await pack.getIndex() @@ -255,7 +247,7 @@ export class CrucibleUtility { }) html.on("click", '.roll-defense-melee', event => { let rollId = $(event.currentTarget).data("roll-id") - let rollData = CrucibleUtility.getRollData(rollId) + let rollData = WarheroUtility.getRollData(rollId) rollData.defenseWeaponId = $(event.currentTarget).data("defense-weapon-id") let actor = game.canvas.tokens.get(rollData.defenderTokenId).actor if (actor && (game.user.isGM || actor.isOwner)) { @@ -264,7 +256,7 @@ export class CrucibleUtility { }) html.on("click", '.roll-defense-ranged', event => { let rollId = $(event.currentTarget).data("roll-id") - let rollData = CrucibleUtility.getRollData(rollId) + let rollData = WarheroUtility.getRollData(rollId) let defender = game.canvas.tokens.get(rollData.defenderTokenId).actor if (defender && (game.user.isGM || defender.isOwner)) { defender.rollDefenseRanged(rollData) @@ -277,14 +269,14 @@ export class CrucibleUtility { static async preloadHandlebarsTemplates() { const templatePaths = [ - 'systems/fvtt-crucible-rpg/templates/editor-notes-gm.html', - 'systems/fvtt-crucible-rpg/templates/partial-roll-select.html', - 'systems/fvtt-crucible-rpg/templates/partial-actor-ability-block.html', - 'systems/fvtt-crucible-rpg/templates/partial-actor-status.html', - 'systems/fvtt-crucible-rpg/templates/partial-options-abilities.html', - 'systems/fvtt-crucible-rpg/templates/partial-item-nav.html', - 'systems/fvtt-crucible-rpg/templates/partial-item-description.html', - 'systems/fvtt-crucible-rpg/templates/partial-actor-equipment.html' + 'systems/fvtt-warhero/templates/editor-notes-gm.html', + 'systems/fvtt-warhero/templates/partial-roll-select.html', + 'systems/fvtt-warhero/templates/partial-actor-ability-block.html', + 'systems/fvtt-warhero/templates/partial-actor-status.html', + 'systems/fvtt-warhero/templates/partial-options-abilities.html', + 'systems/fvtt-warhero/templates/partial-item-nav.html', + 'systems/fvtt-warhero/templates/partial-item-description.html', + 'systems/fvtt-warhero/templates/partial-actor-equipment.html' ] return loadTemplates(templatePaths); } @@ -297,7 +289,7 @@ export class CrucibleUtility { } static findChatMessageId(current) { - return CrucibleUtility.getChatMessageId(CrucibleUtility.findChatMessage(current)); + return WarheroUtility.getChatMessageId(WarheroUtility.findChatMessage(current)); } static getChatMessageId(node) { @@ -305,7 +297,7 @@ export class CrucibleUtility { } static findChatMessage(current) { - return CrucibleUtility.findNodeMatching(current, it => it.classList.contains('chat-message') && it.attributes.getNamedItem('data-message-id')); + return WarheroUtility.findNodeMatching(current, it => it.classList.contains('chat-message') && it.attributes.getNamedItem('data-message-id')); } static findNodeMatching(current, predicate) { @@ -313,7 +305,7 @@ export class CrucibleUtility { if (predicate(current)) { return current; } - return CrucibleUtility.findNodeMatching(current.parentElement, predicate); + return WarheroUtility.findNodeMatching(current.parentElement, predicate); } return undefined; } @@ -357,7 +349,7 @@ export class CrucibleUtility { } /* -------------------------------------------- */ static saveRollData(rollData) { - game.socket.emit("system.crucible-rpg", { + game.socket.emit("system.warhero-rpg", { name: "msg_update_roll", data: rollData }); // Notify all other clients of the roll this.updateRollData(rollData) @@ -380,7 +372,7 @@ export class CrucibleUtility { name: defender.name, alias: defender.name, //user: defender.id, - content: await renderTemplate(`systems/fvtt-crucible-rpg/templates/chat-request-defense.html`, rollData), + content: await renderTemplate(`systems/fvtt-warhero/templates/chat-request-defense.html`, rollData), whisper: [defender.id].concat(ChatMessage.getWhisperRecipients('GM')), }) } @@ -426,7 +418,7 @@ export class CrucibleUtility { /* -------------------------------------------- */ static async getFumble(weapon) { - const pack = game.packs.get("fvtt-crucible-rpg.rolltables") + const pack = game.packs.get("fvtt-warhero.rolltables") const index = await pack.getIndex() let entry @@ -456,16 +448,16 @@ export class CrucibleUtility { result.damageWeaponFormula = result.defenderDamage + dmgDice result.defenderHPLossValue = await defender.incDecHP("-" + result.damageWeaponFormula) } - if (result.fumble || (result.dangerous_fumble && CrucibleUtility.isWeaponDangerous(rollData.attackRollData.weapon))) { + if (result.fumble || (result.dangerous_fumble && WarheroUtility.isWeaponDangerous(rollData.attackRollData.weapon))) { result.fumbleDetails = await this.getFumble(rollData.weapon) } if (result.critical_1 || result.critical_2) { - let isDeadly = CrucibleUtility.isWeaponDeadly(rollData.attackRollData.weapon) + let isDeadly = WarheroUtility.isWeaponDeadly(rollData.attackRollData.weapon) result.critical = await this.getCritical((result.critical_1) ? "I" : "II", rollData.attackRollData.weapon) result.criticalText = result.critical.text } this.createChatWithRollMode(rollData.alias, { - content: await renderTemplate(`systems/fvtt-crucible-rpg/templates/chat-attack-defense-result.html`, rollData) + content: await renderTemplate(`systems/fvtt-warhero/templates/chat-attack-defense-result.html`, rollData) }) console.log("Results processed", rollData) } @@ -490,7 +482,7 @@ export class CrucibleUtility { if (game.user.isGM) { this.processSuccessResult(rollData) } else { - game.socket.emit("system.fvtt-crucible-rpg", { msg: "msg_gm_process_attack_defense", data: rollData }); + game.socket.emit("system.fvtt-warhero", { msg: "msg_gm_process_attack_defense", data: rollData }); } } } @@ -583,7 +575,7 @@ export class CrucibleUtility { } /* -------------------------------------------- */ - static async rollCrucible(rollData) { + static async rollWarhero(rollData) { let actor = game.actors.get(rollData.actorId) @@ -622,9 +614,9 @@ export class CrucibleUtility { if (rollData.skill.system.isfeatdie) { rollData.hasFeatDie = true - diceFormula += "+ 1d10cs>=5[crucible-purple]" + diceFormula += "+ 1d10cs>=5[warhero-purple]" } else { - diceFormula += `+ 0d10cs>=5[crucible-purple]` + diceFormula += `+ 0d10cs>=5[warhero-purple]` } if (rollData.skill.system.bonusdice != "none") { rollData.hasBonusDice = rollData.skill.system.bonusdice @@ -639,10 +631,10 @@ export class CrucibleUtility { // advantage => 8 let advFormula = "+ 0d8cs>=5" if (rollData.advantage == "advantage1" || rollData.forceAdvantage) { - advFormula = "+ 1d8cs>=5[crucible-darkgreen]" + advFormula = "+ 1d8cs>=5[warhero-darkgreen]" } if (rollData.advantage == "advantage2") { - advFormula = "+ 2d8cs>=5[crucible-darkgreen]" + advFormula = "+ 2d8cs>=5[warhero-darkgreen]" } diceFormula += advFormula @@ -699,7 +691,7 @@ export class CrucibleUtility { rollData.rollOrder = 1 rollData.rollType = (rollData.rollAdvantage == "roll-advantage") ? "Advantage" : "Disadvantage" this.createChatWithRollMode(rollData.alias, { - content: await renderTemplate(`systems/fvtt-crucible-rpg/templates/chat-generic-result.html`, rollData) + content: await renderTemplate(`systems/fvtt-warhero/templates/chat-generic-result.html`, rollData) }) rollData.rollOrder = 2 @@ -709,7 +701,7 @@ export class CrucibleUtility { rollData.roll = myRoll2 // Tmp switch to display the proper results rollData.nbSuccess = myRoll2.total this.createChatWithRollMode(rollData.alias, { - content: await renderTemplate(`systems/fvtt-crucible-rpg/templates/chat-generic-result.html`, rollData) + content: await renderTemplate(`systems/fvtt-warhero/templates/chat-generic-result.html`, rollData) }) rollData.roll = myRoll // Revert the tmp switch rollData.nbSuccess = myRoll.total @@ -743,7 +735,7 @@ export class CrucibleUtility { actor.lastRoll = rollData this.createChatWithRollMode(rollData.alias, { - content: await renderTemplate(`systems/fvtt-crucible-rpg/templates/chat-generic-result.html`, rollData) + content: await renderTemplate(`systems/fvtt-warhero/templates/chat-generic-result.html`, rollData) }) console.log("Rolldata result", rollData) @@ -794,7 +786,7 @@ export class CrucibleUtility { chatGM.whisper = this.getUsers(user => user.isGM); chatGM.content = "Blinde message of " + game.user.name + "
" + chatOptions.content; console.log("blindMessageToGM", chatGM); - game.socket.emit("system.fvtt-crucible-rpg", { msg: "msg_gm_chat_message", data: chatGM }); + game.socket.emit("system.fvtt-warhero", { msg: "msg_gm_chat_message", data: chatGM }); } @@ -855,13 +847,13 @@ export class CrucibleUtility { rollMode: game.settings.get("core", "rollMode"), advantage: "none" } - CrucibleUtility.updateWithTarget(rollData) + WarheroUtility.updateWithTarget(rollData) return rollData } /* -------------------------------------------- */ static updateWithTarget(rollData) { - let target = CrucibleUtility.getTarget() + let target = WarheroUtility.getTarget() if (target) { rollData.defenderTokenId = target.id } diff --git a/system.json b/system.json index 4e648aa..ca9f400 100644 --- a/system.json +++ b/system.json @@ -23,172 +23,10 @@ "packs": [ { "type": "Item", - "label": "Armors", - "name": "armor", - "path": "packs/armor.db", - "system": "fvtt-crucible-rpg", - "private": false, - "flags": {} - }, - { - "type": "Item", - "label": "Equipments", - "name": "equipment", - "path": "packs/equipment.db", - "system": "fvtt-crucible-rpg", - "private": false, - "flags": {} - }, - { - "type": "Item", - "label": "Shields", - "name": "shields", - "path": "packs/shields.db", - "system": "fvtt-crucible-rpg", - "private": false, - "flags": {} - }, - { - "type": "Item", - "label": "Weapons", - "name": "weapons", - "path": "packs/weapons.db", - "system": "fvtt-crucible-rpg", - "private": false, - "flags": {} - }, - { - "type": "Item", - "label": "Conditions", - "name": "conditions", - "path": "packs/conditions.db", - "system": "fvtt-crucible-rpg", - "private": false, - "flags": {} - }, - { - "type": "Item", - "label": "Currency", - "name": "currency", - "path": "packs/currency.db", - "system": "fvtt-crucible-rpg", - "private": false, - "flags": {} - }, - { - "type": "Item", - "label": "Lore - Air", - "name": "lore-air", - "path": "packs/lore-air.db", - "system": "fvtt-crucible-rpg", - "private": false, - "flags": {} - }, - { - "type": "Item", - "label": "Lore - Earth", - "name": "lore-earth", - "path": "packs/lore-earth.db", - "system": "fvtt-crucible-rpg", - "private": false, - "flags": {} - }, - { - "type": "Item", - "label": "Lore - Fire", - "name": "lore-fire", - "path": "packs/lore-fire.db", - "system": "fvtt-crucible-rpg", - "private": false, - "flags": {} - }, - { - "type": "Item", - "label": "Lore - Water", - "name": "lore-water", - "path": "packs/lore-water.db", - "system": "fvtt-crucible-rpg", - "private": false, - "flags": {} - }, - { - "type": "Item", - "label": "Lore - Shadow", - "name": "lore-shadow", - "path": "packs/lore-shadow.db", - "system": "fvtt-crucible-rpg", - "private": false, - "flags": {} - }, - { - "type": "Item", - "label": "Skills", - "name": "skills", - "path": "packs/skills.db", - "system": "fvtt-crucible-rpg", - "private": false, - "flags": {} - }, - { - "type": "Item", - "label": "Feats", - "name": "feats", - "path": "packs/feats.db", - "system": "fvtt-crucible-rpg", - "private": false, - "flags": {} - }, - { - "type": "Item", - "label": "Poisons", - "name": "poisons", - "path": "packs/poisons.db", - "system": "fvtt-crucible-rpg", - "private": false, - "flags": {} - }, - { - "type": "Item", - "label": "Powers - Class", - "name": "classpowers", - "path": "packs/classpowers.db", - "system": "fvtt-crucible-rpg", - "private": false, - "flags": {} - }, - { - "type": "Item", - "label": "Tricks & Traps", - "name": "trickstraps", - "path": "packs/trickstraps.db", - "system": "fvtt-crucible-rpg", - "private": false, - "flags": {} - }, - { - "type": "Item", - "label": "Action Tokens", - "name": "action-tokens", - "path": "packs/action-tokens.db", - "system": "fvtt-crucible-rpg", - "private": false, - "flags": {} - }, - { - "type": "Item", - "label": "Powers - Monsters", - "name": "monster-powers", - "path": "packs/monster-powers.db", - "system": "fvtt-crucible-rpg", - "private": false, - "flags": {} - }, - { - "type": "RollTable", - "label": "Rolltables", - "name": "rolltables", - "path": "packs/rolltables.db", - "system": "fvtt-crucible-rpg", + "label": "Races", + "name": "races", + "path": "packs/races.db", + "system": "fvtt-warhero", "private": false, "flags": {} } @@ -206,9 +44,9 @@ "maximum": "10" }, "title": "Warhero RPG", - "manifest": "https://raw.githubusercontent.com/213gaming/Crucible/main/system.json", - "download": "https://github.com/213gaming/Crucible/archive/refs/tags/v10.0.23.zip", - "url": "https://github.com/213gaming/Crucible", - "background": "images/ui/crucible_welcome_page.webp", + "manifest": "https://www.uberwald.me/gitea/public/fvtt-warhero/raw/branch/master/system.json", + "download": "https://www.uberwald.me/gitea/public/fvtt-warhero/raw/branch/master/system.json", + "url": "https://www.uberwald.me/gitea/public/fvtt-warhero", + "background": "images/ui/warhero_welcome_page.webp", "id": "fvtt-warhero" } \ No newline at end of file diff --git a/template.json b/template.json index 88d86a4..fa41254 100644 --- a/template.json +++ b/template.json @@ -102,66 +102,51 @@ } }, "Item": { - "types": [ "race", "skill", "armor", "shield", "equipment", "weapon", "money" , "feat", "spell", "condition", "poison"], - "poison": { + "types": [ "race", "weapon", "armor", "shield", "equipment", "money" , "skill", "power", "spell", "condition", "class"], + "condition": { "description": "" }, - "condition": { - "advantage": false, - "disadvantage": false, - "rolladvantage": false, - "rolldisadvantage": false, - "loosehpround": false, - "loohproundvalue": 0, - "noadvantage": false, - "attackdisadvantage": false, - "defensedisadvantage": false, - "targetadvantage": false, - "noaction": false, + "class": { + "weapons": { + "short": false, + "long": false, + "twohanded": false, + "shotgun": false, + "throwing": false + }, + "armors": { + "light": false, + "medium": false, + "heavy": false + }, + "shields": { + "light": false, + "medium": false, + "tower": false + }, "description": "" }, "race": { "description": "" }, - "feat": { - "isfeatdie": false, - "issl": false, - "sl": 0, + "skill": { "description": "" }, - "skill": { - "ability": "", - "armorpenalty": false, - "isproficient": false, - "isweaponskill": false, - "isshieldskill": false, - "isfeatdie": false, - "issl2": false, - "islore": false, - "skilltype": "", - "isinnate": false, - "bonusdice": "", - "background": 0, - "basic": 0, - "class": 0, - "exp": 0, - "explevel": 0, + "weapon": { + "weapontype": "short", + "damage": "1d6", + "cost": 0, + "equipped": false, "description": "" }, "armor": { - "armortype": "", - "absorprionroll": "", - "damagedroll": "", - "isproficient": false, - "minstr": 0, - "skillpenalty": 0, + "armortype": "light", "equipped": false, "cost": 0, "description":"" }, "shield": { - "shielddie": "", - "skill": "", + "shieldtype": "light", "equipped": false, "cost": 0, "description":"" @@ -176,25 +161,19 @@ "containerid": "", "description":"" }, + "power": { + "level1": "", + "level2": "", + "level3": "", + "level4_1": "", + "level4_2": "", + "description": "" + }, "money" : { "value": 0, "quantity": 0, "description": "" }, - "weapon": { - "isproficient": false, - "skill": "", - "qualities": "", - "flaws": "", - "damage": "", - "isranged": false, - "range": "", - "maxrange": "", - "minstr": 0, - "cost": 0, - "equipped": false, - "description": "" - }, "spell":{ "lore": "", "circle": 1, diff --git a/templates/item-armor-sheet.html b/templates/item-armor-sheet.html index f4ebe36..da4bb1a 100644 --- a/templates/item-armor-sheet.html +++ b/templates/item-armor-sheet.html @@ -6,82 +6,34 @@
- {{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}} + {{> systems/fvtt-warhero/templates/partial-item-nav.html}} {{!-- Sheet Body --}}
- {{> systems/fvtt-crucible-rpg/templates/partial-item-description.html}} + {{> systems/fvtt-warhero/templates/partial-item-description.html}}
  • - + {{#select system.armortype}} + {{#each config.armorTypes as |type key|}} + + {{/each}} {{/select}}
  • -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • -
  • - +
  • - +
diff --git a/templates/item-condition-sheet.html b/templates/item-condition-sheet.html index a84066a..3453352 100644 --- a/templates/item-condition-sheet.html +++ b/templates/item-condition-sheet.html @@ -5,7 +5,7 @@

- {{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}} + {{> systems/fvtt-warhero/templates/partial-item-nav.html}} {{!-- Sheet Body --}}
@@ -20,41 +20,6 @@
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • - {{#if data.loosehpround}} -
  • - -
  • - {{/if}} -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
diff --git a/templates/item-equipment-sheet.html b/templates/item-equipment-sheet.html index 68b2708..59ba1ce 100644 --- a/templates/item-equipment-sheet.html +++ b/templates/item-equipment-sheet.html @@ -6,23 +6,23 @@
- {{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}} + {{> systems/fvtt-warhero/templates/partial-item-nav.html}} {{!-- Sheet Body --}}
- {{> systems/fvtt-crucible-rpg/templates/partial-item-description.html}} + {{> systems/fvtt-warhero/templates/partial-item-description.html}}
  • - +
  • - +
  • - +
diff --git a/templates/item-feat-sheet.html b/templates/item-feat-sheet.html deleted file mode 100644 index 0751e74..0000000 --- a/templates/item-feat-sheet.html +++ /dev/null @@ -1,35 +0,0 @@ -
-
- -
-

-
-
- - {{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}} - - {{!-- Sheet Body --}} -
- - {{> systems/fvtt-crucible-rpg/templates/partial-item-description.html}} - -
-
    -
  • - -
  • - -
  • - -
  • - - {{#if data.issl}} -
  • - -
  • - {{/if}} - -
-
-
-
diff --git a/templates/item-money-sheet.html b/templates/item-money-sheet.html index e2c11d1..3194826 100644 --- a/templates/item-money-sheet.html +++ b/templates/item-money-sheet.html @@ -6,20 +6,20 @@
- {{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}} + {{> systems/fvtt-warhero/templates/partial-item-nav.html}} {{!-- Sheet Body --}}
- {{> systems/fvtt-crucible-rpg/templates/partial-item-description.html}} + {{> systems/fvtt-warhero/templates/partial-item-description.html}}
  • - +
  • - +
diff --git a/templates/item-poison-sheet.html b/templates/item-poison-sheet.html index 9f587ae..18b2eb5 100644 --- a/templates/item-poison-sheet.html +++ b/templates/item-poison-sheet.html @@ -5,7 +5,7 @@

- {{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}} + {{> systems/fvtt-warhero/templates/partial-item-nav.html}} {{!-- Sheet Body --}}
@@ -14,7 +14,7 @@
- {{editor description target="data.description" button=true owner=owner editable=editable}} + {{editor description target="system.description" button=true owner=owner editable=editable}}
diff --git a/templates/item-race-sheet.html b/templates/item-race-sheet.html index 9f587ae..18b2eb5 100644 --- a/templates/item-race-sheet.html +++ b/templates/item-race-sheet.html @@ -5,7 +5,7 @@

- {{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}} + {{> systems/fvtt-warhero/templates/partial-item-nav.html}} {{!-- Sheet Body --}}
@@ -14,7 +14,7 @@
- {{editor description target="data.description" button=true owner=owner editable=editable}} + {{editor description target="system.description" button=true owner=owner editable=editable}}
diff --git a/templates/item-shield-sheet.html b/templates/item-shield-sheet.html index 985f820..51b935a 100644 --- a/templates/item-shield-sheet.html +++ b/templates/item-shield-sheet.html @@ -18,33 +18,22 @@
    -
  • - -
  • - -
  • - + {{#select system.shieldtype}} + {{#each config.armorTypes as |type key|}} + {{/each}} {{/select}}
  • - - +
  • - +
  • - +
diff --git a/templates/item-skill-sheet.html b/templates/item-skill-sheet.html index 5f7c68e..48fa87a 100644 --- a/templates/item-skill-sheet.html +++ b/templates/item-skill-sheet.html @@ -6,98 +6,15 @@
- {{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}} + {{> systems/fvtt-warhero/templates/partial-item-nav.html}} {{!-- Sheet Body --}}
- {{> systems/fvtt-crucible-rpg/templates/partial-item-description.html}} + {{> systems/fvtt-warhero/templates/partial-item-description.html}}
    -
  • - -
  • - -
  • - -
  • -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - - - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
diff --git a/templates/item-spell-sheet.html b/templates/item-spell-sheet.html index 61f5949..8053b4f 100644 --- a/templates/item-spell-sheet.html +++ b/templates/item-spell-sheet.html @@ -6,12 +6,12 @@ - {{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}} + {{> systems/fvtt-warhero/templates/partial-item-nav.html}} {{!-- Sheet Body --}}
- {{> systems/fvtt-crucible-rpg/templates/partial-item-description.html}} + {{> systems/fvtt-warhero/templates/partial-item-description.html}}
    diff --git a/templates/item-weapon-sheet.html b/templates/item-weapon-sheet.html index dcb6071..3e55579 100644 --- a/templates/item-weapon-sheet.html +++ b/templates/item-weapon-sheet.html @@ -6,74 +6,38 @@
- {{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}} + {{> systems/fvtt-warhero/templates/partial-item-nav.html}} {{!-- Sheet Body --}}
- {{> systems/fvtt-crucible-rpg/templates/partial-item-description.html}} + {{> systems/fvtt-warhero/templates/partial-item-description.html}}
    - - -
  • - -
  • - -
  • - + {{#select system.weapontype}} + {{#each config.weaponTypes as |type key|}} + {{/each}} {{/select}}
  • -
  • - -
  • - -
  • - -
  • -
  • - -
  • - -
  • - -
  • - {{#if data.isranged}} -
  • - -
  • -
  • - -
  • - {{/if}} - -
  • - +
  • - +
  • - +