refactor: Cleanup CopyTargetStackObjectEffect (#12220)

* simplify constructors

* rename class

* adjust to accommodate any stack object

* adjust all usages to main common class
This commit is contained in:
xenohedron 2024-05-04 00:47:16 -04:00 committed by GitHub
parent b1b83dc5b8
commit fa728eafb1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
84 changed files with 204 additions and 265 deletions

View file

@ -2,7 +2,7 @@ package mage.game.command.emblems;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.CopyTargetSpellEffect;
import mage.abilities.effects.common.CopyTargetStackObjectEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.constants.SetTargetPointer;
import mage.constants.Zone;
@ -18,7 +18,7 @@ public final class RowanScholarOfSparksEmblem extends Emblem {
public RowanScholarOfSparksEmblem() {
super("Emblem Rowan");
this.getAbilities().add(new SpellCastControllerTriggeredAbility(
Zone.COMMAND, new DoIfCostPaid(new CopyTargetSpellEffect(true), new GenericManaCost(2)),
Zone.COMMAND, new DoIfCostPaid(new CopyTargetStackObjectEffect(true), new GenericManaCost(2)),
StaticFilters.FILTER_SPELL_AN_INSTANT_OR_SORCERY, false, SetTargetPointer.SPELL
));
}

View file

@ -1,7 +1,7 @@
package mage.game.command.emblems;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.CopyTargetSpellEffect;
import mage.abilities.effects.common.CopyTargetStackObjectEffect;
import mage.constants.SetTargetPointer;
import mage.constants.Zone;
import mage.filter.StaticFilters;
@ -17,7 +17,7 @@ public final class WillKenrithEmblem extends Emblem {
super("Emblem Will Kenrith");
this.getAbilities().add(new SpellCastControllerTriggeredAbility(
Zone.COMMAND,
new CopyTargetSpellEffect(true).withSpellName("it"),
new CopyTargetStackObjectEffect(true).withText("it"),
StaticFilters.FILTER_SPELL_AN_INSTANT_OR_SORCERY,
false,
SetTargetPointer.SPELL