Fixed issues with not delayed effect resolution
This commit is contained in:
@@ -30,7 +30,7 @@ public class AddBurden implements EffectAppenderProducer {
|
||||
MultiEffectAppender result = new MultiEffectAppender();
|
||||
|
||||
result.addEffectAppender(
|
||||
new AbstractEffectAppender() {
|
||||
new DelayedAppender() {
|
||||
@Override
|
||||
protected Effect createEffect(CostToEffectAction action, String playerId, LotroGame game, PhysicalCard self, EffectResult effectResult, Effect effect) {
|
||||
final String playerAddingBurden = playerSource.getPlayer(playerId, game, self, effectResult, effect);
|
||||
|
||||
@@ -21,7 +21,7 @@ public class AddTwilight implements EffectAppenderProducer {
|
||||
|
||||
final int amount = FieldUtils.getInteger(effectObject.get("amount"), "amount");
|
||||
|
||||
return new AbstractEffectAppender() {
|
||||
return new DelayedAppender() {
|
||||
@Override
|
||||
protected Effect createEffect(CostToEffectAction action, String playerId, LotroGame game, PhysicalCard self, EffectResult effectResult, Effect effect) {
|
||||
return new AddTwilightEffect(self, amount);
|
||||
|
||||
@@ -19,7 +19,7 @@ public class DiscardCardAtRandomFromHand implements EffectAppenderProducer {
|
||||
public EffectAppender createEffectAppender(JSONObject effectObject, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
FieldUtils.validateAllowedFields(effectObject);
|
||||
|
||||
return new AbstractEffectAppender() {
|
||||
return new DelayedAppender() {
|
||||
@Override
|
||||
protected Effect createEffect(CostToEffectAction action, String playerId, LotroGame game, PhysicalCard self, EffectResult effectResult, Effect effect) {
|
||||
return new DiscardCardAtRandomFromHandEffect(self, self.getOwner(), false);
|
||||
|
||||
@@ -35,7 +35,7 @@ public class NegateWound implements EffectAppenderProducer {
|
||||
return Filters.in(woundEffect.getAffectedCardsMinusPrevented(game));
|
||||
}, 1, 1, "_temp", "owner", "Choose characters to negate wound to", environment));
|
||||
result.addEffectAppender(
|
||||
new AbstractEffectAppender() {
|
||||
new DelayedAppender() {
|
||||
@Override
|
||||
protected Effect createEffect(CostToEffectAction action, String playerId, LotroGame game, PhysicalCard self, EffectResult effectResult, Effect effect) {
|
||||
final Collection<? extends PhysicalCard> cards = action.getCardsFromMemory("_temp");
|
||||
|
||||
@@ -18,7 +18,7 @@ public class PutOnRing implements EffectAppenderProducer {
|
||||
@Override
|
||||
public EffectAppender createEffectAppender(JSONObject effectObject, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
FieldUtils.validateAllowedFields(effectObject);
|
||||
return new AbstractEffectAppender() {
|
||||
return new DelayedAppender() {
|
||||
@Override
|
||||
protected Effect createEffect(CostToEffectAction action, String playerId, LotroGame game, PhysicalCard self, EffectResult effectResult, Effect effect) {
|
||||
return new PutOnTheOneRingEffect();
|
||||
|
||||
@@ -997,7 +997,7 @@ public class IndividualCardAtTest extends AbstractAtTest {
|
||||
_game.getGameState().addTokens(frodo, Token.WOUND, 4);
|
||||
_game.getGameState().addTwilight(3);
|
||||
|
||||
// Pass felloship
|
||||
// Pass in fellowship
|
||||
playerDecided(P1, "");
|
||||
|
||||
// Play minion
|
||||
@@ -1006,8 +1006,34 @@ public class IndividualCardAtTest extends AbstractAtTest {
|
||||
|
||||
// Put on the ring
|
||||
playerDecided(P1, "0");
|
||||
|
||||
assertEquals(Zone.DISCARD, randomCard1.getZone());
|
||||
|
||||
// Pass in maneuver
|
||||
playerDecided(P2, "");
|
||||
playerDecided(P1, "");
|
||||
|
||||
// Pass in archery
|
||||
playerDecided(P1, "");
|
||||
playerDecided(P2, "");
|
||||
|
||||
// Pass in assignment
|
||||
playerDecided(P1, "");
|
||||
playerDecided(P2, "");
|
||||
|
||||
// Assign minion to Frodo
|
||||
playerDecided(P1, frodo.getCardId() + " " + cheapMinion.getCardId());
|
||||
|
||||
// Start skirmish
|
||||
playerDecided(P1, String.valueOf(frodo.getCardId()));
|
||||
|
||||
int burdensBefore = _game.getGameState().getBurdens();
|
||||
|
||||
// Pass in skirmish
|
||||
playerDecided(P1, "");
|
||||
playerDecided(P2, "");
|
||||
|
||||
assertEquals(burdensBefore + 1, _game.getGameState().getBurdens());
|
||||
assertEquals(4, _game.getGameState().getWounds(frodo));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user