mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
[CLB] Implemented Ambitious Dragonborn
This commit is contained in:
parent
07a8cc6bc9
commit
aef01f034e
2 changed files with 89 additions and 0 deletions
88
Mage.Sets/src/mage/cards/a/AmbitiousDragonborn.java
Normal file
88
Mage.Sets/src/mage/cards/a/AmbitiousDragonborn.java
Normal file
|
@ -0,0 +1,88 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.abilities.hint.ValueHint;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class AmbitiousDragonborn extends CardImpl {
|
||||
|
||||
private static final Hint hint = new ValueHint(
|
||||
"Greatest power among creatures you control and in your graveyard", AmbitiousDragonbornValue.instance
|
||||
);
|
||||
|
||||
public AmbitiousDragonborn(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
|
||||
|
||||
this.subtype.add(SubType.DRAGON);
|
||||
this.subtype.add(SubType.BARBARIAN);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(0);
|
||||
|
||||
// Ambitious Dragonborn enters the battlefield with X +1/+1 counters on it, where X is the greatest power among creatures you control and creature cards in your graveyard.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(
|
||||
CounterType.P1P1.createInstance(), AmbitiousDragonbornValue.instance, false
|
||||
), "with X +1/+1 counters on it, where X is the greatest power " +
|
||||
"among creatures you control and creature cards in your graveyard"));
|
||||
}
|
||||
|
||||
private AmbitiousDragonborn(final AmbitiousDragonborn card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AmbitiousDragonborn copy() {
|
||||
return new AmbitiousDragonborn(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum AmbitiousDragonbornValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Player player = game.getPlayer(sourceAbility.getControllerId());
|
||||
if (player == null) {
|
||||
return 0;
|
||||
}
|
||||
return Stream.concat(
|
||||
player.getGraveyard()
|
||||
.getCards(StaticFilters.FILTER_CARD_CREATURE, game)
|
||||
.stream(),
|
||||
game.getBattlefield()
|
||||
.getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE,
|
||||
sourceAbility.getControllerId(), sourceAbility, game
|
||||
).stream()
|
||||
).map(MageObject::getPower).mapToInt(MageInt::getValue).max().orElse(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AmbitiousDragonbornValue copy() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "";
|
||||
}
|
||||
}
|
|
@ -31,6 +31,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Altar of Bhaal", 109, Rarity.RARE, mage.cards.a.AltarOfBhaal.class));
|
||||
cards.add(new SetCardInfo("Amber Gristle O'Maul", 159, Rarity.UNCOMMON, mage.cards.a.AmberGristleOMaul.class));
|
||||
cards.add(new SetCardInfo("Ambition's Cost", 110, Rarity.UNCOMMON, mage.cards.a.AmbitionsCost.class));
|
||||
cards.add(new SetCardInfo("Ambitious Dragonborn", 213, Rarity.COMMON, mage.cards.a.AmbitiousDragonborn.class));
|
||||
cards.add(new SetCardInfo("Amethyst Dragon", 160, Rarity.UNCOMMON, mage.cards.a.AmethystDragon.class));
|
||||
cards.add(new SetCardInfo("Ancient Brass Dragon", 111, Rarity.MYTHIC, mage.cards.a.AncientBrassDragon.class));
|
||||
cards.add(new SetCardInfo("Ancient Bronze Dragon", 214, Rarity.MYTHIC, mage.cards.a.AncientBronzeDragon.class));
|
||||
|
|
Loading…
Reference in a new issue