mirror of
https://github.com/magefree/mage.git
synced 2025-12-29 06:52:02 -08:00
[BLB] Implement Star Charter
This commit is contained in:
parent
835e9abea4
commit
f7eeb75545
3 changed files with 90 additions and 0 deletions
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue