Compare commits
13 Commits
fvtt-pegas
...
master
Author | SHA1 | Date | |
---|---|---|---|
0c215e7a9c | |||
1b655a9c0e | |||
bbf0f31d4c | |||
552ff9564a | |||
26f2fba457 | |||
7d6408f6b7 | |||
72ff709682 | |||
588c6655b3 | |||
9de2bc48b8 | |||
460fd1f0d6 | |||
2647983e8d | |||
d1fdc5a97f | |||
9e92b904fb |
@ -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,13 +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") ) {
|
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)
|
ui.notifications.warn("Unable to recover STUN because of Confidence status : " + this.system.secondary.confidence.status)
|
||||||
return
|
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 = {
|
||||||
@ -778,10 +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'))
|
||||||
}
|
}
|
||||||
this.createEmbeddedDocuments("ActiveEffect", [
|
if (!daze) {
|
||||||
{ label: 'EFFECT.StatusDaze', icon: 'icons/svg/daze.svg', flags: { core: { statusId: '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 {
|
||||||
@ -805,7 +811,7 @@ export class PegasusActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
modifyMomentum(incDec) {
|
modifyMomentum(incDec) {
|
||||||
if ( this.system.stun.value > 0 ) {
|
if (this.system.combat.stunlevel > 0) {
|
||||||
ui.notifications.warn("Unable to gain/use Momentum while stunned")
|
ui.notifications.warn("Unable to gain/use Momentum while stunned")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1461,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
|
||||||
@ -1496,7 +1502,7 @@ export class PegasusActor extends Actor {
|
|||||||
}
|
}
|
||||||
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
|
||||||
@ -1511,6 +1517,11 @@ export class PegasusActor extends Actor {
|
|||||||
let effect = await PegasusUtility.getEffectFromCompendium("Fear")
|
let effect = await PegasusUtility.getEffectFromCompendium("Fear")
|
||||||
this.createEmbeddedDocuments('Item', [effect])
|
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 */
|
/* Manage flag state for status */
|
||||||
this.defeatedDisplayed = this.defeatedDisplayed && this.system.secondary.health.status != "defeated"
|
this.defeatedDisplayed = this.defeatedDisplayed && this.system.secondary.health.status != "defeated"
|
||||||
@ -1567,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 })
|
||||||
}
|
}
|
||||||
@ -1583,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 })
|
||||||
}
|
}
|
||||||
@ -1600,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 })
|
||||||
}
|
}
|
||||||
@ -1612,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
|
||||||
@ -1905,6 +1924,18 @@ 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(statKey) {
|
computeCurrentHindrances(statKey) {
|
||||||
@ -1916,11 +1947,9 @@ export class PegasusActor extends Actor {
|
|||||||
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") {
|
if (statKey.toLowerCase() == "stl" && this.system.secondary.concealment.status == "exposed") {
|
||||||
hindrancesDices += 1
|
hindrancesDices += 1
|
||||||
@ -2139,6 +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.MDL = this.baseMDL
|
||||||
|
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
|
||||||
@ -2223,6 +2254,7 @@ export class PegasusActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rollData.hindranceDices = this.computeCurrentHindrances(statKey)
|
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")
|
||||||
@ -2273,10 +2305,10 @@ export class PegasusActor extends Actor {
|
|||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getExtraTICsFromEffect() {
|
getExtraTICsFromEffect() {
|
||||||
let effects = this.items.filter(it => it.type == "effect" && Number(it.system.extratics)>0)
|
let effects = this.items.filter(it => it.type == "effect" && Number(it.system.extratics) > 0)
|
||||||
let nbTics = 0
|
let nbTics = 0
|
||||||
for (let e of effects) {
|
for (let e of effects) {
|
||||||
nbTics += Number(it.system.extratics)
|
nbTics += Number(e.system.extratics)
|
||||||
}
|
}
|
||||||
return nbTics
|
return nbTics
|
||||||
}
|
}
|
||||||
@ -2402,8 +2434,8 @@ export class PegasusActor extends Actor {
|
|||||||
rollData.title = "MR / Initiative"
|
rollData.title = "MR / Initiative"
|
||||||
rollData.nbTIC = ((this.type == "character") ? 2 : 1) + this.getExtraTICsFromEffect()
|
rollData.nbTIC = ((this.type == "character") ? 2 : 1) + this.getExtraTICsFromEffect()
|
||||||
rollData.TICs = []
|
rollData.TICs = []
|
||||||
for(let i=0; i<rollData.nbTIC; i++) {
|
for (let i = 0; i < rollData.nbTIC; i++) {
|
||||||
rollData.TICs.push( {text:"NONE", revealed: false, displayed: false})
|
rollData.TICs.push({ text: "NONE", revealed: false, displayed: false })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.startRoll(rollData);
|
this.startRoll(rollData);
|
||||||
|
@ -16,6 +16,7 @@ export class PegasusCombatTracker extends CombatTracker {
|
|||||||
let combatData = await super.getData()
|
let combatData = await super.getData()
|
||||||
for (let t of combatData.turns) {
|
for (let t of combatData.turns) {
|
||||||
let c = game.combat.combatants.get(t.id)
|
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")
|
let TICs = c.getFlag("world", "TICs")
|
||||||
if (TICs) {
|
if (TICs) {
|
||||||
t.TICs = TICs
|
t.TICs = TICs
|
||||||
@ -23,7 +24,7 @@ export class PegasusCombatTracker extends CombatTracker {
|
|||||||
t.TICs = []
|
t.TICs = []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log("CBT", combatData)
|
//console.log("CBT", combatData)
|
||||||
return combatData
|
return combatData
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,13 +89,23 @@ export class PegasusCombat extends Combat {
|
|||||||
selectActor(combatantId) {
|
selectActor(combatantId) {
|
||||||
const combatant = game.combat.combatants.get(combatantId)
|
const combatant = game.combat.combatants.get(combatantId)
|
||||||
if (combatant) {
|
if (combatant) {
|
||||||
|
let TICs = combatant.getFlag("world", "TICs") || []
|
||||||
|
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 = {
|
let chatData = {
|
||||||
user: game.user.id,
|
user: game.user.id,
|
||||||
alias: combatant.actor.name,
|
alias: combatant.actor.name,
|
||||||
rollMode: game.settings.get("core", "rollMode"),
|
rollMode: game.settings.get("core", "rollMode"),
|
||||||
whisper: [game.user.id].concat(ChatMessage.getWhisperRecipients('GM')),
|
content: msg
|
||||||
content: `<div>${combatant.actor.name} has been nominated to act, ${combatant.actor.name} choose which TIC you wish to activate!</div`
|
}
|
||||||
}
|
|
||||||
ChatMessage.create(chatData);
|
ChatMessage.create(chatData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,6 +134,17 @@ export class PegasusCombat extends Combat {
|
|||||||
if (ticData) {
|
if (ticData) {
|
||||||
console.log('revealTIC', num, combatantId, ticData)
|
console.log('revealTIC', num, combatantId, ticData)
|
||||||
num = Number(num)
|
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].revealed = true
|
||||||
ticData[num].displayed = true
|
ticData[num].displayed = true
|
||||||
combatant.setFlag("world", "TICs", ticData).then(() => {
|
combatant.setFlag("world", "TICs", ticData).then(() => {
|
||||||
@ -130,7 +152,6 @@ export class PegasusCombat extends Combat {
|
|||||||
user: game.user.id,
|
user: game.user.id,
|
||||||
alias: combatant.actor.name,
|
alias: combatant.actor.name,
|
||||||
rollMode: game.settings.get("core", "rollMode"),
|
rollMode: game.settings.get("core", "rollMode"),
|
||||||
whisper: [game.user.id].concat(ChatMessage.getWhisperRecipients('GM')),
|
|
||||||
content: `<div>${combatant.actor.name} is performing ${ticData[num].text}</div`
|
content: `<div>${combatant.actor.name} is performing ${ticData[num].text}</div`
|
||||||
};
|
};
|
||||||
ChatMessage.create(chatData);
|
ChatMessage.create(chatData);
|
||||||
|
@ -104,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)
|
||||||
}
|
}
|
||||||
@ -120,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)
|
||||||
}
|
}
|
||||||
@ -284,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()
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -165,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"}]
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -283,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)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-------------------------------------------- */
|
/*-------------------------------------------- */
|
||||||
@ -787,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) {
|
||||||
@ -801,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)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -1537,3 +1537,12 @@ Focus FOC: #ff0084
|
|||||||
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;
|
||||||
|
}
|
@ -244,15 +244,15 @@
|
|||||||
"flags": {}
|
"flags": {}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"primaryTokenAttribute": "secondary.health.status",
|
"primaryTokenAttribute": "",
|
||||||
"secondaryTokenAttribute": "secondary.delirium.status",
|
"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.10",
|
"version": "11.0.23",
|
||||||
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.10.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"
|
||||||
}
|
}
|
@ -57,7 +57,16 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if (eq subKey "melee-dmg")}}
|
||||||
|
{{#if (not weaponUsed)}}
|
||||||
|
<li>MDL : {{MDL}}</li>
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{#if (eq subKey "dmg-res")}}
|
{{#if (eq subKey "dmg-res")}}
|
||||||
|
{{#if (not armorUsed)}}
|
||||||
|
<li>ADRL : {{ADRL}}</li>
|
||||||
|
{{/if}}
|
||||||
{{#each armorsList as |armor idx|}}
|
{{#each armorsList as |armor idx|}}
|
||||||
{{#if armor.applied}}
|
{{#if armor.applied}}
|
||||||
<li>ADRL: {{armor.adrl}}</li>
|
<li>ADRL: {{armor.adrl}}</li>
|
||||||
|
@ -101,7 +101,11 @@
|
|||||||
{{#if tic.revealed}}
|
{{#if tic.revealed}}
|
||||||
ACTED
|
ACTED
|
||||||
{{else}}
|
{{else}}
|
||||||
TIC: {{add index 1}}
|
{{#if ../displayTIC}}
|
||||||
|
{{tic.text}}
|
||||||
|
{{else}}
|
||||||
|
TIC: {{add index 1}}
|
||||||
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</a></button>
|
</a></button>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
@ -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,31 +37,31 @@
|
|||||||
</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"> </span>
|
<span class="small-label"> </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"> </span>
|
<span class="small-label"> </span>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
@ -71,39 +71,38 @@
|
|||||||
</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>
|
||||||
@ -156,12 +164,12 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if isInit}}
|
{{#if isInit}}
|
||||||
{{#each TICs as |tic index|}}
|
{{#each TICs as |tic index|}}
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
<span class="roll-dialog-label">TIC {{add index 1}}:</span>
|
<span class="roll-dialog-label">TIC {{add index 1}}:</span>
|
||||||
<input class="roll-input-tic" id="roll-input-tic{{index}}" type="text" value="{{tic.text}}" data-dtype="String">
|
<input class="roll-input-tic" id="roll-input-tic{{index}}" type="text" value="{{tic.text}}" data-dtype="String">
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user