Fix #89 agitators hindrance
This commit is contained in:
parent
ef740f4c0d
commit
5a062cc94e
@ -2025,6 +2025,13 @@ 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 {
|
||||
@ -2299,7 +2306,6 @@ export class PegasusActor extends Actor {
|
||||
return crew
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
addCrew(actorId) {
|
||||
if (this.system.crew.length >= this.system.crewmax) {
|
||||
ui.notifications.warn("Vehicle crew is already full.")
|
||||
@ -2309,11 +2315,13 @@ export class PegasusActor extends Actor {
|
||||
crewList.push({ id: actorId })
|
||||
this.update({ 'system.crew': crewList })
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
delCrew(actorId) {
|
||||
let crewList = duplicate(this.system.crew.filter(actorDef => actorDef.id != actorId) || [])
|
||||
this.update({ 'system.crew': crewList })
|
||||
}
|
||||
inCrew(actorId) {
|
||||
return this.system.crew.find(member => member.id == actorId)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
isVehicleFullStop() {
|
||||
|
@ -1027,7 +1027,12 @@ export class PegasusUtility {
|
||||
if (target) {
|
||||
let defenderActor = target.actor
|
||||
rollData.defenderTokenId = target.id
|
||||
rollData.defenderSize = 0
|
||||
if ( defenderActor.type == "character") {
|
||||
rollData.defenderSize = Number(defenderActor.system.biodata.sizenum) + Number(defenderActor.system.biodata.sizebonus)
|
||||
} else if ( defenderActor.type == "vehicle" ){
|
||||
rollData.defenderSize = Number(defenderActor.system.statistics.hr.size)
|
||||
}
|
||||
//rollData.attackerId = this.id
|
||||
console.log("Target/DEFENDER", defenderActor)
|
||||
defenderActor.addHindrancesList(rollData.effectsList)
|
||||
@ -1068,31 +1073,14 @@ export class PegasusUtility {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static glowToken(token) {
|
||||
let params =
|
||||
[{
|
||||
filterType: "glow",
|
||||
filterId: "superSpookyGlow",
|
||||
outerStrength: 15,
|
||||
innerStrength: 0,
|
||||
color: 0x6AAB8E,
|
||||
quality: 0.5,
|
||||
padding: 40,
|
||||
autoDestroy: true,
|
||||
animated:
|
||||
{
|
||||
color:
|
||||
{
|
||||
active: true,
|
||||
loopDuration: 3000,
|
||||
loops: 2,
|
||||
animType: "colorOscillation",
|
||||
val1: 0x6AAB8E,
|
||||
val2: 0x66FF33
|
||||
static checkIsVehicleCrew(actorId) {
|
||||
let vehicles = game.actors.filter( actor=> actor.type =="vehicle") || []
|
||||
for(let vehicle of vehicles) {
|
||||
if ( vehicle.inCrew(actorId) ) {
|
||||
return vehicle
|
||||
}
|
||||
}
|
||||
}]
|
||||
TokenMagic.addUpdateFilters(token, params)
|
||||
return false
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
Loading…
Reference in New Issue
Block a user