Fix #51
This commit is contained in:
parent
9fac687030
commit
c0c6231b4c
@ -20,11 +20,14 @@ const __statBuild = [
|
|||||||
{ modules: ["propulsionmodule"], field: "ad", itemfield: "ad" },
|
{ modules: ["propulsionmodule"], field: "ad", itemfield: "ad" },
|
||||||
{ modules: ["combatmodule"], field: "fc", itemfield: "fc" },
|
{ modules: ["combatmodule"], field: "fc", itemfield: "fc" },
|
||||||
]
|
]
|
||||||
|
const __LocationsArmour = ["front", "rear", "bottom", "left", "right", "bottom"]
|
||||||
const __isVehicleUnique = { vehiclehull: 1, powercoremodule: 1, mobilitymodule: 1, propulsionmodule: 1, combatmodule: 1 }
|
const __isVehicleUnique = { vehiclehull: 1, powercoremodule: 1, mobilitymodule: 1, propulsionmodule: 1, combatmodule: 1 }
|
||||||
const __speed2Num = { fullstop: 0, crawling: 1, slow: 2, average: 3, fast: 4, extfast: 5 }
|
const __speed2Num = { fullstop: 0, crawling: 1, slow: 2, average: 3, fast: 4, extfast: 5 }
|
||||||
const __num2speed = ["fullstop", "crawling", "slow", "average", "fast", "extfast"]
|
const __num2speed = ["fullstop", "crawling", "slow", "average", "fast", "extfast"]
|
||||||
const __isVehicle = { vehiclehull: 1, powercoremodule: 1, mobilitymodule: 1, combatmodule: 1,
|
const __isVehicle = {
|
||||||
propulsionmodule: 1, vehiclemodule: 1, vehicleweaponmodule: 1, effect: 1, cargo: 1 }
|
vehiclehull: 1, powercoremodule: 1, mobilitymodule: 1, combatmodule: 1,
|
||||||
|
propulsionmodule: 1, vehiclemodule: 1, vehicleweaponmodule: 1, effect: 1, cargo: 1
|
||||||
|
}
|
||||||
const __isVehicleCargo = { cargo: 1 }
|
const __isVehicleCargo = { cargo: 1 }
|
||||||
const __bonusEffect = {
|
const __bonusEffect = {
|
||||||
name: "Crawling MAN Bonus", type: "effect", img: "systems/fvtt-pegasus-rpg/images/icons/icon_effect.webp",
|
name: "Crawling MAN Bonus", type: "effect", img: "systems/fvtt-pegasus-rpg/images/icons/icon_effect.webp",
|
||||||
@ -2009,6 +2012,7 @@ export class PegasusActor extends Actor {
|
|||||||
if (this.system.statistics.hr.currentlevel == 0) {
|
if (this.system.statistics.hr.currentlevel == 0) {
|
||||||
ChatMessage.create({ content: `The vehicle ${this.name} has been destroyed !` })
|
ChatMessage.create({ content: `The vehicle ${this.name} has been destroyed !` })
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2054,6 +2058,7 @@ export class PegasusActor extends Actor {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Cargo management
|
||||||
if (__isVehicleCargo[item.type]) {
|
if (__isVehicleCargo[item.type]) {
|
||||||
let capacity = this.getCurrentCargoCapacity()
|
let capacity = this.getCurrentCargoCapacity()
|
||||||
if (item.type == "cargo") {
|
if (item.type == "cargo") {
|
||||||
@ -2068,6 +2073,27 @@ export class PegasusActor extends Actor {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Armour management
|
||||||
|
if (item.type == "vehiclemodule" && item.system.category == "armor") {
|
||||||
|
let armorsList = this.items.filter(item => item.type == "vehiclemodule" && item.system.category == "armor") || []
|
||||||
|
armorsList.push(item)
|
||||||
|
let arcKey = item.system.location + "arc"
|
||||||
|
let arc = duplicate(this.system.arcs[arcKey])
|
||||||
|
let level = 0
|
||||||
|
for (let armour of armorsList) {
|
||||||
|
if (armour.system.armourdicevalue > 0) {
|
||||||
|
level += Number(armour.system.armourdicevalue)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//console.log(">>>> AMROR, ", level, arc.armourlevel)
|
||||||
|
if (level != Number(arc.armourlevel)) {
|
||||||
|
arc.armourlevel = level
|
||||||
|
setTimeout(500, this.update({ [`system.arcs.${arcKey}`]: arc }))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -995,7 +995,7 @@ export class PegasusUtility {
|
|||||||
icon: '<i class="fas fa-check"></i>',
|
icon: '<i class="fas fa-check"></i>',
|
||||||
label: "Yes, remove it",
|
label: "Yes, remove it",
|
||||||
callback: () => {
|
callback: () => {
|
||||||
actorSheet.actor.deleteEmbeddedDocuments("Item", [itemId]);
|
actorSheet.actor.deleteEmbeddedDocuments("Item", [itemId])
|
||||||
li.slideUp(200, () => actorSheet.render(false));
|
li.slideUp(200, () => actorSheet.render(false));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user