mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
[TLA] Implement Earthbender Ascension
This commit is contained in:
parent
dc07b24ed3
commit
6b482f2afc
3 changed files with 100 additions and 8 deletions
95
Mage.Sets/src/mage/cards/e/EarthbenderAscension.java
Normal file
95
Mage.Sets/src/mage/cards/e/EarthbenderAscension.java
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.LandfallAbility;
|
||||
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.SourceHasCounterCondition;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
|
||||
import mage.abilities.effects.keyword.EarthbendTargetEffect;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.common.TargetControlledLandPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class EarthbenderAscension extends CardImpl {
|
||||
|
||||
public EarthbenderAscension(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
|
||||
|
||||
// When this enchantment enters, earthbend 2. Then search your library for a basic land card, put it onto the battlefield tapped, then shuffle.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new EarthbendTargetEffect(2));
|
||||
ability.addEffect(new SearchLibraryPutInPlayEffect(
|
||||
new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), true
|
||||
).concatBy("Then"));
|
||||
ability.addTarget(new TargetControlledLandPermanent());
|
||||
this.addAbility(ability);
|
||||
|
||||
// Landfall -- Whenever a land you control enters, put a quest counter on this enchantment. When you do, if it has four or more quest counters on it, put a +1/+1 counter on target creature you control. It gains trample until end of turn.
|
||||
this.addAbility(new LandfallAbility(new EarthbenderAscensionEffect()));
|
||||
}
|
||||
|
||||
private EarthbenderAscension(final EarthbenderAscension card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EarthbenderAscension copy() {
|
||||
return new EarthbenderAscension(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EarthbenderAscensionEffect extends OneShotEffect {
|
||||
|
||||
private static final Condition condition = new SourceHasCounterCondition(CounterType.QUEST, ComparisonType.MORE_THAN, 3);
|
||||
|
||||
EarthbenderAscensionEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "put a quest counter on {this}. When you do, if it has four or more quest counters on it, " +
|
||||
"put a +1/+1 counter on target creature you control. It gains trample until end of turn";
|
||||
}
|
||||
|
||||
private EarthbenderAscensionEffect(final EarthbenderAscensionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EarthbenderAscensionEffect copy() {
|
||||
return new EarthbenderAscensionEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
|
||||
if (permanent == null || !permanent.addCounters(CounterType.QUEST.createInstance(), source, game)) {
|
||||
return false;
|
||||
}
|
||||
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(
|
||||
new AddCountersTargetEffect(CounterType.P1P1.createInstance()), false, "When you do, " +
|
||||
"if it has four or more quest counters on it, put a +1/+1 counter on target creature you control. " +
|
||||
"It gains trample until end of turn", condition
|
||||
);
|
||||
ability.addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance()));
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
game.fireReflexiveTriggeredAbility(ability, source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -82,6 +82,8 @@ public final class AvatarTheLastAirbender extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Earth Rumble Wrestlers", 218, Rarity.COMMON, mage.cards.e.EarthRumbleWrestlers.class));
|
||||
cards.add(new SetCardInfo("Earth Rumble", 174, Rarity.UNCOMMON, mage.cards.e.EarthRumble.class));
|
||||
cards.add(new SetCardInfo("Earth Village Ruffians", 219, Rarity.COMMON, mage.cards.e.EarthVillageRuffians.class));
|
||||
cards.add(new SetCardInfo("Earthbender Ascension", 175, Rarity.RARE, mage.cards.e.EarthbenderAscension.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Earthbender Ascension", 307, Rarity.RARE, mage.cards.e.EarthbenderAscension.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Earthbending Lesson", 176, Rarity.COMMON, mage.cards.e.EarthbendingLesson.class));
|
||||
cards.add(new SetCardInfo("Enter the Avatar State", 18, Rarity.UNCOMMON, mage.cards.e.EnterTheAvatarState.class));
|
||||
cards.add(new SetCardInfo("Epic Downfall", 96, Rarity.UNCOMMON, mage.cards.e.EpicDownfall.class));
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import mage.util.CardUtil;
|
|||
public class ReflexiveTriggeredAbility extends DelayedTriggeredAbility {
|
||||
|
||||
private final String text;
|
||||
private final Condition condition;
|
||||
|
||||
public ReflexiveTriggeredAbility(Effect effect, boolean optional) {
|
||||
this(effect, optional, null);
|
||||
|
|
@ -27,13 +26,14 @@ public class ReflexiveTriggeredAbility extends DelayedTriggeredAbility {
|
|||
public ReflexiveTriggeredAbility(Effect effect, boolean optional, String text, Condition condition) {
|
||||
super(effect, Duration.EndOfTurn, true, optional);
|
||||
this.text = text;
|
||||
this.condition = condition;
|
||||
if (condition != null) {
|
||||
this.withInterveningIf(condition);
|
||||
}
|
||||
}
|
||||
|
||||
protected ReflexiveTriggeredAbility(final ReflexiveTriggeredAbility ability) {
|
||||
super(ability);
|
||||
this.text = ability.text;
|
||||
this.condition = ability.condition;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -55,11 +55,6 @@ public class ReflexiveTriggeredAbility extends DelayedTriggeredAbility {
|
|||
return CardUtil.getTextWithFirstCharUpperCase(text) + '.';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkInterveningIfClause(Game game) {
|
||||
return condition == null || condition.apply(game, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReflexiveTriggeredAbility setTriggerPhrase(String triggerPhrase) {
|
||||
super.setTriggerPhrase(triggerPhrase);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue