Compare commits

...

17 Commits

14 changed files with 441 additions and 200 deletions

View File

@ -38,7 +38,6 @@ export class PegasusActorSheet extends ActorSheet {
cssClass: this.isEditable ? "editable" : "locked", cssClass: this.isEditable ? "editable" : "locked",
data: actorData.system, data: actorData.system,
traumaState: this.actor.getTraumaState(), traumaState: this.actor.getTraumaState(),
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited, limited: this.object.limited,
specs: this.actor.getSpecs( ), specs: this.actor.getSpecs( ),
config: game.system.pegasus.config, config: game.system.pegasus.config,

View File

@ -92,7 +92,7 @@ export class PegasusActor extends Actor {
return actor; return actor;
} }
if (data.type == 'character'|| this.type == 'npc') { if (data.type == 'character' || this.type == 'npc') {
} }
@ -495,7 +495,7 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
async activateViceOrVirtue(itemId) { async activateViceOrVirtue(itemId) {
let item = this.items.find(item => item.id == itemId) let item = this.items.find(item => item.id == itemId)
if (item && item.system) { if (item?.system) {
let nrg = duplicate(this.system.nrg) let nrg = duplicate(this.system.nrg)
if (!item.system.activated) { // Current value if (!item.system.activated) { // Current value
@ -581,7 +581,7 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
async activatePower(itemId) { async activatePower(itemId) {
let item = this.items.find(item => item.id == itemId) let item = this.items.find(item => item.id == itemId)
if (item && item.system) { if (item?.system) {
let nrg = duplicate(this.system.nrg) let nrg = duplicate(this.system.nrg)
if (!item.system.activated) { // Current value if (!item.system.activated) { // Current value
@ -764,9 +764,18 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
modifyStun(incDec) { modifyStun(incDec) {
if (incDec < 0 && (this.system.secondary.confidence.status == "anxious" || this.system.secondary.confidence.status == "lostface")) {
ui.notifications.warn("Unable to recover STUN because of Confidence status : " + this.system.secondary.confidence.status)
return
}
let myself = this let myself = this
let combat = duplicate(myself.system.combat) let combat = duplicate(myself.system.combat)
combat.stunlevel += incDec combat.stunlevel += incDec
let daze = this.effects.find(e => e.label == "Daze")
if (daze && combat.stunlevel == 0) {
this.deleteEmbeddedDocuments("ActiveEffect", [daze.id])
}
if (combat.stunlevel >= 0) { if (combat.stunlevel >= 0) {
myself.update({ 'system.combat': combat }) myself.update({ 'system.combat': combat })
let chatData = { let chatData = {
@ -774,6 +783,11 @@ export class PegasusActor extends Actor {
rollMode: game.settings.get("core", "rollMode"), rollMode: game.settings.get("core", "rollMode"),
whisper: [game.user.id].concat(ChatMessage.getWhisperRecipients('GM')) whisper: [game.user.id].concat(ChatMessage.getWhisperRecipients('GM'))
} }
if (!daze) {
this.createEmbeddedDocuments("ActiveEffect", [
{ label: 'Daze', icon: 'icons/svg/daze.svg', flags: { core: { statusId: 'daze' } } }
])
}
if (incDec > 0) { if (incDec > 0) {
chatData.content = `<div>${this.name} suffered a Stun level.</div` chatData.content = `<div>${this.name} suffered a Stun level.</div`
} else { } else {
@ -797,6 +811,11 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
modifyMomentum(incDec) { modifyMomentum(incDec) {
if (this.system.combat.stunlevel > 0) {
ui.notifications.warn("Unable to gain/use Momentum while stunned")
return
}
let momentum = duplicate(this.system.momentum) let momentum = duplicate(this.system.momentum)
momentum.value += incDec momentum.value += incDec
this.update({ 'system.momentum': momentum }) this.update({ 'system.momentum': momentum })
@ -1244,25 +1263,6 @@ export class PegasusActor extends Actor {
nrg.max += item.system.features.nrgcost.value nrg.max += item.system.features.nrgcost.value
await this.update({ 'system.nrg': nrg }) await this.update({ 'system.nrg': nrg })
} }
/* NO MORE USED
if (item.system.features.bonushealth.flag) {
let health = duplicate(this.system.secondary.health)
health.value -= Number(item.system.features.bonushealth.value) || 0
health.max -= Number(item.system.features.bonushealth.value) || 0
await this.update({ 'system.secondary.health': health })
}
if (item.system.features.bonusdelirium.flag) {
let delirium = duplicate(this.system.secondary.delirium)
delirium.value -= Number(item.system.features.bonusdelirium.value) || 0
delirium.max -= Number(item.system.features.bonusdelirium.value) || 0
await this.update({ 'system.secondary.delirium': delirium })
}
if (item.system.features.bonusnrg.flag) {
let nrg = duplicate(this.system.nrg)
nrg.value -= Number(item.system.features.bonusnrg.value) || 0
nrg.max -= Number(item.system.features.bonusnrg.value) || 0
await this.update({ 'system.nrg': nrg })
}*/
this.disableWeaverPerk(item) this.disableWeaverPerk(item)
PegasusUtility.createChatWithRollMode(item.name, { PegasusUtility.createChatWithRollMode(item.name, {
content: await renderTemplate(`systems/fvtt-pegasus-rpg/templates/chat-perk-ready.html`, { name: this.name, perk: duplicate(item) }) content: await renderTemplate(`systems/fvtt-pegasus-rpg/templates/chat-perk-ready.html`, { name: this.name, perk: duplicate(item) })
@ -1343,7 +1343,7 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
getTraumaState() { getTraumaState() {
this.traumaState = "none" this.traumaState = "none"
if (this.type == "character"|| this.type == 'npc') { if (this.type == "character" || this.type == 'npc') {
if (this.system.secondary.delirium.status == "trauma") { if (this.system.secondary.delirium.status == "trauma") {
this.traumaState = "trauma" this.traumaState = "trauma"
} }
@ -1445,36 +1445,6 @@ export class PegasusActor extends Actor {
if (this.isOwner || game.user.isGM) { if (this.isOwner || game.user.isGM) {
let updates = {} let updates = {}
/* No more used
let phyDiceValue = PegasusUtility.getDiceValue(this.system.statistics.phy.value) + this.system.secondary.health.bonus + this.system.statistics.phy.mod + PegasusUtility.getDiceValue(this.system.statistics.phy.bonuseffect);
if (phyDiceValue != this.system.secondary.health.max) {
updates['system.secondary.health.max'] = phyDiceValue
}
if (this.computeValue) {
updates['system.secondary.health.value'] = phyDiceValue
}
let mndDiceValue = PegasusUtility.getDiceValue(this.system.statistics.mnd.value) + this.system.secondary.delirium.bonus + this.system.statistics.mnd.mod + PegasusUtility.getDiceValue(this.system.statistics.mnd.bonuseffect);
if (mndDiceValue != this.system.secondary.delirium.max) {
updates['system.secondary.delirium.max'] = mndDiceValue
}
if (this.computeValue) {
updates['system.secondary.delirium.value'] = mndDiceValue
}
let stlDiceValue = PegasusUtility.getDiceValue(this.system.statistics.stl.value) + this.system.secondary.stealthhealth.bonus + this.system.statistics.stl.mod + PegasusUtility.getDiceValue(this.system.statistics.stl.bonuseffect);
if (stlDiceValue != this.system.secondary.stealthhealth.max) {
updates['system.secondary.stealthhealth.max'] = stlDiceValue
}
if (this.computeValue) {
updates['system.secondary.stealthhealth.value'] = stlDiceValue
}
let socDiceValue = PegasusUtility.getDiceValue(this.system.statistics.soc.value) + this.system.secondary.socialhealth.bonus + this.system.statistics.soc.mod + PegasusUtility.getDiceValue(this.system.statistics.soc.bonuseffect);
if (socDiceValue != this.system.secondary.socialhealth.max) {
updates['system.secondary.socialhealth.max'] = socDiceValue
}
if (this.computeValue) {
updates['system.secondary.socialhealth.value'] = socDiceValue
}*/
let nrgValue = PegasusUtility.getDiceValue(this.system.statistics.foc.value) + this.system.nrg.mod + this.system.statistics.foc.mod + PegasusUtility.getDiceValue(this.system.statistics.foc.bonuseffect) let nrgValue = PegasusUtility.getDiceValue(this.system.statistics.foc.value) + this.system.nrg.mod + this.system.statistics.foc.mod + PegasusUtility.getDiceValue(this.system.statistics.foc.bonuseffect)
if (nrgValue != this.system.nrg.absolutemax) { if (nrgValue != this.system.nrg.absolutemax) {
@ -1497,7 +1467,7 @@ export class PegasusActor extends Actor {
updates['system.momentum.max'] = momentum updates['system.momentum.max'] = momentum
} }
let mrLevel = (this.system.statistics.agi.value + this.system.statistics.str.value) - this.system.statistics.phy.value let mrLevel = (this.system.statistics.agi.value + this.system.statistics.agi.mod + this.system.statistics.str.value + this.system.statistics.str.mod) - (this.system.statistics.phy.value + this.system.statistics.phy.mod)
mrLevel = (mrLevel < 1) ? 1 : mrLevel; mrLevel = (mrLevel < 1) ? 1 : mrLevel;
if (mrLevel != this.system.mr.value) { if (mrLevel != this.system.mr.value) {
updates['system.mr.value'] = mrLevel updates['system.mr.value'] = mrLevel
@ -1530,10 +1500,9 @@ export class PegasusActor extends Actor {
} }
this.computeThreatLevel() this.computeThreatLevel()
} }
if (this.isOwner || game.user.isGM) { if (this.isOwner || game.user.isGM) {
// Update current hindrance level // Update current hindrance level
let hindrance = this.system.combat.hindrancedice let hindrance = 0; //this.system.combat.hindrancedice
if (!this.checkIgnoreHealth()) { if (!this.checkIgnoreHealth()) {
if (this.system.secondary.health.status == "wounded") { if (this.system.secondary.health.status == "wounded") {
hindrance += 1 hindrance += 1
@ -1541,6 +1510,41 @@ export class PegasusActor extends Actor {
if (this.system.secondary.health.status == "severlywounded" || this.system.secondary.health.status == "defeated") { if (this.system.secondary.health.status == "severlywounded" || this.system.secondary.health.status == "defeated") {
hindrance += 3 hindrance += 3
} }
/* Manage confidence */
if (this.system.secondary.confidence.status == "shaken" || this.system.secondary.confidence.status == "anxious" ||
this.system.secondary.confidence.status == "lostface") {
if (!this.items.find(it => it.name.toLowerCase() == "fear" && it.type == "effect")) {
let effect = await PegasusUtility.getEffectFromCompendium("Fear")
this.createEmbeddedDocuments('Item', [effect])
}
} else { // Remove fear if healed
let fear = this.items.find(it => it.name.toLowerCase() == "fear" && it.type == "effect")
if (fear) {
this.deleteEmbeddedDocuments('Item', [fear.id])
}
}
/* Manage flag state for status */
this.defeatedDisplayed = this.defeatedDisplayed && this.system.secondary.health.status != "defeated"
this.deliriumDisplayed = this.deliriumDisplayed && this.system.secondary.delirium.status != "defeated"
this.concealmentDisplayed = this.concealmentDisplayed && this.system.secondary.concealment.status != "defeated"
this.confidenceDisplayed = this.confidenceDisplayed && this.system.secondary.confidence.status != "defeated"
/* Then display relevant messages */
if (!this.defeatedDisplayed && this.system.secondary.health.status == "defeated") {
ChatMessage.create({ content: `DEFEATED : ${this.name} must make a Death Save!` })
this.defeatedDisplayed = true
}
if (!this.deliriumDisplayed && this.system.secondary.delirium.status == "defeated") {
ChatMessage.create({ content: `DEFEATED : ${this.name} must make a Madness Check!` })
this.deliriumDisplayed = true
}
if (!this.concealmentDisplayed && this.system.secondary.concealment.status == "located") {
ChatMessage.create({ content: `${this.name} has been discovered! You can not longer hide and either must fight/surrender or make a run for it` })
this.concealmentDisplayed = true
}
if (!this.confidenceDisplayed && this.system.secondary.confidence.status == "lostface") {
ChatMessage.create({ content: `${this.name} have Lost Face! You can not longer make any Social Rolls, all social rolls against your character is considered an automatic success until healed!` })
this.confidenceDisplayed = true
}
} }
this.system.combat.hindrancedice = hindrance this.system.combat.hindrancedice = hindrance
this.getTraumaState() this.getTraumaState()
@ -1574,9 +1578,11 @@ export class PegasusActor extends Actor {
for (let e of effects) { for (let e of effects) {
meleeBonus += Number(e.system.effectlevel) meleeBonus += Number(e.system.effectlevel)
} }
this.baseMDL = this.system.biodata.sizenum + this.system.biodata.sizebonus + this.system.statistics.str.value +
this.system.statistics.str.mod + this.system.statistics.str.bonuseffect + meleeBonus
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) { 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 let damage = this.baseMDL + Number(w.system.damage)
if (damage != w.system.mdl) { if (damage != w.system.mdl) {
updates.push({ _id: w.id, "system.mdl": damage }) updates.push({ _id: w.id, "system.mdl": damage })
} }
@ -1590,9 +1596,10 @@ export class PegasusActor extends Actor {
if (role?.name?.toLowerCase() == "ranged") { // Add ranged bonus to ADRL if (role?.name?.toLowerCase() == "ranged") { // Add ranged bonus to ADRL
roleBonus = this.getRoleLevel() roleBonus = this.getRoleLevel()
} }
this.baseRDL = roleBonus + rangedBonus
let weaponsRanged = this.items.filter(it => it.type == "weapon" && it.system.damagestatistic.toLowerCase() == "pre") let weaponsRanged = this.items.filter(it => it.type == "weapon" && it.system.damagestatistic.toLowerCase() == "pre")
for (let w of weaponsRanged) { for (let w of weaponsRanged) {
let damage = roleBonus + Number(w.system.damage) + rangedBonus let damage = this.baseRDL + Number(w.system.damage)
if (damage != w.system.rdl) { if (damage != w.system.rdl) {
updates.push({ _id: w.id, "system.rdl": damage }) updates.push({ _id: w.id, "system.rdl": damage })
} }
@ -1607,9 +1614,11 @@ export class PegasusActor extends Actor {
if (role?.name?.toLowerCase() == "defender") { // Add defender bonus to ADRL if (role?.name?.toLowerCase() == "defender") { // Add defender bonus to ADRL
roleBonus = this.getRoleLevel() roleBonus = this.getRoleLevel()
} }
this.baseADRL = roleBonus + armorBonus + this.system.statistics.phy.value + this.system.statistics.phy.mod +
this.system.statistics.phy.bonuseffect + this.system.biodata.sizenum + this.system.biodata.sizebonus
let armors = this.items.filter(it => it.type == "armor") let armors = this.items.filter(it => it.type == "armor")
for (let a of armors) { for (let a of armors) {
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 let adrl = this.baseADRL + a.system.resistance
if (adrl != a.system.adrl) { if (adrl != a.system.adrl) {
updates.push({ _id: a.id, "system.adrl": adrl }) updates.push({ _id: a.id, "system.adrl": adrl })
} }
@ -1619,7 +1628,10 @@ export class PegasusActor extends Actor {
this.updateEmbeddedDocuments('Item', updates) this.updateEmbeddedDocuments('Item', updates)
} }
} }
/* -------------------------------------------- */
getBaseADRL() {
}
/* -------------------------------------------- */ /* -------------------------------------------- */
parseStatEffects() { parseStatEffects() {
if (this.system.biodata.noautobonus) { // If we are in "no-bonus mode if (this.system.biodata.noautobonus) { // If we are in "no-bonus mode
@ -1912,31 +1924,41 @@ export class PegasusActor extends Actor {
await this.createEmbeddedDocuments('Item', newItems) await this.createEmbeddedDocuments('Item', newItems)
} }
/* -------------------------------------------- */
checkEFfectsHindranceDeletion(statKey) {
let toRem = []
let effects = this.items.filter(effect => effect.type == 'effect' && effect.system.oneuse &&
effect.system.hindrance && (effect.system.stataffected == statKey || effect.system.stataffected == "all"))
for (let effect of effects) {
toRem.push(effect.id)
}
if (toRem.length > 0) {
this.deleteEmbeddedDocuments('Item', toRem)
}
}
/* -------------------------------------------- */ /* -------------------------------------------- */
computeCurrentHindrances() { computeCurrentHindrances(statKey) {
let hindrancesDices = 0 let hindrancesDices = 0
if (this.type == "character" || this.type == 'npc') { if (this.type == "character" || this.type == 'npc') {
if (this.system.combat.stunlevel > 0) {
hindrancesDices += 2
}
hindrancesDices += this.system.combat.hindrancedice hindrancesDices += this.system.combat.hindrancedice
let overCapacity = Math.floor(this.encCurrent / this.getEncumbranceCapacity()) let overCapacity = Math.floor(this.encCurrent / this.getEncumbranceCapacity())
if (overCapacity > 0) { if (overCapacity > 0) {
hindrancesDices += overCapacity hindrancesDices += overCapacity
} }
let effects = this.items.filter(item => item.type == 'effect') let effects = this.items.filter(effect => effect.type == 'effect' && effect.system.hindrance && (effect.system.stataffected == statKey || effect.system.stataffected == "all"))
for (let effect of effects) { for (let effect of effects) {
if (effect.system.hindrance) { hindrancesDices += effect.system.effectlevel
hindrancesDices += effect.system.effectlevel }
} if (statKey.toLowerCase() == "stl" && this.system.secondary.concealment.status == "exposed") {
hindrancesDices += 1
}
if (statKey.toLowerCase() == "stl" && (this.system.secondary.concealment.status == "detected" || this.system.secondary.concealment.status == "located")) {
hindrancesDices += 3
} }
} }
if (this.type == "vehicle") { if (this.type == "vehicle") {
if (this.system.stun.value > 0) {
hindrancesDices += 2
}
if (this.isVehicleCrawling()) { if (this.isVehicleCrawling()) {
hindrancesDices += 3 hindrancesDices += 3
} }
@ -1958,7 +1980,7 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
addHindrancesList(effectsList) { addHindrancesList(effectsList) {
if (this.type == "character"|| this.type == 'npc') { if (this.type == "character" || this.type == 'npc') {
if (this.system.combat.stunlevel > 0) { if (this.system.combat.stunlevel > 0) {
effectsList.push({ label: "Stun Hindrance", type: "hindrance", foreign: true, actorId: this.id, applied: false, value: 2 }) effectsList.push({ label: "Stun Hindrance", type: "hindrance", foreign: true, actorId: this.id, applied: false, value: 2 })
} }
@ -2057,7 +2079,7 @@ export class PegasusActor extends Actor {
if (statKey == 'phy' && subKey == "dmg-res") { if (statKey == 'phy' && subKey == "dmg-res") {
let armors = this.getArmors() let armors = this.getArmors()
for (let armor of armors) { for (let armor of armors) {
rollData.armorsList.push({ label: `Armor ${armor.name}`, type: "armor", applied: false, value: armor.system.resistance }) rollData.armorsList.push({ label: `Armor ${armor.name}`, type: "armor", applied: false, value: armor.system.resistance, adrl: armor.system.adrl })
} }
} }
if (useShield) { if (useShield) {
@ -2146,8 +2168,8 @@ export class PegasusActor extends Actor {
rollData.noBonusDice = this.checkNoBonusDice() rollData.noBonusDice = this.checkNoBonusDice()
rollData.dicePool = [] rollData.dicePool = []
rollData.subKey = subKey rollData.subKey = subKey
rollData.tic1 = "NONE" rollData.MDL = this.baseMDL
rollData.tic2 = "NONE" rollData.ADRL = this.baseADRL
if (subKey == "melee-dmg" || subKey == "ranged-dmg" || subKey == "power-dmg") { if (subKey == "melee-dmg" || subKey == "ranged-dmg" || subKey == "power-dmg") {
rollData.isDamage = true rollData.isDamage = true
@ -2210,7 +2232,7 @@ export class PegasusActor extends Actor {
} }
if (statKey == "mr") { if (statKey == "mr") {
if (this.type == "character"|| this.type == 'npc') { if (this.type == "character" || this.type == 'npc') {
rollData.mrVehicle = PegasusUtility.checkIsVehicleCrew(this.id) rollData.mrVehicle = PegasusUtility.checkIsVehicleCrew(this.id)
if (rollData.mrVehicle) { if (rollData.mrVehicle) {
rollData.effectsList.push({ rollData.effectsList.push({
@ -2229,9 +2251,10 @@ export class PegasusActor extends Actor {
}) })
} }
} }
} }
rollData.hindranceDices = this.computeCurrentHindrances() rollData.hindranceDices = this.computeCurrentHindrances(statKey)
rollData.minHindranceDices = rollData.hindranceDices
this.processSizeBonus(rollData) this.processSizeBonus(rollData)
this.addEffects(rollData, isInit, isPower, subKey == "power-dmg") this.addEffects(rollData, isInit, isPower, subKey == "power-dmg")
@ -2250,7 +2273,7 @@ export class PegasusActor extends Actor {
processSizeBonus(rollData) { processSizeBonus(rollData) {
if (rollData.defenderTokenId) { if (rollData.defenderTokenId) {
let diffSize = 0 let diffSize = 0
if (this.type == "character"|| this.type == 'npc') { if (this.type == "character" || this.type == 'npc') {
this.system.biodata.sizenum = this.system.biodata?.sizenum ?? 0 this.system.biodata.sizenum = this.system.biodata?.sizenum ?? 0
this.system.biodata.sizebonus = this.system.biodata?.sizebonus ?? 0 this.system.biodata.sizebonus = this.system.biodata?.sizebonus ?? 0
diffSize = rollData.defenderSize - this.system.biodata.sizenum + this.system.biodata.sizebonus diffSize = rollData.defenderSize - this.system.biodata.sizenum + this.system.biodata.sizebonus
@ -2280,6 +2303,15 @@ export class PegasusActor extends Actor {
} }
} }
} }
/* -------------------------------------------- */
getExtraTICsFromEffect() {
let effects = this.items.filter(it => it.type == "effect" && Number(it.system.extratics) > 0)
let nbTics = 0
for (let e of effects) {
nbTics += Number(e.system.extratics)
}
return nbTics
}
/* -------------------------------------------- */ /* -------------------------------------------- */
getLevelRemainingList() { getLevelRemainingList() {
@ -2400,6 +2432,11 @@ export class PegasusActor extends Actor {
console.log("MR ROLL", rollData) console.log("MR ROLL", rollData)
if (isInit) { if (isInit) {
rollData.title = "MR / Initiative" rollData.title = "MR / Initiative"
rollData.nbTIC = ((this.type == "character") ? 2 : 1) + this.getExtraTICsFromEffect()
rollData.TICs = []
for (let i = 0; i < rollData.nbTIC; i++) {
rollData.TICs.push({ text: "NONE", revealed: false, displayed: false })
}
} }
this.startRoll(rollData); this.startRoll(rollData);
} else { } else {

View File

@ -10,6 +10,24 @@ export class PegasusCombatTracker extends CombatTracker {
template: path, template: path,
}); });
} }
/* -------------------------------------------- */
async getData() {
let combatData = await super.getData()
for (let t of combatData.turns) {
let c = game.combat.combatants.get(t.id)
t.displayTIC = (c.actor.isOwner && c.actor.hasPlayerOwner && !game.user.isGM) || (c.actor.type == "npc" && !c.actor.hasPlayerOwner && game.user.isGM)
let TICs = c.getFlag("world", "TICs")
if (TICs) {
t.TICs = TICs
} else {
t.TICs = []
}
}
//console.log("CBT", combatData)
return combatData
}
/* -------------------------------------------- */ /* -------------------------------------------- */
activateListeners(html) { activateListeners(html) {
super.activateListeners(html) super.activateListeners(html)
@ -19,6 +37,16 @@ export class PegasusCombatTracker extends CombatTracker {
let combatantId = $(ev.currentTarget).data("combatant-id") let combatantId = $(ev.currentTarget).data("combatant-id")
game.combat.revealTIC(ticNum, combatantId) game.combat.revealTIC(ticNum, combatantId)
}) })
html.find('.reset-npc-initiative').click(ev => {
game.combat.resetNPCInitiative()
})
html.find('.select-combat-actor').click(ev => {
let combatantId = $(ev.currentTarget).data("combatant-id")
game.combat.selectActor(combatantId)
})
} }
} }
@ -39,60 +67,134 @@ export class PegasusCombat extends Combat {
return this; return this;
} }
/* -------------------------------------------- */
async resetNPCInitiative() {
for (let c of this.combatants) {
if (c.actor && c.actor.type == "npc") {
await this.updateEmbeddedDocuments("Combatant", [{ _id: c.id, initiative: -1 }]);
}
}
}
/* -------------------------------------------- */ /* -------------------------------------------- */
isCharacter(combatantId) { isCharacter(combatantId) {
const combatant = game.combat.combatants.get(combatantId) const combatant = game.combat.combatants.get(combatantId)
if (combatant) { if (combatant) {
return combatant.actor.type == "character" return combatant.actor.type == "character"
} }
return false return false
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async setTic(combatantId, rollData) { selectActor(combatantId) {
if ( !combatantId) {
return
}
const combatant = game.combat.combatants.get(combatantId) const combatant = game.combat.combatants.get(combatantId)
if (combatant) { if (combatant) {
await combatant.setFlag("world", "tic1", { revealed: false, text: rollData.tic1 }) let TICs = combatant.getFlag("world", "TICs") || []
await combatant.setFlag("world", "tic2", { revealed: false, text: rollData.tic2 }) let allRevealed = true
for(let tic of TICs) {
if (!tic.revealed ) {
allRevealed = false
}
}
let msg = `<div>${combatant.actor.name} has been nominated to act, ${combatant.actor.name} choose which TIC you wish to activate!</div`
if ( allRevealed) {
msg = `<div>${combatant.actor.name} has used all its TIC's please choose a different character.</div`
}
let chatData = {
user: game.user.id,
alias: combatant.actor.name,
rollMode: game.settings.get("core", "rollMode"),
content: msg
}
ChatMessage.create(chatData);
} }
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
getTIC(num, combatantId) { async setTic(combatantId, rollData) {
if ( !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 return
} }
const combatant = game.combat.combatants.get(combatantId) const combatant = game.combat.combatants.get(combatantId)
if (combatant) { if (combatant) {
let ticData = combatant.getFlag("world", "tic" + num) await combatant.setFlag("world", "TICs", rollData.TICs)
}
}
/* -------------------------------------------- */
async revealTIC(num, combatantId) {
console.log('revealTIC', num, combatantId)
if (num == undefined || combatantId == undefined) {
return
}
const combatant = game.combat.combatants.get(combatantId)
if (combatant) {
console.log('revealTIC', num, combatantId, combatant)
let ticData = combatant.getFlag("world", "TICs")
if (ticData) { if (ticData) {
ticData.revealed = true console.log('revealTIC', num, combatantId, ticData)
await combatant.setFlag("world", "tic" + num, ticData) num = Number(num)
if ( ticData[num].revealed && ticData[num].displayed ) {
let chatData = {
user: game.user.id,
alias: combatant.actor.name,
rollMode: game.settings.get("core", "rollMode"),
whisper: [game.user.id].concat(ChatMessage.getWhisperRecipients('GM')),
content: `<div>${combatant.actor.name} : This Action has already been performed please choose a different TIC</div`
};
ChatMessage.create(chatData);
return
}
ticData[num].revealed = true
ticData[num].displayed = true
combatant.setFlag("world", "TICs", ticData).then(() => {
let chatData = {
user: game.user.id,
alias: combatant.actor.name,
rollMode: game.settings.get("core", "rollMode"),
content: `<div>${combatant.actor.name} is performing ${ticData[num].text}</div`
};
ChatMessage.create(chatData);
// Manage if all TIC has been ACTED
let allRevealed = true
for (let c of this.combatants) {
let TICs = c.getFlag("world", "TICs")
if (TICs) {
for (let t of TICs) {
if (!t.revealed) {
allRevealed = false
}
}
}
}
// If all TIC has been ACTED, display a message
if (allRevealed) {
let chatData = {
user: game.user.id,
rollMode: game.settings.get("core", "rollMode"),
content: `<div>All Characters have acted, All Characters who do not have Stun gain 1 Momentum!</div`
}
ChatMessage.create(chatData);
}
})
} }
} }
} }
/* -------------------------------------------- */
nextRound() {
for (let c of this.combatants) {
let TICs = duplicate(c.getFlag("world", "TICs"))
for (let t of TICs) {
t.displayed = false
t.revealed = false
t.text = ""
}
c.setFlag("world", "TICs", TICs)
}
super.nextRound()
}
/* -------------------------------------------- */ /* -------------------------------------------- */
_onUpdate(changed, options, userId) { _onUpdate(changed, options, userId) {
} }

View File

@ -26,5 +26,12 @@ export const PEGASUS_CONFIG = {
shaken: { key:'shaken',name: 'Shaken', hindrance: 0, hasfear: true }, shaken: { key:'shaken',name: 'Shaken', hindrance: 0, hasfear: true },
anxious: { key:'anxious',name: 'Anxious', hindrance: 0, nostunrecover: true }, anxious: { key:'anxious',name: 'Anxious', hindrance: 0, nostunrecover: true },
lostface: { key:'lostface',name: 'Lost Face', hindrance: 0 } lostface: { key:'lostface',name: 'Lost Face', hindrance: 0 }
},
extraTIC: {
"0": {key: "0", name: "None", value: 0},
"1": {key: "1", name: "+1 TIC", value: 1},
"2": {key: "2", name: "+2 TIC", value: 2},
"3": {key: "3", name: "+3 TIC", value: 3},
"4": {key: "4", name: "+4 TIC", value: 4},
} }
} }

View File

@ -57,6 +57,7 @@ export class PegasusItemSheet extends ItemSheet {
type: objectData.type, type: objectData.type,
img: objectData.img, img: objectData.img,
name: objectData.name, name: objectData.name,
config: game.system.pegasus.config,
editable: this.isEditable, editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked", cssClass: this.isEditable ? "editable" : "locked",
optionsDiceList: PegasusUtility.getOptionsDiceList(), optionsDiceList: PegasusUtility.getOptionsDiceList(),

View File

@ -39,8 +39,9 @@ export class PegasusRollDialog extends Dialog {
/* -------------------------------------------- */ /* -------------------------------------------- */
roll() { roll() {
this.rollData.tic1 = $('#roll-input-tic1').val() for(let i=0; i<this.rollData.nbTIC; i++) {
this.rollData.tic2 = $('#roll-input-tic2').val() this.rollData.TICs[i].text = $('#roll-input-tic'+i).val()
}
PegasusUtility.rollPegasus(this.rollData) PegasusUtility.rollPegasus(this.rollData)
} }
@ -103,6 +104,12 @@ export class PegasusRollDialog extends Dialog {
if (armor) { if (armor) {
armor.applied = toggled armor.applied = toggled
} }
this.rollData.armorUsed = false
for(let a of this.rollData.armorsList) {
if (a.applied) {
this.rollData.armorUsed = true
}
}
console.log("Armor", armorIdx, toggled) console.log("Armor", armorIdx, toggled)
PegasusUtility.updateArmorDicePool(this.rollData) PegasusUtility.updateArmorDicePool(this.rollData)
} }
@ -119,6 +126,12 @@ export class PegasusRollDialog extends Dialog {
} }
weapon.applied = toggled weapon.applied = toggled
} }
this.rollData.weaponUsed = false
for(let a of this.rollData.weaponsList) {
if (a.applied) {
this.rollData.weaponUsed = true
}
}
console.log("Weapon", weaponIdx, toggled, weapon) console.log("Weapon", weaponIdx, toggled, weapon)
PegasusUtility.updateDamageDicePool(this.rollData) PegasusUtility.updateDamageDicePool(this.rollData)
} }
@ -283,6 +296,13 @@ export class PegasusRollDialog extends Dialog {
PegasusUtility.removeFromDicePool(this.rollData, idx) PegasusUtility.removeFromDicePool(this.rollData, idx)
this.refreshDialog() this.refreshDialog()
}) })
html.find('.pool-remove-hindrance-dice').click(async (event) => {
if (this.rollData.hindranceDices > this.rollData.minHindranceDices) {
this.rollData.hindranceDices--;
}
this.refreshDialog()
})
} }

View File

@ -110,9 +110,6 @@ export class PegasusUtility {
Handlebars.registerHelper('isGM', function () { Handlebars.registerHelper('isGM', function () {
return game.user.isGM return game.user.isGM
}) })
Handlebars.registerHelper('getTIC', function (num, id) {
return game.combat.getTIC(num, id)
})
Handlebars.registerHelper('isCharacter', function (id) { Handlebars.registerHelper('isCharacter', function (id) {
return game.combat.isCharacter(id) return game.combat.isCharacter(id)
}) })
@ -168,7 +165,8 @@ export class PegasusUtility {
static getDiceList() { static getDiceList() {
return [{ key: "d4", level: 1, img: "systems/fvtt-pegasus-rpg/images/dice/d4.webp" }, { key: "d6", level: 2, img: "systems/fvtt-pegasus-rpg/images/dice/d6.webp" }, return [{ key: "d4", level: 1, img: "systems/fvtt-pegasus-rpg/images/dice/d4.webp" }, { key: "d6", level: 2, img: "systems/fvtt-pegasus-rpg/images/dice/d6.webp" },
{ key: "d8", level: 3, img: "systems/fvtt-pegasus-rpg/images/dice/d8.webp" }, { key: "d10", level: 4, img: "systems/fvtt-pegasus-rpg/images/dice/d10.webp" }, { key: "d8", level: 3, img: "systems/fvtt-pegasus-rpg/images/dice/d8.webp" }, { key: "d10", level: 4, img: "systems/fvtt-pegasus-rpg/images/dice/d10.webp" },
{ key: "d12", level: 5, img: "systems/fvtt-pegasus-rpg/images/dice/d12.webp" }] { key: "d12", level: 5, img: "systems/fvtt-pegasus-rpg/images/dice/d12.webp" },
{ key: "hindrance", level: 0, img: "systems/fvtt-pegasus-rpg/images/dice/hindrance-dice.png"}]
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -286,11 +284,15 @@ export class PegasusUtility {
/* -------------------------------------------- */ /* -------------------------------------------- */
static addDicePool(rollData, diceKey, level) { static addDicePool(rollData, diceKey, level) {
let newDice = { if (diceKey == "hindrance") {
name: "dice-click", key: diceKey, level: level, rollData.hindranceDices +=1
img: `systems/fvtt-pegasus-rpg/images/dice/${diceKey}.webp` } else {
let newDice = {
name: "dice-click", key: diceKey, level: level,
img: `systems/fvtt-pegasus-rpg/images/dice/${diceKey}.webp`
}
rollData.dicePool.push(newDice)
} }
rollData.dicePool.push(newDice)
} }
/*-------------------------------------------- */ /*-------------------------------------------- */
@ -790,7 +792,7 @@ export class PegasusUtility {
// De-actived used effects from perks // De-actived used effects from perks
let toRem = [] let toRem = []
for (let effect of rollData.effectsList) { for (let effect of rollData.effectsList) {
if (effect.effect && effect.effect.system.isUsed && effect.effect.system.oneuse) { if (effect?.effect?.system.isUsed && effect.effect.system.oneuse) {
effect.defenderTokenId = rollData.defenderTokenId effect.defenderTokenId = rollData.defenderTokenId
if (effect.foreign) { if (effect.foreign) {
if (game.user.isGM) { if (game.user.isGM) {
@ -804,11 +806,11 @@ export class PegasusUtility {
} }
} }
} }
let actor = game.actors.get(rollData.actorId)
if (toRem.length > 0) { if (toRem.length > 0) {
//console.log("Going to remove one use effects", toRem)
let actor = game.actors.get(rollData.actorId)
actor.deleteEmbeddedDocuments('Item', toRem) actor.deleteEmbeddedDocuments('Item', toRem)
} }
actor.checkEFfectsHindranceDeletion(rollData.statKey)
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -1142,7 +1142,6 @@ ul, li {
position: relative; position: relative;
margin:4px; margin:4px;
} }
.chat-card-button { .chat-card-button {
box-shadow: inset 0px 1px 0px 0px #a6827e; box-shadow: inset 0px 1px 0px 0px #a6827e;
background: linear-gradient(to bottom, #21374afc 5%, #152833ab 100%); background: linear-gradient(to bottom, #21374afc 5%, #152833ab 100%);
@ -1352,6 +1351,26 @@ Focus FOC: #ff0084
max-height: 26px; max-height: 26px;
margin-top: 4px; margin-top: 4px;
} }
.combat-tracker-tic-section {
max-width: 5rem;
min-width: 5rem;
align-content: center;
}
.combat-tracker-tic {
text-align: center;
background: linear-gradient(to bottom, #21374afc 5%, #152833ab 100%);
border-radius: 3px;
border: 2px ridge #846109;
color: #ffffff;
font-size: 0.8rem;
margin:2px;
}
.combat-tracker-tic-button {
max-height: 1.8rem;
margin-bottom: 4px;
background: linear-gradient(to bottom, #21374afc 5%, #152833ab 100%);
border-radius: 3px;
}
.no-grow { .no-grow {
flex-grow: 1; flex-grow: 1;
max-width: 32px; max-width: 32px;
@ -1517,4 +1536,13 @@ Focus FOC: #ff0084
max-width: 48px; max-width: 48px;
max-height: 48px; max-height: 48px;
flex-grow: 0; flex-grow: 0;
}
.dice-pool-image-add {
border: 0;
margin-left: 4px;
min-width: 32px;
min-height: 32px;
max-width: 32px;
max-height: 32px;
flex-grow: 0;
} }

View File

@ -244,15 +244,15 @@
"flags": {} "flags": {}
} }
], ],
"primaryTokenAttribute": "secondary.health", "primaryTokenAttribute": "",
"secondaryTokenAttribute": "secondary.delirium", "secondaryTokenAttribute": "",
"socket": true, "socket": true,
"styles": [ "styles": [
"styles/simple.css" "styles/simple.css"
], ],
"title": "Pegasus RPG", "title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
"version": "11.0.6", "version": "11.0.23",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.6.zip", "download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.23.zip",
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp" "background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
} }

View File

@ -172,7 +172,7 @@
"type": "value", "type": "value",
"ismax": true, "ismax": true,
"iscombat": true, "iscombat": true,
"status": "healthy", "status": "healthy",
"bonus": 0, "bonus": 0,
"max": 0 "max": 0
}, },
@ -439,6 +439,7 @@
"noperksallowed": false, "noperksallowed": false,
"affectstatus": false, "affectstatus": false,
"affectedstatus": "", "affectedstatus": "",
"extratics": "none",
"locked": false, "locked": false,
"droptext": "", "droptext": "",
"description": "" "description": ""

View File

@ -24,6 +24,11 @@
{{#if isDamage}} {{#if isDamage}}
<li>Weapon Damage Dice : {{weaponDamageDice}}</li> <li>Weapon Damage Dice : {{weaponDamageDice}}</li>
{{/if}} {{/if}}
{{#if (eq subKey "dmg-res")}}
<li>Damage Resistance</li>
{{/if}}
{{#if isResistance}} {{#if isResistance}}
<li>Armor Resistance Dice : {{armor.system.resistanceDice}}</li> <li>Armor Resistance Dice : {{armor.system.resistanceDice}}</li>
<li>ADRL : {{armor.system.adrl}}</li> <li>ADRL : {{armor.system.adrl}}</li>
@ -51,6 +56,23 @@
<li>Damage type : {{weapon.weapon.system.damagetype}} {{weapon.weapon.system.damagetypelevel}}</li> <li>Damage type : {{weapon.weapon.system.damagetype}} {{weapon.weapon.system.damagetypelevel}}</li>
{{/if}} {{/if}}
{{/if}} {{/if}}
{{#if (eq subKey "melee-dmg")}}
{{#if (not weaponUsed)}}
<li>MDL : {{MDL}}</li>
{{/if}}
{{/if}}
{{#if (eq subKey "dmg-res")}}
{{#if (not armorUsed)}}
<li>ADRL : {{ADRL}}</li>
{{/if}}
{{#each armorsList as |armor idx|}}
{{#if armor.applied}}
<li>ADRL: {{armor.adrl}}</li>
{{/if}}
{{/each}}
{{/if}}
{{#if power}} {{#if power}}
<li>Power Damage type : {{power.system.powerdamagetype}} {{power.system.powerdamagetypelevel}}</li> <li>Power Damage type : {{power.system.powerdamagetype}} {{power.system.powerdamagetypelevel}}</li>

View File

@ -88,7 +88,13 @@
<li class="flexrow"><label class="generic-label">Display Text when added to Actor</label> <li class="flexrow"><label class="generic-label">Display Text when added to Actor</label>
<input type="text" class="input-numeric-short padd-right" name="system.droptext" value="{{data.droptext}}" data-dtype="String"/> <input type="text" class="input-numeric-short padd-right" name="system.droptext" value="{{data.droptext}}" data-dtype="String"/>
</li> </li>
<li class="flexrow"><label class="generic-label">Provide extra TICs ?</label>
<select class="competence-base flexrow" type="text" name="system.extratics" value="{{data.extratics}}" data-dtype="String">
{{selectOptions config.extraTIC selected=data.extratics nameAttr="key" labelAttr="name" }}
</select>
</li>
<li class="flexrow"><label class="generic-label">Affect Status?</label> <li class="flexrow"><label class="generic-label">Affect Status?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.affectstatus" {{checked data.affectstatus}}/></label> <label class="attribute-value checkbox"><input type="checkbox" name="system.affectstatus" {{checked data.affectstatus}}/></label>
</li> </li>

View File

@ -30,7 +30,10 @@
<a class="combat-button combat-control" aria-label="{{localize 'COMBAT.RollNPC'}}" role="button" data-tooltip="COMBAT.RollNPC" data-control="rollNPC" {{#unless turns}}disabled{{/unless}}> <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> <i class="fas fa-users-cog"></i>
</a> </a>
{{/if}} <a class="combat-button reset-npc-initiative" aria-label="Reset NPC" role="button" data-tooltip="Reset NPC Initiative" data-control="resetNPC" {{#unless turns}}disabled{{/unless}}>
<i class="fas fa-pickaxe"></i>
</a>
{{/if}}
{{#if combatCount}} {{#if combatCount}}
{{#if combat.round}} {{#if combat.round}}
@ -63,7 +66,7 @@
<li class="combatant actor directory-item flexrow {{this.css}}" data-combatant-id="{{this.id}}"> <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}}"/> <img class="token-image" data-src="{{this.img}}" alt="{{this.name}}"/>
<div class="token-name flexcol"> <div class="token-name flexcol">
<h4>{{this.name}}</h4> <h4>{{this.name}}</h4><a class="select-combat-actor" data-combatant-id="{{this.id}}"><i class="fas fa-hand-pointer"></i></a>
<div class="combatant-controls flexrow"> <div class="combatant-controls flexrow">
{{#if ../user.isGM}} {{#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"> <a class="combatant-control {{#if this.hidden}}active{{/if}}" aria-label="{{localize 'COMBAT.ToggleVis'}}" role="button" data-tooltip="COMBAT.ToggleVis" data-control="toggleHidden">
@ -92,11 +95,20 @@
</div> </div>
{{/if}} {{/if}}
<div class="token-resource" id="{{this.id}}"> <div class="combat-tracker-tic-section flexcol" id="{{this.id}}">
<a class="combat-tracker-tic" data-tic-num="1" data-combatant-id="{{this.id}}">{{getTIC 1 this.id}}</a> {{#each this.TICs as | tic index|}}
{{#if (isCharacter this.id)}} <button class="combat-tracker-tic-button"><a class="combat-tracker-tic" data-tic-num="{{index}}" data-combatant-id="{{../id}}">
<a class="combat-tracker-tic" data-tic-num="2" data-combatant-id="{{this.id}}">{{getTIC 2 this.id}}</a> {{#if tic.revealed}}
{{/if}} ACTED
{{else}}
{{#if ../displayTIC}}
{{tic.text}}
{{else}}
TIC: {{add index 1}}
{{/if}}
{{/if}}
</a></button>
{{/each}}
</div> </div>
<div class="token-initiative"> <div class="token-initiative">

View File

@ -26,7 +26,7 @@
{{#if statVehicle}} {{#if statVehicle}}
<div class="flexrow"> <div class="flexrow">
<span class="roll-dialog-label">{{upper statVehicle.label}} :</span> <span class="roll-dialog-label">{{upper statVehicle.label}} :</span>
<select class="roll-dialog-label" id="statVehicleLevel" type="text" name="statVehicleLevel" <select class="roll-dialog-label" id="statVehicleLevel" type="text" name="statVehicleLevel"
value="{{statVehicle.currentlevel}}" data-dtype="Number" {{#if statKey}}disabled{{/if}}> value="{{statVehicle.currentlevel}}" data-dtype="Number" {{#if statKey}}disabled{{/if}}>
{{#select statVehicle.currentlevel}} {{#select statVehicle.currentlevel}}
@ -37,73 +37,72 @@
</div> </div>
{{/if}} {{/if}}
{{#if specList}} {{#if specList}}
<div class="flexrow"> <div class="flexrow">
<span class="roll-dialog-label">Spec : </span> <span class="roll-dialog-label">Spec : </span>
<select class="roll-dialog-label" id="specList" type="text" name="selectedSpec" value="{{selectedSpec}}" <select class="roll-dialog-label" id="specList" type="text" name="selectedSpec" value="{{selectedSpec}}"
data-dtype="String"> data-dtype="String">
{{#select selectedSpec}} {{#select selectedSpec}}
<option value="0">None</option> <option value="0">None</option>
{{#each specList as |spec idx|}} {{#each specList as |spec idx|}}
<option value="{{spec._id}}">{{spec.name}}</option> <option value="{{spec._id}}">{{spec.name}}</option>
{{/each}} {{/each}}
{{/select}} {{/select}}
</select> </select>
<span class="small-label">&nbsp;</span> <span class="small-label">&nbsp;</span>
</div> </div>
<div class="flexrow"> <div class="flexrow">
<span class="roll-dialog-label">Spec Dice : </span> <span class="roll-dialog-label">Spec Dice : </span>
<select class="roll-dialog-label" id="specDicesLevel" type="text" name="specDicesLevel" <select class="roll-dialog-label" id="specDicesLevel" type="text" name="specDicesLevel"
value="{{specDicesLevel}}" data-dtype="Number" {{#if specList}}disabled{{/if}}> value="{{specDicesLevel}}" data-dtype="Number" {{#if specList}}disabled{{/if}}>
{{#select specDicesLevel}} {{#select specDicesLevel}}
{{{optionsDiceList}}} {{{optionsDiceList}}}
{{/select}} {{/select}}
</select> </select>
<span class="small-label">&nbsp;</span> <span class="small-label">&nbsp;</span>
</div> </div>
{{/if}} {{/if}}
{{/if}} {{/if}}
<div class="dice-pool-div"> <div class="dice-pool-div">
<span> <span>
<h3 class="dice-pool-label">Current pool</h3> <h3 class="dice-pool-label">Current pool</h3>
</span> </span>
<div class="flexrow dice-pool-stack"> <div class="flexrow dice-pool-stack">
{{#each dicePool as |dice idx|}} {{#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" <span><a class="pool-remove-dice" data-dice-idx="{{idx}}" data-dice-level="{{dice.level}}"
src="{{dice.img}}" alt="dices"></a></span> data-dice-key="{{dice.key}}"><img class="dice-pool-image" src="{{dice.img}}" alt="dices"></a></span>
{{/each}} {{/each}}
</div> </div>
</div> </div>
{{#if noBonusDice}}
<div class="flexrow">
No bonus dice due to effect !
</div>
{{else}}
<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}}" alt="dices"></a></span>
{{/each}}
</div>
{{/if}}
{{#if hindranceDices}}
<div class="dice-pool-div"> <div class="dice-pool-div">
<span> <span>
<h3 class="dice-pool-label">Hindrance Dice</h3> <h3 class="dice-pool-label">Hindrance Dice</h3>
</span> </span>
<div class="flexrow dice-pool-stack"> <div class="flexrow dice-pool-stack">
{{#for 1 hindranceDices 1}} {{#for 1 hindranceDices 1}}
<span><a class="" data-dice-idx="{{idx}}" data-dice-level="2" data-dice-key="d6"><img class="dice-pool-image" <span><a class="pool-remove-hindrance-dice" 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> src="systems/fvtt-pegasus-rpg/images/dice/hindrance-dice.png" alt="dices"></a></span>
{{/for}} {{/for}}
</div> </div>
</div> </div>
{{#if noBonusDice}}
<div class="flexrow">
No bonus dice due to effect !
</div>
{{else}}
<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-add" src="{{dice.img}}" alt="dices"></a></span>
{{/each}}
</div>
{{/if}} {{/if}}
<div class="flexrow"> <div class="flexrow">
<span class="roll-dialog-label">Modifiers : </span> <span class="roll-dialog-label">Modifiers : </span>
@ -129,21 +128,30 @@
<option value="d6">Outnumbered 2 Extra Allies d6</option> <option value="d6">Outnumbered 2 Extra Allies d6</option>
<option value="d8">Outnumbered 3 Extra Allies d8</option> <option value="d8">Outnumbered 3 Extra Allies d8</option>
<option value="d10">Outnumbered 4 Extra Allies d10</option> <option value="d10">Outnumbered 4 Extra Allies d10</option>
<option value="d12">Outnumbered 5 Extra Allies d12<option> <option value="d12">Outnumbered 5 Extra Allies d12
<option>
<option value="none4">===== Called DMG Shot Bonus</option> <option value="none4">===== Called DMG Shot Bonus</option>
<option value="d12">Eyes/head d12<option> <option value="d12">Eyes/head d12
<option>
<option value="none4">===== Impact DMG Bonus</option> <option value="none4">===== Impact DMG Bonus</option>
<option value="d4">Soft d4<option> <option value="d4">Soft d4
<option value="d6">Thin/Flimsy d6<option> <option>
<option value="d8">Solid Furniture d8<option> <option value="d6">Thin/Flimsy d6
<option value="d10">Thin Metal/Thick Wood d10<option> <option>
<option value="d12">Solid Object/Concrete d12<option> <option value="d8">Solid Furniture d8
<option>
<option value="d10">Thin Metal/Thick Wood d10
<option>
<option value="d12">Solid Object/Concrete d12
<option>
<option value="none5">===== Other Circumstances</option> <option value="none5">===== Other Circumstances</option>
<option value="d4">Concentrated<option> <option value="d4">Concentrated
<option value="d4">Off Hand d4<option> <option>
<option value="d4">Off Hand d4
<option>
<option value="d6">Higher Ground d6</option> <option value="d6">Higher Ground d6</option>
{{/select}} {{/select}}
</select> </select>
</div> </div>
</div> </div>
@ -154,18 +162,14 @@
{{else}} {{else}}
{{> systems/fvtt-pegasus-rpg/templates/partial-roll-select-effects.html}} {{> systems/fvtt-pegasus-rpg/templates/partial-roll-select-effects.html}}
{{/if}} {{/if}}
{{#if isInit}} {{#if isInit}}
{{#each TICs as |tic index|}}
<div class="flexrow"> <div class="flexrow">
<span class="roll-dialog-label">TIC 1:</span> <span class="roll-dialog-label">TIC {{add index 1}}:</span>
<input class="roll-input-tic" id="roll-input-tic1" type="text" name="tic1" value="{{tic1}}" data-dtype="String"> <input class="roll-input-tic" id="roll-input-tic{{index}}" type="text" value="{{tic.text}}" data-dtype="String">
</div> </div>
{{#if (eq actorType "character")}} {{/each}}
<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}} {{/if}}
</div> </div>