Adding effect to "Goblin Armory" for testing the animations.

This commit is contained in:
marcins78@gmail.com
2011-09-21 10:48:41 +00:00
parent 0b48bda665
commit 178f5723b8
2 changed files with 24 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
package com.gempukku.lotro.cards.effects;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.timing.UnrespondableEffect;
public class CardAffectsCardEffect extends UnrespondableEffect {
private PhysicalCard _card;
private PhysicalCard _affectedCard;
public CardAffectsCardEffect(PhysicalCard card, PhysicalCard affectedCard) {
_card = card;
_affectedCard = affectedCard;
}
@Override
protected void doPlayEffect(LotroGame game) {
game.getGameState().cardAffectsCard(_card, _affectedCard);
}
}

View File

@@ -3,6 +3,7 @@ package com.gempukku.lotro.cards.set1.moria;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddTwilightEffect;
import com.gempukku.lotro.cards.effects.CardAffectsCardEffect;
import com.gempukku.lotro.cards.effects.PreventWoundEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
@@ -45,7 +46,7 @@ public class Card1_173 extends AbstractPermanent {
}
@Override
public List<? extends Action> getOptionalBeforeActions(String playerId, LotroGame game, final Effect effect, PhysicalCard self) {
public List<? extends Action> getOptionalBeforeActions(String playerId, LotroGame game, final Effect effect, final PhysicalCard self) {
if (effect.getType() == EffectResult.Type.WOUND) {
final WoundCharacterEffect woundEffect = (WoundCharacterEffect) effect;
final List<PhysicalCard> cardsToBeWounded = woundEffect.getCardsToBeWounded(game);
@@ -57,6 +58,8 @@ public class Card1_173 extends AbstractPermanent {
new ChooseActiveCardEffect(playerId, "Choose MORIA Orc", Filters.culture(Culture.MORIA), Filters.race(Race.ORC), Filters.in(cardsToBeWounded)) {
@Override
protected void cardSelected(PhysicalCard moriaOrc) {
action.addEffect(
new CardAffectsCardEffect(self, moriaOrc));
action.addEffect(
new PreventWoundEffect(woundEffect, moriaOrc));
}