ENH: Weapon attack
parent
7be97146c2
commit
72c96d1df5
|
@ -42,7 +42,7 @@
|
||||||
"OSE.scores.cha.long": "Charisma",
|
"OSE.scores.cha.long": "Charisma",
|
||||||
"OSE.scores.cha.short": "CHA",
|
"OSE.scores.cha.short": "CHA",
|
||||||
|
|
||||||
"OSE.SavingThrow": "Saving Throw",
|
"OSE.SavingThrow": "Save",
|
||||||
"OSE.saves.death.short": "D",
|
"OSE.saves.death.short": "D",
|
||||||
"OSE.saves.death.long": "Death, Poison",
|
"OSE.saves.death.long": "Death, Poison",
|
||||||
"OSE.saves.wand.short": "W",
|
"OSE.saves.wand.short": "W",
|
||||||
|
|
|
@ -42,11 +42,26 @@ export class OseItem extends Item {
|
||||||
return data;
|
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
|
* Roll the item to Chat, creating a chat card which contains follow up attack or damage roll options
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
async roll({ configureDialog = true } = {}) {
|
async roll({ configureDialog = true } = {}) {
|
||||||
|
console.log(this.data)
|
||||||
|
if (this.data.type == 'weapon') {
|
||||||
|
if (this.rollWeapon()) return;
|
||||||
|
}
|
||||||
// Basic template rendering data
|
// Basic template rendering data
|
||||||
const token = this.actor.token;
|
const token = this.actor.token;
|
||||||
const templateData = {
|
const templateData = {
|
||||||
|
|
Loading…
Reference in New Issue