Add crafting skills

This commit is contained in:
2023-01-24 20:26:59 +01:00
parent 108cda292e
commit 57dc0505cc
11 changed files with 118 additions and 5 deletions

View File

@@ -176,7 +176,12 @@ export class Avd12Actor extends Actor {
Avd12Utility.sortArrayObjectsByName(comp)
return comp;
}
/* -------------------------------------------- */
getCraftingSkills() {
let comp = duplicate(this.items.filter(item => item.type == 'craftingskill') || [])
Avd12Utility.sortArrayObjectsByName(comp)
return comp;
}
/* -------------------------------------------- */
getArmors() {
let comp = duplicate(this.items.filter(item => item.type == 'armor') || []);
@@ -705,7 +710,20 @@ export class Avd12Actor extends Actor {
console.log("New fovcus", this.system, focusData)
this.update({ 'system.focus': focusData })
}
/* -------------------------------------------- */
rollCrafting(craftId) {
let crafting = this.items.get(craftId)
if (crafting) {
crafting = duplicate(crafting)
let rollData = this.getCommonRollData()
rollData.mode = "crafting"
rollData.crafting = crafting
rollData.img = crafting.img
this.startRoll(rollData)
} else {
ui.notifications.warn("Unable to find the relevant weapon ")
}
}
/* -------------------------------------------- */
rollWeapon(weaponId) {
let weapon = this.items.get(weaponId)
@@ -722,6 +740,7 @@ export class Avd12Actor extends Actor {
ui.notifications.warn("Unable to find the relevant weapon ")
}
}
/* -------------------------------------------- */
async rollWeaponDamage(weaponId, damageType) {
let weapon = this.items.get(weaponId)