foul-magics/Mage/src/main/java/mage/game/stack/StackObject.java
Evan Kranzler 9c56a98dc9
Refactor implementation of spell copies for cards like Twinning Staff as well as refactor handling of target changing (WIP) (#7662)
* refactored createCopyOnStack to be void

* added new interface for modifying copied spellsspells

* update implementation of Fork to use new applier

* reworked epic effect

* add applier to spell copy code

* updated implementation of Beamsplitter Mage

* updated cards which copy for each possible target

* added support for additional copies having targets changed

* fixed/ignored failing tests

* updated target changing to prevent unnecessary choosing

* added test for Twinning Staff

* updated implementation of spell copy applier

* added new method for choosing order of copies on stack

* fixed test failures

* [TSR] various text fixes

* fixed a test failure

* [SLD] fixed Rick, Steadfast Leader only counting Human creatures

* updated test framework to handle skips without affecting starting player choice

* fixed another test failure

* updated copy messaging for consistency

* added copy messaging to stack abilities
2021-03-12 12:47:49 -05:00

46 lines
1.3 KiB
Java

package mage.game.stack;
import mage.MageObject;
import mage.abilities.Ability;
import mage.constants.Zone;
import mage.constants.ZoneDetail;
import mage.filter.predicate.Predicate;
import mage.game.Controllable;
import mage.game.Game;
import mage.util.functions.SpellCopyApplier;
import java.util.UUID;
public interface StackObject extends MageObject, Controllable {
boolean resolve(Game game);
UUID getSourceId();
/**
* @param source null for fizzled events (sourceId will be null)
* @param game
*/
void counter(Ability source, Game game);
void counter(Ability source, Game game, Zone zone, boolean owner, ZoneDetail zoneDetail);
Ability getStackAbility();
boolean chooseNewTargets(Game game, UUID playerId, boolean forceChange, boolean onlyOneTarget, Predicate extraPredicate);
boolean canTarget(Game game, UUID targetId);
void createCopyOnStack(Game game, Ability source, UUID newControllerId, boolean chooseNewTargets);
void createCopyOnStack(Game game, Ability source, UUID newControllerId, boolean chooseNewTargets, int amount);
void createCopyOnStack(Game game, Ability source, UUID newControllerId, boolean chooseNewTargets, int amount, SpellCopyApplier applier);
boolean isTargetChanged();
void setTargetChanged(boolean targetChanged);
@Override
StackObject copy();
}