Compare commits
3 Commits
fvtt-hero-
...
fvtt-hero-
Author | SHA1 | Date | |
---|---|---|---|
2d328659b2 | |||
b9b8fa7c0d | |||
0368be050b |
@ -44,8 +44,8 @@ export class Hero6ActorSheet extends ActorSheet {
|
|||||||
powers: await this.actor.getPowers( ),
|
powers: await this.actor.getPowers( ),
|
||||||
talents: this.actor.getTalents( ),
|
talents: this.actor.getTalents( ),
|
||||||
complications: this.actor.getComplications( ),
|
complications: this.actor.getComplications( ),
|
||||||
martialarts: this.actor.getMartialArts( ),
|
|
||||||
maneuvers: this.actor.getManeuvers( ),
|
maneuvers: this.actor.getManeuvers( ),
|
||||||
|
nonstockmaneuvers: this.actor.getNonStockManeuvers(),
|
||||||
weapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getWeapons()) ),
|
weapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getWeapons()) ),
|
||||||
armors: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getArmors())),
|
armors: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getArmors())),
|
||||||
shields: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getShields())),
|
shields: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getShields())),
|
||||||
@ -153,9 +153,9 @@ export class Hero6ActorSheet extends ActorSheet {
|
|||||||
this.actor.rollCharac(characKey);
|
this.actor.rollCharac(characKey);
|
||||||
});
|
});
|
||||||
html.find('.roll-direct').click((event) => {
|
html.find('.roll-direct').click((event) => {
|
||||||
const rollFormula = $(event.currentTarget).data("roll-formula");
|
const rollFormula = $(event.currentTarget).data("roll-formula")
|
||||||
let roll = new Roll(rollFormula).roll({async: false})
|
const rollSource = $(event.currentTarget).data("roll-source")
|
||||||
roll.toMessage()
|
Hero6Utility.processDirectRoll( { actorId: this.actor.id, rollFormula: rollFormula, rollSource: rollSource, mode:"directroll"} )
|
||||||
});
|
});
|
||||||
|
|
||||||
html.find('.roll-item').click((event) => {
|
html.find('.roll-item').click((event) => {
|
||||||
|
@ -3,12 +3,9 @@ import { Hero6Utility } from "./hero6-utility.js";
|
|||||||
import { Hero6RollDialog } from "./hero6-roll-dialog.js";
|
import { Hero6RollDialog } from "./hero6-roll-dialog.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
const coverBonusTable = { "nocover": 0, "lightcover": 2, "heavycover": 4, "entrenchedcover": 6 };
|
const __speed2Segments = [[0], [7], [6, 12], [4, 8, 12], [3, 6, 9, 12], [3, 5, 8, 10, 12], [2, 4, 6, 8, 10, 12]
|
||||||
const statThreatLevel = ["agi", "str", "phy", "com", "def", "per"]
|
[2, 4, 6, 7, 9, 11, 12], [2, 3, 5, 6, 8, 9, 11, 12], [2, 3, 4, 6, 7, 8, 10, 11, 12], [2, 3, 4, 5, 6, 8, 9, 10, 11, 12],
|
||||||
const __subkey2title = {
|
[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]]
|
||||||
"melee-dmg": "Melee Damage", "melee-atk": "Melee Attack", "ranged-atk": "Ranged Attack",
|
|
||||||
"ranged-dmg": "Ranged Damage", "dmg-res": "Damare Resistance"
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -67,8 +64,8 @@ export class Hero6Actor extends Actor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
computeDicesValue() {
|
computeDicesValue() {
|
||||||
this.system.biodata.presenceattack = Hero6Utility.getDerivatedDiceValue(this.system.characteristics.pre.value )
|
this.system.biodata.presenceattack = Hero6Utility.getDerivatedDiceFormulas(this.system.characteristics.pre.value)
|
||||||
this.system.characteristics.str.strdice = Hero6Utility.getDerivatedDiceValue(this.system.characteristics.str.value )
|
this.system.characteristics.str.strdice = Hero6Utility.getDerivatedDiceFormulas(this.system.characteristics.str.value)
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
prepareDerivedData() {
|
prepareDerivedData() {
|
||||||
@ -235,11 +232,6 @@ export class Hero6Actor extends Actor {
|
|||||||
Hero6Utility.sortArrayObjectsByName(comp)
|
Hero6Utility.sortArrayObjectsByName(comp)
|
||||||
return comp
|
return comp
|
||||||
}
|
}
|
||||||
getMartialArts() {
|
|
||||||
let comp = duplicate(this.items.filter(item => item.type == 'martialart') || [])
|
|
||||||
Hero6Utility.sortArrayObjectsByName(comp)
|
|
||||||
return comp
|
|
||||||
}
|
|
||||||
getComplications() {
|
getComplications() {
|
||||||
let comp = duplicate(this.items.filter(item => item.type == 'complication') || [])
|
let comp = duplicate(this.items.filter(item => item.type == 'complication') || [])
|
||||||
Hero6Utility.sortArrayObjectsByName(comp)
|
Hero6Utility.sortArrayObjectsByName(comp)
|
||||||
@ -280,30 +272,50 @@ export class Hero6Actor extends Actor {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
getManeuvers() {
|
getManeuvers() {
|
||||||
let maneuvers = {
|
let maneuvers = {
|
||||||
general: this.items.filter(item => item.type == "maneuver" && item.system.maneuvertype == "general"),
|
general: this.items.filter(item => item.type == "maneuver" && item.system.maneuvertype == "general"),
|
||||||
offensive: this.items.filter(item => item.type == "maneuver" && item.system.maneuvertype == "offensive"),
|
offensive: this.items.filter(item => item.type == "maneuver" && item.system.maneuvertype == "offensive"),
|
||||||
defensive: this.items.filter(item => item.type == "maneuver" && item.system.maneuvertype == "defensive")
|
defensive: this.items.filter(item => item.type == "maneuver" && item.system.maneuvertype == "defensive")
|
||||||
}
|
}
|
||||||
|
Hero6Utility.sortArrayObjectsByName(maneuvers.general)
|
||||||
|
Hero6Utility.sortArrayObjectsByName(maneuvers.offensive)
|
||||||
|
Hero6Utility.sortArrayObjectsByName(maneuvers.defensive)
|
||||||
|
return maneuvers
|
||||||
|
}
|
||||||
|
getNonStockManeuvers() {
|
||||||
|
let maneuvers = this.items.filter(item => item.type == "maneuver" && !item.system.isstock)
|
||||||
|
Hero6Utility.sortArrayObjectsByName(maneuvers)
|
||||||
return maneuvers
|
return maneuvers
|
||||||
}
|
}
|
||||||
getEquipments() {
|
getEquipments() {
|
||||||
return this.items.filter(item => item.type == "equipment" && item.system.subtype == "equipment");
|
let list = this.items.filter(item => item.type == "equipment" && item.system.subtype == "equipment");
|
||||||
|
Hero6Utility.sortArrayObjectsByName(list)
|
||||||
|
return list
|
||||||
}
|
}
|
||||||
getWeapons() {
|
getWeapons() {
|
||||||
return this.items.filter(item => item.type == "equipment" && item.system.subtype == "weapon");
|
let list = this.items.filter(item => item.type == "equipment" && item.system.subtype == "weapon");
|
||||||
|
Hero6Utility.sortArrayObjectsByName(list)
|
||||||
|
return list
|
||||||
}
|
}
|
||||||
getArmors() {
|
getArmors() {
|
||||||
return this.items.filter(item => item.type == "equipment" && item.system.subtype == "armor");
|
let list = this.items.filter(item => item.type == "equipment" && item.system.subtype == "armor");
|
||||||
|
Hero6Utility.sortArrayObjectsByName(list)
|
||||||
|
return list
|
||||||
}
|
}
|
||||||
getShields() {
|
getShields() {
|
||||||
return this.items.filter(item => item.type == "equipment" && item.system.subtype == "shield");
|
let list = this.items.filter(item => item.type == "equipment" && item.system.subtype == "shield");
|
||||||
|
Hero6Utility.sortArrayObjectsByName(list)
|
||||||
|
return list
|
||||||
}
|
}
|
||||||
getEquipmentsMoneys() {
|
getEquipmentsMoneys() {
|
||||||
return duplicate(this.items.filter(item => item.type == "equipment" && (item.system.subtype == "equipment" || item.system.subtype == "money")) || [])
|
let list = duplicate(this.items.filter(item => item.type == "equipment" && (item.system.subtype == "equipment" || item.system.subtype == "money")) || [])
|
||||||
|
Hero6Utility.sortArrayObjectsByName(list)
|
||||||
|
return list
|
||||||
}
|
}
|
||||||
getEquipmentsOnly() {
|
getEquipmentsOnly() {
|
||||||
return duplicate(this.items.filter(item => item.type == "equipment" && item.system.subtype == "equipment") || [])
|
let list = duplicate(this.items.filter(item => item.type == "equipment" && item.system.subtype == "equipment") || [])
|
||||||
|
Hero6Utility.sortArrayObjectsByName(list)
|
||||||
|
return list
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------- */
|
/* ------------------------------------------- */
|
||||||
@ -397,13 +409,23 @@ export class Hero6Actor extends Actor {
|
|||||||
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
|
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getInitiativeScore(combatId, combatantId) {
|
hasPhase( segmentNumber) {
|
||||||
if (this.type == 'character') {
|
let index = Math.min( Math.max(this.system.characteristics.spd.value, 1), 12) // Security bounds
|
||||||
this.rollMR(true, combatId, combatantId)
|
let phases = __speed2Segments[index]
|
||||||
}
|
return phases.includes(segmentNumber)
|
||||||
console.log("Init required !!!!")
|
}
|
||||||
return -1;
|
/* -------------------------------------------- */
|
||||||
|
getSegments() {
|
||||||
|
let index = Math.min( Math.max(this.system.characteristics.spd.value, 1), 12) // Security bounds
|
||||||
|
return __speed2Segments[index]
|
||||||
|
}
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
getBaseInit() {
|
||||||
|
let r = new Roll("1d6").roll({async: false})
|
||||||
|
let base = this.system.characteristics.dex.value + (r.total / 10)
|
||||||
|
return base
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -1,21 +1,141 @@
|
|||||||
import { Hero6Utility } from "./hero6-utility.js";
|
import { Hero6Utility } from "./hero6-utility.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
export class Hero6Combat extends Combat {
|
export class Hero6CombatTracker extends CombatTracker {
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollInitiative(ids, formula = undefined, messageOptions = {} ) {
|
static get defaultOptions() {
|
||||||
|
var path = "systems/fvtt-hero-system-6/templates/apps/combat-tracker.hbs";
|
||||||
|
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||||
|
template: path,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
export class Hero6Combat extends Combat {
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static init() {
|
||||||
|
Hooks.on("getCombatTrackerEntryContext", (html, options) => { Hero6Combat.pushMenuOptions(html, options); });
|
||||||
|
}
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static pushMenuOptions(html, options) {
|
||||||
|
let newOpt
|
||||||
|
for (let i = 0; i < options.length; i++) {
|
||||||
|
let option = options[i];
|
||||||
|
if (option.name == 'COMBAT.CombatantReroll') { // Replace !
|
||||||
|
option.name = "Hold action";
|
||||||
|
option.condition = true;
|
||||||
|
option.icon = '<i class="far fa-question-circle"></i>';
|
||||||
|
option.callback = target => {
|
||||||
|
Hero6Combat.holdAction(target.data('combatant-id'));
|
||||||
|
}
|
||||||
|
newOpt = duplicate(option)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
newOpt.name = "Abort action"
|
||||||
|
newOpt.callback = target => {
|
||||||
|
Hero6Combat.abortAction(target.data('combatant-id'));
|
||||||
|
}
|
||||||
|
options.push( newOpt)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static holdAction(combatantId) {
|
||||||
|
console.log("Combatant HOLD : ", combatantId)
|
||||||
|
const combatant = game.combat.combatants.get(combatantId)
|
||||||
|
combatant.setFlag("world", "hero6-hold-action", true)
|
||||||
|
combatant.update({name: combatant.name + " (H)"})
|
||||||
|
console.log("HOLD", combatant)
|
||||||
|
}
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static abortAction(html, combatantId) {
|
||||||
|
console.log("Combatant ABORT : ", combatantId);
|
||||||
|
const combatant = game.combat.combatants.get(combatantId);
|
||||||
|
combatant.setFlag("world", "hero6-abort-action", true)
|
||||||
|
combatant.update({name: combatant.name + " (A)"})
|
||||||
|
console.log("ABORT", combatant)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
constructor(data, context) {
|
||||||
|
super(data, context);
|
||||||
|
|
||||||
|
this.turnNumber = 1;
|
||||||
|
this.segmentNumber = 12;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
async computeInitiative(c) {
|
||||||
|
let id = c._id || c.id
|
||||||
|
if (c.actor.hasPhase(this.segmentNumber)) {
|
||||||
|
let baseInit = c.actor ? c.actor.getBaseInit() : - 1;
|
||||||
|
await this.updateEmbeddedDocuments("Combatant", [{ _id: id, initiative: baseInit }]);
|
||||||
|
} else {
|
||||||
|
await this.updateEmbeddedDocuments("Combatant", [{ _id: id, initiative: -1, visible: false, active: false }]);
|
||||||
|
}
|
||||||
|
console.log("Combatant", c)
|
||||||
|
}
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
async rollInitiative(ids, formula = undefined, messageOptions = {}) {
|
||||||
ids = typeof ids === "string" ? [ids] : ids;
|
ids = typeof ids === "string" ? [ids] : ids;
|
||||||
for (let cId = 0; cId < ids.length; cId++) {
|
for (let cId = 0; cId < ids.length; cId++) {
|
||||||
const c = this.combatants.get(ids[cId]);
|
const c = this.combatants.get(ids[cId])
|
||||||
let id = c._id || c.id;
|
await this.computeInitiative(c)
|
||||||
let initBonus = c.actor ? c.actor.getInitiativeScore( this.id, id ) : -1;
|
|
||||||
await this.updateEmbeddedDocuments("Combatant", [ { _id: id, initiative: initBonus } ]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
nextRound() {
|
||||||
|
let turn = this.turn === null ? null : 0; // Preserve the fact that it's no-one's turn currently.
|
||||||
|
if (this.settings.skipDefeated && (turn !== null)) {
|
||||||
|
turn = this.turns.findIndex(t => !t.isDefeated);
|
||||||
|
if (turn === -1) {
|
||||||
|
ui.notifications.warn("COMBAT.NoneRemaining", { localize: true });
|
||||||
|
turn = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let advanceTime = Math.max(this.turns.length - this.turn, 0) * CONFIG.time.turnTime;
|
||||||
|
advanceTime += CONFIG.time.roundTime;
|
||||||
|
let nextRound = this.round + 1;
|
||||||
|
|
||||||
|
let turnData = this.getFlag("world", "hero6-turn-data")
|
||||||
|
if (!turnData) {
|
||||||
|
turnData = { turnNumber: 1, segmentNumber: 12 }
|
||||||
|
this.setFlag("world", "hero6-turn-data", turnData)
|
||||||
|
}
|
||||||
|
turnData = duplicate(turnData)
|
||||||
|
turnData.segmentNumber -= 1
|
||||||
|
if (turnData.segmentNumber <= 0) {
|
||||||
|
turnData.segmentNumber = 12
|
||||||
|
turnData.turnNumber++
|
||||||
|
}
|
||||||
|
this.setFlag("world", "hero6-turn-data", turnData)
|
||||||
|
this.turnNumber = turnData.turnNumber;
|
||||||
|
this.segmentNumber = turnData.segmentNumber;
|
||||||
|
|
||||||
|
// Re-compute init of actors
|
||||||
|
for (let c of this.combatants) {
|
||||||
|
this.computeInitiative(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update the document, passing data through a hook first
|
||||||
|
const updateData = { round: nextRound, turn, segmentNumber: turnData.segmentNumber, turnNumber: turnData.turnNumber };
|
||||||
|
const updateOptions = { advanceTime, direction: 1 };
|
||||||
|
Hooks.callAll("combatRound", this, updateData, updateOptions);
|
||||||
|
return this.update(updateData, updateOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
async _onCreateEmbeddedDocuments(type, documents, result, options, userId) {
|
||||||
|
console.log(">>>>", documents)
|
||||||
|
super._onCreateEmbeddedDocuments(type, documents, result, options, userId)
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
_onUpdate(changed, options, userId) {
|
_onUpdate(changed, options, userId) {
|
||||||
}
|
}
|
||||||
|
@ -48,5 +48,11 @@ export const Hero6_CONFIG = {
|
|||||||
powerSenseAffecting: {
|
powerSenseAffecting: {
|
||||||
"none": "None",
|
"none": "None",
|
||||||
"senseaffecting": "Sense-Affecting",
|
"senseaffecting": "Sense-Affecting",
|
||||||
|
},
|
||||||
|
powerEffectRoll: {
|
||||||
|
"standard": "Standard",
|
||||||
|
"normal": "Normal",
|
||||||
|
"killing": "Killing",
|
||||||
|
"countbody": "Killing (Count BODY)"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -13,7 +13,7 @@ import { Hero6ItemSheet } from "./hero6-item-sheet.js";
|
|||||||
import { Hero6ActorSheet } from "./hero6-actor-sheet.js";
|
import { Hero6ActorSheet } from "./hero6-actor-sheet.js";
|
||||||
import { Hero6NPCSheet } from "./hero6-npc-sheet.js";
|
import { Hero6NPCSheet } from "./hero6-npc-sheet.js";
|
||||||
import { Hero6Utility } from "./hero6-utility.js";
|
import { Hero6Utility } from "./hero6-utility.js";
|
||||||
import { Hero6Combat } from "./hero6-combat.js";
|
import { Hero6Combat, Hero6CombatTracker } from "./hero6-combat.js";
|
||||||
import { Hero6Item } from "./hero6-item.js";
|
import { Hero6Item } from "./hero6-item.js";
|
||||||
import { Hero6Hotbar } from "./hero6-hotbar.js"
|
import { Hero6Hotbar } from "./hero6-hotbar.js"
|
||||||
import { Hero6Commands } from "./hero6-commands.js"
|
import { Hero6Commands } from "./hero6-commands.js"
|
||||||
@ -41,7 +41,7 @@ Hooks.once("init", async function () {
|
|||||||
// Set an initiative formula for the system
|
// Set an initiative formula for the system
|
||||||
CONFIG.Combat.initiative = {
|
CONFIG.Combat.initiative = {
|
||||||
formula: "1d6",
|
formula: "1d6",
|
||||||
decimals: 1
|
decimals: 3
|
||||||
};
|
};
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -54,6 +54,8 @@ Hooks.once("init", async function () {
|
|||||||
CONFIG.Combat.documentClass = Hero6Combat
|
CONFIG.Combat.documentClass = Hero6Combat
|
||||||
CONFIG.Actor.documentClass = Hero6Actor
|
CONFIG.Actor.documentClass = Hero6Actor
|
||||||
CONFIG.Item.documentClass = Hero6Item
|
CONFIG.Item.documentClass = Hero6Item
|
||||||
|
CONFIG.ui.combat = Hero6CombatTracker;
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
// Register sheet application classes
|
// Register sheet application classes
|
||||||
@ -65,6 +67,7 @@ Hooks.once("init", async function () {
|
|||||||
Items.registerSheet("fvtt-hero-system-6", Hero6ItemSheet, { makeDefault: true });
|
Items.registerSheet("fvtt-hero-system-6", Hero6ItemSheet, { makeDefault: true });
|
||||||
|
|
||||||
Hero6Utility.init()
|
Hero6Utility.init()
|
||||||
|
Hero6Combat.init()
|
||||||
});
|
});
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -20,11 +20,14 @@ export class Hero6Utility {
|
|||||||
Handlebars.registerHelper('count', function (list) {
|
Handlebars.registerHelper('count', function (list) {
|
||||||
return list.length;
|
return list.length;
|
||||||
})
|
})
|
||||||
|
Handlebars.registerHelper('exists', function (val) {
|
||||||
|
return val != null && val != undefined;
|
||||||
|
});
|
||||||
Handlebars.registerHelper('includes', function (array, val) {
|
Handlebars.registerHelper('includes', function (array, val) {
|
||||||
return array.includes(val);
|
return array.includes(val);
|
||||||
})
|
})
|
||||||
Handlebars.registerHelper('upper', function (text) {
|
Handlebars.registerHelper('upper', function (text) {
|
||||||
if (text) {
|
if (text) {
|
||||||
return text.toUpperCase();
|
return text.toUpperCase();
|
||||||
}
|
}
|
||||||
return text
|
return text
|
||||||
@ -43,14 +46,14 @@ export class Hero6Utility {
|
|||||||
return parseInt(a) * parseInt(b);
|
return parseInt(a) * parseInt(b);
|
||||||
})
|
})
|
||||||
Handlebars.registerHelper('locationLabel', function (key) {
|
Handlebars.registerHelper('locationLabel', function (key) {
|
||||||
return __locationNames[key]
|
return __locationNames[key]
|
||||||
})
|
})
|
||||||
Handlebars.registerHelper('isSkillCustom', function (key) {
|
Handlebars.registerHelper('isSkillCustom', function (key) {
|
||||||
if (key == "custom" ) {
|
if (key == "custom") {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
|
|
||||||
this.gameSettings()
|
this.gameSettings()
|
||||||
|
|
||||||
@ -78,12 +81,16 @@ export class Hero6Utility {
|
|||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------- */
|
/*-------------------------------------------- */
|
||||||
static getDerivatedDiceValue(value) {
|
static getDerivatedDiceFormulas(value) {
|
||||||
let dices = Math.floor(value/5) +"d6"
|
let rollFormula = Math.floor(value / 5) + "d6"
|
||||||
if ( value % 5 > 2) {
|
let displayFormula = Math.floor(value / 5)
|
||||||
dices += "+1d3"
|
if (value % 5 > 2) {
|
||||||
|
rollFormula += "+round(1d6/2)"
|
||||||
|
displayFormula += " 1/2d6"
|
||||||
|
} else {
|
||||||
|
displayFormula += "d6"
|
||||||
}
|
}
|
||||||
return dices
|
return { rollFormula: rollFormula, displayFormula: displayFormula }
|
||||||
}
|
}
|
||||||
/*-------------------------------------------- */
|
/*-------------------------------------------- */
|
||||||
static upperFirst(text) {
|
static upperFirst(text) {
|
||||||
@ -172,7 +179,8 @@ export class Hero6Utility {
|
|||||||
'systems/fvtt-hero-system-6/templates/partials/partial-power-equipment-cost.hbs',
|
'systems/fvtt-hero-system-6/templates/partials/partial-power-equipment-cost.hbs',
|
||||||
'systems/fvtt-hero-system-6/templates/partials/partial-item-hasroll.hbs',
|
'systems/fvtt-hero-system-6/templates/partials/partial-item-hasroll.hbs',
|
||||||
'systems/fvtt-hero-system-6/templates/partials/partial-actor-equipment.hbs',
|
'systems/fvtt-hero-system-6/templates/partials/partial-actor-equipment.hbs',
|
||||||
'systems/fvtt-hero-system-6/templates/partials/partial-actor-equipment-section.hbs'
|
'systems/fvtt-hero-system-6/templates/partials/partial-actor-equipment-section.hbs',
|
||||||
|
'systems/fvtt-hero-system-6/templates/partials/partial-power-maneuver-effect.hbs'
|
||||||
]
|
]
|
||||||
return loadTemplates(templatePaths);
|
return loadTemplates(templatePaths);
|
||||||
}
|
}
|
||||||
@ -301,13 +309,40 @@ export class Hero6Utility {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------- ----------------------------- */
|
||||||
|
static computeBodyValue(roll) {
|
||||||
|
let bodyValue = 0
|
||||||
|
for (let term of roll.terms) {
|
||||||
|
if (term.constructor.name == "Die") {
|
||||||
|
for (let value of term.values) {
|
||||||
|
if (value > 1) {
|
||||||
|
bodyValue += 1
|
||||||
|
}
|
||||||
|
if (value == 6) {
|
||||||
|
bodyValue += 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (term.constructor.name == "NumericTerm") {
|
||||||
|
if (term.total > 1) {
|
||||||
|
bodyValue += 1
|
||||||
|
}
|
||||||
|
if (term.total == 6) {
|
||||||
|
bodyValue += 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return bodyValue
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async rollHero6(rollData) {
|
static async rollHero6(rollData) {
|
||||||
|
|
||||||
let actor = game.actors.get(rollData.actorId)
|
let actor = game.actors.get(rollData.actorId)
|
||||||
|
|
||||||
// ability/save/size => 0
|
// ability/save/size => 0
|
||||||
let diceFormula = "3d6"
|
let diceFormula = "3d6"
|
||||||
let target = 10
|
let target = 10
|
||||||
if (rollData.charac) {
|
if (rollData.charac) {
|
||||||
target = rollData.charac.roll
|
target = rollData.charac.roll
|
||||||
@ -316,7 +351,7 @@ export class Hero6Utility {
|
|||||||
target = rollData.item.roll || rollData.item.system.roll
|
target = rollData.item.roll || rollData.item.system.roll
|
||||||
}
|
}
|
||||||
target += rollData.bonusMalus
|
target += rollData.bonusMalus
|
||||||
|
|
||||||
// Performs roll
|
// Performs roll
|
||||||
console.log("Roll formula", diceFormula)
|
console.log("Roll formula", diceFormula)
|
||||||
let myRoll = rollData.roll
|
let myRoll = rollData.roll
|
||||||
@ -324,6 +359,7 @@ export class Hero6Utility {
|
|||||||
myRoll = new Roll(diceFormula).roll({ async: false })
|
myRoll = new Roll(diceFormula).roll({ async: false })
|
||||||
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
||||||
}
|
}
|
||||||
|
|
||||||
rollData.roll = myRoll
|
rollData.roll = myRoll
|
||||||
rollData.target = target
|
rollData.target = target
|
||||||
rollData.diceFormula = diceFormula
|
rollData.diceFormula = diceFormula
|
||||||
@ -332,23 +368,42 @@ export class Hero6Utility {
|
|||||||
if (rollData.result <= target) {
|
if (rollData.result <= target) {
|
||||||
rollData.isSuccess = true
|
rollData.isSuccess = true
|
||||||
}
|
}
|
||||||
if ( myRoll.terms[0].total == 3) { // Always a success
|
if (myRoll.terms[0].total == 3) { // Always a success
|
||||||
rollData.isSuccess = true
|
rollData.isSuccess = true
|
||||||
}
|
}
|
||||||
if ( myRoll.terms[0].total == 18) { // Always a failure
|
if (myRoll.terms[0].total == 18) { // Always a failure
|
||||||
rollData.isSuccess = false
|
rollData.isSuccess = false
|
||||||
}
|
}
|
||||||
rollData.margin = target - rollData.result
|
rollData.margin = target - rollData.result
|
||||||
|
|
||||||
|
if (rollData.item && rollData.item.system.computebody) {
|
||||||
|
rollData.bodyValue = this.computeBody(myRoll)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.outputRollMessage(rollData)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------- ----------------------------- */
|
||||||
|
static processDirectRoll(rollData) {
|
||||||
|
let roll = new Roll(rollData.rollFormula).roll({ async: false })
|
||||||
|
rollData.roll = roll
|
||||||
|
|
||||||
|
rollData.result = roll.total
|
||||||
|
rollData.bodyValue = this.computeBody(rollData.roll)
|
||||||
|
|
||||||
|
this.outputRollMessage(rollData)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------- ----------------------------- */
|
||||||
|
static async outputRollMessage(rollData) {
|
||||||
let msg = await this.createChatWithRollMode(rollData.alias, {
|
let msg = await this.createChatWithRollMode(rollData.alias, {
|
||||||
content: await renderTemplate(`systems/fvtt-hero-system-6/templates/chat/chat-generic-result.hbs`, rollData)
|
content: await renderTemplate(`systems/fvtt-hero-system-6/templates/chat/chat-generic-result.hbs`, rollData)
|
||||||
})
|
})
|
||||||
msg.setFlag("world", "rolldata", rollData)
|
msg.setFlag("world", "rolldata", rollData)
|
||||||
console.log("Rolldata result", rollData)
|
console.log("Rolldata result", rollData)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------- ----------------------------- */
|
||||||
static sortArrayObjectsByName(myArray) {
|
static sortArrayObjectsByName(myArray) {
|
||||||
myArray.sort((a, b) => {
|
myArray.sort((a, b) => {
|
||||||
let fa = a.name.toLowerCase();
|
let fa = a.name.toLowerCase();
|
||||||
|
@ -1451,4 +1451,8 @@ Focus FOC: #ff0084
|
|||||||
.biodata-portrait {
|
.biodata-portrait {
|
||||||
min-height: 512px;
|
min-height: 512px;
|
||||||
min-width: 256px;
|
min-width: 256px;
|
||||||
|
}
|
||||||
|
.textarea-full-height {
|
||||||
|
min-height: 100%;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
@ -91,7 +91,7 @@
|
|||||||
"styles": [
|
"styles": [
|
||||||
"styles/simple.css"
|
"styles/simple.css"
|
||||||
],
|
],
|
||||||
"version": "10.0.29",
|
"version": "10.0.34",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "10",
|
"minimum": "10",
|
||||||
"verified": "10",
|
"verified": "10",
|
||||||
@ -99,7 +99,7 @@
|
|||||||
},
|
},
|
||||||
"title": "Hero System v6 for FoundrtVTT (Official)",
|
"title": "Hero System v6 for FoundrtVTT (Official)",
|
||||||
"manifest": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/raw/branch/main/system.json",
|
"manifest": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/raw/branch/main/system.json",
|
||||||
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/archive/fvtt-hero-system-6-v10.0.29.zip",
|
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/archive/fvtt-hero-system-6-v10.0.34.zip",
|
||||||
"url": "https://www.uberwald.me/gitea/uberwald/",
|
"url": "https://www.uberwald.me/gitea/uberwald/",
|
||||||
"background": "images/ui/hro6_welcome_page.webp",
|
"background": "images/ui/hro6_welcome_page.webp",
|
||||||
"id": "fvtt-hero-system-6"
|
"id": "fvtt-hero-system-6"
|
||||||
|
@ -31,8 +31,9 @@
|
|||||||
"xpearned": 0,
|
"xpearned": 0,
|
||||||
"xpspent": 0,
|
"xpspent": 0,
|
||||||
"combatskills": "",
|
"combatskills": "",
|
||||||
"presenceattack": "",
|
"presenceattack": {},
|
||||||
"gmnotes": ""
|
"gmnotes": "",
|
||||||
|
"combatnotes1":""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"characteristics": {
|
"characteristics": {
|
||||||
@ -42,7 +43,7 @@
|
|||||||
"value": 10,
|
"value": 10,
|
||||||
"base": 10,
|
"base": 10,
|
||||||
"category": "main",
|
"category": "main",
|
||||||
"strdice": "",
|
"strdice": {},
|
||||||
"lift": "",
|
"lift": "",
|
||||||
"strend": 0,
|
"strend": 0,
|
||||||
"hasroll": true,
|
"hasroll": true,
|
||||||
@ -68,7 +69,8 @@
|
|||||||
"hasroll": true,
|
"hasroll": true,
|
||||||
"category": "main",
|
"category": "main",
|
||||||
"value": 10,
|
"value": 10,
|
||||||
"base": 10
|
"base": 10,
|
||||||
|
"perceptionroll": 10
|
||||||
},
|
},
|
||||||
"ego": {
|
"ego": {
|
||||||
"label": "Ego",
|
"label": "Ego",
|
||||||
@ -314,7 +316,6 @@
|
|||||||
"power",
|
"power",
|
||||||
"advantage",
|
"advantage",
|
||||||
"maneuver",
|
"maneuver",
|
||||||
"martialart",
|
|
||||||
"limitation",
|
"limitation",
|
||||||
"complication",
|
"complication",
|
||||||
"equipment"
|
"equipment"
|
||||||
@ -344,6 +345,10 @@
|
|||||||
"endurance": 0,
|
"endurance": 0,
|
||||||
"hasroll": false,
|
"hasroll": false,
|
||||||
"roll": 0,
|
"roll": 0,
|
||||||
|
"computebody": false,
|
||||||
|
"haseffectroll": false,
|
||||||
|
"effectroll": "standard",
|
||||||
|
"effectrollformula": "",
|
||||||
"items": {}
|
"items": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -355,6 +360,7 @@
|
|||||||
"pha": "",
|
"pha": "",
|
||||||
"ocv": 0,
|
"ocv": 0,
|
||||||
"dcv" : 0,
|
"dcv" : 0,
|
||||||
|
"isstock": false,
|
||||||
"active": false
|
"active": false
|
||||||
},
|
},
|
||||||
"advantage": {
|
"advantage": {
|
||||||
@ -458,15 +464,6 @@
|
|||||||
"templates": [
|
"templates": [
|
||||||
"common"
|
"common"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
"martialart": {
|
|
||||||
"maneuver_phase": 0,
|
|
||||||
"maneuver_ocv": 0,
|
|
||||||
"maneuver_dcv": 0,
|
|
||||||
"maneuver_effect": "",
|
|
||||||
"templates": [
|
|
||||||
"common"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -98,7 +98,7 @@
|
|||||||
<a class="" data-tab="skills">Skills</a>
|
<a class="" data-tab="skills">Skills</a>
|
||||||
<a class="" data-tab="perks">Perks</a>
|
<a class="" data-tab="perks">Perks</a>
|
||||||
<a class="" data-tab="talents">Talents</a>
|
<a class="" data-tab="talents">Talents</a>
|
||||||
<a class="" data-tab="martial">Martial Arts</a>
|
<a class="" data-tab="maneuver">Maneuvers</a>
|
||||||
<a class="" data-tab="powers">Powers</a>
|
<a class="" data-tab="powers">Powers</a>
|
||||||
<a class="" data-tab="complications">Complications</a>
|
<a class="" data-tab="complications">Complications</a>
|
||||||
<a class="" data-tab="equipment">Equipment</a>
|
<a class="" data-tab="equipment">Equipment</a>
|
||||||
@ -117,7 +117,7 @@
|
|||||||
<ul class="item-list alternate-list">
|
<ul class="item-list alternate-list">
|
||||||
<li class="item">
|
<li class="item">
|
||||||
<label class="item-field-label-medium">STR Dice</label>
|
<label class="item-field-label-medium">STR Dice</label>
|
||||||
<a class="roll-direct" data-roll-formula="{{characteristics.str.strdice}}"><i class="fas fa-dice"></i>{{characteristics.str.strdice}}</a>
|
<a class="roll-direct" data-roll-source="STR Dice" data-roll-formula="{{characteristics.str.strdice.rollFormula}}"><i class="fas fa-dice"></i>{{characteristics.str.strdice.displayFormula}}</a>
|
||||||
<label class="item-field-label-short"> </label>
|
<label class="item-field-label-short"> </label>
|
||||||
<label class="item-field-label-medium">Lift</label>
|
<label class="item-field-label-medium">Lift</label>
|
||||||
<input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.str.lift" value="{{characteristics.str.lift}}" data-dtype="String" />
|
<input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.str.lift" value="{{characteristics.str.lift}}" data-dtype="String" />
|
||||||
@ -127,7 +127,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="flexrow item">
|
<li class="flexrow item">
|
||||||
<label class="item-field-label-long">Presence attack</label>
|
<label class="item-field-label-long">Presence attack</label>
|
||||||
<a class="roll-direct" data-roll-formula="{{system.biodata.presenceattack}}"><i class="fas fa-dice"></i>{{system.biodata.presenceattack}}</a>
|
<a class="roll-direct" data-roll-source="Presence attack" data-roll-formula="{{system.biodata.presenceattack.rollFormula}}"><i class="fas fa-dice"></i>{{system.biodata.presenceattack.displayFormula}}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -135,7 +135,7 @@
|
|||||||
<ul class="stat-list alternate-list">
|
<ul class="stat-list alternate-list">
|
||||||
<li class="item flexrow list-item items-title-bg">
|
<li class="item flexrow list-item items-title-bg">
|
||||||
<span class="item-field-label-long-img">
|
<span class="item-field-label-long-img">
|
||||||
<label class="">{{upperFirst key}} Maneuvers</label>
|
<label class="">{{upperFirst key}} Standard Maneuver</label>
|
||||||
</span>
|
</span>
|
||||||
<span class="item-field-label-short">
|
<span class="item-field-label-short">
|
||||||
<label class="short-label">PHA</label>
|
<label class="short-label">PHA</label>
|
||||||
@ -187,10 +187,10 @@
|
|||||||
<label class="">Vitals</label>
|
<label class="">Vitals</label>
|
||||||
</span>
|
</span>
|
||||||
<span class="item-field-label-short">
|
<span class="item-field-label-short">
|
||||||
<label class="short-label">Val.</label>
|
<label class="short-label">Val</label>
|
||||||
</span>
|
</span>
|
||||||
<span class="item-field-label-short">
|
<span class="item-field-label-short">
|
||||||
<label class="short-label">Dam.</label>
|
<label class="short-label">Dmg</label>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
{{#each characteristics as |char key|}}
|
{{#each characteristics as |char key|}}
|
||||||
@ -214,10 +214,10 @@
|
|||||||
<label class="">Defenses</label>
|
<label class="">Defenses</label>
|
||||||
</span>
|
</span>
|
||||||
<span class="item-field-label-short">
|
<span class="item-field-label-short">
|
||||||
<label class="short-label">Val.</label>
|
<label class="short-label">Val</label>
|
||||||
</span>
|
</span>
|
||||||
<span class="item-field-label-short">
|
<span class="item-field-label-short">
|
||||||
<label class="short-label">Res.</label>
|
<label class="short-label">Res</label>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
{{#each characteristics as |char key|}}
|
{{#each characteristics as |char key|}}
|
||||||
@ -277,16 +277,14 @@
|
|||||||
<label class="">Senses</label>
|
<label class="">Senses</label>
|
||||||
</span>
|
</span>
|
||||||
<span class="item-field-label-short">
|
<span class="item-field-label-short">
|
||||||
<label class="short-label">Val.</label>
|
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
{{#each senses as |sense key|}}
|
|
||||||
<li class="item flexrow list-item list-item-shadow" data-charac-key="{{key}}">
|
<li class="item flexrow list-item list-item-shadow" data-charac-key="{{key}}">
|
||||||
<span class="item-field-label-long">{{sense.label}}</span>
|
<span class="item-field-label-long">Perception Roll</span>
|
||||||
<span class="item-field-label-short">{{sense.value}}</span>
|
<input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.int.perceptionroll" value="{{characteristics.int.perceptionroll}}" data-dtype="Number" />
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
|
||||||
</ul>
|
</ul>
|
||||||
|
<textarea type="text" class="textarea-full-height padd-right" name="system.biodata.combatnotes1" data-dtype="String">{{system.biodata.combatnotes1}}</textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@ -296,10 +294,10 @@
|
|||||||
<label class="">Movement</label>
|
<label class="">Movement</label>
|
||||||
</span>
|
</span>
|
||||||
<span class="item-field-label-short">
|
<span class="item-field-label-short">
|
||||||
<label class="short-label">C.</label>
|
<label class="short-label">C</label>
|
||||||
</span>
|
</span>
|
||||||
<span class="item-field-label-short">
|
<span class="item-field-label-short">
|
||||||
<label class="short-label">Non-C.</label>
|
<label class="short-label">NC</label>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
{{#each characteristics as |char key|}}
|
{{#each characteristics as |char key|}}
|
||||||
@ -457,33 +455,44 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{!-- Martial Tab --}}
|
{{!-- Maneuvers Tab --}}
|
||||||
<div class="tab martial" data-group="primary" data-tab="martial">
|
<div class="tab maneuver" data-group="primary" data-tab="maneuver">
|
||||||
|
|
||||||
<ul class="stat-list alternate-list item-list">
|
<ul class="stat-list alternate-list item-list">
|
||||||
<li class="item flexrow list-item items-title-bg">
|
<li class="item flexrow list-item items-title-bg">
|
||||||
<span class="item-field-label-long-img">
|
<span class="item-field-label-long-img">
|
||||||
<label class="">Martial Arts</label>
|
<label class="">Maneuvers</label>
|
||||||
</span>
|
</span>
|
||||||
<span class="item-field-label-short">
|
<span class="item-field-label-short">
|
||||||
<label class="short-label">Roll</label>
|
<label class="short-label">PHA</label>
|
||||||
|
</span>
|
||||||
|
<span class="item-field-label-short">
|
||||||
|
<label class="short-label">OCV</label>
|
||||||
|
</span>
|
||||||
|
<span class="item-field-label-short">
|
||||||
|
<label class="short-label">DCV</label>
|
||||||
|
</span>
|
||||||
|
<span class="item-field-label-long">
|
||||||
|
<label class="short-label">Effects</label>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
{{#each martialarts as |martial key|}}
|
{{#each nonstockmaneuvers as |maneuver key|}}
|
||||||
<li class="item stat flexrow list-item list-item-shadow" data-item-id="{{martial._id}}">
|
<li class="item stat flexrow list-item list-item-shadow" data-item-id="{{maneuver._id}}">
|
||||||
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
|
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
|
||||||
src="{{martial.img}}" /></a>
|
src="{{maneuver.img}}" /></a>
|
||||||
<span class="item-name-label"><a class="roll-item" data-type="talent">{{martial.name}}</a></span>
|
<span class="item-field-label-long">{{maneuver.name}}</span>
|
||||||
{{#if martial.system.hasroll}}
|
|
||||||
<span class="item-field-label-short">{{martial.system.roll}}-</span>
|
<span class="item-field-label-short">{{maneuver.system.pha}}</span>
|
||||||
{{else}}
|
<span class="item-field-label-short">{{maneuver.system.ocv}}</span>
|
||||||
<span class="item-field-label-short"> </span>
|
<span class="item-field-label-short">{{maneuver.system.dcv}}</span>
|
||||||
{{/if}}
|
|
||||||
<div class="item-filler"> </div>
|
<span class="item-field-label-long">{{maneuver.system.effects}}</span>
|
||||||
<div class="item-controls item-controls-fixed">
|
|
||||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
<div class="item-filler"> </div>
|
||||||
</div>
|
<div class="item-controls item-controls-fixed">
|
||||||
</li>
|
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
127
templates/apps/combat-tracker.hbs
Normal file
127
templates/apps/combat-tracker.hbs
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
<section class="{{cssClass}} directory flexcol" id="{{cssId}}" data-tab="{{tabName}}">
|
||||||
|
<header class="combat-tracker-header">
|
||||||
|
{{#if user.isGM}}
|
||||||
|
<nav class="encounters flexrow" aria-label="COMBAT.NavLabel">
|
||||||
|
<a class="combat-button combat-create" data-tooltip="COMBAT.Create">
|
||||||
|
<i class="fas fa-plus"></i>
|
||||||
|
</a>
|
||||||
|
{{#if combatCount}}
|
||||||
|
<a class="combat-button combat-cycle" data-tooltip="COMBAT.EncounterPrevious"
|
||||||
|
{{#if previousId}}data-document-id="{{previousId}}"{{else}}disabled{{/if}}>
|
||||||
|
<i class="fas fa-caret-left"></i>
|
||||||
|
</a>
|
||||||
|
<h4 class="encounter">{{localize "COMBAT.Encounter"}} {{currentIndex}} / {{combatCount}}</h4>
|
||||||
|
<a class="combat-button combat-cycle" data-tooltip="COMBAT.EncounterNext"
|
||||||
|
{{#if nextId}}data-document-id="{{nextId}}"{{else}}disabled{{/if}}>
|
||||||
|
<i class="fas fa-caret-right"></i>
|
||||||
|
</a>
|
||||||
|
{{/if}}
|
||||||
|
<a class="combat-button combat-control" data-tooltip="COMBAT.Delete" data-control="endCombat" {{#unless combatCount}}disabled{{/unless}}>
|
||||||
|
<i class="fas fa-trash"></i>
|
||||||
|
</a>
|
||||||
|
</nav>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
<div class="encounter-controls flexrow {{#if hasCombat}}combat{{/if}}">
|
||||||
|
{{#if user.isGM}}
|
||||||
|
<a class="combat-button combat-control" data-tooltip="COMBAT.RollAll" data-control="rollAll" {{#unless turns}}disabled{{/unless}}>
|
||||||
|
<i class="fas fa-users"></i>
|
||||||
|
</a>
|
||||||
|
<a class="combat-button combat-control" data-tooltip="COMBAT.RollNPC" data-control="rollNPC" {{#unless turns}}disabled{{/unless}}>
|
||||||
|
<i class="fas fa-users-cog"></i>
|
||||||
|
</a>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if combatCount}}
|
||||||
|
{{#if combat.round}}
|
||||||
|
<h3 class="encounter-title noborder">Turn {{combat.turnNumber}} Segment {{combat.segmentNumber}}</h3>
|
||||||
|
{{else}}
|
||||||
|
<h3 class="encounter-title noborder">{{localize 'COMBAT.NotStarted'}}</h3>
|
||||||
|
{{/if}}
|
||||||
|
{{else}}
|
||||||
|
<h3 class="encounter-title noborder">{{localize "COMBAT.None"}}</h3>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if user.isGM}}
|
||||||
|
<a class="combat-button combat-control" data-tooltip="COMBAT.InitiativeReset" data-control="resetAll"
|
||||||
|
{{#unless hasCombat}}disabled{{/unless}}>
|
||||||
|
<i class="fas fa-undo"></i>
|
||||||
|
</a>
|
||||||
|
<a class="combat-button combat-control" data-tooltip="{{labels.scope}}"
|
||||||
|
data-control="toggleSceneLink" {{#unless hasCombat}}disabled{{/unless}}>
|
||||||
|
<i class="fas fa-{{#unless linked}}un{{/unless}}link"></i>
|
||||||
|
</a>
|
||||||
|
<a class="combat-button combat-settings" data-tooltip="COMBAT.Settings" data-control="trackerSettings">
|
||||||
|
<i class="fas fa-cog"></i>
|
||||||
|
</a>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<ol id="combat-tracker" class="directory-list">
|
||||||
|
{{#each turns}}
|
||||||
|
{{#if (ne this.initiative "-1")}}
|
||||||
|
<li class="combatant actor directory-item flexrow {{this.css}}" data-combatant-id="{{this.id}}">
|
||||||
|
<img class="token-image" data-src="{{this.img}}" alt="{{this.name}}"/>
|
||||||
|
<div class="token-name flexcol">
|
||||||
|
<h4>{{this.name}} {{log this}} {{#if this.holdAction}}(H){{/if}}</h4>
|
||||||
|
<div class="combatant-controls flexrow">
|
||||||
|
{{#if ../user.isGM}}
|
||||||
|
<a class="combatant-control {{#if this.hidden}}active{{/if}}" data-tooltip="COMBAT.ToggleVis" data-control="toggleHidden">
|
||||||
|
<i class="fas fa-eye-slash"></i>
|
||||||
|
</a>
|
||||||
|
<a class="combatant-control {{#if this.defeated}}active{{/if}}" data-tooltip="COMBAT.ToggleDead" data-control="toggleDefeated">
|
||||||
|
<i class="fas fa-skull"></i>
|
||||||
|
</a>
|
||||||
|
{{/if}}
|
||||||
|
{{#if this.canPing}}
|
||||||
|
<a class="combatant-control" data-tooltip="COMBAT.PingCombatant" data-control="pingCombatant">
|
||||||
|
<i class="fa-solid fa-bullseye-arrow"></i>
|
||||||
|
</a>
|
||||||
|
{{/if}}
|
||||||
|
<div class="token-effects">
|
||||||
|
{{#each this.effects}}
|
||||||
|
<img class="token-effect" src="{{this}}"/>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{#if this.hasResource}}
|
||||||
|
<div class="token-resource">
|
||||||
|
<span class="resource">{{this.resource}}</span>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
<div class="token-initiative">
|
||||||
|
{{#if this.hasRolled}}
|
||||||
|
<span class="initiative">{{this.initiative}}</span>
|
||||||
|
{{else if this.owner}}
|
||||||
|
<a class="combatant-control roll" data-tooltip="COMBAT.InitiativeRoll" data-control="rollInitiative"></a>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{{/if}}
|
||||||
|
{{/each}}
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<nav id="combat-controls" class="directory-footer flexrow" data-tooltip-direction="UP">
|
||||||
|
{{#if hasCombat}}
|
||||||
|
{{#if user.isGM}}
|
||||||
|
{{#if round}}
|
||||||
|
<a class="combat-control" data-tooltip="COMBAT.RoundPrev" data-control="previousRound"><i class="fas fa-step-backward"></i></a>
|
||||||
|
<a class="combat-control" data-tooltip="COMBAT.TurnPrev" data-control="previousTurn"><i class="fas fa-arrow-left"></i></a>
|
||||||
|
<a class="combat-control center" data-control="endCombat">{{localize 'COMBAT.End'}}</a>
|
||||||
|
<a class="combat-control" data-tooltip="COMBAT.TurnNext" data-control="nextTurn"><i class="fas fa-arrow-right"></i></a>
|
||||||
|
<a class="combat-control" data-tooltip="COMBAT.RoundNext" data-control="nextRound"><i class="fas fa-step-forward"></i></a>
|
||||||
|
{{else}}
|
||||||
|
<a class="combat-control center" data-control="startCombat">{{localize 'COMBAT.Begin'}}</a>
|
||||||
|
{{/if}}
|
||||||
|
{{else if control}}
|
||||||
|
<a class="combat-control" data-tooltip="COMBAT.TurnPrev" data-control="previousTurn"><i class="fas fa-arrow-left"></i></a>
|
||||||
|
<a class="combat-control center" data-control="nextTurn">{{localize 'COMBAT.TurnEnd'}}</a>
|
||||||
|
<a class="combat-control" data-tooltip="COMBAT.TurnNext" data-control="nextTurn"><i class="fas fa-arrow-right"></i></a>
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
</nav>
|
||||||
|
</section>
|
@ -18,8 +18,14 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<ul>
|
<ul>
|
||||||
|
{{#if target}}
|
||||||
<li>Target Roll : {{target}}-
|
<li>Target Roll : {{target}}-
|
||||||
</li>
|
</li>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if rollSource}}
|
||||||
|
<li>Roll : {{rollSource}}</li>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{#if charac}}
|
{{#if charac}}
|
||||||
<li>CHAR : {{charac.label}}</li>
|
<li>CHAR : {{charac.label}}</li>
|
||||||
@ -29,11 +35,24 @@
|
|||||||
<li>{{item.name}} ({{upperFirst item.type}})</li>
|
<li>{{item.name}} ({{upperFirst item.type}})</li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if (exists bonusMalus)}}
|
||||||
<li>Bonus/Penalty : {{bonusMalus}}
|
<li>Bonus/Penalty : {{bonusMalus}}
|
||||||
</li>
|
</li>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<li><strong>Result : {{result}}</strong> ({{#if isSuccess}}Success!!{{else}}Failure!{{/if}})</li>
|
<li><strong>Result : {{result}}</strong>
|
||||||
|
{{#if (exists margin)}}
|
||||||
|
({{#if isSuccess}}Success!!{{else}}Failure!{{/if}})
|
||||||
|
{{/if}}
|
||||||
|
</li>
|
||||||
|
|
||||||
|
{{#if (exists bodyValue)}}
|
||||||
|
<li><strong>BODY : {{bodyValue}}</strong>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if (exists margin)}}
|
||||||
<li><strong>Margin : {{margin}}</strong>
|
<li><strong>Margin : {{margin}}</strong>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="flexrow"><label class="item-field-label-long">Equipped ?</label>
|
<li class="flexrow"><label class="item-field-label-long">Equipped ?</label>
|
||||||
<label class="item-field-label-medium"><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label>
|
<label class="item-field-label-medium"><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="flexrow"><label class="item-field-label-long">Weight</label>
|
<li class="flexrow"><label class="item-field-label-long">Weight</label>
|
||||||
|
@ -27,6 +27,12 @@
|
|||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
{{> systems/fvtt-hero-system-6/templates/partials/partial-power-maneuver-effect.hbs}}
|
||||||
|
|
||||||
|
<li class="flexrow"><label class="item-field-label-medium">Is stock ?</label>
|
||||||
|
<label class="item-field-label-medium"><input type="checkbox" name="system.isstock" {{checked system.isstock}}/></label>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="flexrow"><label class="item-field-label-medium">PHA</label>
|
<li class="flexrow"><label class="item-field-label-medium">PHA</label>
|
||||||
<input type="text" class="item-field-label-medium" name="system.pha" value="{{system.pha}}" data-dtype="String"/>
|
<input type="text" class="item-field-label-medium" name="system.pha" value="{{system.pha}}" data-dtype="String"/>
|
||||||
</li>
|
</li>
|
||||||
@ -42,6 +48,7 @@
|
|||||||
<li class="flexrow"><label class="item-field-label-medium">Effects</label>
|
<li class="flexrow"><label class="item-field-label-medium">Effects</label>
|
||||||
<input type="text" class="item-field-label-long" name="system.effects" value="{{system.effects}}" data-dtype="String"/>
|
<input type="text" class="item-field-label-long" name="system.effects" value="{{system.effects}}" data-dtype="String"/>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
{{> systems/fvtt-hero-system-6/templates/partials/partial-item-cost.hbs}}
|
{{> systems/fvtt-hero-system-6/templates/partials/partial-item-cost.hbs}}
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
<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-hero-system-6/templates/partials/partial-item-nav.hbs}}
|
|
||||||
|
|
||||||
{{!-- Sheet Body --}}
|
|
||||||
<section class="sheet-body">
|
|
||||||
|
|
||||||
<div class="tab details" data-group="primary" data-tab="details">
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
{{> systems/fvtt-hero-system-6/templates/partials/partial-item-description.hbs}}
|
|
||||||
{{> systems/fvtt-hero-system-6/templates/partials/partial-item-cost.hbs}}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</form>
|
|
@ -18,6 +18,8 @@
|
|||||||
<ul>
|
<ul>
|
||||||
{{> systems/fvtt-hero-system-6/templates/partials/partial-item-hasroll.hbs}}
|
{{> systems/fvtt-hero-system-6/templates/partials/partial-item-hasroll.hbs}}
|
||||||
|
|
||||||
|
{{> systems/fvtt-hero-system-6/templates/partials/partial-power-maneuver-effect.hbs}}
|
||||||
|
|
||||||
{{> systems/fvtt-hero-system-6/templates/partials/partial-power-equipment-cost.hbs}}
|
{{> systems/fvtt-hero-system-6/templates/partials/partial-power-equipment-cost.hbs}}
|
||||||
|
|
||||||
{{> systems/fvtt-hero-system-6/templates/partials/partial-item-cost.hbs}}
|
{{> systems/fvtt-hero-system-6/templates/partials/partial-item-cost.hbs}}
|
||||||
|
@ -6,4 +6,8 @@
|
|||||||
<li class="flexrow"><label class="item-field-label-long">Roll</label>
|
<li class="flexrow"><label class="item-field-label-long">Roll</label>
|
||||||
<input type="text" class="item-field-label-medium" name="system.roll" value="{{system.roll}}" data-dtype="Number"/>
|
<input type="text" class="item-field-label-medium" name="system.roll" value="{{system.roll}}" data-dtype="Number"/>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="flexrow"><label class="item-field-label-long">Computes BODY ?</label>
|
||||||
|
<label class="item-field-label-medium"><input type="checkbox" name="system.computebody" {{checked system.computebody}}/></label>
|
||||||
|
</li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
20
templates/partials/partial-power-maneuver-effect.hbs
Normal file
20
templates/partials/partial-power-maneuver-effect.hbs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<li class="flexrow"><label class="item-field-label-long">Has Effect Roll ?</label>
|
||||||
|
<label class="item-field-label-medium"><input type="checkbox" name="system.haseffectroll" {{checked
|
||||||
|
system.haseffectroll}} /></label>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
{{#if system.haseffectroll}}
|
||||||
|
<li class="flexrow"><label class="item-field-label-long">Effect Roll</label>
|
||||||
|
<select class="item-field-label-long" type="text" name="system.effectroll" value="{{system.effectroll}}"
|
||||||
|
data-dtype="String">
|
||||||
|
{{#select system.effectroll}}
|
||||||
|
{{#each config.powerEffectRoll as |name key|}}
|
||||||
|
<option value="{{key}}">{{name}}</option>
|
||||||
|
{{/each}}
|
||||||
|
{{/select}}
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li class="flexrow"><label class="item-field-label-long">Effect roll formula</label>
|
||||||
|
<input type="text" class="item-field-label-long" name="system.effectrollformula" value="{{system.effectrollformula}}" data-dtype="String"/>
|
||||||
|
</li>
|
||||||
|
{{/if}}
|
Reference in New Issue
Block a user