[FIN] Implement Cactuar

This commit is contained in:
theelk801 2025-05-26 13:40:44 -04:00
parent 1553ec0bf7
commit 1375d31dde
14 changed files with 66 additions and 19 deletions

View file

@ -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";
}
}