Compare commits
4 Commits
fvtt-pegas
...
fvtt-pegas
Author | SHA1 | Date | |
---|---|---|---|
47db569efd | |||
ba98d9c264 | |||
c1eb33bc21 | |||
d5f27ae9ea |
BIN
images/dice/hindrance-dice-empty.png
Normal file
BIN
images/dice/hindrance-dice-empty.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.0 KiB |
BIN
images/dice/hindrance-dice.png
Normal file
BIN
images/dice/hindrance-dice.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 37 KiB |
47
lang/en.json
47
lang/en.json
@ -1,27 +1,32 @@
|
||||
{
|
||||
"TYPES": {
|
||||
"Actor": {
|
||||
"character": "Character",
|
||||
"npc": "NPC",
|
||||
"vehicle": "Vehicle"
|
||||
},
|
||||
"Item": {
|
||||
"Race": "Race",
|
||||
"Role": "Role",
|
||||
"Ability": "Ability",
|
||||
"Specialisation": "Specialisation",
|
||||
"Perk": "Perk",
|
||||
"Power": "Power",
|
||||
"Armor": "Armor",
|
||||
"Shield": "Shield",
|
||||
"Equipment": "Equipment",
|
||||
"Weapon": "Weapon",
|
||||
"Effect": "Effect",
|
||||
"Money": "Money",
|
||||
"Virtue": "Virtue",
|
||||
"Vice": "Vice",
|
||||
"Vehiclehull": "Vehicule Hull",
|
||||
"Powercoremodule": "Power Core Module",
|
||||
"Mobilitymodule": "Mobility Module",
|
||||
"Combatmodule": "Combat Module",
|
||||
"Vehiclemodule": "Vehicle Module",
|
||||
"Vehicleweaponmodule" : "Vehicle Weapon Module",
|
||||
"Propulsionmodule": "Propulsion module"
|
||||
"race": "Race",
|
||||
"role": "Role",
|
||||
"ability": "Ability",
|
||||
"specialisation": "Specialisation",
|
||||
"perk": "Perk",
|
||||
"power": "Power",
|
||||
"armor": "Armor",
|
||||
"shield": "Shield",
|
||||
"equipment": "Equipment",
|
||||
"weapon": "Weapon",
|
||||
"effect": "Effect",
|
||||
"money": "Money",
|
||||
"virtue": "Virtue",
|
||||
"vice": "Vice",
|
||||
"vehiclehull": "Vehicule Hull",
|
||||
"powercoremodule": "Power Core Module",
|
||||
"mobilitymodule": "Mobility Module",
|
||||
"combatmodule": "Combat Module",
|
||||
"vehiclemodule": "Vehicle Module",
|
||||
"vehicleweaponmodule" : "Vehicle Weapon Module",
|
||||
"propulsionmodule": "Propulsion module"
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -92,9 +92,7 @@ export class PegasusActor extends Actor {
|
||||
return actor;
|
||||
}
|
||||
|
||||
if (data.type == 'character') {
|
||||
}
|
||||
if (data.type == 'npc') {
|
||||
if (data.type == 'character'|| this.type == 'npc') {
|
||||
}
|
||||
|
||||
|
||||
@ -114,17 +112,17 @@ export class PegasusActor extends Actor {
|
||||
prepareDerivedData() {
|
||||
|
||||
if (this.system.secondary.stealthhealth) {
|
||||
this.update({"system.secondary": {"-=stealthhealth": null}} )
|
||||
this.update({ "system.secondary": { "-=stealthhealth": null } })
|
||||
}
|
||||
if (this.system.secondary.socialhealth) {
|
||||
this.update({"system.secondary": {"-=socialhealth": null}} )
|
||||
this.update({ "system.secondary": { "-=socialhealth": null } })
|
||||
}
|
||||
|
||||
if (!this.traumaState) {
|
||||
this.traumaState = "none"
|
||||
}
|
||||
|
||||
if (this.type == 'character') {
|
||||
if (this.type == 'character' || this.type == 'npc') {
|
||||
this.computeNRGHealth();
|
||||
this.system.encCapacity = this.getEncumbranceCapacity()
|
||||
this.buildContainerTree()
|
||||
@ -770,7 +768,7 @@ export class PegasusActor extends Actor {
|
||||
let combat = duplicate(myself.system.combat)
|
||||
combat.stunlevel += incDec
|
||||
if (combat.stunlevel >= 0) {
|
||||
myself.update({ 'system.combat': combat } )
|
||||
myself.update({ 'system.combat': combat })
|
||||
let chatData = {
|
||||
user: game.user.id,
|
||||
rollMode: game.settings.get("core", "rollMode"),
|
||||
@ -959,13 +957,13 @@ export class PegasusActor extends Actor {
|
||||
async equipGear(equipmentId) {
|
||||
let item = this.items.find(item => item.id == equipmentId);
|
||||
if (item && item.system) {
|
||||
let update = { _id: item.id, "data.equipped": !item.system.equipped };
|
||||
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') {
|
||||
if (this.type == 'character' || this.type == 'npc') {
|
||||
this.rollMR(true, combatId, combatantId)
|
||||
}
|
||||
if (this.type == 'vehicle') {
|
||||
@ -1016,7 +1014,7 @@ export class PegasusActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
getStat(statKey) {
|
||||
let stat
|
||||
if (this.type == "character" && statKey == 'mr') {
|
||||
if ((this.type == "character" || this.type == 'npc') && statKey == 'mr') {
|
||||
stat = duplicate(this.system.mr)
|
||||
} else {
|
||||
stat = duplicate(this.system.statistics[statKey])
|
||||
@ -1154,7 +1152,7 @@ export class PegasusActor extends Actor {
|
||||
async updatePerkUsed(itemId, index, checked) {
|
||||
let item = this.items.get(itemId)
|
||||
if (item && index) {
|
||||
let key = "data.used" + index
|
||||
let key = "system.used" + index
|
||||
await this.updateEmbeddedDocuments('Item', [{ _id: itemId, [`${key}`]: checked }])
|
||||
item = this.items.get(itemId) // Refresh
|
||||
if (item.system.nbuse == "next1action" && item.system.used1) {
|
||||
@ -1193,7 +1191,7 @@ export class PegasusActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
incDecNRG(value) {
|
||||
if (this.type == "character") {
|
||||
if (this.type == "character" || this.type == 'npc') {
|
||||
let nrg = duplicate(this.system.nrg)
|
||||
nrg.value += value
|
||||
if (nrg.value >= 0 && nrg.value <= nrg.max) {
|
||||
@ -1345,11 +1343,11 @@ export class PegasusActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
getTraumaState() {
|
||||
this.traumaState = "none"
|
||||
if (this.type == "character") {
|
||||
if ( this.system.secondary.delirium.status == "trauma") {
|
||||
if (this.type == "character"|| this.type == 'npc') {
|
||||
if (this.system.secondary.delirium.status == "trauma") {
|
||||
this.traumaState = "trauma"
|
||||
}
|
||||
if ( this.system.secondary.delirium.status == "severetrauma") {
|
||||
if (this.system.secondary.delirium.status == "severetrauma" || this.system.secondary.delirium.status == "defeated") {
|
||||
this.traumaState = "severetrauma"
|
||||
}
|
||||
}
|
||||
@ -1540,7 +1538,7 @@ export class PegasusActor extends Actor {
|
||||
if (this.system.secondary.health.status == "wounded") {
|
||||
hindrance += 1
|
||||
}
|
||||
if (this.system.secondary.health.status == "severelywounded") {
|
||||
if (this.system.secondary.health.status == "severlywounded" || this.system.secondary.health.status == "defeated") {
|
||||
hindrance += 3
|
||||
}
|
||||
}
|
||||
@ -1555,7 +1553,7 @@ export class PegasusActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getArmorResistanceBonus() {
|
||||
let bonus = 0
|
||||
let bonus = 0
|
||||
for (let a of armors) {
|
||||
bonus += Number(a.system.resistance)
|
||||
}
|
||||
@ -1567,43 +1565,52 @@ export class PegasusActor extends Actor {
|
||||
return
|
||||
}
|
||||
let updates = []
|
||||
|
||||
let role = this.getRole() // Get the role for optionnal bonuses
|
||||
let roleBonus = 0
|
||||
|
||||
/* Get MDL bonus */
|
||||
let meleeBonus = 0
|
||||
let effects = this.items.filter(effect => effect.type == "effect" && effect.system.affectstatus && effect.system.affectstatus == "mdl" && (Number(effect.system.effectlevel) > 0))
|
||||
for(let e of effects) {
|
||||
for (let e of effects) {
|
||||
meleeBonus += Number(e.system.effectlevel)
|
||||
}
|
||||
let weaponsMelee = this.items.filter( it => it.type == "weapon" && it.system.damagestatistic.toLowerCase() == "str")
|
||||
let weaponsMelee = this.items.filter(it => it.type == "weapon" && it.system.damagestatistic.toLowerCase() == "str")
|
||||
for (let w of weaponsMelee) {
|
||||
let damage = Number(w.system.damage) + this.system.biodata.sizenum + this.system.biodata.sizebonus + this.system.statistics.str.value + this.system.statistics.str.bonuseffect + meleeBonus
|
||||
if (damage != w.system.mdl ) {
|
||||
if (damage != w.system.mdl) {
|
||||
updates.push({ _id: w.id, "system.mdl": damage })
|
||||
}
|
||||
}
|
||||
|
||||
let rangedBonus = 0
|
||||
effects = this.items.filter(effect => effect.type == "effect" && effect.system.affectstatus && effect.system.affectstatus == "rdl" && (Number(effect.system.effectlevel) > 0))
|
||||
for(let e of effects) {
|
||||
for (let e of effects) {
|
||||
rangedBonus += Number(e.system.effectlevel)
|
||||
}
|
||||
let weaponsRanged = this.items.filter( it => it.type == "weapon" && it.system.statistic.toLowerCase() == "agi")
|
||||
if (role?.name?.toLowerCase() == "ranged") { // Add ranged bonus to ADRL
|
||||
roleBonus = this.getRoleLevel()
|
||||
}
|
||||
let weaponsRanged = this.items.filter(it => it.type == "weapon" && it.system.damagestatistic.toLowerCase() == "pre")
|
||||
for (let w of weaponsRanged) {
|
||||
let damage = Number(w.system.damage) + rangedBonus
|
||||
if (damage != w.system.rdl ) {
|
||||
let damage = roleBonus + Number(w.system.damage) + rangedBonus
|
||||
if (damage != w.system.rdl) {
|
||||
updates.push({ _id: w.id, "system.rdl": damage })
|
||||
}
|
||||
}
|
||||
|
||||
let armorBonus = 0
|
||||
effects = this.items.filter(effect => effect.type == "effect" && effect.system.affectstatus && effect.system.affectstatus == " adrl" && (Number(effect.system.effectlevel) > 0))
|
||||
for(let e of effects) {
|
||||
for (let e of effects) {
|
||||
armorBonus += Number(e.system.effectlevel)
|
||||
}
|
||||
let armors = this.items.filter( it => it.type == "armor")
|
||||
roleBonus = 0
|
||||
if (role?.name?.toLowerCase() == "defender") { // Add defender bonus to ADRL
|
||||
roleBonus = this.getRoleLevel()
|
||||
}
|
||||
let armors = this.items.filter(it => it.type == "armor")
|
||||
for (let a of armors) {
|
||||
let adrl = this.system.statistics.phy.value + this.system.statistics.phy.bonuseffect + this.system.biodata.sizenum + this.system.biodata.sizebonus + a.system.resistance + armorBonus
|
||||
if (adrl != a.system.adrl ) {
|
||||
let adrl = roleBonus + this.system.statistics.phy.value + this.system.statistics.phy.bonuseffect + this.system.biodata.sizenum + this.system.biodata.sizebonus + a.system.resistance + armorBonus
|
||||
if (adrl != a.system.adrl) {
|
||||
updates.push({ _id: a.id, "system.adrl": adrl })
|
||||
}
|
||||
}
|
||||
@ -1693,7 +1700,7 @@ export class PegasusActor extends Actor {
|
||||
async modStat(key, inc = 1) {
|
||||
let stat = duplicate(this.system.statistics[key])
|
||||
stat.mod += parseInt(inc)
|
||||
await this.update({ [`data.statistics.${key}`]: stat })
|
||||
await this.update({ [`system.statistics.${key}`]: stat })
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1701,7 +1708,7 @@ export class PegasusActor extends Actor {
|
||||
key = key.toLowerCase()
|
||||
let stat = duplicate(this.system.statistics[key])
|
||||
stat.value += parseInt(inc)
|
||||
await this.update({ [`data.statistics.${key}`]: stat })
|
||||
await this.update({ [`system.statistics.${key}`]: stat })
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1709,11 +1716,11 @@ export class PegasusActor extends Actor {
|
||||
if (key == "nrg") {
|
||||
let nrg = duplicate(this.system.nrg)
|
||||
nrg.mod += parseInt(inc)
|
||||
await this.update({ [`data.nrg`]: nrg })
|
||||
await this.update({ [`system.nrg`]: nrg })
|
||||
} else {
|
||||
let status = duplicate(this.system.secondary[key])
|
||||
status.bonus += parseInt(inc)
|
||||
await this.update({ [`data.secondary.${key}`]: status })
|
||||
await this.update({ [`system.secondary.${key}`]: status })
|
||||
}
|
||||
}
|
||||
|
||||
@ -1752,7 +1759,7 @@ export class PegasusActor extends Actor {
|
||||
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
|
||||
await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.quantity': newQ }]) // pdates one EmbeddedEntity
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1774,14 +1781,14 @@ export class PegasusActor extends Actor {
|
||||
ability.system = ability.data
|
||||
}
|
||||
if (ability.system.affectedstat != "notapplicable") {
|
||||
if ( ability.system.affectedstat == "mr") {
|
||||
if (ability.system.affectedstat == "mr") {
|
||||
let stat = duplicate(this.system.mr)
|
||||
stat.mod += Number(ability.system.statmodifier)
|
||||
updates[`system.mr`] = stat
|
||||
updates[`system.mr`] = stat
|
||||
} else {
|
||||
let stat = duplicate(this.system.statistics[ability.system.affectedstat])
|
||||
stat.mod += Number(ability.system.statmodifier)
|
||||
updates[`system.statistics.${ability.system.affectedstat}`] = stat
|
||||
updates[`system.statistics.${ability.system.affectedstat}`] = stat
|
||||
}
|
||||
}
|
||||
// manage status bonus
|
||||
@ -1881,7 +1888,7 @@ export class PegasusActor extends Actor {
|
||||
getIncreaseStatValue(updates, statKey) {
|
||||
let stat = duplicate(this.system.statistics[statKey])
|
||||
stat.value += 1;
|
||||
updates[`data.statistics.${statKey}`] = stat
|
||||
updates[`system.statistics.${statKey}`] = stat
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1906,10 +1913,52 @@ export class PegasusActor extends Actor {
|
||||
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
computeCurrentHindrances() {
|
||||
let hindrancesDices = 0
|
||||
if (this.type == "character" || this.type == 'npc') {
|
||||
|
||||
if (this.system.combat.stunlevel > 0) {
|
||||
hindrancesDices += 2
|
||||
}
|
||||
hindrancesDices += this.system.combat.hindrancedice
|
||||
let overCapacity = Math.floor(this.encCurrent / this.getEncumbranceCapacity())
|
||||
if (overCapacity > 0) {
|
||||
hindrancesDices += overCapacity
|
||||
}
|
||||
let effects = this.items.filter(item => item.type == 'effect')
|
||||
for (let effect of effects) {
|
||||
if (effect.system.hindrance) {
|
||||
hindrancesDices += effect.system.effectlevel
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.type == "vehicle") {
|
||||
if (this.system.stun.value > 0) {
|
||||
hindrancesDices += 2
|
||||
}
|
||||
if (this.isVehicleCrawling()) {
|
||||
hindrancesDices += 3
|
||||
}
|
||||
if (this.isVehicleSlow()) {
|
||||
hindrancesDices += 1
|
||||
}
|
||||
if (this.isVehicleAverage()) {
|
||||
hindrancesDices += 1
|
||||
}
|
||||
if (this.isVehicleFast()) {
|
||||
hindrancesDices += 3
|
||||
}
|
||||
if (this.isVehicleExFast()) {
|
||||
hindrancesDices += 5
|
||||
}
|
||||
}
|
||||
return hindrancesDices
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
addHindrancesList(effectsList) {
|
||||
if (this.type == "character") {
|
||||
if (this.type == "character"|| this.type == 'npc') {
|
||||
if (this.system.combat.stunlevel > 0) {
|
||||
effectsList.push({ label: "Stun Hindrance", type: "hindrance", foreign: true, actorId: this.id, applied: false, value: 2 })
|
||||
}
|
||||
@ -1957,7 +2006,7 @@ export class PegasusActor extends Actor {
|
||||
/* ROLL SECTION
|
||||
/* -------------------------------------------- */
|
||||
pushEffect(rollData, effect) {
|
||||
if ( (this.getTraumaState() == "none" && !this.checkNoBonusDice()) || !effect.system.bonusdice) {
|
||||
if ((this.getTraumaState() == "none" && !this.checkNoBonusDice()) || !effect.system.bonusdice) {
|
||||
rollData.effectsList.push({ label: effect.name, type: "effect", applied: false, effect: effect, value: effect.system.effectlevel })
|
||||
}
|
||||
}
|
||||
@ -1993,7 +2042,7 @@ export class PegasusActor extends Actor {
|
||||
rollData.effectsList.push({ label: "Ranged Role Bonus", type: "effect", applied: true, isdynamic: true, value: this.getRoleLevel() })
|
||||
rollData.dicePool = rollData.dicePool.concat(PegasusUtility.buildDicePool("effect-bonus-dice", this.getRoleLevel(), 0, "Ranged Role Bonus"))
|
||||
}
|
||||
if (role && role.name.toLowerCase() == "defender" && subKey == "defence") {
|
||||
if (role && role.name.toLowerCase() == "defender" && (subKey == "defence" || subKey == "dmg-res")) {
|
||||
rollData.effectsList.push({ label: "Defender Role Bonus", type: "effect", applied: true, isdynamic: true, value: this.getRoleLevel() })
|
||||
rollData.dicePool = rollData.dicePool.concat(PegasusUtility.buildDicePool("effect-bonus-dice", this.getRoleLevel(), 0, "Defender Role Bonus"))
|
||||
}
|
||||
@ -2086,6 +2135,7 @@ export class PegasusActor extends Actor {
|
||||
let rollData = PegasusUtility.getBasicRollData(isInit)
|
||||
rollData.alias = this.name
|
||||
rollData.actorImg = this.img
|
||||
rollData.actorType = this.type
|
||||
rollData.tokenId = this.token?.id
|
||||
rollData.actorId = (this.token) ? this.token.actor.id : this.id
|
||||
rollData.img = this.img
|
||||
@ -2096,6 +2146,8 @@ export class PegasusActor extends Actor {
|
||||
rollData.noBonusDice = this.checkNoBonusDice()
|
||||
rollData.dicePool = []
|
||||
rollData.subKey = subKey
|
||||
rollData.tic1 = "NONE"
|
||||
rollData.tic2 = "NONE"
|
||||
|
||||
if (subKey == "melee-dmg" || subKey == "ranged-dmg" || subKey == "power-dmg") {
|
||||
rollData.isDamage = true
|
||||
@ -2158,7 +2210,7 @@ export class PegasusActor extends Actor {
|
||||
}
|
||||
|
||||
if (statKey == "mr") {
|
||||
if (this.type == "character") {
|
||||
if (this.type == "character"|| this.type == 'npc') {
|
||||
rollData.mrVehicle = PegasusUtility.checkIsVehicleCrew(this.id)
|
||||
if (rollData.mrVehicle) {
|
||||
rollData.effectsList.push({
|
||||
@ -2177,7 +2229,9 @@ export class PegasusActor extends Actor {
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rollData.hindranceDices = this.computeCurrentHindrances()
|
||||
|
||||
this.processSizeBonus(rollData)
|
||||
this.addEffects(rollData, isInit, isPower, subKey == "power-dmg")
|
||||
@ -2196,7 +2250,7 @@ export class PegasusActor extends Actor {
|
||||
processSizeBonus(rollData) {
|
||||
if (rollData.defenderTokenId) {
|
||||
let diffSize = 0
|
||||
if (this.type == "character") {
|
||||
if (this.type == "character"|| this.type == 'npc') {
|
||||
this.system.biodata.sizenum = this.system.biodata?.sizenum ?? 0
|
||||
this.system.biodata.sizebonus = this.system.biodata?.sizebonus ?? 0
|
||||
diffSize = rollData.defenderSize - this.system.biodata.sizenum + this.system.biodata.sizebonus
|
||||
|
@ -1,21 +1,98 @@
|
||||
import { PegasusUtility } from "./pegasus-utility.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class PegasusCombat extends Combat {
|
||||
|
||||
export class PegasusCombatTracker extends CombatTracker {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollInitiative(ids, formula = undefined, messageOptions = {} ) {
|
||||
static get defaultOptions() {
|
||||
let path = "systems/fvtt-pegasus-rpg/templates/pegasus-combat-tracker.html";
|
||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||
template: path,
|
||||
});
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html)
|
||||
|
||||
html.find('.combat-tracker-tic').click(ev => {
|
||||
let ticNum = $(ev.currentTarget).data("tic-num")
|
||||
let combatantId = $(ev.currentTarget).data("combatant-id")
|
||||
game.combat.revealTIC(ticNum, combatantId)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class PegasusCombat 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 } ]);
|
||||
let initBonus = c.actor ? c.actor.getInitiativeScore(this.id, id) : -1;
|
||||
await this.updateEmbeddedDocuments("Combatant", [{ _id: id, initiative: initBonus }]);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
isCharacter(combatantId) {
|
||||
const combatant = game.combat.combatants.get(combatantId)
|
||||
if (combatant) {
|
||||
return combatant.actor.type == "character"
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async setTic(combatantId, rollData) {
|
||||
if ( !combatantId) {
|
||||
return
|
||||
}
|
||||
const combatant = game.combat.combatants.get(combatantId)
|
||||
if (combatant) {
|
||||
await combatant.setFlag("world", "tic1", { revealed: false, text: rollData.tic1 })
|
||||
await combatant.setFlag("world", "tic2", { revealed: false, text: rollData.tic2 })
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getTIC(num, combatantId) {
|
||||
if ( !combatantId) {
|
||||
return ""
|
||||
}
|
||||
const combatant = game.combat.combatants.get(combatantId)
|
||||
if (combatant) {
|
||||
let ticData = combatant.getFlag("world", "tic" + num)
|
||||
if (ticData) {
|
||||
let ticText = "TIC" + num + ":" + ticData.text
|
||||
/* returns if revealed or if GM and NPC or if player and owner */
|
||||
if (ticData.revealed || (game.user.isGM && combatant.isNPC) || (!game.user.isGM && combatant.isOwner)) {
|
||||
return ticText
|
||||
}
|
||||
}
|
||||
}
|
||||
return "TIC" + num + ":???"
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async revealTIC(num, combatantId) {
|
||||
if ( !num || !combatantId) {
|
||||
return
|
||||
}
|
||||
const combatant = game.combat.combatants.get(combatantId)
|
||||
if (combatant) {
|
||||
let ticData = combatant.getFlag("world", "tic" + num)
|
||||
if (ticData) {
|
||||
ticData.revealed = true
|
||||
await combatant.setFlag("world", "tic" + num, ticData)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_onUpdate(changed, options, userId) {
|
||||
}
|
||||
@ -28,11 +105,11 @@ export class PegasusCombat extends Combat {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async decInitBy10( combatantId, value) {
|
||||
static async decInitBy10(combatantId, value) {
|
||||
const combatant = game.combat.combatants.get(combatantId)
|
||||
let initValue = combatant.initiative + value
|
||||
await game.combat.setInitiative(combatantId, initValue)
|
||||
setTimeout( this.checkTurnPosition, 400) // The setInitiative is no more blocking for unknown reason
|
||||
setTimeout(this.checkTurnPosition, 400) // The setInitiative is no more blocking for unknown reason
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -92,9 +92,11 @@ export class PegasusActorCreate {
|
||||
|
||||
if (step == 'select-race-optionnal') {
|
||||
let ability = this.raceOptionnalAbilities.optionnalabilities.find(item => item._id == itemId);
|
||||
let update = []
|
||||
let update = {}
|
||||
await this.actor.applyAbility(ability, update);
|
||||
this.actor.update(update)
|
||||
if (!jQuery.isEmptyObject(update)) {
|
||||
this.actor.update(update)
|
||||
}
|
||||
this.actor.createEmbeddedDocuments('Item', [ability]);
|
||||
PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget));
|
||||
this.raceOptionnalAbilities.optionnalabilities = this.raceOptionnalAbilities.optionnalabilities.filter(item => item._id != itemId);
|
||||
|
25
modules/pegasus-hindrance-die.js
Normal file
25
modules/pegasus-hindrance-die.js
Normal file
@ -0,0 +1,25 @@
|
||||
export class PegasusHindranceDie extends Die {
|
||||
constructor(termData ) {
|
||||
termData.faces=6;
|
||||
super(termData);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/** @override */
|
||||
static DENOMINATION = "h";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/** @override */
|
||||
getResultLabel(result) {
|
||||
return {
|
||||
"1": '<img src="systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png" />',
|
||||
"2": '<img src="systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png" />',
|
||||
"3": '<img src="systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png" />',
|
||||
"4": '<img src="systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png" />',
|
||||
"5": '<img src="systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png" />',
|
||||
"6": '<img src="systems/fvtt-pegasus-rpg/images/dice/hindrance-dice.png" />'
|
||||
}[result.result];
|
||||
}
|
||||
}
|
@ -12,11 +12,10 @@ import { PegasusActor } from "./pegasus-actor.js";
|
||||
import { PegasusItemSheet } from "./pegasus-item-sheet.js";
|
||||
import { PegasusActorSheet } from "./pegasus-actor-sheet.js";
|
||||
import { PegasusVehicleSheet } from "./pegasus-vehicle-sheet.js";
|
||||
import { PegasusNPCSheet } from "./pegasus-npc-sheet.js";
|
||||
import { PegasusUtility } from "./pegasus-utility.js";
|
||||
import { PegasusCombat } from "./pegasus-combat.js";
|
||||
import { PegasusCombatTracker,PegasusCombat } from "./pegasus-combat.js";
|
||||
import { PegasusItem } from "./pegasus-item.js";
|
||||
import { PegasusToken } from "./pegasus-token.js";
|
||||
import { PegasusHindranceDie } from "./pegasus-hindrance-die.js";
|
||||
import { PEGASUS_CONFIG } from "./pegasus-config.js"
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -58,6 +57,8 @@ Hooks.once("init", async function () {
|
||||
CONFIG.Combat.documentClass = PegasusCombat
|
||||
CONFIG.Actor.documentClass = PegasusActor
|
||||
CONFIG.Item.documentClass = PegasusItem
|
||||
CONFIG.ui.combat = PegasusCombatTracker
|
||||
CONFIG.Dice.terms["h"] = PegasusHindranceDie
|
||||
game.system.pegasus = {
|
||||
utility: PegasusUtility,
|
||||
config: PEGASUS_CONFIG
|
||||
@ -67,6 +68,7 @@ Hooks.once("init", async function () {
|
||||
// Register sheet application classes
|
||||
Actors.unregisterSheet("core", ActorSheet);
|
||||
Actors.registerSheet("fvtt-pegasus", PegasusActorSheet, { types: ["character"], makeDefault: true })
|
||||
Actors.registerSheet("fvtt-pegasus", PegasusActorSheet, { types: ["npc"], makeDefault: true })
|
||||
Actors.registerSheet("fvtt-pegasus", PegasusVehicleSheet, { types: ["vehicle"], makeDefault: false })
|
||||
|
||||
Items.unregisterSheet("core", ItemSheet);
|
||||
@ -74,7 +76,6 @@ Hooks.once("init", async function () {
|
||||
|
||||
PegasusUtility.init()
|
||||
|
||||
|
||||
});
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -39,6 +39,8 @@ export class PegasusRollDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
roll() {
|
||||
this.rollData.tic1 = $('#roll-input-tic1').val()
|
||||
this.rollData.tic2 = $('#roll-input-tic2').val()
|
||||
PegasusUtility.rollPegasus(this.rollData)
|
||||
}
|
||||
|
||||
|
@ -23,9 +23,32 @@ export class PegasusUtility {
|
||||
Hooks.on('renderChatLog', (log, html, data) => PegasusUtility.chatListeners(html))
|
||||
Hooks.on('targetToken', (user, token, flag) => PegasusUtility.targetToken(user, token, flag))
|
||||
Hooks.on('renderSidebarTab', (app, html, data) => PegasusUtility.addDiceRollButton(app, html, data))
|
||||
Hooks.on("getCombatTrackerEntryContext", (html, options) => {
|
||||
/* Deprecated, no more used in rules Hooks.on("getCombatTrackerEntryContext", (html, options) => {
|
||||
PegasusUtility.pushInitiativeOptions(html, options);
|
||||
});
|
||||
});*/
|
||||
Hooks.once('diceSoNiceReady', (dice3d) => {
|
||||
dice3d.addSystem({ id: "pegasus-hindrance", name: "Hindrance Die" }, "preferred");
|
||||
dice3d.addDicePreset({
|
||||
type: "dh",
|
||||
labels: [
|
||||
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
|
||||
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
|
||||
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
|
||||
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
|
||||
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
|
||||
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice.png'
|
||||
],
|
||||
bumpMaps: [
|
||||
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
|
||||
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
|
||||
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
|
||||
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
|
||||
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
|
||||
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice.png'
|
||||
],
|
||||
system: "pegasus-hindrance"
|
||||
}, "d6")
|
||||
})
|
||||
Hooks.on("dropCanvasData", (canvas, data) => {
|
||||
PegasusUtility.dropItemOnToken(canvas, data)
|
||||
});
|
||||
@ -72,9 +95,27 @@ export class PegasusUtility {
|
||||
})
|
||||
Handlebars.registerHelper('getStatusConfig', function (a) {
|
||||
let key = a + "Status"
|
||||
console.log("TABE", key, game.system.pegasus.config[key] )
|
||||
//console.log("TABE", key, game.system.pegasus.config[key] )
|
||||
return game.system.pegasus.config[key]
|
||||
})
|
||||
Handlebars.registerHelper('valueAtIndex', function (arr, idx) {
|
||||
return arr[idx];
|
||||
})
|
||||
Handlebars.registerHelper('for', function (from, to, incr, block) {
|
||||
let accum = '';
|
||||
for (let i = from; i <= to; i += incr)
|
||||
accum += block.fn(i);
|
||||
return accum;
|
||||
})
|
||||
Handlebars.registerHelper('isGM', function () {
|
||||
return game.user.isGM
|
||||
})
|
||||
Handlebars.registerHelper('getTIC', function (num, id) {
|
||||
return game.combat.getTIC(num, id)
|
||||
})
|
||||
Handlebars.registerHelper('isCharacter', function (id) {
|
||||
return game.combat.isCharacter(id)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@ -136,10 +177,10 @@ export class PegasusUtility {
|
||||
let diceKey = PegasusUtility.getDiceFromLevel(level)
|
||||
let diceList = diceKey.split(" ")
|
||||
for (let myDice of diceList) {
|
||||
myDice = myDice.trim()
|
||||
let myDiceTrim = myDice.trim()
|
||||
let newDice = {
|
||||
name: name, key: myDice, level: PegasusUtility.getLevelFromDice(myDice), mod: mod, effect: effectName,
|
||||
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
|
||||
name: name, key: myDiceTrim, level: PegasusUtility.getLevelFromDice(myDiceTrim), mod: mod, effect: effectName,
|
||||
img: `systems/fvtt-pegasus-rpg/images/dice/${myDiceTrim}.webp`
|
||||
}
|
||||
dicePool.push(newDice)
|
||||
mod = 0 // Only first dice has modifier
|
||||
@ -151,10 +192,10 @@ export class PegasusUtility {
|
||||
static updateEffectsBonusDice(rollData) {
|
||||
let newDicePool = rollData.dicePool.filter(dice => dice.name != "effect-bonus-dice")
|
||||
for (let effect of rollData.effectsList) {
|
||||
if (effect && effect.applied && effect.type == "effect" && !effect.effect?.system?.hindrance && effect.effect && effect.effect.system.bonusdice) {
|
||||
if (effect?.applied && effect.type == "effect" && !effect.effect?.system?.hindrance && effect.effect && effect.effect.system.bonusdice) {
|
||||
newDicePool = newDicePool.concat(this.buildDicePool("effect-bonus-dice", effect.effect.system.effectlevel, 0, effect.effect.name))
|
||||
}
|
||||
if (effect && effect.applied && effect.type == "effect" && effect.value && effect.isdynamic && !effect.effect?.system?.hindrance) {
|
||||
if (effect?.applied && effect.type == "effect" && effect.value && effect.isdynamic && !effect.effect?.system?.hindrance) {
|
||||
newDicePool = newDicePool.concat(this.buildDicePool("effect-bonus-dice", effect.value, 0, effect.name))
|
||||
}
|
||||
}
|
||||
@ -165,7 +206,7 @@ export class PegasusUtility {
|
||||
static updateHindranceBonusDice(rollData) {
|
||||
let newDicePool = rollData.dicePool.filter(dice => dice.name != "effect-hindrance")
|
||||
for (let hindrance of rollData.effectsList) {
|
||||
if (hindrance && hindrance.applied && (hindrance.type == "hindrance" || (hindrance.type == "effect" && hindrance.effect?.system?.hindrance))) {
|
||||
if (hindrance?.applied && (hindrance.type == "hindrance" || (hindrance.type == "effect" && hindrance.effect?.system?.hindrance))) {
|
||||
console.log("Adding Hindrance 1", hindrance, newDicePool)
|
||||
newDicePool = newDicePool.concat(this.buildDicePool("effect-hindrance", (hindrance.value) ? hindrance.value : hindrance.effect.system.effectlevel, 0, hindrance.name))
|
||||
console.log("Adding Hindrance 2", newDicePool)
|
||||
@ -206,9 +247,9 @@ export class PegasusUtility {
|
||||
for (let weapon of rollData.vehicleWeapons) {
|
||||
if (weapon.applied) {
|
||||
newDicePool = newDicePool.concat(this.buildDicePool("damage", weapon.value, 0))
|
||||
if( weapon.weapon.system.extradamage) {
|
||||
for(let i=0; i < weapon.weapon.system.extradamagevalue; i++) {
|
||||
newDicePool = newDicePool.concat(this.buildDicePool("damage", 5, 0) )
|
||||
if (weapon.weapon.system.extradamage) {
|
||||
for (let i = 0; i < weapon.weapon.system.extradamagevalue; i++) {
|
||||
newDicePool = newDicePool.concat(this.buildDicePool("damage", 5, 0))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -549,7 +590,7 @@ export class PegasusUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getDiceFromLevel(level = 0) {
|
||||
level = Math.max( Number(level), 0)
|
||||
level = Math.max(Number(level), 0)
|
||||
return this.diceList[level];
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
@ -826,11 +867,22 @@ export class PegasusUtility {
|
||||
let myRoll = rollData.roll
|
||||
if (!myRoll || rollData.rerollHero || rollData.rerollMomentum) { // New rolls only of no rerolls
|
||||
myRoll = new Roll(diceFormula).roll({ async: false })
|
||||
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
||||
rollData.roll = myRoll
|
||||
}
|
||||
if (rollData.hindranceDices > 0) {
|
||||
rollData.hindranceRoll = new Roll(rollData.hindranceDices + "dh").roll({ async: false })
|
||||
this.showDiceSoNice(rollData.hindranceRoll, game.settings.get("core", "rollMode"))
|
||||
for (let res of rollData.hindranceRoll.terms[0].results) {
|
||||
if (res.result == 6) {
|
||||
rollData.hindranceFailure = true
|
||||
rollData.img = `systems/fvtt-pegasus-rpg/images/dice/hindrance-dice.png`
|
||||
}
|
||||
}
|
||||
}
|
||||
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
||||
|
||||
// Final score and keep data
|
||||
rollData.finalScore = myRoll.total
|
||||
rollData.finalScore = (rollData.hindranceFailure) ? 0 : myRoll.total
|
||||
|
||||
if (rollData.damages) {
|
||||
let dmgFormula = this.getFoundryDiceFromLevel(rollData.damages.value)
|
||||
@ -846,6 +898,7 @@ export class PegasusUtility {
|
||||
// Init stuf
|
||||
if (rollData.isInit) {
|
||||
let combat = game.combats.get(rollData.combatId)
|
||||
await combat.setTic(rollData.combatantId, rollData)
|
||||
combat.updateEmbeddedDocuments("Combatant", [{ _id: rollData.combatantId, initiative: rollData.finalScore }])
|
||||
}
|
||||
|
||||
@ -1041,14 +1094,14 @@ export class PegasusUtility {
|
||||
let defenderActor = target.actor
|
||||
rollData.defenderTokenId = target.id
|
||||
rollData.defenderSize = 0
|
||||
if ( defenderActor.type == "character") {
|
||||
if (defenderActor.type == "character") {
|
||||
rollData.defenderSize = Number(defenderActor.system.biodata.sizenum) + Number(defenderActor.system.biodata.sizebonus)
|
||||
} else if ( defenderActor.type == "vehicle" ){
|
||||
} else if (defenderActor.type == "vehicle") {
|
||||
rollData.defenderSize = Number(defenderActor.system.statistics.hr.size)
|
||||
}
|
||||
//rollData.attackerId = this.id
|
||||
console.log("Target/DEFENDER", defenderActor)
|
||||
defenderActor.addHindrancesList(rollData.effectsList)
|
||||
//defenderActor.addHindrancesList(rollData.effectsList) /* No more used */
|
||||
}
|
||||
}
|
||||
|
||||
@ -1087,10 +1140,10 @@ export class PegasusUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static checkIsVehicleCrew(actorId) {
|
||||
let vehicles = game.actors.filter( actor=> actor.type == "vehicle") || []
|
||||
for(let vehicle of vehicles) {
|
||||
let vehicles = game.actors.filter(actor => actor.type == "vehicle") || []
|
||||
for (let vehicle of vehicles) {
|
||||
console.log("Checking", vehicle.name)
|
||||
if ( vehicle.inCrew(actorId) ) {
|
||||
if (vehicle.inCrew(actorId)) {
|
||||
return vehicle
|
||||
}
|
||||
}
|
||||
@ -1123,7 +1176,7 @@ export class PegasusUtility {
|
||||
let tacticianTokens = canvas.tokens.placeables.filter(token => token.actor.isTactician() && !token.document.hidden)
|
||||
for (let token of tacticianTokens) {
|
||||
token.refresh()
|
||||
let friends = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && newToken.document.disposition == token.document.disposition)
|
||||
let friends = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && newToken.document.disposition == token.document.disposition)
|
||||
for (let friend of friends) {
|
||||
if (friend.actor.id != token.actor.id) {
|
||||
let existing = toApply[friend.id] || { token: friend, add: false, level: 0, names: [] }
|
||||
@ -1171,7 +1224,7 @@ export class PegasusUtility {
|
||||
let enhancerTokens = canvas.tokens.placeables.filter(token => token.actor.isEnhancer() && !token.document.hidden)
|
||||
for (let token of enhancerTokens) {
|
||||
token.refresh()
|
||||
let friends = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && newToken.document.disposition == token.document.disposition)
|
||||
let friends = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && newToken.document.disposition == token.document.disposition)
|
||||
for (let friend of friends) {
|
||||
if (friend.actor.id != token.actor.id) {
|
||||
let existing = toApply[friend.id] || { token: friend, add: false, level: 0, names: [] }
|
||||
@ -1223,13 +1276,13 @@ export class PegasusUtility {
|
||||
token.refresh()
|
||||
let ennemies = []
|
||||
if (token.document.disposition == -1) {
|
||||
ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && (newToken.document.disposition == 1 || newToken.document.disposition == 0 ))
|
||||
ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && (newToken.document.disposition == 1 || newToken.document.disposition == 0))
|
||||
}
|
||||
if (token.document.disposition == 1) {
|
||||
ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && (newToken.document.disposition == -1 || newToken.document.disposition == 0 ))
|
||||
ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && (newToken.document.disposition == -1 || newToken.document.disposition == 0))
|
||||
}
|
||||
if (token.document.disposition == 0) {
|
||||
ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && (newToken.document.disposition == -1 || newToken.document.disposition == 1 ))
|
||||
ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && (newToken.document.disposition == -1 || newToken.document.disposition == 1))
|
||||
}
|
||||
console.log("Ennemies for token", token.actor.name, ennemies)
|
||||
for (let ennemy of ennemies) {
|
||||
|
@ -252,7 +252,7 @@
|
||||
],
|
||||
"title": "Pegasus RPG",
|
||||
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
|
||||
"version": "11.0.3",
|
||||
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.3.zip",
|
||||
"version": "11.0.6",
|
||||
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.6.zip",
|
||||
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
|
||||
}
|
@ -2,6 +2,7 @@
|
||||
"Actor": {
|
||||
"types": [
|
||||
"character",
|
||||
"npc",
|
||||
"vehicle"
|
||||
],
|
||||
"templates": {
|
||||
@ -372,6 +373,12 @@
|
||||
"core"
|
||||
]
|
||||
},
|
||||
"npc": {
|
||||
"templates": [
|
||||
"biodata",
|
||||
"core"
|
||||
]
|
||||
},
|
||||
"vehicle": {
|
||||
"templates": [
|
||||
"vehicle"
|
||||
|
@ -56,13 +56,13 @@
|
||||
<li>Power Damage type : {{power.system.powerdamagetype}} {{power.system.powerdamagetypelevel}}</li>
|
||||
{{/if}}
|
||||
|
||||
{{#if isResistance}}
|
||||
<li><strong>Defense Result : {{finalScore}}</strong>
|
||||
{{#if hindranceFailure}}
|
||||
<li><strong>Failed due to Hindrance Dice !!</strong>
|
||||
{{else}}
|
||||
{{#if isDamage}}
|
||||
<li><strong>Damages : {{finalScore}}</strong>
|
||||
{{#if isResistance}}
|
||||
<li><strong>Defense Result : {{finalScore}}</strong>
|
||||
{{else}}
|
||||
<li><strong>Final Result : {{finalScore}}</strong>
|
||||
<li><strong>Final Result : {{finalScore}}</strong>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
</select>
|
||||
</li>
|
||||
|
||||
<li class="flexrow"><label class="generic-label">DMG RES Dice</label>
|
||||
<li class="flexrow"><label class="generic-label">Damage Resistance</label>
|
||||
<select class="competence-base flexrow" type="text" name="system.resistance" value="{{data.resistance}}" data-dtype="Number">
|
||||
{{#select data.resistance}}
|
||||
{{{optionsDiceList}}}
|
||||
|
@ -44,7 +44,7 @@
|
||||
<label class="competence-base">{{data.mdl}}</label>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{#if (and owner (eq data.statistic "agi"))}}
|
||||
{{#if (and owner (eq data.damagestatistic "pre"))}}
|
||||
<li class="flexrow">
|
||||
<label class="generic-label">RDL</label>
|
||||
<label class="competence-base">{{data.rdl}}</label>
|
||||
|
132
templates/pegasus-combat-tracker.html
Normal file
132
templates/pegasus-combat-tracker.html
Normal file
@ -0,0 +1,132 @@
|
||||
<section class="{{cssClass}} directory flexcol" id="{{cssId}}" data-tab="{{tabName}}">
|
||||
<header class="combat-tracker-header">
|
||||
{{#if user.isGM}}
|
||||
<nav class="encounters flexrow" aria-label="{{localize 'COMBAT.NavLabel'}}">
|
||||
<a class="combat-button combat-create" aria-label="{{localize 'COMBAT.Create'}}" role="button" data-tooltip="COMBAT.Create">
|
||||
<i class="fas fa-plus"></i>
|
||||
</a>
|
||||
{{#if combatCount}}
|
||||
<a class="combat-button combat-cycle" aria-label="{{localize 'COMBAT.EncounterPrevious'}}" role="button" 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" aria-label="{{localize 'COMBAT.EncounterNext'}}" role="button" 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" aria-label="{{localize 'COMBAT.Delete'}}" role="button" 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" aria-label="{{localize 'COMBAT.RollAll'}}" role="button" data-tooltip="COMBAT.RollAll" data-control="rollAll" {{#unless turns}}disabled{{/unless}}>
|
||||
<i class="fas fa-users"></i>
|
||||
</a>
|
||||
<a class="combat-button combat-control" aria-label="{{localize 'COMBAT.RollNPC'}}" role="button" 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">{{localize 'COMBAT.Round'}} {{combat.round}}</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" aria-label="{{localize 'COMBAT.InitiativeReset'}}" role="button" data-tooltip="COMBAT.InitiativeReset" data-control="resetAll"
|
||||
{{#unless hasCombat}}disabled{{/unless}}>
|
||||
<i class="fas fa-undo"></i>
|
||||
</a>
|
||||
<a class="combat-button combat-control" aria-label="{{localize 'labels.scope'}}" role="button" data-tooltip="{{labels.scope}}"
|
||||
data-control="toggleSceneLink" {{#unless hasCombat}}disabled{{/unless}}>
|
||||
<i class="fas fa-{{#unless linked}}un{{/unless}}link"></i>
|
||||
</a>
|
||||
{{/if}}
|
||||
<a class="combat-button combat-settings" aria-label="{{localize 'COMBAT.Settings'}}" role="button" data-tooltip="COMBAT.Settings" data-control="trackerSettings">
|
||||
<i class="fas fa-cog"></i>
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<ol id="combat-tracker" class="directory-list">
|
||||
{{#each turns}}
|
||||
<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}}</h4>
|
||||
<div class="combatant-controls flexrow">
|
||||
{{#if ../user.isGM}}
|
||||
<a class="combatant-control {{#if this.hidden}}active{{/if}}" aria-label="{{localize 'COMBAT.ToggleVis'}}" role="button" data-tooltip="COMBAT.ToggleVis" data-control="toggleHidden">
|
||||
<i class="fas fa-eye-slash"></i>
|
||||
</a>
|
||||
<a class="combatant-control {{#if this.defeated}}active{{/if}}" aria-label="{{localize 'COMBAT.ToggleDead'}}" role="button" data-tooltip="COMBAT.ToggleDead" data-control="toggleDefeated">
|
||||
<i class="fas fa-skull"></i>
|
||||
</a>
|
||||
{{/if}}
|
||||
{{#if this.canPing}}
|
||||
<a class="combatant-control" aria-label="{{localize 'COMBAT.PingCombatant'}}" role="button" 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-resource" id="{{this.id}}">
|
||||
<a class="combat-tracker-tic" data-tic-num="1" data-combatant-id="{{this.id}}">{{getTIC 1 this.id}}</a>
|
||||
{{#if (isCharacter this.id)}}
|
||||
<a class="combat-tracker-tic" data-tic-num="2" data-combatant-id="{{this.id}}">{{getTIC 2 this.id}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div class="token-initiative">
|
||||
{{#if this.hasRolled}}
|
||||
<span class="initiative">{{this.initiative}}</span>
|
||||
{{else if this.owner}}
|
||||
<a class="combatant-control roll" aria-label="{{localize 'COMBAT.InitiativeRoll'}}" role="button" data-tooltip="COMBAT.InitiativeRoll" data-control="rollInitiative"></a>
|
||||
{{/if}}
|
||||
</div>
|
||||
</li>
|
||||
{{/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" aria-label="{{localize 'COMBAT.RoundPrev'}}" role="button" data-tooltip="COMBAT.RoundPrev" data-control="previousRound"><i class="fas fa-step-backward"></i></a>
|
||||
<a class="combat-control" aria-label="{{localize 'COMBAT.TurnPrev'}}" role="button" data-tooltip="COMBAT.TurnPrev" data-control="previousTurn"><i class="fas fa-arrow-left"></i></a>
|
||||
<a class="combat-control center" aria-label="{{localize 'COMBAT.End'}}" role="button" data-control="endCombat">{{localize 'COMBAT.End'}}</a>
|
||||
<a class="combat-control" aria-label="{{localize 'COMBAT.TurnNext'}}" role="button" data-tooltip="COMBAT.TurnNext" data-control="nextTurn"><i class="fas fa-arrow-right"></i></a>
|
||||
<a class="combat-control" aria-label="{{localize 'COMBAT.RoundNext'}}" role="button" data-tooltip="COMBAT.RoundNext" data-control="nextRound"><i class="fas fa-step-forward"></i></a>
|
||||
{{else}}
|
||||
<a class="combat-control center" aria-label="{{localize 'COMBAT.Begin'}}" role="button" data-control="startCombat">{{localize 'COMBAT.Begin'}}</a>
|
||||
{{/if}}
|
||||
{{else if control}}
|
||||
<a class="combat-control" aria-label="{{localize 'COMBAT.TurnPrev'}}" role="button" data-tooltip="COMBAT.TurnPrev" data-control="previousTurn"><i class="fas fa-arrow-left"></i></a>
|
||||
<a class="combat-control center" aria-label="{{localize 'COMBAT.TurnEnd'}}" role="button" data-control="nextTurn">{{localize 'COMBAT.TurnEnd'}}</a>
|
||||
<a class="combat-control" aria-label="{{localize 'COMBAT.TurnNext'}}" role="button" data-tooltip="COMBAT.TurnNext" data-control="nextTurn"><i class="fas fa-arrow-right"></i></a>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</nav>
|
||||
</section>
|
@ -64,21 +64,6 @@
|
||||
{{/if}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
<!--
|
||||
{{#if isDamage}}
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Weapon Damage :</span>
|
||||
<select class="roll-dialog-label" id="damageDiceLevel" type="text" name="damageDiceLevel"
|
||||
value="{{damageDiceLevel}}" data-dtype="Number">
|
||||
{{#select damageDiceLevel}}
|
||||
{{{optionsDiceList}}}
|
||||
{{/select}}
|
||||
</select>
|
||||
<span class="small-label"> </span>
|
||||
</div>
|
||||
{{/if}}
|
||||
-->
|
||||
|
||||
<div class="dice-pool-div">
|
||||
<span>
|
||||
@ -87,7 +72,7 @@
|
||||
<div class="flexrow dice-pool-stack">
|
||||
{{#each dicePool as |dice idx|}}
|
||||
<span><a class="pool-remove-dice" data-dice-idx="{{idx}}" data-dice-level="{{dice.level}}" data-dice-key="{{dice.key}}"><img class="dice-pool-image"
|
||||
src="{{dice.img}}"></a></span>
|
||||
src="{{dice.img}}" alt="dices"></a></span>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
@ -100,10 +85,24 @@
|
||||
<div class="flexrow">
|
||||
{{#each diceList as |dice idx|}}
|
||||
<span><a class="pool-add-dice" data-dice-key="{{dice.key}}" data-dice-level="{{dice.level}}"><img class="dice-pool-image"
|
||||
src="{{dice.img}}"></a></span>
|
||||
src="{{dice.img}}" alt="dices"></a></span>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if hindranceDices}}
|
||||
<div class="dice-pool-div">
|
||||
<span>
|
||||
<h3 class="dice-pool-label">Hindrance Dice</h3>
|
||||
</span>
|
||||
<div class="flexrow dice-pool-stack">
|
||||
{{#for 1 hindranceDices 1}}
|
||||
<span><a class="" data-dice-idx="{{idx}}" data-dice-level="2" data-dice-key="d6"><img class="dice-pool-image"
|
||||
src="systems/fvtt-pegasus-rpg/images/dice/hindrance-dice.png" alt="dices"></a></span>
|
||||
{{/for}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="flexrow">
|
||||
|
||||
@ -156,6 +155,19 @@
|
||||
{{> systems/fvtt-pegasus-rpg/templates/partial-roll-select-effects.html}}
|
||||
{{/if}}
|
||||
|
||||
{{#if isInit}}
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">TIC 1:</span>
|
||||
<input class="roll-input-tic" id="roll-input-tic1" type="text" name="tic1" value="{{tic1}}" data-dtype="String">
|
||||
</div>
|
||||
{{#if (eq actorType "character")}}
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">TIC 2:</span>
|
||||
<input class="roll-input-tic" id="roll-input-tic2" type="text" name="tic2" value="{{tic2}}" data-dtype="String">
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user