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
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ public enum CardIconType {
|
|||
ABILITY_CLASS_LEVEL("prepared/hexagon-fill.svg", CardIconCategory.ABILITY, 100),
|
||||
//
|
||||
OTHER_FACEDOWN("prepared/reply-fill.svg", CardIconCategory.ABILITY, 100),
|
||||
OTHER_COST_X("prepared/square-fill.svg", CardIconCategory.ABILITY, 100),
|
||||
//
|
||||
SYSTEM_COMBINED("prepared/square-fill.svg", CardIconCategory.SYSTEM, 1000), // inner usage, must use last order
|
||||
SYSTEM_DEBUG("prepared/link.svg", CardIconCategory.SYSTEM, 1000); // used for test render dialog
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import mage.abilities.icon.CardIconType;
|
|||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public enum FaceDownStatusIcon implements CardIcon {
|
||||
public enum FaceDownCardIcon implements CardIcon {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package mage.abilities.icon.other;
|
||||
|
||||
import mage.abilities.icon.CardIconImpl;
|
||||
import mage.abilities.icon.CardIconType;
|
||||
|
||||
/**
|
||||
* Showing x cost value
|
||||
*
|
||||
* @author JayDi85
|
||||
*/
|
||||
public class VariableCostCardIcon extends CardIconImpl {
|
||||
|
||||
public VariableCostCardIcon(int costX) {
|
||||
super(CardIconType.OTHER_COST_X, "Announced X = " + costX, "x=" + costX);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue