mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 12:31:59 -08:00
updated the Addendum condition to take into account whether a spell was actually cast
This commit is contained in:
parent
fd709bcd28
commit
53720149c6
8 changed files with 26 additions and 21 deletions
|
|
@ -1,26 +1,31 @@
|
|||
|
||||
package mage.abilities.condition.common;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
|
||||
import mage.constants.TurnPhase;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.constants.TurnPhase;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.Spell;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public enum MyMainPhaseCondition implements Condition {
|
||||
public enum AddendumCondition implements Condition {
|
||||
|
||||
instance;
|
||||
private static final Set<TurnPhase> turnPhases = EnumSet.of(TurnPhase.PRECOMBAT_MAIN, TurnPhase.POSTCOMBAT_MAIN);
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return game.isActivePlayer(source.getControllerId()) &&
|
||||
turnPhases.contains(game.getTurn().getPhase().getType());
|
||||
if (!game.isActivePlayer(source.getControllerId()) ||
|
||||
!turnPhases.contains(game.getTurn().getPhase().getType())) {
|
||||
return false;
|
||||
}
|
||||
Spell spell = game.getSpell(source.getSourceId());
|
||||
return spell != null && !spell.isCopy();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue