"Alatar"
This commit is contained in:
@@ -5,6 +5,7 @@ import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.timing.AbstractEffect;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
import com.gempukku.lotro.logic.timing.results.CardTransferredResult;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
@@ -33,8 +34,13 @@ public class TransferToSupportEffect extends AbstractEffect {
|
||||
@Override
|
||||
protected FullEffectResult playEffectReturningResult(LotroGame game) {
|
||||
if (isPlayableInFull(game)) {
|
||||
PhysicalCard transferredFrom = _card.getAttachedTo();
|
||||
game.getGameState().removeCardsFromZone(_card.getOwner(), Collections.singleton(_card));
|
||||
game.getGameState().addCardToZone(game, _card, Zone.SUPPORT);
|
||||
|
||||
game.getActionsEnvironment().emitEffectResult(
|
||||
new CardTransferredResult(_card, transferredFrom, null));
|
||||
|
||||
return new FullEffectResult(true, true);
|
||||
}
|
||||
return new FullEffectResult(false, false);
|
||||
|
||||
@@ -33,14 +33,16 @@ public class FellowshipPlayerChoosesToMoveOrStayGameProcess implements GameProce
|
||||
new ShadowPhasesGameProcess()));
|
||||
else {
|
||||
_nextProcess = new PlayerReconcilesGameProcess(gameState.getCurrentPlayerId(),
|
||||
new DiscardAllMinionsGameProcess());
|
||||
new ReturnFollowersToSupportGameProcess(
|
||||
new DiscardAllMinionsGameProcess()));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
_nextProcess = new PlayerReconcilesGameProcess(gameState.getCurrentPlayerId(),
|
||||
new DiscardAllMinionsGameProcess());
|
||||
new ReturnFollowersToSupportGameProcess(
|
||||
new DiscardAllMinionsGameProcess()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.gempukku.lotro.logic.timing.processes.turn.regroup;
|
||||
|
||||
import com.gempukku.lotro.common.CardType;
|
||||
import com.gempukku.lotro.common.Zone;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.actions.SystemQueueAction;
|
||||
import com.gempukku.lotro.logic.timing.UnrespondableEffect;
|
||||
import com.gempukku.lotro.logic.timing.processes.GameProcess;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class ReturnFollowersToSupportGameProcess implements GameProcess {
|
||||
private GameProcess _followingProcess;
|
||||
|
||||
public ReturnFollowersToSupportGameProcess(GameProcess followingProcess) {
|
||||
_followingProcess = followingProcess;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(LotroGame game) {
|
||||
SystemQueueAction action = new SystemQueueAction();
|
||||
action.appendEffect(
|
||||
new UnrespondableEffect() {
|
||||
@Override
|
||||
protected void doPlayEffect(LotroGame game) {
|
||||
Collection<PhysicalCard> followers = Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), CardType.FOLLOWER, Zone.ATTACHED);
|
||||
game.getGameState().removeCardsFromZone(game.getGameState().getCurrentPlayerId(), followers);
|
||||
for (PhysicalCard attachedFollowers : followers)
|
||||
game.getGameState().addCardToZone(game, attachedFollowers, Zone.SUPPORT);
|
||||
}
|
||||
});
|
||||
game.getActionsEnvironment().addActionToStack(action);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProcess getNextProcess() {
|
||||
return _followingProcess;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user