diff --git a/modules/pegasus-actor.js b/modules/pegasus-actor.js index 18526e7..180e6e6 100644 --- a/modules/pegasus-actor.js +++ b/modules/pegasus-actor.js @@ -1868,6 +1868,28 @@ export class PegasusActor extends Actor { } } + if ( statKey == "mr" ) { + if ( this.type == "character") { + rollData.mrVehicle = PegasusUtility.checkIsVehicleCrew(this.id) + if (rollData.mrVehicle) { + rollData.effectsList.push({ + label: `Vehicle ${rollData.mrVehicle.name} MR Bonus`, + type: "effect", applied: false, isdynamic: true, value: rollData.mrVehicle.system.statistics.mr.currentlevel + }) + } + } + if ( this.type == "vehicle") { + for(let member of this.system.crew) { + let actor = game.actors.get( member.id ) + let specList = actor.getRelevantSpec("mr") + rollData.effectsList.push({ + label: `Crew ${actor.name} MR Bonus`, + type: "effect", applied: false, isdynamic: true, value: actor.system.mr.value + actor.system.mr.bonuseffect, specList: specList + }) + } + } + } + this.processSizeBonus(rollData) this.addEffects(rollData, isInit, isPower, subKey == "power-dmg") this.addArmorsShields(rollData, statKey, useShield, subKey) @@ -2025,13 +2047,6 @@ export class PegasusActor extends Actor { console.log("MR ROLL", rollData) if (isInit) { rollData.title = "MR / Initiative" - rollData.mrVehicle = PegasusUtility.checkIsVehicleCrew(this.id) - if (rollData.mrVehicle) { - rollData.effectsList.push({ - label: `Vehicle ${rollData.mrVehicle.name} MR Bonus`, - type: "effect", applied: false, isdynamic: true, value: rollData.mrVehicle.system.mr.currentlevel - }) - } } this.startRoll(rollData); } else { diff --git a/modules/pegasus-roll-dialog.js b/modules/pegasus-roll-dialog.js index c0315bb..35e531e 100644 --- a/modules/pegasus-roll-dialog.js +++ b/modules/pegasus-roll-dialog.js @@ -90,6 +90,9 @@ export class PegasusRollDialog extends Dialog { PegasusUtility.updateDamageDicePool(this.rollData) PegasusUtility.updateEffectsBonusDice(this.rollData) PegasusUtility.updateHindranceBonusDice(this.rollData) + if ( effect.specList) { + this.rollData.specList = duplicate(effect.specList) + } } /* -------------------------------------------- */ diff --git a/modules/pegasus-utility.js b/modules/pegasus-utility.js index 04703fe..67604bf 100644 --- a/modules/pegasus-utility.js +++ b/modules/pegasus-utility.js @@ -1074,8 +1074,9 @@ export class PegasusUtility { /* -------------------------------------------- */ 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) { + console.log("Checking", vehicle.name) if ( vehicle.inCrew(actorId) ) { return vehicle }