mirror of
https://github.com/correl/mage.git
synced 2025-03-12 17:00:08 -09:00
[AFC] Implemented Death Tyrant
This commit is contained in:
parent
e8db40bb8d
commit
5e67314c96
3 changed files with 106 additions and 1 deletions
104
Mage.Sets/src/mage/cards/d/DeathTyrant.java
Normal file
104
Mage.Sets/src/mage/cards/d/DeathTyrant.java
Normal file
|
@ -0,0 +1,104 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.ZombieToken;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class DeathTyrant extends CardImpl {
|
||||
|
||||
public DeathTyrant(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}");
|
||||
|
||||
this.subtype.add(SubType.BEHOLDER);
|
||||
this.subtype.add(SubType.SKELETON);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
// Menace
|
||||
this.addAbility(new MenaceAbility());
|
||||
|
||||
// Negative Energy Cone — Whenever an attacking creature you control or a blocking creature an opponent controls dies, create a 2/2 black Zombie creature token.
|
||||
this.addAbility(new DeathTyrantTriggeredAbility().withFlavorWord("Negative Energy Cone"));
|
||||
|
||||
// {5}{B}: Return Death Tyrant from your graveyard to the battlefield tapped.
|
||||
this.addAbility(new SimpleActivatedAbility(
|
||||
Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(true),
|
||||
new ManaCostsImpl<>("{5}{B}")
|
||||
));
|
||||
}
|
||||
|
||||
private DeathTyrant(final DeathTyrant card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeathTyrant copy() {
|
||||
return new DeathTyrant(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DeathTyrantTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public DeathTyrantTriggeredAbility() {
|
||||
super(Zone.ALL, new CreateTokenEffect(new ZombieToken()));
|
||||
}
|
||||
|
||||
private DeathTyrantTriggeredAbility(final DeathTyrantTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeathTyrantTriggeredAbility copy() {
|
||||
return new DeathTyrantTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (zEvent.isDiesEvent()) {
|
||||
Permanent permanent = zEvent.getTarget();
|
||||
if (permanent != null && permanent.isCreature(game)) {
|
||||
if (permanent.isControlledBy(controllerId) && permanent.isAttacking()) {
|
||||
return true;
|
||||
}
|
||||
return game.getOpponents(controllerId).contains(permanent.getControllerId()) && permanent.getBlocking() > 0;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
|
||||
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTriggerPhrase() {
|
||||
return "Whenever an attacking creature you control or a blocking creature an opponent controls dies, ";
|
||||
}
|
||||
}
|
|
@ -79,6 +79,7 @@ public final class ForgottenRealmsCommander extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Dark-Dweller Oracle", 119, Rarity.RARE, mage.cards.d.DarkDwellerOracle.class));
|
||||
cards.add(new SetCardInfo("Darkwater Catacombs", 232, Rarity.RARE, mage.cards.d.DarkwaterCatacombs.class));
|
||||
cards.add(new SetCardInfo("Dead Man's Chest", 97, Rarity.RARE, mage.cards.d.DeadMansChest.class));
|
||||
cards.add(new SetCardInfo("Death Tyrant", 23, Rarity.RARE, mage.cards.d.DeathTyrant.class));
|
||||
cards.add(new SetCardInfo("Decree of Savagery", 156, Rarity.RARE, mage.cards.d.DecreeOfSavagery.class));
|
||||
cards.add(new SetCardInfo("Demanding Dragon", 120, Rarity.RARE, mage.cards.d.DemandingDragon.class));
|
||||
cards.add(new SetCardInfo("Desert", 233, Rarity.UNCOMMON, mage.cards.d.Desert.class));
|
||||
|
|
|
@ -1723,7 +1723,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
|
|||
Zone fromZone = game.getState().getZone(objectId);
|
||||
Player controller = game.getPlayer(controllerId);
|
||||
if (controller != null) {
|
||||
ZoneChangeEvent event = new ZoneChangeEvent(this, source, controllerId, fromZone, toZone, appliedEffects);
|
||||
ZoneChangeEvent event = new ZoneChangeEvent(this.copy(), source, controllerId, fromZone, toZone, appliedEffects);
|
||||
ZoneChangeInfo zoneChangeInfo;
|
||||
if (toZone == Zone.LIBRARY) {
|
||||
zoneChangeInfo = new ZoneChangeInfo.Library(event, flag /* put on top */);
|
||||
|
|
Loading…
Add table
Reference in a new issue