Initial Import

This commit is contained in:
LeRatierBretonnien 2023-01-04 21:24:56 +01:00
commit 7665fb32b5
70 changed files with 6953 additions and 0 deletions

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# fvtt-pegasus-rpg

BIN
fonts/middlesaxonytext.ttf Executable file

Binary file not shown.

BIN
fonts/zag_bold.otf Executable file

Binary file not shown.

BIN
fonts/zag_regular.otf Executable file

Binary file not shown.

4
images/.directory Normal file
View File

@ -0,0 +1,4 @@
[Dolphin]
Timestamp=2022,9,12,23,3,3.4699999999999998
Version=4
VisibleRoles=Details_text,Details_size,Details_modificationtime,Details_creationtime,CustomizedDetails

4
images/dice/.directory Normal file
View File

@ -0,0 +1,4 @@
[Dolphin]
Timestamp=2022,7,19,23,15,34.73
Version=4
VisibleRoles=Details_text,Details_size,Details_modificationtime,Details_creationtime,CustomizedDetails

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

1
images/dice/d10-grey.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="40 40 100 100" width="64" height="64"><g><g transform="matrix(1.1679092,0,0,1.1679092,-274.931,-137.53749)"><path fill="#AAAAAA" d="M313.653,154.602l-26.488,55.612l24.356,15.89l26.354-15.928 L313.653,154.602z"/><path fill="#AAAAAA" d="M314.9,153.687l24.49,55.919l14.175-4.584l0.915-22.612 L314.9,153.687z"/><path fill="#AAAAAA" d="M312.359,227.393v8.568l40.76-28.762l-13.608,3.825 L312.359,227.393z"/><path fill="#AAAAAA" d="M312.359,153.927l-26.756,55.732l-13.925-5.99l-1.229-22.679 L312.359,153.927z"/><path fill="#AAAAAA" d="M310.517,227.213v8.75l-39.019-30.157l13.513,5.275 L310.517,227.213z"/></g></g></svg>

After

Width:  |  Height:  |  Size: 676 B

1
images/dice/d10black.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="40 40 100 125" width="64" height="64"><g><g transform="matrix(1.1679092,0,0,1.1679092,-274.931,-137.53749)"><path fill="#000000" d="M313.653,154.602l-26.488,55.612l24.356,15.89l26.354-15.928 L313.653,154.602z"/><path fill="#000000" d="M314.9,153.687l24.49,55.919l14.175-4.584l0.915-22.612 L314.9,153.687z"/><path fill="#000000" d="M312.359,227.393v8.568l40.76-28.762l-13.608,3.825 L312.359,227.393z"/><path fill="#000000" d="M312.359,153.927l-26.756,55.732l-13.925-5.99l-1.229-22.679 L312.359,153.927z"/><path fill="#000000" d="M310.517,227.213v8.75l-39.019-30.157l13.513,5.275 L310.517,227.213z"/></g></g></svg>

After

Width:  |  Height:  |  Size: 676 B

BIN
images/dice/d6_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
images/dice/d6_1.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

BIN
images/dice/d6_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
images/dice/d6_2.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 688 B

BIN
images/dice/d6_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
images/dice/d6_3.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 952 B

BIN
images/dice/d6_4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
images/dice/d6_4.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
images/dice/d6_5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
images/dice/d6_5.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
images/dice/d6_6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
images/dice/d6_6.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

6
images/icons/.directory Executable file
View File

@ -0,0 +1,6 @@
[Dolphin]
SortRole=creationtime
Timestamp=2021,4,13,9,23,48.267
Version=4
ViewMode=1
VisibleRoles=Details_text,Details_size,Details_modificationtime,Details_creationtime,CustomizedDetails

3
lang/en.json Normal file
View File

@ -0,0 +1,3 @@
{
}

View File

@ -0,0 +1,224 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { CrucibleUtility } from "./crucible-utility.js";
/* -------------------------------------------- */
export class CrucibleActorSheet 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",
width: 960,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "skills" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: true
});
}
/* -------------------------------------------- */
async getData() {
const objectData = this.object.system
let actorData = duplicate(objectData)
let formData = {
title: this.title,
id: this.actor.id,
type: this.actor.type,
img: this.actor.img,
name: this.actor.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
data: actorData,
limited: this.object.limited,
skills: this.actor.getSkills( ),
weapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getWeapons()) ),
armors: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getArmors())),
shields: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getShields())),
spells: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getLore())),
equipments: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquipmentsOnly()) ),
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,
encCurrent: this.actor.encCurrent,
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
html.bind("keydown", function(e) { // Ignore Enter in actores sheet
if (e.keyCode === 13) return false;
});
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get( itemId );
item.sheet.render(true);
});
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item")
CrucibleUtility.confirmDelete(this, li)
})
html.find('.item-add').click(ev => {
let dataType = $(ev.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: "NewItem", type: dataType }], { renderSheet: true })
})
html.find('.equip-activate').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
this.actor.equipActivate( itemId)
});
html.find('.equip-deactivate').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
this.actor.equipDeactivate( itemId)
});
html.find('.subactor-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let actorId = li.data("actor-id");
let actor = game.actors.get( actorId );
actor.sheet.render(true);
});
html.find('.subactor-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let actorId = li.data("actor-id");
this.actor.delSubActor(actorId);
});
html.find('.quantity-minus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), -1 );
} );
html.find('.quantity-plus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), +1 );
} );
html.find('.ammo-minus').click(event => {
const li = $(event.currentTarget).parents(".item")
this.actor.incDecAmmo( li.data("item-id"), -1 );
} );
html.find('.ammo-plus').click(event => {
const li = $(event.currentTarget).parents(".item")
this.actor.incDecAmmo( li.data("item-id"), +1 )
} );
html.find('.roll-ability').click((event) => {
const abilityKey = $(event.currentTarget).data("ability-key");
this.actor.rollAbility(abilityKey);
});
html.find('.roll-skill').click((event) => {
const li = $(event.currentTarget).parents(".item")
const skillId = li.data("item-id")
this.actor.rollSkill(skillId)
});
html.find('.roll-weapon').click((event) => {
const li = $(event.currentTarget).parents(".item");
const skillId = li.data("item-id")
this.actor.rollWeapon(skillId)
});
html.find('.roll-armor-die').click((event) => {
this.actor.rollArmorDie()
});
html.find('.roll-shield-die').click((event) => {
this.actor.rollShieldDie()
});
html.find('.roll-target-die').click((event) => {
this.actor.rollDefenseRanged()
});
html.find('.roll-save').click((event) => {
const saveKey = $(event.currentTarget).data("save-key")
this.actor.rollSave(saveKey)
});
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-link a').click((event) => {
const itemId = $(event.currentTarget).data("item-id");
const item = this.actor.getOwnedItem(itemId);
item.sheet.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem( li.data("item-id") );
this.render(true);
});
html.find('.update-field').change(ev => {
const fieldName = $(ev.currentTarget).data("field-name");
let value = Number(ev.currentTarget.value);
this.actor.update( { [`${fieldName}`]: value } );
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
console.log(">>>>>> DROPPED!!!!")
const item = fromUuidSync(dragData.uuid)
if (item == undefined) {
item = this.actor.items.get( item.id )
}
let ret = await this.actor.preprocessItem( event, item, true )
if ( ret ) {
super._onDropItem(event, dragData)
}
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {
// Update the Actor
return this.object.update(formData);
}
}

808
modules/warhero-actor.js Normal file
View File

@ -0,0 +1,808 @@
/* -------------------------------------------- */
import { CrucibleUtility } from "./crucible-utility.js";
import { CrucibleRollDialog } from "./crucible-roll-dialog.js";
/* -------------------------------------------- */
const coverBonusTable = { "nocover": 0, "lightcover": 2, "heavycover": 4, "entrenchedcover": 6 };
const statThreatLevel = ["agi", "str", "phy", "com", "def", "per"]
const __subkey2title = {
"melee-dmg": "Melee Damage", "melee-atk": "Melee Attack", "ranged-atk": "Ranged Attack",
"ranged-dmg": "Ranged Damage", "dmg-res": "Damare Resistance"
}
/* -------------------------------------------- */
/* -------------------------------------------- */
/**
* 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 {
/* -------------------------------------------- */
/**
* Override the create() function to provide additional SoS functionality.
*
* This overrided create() function adds initial items
* Namely: Basic skills, money,
*
* @param {Object} data Barebones actor data which this function adds onto.
* @param {Object} options (Unused) Additional options which customize the creation workflow.
*
*/
static async create(data, options) {
// Case of compendium global import
if (data instanceof Array) {
return super.create(data, options);
}
// If the created actor has items (only applicable to duplicated actors) bypass the new actor creation logic
if (data.items) {
let actor = super.create(data, options);
return actor;
}
if (data.type == 'character') {
const skills = await CrucibleUtility.loadCompendium("fvtt-crucible-rpg.skills");
data.items = skills.map(i => i.toObject())
}
if (data.type == 'npc') {
}
return super.create(data, options);
}
/* -------------------------------------------- */
prepareBaseData() {
}
/* -------------------------------------------- */
async prepareData() {
super.prepareData();
}
/* -------------------------------------------- */
computeHitPoints() {
if (this.type == "character") {
let hp = duplicate(this.system.secondary.hp)
let max = (this.system.abilities.str.value + this.system.abilities.con.value) * 6
if (max != hp.max || hp.value > max) {
hp.max = max
hp.value = max // Init case
this.update({ 'system.secondary.hp': hp })
}
}
}
/* -------------------------------------------- */
computeEffortPoints() {
if (this.type == "character") {
let effort = duplicate(this.system.secondary.effort)
let max = (this.system.abilities.con.value + this.system.abilities.int.value) * 6
if (max != effort.max || effort.value > max) {
effort.max = max
effort.value = max // Init case
this.update({ 'system.secondary.effort': effort })
}
}
}
/* -------------------------------------------- */
prepareDerivedData() {
if (this.type == 'character' || game.user.isGM) {
this.system.encCapacity = this.getEncumbranceCapacity()
this.buildContainerTree()
this.computeHitPoints()
this.computeEffortPoints()
}
super.prepareDerivedData();
}
/* -------------------------------------------- */
_preUpdate(changed, options, user) {
super._preUpdate(changed, options, user);
}
/* -------------------------------------------- */
getEncumbranceCapacity() {
return 1;
}
/* -------------------------------------------- */
getMoneys() {
let comp = this.items.filter(item => item.type == 'money');
CrucibleUtility.sortArrayObjectsByName(comp)
return comp;
}
/* -------------------------------------------- */
getFeats() {
let comp = duplicate(this.items.filter(item => item.type == 'feat') || []);
CrucibleUtility.sortArrayObjectsByName(comp)
return comp;
}
/* -------------------------------------------- */
getFeatsWithDie() {
let comp = duplicate(this.items.filter(item => item.type == 'feat' && item.system.isfeatdie) || []);
CrucibleUtility.sortArrayObjectsByName(comp)
return comp;
}
getFeatsWithSL() {
let comp = duplicate(this.items.filter(item => item.type == 'feat' && item.system.issl) || []);
CrucibleUtility.sortArrayObjectsByName(comp)
return comp;
}
/* -------------------------------------------- */
getLore() {
let comp = duplicate(this.items.filter(item => item.type == 'spell') || []);
CrucibleUtility.sortArrayObjectsByName(comp)
return comp;
}
getEquippedWeapons() {
let comp = duplicate(this.items.filter(item => item.type == 'weapon' && item.system.equipped) || []);
CrucibleUtility.sortArrayObjectsByName(comp)
return comp;
}
/* -------------------------------------------- */
getArmors() {
let comp = duplicate(this.items.filter(item => item.type == 'armor') || []);
CrucibleUtility.sortArrayObjectsByName(comp)
return comp;
}
getEquippedArmor() {
let comp = this.items.find(item => item.type == 'armor' && item.system.equipped)
if (comp) {
return duplicate(comp)
}
return undefined
}
/* -------------------------------------------- */
getShields() {
let comp = duplicate(this.items.filter(item => item.type == 'shield') || []);
CrucibleUtility.sortArrayObjectsByName(comp)
return comp;
}
getEquippedShield() {
let comp = this.items.find(item => item.type == 'shield' && item.system.equipped)
if (comp) {
return duplicate(comp)
}
return undefined
}
/* -------------------------------------------- */
getRace() {
let race = this.items.filter(item => item.type == 'race')
return race[0] ?? [];
}
/* -------------------------------------------- */
checkAndPrepareEquipment(item) {
}
/* -------------------------------------------- */
checkAndPrepareEquipments(listItem) {
for (let item of listItem) {
this.checkAndPrepareEquipment(item)
}
return listItem
}
/* -------------------------------------------- */
getConditions() {
let comp = duplicate(this.items.filter(item => item.type == 'condition') || []);
CrucibleUtility.sortArrayObjectsByName(comp)
return comp;
}
/* -------------------------------------------- */
getWeapons() {
let comp = duplicate(this.items.filter(item => item.type == 'weapon') || []);
CrucibleUtility.sortArrayObjectsByName(comp)
return comp;
}
/* -------------------------------------------- */
getItemById(id) {
let item = this.items.find(item => item.id == id);
if (item) {
item = duplicate(item)
}
return item;
}
/* -------------------------------------------- */
getSkills() {
let comp = duplicate(this.items.filter(item => item.type == 'skill') || [])
for (let skill of comp) {
CrucibleUtility.updateSkill(skill)
}
CrucibleUtility.sortArrayObjectsByName(comp)
return comp
}
/* -------------------------------------------- */
getRelevantAbility(statKey) {
let comp = duplicate(this.items.filter(item => item.type == 'skill' && item.system.ability == ability) || []);
return comp;
}
/* -------------------------------------------- */
async equipItem(itemId) {
let item = this.items.find(item => item.id == itemId)
if (item && item.system) {
if (item.type == "armor") {
let armor = this.items.find(item => item.id != itemId && item.type == "armor" && item.system.equipped)
if (armor) {
ui.notifications.warn("You already have an armor equipped!")
return
}
}
if (item.type == "shield") {
let shield = this.items.find(item => item.id != itemId && item.type == "shield" && item.system.equipped)
if (shield) {
ui.notifications.warn("You already have a shield equipped!")
return
}
}
let update = { _id: item.id, "system.equipped": !item.system.equipped };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
}
}
/* -------------------------------------------- */
compareName(a, b) {
if (a.name < b.name) {
return -1;
}
if (a.name > b.name) {
return 1;
}
return 0;
}
/* ------------------------------------------- */
getEquipments() {
return this.items.filter(item => item.type == 'shield' || item.type == 'armor' || item.type == "weapon" || item.type == "equipment");
}
/* ------------------------------------------- */
getEquipmentsOnly() {
return duplicate(this.items.filter(item => item.type == "equipment") || [])
}
/* ------------------------------------------- */
getSaveRoll() {
return {
reflex: {
"label": "Reflex Save",
"img": "systems/fvtt-crucible-rpg/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",
"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",
"value": this.system.abilities.int.value + this.system.abilities.cha.value
}
}
}
/* ------------------------------------------- */
async buildContainerTree() {
let equipments = duplicate(this.items.filter(item => item.type == "equipment") || [])
for (let equip1 of equipments) {
if (equip1.system.iscontainer) {
equip1.system.contents = []
equip1.system.contentsEnc = 0
for (let equip2 of equipments) {
if (equip1._id != equip2.id && equip2.system.containerid == equip1.id) {
equip1.system.contents.push(equip2)
let q = equip2.system.quantity ?? 1
equip1.system.contentsEnc += q * equip2.system.weight
}
}
}
}
// Compute whole enc
let enc = 0
for (let item of equipments) {
//item.data.idrDice = CrucibleUtility.getDiceFromLevel(Number(item.data.idr))
if (item.system.equipped) {
if (item.system.iscontainer) {
enc += item.system.contentsEnc
} else if (item.system.containerid == "") {
let q = item.system.quantity ?? 1
enc += q * item.system.weight
}
}
}
for (let item of this.items) { // Process items/shields/armors
if ((item.type == "weapon" || item.type == "shield" || item.type == "armor") && item.system.equipped) {
let q = item.system.quantity ?? 1
enc += q * item.system.weight
}
}
// Store local values
this.encCurrent = enc
this.containersTree = equipments.filter(item => item.system.containerid == "") // Returns the root of equipements without container
}
/* -------------------------------------------- */
async rollArmor(rollData) {
let armor = this.getEquippedArmor()
if (armor) {
}
return { armor: "none" }
}
/* -------------------------------------------- */
async incDecHP(formula) {
let dmgRoll = new Roll(formula+"[crucible-orange]").roll({ async: false })
await CrucibleUtility.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 })
return Number(dmgRoll.total)
}
/* -------------------------------------------- */
getAbility(abilKey) {
return this.system.abilities[abilKey];
}
/* -------------------------------------------- */
async addObjectToContainer(itemId, containerId) {
let container = this.items.find(item => item.id == containerId && item.system.iscontainer)
let object = this.items.find(item => item.id == itemId)
if (container) {
if (object.system.iscontainer) {
ui.notifications.warn("Only 1 level of container allowed")
return
}
let alreadyInside = this.items.filter(item => item.system.containerid && item.system.containerid == containerId);
if (alreadyInside.length >= container.system.containercapacity) {
ui.notifications.warn("Container is already full !")
return
} else {
await this.updateEmbeddedDocuments("Item", [{ _id: object.id, 'system.containerid': containerId }])
}
} else if (object && object.system.containerid) { // remove from container
console.log("Removeing: ", object)
await this.updateEmbeddedDocuments("Item", [{ _id: object.id, 'system.containerid': "" }]);
}
}
/* -------------------------------------------- */
async preprocessItem(event, item, onDrop = false) {
let dropID = $(event.target).parents(".item").attr("data-item-id") // Only relevant if container drop
let objectID = item.id || item._id
this.addObjectToContainer(objectID, dropID)
return true
}
/* -------------------------------------------- */
async equipGear(equipmentId) {
let item = this.items.find(item => item.id == equipmentId);
if (item && item.system) {
let update = { _id: item.id, "system.equipped": !item.system.equipped };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
}
}
/* -------------------------------------------- */
getInitiativeScore(combatId, combatantId) {
if (this.type == 'character') {
this.rollMR(true, combatId, combatantId)
}
console.log("Init required !!!!")
return -1;
}
/* -------------------------------------------- */
getSubActors() {
let subActors = [];
for (let id of this.system.subactors) {
subActors.push(duplicate(game.actors.get(id)))
}
return subActors;
}
/* -------------------------------------------- */
async addSubActor(subActorId) {
let subActors = duplicate(this.system.subactors);
subActors.push(subActorId);
await this.update({ 'system.subactors': subActors });
}
/* -------------------------------------------- */
async delSubActor(subActorId) {
let newArray = [];
for (let id of this.system.subactors) {
if (id != subActorId) {
newArray.push(id);
}
}
await this.update({ 'system.subactors': newArray });
}
/* -------------------------------------------- */
syncRoll(rollData) {
this.lastRollId = rollData.rollId;
CrucibleUtility.saveRollData(rollData);
}
/* -------------------------------------------- */
getOneSkill(skillId) {
let skill = this.items.find(item => item.type == 'skill' && item.id == skillId)
if (skill) {
skill = duplicate(skill);
}
return skill;
}
/* -------------------------------------------- */
async deleteAllItemsByType(itemType) {
let items = this.items.filter(item => item.type == itemType);
await this.deleteEmbeddedDocuments('Item', items);
}
/* -------------------------------------------- */
async addItemWithoutDuplicate(newItem) {
let item = this.items.find(item => item.type == newItem.type && item.name.toLowerCase() == newItem.name.toLowerCase())
if (!item) {
await this.createEmbeddedDocuments('Item', [newItem]);
}
}
/* -------------------------------------------- */
async incrementSkillExp(skillId, inc) {
let skill = this.items.get(skillId)
if (skill) {
await this.updateEmbeddedDocuments('Item', [{ _id: skill.id, 'system.exp': skill.system.exp + inc }])
let chatData = {
user: game.user.id,
rollMode: game.settings.get("core", "rollMode"),
whisper: [game.user.id].concat(ChatMessage.getWhisperRecipients('GM')),
content: `<div>${this.name} has gained 1 exp in the skill ${skill.name} (exp = ${skill.system.exp})</div`
}
ChatMessage.create(chatData)
if (skill.system.exp >= 25) {
await this.updateEmbeddedDocuments('Item', [{ _id: skill.id, 'system.exp': 0, 'system.explevel': skill.system.explevel + 1 }])
let chatData = {
user: game.user.id,
rollMode: game.settings.get("core", "rollMode"),
whisper: [game.user.id].concat(ChatMessage.getWhisperRecipients('GM')),
content: `<div>${this.name} has gained 1 exp SL in the skill ${skill.name} (new exp SL : ${skill.system.explevel}) !</div`
}
ChatMessage.create(chatData)
}
}
}
/* -------------------------------------------- */
async incDecQuantity(objetId, incDec = 0) {
let objetQ = this.items.get(objetId)
if (objetQ) {
let newQ = objetQ.system.quantity + incDec
if (newQ >= 0) {
const updated = await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.quantity': newQ }]) // pdates one EmbeddedEntity
}
}
}
/* -------------------------------------------- */
async incDecAmmo(objetId, incDec = 0) {
let objetQ = this.items.get(objetId)
if (objetQ) {
let newQ = objetQ.system.ammocurrent + incDec;
if (newQ >= 0 && newQ <= objetQ.system.ammomax) {
const updated = await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.ammocurrent': newQ }]); // pdates one EmbeddedEntity
}
}
}
/* -------------------------------------------- */
isForcedAdvantage() {
return this.items.find(cond => cond.type == "condition" && cond.system.advantage)
}
isForcedDisadvantage() {
return this.items.find(cond => cond.type == "condition" && cond.system.disadvantage)
}
isForcedRollAdvantage() {
return this.items.find(cond => cond.type == "condition" && cond.system.rolladvantage)
}
isForcedRollDisadvantage() {
return this.items.find(cond => cond.type == "condition" && cond.system.rolldisadvantage)
}
isNoAdvantage() {
return this.items.find(cond => cond.type == "condition" && cond.system.noadvantage)
}
isNoAction() {
return this.items.find(cond => cond.type == "condition" && cond.system.noaction)
}
isAttackDisadvantage() {
return this.items.find(cond => cond.type == "condition" && cond.system.attackdisadvantage)
}
isDefenseDisadvantage() {
return this.items.find(cond => cond.type == "condition" && cond.system.defensedisadvantage)
}
isAttackerAdvantage() {
return this.items.find(cond => cond.type == "condition" && cond.system.targetadvantage)
}
/* -------------------------------------------- */
getCommonRollData(abilityKey = undefined) {
let noAction = this.isNoAction()
if (noAction) {
ui.notifications.warn("You can't do any actions du to the condition : " + noAction.name)
return
}
let rollData = CrucibleUtility.getBasicRollData()
rollData.alias = this.name
rollData.actorImg = this.img
rollData.actorId = this.id
rollData.img = this.img
rollData.featsDie = this.getFeatsWithDie()
rollData.featsSL = this.getFeatsWithSL()
rollData.armors = this.getArmors()
rollData.conditions = this.getConditions()
rollData.featDieName = "none"
rollData.featSLName = "none"
rollData.rollAdvantage = "none"
rollData.advantage = "none"
rollData.disadvantage = "none"
rollData.forceAdvantage = this.isForcedAdvantage()
rollData.forceDisadvantage = this.isForcedDisadvantage()
rollData.forceRollAdvantage = this.isForcedRollAdvantage()
rollData.forceRollDisadvantage = this.isForcedRollDisadvantage()
rollData.noAdvantage = this.isNoAdvantage()
if (rollData.defenderTokenId) {
let defenderToken = game.canvas.tokens.get(rollData.defenderTokenId)
let defender = defenderToken.actor
// Distance management
let token = this.token
if (!token) {
let tokens = this.getActiveTokens()
token = tokens[0]
}
if (token) {
const ray = new Ray(token.object?.center || token.center, defenderToken.center)
rollData.tokensDistance = canvas.grid.measureDistances([{ ray }], { gridSpaces: false })[0] / canvas.grid.grid.options.dimensions.distance
} else {
ui.notifications.info("No token connected to this actor, unable to compute distance.")
return
}
if (defender) {
rollData.forceAdvantage = defender.isAttackerAdvantage()
rollData.advantageFromTarget = true
}
}
if (abilityKey) {
rollData.ability = this.getAbility(abilityKey)
rollData.selectedKill = undefined
}
console.log("ROLLDATA", rollData)
return rollData
}
/* -------------------------------------------- */
rollAbility(abilityKey) {
let rollData = this.getCommonRollData(abilityKey)
rollData.mode = "ability"
if (rollData.target) {
ui.notifications.warn("You are targetting a token with a skill : please use a Weapon instead.")
return
}
CrucibleUtility.rollCrucible(rollData)
}
/* -------------------------------------------- */
rollSkill(skillId) {
let skill = this.items.get(skillId)
if (skill) {
if (skill.system.islore && skill.system.level == 0) {
ui.notifications.warn("You can't use Lore Skills with a SL of 0.")
return
}
skill = duplicate(skill)
CrucibleUtility.updateSkill(skill)
let abilityKey = skill.system.ability
let rollData = this.getCommonRollData(abilityKey)
rollData.mode = "skill"
rollData.skill = skill
rollData.img = skill.img
if (rollData.target) {
ui.notifications.warn("You are targetting a token with a skill : please use a Weapon instead.")
return
}
this.startRoll(rollData)
}
}
/* -------------------------------------------- */
rollWeapon(weaponId) {
let weapon = this.items.get(weaponId)
if (weapon) {
weapon = duplicate(weapon)
let skill = this.items.find(item => item.name.toLowerCase() == weapon.system.skill.toLowerCase())
if (skill) {
skill = duplicate(skill)
CrucibleUtility.updateSkill(skill)
let abilityKey = skill.system.ability
let rollData = this.getCommonRollData(abilityKey)
rollData.mode = "weapon"
rollData.skill = skill
rollData.weapon = weapon
rollData.img = weapon.img
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})` )
return
}*/
this.startRoll(rollData)
} else {
ui.notifications.warn("Unable to find the relevant skill for weapon " + weapon.name)
}
}
}
/* -------------------------------------------- */
rollDefenseMelee(attackRollData) {
let weapon = this.items.get(attackRollData.defenseWeaponId)
if (weapon) {
weapon = duplicate(weapon)
let skill = this.items.find(item => item.name.toLowerCase() == weapon.system.skill.toLowerCase())
if (skill) {
skill = duplicate(skill)
CrucibleUtility.updateSkill(skill)
let abilityKey = skill.system.ability
let rollData = this.getCommonRollData(abilityKey)
rollData.defenderTokenId = undefined // Cleanup
rollData.mode = "weapondefense"
rollData.shield = this.getEquippedShield()
rollData.attackRollData = duplicate(attackRollData)
rollData.skill = skill
rollData.weapon = weapon
rollData.img = weapon.img
if (!rollData.forceDisadvantage) { // This is an attack, check if disadvantaged
rollData.forceDisadvantage = this.isDefenseDisadvantage()
}
this.startRoll(rollData)
} else {
ui.notifications.warn("Unable to find the relevant skill for weapon " + weapon.name)
}
} else {
ui.notifications.warn("Weapon not found ! ")
}
}
/* -------------------------------------------- */
rollDefenseRanged(attackRollData) {
let rollData = this.getCommonRollData()
rollData.defenderTokenId = undefined // Cleanup
rollData.mode = "rangeddefense"
if ( attackRollData) {
rollData.attackRollData = duplicate(attackRollData)
rollData.effectiveRange = CrucibleUtility.getWeaponRange(attackRollData.weapon)
rollData.tokensDistance = attackRollData.tokensDistance // QoL copy
}
rollData.sizeDice = CrucibleUtility.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"
rollData.useshield = false
rollData.shield = this.getEquippedShield()
this.startRoll(rollData)
}
/* -------------------------------------------- */
rollShieldDie() {
let shield = this.getEquippedShield()
if (shield) {
shield = duplicate(shield)
let rollData = this.getCommonRollData()
rollData.mode = "shield"
rollData.shield = shield
rollData.useshield = true
rollData.img = shield.img
this.startRoll(rollData)
}
}
/* -------------------------------------------- */
async rollArmorDie(rollData = undefined) {
let armor = this.getEquippedArmor()
if (armor) {
armor = duplicate(armor)
let reduce = 0
let multiply = 1
let disadvantage = false
let advantage = false
let messages = ["Armor applied"]
if (rollData) {
if (CrucibleUtility.isArmorLight(armor) && CrucibleUtility.isWeaponPenetrating(rollData.attackRollData.weapon)) {
return { armorIgnored: true, nbSuccess: 0, messages: ["Armor ignored : Penetrating weapons ignore Light Armors."] }
}
if (CrucibleUtility.isWeaponPenetrating(rollData.attackRollData.weapon)) {
messages.push("Armor reduced by 1 (Penetrating weapon)")
reduce = 1
}
if (CrucibleUtility.isWeaponLight(rollData.attackRollData.weapon)) {
messages.push("Armor with advantage (Light weapon)")
advantage = true
}
if (CrucibleUtility.isWeaponHeavy(rollData.attackRollData.weapon)) {
messages.push("Armor with disadvantage (Heavy weapon)")
disadvantage = true
}
if (CrucibleUtility.isWeaponHack(rollData.attackRollData.weapon)) {
messages.push("Armor reduced by 1 (Hack weapon)")
reduce = 1
}
if (CrucibleUtility.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)
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 armorValue2 = Math.max(0, (Number(armorResult2.text) + reduce) * multiply)
if (advantage) {
armorValue = (armorValue2 > armorValue) ? armorValue2 : armorValue
messages.push(`Armor advantage - Roll 1 = ${armorValue} - Roll 2 = ${armorValue2}`)
}
if (disadvantage) {
armorValue = (armorValue2 < armorValue) ? armorValue2 : armorValue
messages.push(`Armor disadvantage - Roll 1 = ${armorValue} - Roll 2 = ${armorValue2}`)
}
}
armorResult.armorValue = armorValue
if (!rollData) {
ChatMessage.create({ content: "Armor result : " + armorValue })
}
messages.push("Armor result : " + armorValue)
return { armorIgnored: false, nbSuccess: armorValue, rawArmor: armorResult.text, messages: messages }
}
return { armorIgnored: true, nbSuccess: 0, messages: ["No armor equipped."] }
}
/* -------------------------------------------- */
rollSave(saveKey) {
let saves = this.getSaveRoll()
let save = saves[saveKey]
if (save) {
save = duplicate(save)
let rollData = this.getCommonRollData()
rollData.mode = "save"
rollData.save = save
if (rollData.target) {
ui.notifications.warn("You are targetting a token with a save roll - Not authorized.")
return
}
this.startRoll(rollData)
}
}
/* -------------------------------------------- */
async startRoll(rollData) {
this.syncRoll(rollData)
let rollDialog = await CrucibleRollDialog.create(this, rollData)
rollDialog.render(true)
}
}

30
modules/warhero-combat.js Normal file
View File

@ -0,0 +1,30 @@
import { CrucibleUtility } from "./crucible-utility.js";
/* -------------------------------------------- */
export class CrucibleCombat extends Combat {
/* -------------------------------------------- */
async rollInitiative(ids, formula = undefined, messageOptions = {} ) {
ids = typeof ids === "string" ? [ids] : ids;
for (let cId = 0; cId < ids.length; cId++) {
const c = this.combatants.get(ids[cId]);
let id = c._id || c.id;
let initBonus = c.actor ? c.actor.getInitiativeScore( this.id, id ) : -1;
await this.updateEmbeddedDocuments("Combatant", [ { _id: id, initiative: initBonus } ]);
}
return this;
}
/* -------------------------------------------- */
_onUpdate(changed, options, userId) {
}
/* -------------------------------------------- */
static async checkTurnPosition() {
while (game.combat.turn > 0) {
await game.combat.previousTurn()
}
}
}

144
modules/warhero-commands.js Normal file
View File

@ -0,0 +1,144 @@
/* -------------------------------------------- */
import { CrucibleUtility } from "./crucible-utility.js";
import { CrucibleRollDialog } from "./crucible-roll-dialog.js";
/* -------------------------------------------- */
const __saveFirstToKey = { r: "reflex", f: "fortitude", w: "willpower"}
/* -------------------------------------------- */
export class CrucibleCommands {
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" });
game.system.cruciblerpg.commands = crucibleCommands;
}
}
constructor() {
this.commandsTable = {};
}
/* -------------------------------------------- */
registerCommand(command) {
this._addCommand(this.commandsTable, command.path, '', command);
}
/* -------------------------------------------- */
_addCommand(targetTable, path, fullPath, command) {
if (!this._validateCommand(targetTable, path, command)) {
return;
}
const term = path[0];
fullPath = fullPath + term + ' '
if (path.length == 1) {
command.descr = `<strong>${fullPath}</strong>: ${command.descr}`;
targetTable[term] = command;
}
else {
if (!targetTable[term]) {
targetTable[term] = { subTable: {} };
}
this._addCommand(targetTable[term].subTable, path.slice(1), fullPath, command)
}
}
/* -------------------------------------------- */
_validateCommand(targetTable, path, command) {
if (path.length > 0 && path[0] && command.descr && (path.length != 1 || targetTable[path[0]] == undefined)) {
return true;
}
console.warn("crucibleCommands._validateCommand failed ", targetTable, path, command);
return false;
}
/* -------------------------------------------- */
/* Manage chat commands */
processChatCommand(commandLine, content = '', msg = {}) {
// Setup new message's visibility
let rollMode = game.settings.get("core", "rollMode");
if (["gmroll", "blindroll"].includes(rollMode)) msg["whisper"] = ChatMessage.getWhisperRecipients("GM");
if (rollMode === "blindroll") msg["blind"] = true;
msg["type"] = 0;
let command = commandLine[0].toLowerCase();
let params = commandLine.slice(1);
return this.process(command, params, content, msg);
}
/* -------------------------------------------- */
process(command, params, content, msg) {
return this._processCommand(this.commandsTable, command, params, content, msg);
}
/* -------------------------------------------- */
_processCommand(commandsTable, name, params, content = '', msg = {}, path = "") {
console.log("===> Processing command")
let command = commandsTable[name];
path = path + name + " ";
if (command && command.subTable) {
if (params[0]) {
return this._processCommand(command.subTable, params[0], params.slice(1), content, msg, path)
}
else {
this.help(msg, command.subTable);
return true;
}
}
if (command && command.func) {
const result = command.func(content, msg, params);
if (result == false) {
CrucibleCommands._chatAnswer(msg, command.descr);
}
return true;
}
return false;
}
/* -------------------------------------------- */
static _chatAnswer(msg, content) {
msg.whisper = [game.user.id];
msg.content = content;
ChatMessage.create(msg);
}
/* -------------------------------------------- */
static rollTarget(msg, params) {
const speaker = ChatMessage.getSpeaker()
let actor
if (speaker.token) actor = game.actors.tokens[speaker.token]
if (!actor) actor = game.actors.get(speaker.actor)
if (!actor) {
return ui.notifications.warn(`Select your actor to run the macro`)
}
actor.rollDefenseRanged()
}
/* -------------------------------------------- */
static rollSave(msg, params) {
console.log(msg, params)
if ( params.length == 0) {
ui.notifications.warn("/rsave command error : syntax is /rsave reflex, /rsave fortitude or /rsave willpower")
return
}
let saveKey = params[0].toLowerCase()
if ( saveKey.length > 0 && (saveKey[0] == "r" || saveKey[0] == "f" || saveKey[0] == "w")) {
const speaker = ChatMessage.getSpeaker()
let actor
if (speaker.token) actor = game.actors.tokens[speaker.token]
if (!actor) actor = game.actors.get(speaker.actor)
if (!actor) {
return ui.notifications.warn(`Select your actor to run the macro`)
}
actor.rollSave( __saveFirstToKey[saveKey[0]] )
} else {
ui.notifications.warn("/rsave syntax error : syntax is /rsave reflex, /rsave fortitude or /rsave willpower")
}
}
}

68
modules/warhero-hotbar.js Normal file
View File

@ -0,0 +1,68 @@
export class CrucibleHotbar {
static async addToHotbar(item, slot) {
let command = `game.system.cruciblerpg.CrucibleHotbar.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({
name: item.name,
type: "script",
img: item.img,
command: command
}, { displaySheet: false })
}
await game.user.assignHotbarMacro(macro, slot);
}
/**
* Create a macro when dropping an entity on the hotbar
* Item - open roll dialog for item
* Actor - open actor sheet
* Journal - open journal sheet
*/
static initDropbar() {
Hooks.on("hotbarDrop", (bar, documentData, slot) => {
// Create item macro if rollable item - weapon, spell, prayer, trait, or skill
if (documentData.type == "Item") {
let item = fromUuidSync(documentData.uuid)
if (item == undefined) {
item = this.actor.items.get(documentData.uuid)
}
if (item && (item.type =="weapon" || item.type =="skill")) {
this.addToHotbar(item, slot)
return false
}
}
return true;
});
}
/** Roll macro */
static rollMacro(itemName, itemType, bypassData) {
const speaker = ChatMessage.getSpeaker()
let actor
if (speaker.token) actor = game.actors.tokens[speaker.token]
if (!actor) actor = game.actors.get(speaker.actor)
if (!actor) {
return ui.notifications.warn(`Select your actor to run the macro`)
}
let item = actor.items.find(it => it.name === itemName && it.type == itemType)
if (!item) {
return ui.notifications.warn(`Unable to find the item of the macro in the current actor`)
}
// Trigger the item roll
if (item.type === "weapon") {
return actor.rollWeapon(item.id)
}
if (item.type === "skill") {
return actor.rollSkill(item.id)
}
}
}

View File

@ -0,0 +1,170 @@
import { CrucibleUtility } from "./crucible-utility.js";
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class CrucibleItemSheet 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",
dragDrop: [{ dragSelector: null, dropSelector: null }],
width: 620,
height: 550,
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
});
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
// Add "Post to chat" button
// We previously restricted this to GM and editable items only. If you ever find this comment because it broke something: eh, sorry!
buttons.unshift(
{
class: "post",
icon: "fas fa-comment",
onclick: ev => { }
})
return buttons
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
if (this.item.type.includes('weapon')) {
position.width = 640;
}
return position;
}
/* -------------------------------------------- */
async getData() {
if ( this.object.type == "skill") {
CrucibleUtility.updateSkill(this.object)
}
let objectData = duplicate(this.object.system)
let itemData = objectData
let formData = {
title: this.title,
id: this.id,
type: this.object.type,
img: this.object.img,
name: this.object.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
weaponSkills: CrucibleUtility.getWeaponSkills(),
shieldSkills: CrucibleUtility.getShieldSkills(),
description: await TextEditor.enrichHTML(this.object.system.description, {async: true}),
data: itemData,
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,
isGM: game.user.isGM
}
this.options.editable = !(this.object.origin == "embeddedItem");
console.log("ITEM DATA", formData, this);
return formData;
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
buttons.unshift({
class: "post",
icon: "fas fa-comment",
onclick: ev => this.postItem()
});
return buttons
}
/* -------------------------------------------- */
postItem() {
let chatData = duplicate(CrucibleUtility.data(this.item));
if (this.actor) {
chatData.actor = { id: this.actor.id };
}
// Don't post any image for the item (which would leave a large gap) if the default image is used
if (chatData.img.includes("/blank.png")) {
chatData.img = null;
}
// JSON object for easy creation
chatData.jsondata = JSON.stringify(
{
compendium: "postedItem",
payload: chatData,
});
renderTemplate('systems/fvtt-crucible-rpg/templates/post-item.html', chatData).then(html => {
let chatOptions = CrucibleUtility.chatDataSetup(html);
ChatMessage.create(chatOptions)
});
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item");
const item = this.object.options.actor.getOwnedItem(li.data("item-id"));
item.sheet.render(true);
});
html.find('.delete-spec').click(ev => {
this.object.update({ "data.specialisation": [{ name: 'None' }] });
});
html.find('.delete-subitem').click(ev => {
this.deleteSubitem(ev);
});
// Update Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let itemId = li.data("item-id");
let itemType = li.data("item-type");
});
html.find('.view-subitem').click(ev => {
this.viewSubitem(ev);
});
html.find('.view-spec').click(ev => {
this.manageSpec();
});
}
/* -------------------------------------------- */
get template() {
let type = this.item.type;
return `systems/fvtt-crucible-rpg/templates/item-${type}-sheet.html`;
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {
return this.object.update(formData)
}
}

25
modules/warhero-item.js Normal file
View File

@ -0,0 +1,25 @@
import { CrucibleUtility } from "./crucible-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",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class CrucibleItem extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}

120
modules/warhero-main.js Normal file
View File

@ -0,0 +1,120 @@
/**
* Crucible system
* Author: Uberwald
* Software License: Prop
*/
/* -------------------------------------------- */
/* -------------------------------------------- */
// 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"
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
/************************************************************************************/
Hooks.once("init", async function () {
console.log(`Initializing Crucible RPG`);
game.system.cruciblerpg = {
CrucibleHotbar,
CrucibleCommands
}
/* -------------------------------------------- */
// preload handlebars templates
CrucibleUtility.preloadHandlebarsTemplates();
/* -------------------------------------------- */
// Set an initiative formula for the system
CONFIG.Combat.initiative = {
formula: "1d6",
decimals: 1
};
/* -------------------------------------------- */
game.socket.on("system.fvtt-crucible-rpg", data => {
CrucibleUtility.onSocketMesssage(data)
});
/* -------------------------------------------- */
// Define custom Entity classes
CONFIG.Combat.documentClass = CrucibleCombat
CONFIG.Actor.documentClass = CrucibleActor
CONFIG.Item.documentClass = CrucibleItem
//CONFIG.Token.objectClass = CrucibleToken
/* -------------------------------------------- */
// 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 });
Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("fvtt-crucible", CrucibleItemSheet, { makeDefault: true });
CrucibleUtility.init()
});
/* -------------------------------------------- */
function welcomeMessage() {
ChatMessage.create({
user: game.user.id,
whisper: [game.user.id],
content: `<div id="welcome-message-crucible"><span class="rdd-roll-part">
<strong>Welcome to the Crucible RPG.</strong>
` });
}
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.once("ready", function () {
// User warning
if (!game.user.isGM && game.user.character == undefined) {
ui.notifications.info("Warning ! No character linked to your user !");
ChatMessage.create({
content: "<b>WARNING</b> The player " + game.user.name + " is not linked to a character !",
user: game.user._id
});
}
// CSS patch for v9
if (game.version) {
let sidebar = document.getElementById("sidebar");
sidebar.style.width = "min-content";
}
welcomeMessage();
CrucibleUtility.ready()
CrucibleCommands.init()
CrucibleHotbar.initDropbar()
})
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.on("chatMessage", (html, content, msg) => {
if (content[0] == '/') {
let regExp = /(\S+)/g;
let commands = content.match(regExp);
if (game.system.cruciblerpg.commands.processChatCommand(commands, content, msg)) {
return false;
}
}
return true;
});

View File

@ -0,0 +1,209 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { CrucibleUtility } from "./crucible-utility.js";
/* -------------------------------------------- */
export class CrucibleNPCSheet extends ActorSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["crucible-rpg", "sheet", "actor"],
template: "systems/fvtt-crucible-rpg/templates/npc-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: true
});
}
/* -------------------------------------------- */
async getData() {
const objectData = this.object.system
let actorData = duplicate(objectData)
let formData = {
title: this.title,
id: this.actor.id,
type: this.actor.type,
img: this.actor.img,
name: this.actor.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
data: actorData,
limited: this.object.limited,
skills: this.actor.getSkills( ),
weapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getWeapons()) ),
armors: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getArmors())),
shields: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getShields())),
spells: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getLore())),
equipments: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquipmentsOnly()) ),
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(),
containersTree: this.actor.containersTree,
encCurrent: this.actor.encCurrent,
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
html.bind("keydown", function(e) { // Ignore Enter in actores sheet
if (e.keyCode === 13) return false;
});
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get( itemId );
item.sheet.render(true);
});
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item")
CrucibleUtility.confirmDelete(this, li)
})
html.find('.item-add').click(ev => {
let dataType = $(ev.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: "NewItem", type: dataType }], { renderSheet: true })
})
html.find('.equip-activate').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
this.actor.equipActivate( itemId)
});
html.find('.equip-deactivate').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
this.actor.equipDeactivate( itemId)
});
html.find('.subactor-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let actorId = li.data("actor-id");
let actor = game.actors.get( actorId );
actor.sheet.render(true);
});
html.find('.subactor-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let actorId = li.data("actor-id");
this.actor.delSubActor(actorId);
});
html.find('.quantity-minus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), -1 );
} );
html.find('.quantity-plus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), +1 );
} );
html.find('.ammo-minus').click(event => {
const li = $(event.currentTarget).parents(".item")
this.actor.incDecAmmo( li.data("item-id"), -1 );
} );
html.find('.ammo-plus').click(event => {
const li = $(event.currentTarget).parents(".item")
this.actor.incDecAmmo( li.data("item-id"), +1 )
} );
html.find('.roll-ability').click((event) => {
const abilityKey = $(event.currentTarget).data("ability-key");
this.actor.rollAbility(abilityKey);
});
html.find('.roll-skill').click((event) => {
const li = $(event.currentTarget).parents(".item")
const skillId = li.data("item-id")
this.actor.rollSkill(skillId)
});
html.find('.roll-weapon').click((event) => {
const li = $(event.currentTarget).parents(".item");
const skillId = li.data("item-id")
this.actor.rollWeapon(skillId)
});
html.find('.roll-armor-die').click((event) => {
this.actor.rollArmorDie()
});
html.find('.roll-shield-die').click((event) => {
this.actor.rollShieldDie()
});
html.find('.roll-target-die').click((event) => {
this.actor.rollDefenseRanged()
});
html.find('.roll-save').click((event) => {
const saveKey = $(event.currentTarget).data("save-key")
this.actor.rollSave(saveKey)
});
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-link a').click((event) => {
const itemId = $(event.currentTarget).data("item-id");
const item = this.actor.getOwnedItem(itemId);
item.sheet.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem( li.data("item-id") );
this.render(true);
});
html.find('.update-field').change(ev => {
const fieldName = $(ev.currentTarget).data("field-name");
let value = Number(ev.currentTarget.value);
this.actor.update( { [`${fieldName}`]: value } );
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {
// Update the Actor
return this.object.update(formData);
}
}

View File

@ -0,0 +1,84 @@
import { CrucibleUtility } from "./crucible-utility.js";
export class CrucibleRollDialog 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);
return new CrucibleRollDialog(actor, rollData, html, options);
}
/* -------------------------------------------- */
constructor(actor, rollData, html, options, close = undefined) {
let conf = {
title: (rollData.mode == "skill") ? "Skill" : "Attribute",
content: html,
buttons: {
roll: {
icon: '<i class="fas fa-check"></i>',
label: "Roll !",
callback: () => { this.roll() }
},
cancel: {
icon: '<i class="fas fa-times"></i>',
label: "Cancel",
callback: () => { this.close() }
}
},
close: close
}
super(conf, options);
this.actor = actor;
this.rollData = rollData;
}
/* -------------------------------------------- */
roll() {
CrucibleUtility.rollCrucible(this.rollData)
}
/* -------------------------------------------- */
async refreshDialog() {
const content = await renderTemplate("systems/fvtt-crucible-rpg/templates/roll-dialog-generic.html", this.rollData)
this.data.content = content
this.render(true)
}
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html);
var dialog = this;
function onLoad() {
}
$(function () { onLoad(); });
html.find('#advantage').change((event) => {
this.rollData.advantage = event.currentTarget.value
})
html.find('#disadvantage').change((event) => {
this.rollData.disadvantage = event.currentTarget.value
})
html.find('#rollAdvantage').change((event) => {
this.rollData.rollAdvantage = event.currentTarget.value
})
html.find('#useshield').change((event) => {
this.rollData.useshield = event.currentTarget.checked
})
html.find('#hasCover').change((event) => {
this.rollData.hasCover = event.currentTarget.value
})
html.find('#situational').change((event) => {
this.rollData.situational = event.currentTarget.value
})
html.find('#distanceBonusDice').change((event) => {
this.rollData.distanceBonusDice = Number(event.currentTarget.value)
})
}
}

6
modules/warhero-token.js Normal file
View File

@ -0,0 +1,6 @@
import { CrucibleUtility } from "./crucible-utility.js";
/* -------------------------------------------- */
export class CrucibleToken extends Token {
}

903
modules/warhero-utility.js Normal file
View File

@ -0,0 +1,903 @@
/* -------------------------------------------- */
import { CrucibleCombat } from "./crucible-combat.js";
import { CrucibleCommands } from "./crucible-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 {
/* -------------------------------------------- */
static async init() {
Hooks.on('renderChatLog', (log, html, data) => CrucibleUtility.chatListeners(html));
/*Hooks.on("dropCanvasData", (canvas, data) => {
CrucibleUtility.dropItemOnToken(canvas, data)
});*/
this.rollDataStore = {}
this.defenderStore = {}
CrucibleCommands.init();
Handlebars.registerHelper('count', function (list) {
return list.length;
})
Handlebars.registerHelper('includes', function (array, val) {
return array.includes(val);
})
Handlebars.registerHelper('upper', function (text) {
return text.toUpperCase();
})
Handlebars.registerHelper('lower', function (text) {
return text.toLowerCase()
})
Handlebars.registerHelper('upperFirst', function (text) {
if (typeof text !== 'string') return text
return text.charAt(0).toUpperCase() + text.slice(1)
})
Handlebars.registerHelper('notEmpty', function (list) {
return list.length > 0;
})
Handlebars.registerHelper('mul', function (a, b) {
return parseInt(a) * parseInt(b);
})
this.gameSettings()
}
/*-------------------------------------------- */
static gameSettings() {
/*game.settings.register("fvtt-crucible-rpg", "dice-color-skill", {
name: "Dice color for skills",
hint: "Set the dice color for skills",
scope: "world",
config: true,
requiresReload: true ,
default: "#101010",
type: String
})
Hooks.on('renderSettingsConfig', (event) => {
const element = event.element[0].querySelector(`[name='fvtt-crucible-rpg.dice-color-skill']`)
if (!element) return
// Replace placeholder element
console.log("Element Found !!!!")
}) */
}
/*-------------------------------------------- */
static addDiceColors() {
game.dice3d.addColorset({
name: 'crucible-orange',
category: "crucible",
foreground: '#9F8003',
background: "#FFA500",
visibility: 'visible'
}, "preferred");
game.dice3d.addColorset({
name: 'crucible-purple',
category: "crucible",
foreground: '#9F8003',
background: "#800080",
visibility: 'visible'
}, "preferred");
game.dice3d.addColorset({
name: 'crucible-darkgreen',
category: "crucible",
foreground: '#9F8003',
background: "#006400",
visibility: 'visible'
}, "preferred");
}
/*-------------------------------------------- */
static upperFirst(text) {
if (typeof text !== 'string') return text
return text.charAt(0).toUpperCase() + text.slice(1)
}
/*-------------------------------------------- */
static getSkills() {
return duplicate(this.skills)
}
/*-------------------------------------------- */
static getWeaponSkills() {
return duplicate(this.weaponSkills)
}
/*-------------------------------------------- */
static getShieldSkills() {
return duplicate(this.shieldSkills)
}
/* -------------------------------------------- */
static async ready() {
const skills = await CrucibleUtility.loadCompendium("fvtt-crucible-rpg.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")
this.rollTables = rollTables.map(i => i.toObject())
this.addDiceColors()
}
/* -------------------------------------------- */
static async loadCompendiumData(compendium) {
const pack = game.packs.get(compendium)
return await pack?.getDocuments() ?? []
}
/* -------------------------------------------- */
static async loadCompendium(compendium, filter = item => true) {
let compendiumData = await CrucibleUtility.loadCompendiumData(compendium)
return compendiumData.filter(filter)
}
/* -------------------------------------------- */
static isArmorLight(armor) {
if (armor && (armor.system.armortype.includes("light") || armor.system.armortype.includes("clothes"))) {
return true
}
return false
}
/* -------------------------------------------- */
static isWeaponPenetrating(weapon) {
if (weapon && weapon.system.qualities.toLowerCase().includes("penetrating")) {
return true
}
return false
}
/* -------------------------------------------- */
static isWeaponLight(weapon) {
if (weapon && weapon.system.qualities.toLowerCase().includes("light")) {
return true
}
return false
}
/* -------------------------------------------- */
static isWeaponHeavy(weapon) {
if (weapon && weapon.system.qualities.toLowerCase().includes("heavy")) {
return true
}
return false
}
/* -------------------------------------------- */
static isWeaponHack(weapon) {
if (weapon && weapon.system.qualities.toLowerCase().includes("hack")) {
return true
}
return false
}
/* -------------------------------------------- */
static isWeaponUndamaging(weapon) {
if (weapon && weapon.system.qualities.toLowerCase().includes("undamaging")) {
return true
}
return false
}
/* -------------------------------------------- */
static isWeaponDangerous(weapon) {
if (weapon && weapon.system.qualities.toLowerCase().includes("dangerous")) {
return true
}
return false
}
/* -------------------------------------------- */
static isWeaponDeadly(weapon) {
if (weapon && weapon.system.qualities.toLowerCase().includes("deadly")) {
return true
}
return false
}
static getWeaponRange(weapon) {
if (weapon && weapon.system.isranged) {
let rangeValue = weapon.system.range.replace(/[^0-9]/g, '')
return Number(rangeValue)
}
return false
}
static getWeaponMaxRange(weapon) {
if (weapon && weapon.system.isranged) {
let rangeValue = weapon.system.maxrange.replace(/[^0-9]/g, '')
return Number(rangeValue)
}
return false
}
/* -------------------------------------------- */
static async getRollTableFromDiceColor(diceColor, displayChat = true) {
let rollTableName = __color2RollTable[diceColor]
if (rollTableName) {
const pack = game.packs.get("fvtt-crucible-rpg.rolltables")
const index = await pack.getIndex()
const entry = index.find(e => e.name === rollTableName)
let table = await pack.getDocument(entry._id)
const draw = await table.draw({ displayChat: displayChat, rollMode: "gmroll" })
return draw.results.length > 0 ? draw.results[0] : undefined
}
}
/* -------------------------------------------- */
static getSizeDice(sizeValue) {
return __size2Dice[sizeValue]
}
/* -------------------------------------------- */
static async getCritical(level, weapon) {
const pack = game.packs.get("fvtt-crucible-rpg.rolltables")
let tableName = "Crit " + level + " (" + this.upperFirst(weapon.system.damage) + ")"
const index = await pack.getIndex()
const entry = index.find(e => e.name === tableName)
let table = await pack.getDocument(entry._id)
const draw = await table.draw({ displayChat: false, rollMode: "gmroll" })
return draw.results.length > 0 ? draw.results[0] : undefined
}
/* -------------------------------------------- */
static async chatListeners(html) {
html.on("click", '.view-item-from-chat', event => {
game.system.crucible.creator.openItemView(event)
})
html.on("click", '.roll-defense-melee', event => {
let rollId = $(event.currentTarget).data("roll-id")
let rollData = CrucibleUtility.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)) {
actor.rollDefenseMelee(rollData)
}
})
html.on("click", '.roll-defense-ranged', event => {
let rollId = $(event.currentTarget).data("roll-id")
let rollData = CrucibleUtility.getRollData(rollId)
let defender = game.canvas.tokens.get(rollData.defenderTokenId).actor
if (defender && (game.user.isGM || defender.isOwner)) {
defender.rollDefenseRanged(rollData)
}
})
}
/* -------------------------------------------- */
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'
]
return loadTemplates(templatePaths);
}
/* -------------------------------------------- */
static removeChatMessageId(messageId) {
if (messageId) {
game.messages.get(messageId)?.delete();
}
}
static findChatMessageId(current) {
return CrucibleUtility.getChatMessageId(CrucibleUtility.findChatMessage(current));
}
static getChatMessageId(node) {
return node?.attributes.getNamedItem('data-message-id')?.value;
}
static findChatMessage(current) {
return CrucibleUtility.findNodeMatching(current, it => it.classList.contains('chat-message') && it.attributes.getNamedItem('data-message-id'));
}
static findNodeMatching(current, predicate) {
if (current) {
if (predicate(current)) {
return current;
}
return CrucibleUtility.findNodeMatching(current.parentElement, predicate);
}
return undefined;
}
/* -------------------------------------------- */
static createDirectOptionList(min, max) {
let options = {};
for (let i = min; i <= max; i++) {
options[`${i}`] = `${i}`;
}
return options;
}
/* -------------------------------------------- */
static buildListOptions(min, max) {
let options = ""
for (let i = min; i <= max; i++) {
options += `<option value="${i}">${i}</option>`
}
return options;
}
/* -------------------------------------------- */
static getTarget() {
if (game.user.targets) {
for (let target of game.user.targets) {
return target
}
}
return undefined
}
/* -------------------------------------------- */
static updateRollData(rollData) {
let id = rollData.rollId
let oldRollData = this.rollDataStore[id] || {}
let newRollData = mergeObject(oldRollData, rollData)
this.rollDataStore[id] = newRollData
}
/* -------------------------------------------- */
static saveRollData(rollData) {
game.socket.emit("system.crucible-rpg", {
name: "msg_update_roll", data: rollData
}); // Notify all other clients of the roll
this.updateRollData(rollData)
}
/* -------------------------------------------- */
static getRollData(id) {
return this.rollDataStore[id]
}
/* -------------------------------------------- */
static async displayDefenseMessage(rollData) {
if (rollData.mode == "weapon" && rollData.defenderTokenId) {
let defender = game.canvas.tokens.get(rollData.defenderTokenId).actor
if (game.user.isGM || (game.user.character && game.user.character.id == defender.id)) {
rollData.defender = defender
rollData.defenderWeapons = defender.getEquippedWeapons()
rollData.isRangedAttack = rollData.weapon?.system.isranged
this.createChatWithRollMode(defender.name, {
name: defender.name,
alias: defender.name,
//user: defender.id,
content: await renderTemplate(`systems/fvtt-crucible-rpg/templates/chat-request-defense.html`, rollData),
whisper: [defender.id].concat(ChatMessage.getWhisperRecipients('GM')),
})
}
}
}
/* -------------------------------------------- */
static getSuccessResult(rollData) {
if (rollData.sumSuccess <= -3) {
if (rollData.attackRollData.weapon.system.isranged) {
return { result: "miss", fumble: true, hpLossType: "melee" }
} else {
return { result: "miss", fumble: true, attackerHPLoss: "2d3", hpLossType: "melee" }
}
}
if (rollData.sumSuccess == -2) {
if (rollData.attackRollData.weapon.system.isranged) {
return { result: "miss", dangerous_fumble: true }
} else {
return { result: "miss", dangerous_fumble: true, attackerHPLoss: "1d3", hpLossType: "melee" }
}
}
if (rollData.sumSuccess == -1) {
return { result: "miss" }
}
if (rollData.sumSuccess == 0) {
if (rollData.attackRollData.weapon.system.isranged) {
return { result: "target_space", aoe: true }
} else {
return { result: "clash", hack_vs_shields: true }
}
}
if (rollData.sumSuccess == 1) {
return { result: "hit", defenderDamage: "1", entangle: true, knockback: true }
}
if (rollData.sumSuccess == 2) {
return { result: "hit", defenderDamage: "2", critical_1: true, entangle: true, knockback: true, penetrating_impale: true, hack_armors: true }
}
if (rollData.sumSuccess >= 3) {
return { result: "hit", defenderDamage: "3", critical_2: true, entangle: true, knockback: true, penetrating_impale: true, hack_armors: true }
}
}
/* -------------------------------------------- */
static async getFumble(weapon) {
const pack = game.packs.get("fvtt-crucible-rpg.rolltables")
const index = await pack.getIndex()
let entry
if (weapon.isranged) {
entry = index.find(e => e.name === "Fumble! (ranged)")
}
if (!weapon.isranged) {
entry = index.find(e => e.name === "Fumble! (melee)")
}
let table = await pack.getDocument(entry._id)
const draw = await table.draw({ displayChat: false, rollMode: "gmroll" })
return draw.results.length > 0 ? draw.results[0] : undefined
}
/* -------------------------------------------- */
static async processSuccessResult(rollData) {
if (game.user.isGM) { // Only GM process this
let result = rollData.successDetails
let attacker = game.actors.get(rollData.actorId)
let defender = game.canvas.tokens.get(rollData.attackRollData.defenderTokenId).actor
if (attacker && result.attackerHPLoss) {
result.attackerHPLossValue = await attacker.incDecHP("-" + result.attackerHPLoss)
}
if (attacker && defender && result.defenderDamage) {
let dmgDice = (rollData.attackRollData.weapon.system.isranged) ? "d6" : "d8"
result.damageWeaponFormula = result.defenderDamage + dmgDice
result.defenderHPLossValue = await defender.incDecHP("-" + result.damageWeaponFormula)
}
if (result.fumble || (result.dangerous_fumble && CrucibleUtility.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)
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)
})
console.log("Results processed", rollData)
}
}
/* -------------------------------------------- */
static async processAttackDefense(rollData) {
if (rollData.attackRollData) {
//console.log("Defender token, ", rollData, rollData.defenderTokenId)
let defender = game.canvas.tokens.get(rollData.attackRollData.defenderTokenId).actor
let sumSuccess = rollData.attackRollData.nbSuccess - rollData.nbSuccess
if (sumSuccess > 0) {
let armorResult = await defender.rollArmorDie(rollData)
rollData.armorResult = armorResult
sumSuccess += rollData.armorResult.nbSuccess
if (sumSuccess < 0) { // Never below 0
sumSuccess = 0
}
}
rollData.sumSuccess = sumSuccess
rollData.successDetails = this.getSuccessResult(rollData)
if (game.user.isGM) {
this.processSuccessResult(rollData)
} else {
game.socket.emit("system.fvtt-crucible-rpg", { msg: "msg_gm_process_attack_defense", data: rollData });
}
}
}
/* -------------------------------------------- */
static async onSocketMesssage(msg) {
console.log("SOCKET MESSAGE", msg.name)
if (msg.name == "msg_update_roll") {
this.updateRollData(msg.data)
}
if (msg.name == "msg_gm_process_attack_defense") {
this.processSuccessResult(msg.data)
}
if (msg.name == "msg_gm_item_drop" && game.user.isGM) {
let actor = game.actors.get(msg.data.actorId)
let item
if (msg.data.isPack) {
item = await fromUuid("Compendium." + msg.data.isPack + "." + msg.data.itemId)
} else {
item = game.items.get(msg.data.itemId)
}
this.addItemDropToActor(actor, item)
}
}
/* -------------------------------------------- */
static chatDataSetup(content, modeOverride, isRoll = false, forceWhisper) {
let chatData = {
user: game.user.id,
rollMode: modeOverride || game.settings.get("core", "rollMode"),
content: content
};
if (["gmroll", "blindroll"].includes(chatData.rollMode)) chatData["whisper"] = ChatMessage.getWhisperRecipients("GM").map(u => u.id);
if (chatData.rollMode === "blindroll") chatData["blind"] = true;
else if (chatData.rollMode === "selfroll") chatData["whisper"] = [game.user];
if (forceWhisper) { // Final force !
chatData["speaker"] = ChatMessage.getSpeaker();
chatData["whisper"] = ChatMessage.getWhisperRecipients(forceWhisper);
}
return chatData;
}
/* -------------------------------------------- */
static async showDiceSoNice(roll, rollMode) {
if (game.modules.get("dice-so-nice")?.active) {
if (game.dice3d) {
let whisper = null;
let blind = false;
rollMode = rollMode ?? game.settings.get("core", "rollMode");
switch (rollMode) {
case "blindroll": //GM only
blind = true;
case "gmroll": //GM + rolling player
whisper = this.getUsers(user => user.isGM);
break;
case "roll": //everybody
whisper = this.getUsers(user => user.active);
break;
case "selfroll":
whisper = [game.user.id];
break;
}
await game.dice3d.showForRoll(roll, game.user, true, whisper, blind);
}
}
}
/* -------------------------------------------- */
static updateSkill(skill) {
skill.system.level = skill.system.background + skill.system.basic + skill.system.class + skill.system.explevel
if (skill.system.level > 7) { skill.system.level = 7 }
skill.system.skilldice = __skillLevel2Dice[skill.system.level]
}
/* -------------------------------------------- */
static getDiceFromCover(cover) {
if (cover == "cover50") return 1
return 0
}
/* -------------------------------------------- */
static getDiceFromSituational(cover) {
if (cover == "prone") return 1
if (cover == "dodge") return 1
if (cover == "moving") return 1
if (cover == "engaged") return 1
return 0
}
/* -------------------------------------------- */
static async rollCrucible(rollData) {
let actor = game.actors.get(rollData.actorId)
// ability/save/size => 0
let diceFormula
let startFormula = "0d6cs>=5[blue]"
if (rollData.ability) {
startFormula = String(rollData.ability.value) + "d6cs>=5[blue]"
}
if (rollData.save) {
startFormula = String(rollData.save.value) + "d6cs>=5[blue]"
}
if (rollData.sizeDice) {
let nb = rollData.sizeDice.nb + rollData.distanceBonusDice + this.getDiceFromCover(rollData.hasCover) + this.getDiceFromSituational(rollData.situational)
startFormula = String(nb) + String(rollData.sizeDice.dice) + "cs>=5[blue]"
}
diceFormula = startFormula
// skill => 2
// feat => 4
// bonus => 6
if (rollData.skill) {
let level = rollData.skill.system.level
if (rollData.skill.system.issl2) {
rollData.hasSLBonus = true
level += 2
if (level > 7) { level = 7 }
}
rollData.skill.system.skilldice = __skillLevel2Dice[level]
diceFormula += "+" + String(rollData.skill.system.skilldice) + "cs>=5[black]"
if (rollData.skill.system.skilltype == "complex" && rollData.skill.system.level == 0) {
rollData.complexSkillDisadvantage = true
rollData.rollAdvantage = "roll-disadvantage"
}
if (rollData.skill.system.isfeatdie) {
rollData.hasFeatDie = true
diceFormula += "+ 1d10cs>=5[crucible-purple]"
} else {
diceFormula += `+ 0d10cs>=5[crucible-purple]`
}
if (rollData.skill.system.bonusdice != "none") {
rollData.hasBonusDice = rollData.skill.system.bonusdice
diceFormula += `+ ${rollData.hasBonusDice}cs>=5[black]`
} else {
diceFormula += `+ 0d6cs>=5[black]`
}
} else {
diceFormula += `+ 0d8cs=>5 + 0d10cs>=5 + 0d6cs>=5`
}
// advantage => 8
let advFormula = "+ 0d8cs>=5"
if (rollData.advantage == "advantage1" || rollData.forceAdvantage) {
advFormula = "+ 1d8cs>=5[crucible-darkgreen]"
}
if (rollData.advantage == "advantage2") {
advFormula = "+ 2d8cs>=5[crucible-darkgreen]"
}
diceFormula += advFormula
// disadvantage => 10
let disFormula = "- 0d8cs>=5"
if (rollData.disadvantage == "disadvantage1" || rollData.forceDisadvantage) {
disFormula = "- 1d8cs>=5[red]"
}
if (rollData.disadvantage == "disadvantage2") {
disFormula = "- 2d8cs>=5[red]"
}
diceFormula += disFormula
// armor => 12
let skillArmorPenalty = 0
for (let armor of rollData.armors) {
if (armor.system.equipped) {
skillArmorPenalty += armor.system.skillpenalty
}
}
if (rollData.skill && rollData.skill.system.armorpenalty && skillArmorPenalty > 0) {
rollData.skillArmorPenalty = skillArmorPenalty
diceFormula += `- ${skillArmorPenalty}d8cs>=5`
} else {
diceFormula += `- 0d8cs>=5`
}
// shield => 14
if (rollData.useshield && rollData.shield) {
diceFormula += "+ 1" + String(rollData.shield.system.shielddie) + "cs>=5[yellow]"
} else {
diceFormula += " + 0d6cs>=5"
}
// Performs roll
console.log("Roll formula", diceFormula)
let myRoll = rollData.roll
if (!myRoll) { // New rolls only of no rerolls
myRoll = new Roll(diceFormula).roll({ async: false })
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
}
rollData.rollOrder = 0
rollData.roll = myRoll
rollData.nbSuccess = myRoll.total
if (rollData.rollAdvantage == "none" && rollData.forceRollAdvantage) {
rollData.rollAdvantage = "roll-advantage"
}
if (rollData.rollAdvantage == "none" && rollData.forceRollDisadvantage) {
rollData.rollAdvantage = "roll-disadvantage"
}
if (rollData.rollAdvantage != "none") {
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)
})
rollData.rollOrder = 2
let myRoll2 = new Roll(diceFormula).roll({ async: false })
await this.showDiceSoNice(myRoll2, game.settings.get("core", "rollMode"))
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)
})
rollData.roll = myRoll // Revert the tmp switch
rollData.nbSuccess = myRoll.total
if (rollData.rollAdvantage == "roll-advantage") {
if (myRoll2.total > rollData.nbSuccess) {
hasChanged = true
rollData.roll = myRoll2
rollData.nbSuccess = myRoll2.total
}
} else {
if (myRoll2.total < rollData.nbSuccess) {
rollData.roll = myRoll2
rollData.nbSuccess = myRoll2.total
}
}
rollData.rollOrder = 3
}
rollData.nbSuccess = Math.max(0, rollData.nbSuccess)
rollData.isFirstRollAdvantage = false
// Manage exp
if (rollData.skill && rollData.skill.system.level > 0) {
let nbSkillSuccess = rollData.roll.terms[2].total
if (nbSkillSuccess == 0 || nbSkillSuccess == rollData.skill.system.level) {
actor.incrementSkillExp(rollData.skill.id, 1)
}
}
this.saveRollData(rollData)
actor.lastRoll = rollData
this.createChatWithRollMode(rollData.alias, {
content: await renderTemplate(`systems/fvtt-crucible-rpg/templates/chat-generic-result.html`, rollData)
})
console.log("Rolldata result", rollData)
// Message response
this.displayDefenseMessage(rollData)
// Manage defense result
this.processAttackDefense(rollData)
}
/* -------------------------------------------- */
static sortArrayObjectsByName(myArray) {
myArray.sort((a, b) => {
let fa = a.name.toLowerCase();
let fb = b.name.toLowerCase();
if (fa < fb) {
return -1;
}
if (fa > fb) {
return 1;
}
return 0;
})
}
/* -------------------------------------------- */
static getUsers(filter) {
return game.users.filter(filter).map(user => user.id);
}
/* -------------------------------------------- */
static getWhisperRecipients(rollMode, name) {
switch (rollMode) {
case "blindroll": return this.getUsers(user => user.isGM);
case "gmroll": return this.getWhisperRecipientsAndGMs(name);
case "selfroll": return [game.user.id];
}
return undefined;
}
/* -------------------------------------------- */
static getWhisperRecipientsAndGMs(name) {
let recep1 = ChatMessage.getWhisperRecipients(name) || [];
return recep1.concat(ChatMessage.getWhisperRecipients('GM'));
}
/* -------------------------------------------- */
static blindMessageToGM(chatOptions) {
let chatGM = duplicate(chatOptions);
chatGM.whisper = this.getUsers(user => user.isGM);
chatGM.content = "Blinde message of " + game.user.name + "<br>" + chatOptions.content;
console.log("blindMessageToGM", chatGM);
game.socket.emit("system.fvtt-crucible-rpg", { msg: "msg_gm_chat_message", data: chatGM });
}
/* -------------------------------------------- */
static async searchItem(dataItem) {
let item
if (dataItem.pack) {
item = await fromUuid("Compendium." + dataItem.pack + "." + dataItem.id)
} else {
item = game.items.get(dataItem.id)
}
return item
}
/* -------------------------------------------- */
static split3Columns(data) {
let array = [[], [], []];
if (data == undefined) return array;
let col = 0;
for (let key in data) {
let keyword = data[key];
keyword.key = key; // Self-reference
array[col].push(keyword);
col++;
if (col == 3) col = 0;
}
return array;
}
/* -------------------------------------------- */
static createChatMessage(name, rollMode, chatOptions) {
switch (rollMode) {
case "blindroll": // GM only
if (!game.user.isGM) {
this.blindMessageToGM(chatOptions);
chatOptions.whisper = [game.user.id];
chatOptions.content = "Message only to the GM";
}
else {
chatOptions.whisper = this.getUsers(user => user.isGM);
}
break;
default:
chatOptions.whisper = this.getWhisperRecipients(rollMode, name);
break;
}
chatOptions.alias = chatOptions.alias || name;
ChatMessage.create(chatOptions);
}
/* -------------------------------------------- */
static getBasicRollData() {
let rollData = {
rollId: randomID(16),
rollMode: game.settings.get("core", "rollMode"),
advantage: "none"
}
CrucibleUtility.updateWithTarget(rollData)
return rollData
}
/* -------------------------------------------- */
static updateWithTarget(rollData) {
let target = CrucibleUtility.getTarget()
if (target) {
rollData.defenderTokenId = target.id
}
}
/* -------------------------------------------- */
static createChatWithRollMode(name, chatOptions) {
this.createChatMessage(name, game.settings.get("core", "rollMode"), chatOptions)
}
/* -------------------------------------------- */
static async confirmDelete(actorSheet, li) {
let itemId = li.data("item-id");
let msgTxt = "<p>Are you sure to remove this Item ?";
let buttons = {
delete: {
icon: '<i class="fas fa-check"></i>',
label: "Yes, remove it",
callback: () => {
actorSheet.actor.deleteEmbeddedDocuments("Item", [itemId]);
li.slideUp(200, () => actorSheet.render(false));
}
},
cancel: {
icon: '<i class="fas fa-times"></i>',
label: "Cancel"
}
}
msgTxt += "</p>";
let d = new Dialog({
title: "Confirm removal",
content: msgTxt,
buttons: buttons,
default: "cancel"
});
d.render(true);
}
}

1497
styles/simple.css Normal file

File diff suppressed because it is too large Load Diff

60
styles/unused.html Normal file
View File

@ -0,0 +1,60 @@
{{!-- Carac Tab --}}
<div class="tab items" data-group="primary" data-tab="statistics">
<div class="grid grid-2col">
<div class="">
<div class="flexrow">
<span class="generic-label packed-left"><a class="generic-pool-roll"><button class="chat-card-button">Dice Pool</button></a></span>
</div>
</div>
<div class="">
<ul>
<li class="item flexrow list-item" data-key="momentum">
<span class="stat-label flexrow" name="momentum"> <h4>{{data.momentum.label}}</h4> </span>
<input type="text" class="padd-right" name="data.momentum.value" value="{{data.momentum.value}}" data-dtype="Number"/>
<input type="text" class="padd-right" name="data.momentum.max" value="{{data.momentum.max}}" data-dtype="Number"/>
</li>
</ul>
</div>
</div>
</div>
<ul>
<li class="item flexrow list-item" data-key="mr">
<span class="stat-label flexrow" name="mr">
<a class="roll-mr" data-stat-key="{{mr}}"><h4>{{data.mr.label}}</h4></a>
</span>
<select class="carac-base flexrow" type="text" name="data.mr.value" value="{{data.mr.value}}"
data-dtype="Number" >
{{#select data.mr.value}}
{{{@root.optionsDiceList}}}
{{/select}}
</select>
<input type="text" class="padd-right input-numeric-short" name="data.mr.mod" value="{{data.mr.mod}}" data-dtype="Number"/>
</li>
</ul>
<li class="item flexrow list-item" data-attr-key="{{key}}">
{{#each data.secondary as |stat2 key|}}
{{#if stat2.iscombat}}
<span class="stat-label" name="{{key}}">
<h4>{{stat2.label}} : </h4>
</span>
<span class="small-label padd-right packed-left">Cur</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.secondary.{{key}}.value" value="{{stat2.value}}" data-dtype="Number"/>
<span class="small-label padd-right packed-left">&nbsp;Max</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.secondary.{{key}}.max" value="{{stat2.max}}" data-dtype="Number"/>
{{/if}}
{{/each}}
</li>
<li class="item flexrow list-item" data-key="momentum">
<span class="stat-label flexrow" name="momentum"><h4>{{data.momentum.label}}:</h4></span>
<span class="small-label padd-right packed-left">Cur</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.momentum.value" value="{{data.momentum.value}}" data-dtype="Number"/>
<span class="small-label padd-right packed-left">&nbsp;Max</span><input type="text" class="padd-right update-field input-numeric-short" data-field-name="data.momentum.max" value="{{data.momentum.max}}" data-dtype="Number"/>
</li>

214
system.json Normal file
View File

@ -0,0 +1,214 @@
{
"authors": [
{
"name": "Uberwald",
"flags": {}
}
],
"description": "Warhero RPG system for FoundryVTT",
"esmodules": [
"modules/warhero-main.js"
],
"gridDistance": 5,
"gridUnits": "m",
"languages": [
{
"lang": "en",
"name": "English",
"path": "lang/en.json",
"flags": {}
}
],
"license": "LICENSE.txt",
"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",
"private": false,
"flags": {}
}
],
"primaryTokenAttribute": "secondary.hp",
"secondaryTokenAttribute": "secondary.effort",
"socket": true,
"styles": [
"styles/simple.css"
],
"version": "10.0.0",
"compatibility": {
"minimum": "10",
"verified": "10",
"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",
"id": "fvtt-warhero"
}

205
template.json Normal file
View File

@ -0,0 +1,205 @@
{
"Actor": {
"types": ["character", "npc"],
"templates": {
"biodata": {
"biodata": {
"class": "",
"age": 0,
"size": 0,
"weight": "",
"height": "",
"hair": "",
"sex": "",
"eyes": "",
"background": "",
"description": "",
"notes": "",
"gmnotes": ""
}
},
"core": {
"subactors": [],
"abilities": {
"str":{
"label": "Strength",
"abbrev": "str",
"col": 1,
"value": 1
},
"agi":{
"label": "Agility",
"abbrev": "agi",
"col": 1,
"value": 1
},
"dex":{
"label": "Dexterity",
"abbrev": "dex",
"col": 1,
"value": 1
},
"con":{
"label": "Constitution",
"abbrev": "con",
"col": 1,
"value": 1
},
"int":{
"label": "Intelligence",
"abbrev": "int",
"col": 2,
"value": 1
},
"wit":{
"label": "Wits",
"abbrev": "wit",
"col": 2,
"value": 1
},
"cha":{
"label": "Charisma",
"abbrev": "cha",
"col": 2,
"value": 1
}
},
"secondary": {
"hp": {
"label": "Hitpoint",
"abbrev": "hb",
"value": -1,
"max": 0
},
"effort": {
"label": "Effort",
"abbrev": "eff",
"value": -1,
"max": 0
}
},
"social": {
"fame": {
"label": "Fame",
"value": 0
},
"reputation": {
"label": "Reputation",
"value": 0
}
}
},
"npccore": {
"npctype": "",
"description": ""
}
},
"character": {
"templates": [ "biodata", "core" ]
},
"npc": {
"templates": [ "biodata", "core" ]
}
},
"Item": {
"types": [ "race", "skill", "armor", "shield", "equipment", "weapon", "money" , "feat", "spell", "condition", "poison"],
"poison": {
"description": ""
},
"condition": {
"advantage": false,
"disadvantage": false,
"rolladvantage": false,
"rolldisadvantage": false,
"loosehpround": false,
"loohproundvalue": 0,
"noadvantage": false,
"attackdisadvantage": false,
"defensedisadvantage": false,
"targetadvantage": false,
"noaction": false,
"description": ""
},
"race": {
"description": ""
},
"feat": {
"isfeatdie": false,
"issl": false,
"sl": 0,
"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,
"description": ""
},
"armor": {
"armortype": "",
"absorprionroll": "",
"damagedroll": "",
"isproficient": false,
"minstr": 0,
"skillpenalty": 0,
"equipped": false,
"cost": 0,
"description":""
},
"shield": {
"shielddie": "",
"skill": "",
"equipped": false,
"cost": 0,
"description":""
},
"equipment": {
"equiptype": "",
"cost": 0,
"quantity": 0,
"equipped": false,
"iscontainer": false,
"containercapacity": 0,
"containerid": "",
"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,
"range": "",
"description": ""
}
}
}

530
templates/actor-sheet.html Normal file
View File

@ -0,0 +1,530 @@
<form class="{{cssClass}}" autocomplete="off">
{{!-- Sheet Header --}}
<header class="sheet-header">
<div class="header-fields">
<h1 class="charname margin-right"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
<div class="flexrow">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" />
<div class="flexcol">
<div class="flexrow">
<div class="ability-item">
<ul>
{{#each data.abilities as |ability key|}}
{{#if (eq ability.col 1)}}
{{> systems/fvtt-crucible-rpg/templates/partial-actor-ability-block.html ability=ability key=key}}
{{/if}}
{{/each}}
</ul>
<li class="item flexrow list-item" data-attr-key="class">
<span class="ability-label " name="class">
<h4 class="ability-text-white ability-margin">Class</h4>
</span>
<select class="competence-base flexrow" type="text" name="system.biodata.class" value="{{data.biodata.class}}" data-dtype="String">
{{#select data.biodata.class}}
<option value="chaplain">Chaplain</option>
<option value="magus">Magus</option>
<option value="martial">Martial</option>
<option value="skalawag">Skalawag</option>
<option value="warden">Warden</option>
{{/select}}
</select>
</li>
</div>
<div class="ability-item">
<ul>
{{#each data.abilities as |ability key|}}
{{#if (eq ability.col 2)}}
{{> systems/fvtt-crucible-rpg/templates/partial-actor-ability-block.html ability=ability key=key}}
{{/if}}
{{/each}}
{{#if equippedArmor}}
<li class="item flexrow list-item" data-attr-key="class">
<img class="sheet-competence-img" src="{{equippedArmor.img}}" />
<span class="ability-label " name="class">
<h4 class="ability-text-white ability-margin"><a class="roll-armor-die ability-margin">{{equippedArmor.name}}</a></h4>
</span>
</li>
{{/if}}
{{#if equippedShield}}
<li class="item flexrow list-item" data-attr-key="class">
<img class="sheet-competence-img" src="{{equippedShield.img}}" />
<span class="ability-label " name="equippedShield">
<h4 class="ability-text-white ability-margin"><a class="roll-shield-die ability-margin">{{equippedShield.name}}</a></h4>
</span>
</li>
{{/if}}
<li class="item flexrow list-item" data-attr-key="class">
<img class="sheet-competence-img" src="systems/fvtt-crucible-rpg/images/icons/feats/Marksman (Ballistic).webp" />
<span class="ability-label " name="rollTarget">
<h4 class="ability-text-white ability-margin"><a class="roll-target-die ability-margin">Target Roll</a></h4>
</span>
</li>
</ul>
</div>
<div class="ability-item status-block">
{{> systems/fvtt-crucible-rpg/templates/partial-actor-status.html}}
</div>
</div>
</div>
</div>
</div>
</header>
{{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="skills">Skills</a>
<a class="item" data-tab="combat">Combat</a>
<a class="item" data-tab="lore">Lore</a>
<a class="item" data-tab="equipment">Equipment</a>
<a class="item" data-tab="biodata">Biography</a>
</nav>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Skills Tab --}}
<div class="tab skills" data-group="primary" data-tab="skills">
<ul class="stat-list alternate-list item-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Skills</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Ability</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Dice</label>
</span>
<span class="item-field-label-long">
<label class="short-label">Background</label>
</span>
</li>
{{#each skills as |skill key|}}
<li class="item stat flexrow list-item list-item-shadow" data-item-id="{{skill._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{skill.img}}" /></a>
<span class="item-name-label"><a class="roll-skill">{{skill.name}}</a></span>
<span class="item-field-label-short">{{upper skill.system.ability}}</span>
<span class="item-field-label-short">{{skill.system.skilldice}}</span>
<span class="item-field-label-long">&nbsp;-&nbsp;</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
{{!-- Combat Tab --}}
<div class="tab combat" data-group="primary" data-tab="combat">
<div class="flexcol">
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header-long">
<h3><label class="items-title-text">Weapons</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Ability</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Range</label>
</span>
</li>
{{#each equippedWeapons as |weapon key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{weapon._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{weapon.img}}" /></a>
<span class="item-name-label-long"><a class ="roll-weapon">{{weapon.name}}</a></span>
<span class="item-field-label-short">{{weapon.system.ability}}</span>
<span class="item-field-label-medium">{{perk.system.range}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header-long">
<h3><label class="items-title-text">Feats</label></h3>
</span>
<span class="item-field-label-medium">
<label class="short-label">Feature Die?</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">SL?</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">SL</label>
</span>
</li>
{{#each feats as |feat key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{feat._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{feat.img}}" /></a>
<span class="item-name-label-long">{{feat.name}}</span>
<span class="item-field-label-medium">{{upperFirst feat.system.isfeatdie}}</span>
<span class="item-field-label-medium">{{upperFirst feat.system.issl}}</span>
<span class="item-field-label-medium">{{feat.system.sl}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header-long">
<h3><label class="items-title-text">Conditions</label></h3>
</span>
</li>
{{#each conditions as |condition key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{condition._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{condition.img}}" /></a>
<span class="item-name-label-long">{{condition.name}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
</div>
{{!-- Lore Tab --}}
<div class="tab lore" data-group="primary" data-tab="lore">
<div class="flexcol">
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Lore</label></h3>
</span>
<span class="item-field-label-medium">
<label class="short-label">Lore</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Circle</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Range</label>
</span>
</li>
{{#each spells as |spell key|}}
<li class="item stat flexrow list-item list-item-shadow" data-item-id="{{spell._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{spell.img}}" /></a>
<span class="item-name-label">
<a class="power-roll">{{spell.name}}</a>
</span>
<span class="item-field-label-medium">{{upperFirst spell.system.lore}}</span>
<span class="item-field-label-short">{{upperFirst spell.system.circle}}</span>
<span class="item-field-label-medium">{{upperFirst spell.system.range}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
{{!-- Equipement Tab --}}
<div class="tab equipment" data-group="primary" data-tab="equipment">
<div class="flexrow">
<h3>Encumbrance</h3>
<span class="small-label">Current : {{encCurrent}}</span>
<span class="small-label">Capacity : {{encCapacity}}</span>
</div>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Money</label></h3>
</span>
<span class="item-field-label-long">
<label class="short-label">Qty</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Weight</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">IDR</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="money" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each moneys as |money key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{money._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{money.img}}" /></a>
<span class="item-name-label">{{money.name}}</span>
<span class="item-field-label-long"><label>
{{money.system.quantity}}
(<a class="quantity-minus plus-minus-button"> -</a>/<a class="quantity-plus plus-minus-button">+</a>)
</label>
</span>
<span class="item-field-label-medium">
<label>{{money.system.weight}}</label>
</span>
<span class="item-field-label-medium">
{{#if money.system.idrDice}}
<a class="roll-idr" data-dice-value="{{money.data.idrDice}}">{{money.system.idrDice}}</a>
{{else}}
&nbsp;-&nbsp;
{{/if}}
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Weapons</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Attack</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Damage</label>
</span>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="weapon" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each weapons as |weapon key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{weapon._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{weapon.img}}" /></a>
<span class="item-name-label">{{weapon.name}}</span>
<span class="item-field-label-short"><label>{{upper weapon.system.ability}}</label></span>
<span class="item-field-label-short"><label>{{upper weapon.system.damage}}</label></span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-equip" title="Worn">{{#if weapon.system.equipped}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Armors</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Type</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Absorption</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="armor" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each armors as |armor key|}}
<li class="item list-item flexrow list-item-shadow" data-item-id="{{armor._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{armor.img}}" /></a>
<span class="item-name-label">{{armor.name}}</span>
<span class="item-field-label-short">{{upper armor.system.armortype}}</span>
<span class="item-field-label-short">{{armor.system.absorprionroll}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-equip" title="Worn">{{#if armor.system.equipped}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Shields</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Dice</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="shield" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each shields as |shield key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{shield._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{shield.img}}" /></a>
<span class="item-name-label">{{shield.name}}</span>
<span class="item-field-label-short">{{shield.system.levelDice}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-equip" title="Worn">{{#if shield.system.equipped}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Equipment</label></h3>
</span>
<span class="item-field-label-long">
<label class="short-label">Quantity</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="equipment" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each containersTree as |equip key|}}
{{> systems/fvtt-crucible-rpg/templates/partial-actor-equipment.html equip=equip level=1}}
<ul class="item-list list-item-shadow2 list-item-margin1">
{{#each equip.data.contents as |subgear key|}}
{{> systems/fvtt-crucible-rpg/templates/partial-actor-equipment.html equip=subgear level=2}}
{{/each}}
</ul>
{{/each}}
</ul>
<hr>
</div>
{{!-- Biography Tab --}}
<div class="tab biodata" data-group="primary" data-tab="biodata">
<div class="grid grid-2col">
<div>
<ul class="item-list alternate-list">
<li class="item flexrow">
<label class="generic-label">Origin</label>
<input type="text" class="" name="system.biodata.origin" value="{{data.biodata.origin}}"
data-dtype="String" />
</li>
<li class="item flexrow">
<label class="generic-label">Age</label>
<input type="text" class="" name="system.biodata.age" value="{{data.biodata.age}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="generic-label">Height</label>
<input type="text" class="" name="system.biodata.height" value="{{data.biodata.height}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="generic-label">Eyes</label>
<input type="text" class="" name="system.biodata.eyes" value="{{data.biodata.eyes}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="generic-label">Hair</label>
<input type="text" class="" name="system.biodata.hair" value="{{data.biodata.hair}}" data-dtype="String" />
</li>
</ul>
</div>
<div>
<ul>
<li class="flexrow item">
<label class="generic-label">Size</label>
<select class="competence-base flexrow" type="text" name="system.biodata.size" value="{{data.biodata.size}}" data-dtype="Number">
{{#select data.biodata.size}}
<option value="1">Tiny</option>
<option value="2">Small</option>
<option value="3">Medium</option>
<option value="4">Large</option>
<option value="5">Huge</option>
<option value="6">Gargantuan</option>
{{/select}}
</select>
</li>
<li class="flexrow item">
<label class="generic-label">Sex</label>
<input type="text" class="" name="system.biodata.sex" value="{{data.biodata.sex}}" data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label">Preferred Hand</label>
<input type="text" class="" name="system.biodata.preferredhand" value="{{data.biodata.preferredhand}}"
data-dtype="String" />
</li>
<li class="flexrow item" data-item-id="{{race._id}}">
<label class="generic-label">Race</label>
<a class="item-edit"><img class="stat-icon" src="{{race.img}}"></a>
<input type="text" class="" name="system.biodata.racename" value="{{data.biodata.racename}}" data-dtype="String" />
</li>
</ul>
</div>
</div>
<hr>
<h3>Background : </h3>
<div class="form-group editor">
{{editor description target="system.biodata.description" button=true owner=owner
editable=editable}}
</div>
<hr>
<h3>Notes : </h3>
<div class="form-group editor">
{{editor notes target="system.biodata.notes" button=true owner=owner editable=editable}}
</div>
<hr>
</article>
</div>
</section>
</form>

View File

@ -0,0 +1,75 @@
<div class="chat-message-header">
{{#if actorImg}}
<img class="actor-icon" src="{{actorImg}}" alt="{{alias}}" />
{{/if}}
<h4 class=chat-actor-name>{{alias}}</h4>
</div>
<hr>
{{#if img}}
<div >
<img class="chat-icon" src="{{img}}" alt="{{name}}" />
</div>
{{/if}}
<div class="flexcol">
</div>
<div>
<ul>
<li><strong>Fight result !</strong></li>
{{#if successDetails.fumbleDetails}}
<li>Fumble ! : {{successDetails.fumbleDetails.data.text}} </li>
{{/if}}
{{#if armorResult}}
<li>Armor initial result : {{armorResult.rawArmor}}</li>
{{#each armorResult.messages as |message idx|}}
<li>{{message}}</li>
{{/each}}
{{/if}}
{{#if successDetails.hack_vs_shields}}
<li>Hack weapon : check shield !</li>
{{/if}}
{{#if successDetails.entangle}}
<li>Entangle weapon : attacker can entangle !</li>
{{/if}}
{{#if successDetails.knockback}}
<li>Knockback weapon : check knockback !</li>
{{/if}}
{{#if successDetails.hack_armors}}
<li>Hack weapon : check armor damage !</li>
{{/if}}
{{#if successDetails.penetrating_impale}}
<li>Penetrating weapon : apply the Impale condition !</li>
{{/if}}
{{#if (or successDetails.critical_1 successDetails.critical_2)}}
<li>Critical {{#if successDetails.critical_1}} 1 {{else}} 2 {{/if}} : {{successDetails.criticalText}} </li>
{{/if}}
{{#if successDetails.attackerHPLossValue}}
<li>Attacker has lost HP : {{successDetails.attackerHPLossValue}} HP </li>
{{/if}}
{{#if successDetails.defenderHPLossValue}}
<li>Defender has lost HP : {{successDetails.defenderHPLossValue}} HP </li>
{{/if}}
<li>Success details : {{successDetails.result}} </li>
<li><strong>Final successes</strong> {{sumSuccess}} </li>
<!-- <button class="chat-card-button reroll-level-remaining" data-roll-id="{{rollId}}">Reroll</button> -->
</ul>
</div>
</div>

View File

@ -0,0 +1,149 @@
<div class="chat-message-header">
{{#if actorImg}}
<img class="actor-icon" src="{{actorImg}}" alt="{{alias}}" />
{{/if}}
<h4 class=chat-actor-name>{{alias}}</h4>
</div>
<hr>
{{#if img}}
<div >
<img class="chat-icon" src="{{img}}" alt="{{name}}" />
</div>
{{/if}}
<div class="flexcol">
</div>
<div>
<ul>
{{#if (eq rollOrder 1)}}
<li><strong>Roll with {{rollType}} - Roll 1</strong></li>
{{/if}}
{{#if (eq rollOrder 2)}}
<li><strong>Roll with {{rollType}} - Roll 2</strong></li>
{{/if}}
{{#if (eq rollOrder 3)}}
<li><strong>Roll with {{rollType}} - Final result !</strong></li>
{{/if}}
{{#if save}}
<li>Save : {{save.label}} - {{save.value}}d6
({{#each roll.terms.0.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if sizeDice}}
<li>Size/Range/Cover/Situational dices
({{#each roll.terms.0.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if ability}}
<li>Ability : {{ability.label}} - {{ability.value}}d6
({{#each roll.terms.0.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if skill}}
<li>Skill : {{skill.name}} - {{skill.data.skilldice}}
{{#if featSL}}
- with Feat SL +{{featSL}}
{{/if}}
&nbsp;({{#each roll.terms.2.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if noAdvantage}}
<li>No advantage due to condition : {{noAdvantage.name}}</li>
{{else}}
{{#if (or (eq advantage "advantage1") forceAdvantage)}}
<li>1 Advantage Die !
&nbsp;({{#each roll.terms.8.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if (eq advantage "advantage2") }}
<li>2 Advantage Dice !
&nbsp;({{#each roll.terms.8.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{/if}}
{{#if (or (eq disadvantage "disadvantage1") forceDisadvantage)}}
<li>1 Disadvantage Die !
&nbsp;({{#each roll.terms.10.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if (eq disadvantage "disadvantage2")}}
<li>2 Disadvantage Dice !
&nbsp;({{#each roll.terms.10.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if (eq rollAdvantage "roll-advantage")}}
<li>Roll with Advantage !</li>
{{/if}}
{{#if (eq rollAdvantage "roll-disadvantage")}}
<li>Roll with Disadvantage !</li>
{{/if}}
{{#if skillArmorPenalty}}
<li>Armor Penalty : {{skillArmorPenalty}} Disadvantage Dice
&nbsp;({{#each roll.terms.12.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if hasBonusDice}}
<li>Skill bonus dice : {{hasBonusDice}}
&nbsp;({{#each roll.terms.6.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if complexSkillDisadvantage}}
<li>Roll with Disadvantage because of Complex Skill at SL 0 !</li>
{{/if}}
{{#if hasFeatDie}}
<li>Feat Die : d10
&nbsp;({{#each roll.terms.4.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
{{#if useshield}}
<li>Shield : {{shield.name}} - {{shield.data.shielddie}}
({{#each roll.terms.14.results as |die idx|}}
{{die.result}}&nbsp;
{{/each}})
</li>
{{/if}}
<li><strong>Number of successes</strong> {{nbSuccess}} </li>
<!-- <button class="chat-card-button reroll-level-remaining" data-roll-id="{{rollId}}">Reroll</button> -->
</ul>
</div>
</div>

View File

@ -0,0 +1,11 @@
<div class="chat-message-header">
<img class="actor-icon" src="{{actorImg}}" alt="{{alias}}" />
<h4 class=chat-actor-name>{{defenderName}}</h4>
</div>
<hr>
<div >
{{defenderName}} wins the opposition against {{attackerName}} !
</div>
</div>

View File

@ -0,0 +1,46 @@
<div class="chat-message-header">
{{#if actorImg}}
<img class="actor-icon" src="{{actorImg}}" alt="{{alias}}" />
{{/if}}
<h4 class=chat-actor-name>{{alias}}</h4>
</div>
<hr>
{{#if img}}
<div>
<img class="chat-icon" src="{{img}}" alt="{{name}}" />
</div>
{{/if}}
<div class="flexcol">
</div>
<div>
{{#if isRangedAttack}}
<div>{{defender.name}} is under Ranged attack. He must roll a Target Roll to defend himself.</div>
{{else}}
<div>{{defender.name}} is under Melee attack. He must roll a Defense Roll to defend himself.</div>
{{/if}}
<ul>
{{#if isRangedAttack}}
<li>
<button class="chat-card-button roll-defense-ranged" data-roll-id="{{@root.rollId}}">Roll Target !</button>
</li>
{{else}}
<li>
{{#each defenderWeapons as |weapon idx|}}
<button class="chat-card-button roll-defense-melee" data-defense-weapon-id="{{weapon._id}}"
data-roll-id="{{@root.rollId}}">{{weapon.name}}</button>
{{/each}}
</li>
{{/if}}
</ul>
<!-- <button class="chat-card-button reroll-level-remaining" data-roll-id="{{rollId}}">Reroll</button> -->
</ul>
</div>
</div>

View File

@ -0,0 +1,6 @@
{{#if data.isGM}}
<h3>GM Notes : </h3>
<div class="form-group editor">
{{editor data.gmnotes target="system.gmnotes" button=true owner=owner editable=editable}}
</div>
{{/if}}

View File

@ -0,0 +1,92 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-crucible-rpg/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<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="{{data.armortype}}" data-dtype="String">
{{#select data.armortype}}
<option value="clothes">Clothes</option>
<option value="paddedlight">Padded (Light)</option>
<option value="leatherlight">Leather/Hide (Light)</option>
<option value="leathermedium">Studded Leather (Medium)</option>
<option value="chain">Chain (Medium)</option>
<option value="scale">Scale (Heavy)</option>
<option value="scale">Scale (Heavy)</option>
<option value="platemail">Plate Mail (Heavy)</option>
<option value="platefull">Full Plate (Heavy)</option>
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Absorption roll</label>
<select class="competence-base flexrow" type="text" name="system.absorprionroll" value="{{data.absorprionroll}}" data-dtype="String">
{{#select data.absorprionroll}}
<option value="none">None</option>
<option value="white">White</option>
<option value="green">Green</option>
<option value="blue">Blue</option>
<option value="purple">Purple</option>
<option value="red">Red</option>
<option value="black">Black</option>
<option value="blackgreen">Black+Green</option>
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Damaged roll</label>
<select class="competence-base flexrow" type="text" name="system.damagedroll" value="{{data.damagedroll}}" data-dtype="String">
{{#select data.damagedroll}}
<option value="none">None</option>
<option value="white">White</option>
<option value="green">Green</option>
<option value="blue">Blue</option>
<option value="purple">Purple</option>
<option value="red">Red</option>
<option value="black">Black</option>
<option value="blackgreen">Black+Green</option>
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Is proficient ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.isproficient" {{checked data.isproficient}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Minimum strength</label>
<input type="text" class="input-numeric-short padd-right" name="system.minstr" value="{{data.minstr}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Skill penalty</label>
<input type="text" class="input-numeric-short padd-right" name="system.skillpenalty" value="{{data.skillpenalty}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Equipped ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.equipped" {{checked data.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="{{data.cost}}" data-dtype="Number"/>
</li>
</ul>
</div>
</div>
</section>
</form>

View File

@ -0,0 +1,64 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}" />
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
</div>
</header>
{{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="tab details" data-group="primary" data-tab="description">
<label class="generic-label">Description</label>
<div class="medium-editor item-text-long-line">
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</div>
<div class="tab details" data-group="primary" data-tab="details">
<ul>
<li class="flexrow"><label class="generic-label">Provides 1 Advantage ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.advantage" {{checked data.advantage}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Provides 1 Disadvantage ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.disadvantage" {{checked data.disadvantage}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Provides Roll Advantage ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.rolladvantage" {{checked data.rolladvantage}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Provides Roll Disadvantage ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.rolldisadvantage" {{checked data.rolldisadvantage}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Loose HP per round ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.loosehpround" {{checked data.loosehpround}}/></label>
</li>
{{#if data.loosehpround}}
<li class="flexrow"><label class="generic-label">Number of HP : </label>
<input type="text" class="input-numeric-short padd-right" name="system.loohproundvalue" value="{{data.loohproundvalue}}" data-dtype="Number"/>
</li>
{{/if}}
<li class="flexrow"><label class="generic-label">No advantage possible ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.noadvantage" {{checked data.noadvantage}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Disadvantage on attack ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.attackdisadvantage" {{checked data.attackdisadvantage}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Disadvantage on defense ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.defensedisadvantage" {{checked data.defensedisadvantage}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Provides advantage to attacker ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.targetadvantage" {{checked data.targetadvantage}}/></label>
</li>
<li class="flexrow"><label class="generic-label">No action possible ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.noaction" {{checked data.noaction}}/></label>
</li>
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,31 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-crucible-rpg/templates/partial-item-description.html}}
<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 data.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="{{data.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="{{data.cost}}" data-dtype="Number"/>
</li>
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,35 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-crucible-rpg/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<ul>
<li class="flexrow"><label class="generic-label">Add feat die ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.isfeatdie" {{checked data.isfeatdie}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Add SL ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.issl" {{checked data.issl}}/></label>
</li>
{{#if data.issl}}
<li class="flexrow"><label class="generic-label">SL value</label>
<input type="text" class="" name="data.sl" value="{{system.sl}}" data-dtype="Number"/>
</li>
{{/if}}
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,28 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-crucible-rpg/templates/partial-item-description.html}}
<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="{{data.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="{{data.value}}" data-dtype="Number"/>
</li>
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,28 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}" />
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
</div>
</header>
{{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="tab details" data-group="primary" data-tab="description">
<label class="generic-label">Description</label>
<div class="medium-editor item-text-long-line">
{{editor description target="data.description" button=true owner=owner editable=editable}}
</div>
</div>
<div class="tab details" data-group="primary" data-tab="details">
<ul>
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,28 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}" />
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
</div>
</header>
{{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="tab details" data-group="primary" data-tab="description">
<label class="generic-label">Description</label>
<div class="medium-editor item-text-long-line">
{{editor description target="data.description" button=true owner=owner editable=editable}}
</div>
</div>
<div class="tab details" data-group="primary" data-tab="details">
<ul>
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,55 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-crucible-rpg/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Shield die</label>
<select class="competence-base flexrow" type="text" name="system.shielddie" value="{{data.shielddie}}" data-dtype="String">
{{#select data.shielddie}}
<option value="d6">d6</option>
<option value="d8">d8</option>
<option value="d10">d10</option>
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Associated skill</label>
<select class="competence-base flexrow" type="text" name="system.skill" value="{{data.skill}}" data-dtype="String">
{{#select data.skill}}
{{#each shieldSkills as |skill idx|}}
<option value="{{skill.name}}">{{skill.name}}</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 data.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="{{data.cost}}" data-dtype="Number"/>
</li>
</ul>
</div>
</div>
</section>
</form>

View File

@ -0,0 +1,105 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-crucible-rpg/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<ul>
<li class="flexrow"><label class="generic-label">Ability</label>
<select class="competence-base flexrow" type="text" name="system.ability" value="{{data.ability}}" data-dtype="String">
{{#select data.ability}}
{{> systems/fvtt-crucible-rpg/templates/partial-options-abilities.html}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Is Feat Die ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.isfeatdie" {{checked data.isfeatdie}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Is SL +2 ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.issl2" {{checked data.issl2}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Subject to Armor Penalty ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.armorpenalty" {{checked data.armorpenalty}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Skill Type</label>
<select class="competence-base flexrow" type="text" name="system.skilltype" value="{{data.skilltype}}" data-dtype="string">
{{#select data.skilltype}}
<option value="simple">Simple</option>
<option value="complex">Complex</option>
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Skill Dice</label>
<input type="text" class="" name="system.skilldice" value="{{data.skilldice}} (level {{data.level}})" data-dtype="String" disabled/>
</li>
<li class="flexrow"><label class="generic-label">Is Innate ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.isinnate" {{checked data.isinnate}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Is Lore ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.islore" {{checked data.islore}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Is Weapon Skill ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.isweaponskill" {{checked data.isweaponskill}}/></label>
</li>
<!-- <li class="flexrow"><label class="generic-label">Is Shield Skill ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="data.isshieldskill" {{checked data.isshieldskill}}/></label>
</li> -->
<li class="flexrow"><label class="generic-label">Bonus dice</label>
<select class="competence-base flexrow" type="text" name="system.bonusdice" value="{{data.bonusdice}}" data-dtype="String">
{{#select data.bonusdice}}
<option value="none">None</option>
<option value="1d6">1d6</option>
<option value="2d6">2d6</option>
<option value="3d6">3d6</option>
<option value="4d6">4d6</option>
<option value="5d6">5d6</option>
<option value="6d6">6d6</option>
<option value="7d6">7d6</option>
<option value="8d6">8d6</option>
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Background</label>
<input type="text" class="" name="system.background" value="{{data.background}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Basic</label>
<input type="text" class="" name="system.basic" value="{{data.basic}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Class</label>
<input type="text" class="" name="system.class" value="{{data.class}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Exp level</label>
<input type="text" class="" name="system.explevel" value="{{data.explevel}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Gained exp (+1 to Exp level at 25)</label>
<input type="text" class="" name="system.exp" value="{{data.exp}}" data-dtype="Number"/>
</li>
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,49 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-crucible-rpg/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<ul>
<li class="flexrow"><label class="generic-label">Lore</label>
<select class="competence-base flexrow" type="text" name="system.lore" value="{{data.lore}}" data-dtype="String">
{{#select data.lore}}
<option value="earth">Earth</option>
<option value="air">Air</option>
<option value="fire">Fire</option>
<option value="water">Water</option>
<option value="shadow">Shadow</option>
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Circle</label>
<select class="competence-base flexrow" type="text" name="system.circle" value="{{data.circle}}" data-dtype="Number">
{{#select data.circle}}
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Range</label>
<input type="text" class="" name="system.range" value="{{data.range}}" data-dtype="String"/>
</li>
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,84 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-crucible-rpg/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<div class="tab" data-group="primary">
<ul>
<!-- <li class="flexrow"><label class="generic-label">Ability</label>
<select class="competence-base flexrow" type="text" name="data.ability" value="{{data.ability}}" data-dtype="String">
{{#select data.ability}}
{{> systems/fvtt-crucible-rpg/templates/partial-options-abilities.html}}
{{/select}}
</select>
</li> -->
<li class="flexrow"><label class="generic-label">Is proficient ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.isproficient" {{checked data.isproficient}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Associated skill</label>
<select class="competence-base flexrow" type="text" name="system.skill" value="{{data.skill}}" data-dtype="String">
{{#select data.skill}}
{{#each weaponSkills as |skill idx|}}
<option value="{{skill.name}}">{{skill.name}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Qualities (comma separated list)</label>
<input type="text" class="padd-right" name="system.qualities" value="{{data.qualities}}" data-dtype="String"/>
</li>
<li class="flexrow"><label class="generic-label">Flaws (comma separated list)</label>
<input type="text" class="padd-right" name="system.flaws" value="{{data.flaws}}" data-dtype="String"/>
</li>
<li class="flexrow"><label class="generic-label">Damage</label>
<input type="text" class="right" name="system.damage" value="{{data.damage}}" data-dtype="String"/>
</li>
<li class="flexrow"><label class="generic-label">Is ranged weapon ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.isranged" {{checked data.isranged}}/></label>
</li>
{{#if data.isranged}}
<li class="flexrow"><label class="generic-label">Effective Range</label>
<input type="text" class="right" name="system.range" value="{{data.range}}" data-dtype="String"/>
</li>
<li class="flexrow"><label class="generic-label">Max range</label>
<input type="text" class="right" name="system.maxrange" value="{{data.maxrange}}" data-dtype="String"/>
</li>
{{/if}}
<li class="flexrow"><label class="generic-label">Minimum strength</label>
<input type="text" class="input-numeric-short padd-right" name="system.minstr" value="{{data.minstr}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Equipped ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.equipped" {{checked data.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="{{data.cost}}" data-dtype="Number"/>
</li>
</ul>
</div>
</div>
</section>
</form>

413
templates/npc-sheet.html Normal file
View File

@ -0,0 +1,413 @@
<form class="{{cssClass}}" autocomplete="off">
{{!-- Sheet Header --}}
<header class="sheet-header">
<div class="header-fields">
<h1 class="charname margin-right"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
<div class="flexrow">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" />
<div class="flexcol">
<div class="flexrow">
<div class="ability-item">
<ul>
{{#each data.abilities as |ability key|}}
{{#if (eq ability.col 1)}}
{{> systems/fvtt-crucible-rpg/templates/partial-actor-ability-block.html ability=ability key=key}}
{{/if}}
{{/each}}
</ul>
<li class="item flexrow list-item" data-attr-key="class">
<span class="ability-label " name="class">
<h4 class="ability-text-white ability-margin">Class</h4>
</span>
<select class="competence-base flexrow" type="text" name="system.biodata.class" value="{{data.biodata.class}}" data-dtype="String">
{{#select data.biodata.class}}
<option value="none">None</option>
<option value="chaplain">Chaplain</option>
<option value="magus">Magus</option>
<option value="martial">Martial</option>
<option value="skalawag">Skalawag</option>
<option value="warden">Warden</option>
{{/select}}
</select>
</li>
</div>
<div class="ability-item">
<ul>
{{#each data.abilities as |ability key|}}
{{#if (eq ability.col 2)}}
{{> systems/fvtt-crucible-rpg/templates/partial-actor-ability-block.html ability=ability key=key}}
{{/if}}
{{/each}}
{{#if equippedArmor}}
<li class="item flexrow list-item" data-attr-key="class">
<img class="sheet-competence-img" src="{{equippedArmor.img}}" />
<span class="ability-label " name="class">
<h4 class="ability-text-white ability-margin"><a class="roll-armor-die ability-margin">{{equippedArmor.name}}</a></h4>
</span>
</li>
{{/if}}
{{#if equippedShield}}
<li class="item flexrow list-item" data-attr-key="class">
<img class="sheet-competence-img" src="{{equippedShield.img}}" />
<span class="ability-label " name="equippedShield">
<h4 class="ability-text-white ability-margin"><a class="roll-shield-die ability-margin">{{equippedShield.name}}</a></h4>
</span>
</li>
{{/if}}
<li class="item flexrow list-item" data-attr-key="class">
<img class="sheet-competence-img" src="systems/fvtt-crucible-rpg/images/icons/feats/Marksman (Ballistic).webp" />
<span class="ability-label " name="rollTarget">
<h4 class="ability-text-white ability-margin"><a class="roll-target-die ability-margin">Target Roll</a></h4>
</span>
</li>
</ul>
</div>
<div class="ability-item status-block">
{{> systems/fvtt-crucible-rpg/templates/partial-actor-status.html}}
</div>
</div>
</div>
</div>
</div>
</header>
{{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="details">Details</a>
<a class="item" data-tab="biodata">Biography</a>
</nav>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Skills Tab --}}
<div class="tab skills" data-group="primary" data-tab="details">
<ul class="stat-list alternate-list item-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Skills</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Ability</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Dice</label>
</span>
<span class="item-field-label-long">
<label class="short-label">Background</label>
</span>
</li>
{{#each skills as |skill key|}}
<li class="item stat flexrow list-item list-item-shadow" data-item-id="{{skill._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{skill.img}}" /></a>
<span class="item-name-label"><a class="roll-skill">{{skill.name}}</a></span>
<span class="item-field-label-short">{{upper skill.system.ability}}</span>
<span class="item-field-label-short">{{skill.system.skilldice}}</span>
<span class="item-field-label-long">&nbsp;-&nbsp;</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header-long">
<h3><label class="items-title-text">Combat</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Ability</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Range</label>
</span>
</li>
{{#each equippedWeapons as |weapon key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{weapon._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{weapon.img}}" /></a>
<span class="item-name-label-long"><a class ="roll-weapon">{{weapon.name}}</a></span>
<span class="item-field-label-short">{{weapon.system.ability}}</span>
<span class="item-field-label-medium">{{perk.system.range}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header-long">
<h3><label class="items-title-text">Monster Powers</label></h3>
</span>
<span class="item-field-label-medium">
<label class="short-label">Feature Die?</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">SL?</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">SL</label>
</span>
</li>
{{#each feats as |feat key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{feat._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{feat.img}}" /></a>
<span class="item-name-label-long">{{feat.name}}</span>
<span class="item-field-label-medium">{{upperFirst feat.system.isfeatdie}}</span>
<span class="item-field-label-medium">{{upperFirst feat.system.issl}}</span>
<span class="item-field-label-medium">{{feat.system.sl}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header-long">
<h3><label class="items-title-text">Conditions</label></h3>
</span>
</li>
{{#each conditions as |condition key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{condition._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{condition.img}}" /></a>
<span class="item-name-label-long">{{condition.name}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Weapons</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Attack</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Damage</label>
</span>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="weapon" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each weapons as |weapon key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{weapon._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{weapon.img}}" /></a>
<span class="item-name-label">{{weapon.name}}</span>
<span class="item-field-label-short"><label>{{upper weapon.system.ability}}</label></span>
<span class="item-field-label-short"><label>{{upper weapon.system.damage}}</label></span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-equip" title="Worn">{{#if weapon.system.equipped}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Armors</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Type</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Absorption</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="armor" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each armors as |armor key|}}
<li class="item list-item flexrow list-item-shadow" data-item-id="{{armor._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{armor.img}}" /></a>
<span class="item-name-label">{{armor.name}}</span>
<span class="item-field-label-short">{{upper armor.system.armortype}}</span>
<span class="item-field-label-short">{{armor.system.absorprionroll}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-equip" title="Worn">{{#if armor.system.equipped}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Shields</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Dice</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="shield" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each shields as |shield key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{shield._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{shield.img}}" /></a>
<span class="item-name-label">{{shield.name}}</span>
<span class="item-field-label-short">{{shield.system.levelDice}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-equip" title="Worn">{{#if shield.system.equipped}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Equipment</label></h3>
</span>
<span class="item-field-label-long">
<label class="short-label">Quantity</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="equipment" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each containersTree as |equip key|}}
{{> systems/fvtt-crucible-rpg/templates/partial-actor-equipment.html equip=equip level=1}}
<ul class="item-list list-item-shadow2 list-item-margin1">
{{#each equip.data.contents as |subgear key|}}
{{> systems/fvtt-crucible-rpg/templates/partial-actor-equipment.html equip=subgear level=2}}
{{/each}}
</ul>
{{/each}}
</ul>
</div>
</div>
{{!-- Biography Tab --}}
<div class="tab biodata" data-group="primary" data-tab="biodata">
<div class="grid grid-2col">
<div>
<ul class="item-list alternate-list">
<li class="item flexrow">
<label class="generic-label">Origin</label>
<input type="text" class="" name="system.biodata.origin" value="{{data.biodata.origin}}"
data-dtype="String" />
</li>
<li class="item flexrow">
<label class="generic-label">Age</label>
<input type="text" class="" name="system.biodata.age" value="{{data.biodata.age}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="generic-label">Height</label>
<input type="text" class="" name="system.biodata.height" value="{{data.biodata.height}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="generic-label">Eyes</label>
<input type="text" class="" name="system.biodata.eyes" value="{{data.biodata.eyes}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="generic-label">Hair</label>
<input type="text" class="" name="system.biodata.hair" value="{{data.biodata.hair}}" data-dtype="String" />
</li>
</ul>
</div>
<div>
<ul>
<li class="flexrow item">
<label class="generic-label">Size</label>
<select class="competence-base flexrow" type="text" name="system.biodata.size" value="{{data.biodata.size}}" data-dtype="Number">
{{#select data.biodata.size}}
<option value="1">Tiny</option>
<option value="2">Small</option>
<option value="3">Medium</option>
<option value="4">Large</option>
<option value="5">Huge</option>
<option value="6">Gargantuan</option>
{{/select}}
</select>
</li>
<li class="flexrow item">
<label class="generic-label">Sex</label>
<input type="text" class="" name="system.biodata.sex" value="{{data.biodata.sex}}" data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label">Preferred Hand</label>
<input type="text" class="" name="system.biodata.preferredhand" value="{{data.biodata.preferredhand}}"
data-dtype="String" />
</li>
<li class="flexrow item" data-item-id="{{race._id}}">
<label class="generic-label">Race</label>
<a class="item-edit"><img class="stat-icon" src="{{race.img}}"></a>
<input type="text" class="" name="system.biodata.racename" value="{{data.biodata.racename}}" data-dtype="String" />
</li>
</ul>
</div>
</div>
<hr>
<h3>Background : </h3>
<div class="form-group editor">
{{editor data.biodata.description target="system.biodata.description" button=true owner=owner
editable=editable}}
</div>
<hr>
<h3>Notes : </h3>
<div class="form-group editor">
{{editor data.biodata.notes target="system.biodata.notes" button=true owner=owner editable=editable}}
</div>
<hr>
</article>
</div>
</section>
</form>

View File

@ -0,0 +1,19 @@
<li class="item flexrow list-item item-ability-roll" data-attr-key="{{key}}">
<span class="ability-label ability-margin" name="{{key}}">
<h4 class="ability-text-white ability-margin"><a class="roll-ability ability-margin" data-ability-key="{{key}}">{{ability.label}}</a></h4>
</span>
<select class="status-small-label color-class-common" type="text" name="system.abilities.{{key}}.value" value="{{ability.value}}"
data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select ability.value}}
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
{{/select}}
</select>
</li>

View File

@ -0,0 +1,37 @@
<li class="item flexrow list-item list-item-shadow" data-item-id="{{equip._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img" src="{{equip.img}}" /></a>
{{#if (eq level 1)}}
<span class="item-name-label">{{equip.name}}</span>
{{else}}
<span class="item-name-label-level2">{{equip.name}}</span>
{{/if}}
<span class="item-field-label-long"><label>
{{equip.system.quantity}}
(<a class="quantity-minus plus-minus-button">&nbsp;-</a>/<a class="quantity-plus plus-minus-button">+</a>)
</label>
</span>
<span class="item-field-label-medium">
&nbsp;-&nbsp;
</span>
<span class="item-field-label-short">
{{#if equip.system.iscontainer}}
{{equip.system.contentsEnc}}
{{else}}
{{mul equip.system.weight equip.system.quantity}}
{{/if}}
</span>
<span class="item-field-label-medium">
&nbsp;-&nbsp;
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
{{#if (eq level 1)}}
<a class="item-control item-equip" title="Worn">{{#if equip.system.equipped}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
{{/if}}
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>

View File

@ -0,0 +1,39 @@
<ul class="status-block">
<li class="item flexrow list-item" data-attr-key="hp">
<span class="ability-label " name="hp">
<h4 class="ability-text-white ability-margin">HP</h4>
</span>
<span class="ability-label ability-margin">
<input class="input-numeric-short" name="system.secondary.hp.value" value="{{data.secondary.hp.value}}"></span>
{{#if (eq type "character")}}
<span class="ability-label ability-margin"> / {{data.secondary.hp.max}}</span>
{{else}}
<span class="ability-label ability-margin">/<input class="input-numeric-short" name="system.secondary.hp.max" value="{{data.secondary.hp.max}}"></span>
{{/if}}
</li>
<li class="item flexrow list-item" data-attr-key="hp">
<span class="ability-label " name="hp">
<h4 class="ability-text-white ability-margin">Effort</h4>
</span>
<span class="ability-label ability-margin">
<input class="input-numeric-short" name="system.secondary.effort.value" value="{{data.secondary.effort.value}}"></span>
{{#if (eq type "character")}}
<span class="ability-label ability-margin"> / {{data.secondary.effort.max}}</span>
{{else}}
<span class="ability-label ability-margin">/<input class="input-numeric-short" name="system.secondary.effort.max" value="{{data.secondary.effort.max}}"></span>
{{/if}}
</li>
<li>&nbsp;</li>
{{#each saveRolls as |save key|}}
<li class="item flexrow list-item" data-attr-key="{{key}}">
<img class="sheet-competence-img" src="{{save.img}}" />
<span class="ability-label" name="{{key}}">
<h4 class="ability-text-white ability-margin">
<a class="roll-save ability-margin" data-save-key="{{key}}">{{save.label}} {{save.value}}</a></h4>
</span>
</li>
{{/each}}
<ul>

View File

@ -0,0 +1,8 @@
<div class="tab description" data-group="primary" data-tab="description">
<div>
<label class="generic-label">Description</label>
<div class="medium-editor item-text-long-line">
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -0,0 +1,5 @@
{{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="description">Description</a>
<a class="item" data-tab="details">Details</a>
</nav>

View File

@ -0,0 +1,7 @@
<option value="agi">Agility</option>
<option value="str">Strength</option>
<option value="dex">Dexterity</option>
<option value="con">Constitution</option>
<option value="int">Intelligence</option>
<option value="wit">Wits</option>
<option value="cha">Charisma</option>

View File

@ -0,0 +1,13 @@
<option value="camping">Camping & Survival</option>
<option value="communication">Communication & Information</option>
<option value="equestrian">Equestrian</option>
<option value="spy">Law/Security/Spy/Thief</option>
<option value="medical">Medical</option>
<option value="tools">Tools</option>
<option value="weaponaccess">Weapons accessories</option>
<option value="wizard">Wizards materials</option>
<option value="mount">Mounts</option>
<option value="vehicle">Vehicles</option>
<option value="clothing">Clothing</option>
<option value="ammo">Ammo</option>
<option value="misc">Misc</option>

View File

@ -0,0 +1,14 @@
{{#if notapplicable}}
<option value="notapplicable">Not applicable</option>
{{/if}}
<option value="0">0</option>
<option value="1">d4</option>
<option value="2">d6</option>
<option value="3">d8</option>
<option value="4">d10</option>
<option value="5">d12</option>
<option value="6">d12 d4</option>
<option value="7">d12 d6</option>
<option value="8">d12 d8</option>
<option value="9">d12 d10</option>
<option value="10">d12 d12</option>

View File

@ -0,0 +1,15 @@
{{#if notapplicable}}
<option value="notapplicable">Not applicable</option>
{{/if}}
<option value="touch">Self Only</option>
<option value="touchself">Touch/Self</option>
<option value="tz">Threat Zone</option>
<option value="close">Close</option>
<option value="medium">Medium</option>
<option value="long">Long</option>
<option value="extreme">Extreme</option>
<option value="sight">Line of Sight</option>
<option value="tz_close">TZ/Close</option>
<option value="close_medium">Close/Medium</option>
<option value="medium_long">Medium/Long</option>
<option value="long_extreme">Long/Extreme</option>

View File

@ -0,0 +1,4 @@
<ul>
</ul>

8
templates/post-item.html Normal file
View File

@ -0,0 +1,8 @@
<div class="post-item" data-transfer="{{transfer}}">
<h3><b>{{name}}</b></h3>
{{#if img}}
<img class="chat-img" src="{{img}}" title="{{name}}" />
{{/if}}
<h4><b>Description : </b></h4>
<p class="card-content">{{{data.description}}}</p>
</div>

View File

@ -0,0 +1,167 @@
<form class="skill-roll-dialog">
<header class="roll-dialog-header">
{{#if img}}
<img class="actor-icon" src="{{img}}" data-edit="img" title="{{name}}" />
{{/if}}
<h1 class="dialog-roll-title roll-dialog-header">{{title}}</h1>
</header>
<div class="flexcol">
{{#if sizeDice}}
<div class="flexrow">
<span class="roll-dialog-label">Size basic dices : </span>
<span class="roll-dialog-label">{{sizeDice.nb}}{{sizeDice.dice}}</span>
</div>
<div class="flexrow">
<span class="roll-dialog-label">Distance bonus dice(s) : </span>
<select class="status-small-label color-class-common" type="text" id="distanceBonusDice" value="{{distanceBonusDice}}" data-dtype="String" >
{{#select distanceBonusDice}}
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
{{/select}}
</select>
</div>
{{/if}}
{{#if hasCover}}
<div class="flexrow">
<span class="roll-dialog-label">Cover : </span>
<select class="status-small-label color-class-common" type="text" id="hasCover" value="{{hasCover}}" data-dtype="String" >
{{#select hasCover}}
<option value="none">None</option>
<option value="cover50">Cover at 50% (+1 dice)</option>
{{/select}}
</select>
</div>
{{/if}}
{{#if situational}}
<div class="flexrow">
<span class="roll-dialog-label">Situational : </span>
<select class="status-small-label color-class-common" type="text" id="situational" value="{{situational}}" data-dtype="String" >
{{#select situational}}
<option value="none">None</option>
<option value="dodge">Dodge (+1 dice)</option>
<option value="prone">Prone (+1 dice)</option>
<option value="moving">Moving (+1 dice)</option>
<option value="Engaged">Engaged (+1 dice)</option>
{{/select}}
</select>
</div>
{{/if}}
{{#if save}}
<div class="flexrow">
<span class="roll-dialog-label">{{save.label}} : </span>
<span class="roll-dialog-label">{{save.value}}d6</span>
</div>
{{/if}}
{{#if ability}}
<div class="flexrow">
<span class="roll-dialog-label">Ability : </span>
<span class="roll-dialog-label">{{ability.value}}d6</span>
</div>
{{/if}}
{{#if weapon}}
<div class="flexrow">
<span class="roll-dialog-label">Weapon : </span>
<span class="roll-dialog-label">{{weapon.name}}</span>
</div>
{{/if}}
{{#if shield}}
<div class="flexrow">
<span class="roll-dialog-label">Use shield ? : </span>
<span class="roll-dialog-label"><input type="checkbox" id="useshield" name="useshield" {{checked useshield}}/></span>
</div>
<div class="flexrow">
<span class="roll-dialog-label">{{shield.name}} : </span>
<span class="roll-dialog-label">{{shield.data.shielddie}}</span>
</div>
{{/if}}
{{#if skill}}
<div class="flexrow">
<span class="roll-dialog-label">Skill : </span>
<span class="roll-dialog-label">{{skill.name}} - {{skill.data.skilldice}}</span>
</div>
<div class="flexrow">
<span class="roll-dialog-label">Feature die or SL+2? : </span>
<span class="roll-dialog-label">{{#if skill.data.isfeatdie}} Yes {{else}} No {{/if}}</span>
</div>
{{/if}}
{{#if noAdvantage}}
<div>
<span class="roll-dialog-label">No advantage due to condition : {{noAdvantage.name}}</span>
</div>
{{else}}
<div class="flexrow">
<span class="roll-dialog-label">Advantage : </span>
<select class="status-small-label color-class-common" type="text" id="advantage" value="{{advantage}}" data-dtype="String" >
{{#select advantage}}
<option value="none">None</option>
<option value="advantage1">1 Advantage</option>
<option value="advantage2">2 Advantages</option>
{{/select}}
</select>
</div>
{{/if}}
<div class="flexrow">
<span class="roll-dialog-label">Disadvantage : </span>
<select class="status-small-label color-class-common" type="text" id="disadvantage" value="{{disadvantage}}" data-dtype="String" >
{{#select disadvantage}}
<option value="none">None</option>
<option value="disadvantage1">1 Disadvantage</option>
<option value="disadvantage2">2 Disadvantages</option>
{{/select}}
</select>
</div>
<div class="flexrow">
<span class="roll-dialog-label">Roll with Advantage/Disadvantage : </span>
<select class="status-small-label color-class-common" type="text" id="rollAdvantage" value="{{rollAdvantage}}" data-dtype="String" >
{{#select rollAdvantage}}
<option value="none">None</option>
<option value="roll-advantage">Roll with Advantage</option>
<option value="roll-disadvantage">Roll with Disadvantage</option>
{{/select}}
</select>
</div>
{{#if forceAdvantage}}
<div class="flexrow">
<span class="roll-dialog-label">1 Advantage from condition : {{forceAdvantage.name}}
{{#if advantageFromTarget}} (Provided by targetted actor) {{/if}}
</span>
</div>
{{/if}}
{{#if forceDisadvantage}}
<div class="flexrow">
<span class="roll-dialog-label">1 Disadvantage from condition : {{forceDisadvantage.name}} </span>
</div>
{{/if}}
{{#if forceRollAdvantage}}
<div class="flexrow">
<span class="roll-dialog-label">Roll Advantage from condition : {{forceRollAdvantage.name}} </span>
</div>
{{/if}}
{{#if forceRollDisadvantage}}
<div class="flexrow">
<span class="roll-dialog-label">Roll Disadvantage from condition : {{forceRollDisadvantage.name}} </span>
</div>
{{/if}}
</div>
</form>