diff --git a/server/Battleside.js b/server/Battleside.js index 9047ea8..5a9f8a3 100644 --- a/server/Battleside.js +++ b/server/Battleside.js @@ -256,12 +256,19 @@ Battleside = (function(){ return 1; } - r.checkAbilities = function(card, obj){ + r.checkAbilities = function(card, obj, __flag){ var self = this; obj.targetSide = this; + var ability = Array.isArray(__flag) || card.getAbility(); + if(Array.isArray(ability) && ability.length){ + var ret = ability.slice(); + ret = ret.splice(0, 1); + this.checkAbilities(card, obj, ret); + ability = ability[0]; + } - if(card.getAbility()){ - var ability = card.getAbility(); + if(ability && !Array.isArray(ability)){/* + var ability = card.getAbility();*/ if(ability.changeSide){ obj.targetSide = this.foe; } diff --git a/server/Card.js b/server/Card.js index a096643..5a122ad 100644 --- a/server/Card.js +++ b/server/Card.js @@ -76,6 +76,13 @@ var Card = (function(){ return this._data.ability; } r.getAbility = function(){ + if(Array.isArray(this._data.ability)) { + var res = []; + this._data.ability.forEach(function(ability) { + res.push(AbilityData[ability]); + }) + return res; + } return AbilityData[this._data.ability]; } r.getImage = function(){