Implemented Underworld Rage-Hound

This commit is contained in:
Evan Kranzler 2019-12-20 19:35:27 -05:00
parent e453b2ad4f
commit 88a1b9fe22
3 changed files with 132 additions and 0 deletions

View file

@ -0,0 +1,43 @@
package mage.cards.u;
import mage.MageInt;
import mage.abilities.common.AttacksEachCombatStaticAbility;
import mage.abilities.keyword.EscapeAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class UnderworldRageHound extends CardImpl {
public UnderworldRageHound(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
this.subtype.add(SubType.ELEMENTAL);
this.subtype.add(SubType.HOUND);
this.power = new MageInt(3);
this.toughness = new MageInt(1);
// Underworld Rage-Hound attacks each combat if able.
this.addAbility(new AttacksEachCombatStaticAbility());
// Escape{3}{R}, Exile three other cards from your graveyard.
this.addAbility(new EscapeAbility(this, "{3}{R}", 3));
// Underworld Rage-Hound escapes with a +1/+1 counter on it.
}
private UnderworldRageHound(final UnderworldRageHound card) {
super(card);
}
@Override
public UnderworldRageHound copy() {
return new UnderworldRageHound(this);
}
}

View file

@ -57,6 +57,7 @@ public final class TherosBeyondDeath extends ExpansionSet {
cards.add(new SetCardInfo("Terror of Mount Velus", 295, Rarity.RARE, mage.cards.t.TerrorOfMountVelus.class)); cards.add(new SetCardInfo("Terror of Mount Velus", 295, Rarity.RARE, mage.cards.t.TerrorOfMountVelus.class));
cards.add(new SetCardInfo("The Akroan War", 124, Rarity.RARE, mage.cards.t.TheAkroanWar.class)); cards.add(new SetCardInfo("The Akroan War", 124, Rarity.RARE, mage.cards.t.TheAkroanWar.class));
cards.add(new SetCardInfo("Treeshaker Chimera", 297, Rarity.RARE, mage.cards.t.TreeshakerChimera.class)); cards.add(new SetCardInfo("Treeshaker Chimera", 297, Rarity.RARE, mage.cards.t.TreeshakerChimera.class));
cards.add(new SetCardInfo("Underworld Rage-Hound", 163, Rarity.COMMON, mage.cards.u.UnderworldRageHound.class));
cards.add(new SetCardInfo("Underworld Sentinel", 293, Rarity.COMMON, mage.cards.u.UnderworldSentinel.class)); cards.add(new SetCardInfo("Underworld Sentinel", 293, Rarity.COMMON, mage.cards.u.UnderworldSentinel.class));
cards.add(new SetCardInfo("Victory's Envoy", 289, Rarity.COMMON, mage.cards.v.VictorysEnvoy.class)); cards.add(new SetCardInfo("Victory's Envoy", 289, Rarity.COMMON, mage.cards.v.VictorysEnvoy.class));
} }

View file

@ -0,0 +1,88 @@
package mage.abilities.common;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.effects.EntersBattlefieldEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.EscapeAbility;
import mage.constants.AbilityType;
import mage.constants.Outcome;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.util.CardUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* @author TheElk801
*/
public class EscapesWithAbility extends EntersBattlefieldAbility {
private final int counters;
public EscapesWithAbility(int counters) {
super(new EscapesWithEffect(counters), false);
this.counters = counters;
}
private EscapesWithAbility(final EscapesWithAbility ability) {
super(ability);
this.counters = ability.counters;
}
@Override
public EscapesWithAbility copy() {
return new EscapesWithAbility(this);
}
@Override
public String getRule() {
return "{this} escapes with " + CardUtil.numberToText(counters, "a")
+ " +1/+1 counter" + (counters > 1 ? 's' : "") + " on it.";
}
}
class EscapesWithEffect extends OneShotEffect {
private final int counter;
EscapesWithEffect(int counter) {
super(Outcome.BoostCreature);
this.counter = counter;
}
private EscapesWithEffect(final EscapesWithEffect effect) {
super(effect);
this.counter = effect.counter;
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent == null && source.getAbilityType() == AbilityType.STATIC) {
permanent = game.getPermanentEntering(source.getSourceId());
}
if (permanent == null) {
return false;
}
SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
if (!(spellAbility instanceof EscapeAbility)
|| !spellAbility.getSourceId().equals(source.getSourceId())
|| permanent.getZoneChangeCounter(game) != spellAbility.getSourceObjectZoneChangeCounter()
|| !spellAbility.getSourceId().equals(source.getSourceId())) {
return false;
}
List<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects");
permanent.addCounters(CounterType.P1P1.createInstance(counter), source, game, appliedEffects);
return true;
}
@Override
public EscapesWithEffect copy() {
return new EscapesWithEffect(this);
}
}