mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Implemented Underworld Sentinel
This commit is contained in:
parent
0a8a9ed00d
commit
e453b2ad4f
2 changed files with 84 additions and 0 deletions
83
Mage.Sets/src/mage/cards/u/UnderworldSentinel.java
Normal file
83
Mage.Sets/src/mage/cards/u/UnderworldSentinel.java
Normal file
|
@ -0,0 +1,83 @@
|
|||
package mage.cards.u;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.common.DiesTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileTargetForSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.ExileZone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class UnderworldSentinel extends CardImpl {
|
||||
|
||||
public UnderworldSentinel(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
|
||||
|
||||
this.subtype.add(SubType.SKELETON);
|
||||
this.subtype.add(SubType.SOLDIER);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
// Whenever Underworld Sentinel attacks, exile target creature card from your graveyard.
|
||||
Ability ability = new AttacksTriggeredAbility(new ExileTargetForSourceEffect(), false);
|
||||
ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
|
||||
this.addAbility(ability);
|
||||
|
||||
// When Underworld Sentinel dies, put all cards exiled with it onto the battlefield.
|
||||
this.addAbility(new DiesTriggeredAbility(new UnderworldSentinelEffect()));
|
||||
}
|
||||
|
||||
private UnderworldSentinel(final UnderworldSentinel card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UnderworldSentinel copy() {
|
||||
return new UnderworldSentinel(this);
|
||||
}
|
||||
}
|
||||
|
||||
class UnderworldSentinelEffect extends OneShotEffect {
|
||||
|
||||
UnderworldSentinelEffect() {
|
||||
super(Outcome.PutCardInPlay);
|
||||
this.staticText = "put all cards exiled with it onto the battlefield";
|
||||
}
|
||||
|
||||
private UnderworldSentinelEffect(final UnderworldSentinelEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UnderworldSentinelEffect copy() {
|
||||
return new UnderworldSentinelEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
ExileZone exileZone = game.getExile().getExileZone(
|
||||
CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter())
|
||||
);
|
||||
return exileZone != null && controller.moveCards(exileZone, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
|
@ -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("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("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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue