Ajout creatures

This commit is contained in:
2022-04-10 16:38:09 +02:00
parent 477c86db0e
commit 45e239b8e9
4 changed files with 43 additions and 5 deletions

View File

@ -120,6 +120,7 @@ export class BoLActorSheet extends ActorSheet {
formData.aptitudes = this.actor.aptitudes
formData.resources = this.actor.getResourcesFromType()
formData.equipment = this.actor.equipment
formData.equipmentCreature = this.actor.equipmentCreature
formData.weapons = this.actor.weapons
formData.protections = this.actor.protections
formData.spells = this.actor.spells
@ -132,6 +133,7 @@ export class BoLActorSheet extends ActorSheet {
formData.ammos = this.actor.ammos
formData.misc = this.actor.misc
formData.combat = this.actor.buildCombat()
formData.combatCreature = this.actor.buildCombatCreature()
formData.features = this.actor.buildFeatures()
formData.isGM = game.user.isGM
formData.options = this.options

View File

@ -218,6 +218,9 @@ export class BoLActor extends Actor {
get equipment() {
return this.itemData.filter(i => i.type === "item")
}
get equipmentCreature() {
return this.itemData.filter(i => i.type === "item" && i.data.category === "equipment" && (( i.data.subtype === "weapon" && i.data.properties.natural === true) || (i.data.subtype === "armor")) )
}
get armors() {
return this.itemData.filter(i => i.type === "item" && i.data.category === "equipment" && i.data.subtype === "armor");
}
@ -243,6 +246,9 @@ export class BoLActor extends Actor {
get melee() {
return this.weapons.filter(i => i.data.properties.melee === true);
}
get natural() {
return this.weapons.filter(i => i.data.properties.natural === true);
}
get ranged() {
return this.weapons.filter(i => i.data.properties.ranged === true);
}
@ -488,6 +494,29 @@ export class BoLActor extends Actor {
}
}
buildCombatCreature() {
return {
"natural": {
"label": "BOL.combatCategory.natural",
"weapon": true,
"protection": false,
"blocking": false,
"ranged": false,
"options": false,
"items": this.natural
},
"protections": {
"label": "BOL.combatCategory.protections",
"weapon": false,
"protection": true,
"blocking": false,
"ranged": false,
"options": false,
"items": this.protections
},
}
}
/*-------------------------------------------- */
buildRollList() {
let rolls = []