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 {
static init() {
if (!game.system.cruciblerpg.commands) {
if (!game.system.warhero.commands) {
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;
//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.warhero.commands = crucibleCommands;
}
}

View File

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

View File

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

View File

@ -67,33 +67,6 @@ export class WarheroUtility {
}) */
}
/*-------------------------------------------- */
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) {
if (typeof text !== 'string') return text
@ -115,16 +88,6 @@ export class WarheroUtility {
/* -------------------------------------------- */
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">
<ul>
<li class="flexrow"><label class="generic-label">Type</label>
<select class="competence-base flexrow" type="text" name="system.armortype" value="{{system.armortype}}" data-dtype="String">
<li class="flexrow"><label class="item-field-label-medium ">Type</label>
<select class="item-field-label-medium " type="text" name="system.armortype" value="{{system.armortype}}" data-dtype="String">
{{#select system.armortype}}
{{#each config.armorTypes as |type key|}}
<option value="{{key}}">{{localiser type.label}}</option>
<option value="{{key}}">{{localize type.label}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Equipped ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label>
<li class="flexrow"><label class="item-field-label-medium ">Equipped ?</label>
<label class="item-field-label-medium checkbox"><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label>
</li>
<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"/>
<li class="flexrow"><label class="item-field-label-medium ">Cost</label>
<input type="text" class="item-field-label-medium " name="system.cost" value="{{system.cost}}" data-dtype="Number"/>
</li>
</ul>

View File

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

View File

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

View File

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

View File

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