mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
[EOE] Implement Singularity Rupture
This commit is contained in:
parent
ebe82151b9
commit
dddc751106
3 changed files with 49 additions and 5 deletions
36
Mage.Sets/src/mage/cards/s/SingularityRupture.java
Normal file
36
Mage.Sets/src/mage/cards/s/SingularityRupture.java
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.abilities.effects.common.DestroyAllEffect;
|
||||
import mage.abilities.effects.common.MillHalfLibraryTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SingularityRupture extends CardImpl {
|
||||
|
||||
public SingularityRupture(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{U}{B}{B}");
|
||||
|
||||
// Destroy all creatures, then any number of target players each mill half their library, rounded down.
|
||||
this.getSpellAbility().addEffect(new DestroyAllEffect(StaticFilters.FILTER_PERMANENT_CREATURES));
|
||||
this.getSpellAbility().addEffect(new MillHalfLibraryTargetEffect(false)
|
||||
.setText(", then any number of target players each mill half their library, rounded down"));
|
||||
this.getSpellAbility().addTarget(new TargetPlayer(0, Integer.MAX_VALUE, false));
|
||||
}
|
||||
|
||||
private SingularityRupture(final SingularityRupture card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingularityRupture copy() {
|
||||
return new SingularityRupture(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -60,6 +60,9 @@ public final class EdgeOfEternities extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Sacred Foundry", 377, Rarity.RARE, mage.cards.s.SacredFoundry.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Sami, Ship's Engineer", 225, Rarity.UNCOMMON, mage.cards.s.SamiShipsEngineer.class));
|
||||
cards.add(new SetCardInfo("Shattered Wings", 206, Rarity.COMMON, mage.cards.s.ShatteredWings.class));
|
||||
cards.add(new SetCardInfo("Singularity Rupture", 228, Rarity.RARE, mage.cards.s.SingularityRupture.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Singularity Rupture", 350, Rarity.RARE, mage.cards.s.SingularityRupture.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Singularity Rupture", 398, Rarity.RARE, mage.cards.s.SingularityRupture.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Sothera, the Supervoid", 115, Rarity.MYTHIC, mage.cards.s.SotheraTheSupervoid.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Sothera, the Supervoid", 360, Rarity.MYTHIC, mage.cards.s.SotheraTheSupervoid.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Sothera, the Supervoid", 382, Rarity.MYTHIC, mage.cards.s.SotheraTheSupervoid.class, NON_FULL_USE_VARIOUS));
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import mage.constants.Outcome;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
|
|
@ -31,12 +33,15 @@ public class MillHalfLibraryTargetEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
if (player == null) {
|
||||
return false;
|
||||
for (UUID playerId : getTargetPointer().getTargets(game, source)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
int count = player.getLibrary().size();
|
||||
player.millCards(count / 2 + (roundUp ? count % 2 : 0), source, game);
|
||||
}
|
||||
int count = player.getLibrary().size();
|
||||
return player.millCards(count / 2 + (roundUp ? count % 2 : 0), source, game).size() > 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue