mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 12:49:39 -08:00
Migrated some card moving callers to non-deprecated method.
Since the function the were calling just calls into the non-deprecated method, this is a low risk change.
This commit is contained in:
parent
bd51cd5f77
commit
4b6bbacd8c
35 changed files with 46 additions and 41 deletions
|
|
@ -101,7 +101,7 @@ class SzadekLordOfSecretsEffect extends ReplacementEffectImpl {
|
|||
if (permanent != null) {
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(damageEvent.getAmount()), game);
|
||||
if (damagedPlayer != null) {
|
||||
damagedPlayer.moveCards(damagedPlayer.getLibrary().getTopCards(game, damageEvent.getAmount()), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
damagedPlayer.moveCards(damagedPlayer.getLibrary().getTopCards(game, damageEvent.getAmount()), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class ExtractFromDarknessMillEffect extends OneShotEffect {
|
|||
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.moveCards(player.getLibrary().getTopCards(game, 2), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
player.moveCards(player.getLibrary().getTopCards(game, 2), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class ChillOfForebodingEffect extends OneShotEffect {
|
|||
for (UUID playerId : game.getState().getPlayersInRange(sourcePlayer.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.moveCards(player.getLibrary().getTopCards(game, 5), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
player.moveCards(player.getLibrary().getTopCards(game, 5), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class IncreasingConfusionEffect extends OneShotEffect {
|
|||
if (spell.getFromZone() == Zone.GRAVEYARD) {
|
||||
amount *= 2;
|
||||
}
|
||||
player.moveCards(player.getLibrary().getTopCards(game, amount), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
player.moveCards(player.getLibrary().getTopCards(game, amount), Zone.GRAVEYARD, source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class TrialEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
}
|
||||
controller.moveCards(toHand, null, Zone.HAND, source, game);
|
||||
controller.moveCards(toHand, Zone.HAND, source, game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class SanityGrindingEffect extends OneShotEffect {
|
|||
Player targetOpponent = game.getPlayer(source.getFirstTarget());
|
||||
if (targetOpponent != null) {
|
||||
targetOpponent.moveCards(targetOpponent.getLibrary().getTopCards(game, new ChromaSanityGrindingCount(revealed).calculate(game, source, this)),
|
||||
Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
return controller.putCardsOnBottomOfLibrary(revealed, game, source, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class PsychicStrikeEffect extends OneShotEffect {
|
|||
if (stackObject != null) {
|
||||
Player controller = game.getPlayer(stackObject.getControllerId());
|
||||
if (controller != null) {
|
||||
controller.moveCards(controller.getLibrary().getTopCards(game, 2), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
controller.moveCards(controller.getLibrary().getTopCards(game, 2), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
}
|
||||
return countered;
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class DemonicConsultationEffect extends OneShotEffect {
|
|||
game.informPlayers("Card named: " + name);
|
||||
|
||||
// Exile the top six cards of your library,
|
||||
controller.moveCards(controller.getLibrary().getTopCards(game, 6), null, Zone.EXILED, source, game);
|
||||
controller.moveCards(controller.getLibrary().getTopCards(game, 6), Zone.EXILED, source, game);
|
||||
|
||||
// then reveal cards from the top of your library until you reveal the named card.
|
||||
Cards cardsToReaveal = new CardsImpl();
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class HereticsPunishmentEffect extends OneShotEffect {
|
|||
maxCost = test;
|
||||
}
|
||||
}
|
||||
controller.moveCards(cardList, Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
controller.moveCards(cardList, Zone.GRAVEYARD, source, game);
|
||||
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
|
||||
if (permanent != null) {
|
||||
permanent.damage(maxCost, source.getSourceId(), game, false, true);
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ class UndeadAlchemistEffect extends ReplacementEffectImpl {
|
|||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Player player = game.getPlayer(event.getTargetId());
|
||||
if (player != null) {
|
||||
return player.moveCards(player.getLibrary().getTopCards(game, event.getAmount()), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
return player.moveCards(player.getLibrary().getTopCards(game, event.getAmount()), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class CountermandEffect extends OneShotEffect {
|
|||
if (stackObject != null) {
|
||||
Player controller = game.getPlayer(stackObject.getControllerId());
|
||||
if (controller != null) {
|
||||
controller.moveCards(controller.getLibrary().getTopCards(game, 4), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
controller.moveCards(controller.getLibrary().getTopCards(game, 4), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
}
|
||||
return countered;
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class BookBurningMillEffect extends OneShotEffect {
|
|||
if (millCards) {
|
||||
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
if (targetPlayer != null) {
|
||||
targetPlayer.moveCards(targetPlayer.getLibrary().getTopCards(game, 6), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
targetPlayer.moveCards(targetPlayer.getLibrary().getTopCards(game, 6), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class NarsetEnlightenedMasterExileEffect extends OneShotEffect {
|
|||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (player != null && sourceObject != null) {
|
||||
Set<Card> cards = player.getLibrary().getTopCards(game, 4);
|
||||
player.moveCards(cards, Zone.LIBRARY, Zone.EXILED, source, game);
|
||||
player.moveCards(cards, Zone.EXILED, source, game);
|
||||
for (Card card : cards) {
|
||||
if (game.getState().getZone(card.getId()) == Zone.EXILED
|
||||
&& !card.getCardType().contains(CardType.CREATURE)
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ class BrokenAmbitionsEffect extends OneShotEffect {
|
|||
game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
}
|
||||
if (ClashEffect.getInstance().apply(game, source)) {
|
||||
controller.moveCards(controller.getLibrary().getTopCards(game, 4), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
controller.moveCards(controller.getLibrary().getTopCards(game, 4), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class WarpWorldEffect extends OneShotEffect {
|
|||
Integer count = 0;
|
||||
if (set != null) {
|
||||
count = set.size();
|
||||
player.moveCards(set, Zone.BATTLEFIELD, Zone.LIBRARY, source, game);
|
||||
player.moveCards(set, Zone.LIBRARY, source, game);
|
||||
}
|
||||
|
||||
if (count > 0) {
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class JaceMindseekerEffect extends OneShotEffect {
|
|||
Player targetOpponent = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (targetOpponent != null) {
|
||||
Set<Card> allCards = targetOpponent.getLibrary().getTopCards(game, 5);
|
||||
targetOpponent.moveCards(allCards, Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
targetOpponent.moveCards(allCards, Zone.GRAVEYARD, source, game);
|
||||
for (Card card : allCards) {
|
||||
if (filter.match(card, game)) {
|
||||
Zone zone = game.getState().getZone(card.getId());
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class TalentOfTheTelepathEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
|
||||
targetOpponent.moveCards(allCards, Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
targetOpponent.moveCards(allCards, Zone.GRAVEYARD, source, game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class CrumblingSanctuaryEffect extends PreventionEffectImpl {
|
|||
Player player = game.getPlayer(event.getTargetId());
|
||||
if(player != null) {
|
||||
preventDamageAction(event, source, game);
|
||||
player.moveCards(player.getLibrary().getTopCards(game, amount), Zone.LIBRARY, Zone.EXILED, source, game);
|
||||
player.moveCards(player.getLibrary().getTopCards(game, amount), Zone.EXILED, source, game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ class ChancellorOfTheSpiresEffect extends OneShotEffect {
|
|||
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
|
||||
Player opponent = game.getPlayer(opponentId);
|
||||
if (opponent != null) {
|
||||
opponent.moveCards(opponent.getLibrary().getTopCards(game, 7), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
opponent.moveCards(opponent.getLibrary().getTopCards(game, 7), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ class MindcrankEffect extends OneShotEffect {
|
|||
if (amount == null) {
|
||||
amount = 0;
|
||||
}
|
||||
targetPlayer.moveCards(targetPlayer.getLibrary().getTopCards(game, amount), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
targetPlayer.moveCards(targetPlayer.getLibrary().getTopCards(game, amount), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class PsychicSpiralEffect extends OneShotEffect {
|
|||
if (cardsInGraveyard > 0) {
|
||||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
||||
if (targetPlayer != null) {
|
||||
targetPlayer.moveCards(targetPlayer.getLibrary().getTopCards(game, cardsInGraveyard), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
targetPlayer.moveCards(targetPlayer.getLibrary().getTopCards(game, cardsInGraveyard), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class KeeningStoneEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (player != null) {
|
||||
player.moveCards(player.getLibrary().getTopCards(game, player.getGraveyard().size()), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
player.moveCards(player.getLibrary().getTopCards(game, player.getGraveyard().size()), Zone.GRAVEYARD, source, game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class CloudhoofKirinEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
if (targetPlayer != null) {
|
||||
return targetPlayer.moveCards(targetPlayer.getLibrary().getTopCards(game, spell.getConvertedManaCost()), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
return targetPlayer.moveCards(targetPlayer.getLibrary().getTopCards(game, spell.getConvertedManaCost()), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class GrindclockEffect extends OneShotEffect {
|
|||
int amount = game.getPermanent(source.getSourceId()).getCounters().getCount(CounterType.CHARGE);
|
||||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
||||
if (targetPlayer != null) {
|
||||
targetPlayer.moveCards(targetPlayer.getLibrary().getTopCards(game, amount), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
targetPlayer.moveCards(targetPlayer.getLibrary().getTopCards(game, amount), Zone.GRAVEYARD, source, game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -27,8 +27,10 @@
|
|||
*/
|
||||
package mage.sets.shadowsoverinnistrad;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.ActivatedAbility;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
|
@ -133,7 +135,10 @@ class HarnessTheStormEffect extends OneShotEffect {
|
|||
Card card = controller.getGraveyard().get(getTargetPointer().getFirst(game, source), game);
|
||||
if (card != null) {
|
||||
if (controller.chooseUse(outcome, "Cast " + card.getIdName() + " from your graveyard?", source, game)) {
|
||||
controller.cast(card.getSpellAbility(), game, false);
|
||||
//LinkedHashMap<UUID, ActivatedAbility> useableAbilities = controller.getUseableActivatedAbilities(object, zone, game);
|
||||
//if (useableAbilities != null && useableAbilities.size() > 0) {
|
||||
//controller.activateAbility(useableAbilities, card, game);
|
||||
//}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class AltarOfDementiaEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
if (amount > 0) {
|
||||
player.moveCards(player.getLibrary().getTopCards(game, amount), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
player.moveCards(player.getLibrary().getTopCards(game, amount), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class TraumatizeEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (player != null) {
|
||||
int amount = player.getLibrary().size() / 2;
|
||||
return player.moveCards(player.getLibrary().getTopCards(game, amount), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
return player.moveCards(player.getLibrary().getTopCards(game, amount), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class CephalidVandalEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null && controller != null) {
|
||||
int amount = permanent.getCounters().getCount(CounterType.SHRED);
|
||||
controller.moveCards(controller.getLibrary().getTopCards(game, amount), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
controller.moveCards(controller.getLibrary().getTopCards(game, amount), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class WhetstoneEffect extends OneShotEffect {
|
|||
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.moveCards(player.getLibrary().getTopCards(game, 2), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
player.moveCards(player.getLibrary().getTopCards(game, 2), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue