1
0
mirror of https://github.com/exane/not-gwent-online synced 2024-11-27 03:46:54 +00:00
not-gwent-online/assets/data/abilities.js

123 lines
3.0 KiB
JavaScript
Raw Normal View History

2015-06-13 19:36:02 +00:00
module.exports = {
"agile": {
},
"medic": {
},
"morale_boost": {
onAfterPlace: function(card) {
2015-06-14 18:50:53 +00:00
var field = this.field[card.getType()];
var cards = field.get();
2015-06-13 19:36:02 +00:00
cards.forEach(function(_card) {
2015-06-14 18:50:53 +00:00
if(_card.getID() == card.getID()) return;
2015-06-13 19:36:02 +00:00
_card.boost(1);
})
}
},
"muster": {
onAfterPlace: function(card){
var name = card.getName();
var self = this;
2015-06-14 18:50:53 +00:00
var cards = this.deck.find("name", name);
2015-06-13 19:36:02 +00:00
cards.forEach(function(_card) {
2015-06-14 18:50:53 +00:00
self.deck.removeFromDeck(_card);
this.placeCard(_card);
2015-06-13 19:36:02 +00:00
})
}
},
"tight_bond": {
onAfterPlace: function(card){
2015-06-14 18:50:53 +00:00
var field = this.field[card.getType()];
var cards = field.get();
2015-06-13 19:36:02 +00:00
var lastInsert = cards.length;
if(lastInsert < 2) return;
if(cards[lastInsert - 2].getName() == cards[lastInsert - 1].getName()){
cards[lastInsert - 2].boost(+cards[lastInsert - 2].getPower());
cards[lastInsert - 1].boost(+cards[lastInsert - 1].getPower());
}
}
},
"spy": {
changeSide: true,
onAfterPlace: function(card){
2015-06-14 18:50:53 +00:00
this.draw(2);
2015-06-13 19:36:02 +00:00
}
},
"weather_fog": {
onEachTurn: function(card) {
var targetRow = card.constructor.TYPE.RANGED;
var forcedPower = 1;
2015-06-14 18:50:53 +00:00
var field1 = this.field[targetRow].get();
var field2 = this.foe.field[targetRow].get();
2015-06-13 19:36:02 +00:00
var field = field1.concat(field2);
field.forEach(function(_card) {
if(_card.getRawAbility() == "hero") return;
_card.setForcedPower(forcedPower);
});
2015-06-14 18:50:53 +00:00
},
onEachCardPlace: function(card) {
var targetRow = card.constructor.TYPE.RANGED;
var forcedPower = 1;
var field1 = this.field[targetRow].get();
var field2 = this.foe.field[targetRow].get();
var field = field1.concat(field2);
2015-06-13 19:36:02 +00:00
2015-06-14 18:50:53 +00:00
field.forEach(function(_card) {
if(_card.getRawAbility() == "hero") return;
_card.setForcedPower(forcedPower);
});
2015-06-13 19:36:02 +00:00
}
},
"weather_rain": {
onEachTurn: function(card) {
var targetRow = card.constructor.TYPE.SIEGE;
var forcedPower = 1;
2015-06-14 18:50:53 +00:00
var field1 = this.field[targetRow].get();
var field2 = this.foe.field[targetRow].get();
2015-06-13 19:36:02 +00:00
var field = field1.concat(field2);
field.forEach(function(_card) {
if(_card.getRawAbility() == "hero") return;
_card.setForcedPower(forcedPower);
});
}
},
"weather_frost": {
onEachTurn: function(card) {
var targetRow = card.constructor.TYPE.CLOSE_COMBAT;
var forcedPower = 1;
2015-06-14 18:50:53 +00:00
var field1 = this.field[targetRow].get();
var field2 = this.foe.field[targetRow].get();
2015-06-13 19:36:02 +00:00
var field = field1.concat(field2);
field.forEach(function(_card) {
if(_card.getRawAbility() == "hero") return;
_card.setForcedPower(forcedPower);
});
}
},
"clear_weather": {
onAfterPlace: function(card) {
var targetRow = card.constructor.TYPE.WEATHER;
2015-06-14 18:50:53 +00:00
var field = this.field[targetRow].get();
2015-06-13 19:36:02 +00:00
//todo: remove weather cards
}
},
"decoy": {
replaceWith: true
}
}