forked from External/mage
39 lines
970 B
Java
39 lines
970 B
Java
package mage.abilities.dynamicvalue.common;
|
|
|
|
import mage.abilities.Ability;
|
|
import mage.abilities.dynamicvalue.DynamicValue;
|
|
import mage.abilities.effects.Effect;
|
|
import mage.game.Game;
|
|
import mage.watchers.common.CardsDrawnThisTurnWatcher;
|
|
|
|
/**
|
|
* @author TheElk801
|
|
*/
|
|
public enum CardsDrawnThisTurnDynamicValue implements DynamicValue {
|
|
instance;
|
|
|
|
@Override
|
|
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
|
CardsDrawnThisTurnWatcher watcher = game.getState().getWatcher(CardsDrawnThisTurnWatcher.class);
|
|
if (watcher != null) {
|
|
return watcher.getCardsDrawnThisTurn(sourceAbility.getControllerId());
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
@Override
|
|
public CardsDrawnThisTurnDynamicValue copy() {
|
|
return instance;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "1";
|
|
}
|
|
|
|
@Override
|
|
public String getMessage() {
|
|
return "card you've drawn this turn";
|
|
}
|
|
}
|
|
|