This commit is contained in:
marcins78@gmail.com
2011-12-29 06:37:36 +00:00
parent 5d1100f1ab
commit cdc4340060
3 changed files with 51 additions and 2 deletions

View File

@@ -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);

View File

@@ -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()));
}
}

View File

@@ -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;
}
}