The played cards from ChooseAndPlayCard... effects now gets notified of the fact AFTER it hits play.
This commit is contained in:
@@ -53,9 +53,6 @@ public class ChooseAndPlayCardFromHandEffect implements Effect {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void cardPlayed(PhysicalCard cardPlayed) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<? extends EffectResult> playEffect(final LotroGame game) {
|
||||
Collection<PhysicalCard> playableInHand = getPlayableInHandCards(game);
|
||||
@@ -70,7 +67,7 @@ public class ChooseAndPlayCardFromHandEffect implements Effect {
|
||||
new UnrespondableEffect() {
|
||||
@Override
|
||||
protected void doPlayEffect(LotroGame game) {
|
||||
cardPlayed(selectedCard);
|
||||
afterCardPlayed(selectedCard);
|
||||
}
|
||||
});
|
||||
game.getActionsEnvironment().addActionToStack(_playCardAction);
|
||||
@@ -80,6 +77,9 @@ public class ChooseAndPlayCardFromHandEffect implements Effect {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void afterCardPlayed(PhysicalCard cardPlayed) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wasSuccessful() {
|
||||
if (_playCardAction == null)
|
||||
|
||||
@@ -72,7 +72,7 @@ public class ChooseAndPlayCardFromStackedEffect implements Effect {
|
||||
new UnrespondableEffect() {
|
||||
@Override
|
||||
protected void doPlayEffect(LotroGame game) {
|
||||
cardPlayed(selectedCard);
|
||||
afterCardPlayed(selectedCard);
|
||||
}
|
||||
});
|
||||
game.getActionsEnvironment().addActionToStack(_playCardAction);
|
||||
@@ -83,7 +83,7 @@ public class ChooseAndPlayCardFromStackedEffect implements Effect {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void cardPlayed(PhysicalCard cardPlayed) {
|
||||
protected void afterCardPlayed(PhysicalCard cardPlayed) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -43,7 +43,7 @@ public class Card4_009 extends AbstractMinion {
|
||||
action.appendEffect(
|
||||
new ChooseAndPlayCardFromHandEffect(playerId, game.getGameState().getHand(playerId), -2, Filters.and(Filters.culture(Culture.DUNLAND), Filters.race(Race.MAN))) {
|
||||
@Override
|
||||
protected void cardPlayed(PhysicalCard cardPlayed) {
|
||||
protected void afterCardPlayed(PhysicalCard cardPlayed) {
|
||||
action.appendEffect(
|
||||
new AddUntilStartOfPhaseModifierEffect(
|
||||
new KeywordModifier(self, Filters.sameCard(cardPlayed), Keyword.FIERCE), Phase.REGROUP));
|
||||
|
||||
@@ -43,7 +43,7 @@ public class Card4_023 extends AbstractMinion {
|
||||
action.appendEffect(
|
||||
new ChooseAndPlayCardFromHandEffect(playerId, game.getGameState().getHand(playerId), -2, Filters.and(Filters.culture(Culture.DUNLAND), Filters.race(Race.MAN))) {
|
||||
@Override
|
||||
protected void cardPlayed(PhysicalCard cardPlayed) {
|
||||
protected void afterCardPlayed(PhysicalCard cardPlayed) {
|
||||
action.appendEffect(
|
||||
new AddUntilStartOfPhaseModifierEffect(
|
||||
new KeywordModifier(self, Filters.sameCard(cardPlayed), Keyword.FIERCE), Phase.REGROUP));
|
||||
|
||||
@@ -43,7 +43,7 @@ public class Card4_038 extends AbstractMinion {
|
||||
action.appendEffect(
|
||||
new ChooseAndPlayCardFromHandEffect(playerId, game.getGameState().getHand(playerId), -2, Filters.and(Filters.culture(Culture.DUNLAND), Filters.race(Race.MAN))) {
|
||||
@Override
|
||||
protected void cardPlayed(PhysicalCard cardPlayed) {
|
||||
protected void afterCardPlayed(PhysicalCard cardPlayed) {
|
||||
action.appendEffect(
|
||||
new AddUntilStartOfPhaseModifierEffect(
|
||||
new KeywordModifier(self, Filters.sameCard(cardPlayed), Keyword.FIERCE), Phase.REGROUP));
|
||||
|
||||
@@ -43,7 +43,7 @@ public class Card6_006 extends AbstractMinion {
|
||||
action.appendEffect(
|
||||
new ChooseAndPlayCardFromHandEffect(playerId, game.getGameState().getHand(playerId), Filters.and(Filters.culture(Culture.DUNLAND), Filters.race(Race.MAN))) {
|
||||
@Override
|
||||
protected void cardPlayed(PhysicalCard cardPlayed) {
|
||||
protected void afterCardPlayed(PhysicalCard cardPlayed) {
|
||||
action.appendEffect(
|
||||
new AddUntilStartOfPhaseModifierEffect(
|
||||
new KeywordModifier(self, Filters.sameCard(cardPlayed), Keyword.FIERCE), Phase.REGROUP));
|
||||
|
||||
@@ -40,7 +40,7 @@ public class Card6_105 extends AbstractPermanent {
|
||||
action.appendEffect(
|
||||
new ChooseAndPlayCardFromHandEffect(playerId, game.getGameState().getHand(playerId), -4, CardType.MINION, Filters.or(Race.NAZGUL, Culture.SAURON)) {
|
||||
@Override
|
||||
protected void cardPlayed(PhysicalCard cardPlayed) {
|
||||
protected void afterCardPlayed(PhysicalCard cardPlayed) {
|
||||
action.appendEffect(
|
||||
new ExhaustCharacterEffect(self, action, cardPlayed));
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class Card6_084 extends AbstractPermanent {
|
||||
action.appendEffect(
|
||||
new ChooseAndPlayCardFromHandEffect(playerId, game.getGameState().getHand(playerId), -8, CardType.MINION, Filters.or(Culture.WRAITH, Culture.SAURON)) {
|
||||
@Override
|
||||
protected void cardPlayed(PhysicalCard cardPlayed) {
|
||||
protected void afterCardPlayed(PhysicalCard cardPlayed) {
|
||||
action.appendEffect(
|
||||
new ExhaustCharacterEffect(self, action, cardPlayed));
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class Card7_274 extends AbstractMinion {
|
||||
action.appendEffect(
|
||||
new ChooseAndPlayCardFromStackedEffect(playerId, Filters.siteControlled(playerId), Culture.SAURON, Race.ORC) {
|
||||
@Override
|
||||
protected void cardPlayed(PhysicalCard cardPlayed) {
|
||||
protected void afterCardPlayed(PhysicalCard cardPlayed) {
|
||||
action.appendEffect(
|
||||
new AddUntilStartOfPhaseModifierEffect(
|
||||
new StrengthModifier(self, cardPlayed, 6), Phase.REGROUP));
|
||||
|
||||
Reference in New Issue
Block a user