Skip to content

Commit

Permalink
added more parameters for afterCards method
Browse files Browse the repository at this point in the history
  • Loading branch information
Zomis committed May 4, 2015
1 parent 7884810 commit 7831b19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion extra-resources/keyword-noattack.js
Expand Up @@ -7,7 +7,7 @@ keywords.cards.noAttack = function (entity, obj, value) {
noAttackCreatures.add(obj.name);
}

keywords.afterCards.push(function (game) {
keywords.afterCards.push(function (game, cardData, cardEntities) {
var System = Java.type("net.zomis.cardshifter.ecs.usage.DenyActionForNames");
game.addSystem(new System(ATTACK_ACTION, noAttackCreatures));
});
4 changes: 3 additions & 1 deletion extra-resources/keywords.js
Expand Up @@ -22,14 +22,16 @@ function applyEntity(game, card, entity, keyword) {


function applyCardKeywords(game, zone, data) {
var cardEntities = [];
for (var i = 0; i < data.cards.length; i++) {
var card = data.cards[i];
var entity = game.newEntity();
applyEntity(game, card, entity, keywords.cards);
zone.addOnBottom(entity);
cardEntities.push(entity);
}
for (var i = 0; i < keywords.afterCards.length; i++) {
keywords.afterCards[i](game);
keywords.afterCards[i](game, data, cardEntities);
}
}

Expand Down

0 comments on commit 7831b19

Please sign in to comment.