|
|
|
@ -811,9 +811,11 @@ export class PegasusActor extends Actor {
|
|
|
|
|
ChatMessage.create({ content: "Effects of this type cannot be applied while Immunity is applied" })
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (item.system.droptext && item.system.droptext.length > 0) {
|
|
|
|
|
ChatMessage.create({ content: `Effect ${item.name} message : ${item.system.droptext}` })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (item.type == 'race') {
|
|
|
|
|
this.applyRace(item)
|
|
|
|
|
} else if (item.type == 'role') {
|
|
|
|
@ -912,12 +914,16 @@ export class PegasusActor extends Actor {
|
|
|
|
|
getStat(statKey) {
|
|
|
|
|
let stat
|
|
|
|
|
if (this.type == "character" && statKey == 'mr') {
|
|
|
|
|
stat = duplicate(this.system.mr);
|
|
|
|
|
stat = duplicate(this.system.mr)
|
|
|
|
|
} else {
|
|
|
|
|
stat = duplicate(this.system.statistics[statKey]);
|
|
|
|
|
stat = duplicate(this.system.statistics[statKey])
|
|
|
|
|
}
|
|
|
|
|
stat.dice = PegasusUtility.getDiceFromLevel(stat.value || stat.level);
|
|
|
|
|
return stat;
|
|
|
|
|
if (stat.currentlevel) {
|
|
|
|
|
stat.dice = PegasusUtility.getDiceFromLevel(stat.currentlevel)
|
|
|
|
|
} else {
|
|
|
|
|
stat.dice = PegasusUtility.getDiceFromLevel(stat.value || stat.level)
|
|
|
|
|
}
|
|
|
|
|
return stat
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
@ -1804,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) {
|
|
|
|
|
let rollData = PegasusUtility.getBasicRollData(isInit)
|
|
|
|
@ -1828,8 +1855,12 @@ export class PegasusActor extends Actor {
|
|
|
|
|
rollData.stat = this.getStat(statKey)
|
|
|
|
|
if (rollData.stat.value != undefined) {
|
|
|
|
|
rollData.stat.level = rollData.stat.value // Normalize
|
|
|
|
|
rollData.statDicesLevel = rollData.stat.level + rollData.stat.bonuseffect
|
|
|
|
|
}
|
|
|
|
|
if (rollData.stat.currentlevel) {
|
|
|
|
|
rollData.stat.level = rollData.stat.currentlevel
|
|
|
|
|
rollData.statDicesLevel = rollData.stat.currentlevel
|
|
|
|
|
}
|
|
|
|
|
rollData.statDicesLevel = rollData.stat.level + rollData.stat.bonuseffect
|
|
|
|
|
rollData.statMod = rollData.stat.mod
|
|
|
|
|
if (vehicle) {
|
|
|
|
|
rollData.vehicle = duplicate(vehicle)
|
|
|
|
@ -1859,8 +1890,6 @@ export class PegasusActor extends Actor {
|
|
|
|
|
vehicle.addVehicleShields(rollData)
|
|
|
|
|
}
|
|
|
|
|
vehicle.addEffects(rollData, false, false, false)
|
|
|
|
|
//this.addVehiculeHindrances(rollData.effectsList, vehicle)
|
|
|
|
|
//this.addVehicleBonus(rollData, vehicle)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rollData.specList = this.getRelevantSpec(statKey)
|
|
|
|
@ -1904,6 +1933,8 @@ export class PegasusActor extends Actor {
|
|
|
|
|
this.addArmorsShields(rollData, statKey, useShield, subKey)
|
|
|
|
|
this.addWeapons(rollData, statKey, useShield)
|
|
|
|
|
this.addEquipments(rollData, statKey)
|
|
|
|
|
this.processVehicleTargetMessage(rollData)
|
|
|
|
|
|
|
|
|
|
console.log("ROLLDATA", rollData)
|
|
|
|
|
|
|
|
|
|
return rollData
|
|
|
|
@ -1912,7 +1943,14 @@ export class PegasusActor extends Actor {
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
processSizeBonus(rollData) {
|
|
|
|
|
if (rollData.defenderTokenId) {
|
|
|
|
|
let diffSize = rollData.defenderSize - this.system.biodata.sizenum + this.system.biodata.sizebonus
|
|
|
|
|
let diffSize = 0
|
|
|
|
|
if (this.type == "character") {
|
|
|
|
|
this.system.biodata.sizenum = this.system.biodata?.sizenum ?? 0
|
|
|
|
|
this.system.biodata.sizebonus = this.system.biodata?.sizebonus ?? 0
|
|
|
|
|
diffSize = rollData.defenderSize - this.system.biodata.sizenum + this.system.biodata.sizebonus
|
|
|
|
|
} else {
|
|
|
|
|
diffSize = rollData.defenderSize - this.system.statistics.hr.size
|
|
|
|
|
}
|
|
|
|
|
//console.log("Diffsize", diffSize)
|
|
|
|
|
if (rollData.subKey == "melee-atk" || rollData.subKey == "ranged-atk") {
|
|
|
|
|
if (diffSize > 0) {
|
|
|
|
@ -2009,7 +2047,7 @@ export class PegasusActor extends Actor {
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------- */
|
|
|
|
|
rollStat(statKey) {
|
|
|
|
|
let stat = this.getStat(statKey);
|
|
|
|
|
let stat = this.getStat(statKey)
|
|
|
|
|
if (stat) {
|
|
|
|
|
let rollData = this.getCommonRollData(statKey)
|
|
|
|
|
rollData.mode = "stat"
|
|
|
|
@ -2180,7 +2218,7 @@ export class PegasusActor extends Actor {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
async computeVehicleStats() {
|
|
|
|
|
|
|
|
|
@ -2296,6 +2334,9 @@ export class PegasusActor extends Actor {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item.type == "effect" && item.system.droptext && item.system.droptext.length > 0) {
|
|
|
|
|
ChatMessage.create({ content: `Effect ${item.name} message : ${item.system.droptext}` })
|
|
|
|
|
}
|
|
|
|
|
//console.log(">>>>> item", item.type, __isVehicleUnique[item.type])
|
|
|
|
|
if (__isVehicleUnique[item.type]) {
|
|
|
|
|
let toDelList = []
|
|
|
|
|