[PIP] Implement ED-E, Lonesome Eyebot (#12238)

This commit is contained in:
Cameron Merkel 2024-05-20 22:51:56 -05:00 committed by GitHub
parent f8a159839e
commit 769863c6d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 94 additions and 0 deletions

View file

@ -0,0 +1,90 @@
package mage.cards.e;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksWithCreaturesTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.condition.Condition;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.IntPlusDynamicValue;
import mage.abilities.dynamicvalue.common.CountersSourceCount;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
* @author Cguy7777
*/
public final class EDELonesomeEyebot extends CardImpl {
public EDELonesomeEyebot(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
this.supertype.add(SuperType.LEGENDARY);
this.subtype.add(SubType.ROBOT);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Flying
this.addAbility(FlyingAbility.getInstance());
// ED-E My Love -- Whenever you attack, if the number of attacking creatures is greater than the number of quest counters on
// ED-E, Lonesome Eyebot, put a quest counter on it.
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new AttacksWithCreaturesTriggeredAbility(new AddCountersSourceEffect(CounterType.QUEST.createInstance()), 1),
EDELonesomeEyebotCondition.instance,
"Whenever you attack, if the number of attacking creatures is " +
"greater than the number of quest counters on {this}, put a quest counter on it."
).withFlavorWord("ED-E My Love"));
// {2}, Sacrifice ED-E: Draw a card, then draw an additional card for each quest counter on ED-E.
Ability ability = new SimpleActivatedAbility(
new DrawCardSourceControllerEffect(
new IntPlusDynamicValue(1, new CountersSourceCount(CounterType.QUEST)))
.setText("draw a card, then draw an additional card for each quest counter on {this}"),
new GenericManaCost(2));
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);
}
private EDELonesomeEyebot(final EDELonesomeEyebot card) {
super(card);
}
@Override
public EDELonesomeEyebot copy() {
return new EDELonesomeEyebot(this);
}
}
enum EDELonesomeEyebotCondition implements Condition {
instance;
private static final DynamicValue attackingCreatureCount
= new PermanentsOnBattlefieldCount(StaticFilters.FILTER_ATTACKING_CREATURES);
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
if (permanent == null) {
return false;
}
return attackingCreatureCount.calculate(game, source, null) > permanent.getCounters(game).getCount(CounterType.QUEST);
}
}

View file

@ -108,6 +108,10 @@ public final class Fallout extends ExpansionSet {
cards.add(new SetCardInfo("Dragonskull Summit", 261, Rarity.RARE, mage.cards.d.DragonskullSummit.class));
cards.add(new SetCardInfo("Drowned Catacomb", 262, Rarity.RARE, mage.cards.d.DrownedCatacomb.class));
cards.add(new SetCardInfo("Duchess, Wayward Tavernkeep", 57, Rarity.RARE, mage.cards.d.DuchessWaywardTavernkeep.class));
cards.add(new SetCardInfo("ED-E, Lonesome Eyebot", 131, Rarity.RARE, mage.cards.e.EDELonesomeEyebot.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("ED-E, Lonesome Eyebot", 432, Rarity.RARE, mage.cards.e.EDELonesomeEyebot.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("ED-E, Lonesome Eyebot", 659, Rarity.RARE, mage.cards.e.EDELonesomeEyebot.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("ED-E, Lonesome Eyebot", 960, Rarity.RARE, mage.cards.e.EDELonesomeEyebot.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Elder Arthur Maxson", 102, Rarity.RARE, mage.cards.e.ElderArthurMaxson.class));
cards.add(new SetCardInfo("Elder Owyn Lyons", 103, Rarity.UNCOMMON, mage.cards.e.ElderOwynLyons.class));
cards.add(new SetCardInfo("Electrosiphon", 104, Rarity.RARE, mage.cards.e.Electrosiphon.class, NON_FULL_USE_VARIOUS));