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