mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 12:19:59 -08:00
[ECL] Implement Harmonized Crescendo
This commit is contained in:
parent
03c74b616e
commit
c991700567
2 changed files with 88 additions and 0 deletions
83
Mage.Sets/src/mage/cards/h/HarmonizedCrescendo.java
Normal file
83
Mage.Sets/src/mage/cards/h/HarmonizedCrescendo.java
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
package mage.cards.h;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.ConvokeAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.choices.Choice;
|
||||
import mage.choices.ChoiceCreatureType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class HarmonizedCrescendo extends CardImpl {
|
||||
|
||||
public HarmonizedCrescendo(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{U}{U}");
|
||||
|
||||
// Convoke
|
||||
this.addAbility(new ConvokeAbility());
|
||||
|
||||
// Choose a creature type. Draw a card for each permanent you control of that type.
|
||||
this.getSpellAbility().addEffect(new HarmonizedCrescendoEffect());
|
||||
}
|
||||
|
||||
private HarmonizedCrescendo(final HarmonizedCrescendo card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HarmonizedCrescendo copy() {
|
||||
return new HarmonizedCrescendo(this);
|
||||
}
|
||||
}
|
||||
|
||||
class HarmonizedCrescendoEffect extends OneShotEffect {
|
||||
|
||||
HarmonizedCrescendoEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "choose a creature type. Draw a card for each permanent you control of that type";
|
||||
}
|
||||
|
||||
private HarmonizedCrescendoEffect(final HarmonizedCrescendoEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HarmonizedCrescendoEffect copy() {
|
||||
return new HarmonizedCrescendoEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
Choice choice = new ChoiceCreatureType(game, source);
|
||||
player.choose(outcome, choice, game);
|
||||
SubType subType = SubType.fromString(choice.getChoice());
|
||||
if (subType == null) {
|
||||
return false;
|
||||
}
|
||||
game.informPlayers(CardUtil.getSourceLogName(game, source) + ": " + player.getLogName() + " chooses " + subType);
|
||||
int count = game
|
||||
.getBattlefield()
|
||||
.getActivePermanents(StaticFilters.FILTER_CONTROLLED_PERMANENT, source.getControllerId(), source, game)
|
||||
.stream()
|
||||
.filter(permanent -> permanent.hasSubtype(subType, game))
|
||||
.mapToInt(x -> 1)
|
||||
.sum();
|
||||
return count > 0 && player.drawCards(count, source, game) > 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -100,6 +100,11 @@ public final class LorwynEclipsed extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Hallowed Fountain", "347b", Rarity.RARE, mage.cards.h.HallowedFountain.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Hallowed Fountain", 265, Rarity.RARE, mage.cards.h.HallowedFountain.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Hallowed Fountain", 347, Rarity.RARE, mage.cards.h.HallowedFountain.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Harmonized Crescendo", 357, Rarity.RARE, mage.cards.h.HarmonizedCrescendo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Harmonized Crescendo", 384, Rarity.MYTHIC, mage.cards.h.HarmonizedCrescendo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Harmonized Crescendo", 394, Rarity.MYTHIC, mage.cards.h.HarmonizedCrescendo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Harmonized Crescendo", 408, Rarity.RARE, mage.cards.h.HarmonizedCrescendo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Harmonized Crescendo", 54, Rarity.RARE, mage.cards.h.HarmonizedCrescendo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Heirloom Auntie", 107, Rarity.COMMON, mage.cards.h.HeirloomAuntie.class));
|
||||
cards.add(new SetCardInfo("Hexing Squelcher", 145, Rarity.RARE, mage.cards.h.HexingSquelcher.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Hexing Squelcher", 317, Rarity.RARE, mage.cards.h.HexingSquelcher.class, NON_FULL_USE_VARIOUS));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue