forked from External/mage
* GUI: added card icon for announced X value (card cast);
This commit is contained in:
parent
fc0ff6c22d
commit
76082e1d7a
9 changed files with 353 additions and 12 deletions
|
|
@ -7,7 +7,9 @@ import mage.game.Game;
|
|||
import mage.watchers.common.ManaSpentToCastWatcher;
|
||||
|
||||
public enum ManacostVariableValue implements DynamicValue {
|
||||
REGULAR, ETB;
|
||||
|
||||
REGULAR, // if you need X on cast/activate (in stack)
|
||||
ETB; // if you need X after ETB (in battlefield)
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -15,7 +17,10 @@ public enum ManacostVariableValue implements DynamicValue {
|
|||
return sourceAbility.getManaCostsToPay().getX();
|
||||
}
|
||||
ManaSpentToCastWatcher watcher = game.getState().getWatcher(ManaSpentToCastWatcher.class);
|
||||
return watcher != null ? watcher.getAndResetLastXValue(sourceAbility.getSourceId()) : sourceAbility.getManaCostsToPay().getX();
|
||||
if (watcher != null) {
|
||||
return watcher.getAndResetLastXValue(sourceAbility);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue