Initial Import

This commit is contained in:
LeRatierBretonnien 2023-01-04 22:21:49 +01:00
parent da4efccad5
commit 405539e077
10 changed files with 1570 additions and 1565 deletions

View File

@ -10,11 +10,11 @@ const __saveFirstToKey = { r: "reflex", f: "fortitude", w: "willpower"}
export class WarheroCommands { export class WarheroCommands {
static init() { static init() {
if (!game.system.cruciblerpg.commands) { if (!game.system.warhero.commands) {
const crucibleCommands = new WarheroCommands(); 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: ["/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" }); //crucibleCommands.registerCommand({ path: ["/rsave"], func: (content, msg, params) => WarheroCommands.rollSave(msg, params), descr: "Performs a save roll" });
game.system.cruciblerpg.commands = crucibleCommands; game.system.warhero.commands = crucibleCommands;
} }
} }

View File

@ -63,10 +63,9 @@ export class WarheroItemSheet extends ItemSheet {
name: this.object.name, name: this.object.name,
editable: this.isEditable, editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked", cssClass: this.isEditable ? "editable" : "locked",
weaponSkills: WarheroUtility.getWeaponSkills(), config: game.system.warhero.config,
shieldSkills: WarheroUtility.getShieldSkills(),
description: await TextEditor.enrichHTML(this.object.system.description, {async: true}), description: await TextEditor.enrichHTML(this.object.system.description, {async: true}),
data: itemData, system: itemData,
limited: this.object.limited, limited: this.object.limited,
options: this.options, options: this.options,
owner: this.document.isOwner, owner: this.document.isOwner,

View File

@ -17,6 +17,7 @@ import { WarheroCombat } from "./warhero-combat.js";
import { WarheroItem } from "./warhero-item.js"; import { WarheroItem } from "./warhero-item.js";
import { WarheroHotbar } from "./warhero-hotbar.js" import { WarheroHotbar } from "./warhero-hotbar.js"
import { WarheroCommands } from "./warhero-commands.js" import { WarheroCommands } from "./warhero-commands.js"
import { WARHERO_CONFIG } from "./warhero-config.js"
/* -------------------------------------------- */ /* -------------------------------------------- */
/* Foundry VTT Initialization */ /* Foundry VTT Initialization */
@ -27,9 +28,10 @@ Hooks.once("init", async function () {
console.log(`Initializing Warhero RPG`); console.log(`Initializing Warhero RPG`);
game.system.cruciblerpg = { game.system.warhero = {
WarheroHotbar, WarheroHotbar,
WarheroCommands WarheroCommands,
config: WARHERO_CONFIG
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -66,33 +66,6 @@ export class WarheroUtility {
console.log("Element Found !!!!") console.log("Element Found !!!!")
}) */ }) */
} }
/*-------------------------------------------- */
static addDiceColors() {
game.dice3d.addColorset({
name: 'warhero-orange',
category: "crucible",
foreground: '#9F8003',
background: "#FFA500",
visibility: 'visible'
}, "preferred");
game.dice3d.addColorset({
name: 'warhero-purple',
category: "crucible",
foreground: '#9F8003',
background: "#800080",
visibility: 'visible'
}, "preferred");
game.dice3d.addColorset({
name: 'warhero-darkgreen',
category: "crucible",
foreground: '#9F8003',
background: "#006400",
visibility: 'visible'
}, "preferred");
}
/*-------------------------------------------- */ /*-------------------------------------------- */
static upperFirst(text) { static upperFirst(text) {
@ -115,16 +88,6 @@ export class WarheroUtility {
/* -------------------------------------------- */ /* -------------------------------------------- */
static async ready() { static async ready() {
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 WarheroUtility.loadCompendium("fvtt-warhero.rolltables")
this.rollTables = rollTables.map(i => i.toObject())
this.addDiceColors()
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

File diff suppressed because it is too large Load Diff

View File

@ -18,22 +18,22 @@
<div class="tab" data-group="primary"> <div class="tab" data-group="primary">
<ul> <ul>
<li class="flexrow"><label class="generic-label">Type</label> <li class="flexrow"><label class="item-field-label-medium ">Type</label>
<select class="competence-base flexrow" type="text" name="system.armortype" value="{{system.armortype}}" data-dtype="String"> <select class="item-field-label-medium " type="text" name="system.armortype" value="{{system.armortype}}" data-dtype="String">
{{#select system.armortype}} {{#select system.armortype}}
{{#each config.armorTypes as |type key|}} {{#each config.armorTypes as |type key|}}
<option value="{{key}}">{{localiser type.label}}</option> <option value="{{key}}">{{localize type.label}}</option>
{{/each}} {{/each}}
{{/select}} {{/select}}
</select> </select>
</li> </li>
<li class="flexrow"><label class="generic-label">Equipped ?</label> <li class="flexrow"><label class="item-field-label-medium ">Equipped ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label> <label class="item-field-label-medium checkbox"><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label>
</li> </li>
<li class="flexrow"><label class="generic-label">Cost</label> <li class="flexrow"><label class="item-field-label-medium ">Cost</label>
<input type="text" class="input-numeric-short padd-right" name="system.cost" value="{{system.cost}}" data-dtype="Number"/> <input type="text" class="item-field-label-medium " name="system.cost" value="{{system.cost}}" data-dtype="Number"/>
</li> </li>
</ul> </ul>

View File

@ -15,14 +15,14 @@
<div class="tab details" data-group="primary" data-tab="details"> <div class="tab details" data-group="primary" data-tab="details">
<ul> <ul>
<li class="flexrow"><label class="generic-label">Equipped ?</label> <li class="flexrow"><label class="item-field-label-medium ">Equipped ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label> <label class="item-field-label-medium checkbox"><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label>
</li> </li>
<li class="flexrow"><label class="generic-label">Quantity</label> <li class="flexrow"><label class="item-field-label-medium ">Quantity</label>
<input type="text" class="input-numeric-short padd-right" name="system.quantity" value="{{system.quantity}}" data-dtype="Number"/> <input type="text" class="item-field-label-medium " name="system.quantity" value="{{system.quantity}}" data-dtype="Number"/>
</li> </li>
<li class="flexrow"><label class="generic-label">Cost</label> <li class="flexrow"><label class="generic-label">Cost</label>
<input type="text" class="input-numeric-short padd-right" name="system.cost" value="{{system.cost}}" data-dtype="Number"/> <input type="text" class="item-field-label-medium " name="system.cost" value="{{system.cost}}" data-dtype="Number"/>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -15,11 +15,11 @@
<div class="tab details" data-group="primary" data-tab="details"> <div class="tab details" data-group="primary" data-tab="details">
<ul> <ul>
<li class="flexrow"><label class="generic-label">Quantity</label> <li class="flexrow"><label class="item-field-label-medium ">Quantity</label>
<input type="text" class="input-numeric-short padd-right" name="system.quantity" value="{{system.quantity}}" data-dtype="Number"/> <input type="text" class="item-field-label-medium " name="system.quantity" value="{{system.quantity}}" data-dtype="Number"/>
</li> </li>
<li class="flexrow"><label class="generic-label">Unit value</label> <li class="flexrow"><label class="generic-label">Unit value</label>
<input type="text" class="input-numeric-short padd-right" name="system.value" value="{{system.value}}" data-dtype="Number"/> <input type="text" class="item-field-label-medium " name="system.value" value="{{system.value}}" data-dtype="Number"/>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -18,22 +18,22 @@
<div class="tab" data-group="primary"> <div class="tab" data-group="primary">
<ul> <ul>
<li class="flexrow"><label class="generic-label">Shield typer</label> <li class="flexrow"><label class="item-field-label-medium ">Shield typer</label>
<select class="competence-base flexrow" type="text" name="system.shieldtype" value="{{system.shieldtype}}" data-dtype="String"> <select class="item-field-label-medium " type="text" name="system.shieldtype" value="{{system.shieldtype}}" data-dtype="String">
{{#select system.shieldtype}} {{#select system.shieldtype}}
{{#each config.armorTypes as |type key|}} {{#each config.armorTypes as |type key|}}
<option value="{{key}}">{{localiser type.label}}</option> <option value="{{key}}">{{localize type.label}}</option>
{{/each}} {{/each}}
{{/select}} {{/select}}
</select> </select>
</li> </li>
<li class="flexrow"><label class="generic-label">Equipped ?</label> <li class="flexrow"><label class="item-field-label-medium ">Equipped ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label> <label class="item-field-label-medium "><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label>
</li> </li>
<li class="flexrow"><label class="generic-label">Cost</label> <li class="flexrow"><label class="item-field-label-medium ">Cost</label>
<input type="text" class="input-numeric-short padd-right" name="system.cost" value="{{system.cost}}" data-dtype="Number"/> <input type="text" class="item-field-label-medium " name="system.cost" value="{{system.cost}}" data-dtype="Number"/>
</li> </li>
</ul> </ul>

View File

@ -18,26 +18,26 @@
<div class="tab" data-group="primary"> <div class="tab" data-group="primary">
<ul> <ul>
<li class="flexrow"><label class="generic-label">Type</label> <li class="flexrow"><label class="item-field-label-medium ">Type</label>
<select class="competence-base flexrow" type="text" name="system.weapontype" value="{{system.weapontype}}" data-dtype="String"> <select class="item-field-label-medium " type="text" name="system.weapontype" value="{{system.weapontype}}" data-dtype="String">
{{#select system.weapontype}} {{#select system.weapontype}}
{{#each config.weaponTypes as |type key|}} {{#each config.weaponTypes as |type key|}}
<option value="{{key}}">{{localiser type.label}}</option> <option value="{{key}}">{{localize type.label}}</option>
{{/each}} {{/each}}
{{/select}} {{/select}}
</select> </select>
</li> </li>
<li class="flexrow"><label class="generic-label">Damage</label> <li class="flexrow"><label class="item-field-label-medium ">Damage</label>
<input type="text" class="right" name="system.damage" value="{{system.damage}}" data-dtype="String"/> <input type="text" class="item-field-label-medium " name="system.damage" value="{{system.damage}}" data-dtype="String"/>
</li> </li>
<li class="flexrow"><label class="generic-label">Equipped ?</label> <li class="flexrow"><label class="item-field-label-medium ">Equipped ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label> <label class="item-field-label-medium checkbox"><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label>
</li> </li>
<li class="flexrow"><label class="generic-label">Cost</label> <li class="flexrow"><label class="item-field-label-medium ">Cost</label>
<input type="text" class="input-numeric-short padd-right" name="system.cost" value="{{system.cost}}" data-dtype="Number"/> <input type="text" class="item-field-label-medium " name="system.cost" value="{{system.cost}}" data-dtype="Number"/>
</li> </li>
</ul> </ul>