Compare commits

..

5 Commits

Author SHA1 Message Date
ff57953e75 Manage status 2023-09-15 07:33:44 +02:00
dc07b27801 Minor changes 2023-09-14 23:23:16 +02:00
2394026d0c Minor changes 2023-09-14 21:03:08 +02:00
47db569efd Add hindrance dice 2023-09-13 21:26:47 +02:00
ba98d9c264 Add hindrance dice 2023-09-13 21:25:44 +02:00
11 changed files with 196 additions and 97 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

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') {
} }
@ -764,6 +764,10 @@ 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
@ -1244,25 +1248,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 +1328,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 +1430,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) {
@ -1530,7 +1485,6 @@ 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 = this.system.combat.hindrancedice
@ -1541,6 +1495,36 @@ 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])
}
}
/* 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()
@ -1914,7 +1898,7 @@ export class PegasusActor extends Actor {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
computeCurrentHindrances() { computeCurrentHindrances(statKey) {
let hindrancesDices = 0 let hindrancesDices = 0
if (this.type == "character" || this.type == 'npc') { if (this.type == "character" || this.type == 'npc') {
@ -1932,6 +1916,12 @@ export class PegasusActor extends Actor {
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) { if (this.system.stun.value > 0) {
@ -1958,7 +1948,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 +2047,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) {
@ -2210,7 +2200,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({
@ -2231,7 +2221,7 @@ export class PegasusActor extends Actor {
} }
} }
rollData.hindranceDices = this.computeCurrentHindrances() rollData.hindranceDices = this.computeCurrentHindrances(statKey)
this.processSizeBonus(rollData) this.processSizeBonus(rollData)
this.addEffects(rollData, isInit, isPower, subKey == "power-dmg") this.addEffects(rollData, isInit, isPower, subKey == "power-dmg")
@ -2250,7 +2240,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

View File

@ -19,6 +19,11 @@ 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()
})
} }
} }
@ -39,6 +44,15 @@ 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)
@ -50,37 +64,50 @@ export class PegasusCombat extends Combat {
/* -------------------------------------------- */ /* -------------------------------------------- */
async setTic(combatantId, rollData) { async setTic(combatantId, rollData) {
if ( !combatantId) { if (!combatantId) {
return 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 }) await combatant.setFlag("world", "tic1", { revealed: false, text: rollData.tic1, displayed: false })
await combatant.setFlag("world", "tic2", { revealed: false, text: rollData.tic2 }) await combatant.setFlag("world", "tic2", { revealed: false, text: rollData.tic2, displayed: false })
} }
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
getTIC(num, combatantId) { getTIC(num, combatantId) {
if ( !combatantId) { if (!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) let ticData = combatant.getFlag("world", "tic" + num)
if (ticData) { if (ticData) {
let ticText = "TIC" + num + ":" + ticData.text /* returns if revealed */
/* returns if revealed or if GM and NPC or if player and owner */ if (ticData.revealed && ticData.displayed) {
if (ticData.revealed || (game.user.isGM && combatant.isNPC) || (!game.user.isGM && combatant.isOwner)) { return "ACTED"
return ticText }
if (ticData.revealed && !ticData.displayed) {
ticData.displayed = true
combatant.setFlag("world", "tic" + num, ticData ).then(() => {
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} is performing ${ticData.text}</div`
};
ChatMessage.create(chatData);
return "ACTED"
})
} }
} }
} }
return "TIC" + num + ":???" return "TIC " + num
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async revealTIC(num, combatantId) { async revealTIC(num, combatantId) {
if ( !num || !combatantId) { if (!num || !combatantId) {
return return
} }
const combatant = game.combat.combatants.get(combatantId) const combatant = game.combat.combatants.get(combatantId)
@ -92,6 +119,14 @@ export class PegasusCombat extends Combat {
} }
} }
} }
/* -------------------------------------------- */
nextRound() {
for(let c of this.combatants) {
c.setFlag("world", "tic1", { revealed: false, text: "", displayed: false })
c.setFlag("world", "tic2", { revealed: false, text: "", displayed: false })
}
super.nextRound()
}
/* -------------------------------------------- */ /* -------------------------------------------- */
_onUpdate(changed, options, userId) { _onUpdate(changed, options, userId) {

View 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];
}
}

View File

@ -15,6 +15,7 @@ import { PegasusVehicleSheet } from "./pegasus-vehicle-sheet.js";
import { PegasusUtility } from "./pegasus-utility.js"; import { PegasusUtility } from "./pegasus-utility.js";
import { PegasusCombatTracker,PegasusCombat } from "./pegasus-combat.js"; import { PegasusCombatTracker,PegasusCombat } from "./pegasus-combat.js";
import { PegasusItem } from "./pegasus-item.js"; import { PegasusItem } from "./pegasus-item.js";
import { PegasusHindranceDie } from "./pegasus-hindrance-die.js";
import { PEGASUS_CONFIG } from "./pegasus-config.js" import { PEGASUS_CONFIG } from "./pegasus-config.js"
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -57,6 +58,7 @@ Hooks.once("init", async function () {
CONFIG.Actor.documentClass = PegasusActor CONFIG.Actor.documentClass = PegasusActor
CONFIG.Item.documentClass = PegasusItem CONFIG.Item.documentClass = PegasusItem
CONFIG.ui.combat = PegasusCombatTracker CONFIG.ui.combat = PegasusCombatTracker
CONFIG.Dice.terms["h"] = PegasusHindranceDie
game.system.pegasus = { game.system.pegasus = {
utility: PegasusUtility, utility: PegasusUtility,
config: PEGASUS_CONFIG config: PEGASUS_CONFIG
@ -74,7 +76,6 @@ Hooks.once("init", async function () {
PegasusUtility.init() PegasusUtility.init()
}); });
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -26,6 +26,29 @@ export class PegasusUtility {
/* Deprecated, no more used in rules Hooks.on("getCombatTrackerEntryContext", (html, options) => { /* Deprecated, no more used in rules Hooks.on("getCombatTrackerEntryContext", (html, options) => {
PegasusUtility.pushInitiativeOptions(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) => { Hooks.on("dropCanvasData", (canvas, data) => {
PegasusUtility.dropItemOnToken(canvas, data) PegasusUtility.dropItemOnToken(canvas, data)
}); });
@ -224,9 +247,9 @@ export class PegasusUtility {
for (let weapon of rollData.vehicleWeapons) { for (let weapon of rollData.vehicleWeapons) {
if (weapon.applied) { if (weapon.applied) {
newDicePool = newDicePool.concat(this.buildDicePool("damage", weapon.value, 0)) newDicePool = newDicePool.concat(this.buildDicePool("damage", weapon.value, 0))
if( weapon.weapon.system.extradamage) { if (weapon.weapon.system.extradamage) {
for(let i=0; i < weapon.weapon.system.extradamagevalue; i++) { for (let i = 0; i < weapon.weapon.system.extradamagevalue; i++) {
newDicePool = newDicePool.concat(this.buildDicePool("damage", 5, 0) ) newDicePool = newDicePool.concat(this.buildDicePool("damage", 5, 0))
} }
} }
} }
@ -567,7 +590,7 @@ export class PegasusUtility {
/* -------------------------------------------- */ /* -------------------------------------------- */
static getDiceFromLevel(level = 0) { static getDiceFromLevel(level = 0) {
level = Math.max( Number(level), 0) level = Math.max(Number(level), 0)
return this.diceList[level]; return this.diceList[level];
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -846,8 +869,8 @@ export class PegasusUtility {
myRoll = new Roll(diceFormula).roll({ async: false }) myRoll = new Roll(diceFormula).roll({ async: false })
rollData.roll = myRoll rollData.roll = myRoll
} }
if ( rollData.hindranceDices > 0) { if (rollData.hindranceDices > 0) {
rollData.hindranceRoll = new Roll(rollData.hindranceDices + "d6").roll({ async: false }) rollData.hindranceRoll = new Roll(rollData.hindranceDices + "dh").roll({ async: false })
this.showDiceSoNice(rollData.hindranceRoll, game.settings.get("core", "rollMode")) this.showDiceSoNice(rollData.hindranceRoll, game.settings.get("core", "rollMode"))
for (let res of rollData.hindranceRoll.terms[0].results) { for (let res of rollData.hindranceRoll.terms[0].results) {
if (res.result == 6) { if (res.result == 6) {
@ -1071,9 +1094,9 @@ export class PegasusUtility {
let defenderActor = target.actor let defenderActor = target.actor
rollData.defenderTokenId = target.id rollData.defenderTokenId = target.id
rollData.defenderSize = 0 rollData.defenderSize = 0
if ( defenderActor.type == "character") { if (defenderActor.type == "character") {
rollData.defenderSize = Number(defenderActor.system.biodata.sizenum) + Number(defenderActor.system.biodata.sizebonus) 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.defenderSize = Number(defenderActor.system.statistics.hr.size)
} }
//rollData.attackerId = this.id //rollData.attackerId = this.id
@ -1117,10 +1140,10 @@ export class PegasusUtility {
/* -------------------------------------------- */ /* -------------------------------------------- */
static checkIsVehicleCrew(actorId) { static checkIsVehicleCrew(actorId) {
let vehicles = game.actors.filter( actor=> actor.type == "vehicle") || [] let vehicles = game.actors.filter(actor => actor.type == "vehicle") || []
for(let vehicle of vehicles) { for (let vehicle of vehicles) {
console.log("Checking", vehicle.name) console.log("Checking", vehicle.name)
if ( vehicle.inCrew(actorId) ) { if (vehicle.inCrew(actorId)) {
return vehicle return vehicle
} }
} }
@ -1253,13 +1276,13 @@ export class PegasusUtility {
token.refresh() token.refresh()
let ennemies = [] let ennemies = []
if (token.document.disposition == -1) { 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) { 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) { 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) console.log("Ennemies for token", token.actor.name, ennemies)
for (let ennemy of ennemies) { for (let ennemy of ennemies) {

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,20 @@ 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;
}
.no-grow { .no-grow {
flex-grow: 1; flex-grow: 1;
max-width: 32px; max-width: 32px;

View File

@ -252,7 +252,7 @@
], ],
"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.5", "version": "11.0.9",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.5.zip", "download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.9.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

@ -52,6 +52,15 @@
{{/if}} {{/if}}
{{/if}} {{/if}}
{{#if (eq subKey "dmg-res")}}
<li>Damage Resistance</li>
{{#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>
{{/if}} {{/if}}

View File

@ -30,6 +30,9 @@
<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>
<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}}
{{#if combatCount}} {{#if combatCount}}
@ -92,7 +95,7 @@
</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> <a class="combat-tracker-tic" data-tic-num="1" data-combatant-id="{{this.id}}">{{getTIC 1 this.id}}</a>
{{#if (isCharacter this.id)}} {{#if (isCharacter this.id)}}
<a class="combat-tracker-tic" data-tic-num="2" data-combatant-id="{{this.id}}">{{getTIC 2 this.id}}</a> <a class="combat-tracker-tic" data-tic-num="2" data-combatant-id="{{this.id}}">{{getTIC 2 this.id}}</a>