- "Dunlending Warrior" now can assign itself to an ally.
This commit is contained in:
@@ -40,7 +40,7 @@ public class ChooseAndAssignCharacterToMinionEffect extends ChooseActiveCardEffe
|
|||||||
protected void cardSelected(LotroGame game, PhysicalCard card) {
|
protected void cardSelected(LotroGame game, PhysicalCard card) {
|
||||||
SubAction subAction = new SubAction(_action);
|
SubAction subAction = new SubAction(_action);
|
||||||
subAction.appendEffect(
|
subAction.appendEffect(
|
||||||
new AssignmentEffect(_playerId, card, _minion));
|
new AssignmentEffect(_playerId, card, _minion, _skipAllyLocationCheck));
|
||||||
game.getActionsEnvironment().addActionToStack(subAction);
|
game.getActionsEnvironment().addActionToStack(subAction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public class ChooseAndDoAssignmentEffect extends AbstractSubActionEffect {
|
|||||||
private void assignmentSelected(LotroGame game, PhysicalCard fpCharacter, PhysicalCard minion) {
|
private void assignmentSelected(LotroGame game, PhysicalCard fpCharacter, PhysicalCard minion) {
|
||||||
SubAction subAction = new SubAction(_action);
|
SubAction subAction = new SubAction(_action);
|
||||||
subAction.appendEffect(
|
subAction.appendEffect(
|
||||||
new AssignmentEffect(_playerId, fpCharacter, minion));
|
new AssignmentEffect(_playerId, fpCharacter, minion, _allowAllyToSkirmish));
|
||||||
processSubAction(game, subAction);
|
processSubAction(game, subAction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,13 +14,19 @@ import java.util.Collections;
|
|||||||
public class AssignmentEffect extends AbstractEffect {
|
public class AssignmentEffect extends AbstractEffect {
|
||||||
private String _playerId;
|
private String _playerId;
|
||||||
private boolean _ignoreSingleMinionRestriction;
|
private boolean _ignoreSingleMinionRestriction;
|
||||||
|
private boolean _skipAllyLocationCheck;
|
||||||
private PhysicalCard _fpChar;
|
private PhysicalCard _fpChar;
|
||||||
private PhysicalCard _minion;
|
private PhysicalCard _minion;
|
||||||
|
|
||||||
public AssignmentEffect(String playerId, PhysicalCard fpChar, PhysicalCard minion) {
|
public AssignmentEffect(String playerId, PhysicalCard fpChar, PhysicalCard minion) {
|
||||||
|
this(playerId, fpChar, minion, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AssignmentEffect(String playerId, PhysicalCard fpChar, PhysicalCard minion, boolean skipAllyLocationCheck) {
|
||||||
_playerId = playerId;
|
_playerId = playerId;
|
||||||
_fpChar = fpChar;
|
_fpChar = fpChar;
|
||||||
_minion = minion;
|
_minion = minion;
|
||||||
|
_skipAllyLocationCheck = skipAllyLocationCheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIgnoreSingleMinionRestriction(boolean ignoreSingleMinionRestriction) {
|
public void setIgnoreSingleMinionRestriction(boolean ignoreSingleMinionRestriction) {
|
||||||
@@ -40,7 +46,7 @@ public class AssignmentEffect extends AbstractEffect {
|
|||||||
@Override
|
@Override
|
||||||
public boolean isPlayableInFull(LotroGame game) {
|
public boolean isPlayableInFull(LotroGame game) {
|
||||||
Side side = _playerId.equals(game.getGameState().getCurrentPlayerId()) ? Side.FREE_PEOPLE : Side.SHADOW;
|
Side side = _playerId.equals(game.getGameState().getCurrentPlayerId()) ? Side.FREE_PEOPLE : Side.SHADOW;
|
||||||
return Filters.assignableToSkirmishAgainst(side, _fpChar, _ignoreSingleMinionRestriction, false).accepts(game.getGameState(), game.getModifiersQuerying(), _minion);
|
return Filters.assignableToSkirmishAgainst(side, _fpChar, _ignoreSingleMinionRestriction, _skipAllyLocationCheck).accepts(game.getGameState(), game.getModifiersQuerying(), _minion);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -395,4 +395,47 @@ public class AssignmentAtTest extends AbstractAtTest {
|
|||||||
// Expected
|
// Expected
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void dunlendingWarriorAssignsToAlly() throws DecisionResultInvalidException {
|
||||||
|
initializeSimplestGame();
|
||||||
|
|
||||||
|
skipMulligans();
|
||||||
|
|
||||||
|
PhysicalCardImpl elrond = new PhysicalCardImpl(101, "1_40", P1, _library.getLotroCardBlueprint("1_40"));
|
||||||
|
PhysicalCardImpl dunlendingWarrior = new PhysicalCardImpl(102, "4_18", P2, _library.getLotroCardBlueprint("4_18"));
|
||||||
|
|
||||||
|
_game.getGameState().addCardToZone(_game, elrond, Zone.SUPPORT);
|
||||||
|
|
||||||
|
// End fellowship phase
|
||||||
|
playerDecided(P1, "");
|
||||||
|
|
||||||
|
_game.getGameState().addCardToZone(_game, dunlendingWarrior, Zone.SHADOW_CHARACTERS);
|
||||||
|
|
||||||
|
// End shadow phase
|
||||||
|
playerDecided(P2, "");
|
||||||
|
|
||||||
|
// End maneuvers phase
|
||||||
|
playerDecided(P1, "");
|
||||||
|
playerDecided(P2, "");
|
||||||
|
|
||||||
|
// End arhcery phase
|
||||||
|
playerDecided(P1, "");
|
||||||
|
playerDecided(P2, "");
|
||||||
|
|
||||||
|
// End assignment phase
|
||||||
|
playerDecided(P1, "");
|
||||||
|
|
||||||
|
AwaitingDecision assignmentActions = _userFeedback.getAwaitingDecision(P2);
|
||||||
|
assertEquals(AwaitingDecisionType.CARD_ACTION_CHOICE, assignmentActions.getDecisionType());
|
||||||
|
validateContents(toCardIdArray(dunlendingWarrior), (String[]) assignmentActions.getDecisionParameters().get("cardId"));
|
||||||
|
|
||||||
|
playerDecided(P2, "0");
|
||||||
|
|
||||||
|
final List<Assignment> assignmentsAfterFreePlayer = _game.getGameState().getAssignments();
|
||||||
|
assertEquals(1, assignmentsAfterFreePlayer.size());
|
||||||
|
assertEquals(elrond, assignmentsAfterFreePlayer.get(0).getFellowshipCharacter());
|
||||||
|
assertEquals(1, assignmentsAfterFreePlayer.get(0).getShadowCharacters().size());
|
||||||
|
assertTrue(assignmentsAfterFreePlayer.get(0).getShadowCharacters().contains(dunlendingWarrior));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ for cancelling bonus modifiers.
|
|||||||
- "Orc Strategist" has a proper name now.
|
- "Orc Strategist" has a proper name now.
|
||||||
- Added "Expanded Middle-earth" (set 14) set.
|
- Added "Expanded Middle-earth" (set 14) set.
|
||||||
- "Sword of Rohan" now properly gives the damage +1 bonus.
|
- "Sword of Rohan" now properly gives the damage +1 bonus.
|
||||||
|
- "Dunlending Warrior" now can assign itself to an ally.
|
||||||
|
|
||||||
<b>15 Jan. 2012</b>
|
<b>15 Jan. 2012</b>
|
||||||
- "Hobbit Farmer" and other allies copying site text should now be able to activate the site phase actions.
|
- "Hobbit Farmer" and other allies copying site text should now be able to activate the site phase actions.
|
||||||
|
|||||||
Reference in New Issue
Block a user