mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
[KHM] Implemented Replicating Ring
This commit is contained in:
parent
16c3cfceb1
commit
4ea5898360
4 changed files with 113 additions and 0 deletions
83
Mage.Sets/src/mage/cards/r/ReplicatingRing.java
Normal file
83
Mage.Sets/src/mage/cards/r/ReplicatingRing.java
Normal file
|
@ -0,0 +1,83 @@
|
|||
package mage.cards.r;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.mana.AnyColorManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.ReplicatedRingToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class ReplicatingRing extends CardImpl {
|
||||
|
||||
public ReplicatingRing(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||
|
||||
this.addSuperType(SuperType.SNOW);
|
||||
|
||||
// {T}: Add one mana of any color.
|
||||
this.addAbility(new AnyColorManaAbility());
|
||||
|
||||
// At the beginning of your upkeep, put a night counter on Replicating Ring. Then if it has eight or more night counters on it, remove all of them and create eight colorless snow artifact tokens named Replicated Ring with "{T}: Add one mana of any color."
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
|
||||
new ReplicatingRingEffect(), TargetController.YOU, false
|
||||
));
|
||||
}
|
||||
|
||||
private ReplicatingRing(final ReplicatingRing card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReplicatingRing copy() {
|
||||
return new ReplicatingRing(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ReplicatingRingEffect extends OneShotEffect {
|
||||
|
||||
ReplicatingRingEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "put a night counter on {this}. Then if it has eight or more night counters on it, " +
|
||||
"remove all of them and create eight colorless snow artifact tokens named " +
|
||||
"Replicated Ring with \"{T}: Add one mana of any color.\"";
|
||||
}
|
||||
|
||||
private ReplicatingRingEffect(final ReplicatingRingEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReplicatingRingEffect copy() {
|
||||
return new ReplicatingRingEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
|
||||
if (permanent != null) {
|
||||
permanent.addCounters(CounterType.NIGHT.createInstance(), source, game);
|
||||
}
|
||||
permanent = source.getSourcePermanentOrLKI(game);
|
||||
if (permanent == null || permanent.getCounters(game).getCount(CounterType.NIGHT) < 8) {
|
||||
return true;
|
||||
}
|
||||
permanent.removeCounters(CounterType.NIGHT.createInstance(
|
||||
permanent.getCounters(game).getCount(CounterType.NIGHT)
|
||||
),source,game);
|
||||
new ReplicatedRingToken().putOntoBattlefield(8, game, source, source.getControllerId());
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -95,6 +95,7 @@ public final class Kaldheim extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Ravenform", 72, Rarity.COMMON, mage.cards.r.Ravenform.class));
|
||||
cards.add(new SetCardInfo("Realmwalker", 188, Rarity.RARE, mage.cards.r.Realmwalker.class));
|
||||
cards.add(new SetCardInfo("Renegade Reaper", 386, Rarity.UNCOMMON, mage.cards.r.RenegadeReaper.class));
|
||||
cards.add(new SetCardInfo("Replicating Ring", 244, Rarity.UNCOMMON, mage.cards.r.ReplicatingRing.class));
|
||||
cards.add(new SetCardInfo("Rimewood Falls", 266, Rarity.COMMON, mage.cards.r.RimewoodFalls.class));
|
||||
cards.add(new SetCardInfo("Sarulf's Packmate", 192, Rarity.COMMON, mage.cards.s.SarulfsPackmate.class));
|
||||
cards.add(new SetCardInfo("Sarulf, Realm Eater", 228, Rarity.RARE, mage.cards.s.SarulfRealmEater.class));
|
||||
|
|
|
@ -105,6 +105,7 @@ public enum CounterType {
|
|||
MUSIC("music"),
|
||||
MUSTER("muster"),
|
||||
NET("net"),
|
||||
NIGHT("night"),
|
||||
OMEN("omen"),
|
||||
ORE("ore"),
|
||||
P0P1(new BoostCounter(0, 1).name),
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.abilities.mana.AnyColorManaAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SuperType;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class ReplicatedRingToken extends TokenImpl {
|
||||
|
||||
public ReplicatedRingToken() {
|
||||
super("Replicated Ring", "colorless snow artifact token named Replicated Ring with \"{T}: Add one mana of any color.\"");
|
||||
this.addSuperType(SuperType.SNOW);
|
||||
cardType.add(CardType.ARTIFACT);
|
||||
this.addAbility(new AnyColorManaAbility());
|
||||
}
|
||||
|
||||
|
||||
private ReplicatedRingToken(final ReplicatedRingToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReplicatedRingToken copy() {
|
||||
return new ReplicatedRingToken(this);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue