1
0
mirror of https://github.com/exane/not-gwent-online synced 2024-12-23 21:03:14 +00:00
This commit is contained in:
exane 2015-06-18 20:47:17 +02:00
parent 9f5028741e
commit 164d6da97e
2 changed files with 17 additions and 3 deletions

View File

@ -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;
}

View File

@ -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(){