[CLB] Implemented Halsin, Emerald Archdruid

This commit is contained in:
Evan Kranzler 2022-05-25 20:14:32 -04:00
parent 6f7f0122a2
commit 7a7f7e4761
2 changed files with 118 additions and 0 deletions

View file

@ -0,0 +1,117 @@
package mage.cards.h;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.ChooseABackgroundAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class HalsinEmeraldArchdruid extends CardImpl {
private static final FilterPermanent filter = new FilterControlledPermanent("token you control");
static {
filter.add(TokenPredicate.TRUE);
}
public HalsinEmeraldArchdruid(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.ELF);
this.subtype.add(SubType.DRUID);
this.power = new MageInt(2);
this.toughness = new MageInt(4);
// {1}: Until end of turn, target token you control becomes a green Bear creature with base power and toughness 4/4 in addition to its other types and colors.
Ability ability = new SimpleActivatedAbility(new HalsinEmeraldArchdruidEffect(), new GenericManaCost(1));
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);
// Choose a Background
this.addAbility(ChooseABackgroundAbility.getInstance());
}
private HalsinEmeraldArchdruid(final HalsinEmeraldArchdruid card) {
super(card);
}
@Override
public HalsinEmeraldArchdruid copy() {
return new HalsinEmeraldArchdruid(this);
}
}
class HalsinEmeraldArchdruidEffect extends ContinuousEffectImpl {
HalsinEmeraldArchdruidEffect() {
super(Duration.EndOfTurn, Outcome.Benefit);
staticText = "until end of turn, target token you control becomes a green Bear creature " +
"with base power and toughness 4/4 in addition to its other types and colors";
}
private HalsinEmeraldArchdruidEffect(final HalsinEmeraldArchdruidEffect effect) {
super(effect);
}
@Override
public HalsinEmeraldArchdruidEffect copy() {
return new HalsinEmeraldArchdruidEffect(this);
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (permanent == null) {
discard();
return false;
}
switch (layer) {
case TypeChangingEffects_4:
permanent.addCardType(game, CardType.CREATURE);
permanent.addSubType(game, SubType.BEAR);
return true;
case ColorChangingEffects_5:
permanent.getColor(game).setGreen(true);
return true;
case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) {
permanent.getPower().setValue(4);
permanent.getToughness().setValue(4);
return true;
}
}
return false;
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
@Override
public boolean hasLayer(Layer layer) {
switch (layer) {
case TypeChangingEffects_4:
case ColorChangingEffects_5:
case PTChangingEffects_7:
return true;
}
return false;
}
}

View file

@ -92,6 +92,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet {
cards.add(new SetCardInfo("Gorion, Wise Mentor", 276, Rarity.RARE, mage.cards.g.GorionWiseMentor.class));
cards.add(new SetCardInfo("Greatsword of Tyr", 22, Rarity.COMMON, mage.cards.g.GreatswordOfTyr.class));
cards.add(new SetCardInfo("Gut, True Soul Zealot", 180, Rarity.UNCOMMON, mage.cards.g.GutTrueSoulZealot.class));
cards.add(new SetCardInfo("Halsin, Emerald Archdruid", 234, Rarity.UNCOMMON, mage.cards.h.HalsinEmeraldArchdruid.class));
cards.add(new SetCardInfo("Hammers of Moradin", 25, Rarity.UNCOMMON, mage.cards.h.HammersOfMoradin.class));
cards.add(new SetCardInfo("Hardy Outlander", 235, Rarity.UNCOMMON, mage.cards.h.HardyOutlander.class));
cards.add(new SetCardInfo("Horn of Valhalla", 26, Rarity.RARE, mage.cards.h.HornOfValhalla.class));