mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
Replaced use of source.getId() by source.getSourceId() for Mage Sets.
This commit is contained in:
parent
83eb066d88
commit
8b4c454f1f
382 changed files with 606 additions and 581 deletions
|
@ -125,13 +125,13 @@ class ArchitectsOfWillEffect extends OneShotEffect {
|
|||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, true);
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
target.clearChosen();
|
||||
}
|
||||
if (cards.size() == 1) {
|
||||
Card card = cards.get(cards.iterator().next(), game);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, true);
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ class AvenEffect2 extends ContinuousEffectImpl {
|
|||
Permanent target = game.getPermanent(source.getFirstTarget());
|
||||
if (target != null) {
|
||||
if (!target.getAbilities().contains(FlyingAbility.getInstance())) {
|
||||
target.addAbility(FlyingAbility.getInstance(), source.getId(), game);
|
||||
target.addAbility(FlyingAbility.getInstance(), source.getSourceId(), game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,13 +84,13 @@ class IdentityCrisisEffect extends OneShotEffect {
|
|||
for (UUID cid : player.getHand().copy()) {
|
||||
Card c = game.getCard(cid);
|
||||
if (c != null) {
|
||||
c.moveToExile(null, null, source.getId(), game);
|
||||
c.moveToExile(null, null, source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
for (UUID cid : player.getGraveyard().copy()) {
|
||||
Card c = game.getCard(cid);
|
||||
if (c != null) {
|
||||
c.moveToExile(null, null, source.getId(), game);
|
||||
c.moveToExile(null, null, source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -101,11 +101,11 @@ class LavalancheEffect extends OneShotEffect {
|
|||
if (targetPlayer == null) {
|
||||
return false;
|
||||
}
|
||||
targetPlayer.damage(amount.calculate(game, source), source.getId(), game, false, true);
|
||||
targetPlayer.damage(amount.calculate(game, source), source.getSourceId(), game, false, true);
|
||||
FilterPermanent filter = new FilterPermanent("and each creature he or she controls");
|
||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
filter.add(new ControllerIdPredicate(targetPlayer.getId()));
|
||||
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getId(), game);
|
||||
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game);
|
||||
for (Permanent permanent: permanents) {
|
||||
permanent.damage(amount.calculate(game, source), source.getSourceId(), game, false, true);
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ class DamageOpponentsEffect extends OneShotEffect {
|
|||
for (UUID playerId : game.getOpponents(source.getControllerId())) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.damage(amount.calculate(game, source), source.getId(), game, false, true);
|
||||
player.damage(amount.calculate(game, source), source.getSourceId(), game, false, true);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -182,7 +182,7 @@ class CascadeEffect extends OneShotEffect {
|
|||
break;
|
||||
}
|
||||
|
||||
player.moveCardToExileWithInfo(card, source.getId(), exile.getName(), source.getSourceId(), game, Zone.LIBRARY);
|
||||
player.moveCardToExileWithInfo(card, source.getSourceId(), exile.getName(), source.getSourceId(), game, Zone.LIBRARY);
|
||||
} while (card.getCardType().contains(CardType.LAND) || card.getManaCost().convertedManaCost() >= sourceCost);
|
||||
|
||||
if (card != null) {
|
||||
|
|
|
@ -105,7 +105,7 @@ class MindFuneralEffect extends OneShotEffect {
|
|||
}
|
||||
opponent.revealCards("Mind Funeral", cards, game);
|
||||
for (Card card: cards.getCards(game)) {
|
||||
card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false);
|
||||
card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -89,10 +89,10 @@ class MorbidBloomEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Card targetCreatureCard = game.getCard(source.getFirstTarget());
|
||||
if (targetCreatureCard != null) {
|
||||
targetCreatureCard.moveToExile(null, null, source.getId(), game);
|
||||
targetCreatureCard.moveToExile(null, null, source.getSourceId(), game);
|
||||
int toughness = targetCreatureCard.getToughness().getValue();
|
||||
SaprolingToken token = new SaprolingToken();
|
||||
return token.putOntoBattlefield(toughness, game, source.getId(), source.getControllerId());
|
||||
return token.putOntoBattlefield(toughness, game, source.getSourceId(), source.getControllerId());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ class NecromancersConvenantEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
ZombieToken zombieToken = new ZombieToken("ALA");
|
||||
if (zombieToken.putOntoBattlefield(count, game, source.getId(), source.getControllerId())) {
|
||||
if (zombieToken.putOntoBattlefield(count, game, source.getSourceId(), source.getControllerId())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -117,7 +117,7 @@ class SagesOfTheAnimaReplacementEffect extends ReplacementEffectImpl {
|
|||
player.revealCards("Top three cards of library revealed", cards, game);
|
||||
for (Card revealedCard : cards.getCards(game)) {
|
||||
if (revealedCard.getCardType().contains(CardType.CREATURE)) {
|
||||
revealedCard.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
revealedCard.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
cards.remove(revealedCard);
|
||||
}
|
||||
}
|
||||
|
@ -127,13 +127,13 @@ class SagesOfTheAnimaReplacementEffect extends ReplacementEffectImpl {
|
|||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, false);
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
||||
}
|
||||
target.clearChosen();
|
||||
}
|
||||
if (cards.size() == 1) {
|
||||
Card card = cards.get(cards.iterator().next(), game);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, false);
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -144,7 +144,7 @@ class SovereignsOfLostAlaraEffect extends OneShotEffect {
|
|||
if (target.getFirstTarget() != null) {
|
||||
Card aura = game.getCard(target.getFirstTarget());
|
||||
game.getState().setValue("attachTo:" + aura.getId(), attackingCreature);
|
||||
aura.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), you.getId());
|
||||
aura.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), you.getId());
|
||||
return attackingCreature.addAttachment(aura.getId(), game);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,22 +104,22 @@ class ThoughtHemorrhageEffect extends OneShotEffect {
|
|||
targetPlayer.revealCards("hand of target player", targetPlayer.getHand(), game);
|
||||
for (Card card : targetPlayer.getHand().getCards(game)) {
|
||||
if (card.getName().equals(cardName)) {
|
||||
targetPlayer.damage(3, source.getId(), game, false, true);
|
||||
targetPlayer.damage(3, source.getSourceId(), game, false, true);
|
||||
}
|
||||
}
|
||||
for (Card card : targetPlayer.getGraveyard().getCards(game)) {
|
||||
if (card.getName().equals(cardName)) {
|
||||
card.moveToExile(null, "", source.getId(), game);
|
||||
card.moveToExile(null, "", source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
for (Card card : targetPlayer.getHand().getCards(game)) {
|
||||
if (card.getName().equals(cardName)) {
|
||||
card.moveToExile(null, "", source.getId(), game);
|
||||
card.moveToExile(null, "", source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
for (Card card : targetPlayer.getLibrary().getCards(game)) {
|
||||
if (card.getName().equals(cardName)) {
|
||||
card.moveToExile(null, "", source.getId(), game);
|
||||
card.moveToExile(null, "", source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
targetPlayer.shuffleLibrary(game);
|
||||
|
|
|
@ -158,9 +158,9 @@ class UnscytheEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Card card = game.getCard(targetPointer.getFirst(game, source));
|
||||
if (card != null) {
|
||||
if (card.moveToExile(null, "Unscythe Exile", source.getId(), game)) {
|
||||
if (card.moveToExile(null, "Unscythe Exile", source.getSourceId(), game)) {
|
||||
ZombieToken zombie = new ZombieToken("ALA");
|
||||
return zombie.putOntoBattlefield(1, game, source.getId(), source.getControllerId());
|
||||
return zombie.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -121,7 +121,7 @@ class OrimsThunderEffect2 extends OneShotEffect {
|
|||
}
|
||||
boolean kicked = KickedCondition.getInstance().apply(game, source);
|
||||
if (kicked && secondTarget != null) {
|
||||
secondTarget.damage(damage, source.getId(), game, false, true);
|
||||
secondTarget.damage(damage, source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -148,7 +148,7 @@ class OrimsThunderEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent target = game.getPermanent(source.getFirstTarget());
|
||||
if (target != null) {
|
||||
return target.destroy(source.getId(), game, false);
|
||||
return target.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ class PerniciousDeedEffect extends OneShotEffect {
|
|||
|
||||
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|
||||
permanent.destroy(source.getId(), game, false);
|
||||
permanent.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ class TranquilPathEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|
||||
permanent.destroy(source.getId(), game, false);
|
||||
permanent.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ class AggraveteEffect extends OneShotEffect {
|
|||
if (player != null) {
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
filter.add(new ControllerIdPredicate(player.getId()));
|
||||
List<Permanent> creatures = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getId(), game);
|
||||
List<Permanent> creatures = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game);
|
||||
for (Permanent creature : creatures) {
|
||||
creature.damage(1, source.getSourceId(), game, false, true);
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ class AmassTheComponentsEffect extends OneShotEffect {
|
|||
Card card = player.getHand().get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
player.removeFromHand(card, game);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, false);
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,10 +108,10 @@ class AngelOfGlorysRiseEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
for (Permanent zombie : game.getBattlefield().getActivePermanents(filterZombie, source.getControllerId(), source.getSourceId(), game)) {
|
||||
zombie.moveToExile(source.getId(), zombie.getName(), source.getSourceId(), game);
|
||||
zombie.moveToExile(source.getSourceId(), zombie.getName(), source.getSourceId(), game);
|
||||
}
|
||||
for (Card human : player.getGraveyard().getCards(filterHuman, game)) {
|
||||
human.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId());
|
||||
human.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -93,9 +93,9 @@ class BonfireOfTheDamnedEffect extends OneShotEffect {
|
|||
if (player != null) {
|
||||
int damage = source.getManaCostsToPay().getX();
|
||||
if (damage > 0) {
|
||||
player.damage(damage, source.getId(), game, false, true);
|
||||
player.damage(damage, source.getSourceId(), game, false, true);
|
||||
for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) {
|
||||
perm.damage(damage, source.getId(), game, false, true);
|
||||
perm.damage(damage, source.getSourceId(), game, false, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ class BrunaLightOfAlabasterEffect extends OneShotEffect {
|
|||
Card aura = game.getCard(targetAura.getFirstTarget());
|
||||
if (aura != null) {
|
||||
game.getState().setValue("attachTo:" + aura.getId(), permanent);
|
||||
aura.putOntoBattlefield(game, Zone.HAND, source.getId(), player.getId());
|
||||
aura.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), player.getId());
|
||||
permanent.addAttachment(aura.getId(), game);
|
||||
}
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ class BrunaLightOfAlabasterEffect extends OneShotEffect {
|
|||
Card aura = game.getCard(targetAura.getFirstTarget());
|
||||
if (aura != null) {
|
||||
game.getState().setValue("attachTo:" + aura.getId(), permanent);
|
||||
aura.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), player.getId());
|
||||
aura.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), player.getId());
|
||||
permanent.addAttachment(aura.getId(), game);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,11 +101,11 @@ class EatenBySpidersEffect extends OneShotEffect {
|
|||
for (UUID attachmentId : attachments) {
|
||||
Permanent attachment = game.getPermanent(attachmentId);
|
||||
if (attachment.hasSubtype("Equipment")) {
|
||||
attachment.destroy(source.getId(), game, false);
|
||||
attachment.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
|
||||
permanent.destroy(source.getId(), game, false);
|
||||
permanent.destroy(source.getSourceId(), game, false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -108,7 +108,7 @@ class FettergeistUnlessPaysEffect extends OneShotEffect {
|
|||
}
|
||||
if (player.chooseUse(Outcome.Benefit, "Pay " + count + "?", game)) {
|
||||
GenericManaCost cost = new GenericManaCost(count);
|
||||
if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) {
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ class GallowsAtWillowHillEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(permanentId);
|
||||
if (permanent != null) {
|
||||
Player controller = game.getPlayer(permanent.getControllerId());
|
||||
permanent.destroy(source.getId(), game, false);
|
||||
permanent.destroy(source.getSourceId(), game, false);
|
||||
if (controller != null) {
|
||||
Token spirit = new SpiritWhiteToken("AVR", 1);
|
||||
spirit.putOntoBattlefield(1, game, source.getSourceId(), controller.getId());
|
||||
|
|
|
@ -101,11 +101,11 @@ class GhostlyFlickerEffect extends OneShotEffect {
|
|||
for (UUID permanentId : targetPointer.getTargets(game, source)) {
|
||||
Permanent target = game.getPermanent(permanentId);
|
||||
if (target != null) {
|
||||
target.moveToExile(exileId, "Ghostly Flicker", source.getId(), game);
|
||||
target.moveToExile(exileId, "Ghostly Flicker", source.getSourceId(), game);
|
||||
Card card = game.getCard(target.getId());
|
||||
if (card != null) {
|
||||
Zone currentZone = game.getState().getZone(card.getId());
|
||||
card.putOntoBattlefield(game, currentZone, source.getId(), source.getControllerId());
|
||||
card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,10 +119,10 @@ class GiselaBladeOfGoldnightDoubleDamageEffect extends ReplacementEffectImpl {
|
|||
|
||||
private void preventDamage(GameEvent event, Ability source, UUID target, Game game) {
|
||||
int amount = (int)Math.ceil(event.getAmount() / 2.0);
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, target, source.getId(), source.getControllerId(), amount, false);
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, target, source.getSourceId(), source.getControllerId(), amount, false);
|
||||
if (!game.replaceEvent(preventEvent)) {
|
||||
event.setAmount(event.getAmount() - amount);
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, target, source.getId(), source.getControllerId(), amount));
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, target, source.getSourceId(), source.getControllerId(), amount));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ class GloomSurgeonEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false);
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), event.getAmount(), false);
|
||||
if (!game.replaceEvent(preventEvent)) {
|
||||
int preventedDamage = event.getAmount();
|
||||
event.setAmount(0);
|
||||
|
@ -100,7 +100,7 @@ class GloomSurgeonEffect extends ReplacementEffectImpl {
|
|||
}
|
||||
}
|
||||
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), preventedDamage));
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), preventedDamage));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ class HolyJusticiarEffect extends OneShotEffect {
|
|||
if (creature != null) {
|
||||
if (creature.hasSubtype("Zombie")) {
|
||||
creature.tap(game);
|
||||
creature.moveToExile(source.getId(), creature.getName(), source.getSourceId(), game);
|
||||
creature.moveToExile(source.getSourceId(), creature.getName(), source.getSourceId(), game);
|
||||
} else {
|
||||
creature.tap(game);
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ class KillingWaveEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
for (Permanent creature : sacrifices) {
|
||||
creature.sacrifice(source.getId(), game);
|
||||
creature.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -102,7 +102,7 @@ class LairDelveEffect extends OneShotEffect {
|
|||
Set<Card> cardsList = cards.getCards(game);
|
||||
for (Card card : cardsList) {
|
||||
if (card.getCardType().contains(CardType.CREATURE) || card.getCardType().contains(CardType.LAND)) {
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, true);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
|
||||
cards.remove(card);
|
||||
}
|
||||
}
|
||||
|
@ -113,13 +113,13 @@ class LairDelveEffect extends OneShotEffect {
|
|||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, false);
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
||||
}
|
||||
target.clearChosen();
|
||||
}
|
||||
if (cards.size() == 1) {
|
||||
Card card = cards.get(cards.iterator().next(), game);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, false);
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -99,11 +99,11 @@ class PeelFromRealityEffect extends OneShotEffect {
|
|||
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
result |= permanent.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
result |= permanent.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
}
|
||||
permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (permanent != null) {
|
||||
result |= permanent.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
result |= permanent.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -99,7 +99,7 @@ class PillarOfFlameEffect extends ReplacementEffectImpl {
|
|||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
|
||||
if (permanent != null) {
|
||||
return permanent.moveToExile(null, "", source.getId(), game);
|
||||
return permanent.moveToExile(null, "", source.getSourceId(), game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ class PrimalSurgeEffect extends OneShotEffect {
|
|||
|| cardType.contains(CardType.ENCHANTMENT) || cardType.contains(CardType.LAND)
|
||||
|| cardType.contains(CardType.PLANESWALKER))
|
||||
&& player.chooseUse(Outcome.PutCardInPlay, "Put " + card.getName() + " onto the battlefield?", game)) {
|
||||
card.moveToZone(Zone.BATTLEFIELD, source.getId(), game, false);
|
||||
card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
|
||||
|
||||
Permanent permanent = game.getPermanent(card.getId());
|
||||
if (permanent == null) {
|
||||
|
|
|
@ -95,7 +95,7 @@ class StolenGoodsEffect extends OneShotEffect {
|
|||
do {
|
||||
card = library.removeFromTop(game);
|
||||
if (card != null) {
|
||||
opponent.moveCardToExileWithInfo(card, source.getId(), "Stolen Goods", source.getSourceId(), game, Zone.LIBRARY);
|
||||
opponent.moveCardToExileWithInfo(card, source.getSourceId(), "Stolen Goods", source.getSourceId(), game, Zone.LIBRARY);
|
||||
}
|
||||
} while (library.size() > 0 && card != null && card.getCardType().contains(CardType.LAND));
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ class TamiyoTheMoonSageEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Card card = game.getCard(this.targetPointer.getFirst(game, source));
|
||||
if (card != null) {
|
||||
return card.moveToZone(Zone.HAND, source.getId(), game, true);
|
||||
return card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -90,9 +90,9 @@ class TerminusEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
List<Permanent> permanents = game.getBattlefield().getActivePermanents(
|
||||
new FilterCreaturePermanent(), source.getControllerId(), source.getId(), game);
|
||||
new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game);
|
||||
for (Permanent permanent : permanents) {
|
||||
permanent.moveToZone(Zone.LIBRARY, source.getId(), game, false);
|
||||
permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ class TibaltTheFiendBloodedThirdEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
List<Permanent> permanents = game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getId(), game);
|
||||
List<Permanent> permanents = game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game);
|
||||
for (Permanent permanent : permanents) {
|
||||
permanent.untap(game);
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ class VexingDevilEffect extends OneShotEffect {
|
|||
int dealt = opponent.damage(4, permanent.getId(), game, false, true);
|
||||
if (dealt == 4) {
|
||||
game.informPlayers(opponent.getName() + " was dealt 4 damage so " + permanent.getName() + " will be sacrificed.");
|
||||
permanent.sacrifice(source.getId(), game);
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
return true;
|
||||
} else {
|
||||
game.informPlayers("4 damage wasn't dealt so " + permanent.getName() + " won't be sacrificed.");
|
||||
|
|
|
@ -85,7 +85,7 @@ class FinalJudgmentEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|
||||
permanent.moveToExile(null, null,source.getId(), game);
|
||||
permanent.moveToExile(null, null,source.getSourceId(), game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ class GoryosVengeanceEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
Card card = game.getCard(targetPointer.getFirst(game, source));
|
||||
if (card != null) {
|
||||
if (controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getId())) {
|
||||
if (controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId())) {
|
||||
Permanent permanent = game.getPermanent(card.getId());
|
||||
if (permanent != null) {
|
||||
// Haste
|
||||
|
|
|
@ -102,11 +102,11 @@ class HeartOfLightEffect extends PreventionEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false);
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), event.getAmount(), false);
|
||||
if (!game.replaceEvent(preventEvent)) {
|
||||
int damage = event.getAmount();
|
||||
event.setAmount(0);
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage));
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), damage));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ public class HeedTheMists extends CardImpl {
|
|||
Card card = player.getLibrary().removeFromTop(game);
|
||||
if (card != null) {
|
||||
int cmc = card.getManaCost().convertedManaCost();
|
||||
result = card.moveToZone(Zone.GRAVEYARD, source.getId(), game, true);
|
||||
result = card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, true);
|
||||
player.drawCards(cmc, game);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -189,13 +189,13 @@ class OpalEyeKondasYojimboPreventEffect extends PreventionEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false);
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), event.getAmount(), false);
|
||||
if (!game.replaceEvent(preventEvent)) {
|
||||
if (event.getAmount() >= 1) {
|
||||
int damage = 1;
|
||||
event.setAmount(event.getAmount() - 1);
|
||||
this.used = true;
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage));
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), damage));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -107,7 +107,7 @@ public class PhantomWings extends CardImpl {
|
|||
{
|
||||
Permanent enchantedCreature = game.getPermanent(permanent.getAttachedTo());
|
||||
if (enchantedCreature != null) {
|
||||
return enchantedCreature.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
return enchantedCreature.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -121,20 +121,20 @@ class ShiningShoalPreventDamageTargetEffect extends PreventionEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false);
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), event.getAmount(), false);
|
||||
if (!game.replaceEvent(preventEvent)) {
|
||||
int prevented;
|
||||
if (event.getAmount() >= this.amount) {
|
||||
int damage = amount;
|
||||
event.setAmount(event.getAmount() - amount);
|
||||
this.used = true;
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage));
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), damage));
|
||||
prevented = damage;
|
||||
} else {
|
||||
int damage = event.getAmount();
|
||||
event.setAmount(0);
|
||||
amount -= damage;
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage));
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), damage));
|
||||
prevented = damage;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ class StreamOfConsciousnessEffect extends OneShotEffect {
|
|||
if (card != null) {
|
||||
if (player.getGraveyard().contains(card.getId())) {
|
||||
player.getGraveyard().remove(card);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, true);
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
shuffle = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ class SwayOfTheStarsEffect extends OneShotEffect {
|
|||
Player sourcePlayer = game.getPlayer(source.getControllerId());
|
||||
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
|
||||
permanent.moveToZone(Zone.LIBRARY, source.getId(), game, true);
|
||||
permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
|
||||
for (UUID playerId: sourcePlayer.getInRange()) {
|
||||
|
|
|
@ -109,7 +109,7 @@ class WaxmaneBakuTapEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
TargetPermanent target = new TargetPermanent(numberToTap, filter);
|
||||
if (target.canChoose(source.getControllerId(), game) && target.choose(Outcome.Tap, source.getControllerId(), source.getId(), game)) {
|
||||
if (target.canChoose(source.getControllerId(), game) && target.choose(Outcome.Tap, source.getControllerId(), source.getSourceId(), game)) {
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
List<UUID> targets = target.getTargets();
|
||||
for (UUID targetId : targets) {
|
||||
|
|
|
@ -111,7 +111,7 @@ class AcolytesRewardEffect extends PreventionEffectImpl {
|
|||
} else {
|
||||
amount = 0;
|
||||
}
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getControllerId(), source.getId(), source.getControllerId(), toPrevent, false);
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getControllerId(), source.getSourceId(), source.getControllerId(), toPrevent, false);
|
||||
if (!game.replaceEvent(preventEvent)) {
|
||||
Permanent targetCreature = game.getPermanent(source.getFirstTarget());
|
||||
if (targetCreature != null) {
|
||||
|
|
|
@ -99,7 +99,7 @@ class HeroOfLeinaTowerEffect extends OneShotEffect {
|
|||
if (you != null && you.chooseUse(Outcome.BoostCreature, "Do you want to to pay {X}?", game)) {
|
||||
int costX = you.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source);
|
||||
cost.add(new GenericManaCost(costX));
|
||||
if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) {
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent != null) {
|
||||
return new AddCountersSourceEffect(CounterType.P1P1.createInstance(costX), true).apply(game, source);
|
||||
|
|
|
@ -140,11 +140,11 @@ class KioraPreventionEffect extends PreventionEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false);
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), event.getAmount(), false);
|
||||
if (!game.replaceEvent(preventEvent)) {
|
||||
int damage = event.getAmount();
|
||||
event.setAmount(0);
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage));
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), damage));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -96,20 +96,20 @@ class CandlesGlowPreventDamageTargetEffect extends PreventionEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false);
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), event.getAmount(), false);
|
||||
if (!game.replaceEvent(preventEvent)) {
|
||||
int prevented;
|
||||
if (event.getAmount() >= this.amount) {
|
||||
int damage = amount;
|
||||
event.setAmount(event.getAmount() - amount);
|
||||
this.used = true;
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage));
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), damage));
|
||||
prevented = damage;
|
||||
} else {
|
||||
int damage = event.getAmount();
|
||||
event.setAmount(0);
|
||||
amount -= damage;
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage));
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), damage));
|
||||
prevented = damage;
|
||||
}
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ class FeastOfWormsEffect extends OneShotEffect {
|
|||
|
||||
Permanent land = game.getPermanent(target.getFirstTarget());
|
||||
if (land != null) {
|
||||
return land.sacrifice(source.getId(), game);
|
||||
return land.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ class FrostwielderEffect extends ReplacementEffectImpl {
|
|||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = ((ZoneChangeEvent)event).getTarget();
|
||||
if (permanent != null) {
|
||||
return permanent.moveToExile(null, "", source.getId(), game);
|
||||
return permanent.moveToExile(null, "", source.getSourceId(), game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ class HikariTwilightGuardianEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
if (permanent.moveToExile(source.getSourceId(), "Hikari, Twilight Guardian", source.getId(), game)) {
|
||||
if (permanent.moveToExile(source.getSourceId(), "Hikari, Twilight Guardian", source.getSourceId(), game)) {
|
||||
//create delayed triggered ability
|
||||
AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(
|
||||
new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
|
||||
|
|
|
@ -113,7 +113,7 @@ class KumanaoMasterYamabushiEffect extends ReplacementEffectImpl {
|
|||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = ((ZoneChangeEvent)event).getTarget();
|
||||
if (permanent != null) {
|
||||
return permanent.moveToExile(null, "", source.getId(), game);
|
||||
return permanent.moveToExile(null, "", source.getSourceId(), game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ class ManaSeismEffect extends OneShotEffect {
|
|||
for(Object uuid : sacrificeLand.getTargets()){
|
||||
Permanent land = game.getPermanent((UUID)uuid);
|
||||
if(land != null){
|
||||
land.sacrifice(source.getId(), game);
|
||||
land.sacrifice(source.getSourceId(), game);
|
||||
amount++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -199,7 +199,7 @@ public class NightDealings extends CardImpl {
|
|||
if (player.searchLibrary(target, game)) {
|
||||
Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
|
||||
String name = "Reveal";
|
||||
Cards cards = new CardsImpl();
|
||||
|
|
|
@ -109,7 +109,7 @@ class NineRingedBoEffect extends ReplacementEffectImpl {
|
|||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
|
||||
if (permanent != null) {
|
||||
return permanent.moveToExile(null, "", source.getId(), game);
|
||||
return permanent.moveToExile(null, "", source.getSourceId(), game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ class OtherworldlyJourneyEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
if (permanent.moveToExile(source.getSourceId(), "Otherworldly Journey", source.getId(), game)) {
|
||||
if (permanent.moveToExile(source.getSourceId(), "Otherworldly Journey", source.getSourceId(), game)) {
|
||||
ExileZone exile = game.getExile().getExileZone(source.getSourceId());
|
||||
// only if permanent is in exile (tokens would be stop to exist)
|
||||
if (exile != null && !exile.isEmpty()) {
|
||||
|
|
|
@ -102,7 +102,7 @@ class RagDealerExileEffect extends OneShotEffect {
|
|||
for (UUID targetID : source.getTargets().get(0).getTargets()) {
|
||||
Card card = game.getCard(targetID);
|
||||
if (card != null) {
|
||||
card.moveToExile(null, "", source.getId(), game);
|
||||
card.moveToExile(null, "", source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -105,7 +105,7 @@ class SamuraiOfThePaleCurtainEffect extends ReplacementEffectImpl {
|
|||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = ((ZoneChangeEvent)event).getTarget();
|
||||
if (permanent != null) {
|
||||
return permanent.moveToExile(null, "", source.getId(), game);
|
||||
return permanent.moveToExile(null, "", source.getSourceId(), game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ class SenseisDiviningTopEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
return permanent.moveToZone(Zone.LIBRARY, source.getId(), game, true);
|
||||
return permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ class ActivatedAbilityTarget extends TargetObject {
|
|||
|
||||
@Override
|
||||
public boolean canTarget(UUID id, Ability source, Game game) {
|
||||
if (source != null && source.getId().equals(id)) {
|
||||
if (source != null && source.getSourceId().equals(id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ class YamabushisFlameEffect extends ReplacementEffectImpl {
|
|||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = ((ZoneChangeEvent)event).getTarget();
|
||||
if (permanent != null) {
|
||||
return permanent.moveToExile(null, "", source.getId(), game);
|
||||
return permanent.moveToExile(null, "", source.getSourceId(), game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ class YamabushisStormEffect extends ReplacementEffectImpl {
|
|||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = ((ZoneChangeEvent)event).getTarget();
|
||||
if (permanent != null) {
|
||||
return permanent.moveToExile(null, "", source.getId(), game);
|
||||
return permanent.moveToExile(null, "", source.getSourceId(), game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ class CollectiveVoyageEffect extends OneShotEffect {
|
|||
for (UUID cardId : target.getTargets()) {
|
||||
Card card = player.getLibrary().getCard(cardId, game);
|
||||
if (card != null) {
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), player.getId(), true);
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), player.getId(), true);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ class VeteranExplorerEffect extends OneShotEffect {
|
|||
for (UUID cardId: (List<UUID>)target.getTargets()) {
|
||||
Card card = player.getLibrary().getCard(cardId, game);
|
||||
if (card != null) {
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), player.getId());
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), player.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,6 @@ import mage.constants.CardType;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.StackObject;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetSpell;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
@ -101,7 +100,7 @@ class ArcaneDenialEffect extends OneShotEffect {
|
|||
controller = game.getPlayer(game.getControllerId(targetId));
|
||||
}
|
||||
if (targetId != null
|
||||
&& game.getStack().counter(targetId, source.getId(), game)) {
|
||||
&& game.getStack().counter(targetId, source.getSourceId(), game)) {
|
||||
countered = true;
|
||||
}
|
||||
if (controller != null) {
|
||||
|
|
|
@ -120,13 +120,13 @@ class LimDulsVaultEffect extends OneShotEffect {
|
|||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, !doAgain);
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, !doAgain);
|
||||
}
|
||||
target.clearChosen();
|
||||
}
|
||||
if (cards.size() == 1) {
|
||||
Card card = cards.get(cards.iterator().next(), game);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, !doAgain);
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, !doAgain);
|
||||
}
|
||||
|
||||
} while (doAgain);
|
||||
|
|
|
@ -107,13 +107,13 @@ class StrategicPlanningEffect extends OneShotEffect {
|
|||
if (player.choose(Outcome.Benefit, cards, target, game)) {
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
cards.remove(card);
|
||||
}
|
||||
}
|
||||
|
||||
for (Card card : cards.getCards(game)) {
|
||||
card.moveToZone(Zone.GRAVEYARD, source.getId(), game, true);
|
||||
card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, true);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -176,7 +176,7 @@ class ConfluxEffect extends OneShotEffect {
|
|||
if (you != null) {
|
||||
you.revealCards("Conflux", cards, game);
|
||||
for (Card card : cards.getCards(game)) {
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, true);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
|
||||
}
|
||||
you.shuffleLibrary(game);
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ class DarkTemperEffect extends OneShotEffect {
|
|||
if (game.getBattlefield().countAll(filter, source.getControllerId(), game) == 0) {
|
||||
permanent.damage(2, source.getSourceId(), game, false, true);
|
||||
} else {
|
||||
permanent.destroy(source.getId(), game, false);
|
||||
permanent.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ class MartialCoupEffect extends OneShotEffect {
|
|||
permanent.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
token.putOntoBattlefield(amount, game, source.getId(), source.getControllerId());
|
||||
token.putOntoBattlefield(amount, game, source.getSourceId(), source.getControllerId());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ class ShardConvergenceEffect extends OneShotEffect {
|
|||
if (player.searchLibrary(target, game)) {
|
||||
Card card = player.getLibrary().remove(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
cards.add(card);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ class TeleminPerformanceEffect extends OneShotEffect {
|
|||
}
|
||||
if (!creatureFound) {
|
||||
cards.add(card);
|
||||
card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false);
|
||||
card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,9 +95,9 @@ class ViewFromAboveEffect extends PostResolveEffect {
|
|||
filter.add(new ColorPredicate(ObjectColor.WHITE));
|
||||
|
||||
if (game.getBattlefield().countAll(filter, source.getControllerId(), game) > 0) {
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
} else {
|
||||
card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false);
|
||||
card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ class WorldlyCounselEffect extends OneShotEffect {
|
|||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, false);
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
||||
}
|
||||
target.clearChosen();
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ class WretchedBanquetEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
if (targetCreature != null && targetCreature.getPower().getValue() <= minPower) {
|
||||
targetCreature.destroy(source.getId(), game, false);
|
||||
targetCreature.destroy(source.getSourceId(), game, false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -106,7 +106,7 @@ class DestroyEnchantedEffect extends OneShotEffect {
|
|||
creature = game.getPermanent(enchantment.getAttachedTo());
|
||||
}
|
||||
if (creature != null) {
|
||||
return creature.destroy(source.getId(), game, false);
|
||||
return creature.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -149,7 +149,7 @@ class CallToTheKindredEffect extends OneShotEffect {
|
|||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.putOntoBattlefield(game, Zone.PICK, source.getId(), source.getControllerId());
|
||||
card.putOntoBattlefield(game, Zone.PICK, source.getSourceId(), source.getControllerId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -160,13 +160,13 @@ class CallToTheKindredEffect extends OneShotEffect {
|
|||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, false);
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
||||
}
|
||||
target.clearChosen();
|
||||
}
|
||||
if (cards.size() == 1) {
|
||||
Card card = cards.get(cards.iterator().next(), game);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, false);
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -121,7 +121,7 @@ class CurseOfMisfortunesEffect extends OneShotEffect {
|
|||
this.setTargetPointer(new FixedTarget(targetPlayer.getId()));
|
||||
game.getState().setValue("attachTo:" + card.getId(), targetPlayer.getId());
|
||||
player.shuffleLibrary(game);
|
||||
return card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), source.getControllerId());
|
||||
return card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId());
|
||||
}
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
|
|
|
@ -100,7 +100,7 @@ class HauntedFengrafEffect extends OneShotEffect {
|
|||
if (cards.length > 0) {
|
||||
Random rnd = new Random();
|
||||
Card card = cards[rnd.nextInt(cards.length)];
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, true);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
|
||||
game.informPlayers(card.getName() + " returned to the hand of " + player.getName());
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ class IncreasingAmbitionEffect extends SearchEffect {
|
|||
for (UUID cardId: (List<UUID>)target.getTargets()) {
|
||||
Card card = player.getLibrary().remove(cardId, game);
|
||||
if (card != null) {
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ class IncreasingConfusionEffect extends OneShotEffect {
|
|||
for (int i = 0; i < amount; i++) {
|
||||
card = player.getLibrary().removeFromTop(game);
|
||||
if (card != null) {
|
||||
card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false);
|
||||
card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -208,7 +208,7 @@ class JarOfEyeballsEffect extends OneShotEffect {
|
|||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -218,13 +218,13 @@ class JarOfEyeballsEffect extends OneShotEffect {
|
|||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, false);
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
||||
}
|
||||
target.clearChosen();
|
||||
}
|
||||
if (cards.size() == 1) {
|
||||
Card card = cards.get(cards.iterator().next(), game);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, false);
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -102,7 +102,7 @@ class LostInTheWoodsEffect extends OneShotEffect {
|
|||
permanent.removeFromCombat(game);
|
||||
}
|
||||
}
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, false);
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -155,7 +155,7 @@ class SorinLordOfInnistradEffect extends OneShotEffect {
|
|||
if (game.getState().getZone(targetId) == Zone.GRAVEYARD) {
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null) {
|
||||
card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), player.getId());
|
||||
card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), player.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ class TrackersInstinctsEffect extends OneShotEffect {
|
|||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ class TrackersInstinctsEffect extends OneShotEffect {
|
|||
for (UUID cardId : cards) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null) {
|
||||
card.moveToZone(Zone.GRAVEYARD, source.getId(), game, true);
|
||||
card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ class WerewolfRansackerEffect extends OneShotEffect {
|
|||
for (UUID permanentId : targetPointer.getTargets(game, source)) {
|
||||
Permanent permanent = game.getPermanent(permanentId);
|
||||
if (permanent != null) {
|
||||
if (permanent.destroy(source.getId(), game, false)) {
|
||||
if (permanent.destroy(source.getSourceId(), game, false)) {
|
||||
affectedTargets++;
|
||||
if (game.getState().getZone(permanent.getId()) == Zone.GRAVEYARD) {
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
|
|
|
@ -100,7 +100,7 @@ class ZombieApocalypseEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
|
||||
for (Card card : player.getGraveyard().getCards(filterZombie, game)) {
|
||||
card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId());
|
||||
card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(card.getId());
|
||||
if (permanent != null) {
|
||||
permanent.setTapped(true);
|
||||
|
|
|
@ -94,7 +94,7 @@ class EchoingCalmEffect extends OneShotEffect {
|
|||
permanent.destroy(source.getSourceId(), game, false);
|
||||
for (Permanent perm : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
|
||||
if (perm.getName().equals(name) && perm.getCardType().contains(CardType.ENCHANTMENT))
|
||||
perm.destroy(source.getId(), game, false);
|
||||
perm.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -94,7 +94,7 @@ class SerumPowderReplaceEffect extends ReplacementEffectImpl {
|
|||
cards.add(game.getCard(cardId));
|
||||
}
|
||||
for (Card card: cards.getCards(game)) {
|
||||
card.moveToExile(null, null, source.getId(), game);
|
||||
card.moveToExile(null, null, source.getSourceId(), game);
|
||||
}
|
||||
controller.drawCards(cardsHand, game);
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ class AEherlingRemovingEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
if (permanent.moveToExile(source.getSourceId(), "AEherling Exile", source.getId(), game)) {
|
||||
if (permanent.moveToExile(source.getSourceId(), "AEherling Exile", source.getSourceId(), game)) {
|
||||
//create delayed triggered ability
|
||||
AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(
|
||||
new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
|
||||
|
|
|
@ -118,7 +118,7 @@ class EnteringReturnFromGraveyardToBattlefieldEffect extends OneShotEffect {
|
|||
player.chooseTarget(outcome, target, source, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
if (card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId())) {
|
||||
if (card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId())) {
|
||||
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(card.getId()));
|
||||
game.addEffect(effect, source);
|
||||
|
|
|
@ -207,7 +207,7 @@ class ReleaseSacrificeEffect extends OneShotEffect {
|
|||
for (UUID uuid : chosen) {
|
||||
Permanent permanent = game.getPermanent(uuid);
|
||||
if (permanent != null) {
|
||||
permanent.sacrifice(source.getId(), game);
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -93,7 +93,7 @@ class CryptIncursionEffect extends OneShotEffect {
|
|||
int exiledCards = 0;
|
||||
for (Card card: targetPlayer.getGraveyard().getCards(game)) {
|
||||
if (filter.match(card, game)) {
|
||||
if (card.moveToExile(null, "", source.getId(), game)) {
|
||||
if (card.moveToExile(null, "", source.getSourceId(), game)) {
|
||||
exiledCards++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ class DeadbridgeChantEffect extends OneShotEffect {
|
|||
targetZone = Zone.BATTLEFIELD;
|
||||
text = " put onto battlefield for ";
|
||||
}
|
||||
card.moveToZone(targetZone, source.getId(), game, false);
|
||||
card.moveToZone(targetZone, source.getSourceId(), game, false);
|
||||
game.informPlayers(new StringBuilder("Deadbridge Chant: ").append(card.getName()).append(text).append(player.getName()).toString());
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ class GazeOfGraniteEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
|
||||
if (!permanent.getCardType().contains(CardType.LAND) && permanent.getManaCost().convertedManaCost() <= source.getManaCostsToPay().getX()) {
|
||||
permanent.destroy(source.getId(), game, false);
|
||||
permanent.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -168,7 +168,7 @@ class LegionsInitiativeReturnFromExileEffect extends OneShotEffect {
|
|||
exile = exile.copy();
|
||||
for (UUID cardId: exile) {
|
||||
Card card = game.getCard(cardId);
|
||||
card.moveToZone(Zone.BATTLEFIELD, source.getId(), game, false);
|
||||
card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
|
||||
Permanent returnedCreature = game.getPermanent(cardId);
|
||||
if (returnedCreature != null) {
|
||||
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue