mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
[DMU] Implemented Queen Allenal of Ruadach
This commit is contained in:
parent
6c91714020
commit
163a13dc45
2 changed files with 105 additions and 0 deletions
104
Mage.Sets/src/mage/cards/q/QueenAllenalOfRuadach.java
Normal file
104
Mage.Sets/src/mage/cards/q/QueenAllenalOfRuadach.java
Normal file
|
@ -0,0 +1,104 @@
|
|||
package mage.cards.q;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
|
||||
import mage.constants.*;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.CreateTokenEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.token.SoldierToken;
|
||||
import mage.game.permanent.token.Token;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class QueenAllenalOfRuadach extends CardImpl {
|
||||
|
||||
private static final PermanentsOnBattlefieldCount count
|
||||
= new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURES);
|
||||
|
||||
public QueenAllenalOfRuadach(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}{W}{W}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.ELF);
|
||||
this.subtype.add(SubType.NOBLE);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(0);
|
||||
|
||||
// Queen Allenal of Ruadach's power and toughness are each equal to the number of creatures you control.
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.ALL,
|
||||
new SetPowerToughnessSourceEffect(count, Duration.EndOfGame)
|
||||
));
|
||||
|
||||
// If one or more creature tokens would be created under your control, those tokens plus a 1/1 white Soldier creature token are created instead.
|
||||
this.addAbility(new SimpleStaticAbility(new QueenAllenalOfRuadachEffect()));
|
||||
}
|
||||
|
||||
private QueenAllenalOfRuadach(final QueenAllenalOfRuadach card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueenAllenalOfRuadach copy() {
|
||||
return new QueenAllenalOfRuadach(this);
|
||||
}
|
||||
}
|
||||
|
||||
class QueenAllenalOfRuadachEffect extends ReplacementEffectImpl {
|
||||
|
||||
public QueenAllenalOfRuadachEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit);
|
||||
this.staticText = "If one or more creature tokens would be created under your control, those tokens plus a 1/1 white Soldier creature token are created instead.";
|
||||
}
|
||||
|
||||
private QueenAllenalOfRuadachEffect(final QueenAllenalOfRuadachEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueenAllenalOfRuadachEffect copy() {
|
||||
return new QueenAllenalOfRuadachEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.CREATE_TOKEN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (source.isControlledBy(event.getPlayerId())) {
|
||||
for (Map.Entry<Token, Integer> entry : ((CreateTokenEvent) event).getTokens().entrySet()) {
|
||||
if (entry.getValue() > 0 && entry.getKey().isCreature(game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Map<Token, Integer> tokens = ((CreateTokenEvent) event).getTokens();
|
||||
for (Map.Entry<Token, Integer> entry : tokens.entrySet()) {
|
||||
if (entry.getKey() instanceof SoldierToken) {
|
||||
entry.setValue(entry.getValue() + 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
tokens.put(new SoldierToken(), 1);
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -169,6 +169,7 @@ public final class DominariaUnited extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Plains", 262, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Prayer of Binding", 28, Rarity.UNCOMMON, mage.cards.p.PrayerOfBinding.class));
|
||||
cards.add(new SetCardInfo("Protect the Negotiators", 62, Rarity.UNCOMMON, mage.cards.p.ProtectTheNegotiators.class));
|
||||
cards.add(new SetCardInfo("Queen Allenal of Ruadach", 210, Rarity.UNCOMMON, mage.cards.q.QueenAllenalOfRuadach.class));
|
||||
cards.add(new SetCardInfo("Radha's Firebrand", 141, Rarity.RARE, mage.cards.r.RadhasFirebrand.class));
|
||||
cards.add(new SetCardInfo("Radha, Coalition Warlord", 211, Rarity.UNCOMMON, mage.cards.r.RadhaCoalitionWarlord.class));
|
||||
cards.add(new SetCardInfo("Radiant Grove", 253, Rarity.COMMON, mage.cards.r.RadiantGrove.class));
|
||||
|
|
Loading…
Reference in a new issue