mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
Implemented Eon Frolicker
This commit is contained in:
parent
3c4f93c44d
commit
4bfbfe2232
2 changed files with 101 additions and 0 deletions
100
Mage.Sets/src/mage/cards/e/EonFrolicker.java
Normal file
100
Mage.Sets/src/mage/cards/e/EonFrolicker.java
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.CastFromEverywhereSourceCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityControllerEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.ProtectionAbility;
|
||||
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.FilterObject;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.turn.TurnMod;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetOpponent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class EonFrolicker extends CardImpl {
|
||||
|
||||
public EonFrolicker(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
|
||||
|
||||
this.subtype.add(SubType.ELEMENTAL);
|
||||
this.subtype.add(SubType.OTTER);
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// When Eon Frolicker enters the battlefield, if you cast it, target opponent takes an extra turn after this one. Until your next turn, you and planeswalkers you control gain protection from that player.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new EonFrolickerEffect()),
|
||||
CastFromEverywhereSourceCondition.instance, "When {this} enters the battlefield, " +
|
||||
"if you cast it, target opponent takes an extra turn after this one. Until your next turn, " +
|
||||
"you and planeswalkers you control gain protection from that player."
|
||||
);
|
||||
ability.addTarget(new TargetOpponent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private EonFrolicker(final EonFrolicker card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EonFrolicker copy() {
|
||||
return new EonFrolicker(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EonFrolickerEffect extends OneShotEffect {
|
||||
|
||||
EonFrolickerEffect() {
|
||||
super(Outcome.Benefit);
|
||||
}
|
||||
|
||||
private EonFrolickerEffect(final EonFrolickerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EonFrolickerEffect copy() {
|
||||
return new EonFrolickerEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
game.getState().getTurnMods().add(new TurnMod(player.getId(), false));
|
||||
FilterObject filter = new FilterObject(player.getName());
|
||||
filter.add(new ControllerIdPredicate(player.getId()));
|
||||
Ability ability = new ProtectionAbility(filter);
|
||||
game.addEffect(new GainAbilityControlledEffect(
|
||||
ability, Duration.UntilYourNextTurn,
|
||||
StaticFilters.FILTER_PERMANENT_PLANESWALKER
|
||||
), source);
|
||||
game.addEffect(new GainAbilityControllerEffect(
|
||||
ability, Duration.UntilYourNextTurn
|
||||
), source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -121,6 +121,7 @@ public final class Commander2020Edition extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Dualcaster Mage", 150, Rarity.RARE, mage.cards.d.DualcasterMage.class));
|
||||
cards.add(new SetCardInfo("Duneblast", 211, Rarity.RARE, mage.cards.d.Duneblast.class));
|
||||
cards.add(new SetCardInfo("Endless Sands", 272, Rarity.RARE, mage.cards.e.EndlessSands.class));
|
||||
cards.add(new SetCardInfo("Eon Frolicker", 33, Rarity.RARE, mage.cards.e.EonFrolicker.class));
|
||||
cards.add(new SetCardInfo("Etali, Primal Storm", 151, Rarity.RARE, mage.cards.e.EtaliPrimalStorm.class));
|
||||
cards.add(new SetCardInfo("Eternal Dragon", 88, Rarity.RARE, mage.cards.e.EternalDragon.class));
|
||||
cards.add(new SetCardInfo("Ever After", 133, Rarity.RARE, mage.cards.e.EverAfter.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue