mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
[AFR] Implemented Green Dragon
This commit is contained in:
parent
37158ffec9
commit
ac300fbaff
2 changed files with 88 additions and 0 deletions
87
Mage.Sets/src/mage/cards/g/GreenDragon.java
Normal file
87
Mage.Sets/src/mage/cards/g/GreenDragon.java
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class GreenDragon extends CardImpl {
|
||||
|
||||
public GreenDragon(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}{G}");
|
||||
|
||||
this.subtype.add(SubType.DRAGON);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Poison Breath — When Green Dragon enters the battlefield, until end of turn, whenever a creature an opponent controls is dealt damage, destroy it.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(
|
||||
new GreenDragonDelayedTriggeredAbility(), false
|
||||
)));
|
||||
}
|
||||
|
||||
private GreenDragon(final GreenDragon card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GreenDragon copy() {
|
||||
return new GreenDragon(this);
|
||||
}
|
||||
}
|
||||
|
||||
class GreenDragonDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
||||
|
||||
public GreenDragonDelayedTriggeredAbility() {
|
||||
super(new DestroyTargetEffect(), Duration.EndOfTurn, false);
|
||||
}
|
||||
|
||||
private GreenDragonDelayedTriggeredAbility(final GreenDragonDelayedTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GreenDragonDelayedTriggeredAbility copy() {
|
||||
return new GreenDragonDelayedTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.DAMAGED_PERMANENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && permanent.isCreature()
|
||||
&& game.getOpponents(permanent.getControllerId()).contains(this.getControllerId())) {
|
||||
this.getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "until end of turn, whenever a creature an opponent controls is dealt damage, destroy it.";
|
||||
}
|
||||
}
|
||||
|
|
@ -59,6 +59,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Gloom Stalker", 16, Rarity.COMMON, mage.cards.g.GloomStalker.class));
|
||||
cards.add(new SetCardInfo("Gnoll Hunter", 185, Rarity.COMMON, mage.cards.g.GnollHunter.class));
|
||||
cards.add(new SetCardInfo("Grazilaxx, Illithid Scholar", 60, Rarity.RARE, mage.cards.g.GrazilaxxIllithidScholar.class));
|
||||
cards.add(new SetCardInfo("Green Dragon", 186, Rarity.UNCOMMON, mage.cards.g.GreenDragon.class));
|
||||
cards.add(new SetCardInfo("Guild Thief", 61, Rarity.UNCOMMON, mage.cards.g.GuildThief.class));
|
||||
cards.add(new SetCardInfo("Half-Elf Monk", 19, Rarity.COMMON, mage.cards.h.HalfElfMonk.class));
|
||||
cards.add(new SetCardInfo("Hive of the Eye Tyrant", 258, Rarity.RARE, mage.cards.h.HiveOfTheEyeTyrant.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue