mirror of
https://github.com/correl/mage.git
synced 2024-11-16 03:00:12 +00:00
* Alhammarret's Archive - Fixed that the draw effect was also applied on cards drawn from other players.
This commit is contained in:
parent
539ec1f679
commit
3a01e97d6e
1 changed files with 11 additions and 14 deletions
|
@ -87,11 +87,6 @@ class AlhammarretsArchiveEffect extends ReplacementEffectImpl {
|
|||
return new AlhammarretsArchiveEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
event.setAmount(event.getAmount() * 2);
|
||||
|
@ -132,9 +127,9 @@ class AlhammarretsArchiveReplacementEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
player.drawCards(2, game, event.getAppliedEffects());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
controller.drawCards(2, game, event.getAppliedEffects());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -146,15 +141,17 @@ class AlhammarretsArchiveReplacementEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (game.getActivePlayerId().equals(event.getPlayerId()) && game.getPhase().getStep().getType().equals(PhaseStep.DRAW)) {
|
||||
CardsDrawnDuringDrawStepWatcher watcher = (CardsDrawnDuringDrawStepWatcher) game.getState().getWatchers().get("CardsDrawnDuringDrawStep");
|
||||
if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0) {
|
||||
if (event.getPlayerId().equals(source.getControllerId())) {
|
||||
if (game.getActivePlayerId().equals(event.getPlayerId())
|
||||
&& game.getPhase().getStep().getType().equals(PhaseStep.DRAW)) {
|
||||
CardsDrawnDuringDrawStepWatcher watcher = (CardsDrawnDuringDrawStepWatcher) game.getState().getWatchers().get("CardsDrawnDuringDrawStep");
|
||||
if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue