[BLB] Implement Star Charter

This commit is contained in:
theelk801 2024-07-17 10:19:13 -04:00
parent 835e9abea4
commit f7eeb75545
3 changed files with 90 additions and 0 deletions

View file

@ -0,0 +1,33 @@
package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.game.Game;
import mage.watchers.common.PlayerGainedLifeWatcher;
import mage.watchers.common.PlayerLostLifeWatcher;
/**
* Needs PlayerGainedLifeWatcher to work
*
* @author TheElk801
*/
public enum YouGainedOrLostLifeCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
return game
.getState()
.getWatcher(PlayerGainedLifeWatcher.class)
.getLifeGained(source.getControllerId()) > 0
|| game
.getState()
.getWatcher(PlayerLostLifeWatcher.class)
.getLifeLost(source.getControllerId()) > 0;
}
@Override
public String toString() {
return "you gained or lost life this turn";
}
}