[EOE] Implement Dual-Sun Technique

This commit is contained in:
theelk801 2025-07-16 11:53:44 -04:00
parent 416b8880bc
commit 57780c9211
2 changed files with 72 additions and 0 deletions

View file

@ -0,0 +1,71 @@
package mage.cards.d;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.counters.CounterType;
import mage.game.Controllable;
import mage.game.Game;
import mage.target.common.TargetControlledCreaturePermanent;
import java.util.Optional;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class DualSunTechnique extends CardImpl {
public DualSunTechnique(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}");
// Target creature you control gains double strike until end of turn. If it has a +1/+1 counter on it, draw a card.
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance()));
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addEffect(new DualSunTechniqueEffect());
}
private DualSunTechnique(final DualSunTechnique card) {
super(card);
}
@Override
public DualSunTechnique copy() {
return new DualSunTechnique(this);
}
}
class DualSunTechniqueEffect extends OneShotEffect {
DualSunTechniqueEffect() {
super(Outcome.Benefit);
staticText = "If it has a +1/+1 counter on it, draw a card";
}
private DualSunTechniqueEffect(final DualSunTechniqueEffect effect) {
super(effect);
}
@Override
public DualSunTechniqueEffect copy() {
return new DualSunTechniqueEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
return Optional
.ofNullable(getTargetPointer().getFirst(game, source))
.map(game::getPermanent)
.filter(permanent -> permanent.getCounters(game).containsKey(CounterType.P1P1))
.map(x -> source)
.map(Controllable::getControllerId)
.map(game::getPlayer)
.filter(player -> player.drawCards(1, source, game) > 0)
.isPresent();
}
}

View file

@ -78,6 +78,7 @@ public final class EdgeOfEternities extends ExpansionSet {
cards.add(new SetCardInfo("Devastating Onslaught", 308, Rarity.MYTHIC, mage.cards.d.DevastatingOnslaught.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Devastating Onslaught", 308, Rarity.MYTHIC, mage.cards.d.DevastatingOnslaught.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Devastating Onslaught", 361, Rarity.MYTHIC, mage.cards.d.DevastatingOnslaught.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Devastating Onslaught", 361, Rarity.MYTHIC, mage.cards.d.DevastatingOnslaught.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Drix Fatemaker", 178, Rarity.COMMON, mage.cards.d.DrixFatemaker.class)); cards.add(new SetCardInfo("Drix Fatemaker", 178, Rarity.COMMON, mage.cards.d.DrixFatemaker.class));
cards.add(new SetCardInfo("Dual-Sun Technique", 13, Rarity.UNCOMMON, mage.cards.d.DualSunTechnique.class));
cards.add(new SetCardInfo("Dubious Delicacy", 96, Rarity.UNCOMMON, mage.cards.d.DubiousDelicacy.class)); cards.add(new SetCardInfo("Dubious Delicacy", 96, Rarity.UNCOMMON, mage.cards.d.DubiousDelicacy.class));
cards.add(new SetCardInfo("Dyadrine, Synthesis Amalgam", 216, Rarity.RARE, mage.cards.d.DyadrineSynthesisAmalgam.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Dyadrine, Synthesis Amalgam", 216, Rarity.RARE, mage.cards.d.DyadrineSynthesisAmalgam.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Dyadrine, Synthesis Amalgam", 298, Rarity.RARE, mage.cards.d.DyadrineSynthesisAmalgam.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Dyadrine, Synthesis Amalgam", 298, Rarity.RARE, mage.cards.d.DyadrineSynthesisAmalgam.class, NON_FULL_USE_VARIOUS));