Various enhancements

This commit is contained in:
2022-02-23 20:39:58 +01:00
parent f63692b6b5
commit eacd32927c
18 changed files with 562 additions and 475 deletions

View File

@ -3,6 +3,7 @@
* @extends {ActorSheet}
*/
import {BoLRoll} from "../controllers/bol-rolls.js";
import { BoLUtility } from "../system/bol-utility.js";
export class BoLActorSheet extends ActorSheet {
@ -34,7 +35,7 @@ export class BoLActorSheet extends ActorSheet {
const li = $(ev.currentTarget).parents(".item");
const item = this.actor.items.get(li.data("itemId"));
item.sheet.render(true);
});
})
// Equip/Unequip item
html.find('.item-equip').click(this._onToggleEquip.bind(this));
@ -135,12 +136,13 @@ export class BoLActorSheet extends ActorSheet {
formData.vehicles = this.actor.vehicles;
formData.ammos = this.actor.ammos;
formData.misc = this.actor.misc;
formData.combat = this.actor.buildCombat();
formData.combat = this.actor.buildCombat()
formData.features = this.actor.buildFeatures()
formData.isGM = game.user.isGM
formData.options= this.options
formData.owner= this.document.isOwner
formData.editScore= this.options.editScore
formData.useBougette = BoLUtility.getUseBougette()
formData.isSorcerer = this.actor.isSorcerer()
formData.isAlchemist = this.actor.isAlchemist()

View File

@ -10,10 +10,7 @@ export class BoLActor extends Actor {
/** @override */
prepareData() {
const actorData = this.data;
// console.log(actorData);
// const data = actorData.data;
// const flags = actorData.flags;
// Make separate methods for each Actor type (character, npc, etc.) to keep things organized.
if (actorData.type === 'character') {
actorData.type = 'player';
actorData.villainy = false;
@ -356,7 +353,19 @@ export class BoLActor extends Actor {
if ( protect.data.subtype == 'helm') {
formula += "+1"
} else if ( protect.data.subtype == 'armor') {
formula += "+" + protect.data.properties.soak.formula;
if ( BoLUtility.this.getRollArmor() ) {
if ( !protect.data.properties.soak.formula || protect.data.properties.soak.formula=="") {
ui.notifications.warn(`L'armure ${protect.name} n'a pas de formule pour la protection !`)
} else {
formula += "+" + protect.data.properties.soak.formula
}
} else {
if ( protect.data.properties.soak.value == undefined ) {
ui.notifications.warn(`L'armure ${protect.name} n'a pas de valeur fixe pour la protection !`)
} else {
formula += "+ " + protect.data.properties.soak.value
}
}
}
}
console.log("Protect Formula", formula)