Fix #103 size warning

This commit is contained in:
sladecraven 2022-10-06 13:17:42 +02:00
parent 7fcb5c36b6
commit de3e16a3f0
2 changed files with 34 additions and 13 deletions

View File

@ -811,8 +811,8 @@ export class PegasusActor extends Actor {
ChatMessage.create({ content: "Effects of this type cannot be applied while Immunity is applied" }) ChatMessage.create({ content: "Effects of this type cannot be applied while Immunity is applied" })
return return
} }
if ( item.system.droptext && item.system.droptext.length > 0) { if (item.system.droptext && item.system.droptext.length > 0) {
ChatMessage.create( { content: `Effect ${item.name} message : ${item.system.droptext}`}) ChatMessage.create({ content: `Effect ${item.name} message : ${item.system.droptext}` })
} }
} }
@ -918,7 +918,7 @@ export class PegasusActor extends Actor {
} else { } else {
stat = duplicate(this.system.statistics[statKey]) stat = duplicate(this.system.statistics[statKey])
} }
if ( stat.currentlevel) { if (stat.currentlevel) {
stat.dice = PegasusUtility.getDiceFromLevel(stat.currentlevel) stat.dice = PegasusUtility.getDiceFromLevel(stat.currentlevel)
} else { } else {
stat.dice = PegasusUtility.getDiceFromLevel(stat.value || stat.level) stat.dice = PegasusUtility.getDiceFromLevel(stat.value || stat.level)
@ -1810,6 +1810,27 @@ export class PegasusActor extends Actor {
} }
} }
/* -------------------------------------------- */
processVehicleTargetMessage(rollData) {
if (rollData.defenderTokenId) {
let vehicle = game.canvas.tokens.get(rollData.defenderTokenId).actor
if (vehicle.type == "vehicle") {
if (rollData.subKey == "defence" && vehicle.system.statistics.ad.currentspeed == "crawling") {
ChatMessage.create({ content: `${vehicle.name} is moving at Crawling speed : add a D8 to your Attack Dice Pool against this Vehicle` })
}
if (rollData.subKey == "defence" && vehicle.system.statistics.ad.currentspeed == "slow") {
ChatMessage.create({ content: `${vehicle.name} is moving at Slow speed : add a D4 to your Attack Dice Pool against this Vehicle` })
}
}
if (this.type == "vehicle" && rollData.statKey == "man" && this.system.statistics.ad.currentspeed == "fast") {
ChatMessage.create({ content: `Vehicle is moving at Fast speed : anyone using the vehicles MAN Dice Pool suffers a D8 Hindrance which is added to the Difficulty Dice Pool against this Vehicle` })
}
if (this.type == "vehicle" && rollData.statKey == "man" && this.system.statistics.ad.currentspeed == "extfast") {
ChatMessage.create({ content: `Vehicle is moving at Extremely Fast speed : anyone using the vehicles MAN Dice Pool suffers a D12 Hindrance which is added to the Difficulty Dice Pool against this Vehicle` })
}
}
}
/* -------------------------------------------- */ /* -------------------------------------------- */
getCommonRollData(statKey = undefined, useShield = false, isInit = false, isPower = false, subKey = "", vehicle = undefined) { getCommonRollData(statKey = undefined, useShield = false, isInit = false, isPower = false, subKey = "", vehicle = undefined) {
let rollData = PegasusUtility.getBasicRollData(isInit) let rollData = PegasusUtility.getBasicRollData(isInit)
@ -1869,8 +1890,6 @@ export class PegasusActor extends Actor {
vehicle.addVehicleShields(rollData) vehicle.addVehicleShields(rollData)
} }
vehicle.addEffects(rollData, false, false, false) vehicle.addEffects(rollData, false, false, false)
//this.addVehiculeHindrances(rollData.effectsList, vehicle)
//this.addVehicleBonus(rollData, vehicle)
} }
rollData.specList = this.getRelevantSpec(statKey) rollData.specList = this.getRelevantSpec(statKey)
@ -1914,6 +1933,8 @@ export class PegasusActor extends Actor {
this.addArmorsShields(rollData, statKey, useShield, subKey) this.addArmorsShields(rollData, statKey, useShield, subKey)
this.addWeapons(rollData, statKey, useShield) this.addWeapons(rollData, statKey, useShield)
this.addEquipments(rollData, statKey) this.addEquipments(rollData, statKey)
this.processVehicleTargetMessage(rollData)
console.log("ROLLDATA", rollData) console.log("ROLLDATA", rollData)
return rollData return rollData
@ -1923,9 +1944,9 @@ 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") { if (this.type == "character") {
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
} else { } else {
diffSize = rollData.defenderSize - this.system.statistics.hr.size diffSize = rollData.defenderSize - this.system.statistics.hr.size
@ -2197,7 +2218,7 @@ export class PegasusActor extends Actor {
} }
} }
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async computeVehicleStats() { async computeVehicleStats() {
@ -2313,8 +2334,8 @@ export class PegasusActor extends Actor {
return return
} }
if ( item.type == "effect" && item.system.droptext && item.system.droptext.length > 0) { if (item.type == "effect" && item.system.droptext && item.system.droptext.length > 0) {
ChatMessage.create( { content: `Effect ${item.name} message : ${item.system.droptext}`}) ChatMessage.create({ content: `Effect ${item.name} message : ${item.system.droptext}` })
} }
//console.log(">>>>> item", item.type, __isVehicleUnique[item.type]) //console.log(">>>>> item", item.type, __isVehicleUnique[item.type])
if (__isVehicleUnique[item.type]) { if (__isVehicleUnique[item.type]) {

View File

@ -253,7 +253,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": "10.1.2", "version": "10.1.3",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.1.2.zip", "download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.1.3.zip",
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp" "background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
} }