forked from External/mage
added replace event to putOntoBattlefield call - moved logic for moving cards to putOntoBattlefield
This commit is contained in:
parent
11a64a1c6a
commit
82f8a7cdee
35 changed files with 50 additions and 75 deletions
|
|
@ -512,24 +512,6 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
|
|||
if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.PLAY_LAND, card.getId(), playerId))) {
|
||||
int bookmark = game.bookmarkState();
|
||||
Zone zone = game.getState().getZone(card.getId());
|
||||
switch (zone) {
|
||||
case HAND:
|
||||
removeFromHand(card, game);
|
||||
break;
|
||||
case LIBRARY:
|
||||
removeFromLibrary(card, game);
|
||||
break;
|
||||
case GRAVEYARD:
|
||||
removeFromGraveyard(card, game);
|
||||
break;
|
||||
case EXILED:
|
||||
game.getExile().removeCard(card, game);
|
||||
break;
|
||||
default:
|
||||
// invalid zone for play land
|
||||
return false;
|
||||
}
|
||||
|
||||
if (card.putOntoBattlefield(game, zone, null, playerId)) {
|
||||
landsPlayed++;
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LAND_PLAYED, card.getId(), playerId));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue