mirror of
https://github.com/magefree/mage.git
synced 2025-12-29 23:12:10 -08:00
[MKM] Implement Audience with Trostani
This commit is contained in:
parent
00fbce101c
commit
3b99ac0d41
2 changed files with 88 additions and 0 deletions
87
Mage.Sets/src/mage/cards/a/AudienceWithTrostani.java
Normal file
87
Mage.Sets/src/mage/cards/a/AudienceWithTrostani.java
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.abilities.hint.ValueHint;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.PermanentToken;
|
||||
import mage.game.permanent.token.PlantToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class AudienceWithTrostani extends CardImpl {
|
||||
|
||||
public AudienceWithTrostani(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}");
|
||||
|
||||
// Create a 0/1 green Plant creature token, then draw cards equal to the number of differently named creature tokens you control.
|
||||
this.getSpellAbility().addEffect(new CreateTokenEffect(new PlantToken()));
|
||||
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(AudienceWithTrostaniValue.instance)
|
||||
.setText(", then draw cards equal to the number of differently named creature tokens you control"));
|
||||
this.getSpellAbility().addHint(AudienceWithTrostaniValue.getHint());
|
||||
}
|
||||
|
||||
private AudienceWithTrostani(final AudienceWithTrostani card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AudienceWithTrostani copy() {
|
||||
return new AudienceWithTrostani(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum AudienceWithTrostaniValue implements DynamicValue {
|
||||
instance;
|
||||
private static final Hint hint = new ValueHint(
|
||||
"Different names among creature tokens you control", instance
|
||||
);
|
||||
|
||||
public static Hint getHint() {
|
||||
return hint;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
return game
|
||||
.getBattlefield()
|
||||
.getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE,
|
||||
sourceAbility.getControllerId(), sourceAbility, game
|
||||
)
|
||||
.stream()
|
||||
.filter(PermanentToken.class::isInstance)
|
||||
.map(MageObject::getName)
|
||||
.filter(s -> !s.isEmpty())
|
||||
.distinct()
|
||||
.mapToInt(x -> 1)
|
||||
.sum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AudienceWithTrostaniValue copy() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "1";
|
||||
}
|
||||
}
|
||||
|
|
@ -30,6 +30,7 @@ public final class MurdersAtKarlovManor extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Alley Assailant", 76, Rarity.COMMON, mage.cards.a.AlleyAssailant.class));
|
||||
cards.add(new SetCardInfo("Alquist Proft, Master Sleuth", 185, Rarity.MYTHIC, mage.cards.a.AlquistProftMasterSleuth.class));
|
||||
cards.add(new SetCardInfo("Assassin's Trophy", 187, Rarity.RARE, mage.cards.a.AssassinsTrophy.class));
|
||||
cards.add(new SetCardInfo("Audience with Trostani", 152, Rarity.RARE, mage.cards.a.AudienceWithTrostani.class));
|
||||
cards.add(new SetCardInfo("Aurelia, the Law Above", 188, Rarity.RARE, mage.cards.a.AureliaTheLawAbove.class));
|
||||
cards.add(new SetCardInfo("Auspicious Arrival", 5, Rarity.COMMON, mage.cards.a.AuspiciousArrival.class));
|
||||
cards.add(new SetCardInfo("Basilica Stalker", 78, Rarity.COMMON, mage.cards.b.BasilicaStalker.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue