mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
new common class: SourceEnteredThisTurnCondition (#10415)
* Create new common condition class * Use common condition on nine cards where appropriate
This commit is contained in:
parent
749f2e3991
commit
50105c0372
10 changed files with 55 additions and 142 deletions
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
package mage.abilities.condition.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
* @author xenohedron
|
||||
*/
|
||||
|
||||
public enum SourceEnteredThisTurnCondition implements Condition {
|
||||
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = source.getSourcePermanentOrLKI(game);
|
||||
return permanent != null && permanent.getTurnsOnBattlefield() == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{this} entered the battlefield this turn";
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue