ENH: Weapon attack

master
U~man 2020-07-03 23:16:47 +02:00
parent 7be97146c2
commit 72c96d1df5
2 changed files with 16 additions and 1 deletions

View File

@ -42,7 +42,7 @@
"OSE.scores.cha.long": "Charisma",
"OSE.scores.cha.short": "CHA",
"OSE.SavingThrow": "Saving Throw",
"OSE.SavingThrow": "Save",
"OSE.saves.death.short": "D",
"OSE.saves.death.long": "Death, Poison",
"OSE.saves.wand.short": "W",

View File

@ -42,11 +42,26 @@ export class OseItem extends Item {
return data;
}
rollWeapon() {
if (this.data.data.missile) {
this.actor.rollAttack('Missile');
return true;
} else if (this.data.data.melee) {
this.actor.rollAttack('Melee');
return true;
}
return false;
}
/**
* Roll the item to Chat, creating a chat card which contains follow up attack or damage roll options
* @return {Promise}
*/
async roll({ configureDialog = true } = {}) {
console.log(this.data)
if (this.data.type == 'weapon') {
if (this.rollWeapon()) return;
}
// Basic template rendering data
const token = this.actor.token;
const templateData = {