Rollable damages + protection
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import { BoLDefaultRoll } from "../controllers/bol-rolls.js";
|
||||
|
||||
/**
|
||||
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
|
||||
* @extends {Actor}
|
||||
@ -270,6 +272,27 @@ export class BoLActor extends Actor {
|
||||
return (formula == "") ? 0 :formula;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
rollProtection( itemId) {
|
||||
let armor = this.data.items.get( itemId )
|
||||
if ( armor ) {
|
||||
let armorFormula = armor.data.data.properties.soak.formula;
|
||||
let rollArmor = new Roll(armorFormula)
|
||||
rollArmor.roll( {async: false} ).toMessage();
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
rollWeaponDamage( itemId) {
|
||||
let weapon = this.data.items.get(itemId )
|
||||
if ( weapon ) {
|
||||
console.log("WE", weapon)
|
||||
let r = new BoLDefaultRoll( { id: randomID(16), isSuccess: true, mode: "weapon", weapon: weapon, actor: this} )
|
||||
r.setSuccess(true)
|
||||
r.processResult()
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
toggleEquipItem(item) {
|
||||
const equipable = item.data.data.properties.equipable;
|
||||
|
Reference in New Issue
Block a user