"Ranks Without Number"
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
package com.gempukku.lotro.cards.set4.isengard;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractPermanent;
|
||||
import com.gempukku.lotro.cards.effects.ChooseAndPlayCardFromDiscardEffect;
|
||||
import com.gempukku.lotro.common.CardType;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Side;
|
||||
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.OptionalTriggerAction;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
import com.gempukku.lotro.logic.timing.results.AssignmentResult;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: The Two Towers
|
||||
* Side: Shadow
|
||||
* Culture: Isengard
|
||||
* Twilight Cost: 1
|
||||
* Type: Condition
|
||||
* Game Text: Plays to your support area. Each time the Free Peoples player assigns an ally to a skirmish, you may play
|
||||
* an [ISENGARD] minion from your discard pile. That minion's twilight cost is -2.
|
||||
*/
|
||||
public class Card4_170 extends AbstractPermanent {
|
||||
public Card4_170() {
|
||||
super(Side.SHADOW, 1, CardType.CONDITION, Culture.ISENGARD, Zone.SUPPORT, "Ranks Without Number", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (effectResult.getType() == EffectResult.Type.ASSIGNMENT) {
|
||||
AssignmentResult assignmentResult = (AssignmentResult) effectResult;
|
||||
if (assignmentResult.getPlayerId().equals(game.getGameState().getCurrentPlayerId())) {
|
||||
int count = Filters.filter(assignmentResult.getAssignments().keySet(), game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.ALLY)).size();
|
||||
List<OptionalTriggerAction> optionalTriggers = new LinkedList<OptionalTriggerAction>();
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
OptionalTriggerAction action = new OptionalTriggerAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseAndPlayCardFromDiscardEffect(playerId, game.getGameState().getDiscard(playerId), Filters.and(Filters.type(CardType.MINION), Filters.culture(Culture.ISENGARD)), -2));
|
||||
optionalTriggers.add(action);
|
||||
}
|
||||
|
||||
return optionalTriggers;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -56,6 +56,6 @@ public class AssignmentEffect extends AbstractEffect {
|
||||
List<PhysicalCard> minions = physicalCardListEntry.getValue();
|
||||
game.getGameState().assignToSkirmishes(fpChar, minions);
|
||||
}
|
||||
return new FullEffectResult(new EffectResult[]{new AssignmentResult(_assignments)}, true, true);
|
||||
return new FullEffectResult(new EffectResult[]{new AssignmentResult(_playerId, _assignments)}, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,13 +8,19 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AssignmentResult extends EffectResult {
|
||||
private String _playerId;
|
||||
private Map<PhysicalCard, List<PhysicalCard>> _assignments;
|
||||
|
||||
public AssignmentResult(Map<PhysicalCard, List<PhysicalCard>> assignments) {
|
||||
public AssignmentResult(String playerId, Map<PhysicalCard, List<PhysicalCard>> assignments) {
|
||||
super(EffectResult.Type.ASSIGNMENT);
|
||||
_playerId = playerId;
|
||||
_assignments = assignments;
|
||||
}
|
||||
|
||||
public String getPlayerId() {
|
||||
return _playerId;
|
||||
}
|
||||
|
||||
public Map<PhysicalCard, List<PhysicalCard>> getAssignments() {
|
||||
return Collections.unmodifiableMap(_assignments);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user