diff --git a/rpg-docs/client/views/character/attacks/attackEditList/attackEditList.js b/rpg-docs/client/views/character/attacks/attackEditList/attackEditList.js index 207f8777..dce97c32 100644 --- a/rpg-docs/client/views/character/attacks/attackEditList/attackEditList.js +++ b/rpg-docs/client/views/character/attacks/attackEditList/attackEditList.js @@ -7,12 +7,32 @@ Template.attackEditList.helpers({ Template.attackEditList.events({ "tap #addAttackButton": function() { + if (typeof this.isSpell !== 'undefined' && this.isSpell) { + var parentSpell = Spells.findOne({"_id": this.parentId}) + if (parentSpell && parentSpell.parent.collection == "SpellLists") { + var spellList = SpellLists.findOne({"_id":parentSpell.parent.id}); + if (spellList && spellList.attackBonus) { + Attacks.insert({ + charId: this.charId, + parent: { + id: this.parentId, + collection: this.parentCollection + }, + attackBonus: spellList.attackBonus, + damage: "1d10", + damageType: "fire", + }); + return; + } + } + } + Attacks.insert({ charId: this.charId, parent: { id: this.parentId, collection: this.parentCollection - } + }, }); }, }); diff --git a/rpg-docs/client/views/character/spells/spellDialog/spellDialog.html b/rpg-docs/client/views/character/spells/spellDialog/spellDialog.html index 7de0fdd8..d2d77854 100644 --- a/rpg-docs/client/views/character/spells/spellDialog/spellDialog.html +++ b/rpg-docs/client/views/character/spells/spellDialog/spellDialog.html @@ -38,6 +38,7 @@