mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 12:52:06 -08:00
[FIN] Implement Cactuar
This commit is contained in:
parent
1553ec0bf7
commit
1375d31dde
14 changed files with 66 additions and 19 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.abilities.condition.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -9,20 +8,23 @@ import mage.game.permanent.Permanent;
|
|||
/**
|
||||
* @author xenohedron
|
||||
*/
|
||||
|
||||
public enum SourceEnteredThisTurnCondition implements Condition {
|
||||
DID(true),
|
||||
DIDNT(false);
|
||||
private final boolean flag;
|
||||
|
||||
instance;
|
||||
SourceEnteredThisTurnCondition(boolean flag) {
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = source.getSourcePermanentOrLKI(game);
|
||||
return permanent != null && permanent.getTurnsOnBattlefield() == 0;
|
||||
return permanent != null && (permanent.getTurnsOnBattlefield() == 0) == flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{this} entered the battlefield this turn";
|
||||
return "{this} " + (flag ? "entered" : "didn't enter") + " the battlefield this turn";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue