"Baruk Khazad"

This commit is contained in:
marcins78@gmail.com
2011-10-17 10:41:03 +00:00
parent 5961911bd6
commit 7045884918
5 changed files with 88 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
package com.gempukku.lotro.cards.effects;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.timing.AbstractSuccessfulEffect;
import com.gempukku.lotro.logic.timing.EffectResult;
public class SetUpConsecutiveActionEffect extends AbstractSuccessfulEffect {
@Override
public String getText(LotroGame game) {
return null;
}
@Override
public EffectResult.Type getType() {
return null;
}
@Override
public EffectResult[] playEffect(LotroGame game) {
game.getGameState().setConsecutiveAction(true);
return null;
}
}

View File

@@ -0,0 +1,43 @@
package com.gempukku.lotro.cards.set5.dwarven;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.SetUpConsecutiveActionEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.effects.ChooseAndWoundCharactersEffect;
/**
* Set: Battle of Helm's Deep
* Side: Free
* Culture: Dwarven
* Twilight Cost: 0
* Type: Event
* Game Text: Maneuver: Exert a Dwarf to wound a minion. You may take the next maneuver action.
*/
public class Card5_005 extends AbstractEvent {
public Card5_005() {
super(Side.FREE_PEOPLE, 0, Culture.DWARVEN, "Baruk Khazad", Phase.MANEUVER);
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
return super.checkPlayRequirements(playerId, game, self, twilightModifier)
&& PlayConditions.canExert(self, game, Race.DWARF);
}
@Override
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Race.DWARF));
action.appendEffect(
new ChooseAndWoundCharactersEffect(action, playerId, 1, 1, CardType.MINION));
action.appendEffect(
new SetUpConsecutiveActionEffect());
return action;
}
}

View File

@@ -29,6 +29,7 @@ public class GameState {
private int _moveCount;
private boolean _fierceSkirmishes;
private boolean _wearingRing;
private boolean _consecutiveAction;
private Map<String, Integer> _playerPosition = new HashMap<String, Integer>();
private Map<PhysicalCard, Map<Token, Integer>> _cardTokens = new HashMap<PhysicalCard, Map<Token, Integer>>();
@@ -81,6 +82,14 @@ public class GameState {
}
}
public boolean isConsecutiveAction() {
return _consecutiveAction;
}
public void setConsecutiveAction(boolean consecutiveAction) {
_consecutiveAction = consecutiveAction;
}
public void setWearingRing(boolean wearingRing) {
_wearingRing = wearingRing;
}

View File

@@ -5,6 +5,7 @@ import java.util.List;
public class PlayOrder {
private List<String> _playOrder;
private boolean _looped;
private String _lastPlayer;
private int _nextPlayerIndex;
public PlayOrder(List<String> playOrder, boolean looped) {
@@ -12,6 +13,10 @@ public class PlayOrder {
_looped = looped;
}
public String getLastPlayer() {
return _lastPlayer;
}
public String getNextPlayer() {
if (_nextPlayerIndex >= getPlayerCount())
return null;
@@ -20,6 +25,7 @@ public class PlayOrder {
_nextPlayerIndex++;
if (_nextPlayerIndex >= getPlayerCount() && _looped)
_nextPlayerIndex = 0;
_lastPlayer = nextPlayer;
return nextPlayer;
}

View File

@@ -35,7 +35,13 @@ public class PlayersPlayPhaseActionsInOrderGameProcess implements GameProcess {
// If the skirmish is cancelled or one side of the skirmish is missing, no more phase actions can be played
_nextProcess = _followingGameProcess;
} else {
String playerId = _playOrder.getNextPlayer();
String playerId;
if (_game.getGameState().isConsecutiveAction()) {
playerId = _playOrder.getLastPlayer();
_game.getGameState().setConsecutiveAction(false);
} else {
playerId = _playOrder.getNextPlayer();
}
final List<Action> playableActions = _game.getActionsEnvironment().getPhaseActions(playerId);