mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Implemented Bogardan Phoenix
This commit is contained in:
parent
c4ce367c56
commit
5ba0717086
3 changed files with 95 additions and 0 deletions
93
Mage.Sets/src/mage/cards/b/BogardanPhoenix.java
Normal file
93
Mage.Sets/src/mage/cards/b/BogardanPhoenix.java
Normal file
|
@ -0,0 +1,93 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.counters.Counters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class BogardanPhoenix extends CardImpl {
|
||||
|
||||
public BogardanPhoenix(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}{R}");
|
||||
|
||||
this.subtype.add(SubType.PHOENIX);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// When Bogardan Phoenix dies, exile it if it had a death counter on it. Otherwise, return it to the battlefield under your control and put a death counter on it.
|
||||
this.addAbility(new DiesTriggeredAbility(new BogardanPhoenixEffect(), false));
|
||||
}
|
||||
|
||||
public BogardanPhoenix(final BogardanPhoenix card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BogardanPhoenix copy() {
|
||||
return new BogardanPhoenix(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BogardanPhoenixEffect extends OneShotEffect {
|
||||
|
||||
public BogardanPhoenixEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "exile it if it had a death counter on it. "
|
||||
+ "Otherwise, return it to the battlefield under your control "
|
||||
+ "and put a death counter on it.";
|
||||
}
|
||||
|
||||
public BogardanPhoenixEffect(final BogardanPhoenixEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BogardanPhoenixEffect copy() {
|
||||
return new BogardanPhoenixEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (permanent == null
|
||||
|| controller == null
|
||||
|| permanent.getZoneChangeCounter(game) + 1
|
||||
!= source.getSourceObjectZoneChangeCounter()) {
|
||||
return false;
|
||||
}
|
||||
Card card = game.getCard(permanent.getId());
|
||||
if (card == null || card.getZoneChangeCounter(game) != source.getSourceObjectZoneChangeCounter()) {
|
||||
return false;
|
||||
}
|
||||
if (permanent.getCounters(game).containsKey(CounterType.DEATH)) {
|
||||
return controller.moveCards(card, Zone.EXILED, source, game);
|
||||
} else {
|
||||
Counters countersToAdd = new Counters();
|
||||
countersToAdd.addCounter(CounterType.DEATH.createInstance());
|
||||
game.setEnterWithCounters(source.getSourceId(), countersToAdd);
|
||||
return controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -34,6 +34,7 @@ public final class Visions extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Army Ants", 126, Rarity.UNCOMMON, mage.cards.a.ArmyAnts.class));
|
||||
cards.add(new SetCardInfo("Betrayal", 26, Rarity.COMMON, mage.cards.b.Betrayal.class));
|
||||
cards.add(new SetCardInfo("Blanket of Night", 52, Rarity.UNCOMMON, mage.cards.b.BlanketOfNight.class));
|
||||
cards.add(new SetCardInfo("Bogardan Phoenix", 76, Rarity.RARE, mage.cards.b.BogardanPhoenix.class));
|
||||
cards.add(new SetCardInfo("Brass-Talon Chimera", 142, Rarity.UNCOMMON, mage.cards.b.BrassTalonChimera.class));
|
||||
cards.add(new SetCardInfo("Breathstealer's Crypt", 127, Rarity.RARE, mage.cards.b.BreathstealersCrypt.class));
|
||||
cards.add(new SetCardInfo("Breezekeeper", 27, Rarity.COMMON, mage.cards.b.Breezekeeper.class));
|
||||
|
|
|
@ -25,6 +25,7 @@ public enum CounterType {
|
|||
CRYSTAL("crystal"),
|
||||
CUBE("cube"),
|
||||
CURRENCY("currency"),
|
||||
DEATH("death"),
|
||||
DELAY("delay"),
|
||||
DEPLETION("depletion"),
|
||||
DESPAIR("despair"),
|
||||
|
|
Loading…
Reference in a new issue