mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
- now these cards work with split-cards.
This commit is contained in:
parent
678f77c2a3
commit
5eecfb2a86
10 changed files with 22 additions and 21 deletions
|
@ -122,16 +122,15 @@ class CunningAbductionSpendAnyManaEffect extends AsThoughEffectImpl implements A
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
objectId = game.getCard(objectId).getMainCard().getId(); // for split cards
|
||||
if (objectId.equals(((FixedTarget) getTargetPointer()).getTarget())
|
||||
&& game.getState().getZoneChangeCounter(objectId) <= ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1) {
|
||||
|
||||
if (affectedControllerId.equals(source.getControllerId())) {
|
||||
// if the card moved from exile to spell the zone change counter is increased by 1
|
||||
if (game.getState().getZoneChangeCounter(objectId) == ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (((FixedTarget) getTargetPointer()).getTarget().equals(objectId)) {
|
||||
// object has moved zone so effect can be discarted
|
||||
this.discard();
|
||||
|
|
|
@ -177,6 +177,7 @@ class DaxosOfMeletisSpendAnyManaEffect extends AsThoughEffectImpl implements AsT
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
objectId = game.getCard(objectId).getMainCard().getId(); // for split cards
|
||||
return source.isControlledBy(affectedControllerId)
|
||||
&& Objects.equals(objectId, ((FixedTarget) getTargetPointer()).getTarget())
|
||||
&& ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1 == game.getState().getZoneChangeCounter(objectId)
|
||||
|
|
|
@ -178,16 +178,15 @@ class DeadMansChestSpendManaEffect extends AsThoughEffectImpl implements AsThoug
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
objectId = game.getCard(objectId).getMainCard().getId(); // for split cards
|
||||
if (objectId.equals(((FixedTarget) getTargetPointer()).getTarget())
|
||||
&& game.getState().getZoneChangeCounter(objectId) <= ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1) {
|
||||
|
||||
if (affectedControllerId.equals(source.getControllerId())) {
|
||||
// if the card moved from exile to spell the zone change counter is increased by 1
|
||||
if (game.getState().getZoneChangeCounter(objectId) == ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if (((FixedTarget) getTargetPointer()).getTarget().equals(objectId)) {
|
||||
// object has moved zone so effect can be discarted
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.g;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
@ -155,7 +154,8 @@ class GontiLordOfLuxuryCastFromExileEffect extends AsThoughEffectImpl {
|
|||
&& affectedControllerId.equals(source.getControllerId())) {
|
||||
Card card = game.getCard(objectId);
|
||||
// TODO: Allow to cast Zoetic Cavern face down
|
||||
return card != null && !card.isLand();
|
||||
return card != null
|
||||
&& !card.isLand();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -184,16 +184,15 @@ class GontiLordOfLuxurySpendAnyManaEffect extends AsThoughEffectImpl implements
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
objectId = game.getCard(objectId).getMainCard().getId(); // for split cards
|
||||
if (objectId.equals(((FixedTarget) getTargetPointer()).getTarget())
|
||||
&& game.getState().getZoneChangeCounter(objectId) <= ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1) {
|
||||
|
||||
if (affectedControllerId.equals(source.getControllerId())) {
|
||||
// if the card moved from exile to spell the zone change counter is increased by 1
|
||||
if (game.getState().getZoneChangeCounter(objectId) == ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (((FixedTarget) getTargetPointer()).getTarget().equals(objectId)) {
|
||||
// object has moved zone so effect can be discarted
|
||||
this.discard();
|
||||
|
@ -230,13 +229,18 @@ class GontiLordOfLuxuryLookEffect extends AsThoughEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId) == Zone.EXILED) {
|
||||
objectId = game.getCard(objectId).getMainCard().getId(); // for split cards
|
||||
if (affectedControllerId.equals(source.getControllerId())
|
||||
&& game.getState().getZone(objectId) == Zone.EXILED) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (controller != null && sourceObject != null) {
|
||||
if (controller != null
|
||||
&& sourceObject != null) {
|
||||
Card card = game.getCard(objectId);
|
||||
if (card != null && card.isFaceDown(game)) {
|
||||
Set<UUID> exileZones = (Set<UUID>) game.getState().getValue(GontiLordOfLuxury.VALUE_PREFIX + source.getSourceId().toString());
|
||||
if (card != null
|
||||
&& card.isFaceDown(game)) {
|
||||
Set<UUID> exileZones = (Set<UUID>) game.getState().getValue(
|
||||
GontiLordOfLuxury.VALUE_PREFIX + source.getSourceId().toString());
|
||||
if (exileZones != null) {
|
||||
for (ExileZone exileZone : game.getExile().getExileZones()) {
|
||||
if (exileZone.contains(objectId)) {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.h;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -174,16 +173,15 @@ class HostageTakerSpendAnyManaEffect extends AsThoughEffectImpl implements AsTho
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
objectId = game.getCard(objectId).getMainCard().getId(); // for split cards
|
||||
if (objectId.equals(((FixedTarget) getTargetPointer()).getTarget())
|
||||
&& game.getState().getZoneChangeCounter(objectId) <= ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1) {
|
||||
|
||||
if (affectedControllerId.equals(source.getControllerId())) {
|
||||
// if the card moved from exile to spell the zone change counter is increased by 1
|
||||
if (game.getState().getZoneChangeCounter(objectId) == ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if (((FixedTarget) getTargetPointer()).getTarget().equals(objectId)) {
|
||||
// object has moved zone so effect can be discarted
|
||||
|
|
|
@ -156,6 +156,7 @@ class MnemonicBetrayalAnyColorEffect extends AsThoughEffectImpl implements AsTho
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
objectId = game.getCard(objectId).getMainCard().getId(); // for split cards
|
||||
if (objectId.equals(card.getId())
|
||||
&& card.getZoneChangeCounter(game) <= zoneCounter + 1
|
||||
&& affectedControllerId.equals(source.getControllerId())) {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.p;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -33,7 +32,7 @@ import mage.util.CardUtil;
|
|||
public final class PsychicIntrusion extends CardImpl {
|
||||
|
||||
public PsychicIntrusion(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{U}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{U}{B}");
|
||||
|
||||
// Target opponent reveals their hand. You choose a nonland card from that player's graveyard or hand and exile it.
|
||||
// You may cast that card for as long as it remains exiled, and you may spend mana as though it were mana of any color
|
||||
|
@ -187,16 +186,15 @@ class PsychicIntrusionSpendAnyManaEffect extends AsThoughEffectImpl implements A
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
objectId = game.getCard(objectId).getMainCard().getId(); // for split cards
|
||||
if (objectId.equals(((FixedTarget) getTargetPointer()).getTarget())
|
||||
&& game.getState().getZoneChangeCounter(objectId) <= ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1) {
|
||||
|
||||
if (affectedControllerId.equals(source.getControllerId())) {
|
||||
// if the card moved from exile to spell the zone change counter is increased by 1
|
||||
if (game.getState().getZoneChangeCounter(objectId) == ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if (((FixedTarget) getTargetPointer()).getTarget().equals(objectId)) {
|
||||
// object has moved zone so effect can be discarted
|
||||
|
|
|
@ -164,6 +164,7 @@ class StolenStrategySpendAnyManaEffect extends AsThoughEffectImpl implements AsT
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
objectId = game.getCard(objectId).getMainCard().getId(); // for split cards
|
||||
return source.isControlledBy(affectedControllerId)
|
||||
&& Objects.equals(objectId, ((FixedTarget) getTargetPointer()).getTarget())
|
||||
&& ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1 == game.getState().getZoneChangeCounter(objectId)
|
||||
|
|
|
@ -197,16 +197,15 @@ class ThiefOfSanitySpendAnyManaEffect extends AsThoughEffectImpl implements AsTh
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
objectId = game.getCard(objectId).getMainCard().getId(); // for split cards
|
||||
if (objectId.equals(((FixedTarget) getTargetPointer()).getTarget())
|
||||
&& game.getState().getZoneChangeCounter(objectId) <= ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1) {
|
||||
|
||||
if (affectedControllerId.equals(authorizedPlayerId)) {
|
||||
// if the card moved from exile to stack the zone change counter is increased by 1
|
||||
if (game.getState().getZoneChangeCounter(objectId) == ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (((FixedTarget) getTargetPointer()).getTarget().equals(objectId)) {
|
||||
// object has moved zone so effect can be discarted
|
||||
this.discard();
|
||||
|
|
|
@ -170,6 +170,7 @@ class TobiasBeckettSpendAnyManaEffect extends AsThoughEffectImpl implements AsTh
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
objectId = game.getCard(objectId).getMainCard().getId(); // for split cards
|
||||
return source.isControlledBy(affectedControllerId)
|
||||
&& Objects.equals(objectId, ((FixedTarget) getTargetPointer()).getTarget())
|
||||
&& ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1 == game.getState().getZoneChangeCounter(objectId)
|
||||
|
|
Loading…
Reference in a new issue