implement [BLB] Starseer Mentor

This commit is contained in:
Susucre 2024-07-12 18:18:02 +02:00
parent 233d714e00
commit 3fdeb8c2fc
8 changed files with 421 additions and 152 deletions

View file

@ -0,0 +1,37 @@
package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.IntCompareCondition;
import mage.constants.ComparisonType;
import mage.game.Game;
import mage.watchers.common.PlayerLostLifeWatcher;
/**
* Needs PlayerLostLifeWatcher to work
*
* @author Susucr
*/
public class YouLostLifeCondition extends IntCompareCondition {
/**
* "if you lost life this turn"
*/
public YouLostLifeCondition() {
super(ComparisonType.MORE_THAN, 0);
}
public YouLostLifeCondition(ComparisonType type, int value) {
super(type, value);
}
@Override
protected int getInputValue(Game game, Ability source) {
PlayerLostLifeWatcher watcher = game.getState().getWatcher(PlayerLostLifeWatcher.class);
return watcher == null ? 0 : watcher.getLifeLost(source.getControllerId());
}
@Override
public String toString() {
return "if you lost " + (value == 0 ? "" : (value + 1) + " or more ") + "life this turn";
}
}