mirror of
https://github.com/correl/mage.git
synced 2025-03-17 01:06:26 -09:00
* Hedonist's Trove - Fixed that all players could play the exiled cards.
This commit is contained in:
parent
8c9c4421cd
commit
57e378c1da
1 changed files with 33 additions and 30 deletions
|
@ -43,7 +43,6 @@ import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
|
||||||
import mage.game.ExileZone;
|
import mage.game.ExileZone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
@ -138,13 +137,15 @@ class HedonistsTrovePlayLandEffect extends AsThoughEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
Card card = game.getCard(objectId);
|
if (affectedControllerId.equals(source.getControllerId())) {
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
Card card = game.getCard(objectId);
|
||||||
if (card != null && card.getCardType().contains(CardType.LAND) && sourceObject != null) {
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
if (card != null && card.getCardType().contains(CardType.LAND) && sourceObject != null) {
|
||||||
if (exileId != null) {
|
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||||
ExileZone exileZone = game.getState().getExile().getExileZone(exileId);
|
if (exileId != null) {
|
||||||
return exileZone != null && exileZone.contains(objectId);
|
ExileZone exileZone = game.getState().getExile().getExileZone(exileId);
|
||||||
|
return exileZone != null && exileZone.contains(objectId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -179,24 +180,26 @@ class HedonistsTroveCastNonlandCardsEffect extends AsThoughEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
Card card = game.getCard(objectId);
|
if (affectedControllerId.equals(source.getControllerId())) {
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
Card card = game.getCard(objectId);
|
||||||
if (card != null && !card.getCardType().contains(CardType.LAND) && sourceObject != null) {
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
if (card != null && !card.getCardType().contains(CardType.LAND) && sourceObject != null) {
|
||||||
if (exileId != null) {
|
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||||
ExileZone exileZone = game.getState().getExile().getExileZone(exileId);
|
if (exileId != null) {
|
||||||
if (exileZone != null && exileZone.contains(objectId)) {
|
ExileZone exileZone = game.getState().getExile().getExileZone(exileId);
|
||||||
if (game.getTurnNum() == turnNumber) {
|
if (exileZone != null && exileZone.contains(objectId)) {
|
||||||
if (!exileZone.contains(cardId)) {
|
if (game.getTurnNum() == turnNumber) {
|
||||||
// last checked card this turn is no longer exiled, so you can't cast another with this effect
|
if (!exileZone.contains(cardId)) {
|
||||||
// TODO: Handle if card was cast/removed from exile with effect from another card.
|
// last checked card this turn is no longer exiled, so you can't cast another with this effect
|
||||||
// If so, this effect could prevent player from casting although he should be able to use it
|
// TODO: Handle if card was cast/removed from exile with effect from another card.
|
||||||
return false;
|
// If so, this effect could prevent player from casting although he should be able to use it
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
this.turnNumber = game.getTurnNum();
|
||||||
|
this.cardId = objectId;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
this.turnNumber = game.getTurnNum();
|
|
||||||
this.cardId = objectId;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue