mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 04:42:07 -08:00
[FIN] Implement Traveling Chocobo
This commit is contained in:
parent
5578b3847a
commit
a863837e20
2 changed files with 121 additions and 0 deletions
113
Mage.Sets/src/mage/cards/t/TravelingChocobo.java
Normal file
113
Mage.Sets/src/mage/cards/t/TravelingChocobo.java
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.continuous.LookAtTopCardOfLibraryAnyTimeEffect;
|
||||
import mage.abilities.effects.common.continuous.PlayFromTopOfLibraryEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.EntersTheBattlefieldEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.NumberOfTriggersEvent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class TravelingChocobo extends CardImpl {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("play lands and cast Bird spells");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(
|
||||
CardType.LAND.getPredicate(),
|
||||
SubType.BIRD.getPredicate()
|
||||
));
|
||||
}
|
||||
|
||||
public TravelingChocobo(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}");
|
||||
|
||||
this.subtype.add(SubType.BIRD);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// You may look at the top card of your library any time.
|
||||
this.addAbility(new SimpleStaticAbility(new LookAtTopCardOfLibraryAnyTimeEffect()));
|
||||
|
||||
// You may play lands and cast Bird spells from the top of your library.
|
||||
this.addAbility(new SimpleStaticAbility(new PlayFromTopOfLibraryEffect(filter)));
|
||||
|
||||
// If a land or Bird you control entering the battlefield causes a triggered ability of a permanent you control to trigger, that ability triggers an additional time.
|
||||
this.addAbility(new SimpleStaticAbility(new TravelingChocoboEffect()));
|
||||
}
|
||||
|
||||
private TravelingChocobo(final TravelingChocobo card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TravelingChocobo copy() {
|
||||
return new TravelingChocobo(this);
|
||||
}
|
||||
}
|
||||
|
||||
class TravelingChocoboEffect extends ReplacementEffectImpl {
|
||||
|
||||
TravelingChocoboEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit);
|
||||
staticText = "if land or Bird entering the battlefield causes a triggered ability " +
|
||||
"of a permanent you control to trigger, that ability triggers an additional time";
|
||||
}
|
||||
|
||||
private TravelingChocoboEffect(final TravelingChocoboEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TravelingChocoboEffect copy() {
|
||||
return new TravelingChocoboEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.NUMBER_OF_TRIGGERS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (!(event instanceof NumberOfTriggersEvent)) {
|
||||
return false;
|
||||
}
|
||||
NumberOfTriggersEvent numberOfTriggersEvent = (NumberOfTriggersEvent) event;
|
||||
if (!source.isControlledBy(event.getPlayerId())) {
|
||||
return false;
|
||||
}
|
||||
GameEvent sourceEvent = numberOfTriggersEvent.getSourceEvent();
|
||||
if (sourceEvent == null
|
||||
|| sourceEvent.getType() != GameEvent.EventType.ENTERS_THE_BATTLEFIELD
|
||||
|| !(sourceEvent instanceof EntersTheBattlefieldEvent)) {
|
||||
return false;
|
||||
}
|
||||
EntersTheBattlefieldEvent entersTheBattlefieldEvent = (EntersTheBattlefieldEvent) sourceEvent;
|
||||
return (entersTheBattlefieldEvent.getTarget().isLand(game)
|
||||
|| entersTheBattlefieldEvent.getTarget().hasSubtype(SubType.BIRD, game))
|
||||
&& game.getPermanent(numberOfTriggersEvent.getSourceId()) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
event.setAmount(event.getAmount() + 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -161,6 +161,14 @@ public final class FinalFantasy extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Tifa Lockhart", 536, Rarity.RARE, mage.cards.t.TifaLockhart.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Tonberry", 122, Rarity.UNCOMMON, mage.cards.t.Tonberry.class));
|
||||
cards.add(new SetCardInfo("Town Greeter", 209, Rarity.COMMON, mage.cards.t.TownGreeter.class));
|
||||
cards.add(new SetCardInfo("Traveling Chocobo", 210, Rarity.MYTHIC, mage.cards.t.TravelingChocobo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Traveling Chocobo", 406, Rarity.MYTHIC, mage.cards.t.TravelingChocobo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Traveling Chocobo", 551, Rarity.MYTHIC, mage.cards.t.TravelingChocobo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Traveling Chocobo", "551a", Rarity.MYTHIC, mage.cards.t.TravelingChocobo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Traveling Chocobo", "551b", Rarity.MYTHIC, mage.cards.t.TravelingChocobo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Traveling Chocobo", "551c", Rarity.MYTHIC, mage.cards.t.TravelingChocobo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Traveling Chocobo", "551d", Rarity.MYTHIC, mage.cards.t.TravelingChocobo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Traveling Chocobo", "551f", Rarity.MYTHIC, mage.cards.t.TravelingChocobo.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Ultimecia, Omnipotent", 247, Rarity.UNCOMMON, mage.cards.u.UltimeciaOmnipotent.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Ultimecia, Omnipotent", 513, Rarity.UNCOMMON, mage.cards.u.UltimeciaOmnipotent.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Ultimecia, Time Sorceress", 247, Rarity.UNCOMMON, mage.cards.u.UltimeciaTimeSorceress.class, NON_FULL_USE_VARIOUS));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue