From c2d717f04ac4af8eb11bffe09c4b02c6fd661fbb Mon Sep 17 00:00:00 2001 From: balazskristof <20043803+balazskristof@users.noreply.github.com> Date: Thu, 12 Jun 2025 06:54:59 +0200 Subject: [PATCH] [WHO] Implement Osgood, Operation Double --- .../mage/cards/o/OsgoodOperationDouble.java | 125 ++++++++++++++++++ Mage.Sets/src/mage/sets/DoctorWho.java | 8 +- 2 files changed, 129 insertions(+), 4 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/o/OsgoodOperationDouble.java diff --git a/Mage.Sets/src/mage/cards/o/OsgoodOperationDouble.java b/Mage.Sets/src/mage/cards/o/OsgoodOperationDouble.java new file mode 100644 index 000000000000..8f054a190932 --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/OsgoodOperationDouble.java @@ -0,0 +1,125 @@ +package mage.cards.o; + +import java.util.UUID; + +import mage.ConditionalMana; +import mage.MageInt; +import mage.MageObject; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CastSourceTriggeredAbility; +import mage.abilities.effects.keyword.InvestigateEffect; +import mage.abilities.mana.ConditionalColoredManaAbility; +import mage.abilities.mana.builder.ConditionalManaBuilder; +import mage.constants.*; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.card.CastFromZonePredicate; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.util.functions.RemoveTypeCopyApplier; + +/** + * @author balazskristof + */ +public final class OsgoodOperationDouble extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a spell from anywhere other than your hand"); + + static { + filter.add(Predicates.not(new CastFromZonePredicate(Zone.HAND))); + } + + public OsgoodOperationDouble(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.ALIEN); + this.subtype.add(SubType.SHAPESHIFTER); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When you cast this spell, create a token that's a copy of it, except it isn't legendary. + this.addAbility(new CastSourceTriggeredAbility(new OsgoodOperationDoubleEffect())); + + // {T}: Add {C}. Spend this mana only to cast an artifact spell or activate an ability of an artifact. + this.addAbility(new ConditionalColoredManaAbility(Mana.ColorlessMana(1), new OsgoodOperationDoubleManaBuilder())); + + // Paradox -- Whenever you cast a spell from anywhere other than your hand, investigate. + this.addAbility(new SpellCastControllerTriggeredAbility( + new InvestigateEffect(), + filter, false + ).setAbilityWord(AbilityWord.PARADOX)); + } + + private OsgoodOperationDouble(final OsgoodOperationDouble card) { + super(card); + } + + @Override + public OsgoodOperationDouble copy() { + return new OsgoodOperationDouble(this); + } +} + +class OsgoodOperationDoubleEffect extends OneShotEffect { + + OsgoodOperationDoubleEffect() { + super(Outcome.Benefit); + staticText = "create a token that's a copy of it, except it isn't legendary"; + } + + protected OsgoodOperationDoubleEffect(final OsgoodOperationDoubleEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell spell = game.getSpell(source.getSourceId()); + if (spell == null) { + return false; + } + spell.createCopyOnStack(game, source, source.getControllerId(), false, 1, new RemoveTypeCopyApplier(SuperType.LEGENDARY)); + return true; + } + + @Override + public OsgoodOperationDoubleEffect copy() { return new OsgoodOperationDoubleEffect(this); } +} + +class OsgoodOperationDoubleManaBuilder extends ConditionalManaBuilder { + + @Override + public ConditionalMana build(Object... options) { + return new OsgoodOperationDoubleConditionalMana(this.mana); + } + + @Override + public String getRule() { + return "Spend this mana only to cast an artifact spell or activate an ability of an artifact."; + } +} + +class OsgoodOperationDoubleConditionalMana extends ConditionalMana { + + OsgoodOperationDoubleConditionalMana(Mana mana) { + super(mana); + addCondition(OsgoodOperationDoubleCondition.instance); + } +} + +enum OsgoodOperationDoubleCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + MageObject object = game.getObject(source); + return object != null && object.isArtifact(game); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/DoctorWho.java b/Mage.Sets/src/mage/sets/DoctorWho.java index e90aca9d94dd..4c50b5ee0a49 100644 --- a/Mage.Sets/src/mage/sets/DoctorWho.java +++ b/Mage.Sets/src/mage/sets/DoctorWho.java @@ -573,10 +573,10 @@ private DoctorWho() { cards.add(new SetCardInfo("Ominous Cemetery", 189, Rarity.UNCOMMON, mage.cards.o.OminousCemetery.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Ominous Cemetery", 794, Rarity.UNCOMMON, mage.cards.o.OminousCemetery.class, NON_FULL_USE_VARIOUS)); //cards.add(new SetCardInfo("Ood Sphere", 594, Rarity.COMMON, mage.cards.o.OodSphere.class)); - //cards.add(new SetCardInfo("Osgood, Operation Double", 191, Rarity.RARE, mage.cards.o.OsgoodOperationDouble.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Osgood, Operation Double", 367, Rarity.RARE, mage.cards.o.OsgoodOperationDouble.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Osgood, Operation Double", 796, Rarity.RARE, mage.cards.o.OsgoodOperationDouble.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Osgood, Operation Double", 958, Rarity.RARE, mage.cards.o.OsgoodOperationDouble.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Osgood, Operation Double", 191, Rarity.RARE, mage.cards.o.OsgoodOperationDouble.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Osgood, Operation Double", 367, Rarity.RARE, mage.cards.o.OsgoodOperationDouble.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Osgood, Operation Double", 796, Rarity.RARE, mage.cards.o.OsgoodOperationDouble.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Osgood, Operation Double", 958, Rarity.RARE, mage.cards.o.OsgoodOperationDouble.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Out of Time", 1058, Rarity.RARE, mage.cards.o.OutOfTime.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Out of Time", 209, Rarity.RARE, mage.cards.o.OutOfTime.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Out of Time", 467, Rarity.RARE, mage.cards.o.OutOfTime.class, NON_FULL_USE_VARIOUS));