mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Implemented Game Plan, added new class for Timetwister effects
This commit is contained in:
parent
1dfe0d8d0a
commit
8fb03574e6
10 changed files with 145 additions and 284 deletions
|
|
@ -0,0 +1,45 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class ShuffleHandGraveyardAllEffect extends OneShotEffect {
|
||||
|
||||
public ShuffleHandGraveyardAllEffect() {
|
||||
super(Outcome.Neutral);
|
||||
staticText = "each player shuffles their hand and graveyard into their library";
|
||||
}
|
||||
|
||||
public ShuffleHandGraveyardAllEffect(final ShuffleHandGraveyardAllEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.moveCards(player.getHand(), Zone.LIBRARY, source, game);
|
||||
player.moveCards(player.getGraveyard(), Zone.LIBRARY, source, game);
|
||||
player.shuffleLibrary(source, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShuffleHandGraveyardAllEffect copy() {
|
||||
return new ShuffleHandGraveyardAllEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue