foul-magics/Mage/src/main/java/mage/abilities/dynamicvalue/common/SnowManaSpentValue.java
Evan Kranzler b4355b8f6e
Added treasure mana check (#7979)
* add treasure mana support to mana code

* [AFR] Implemented Hired Hexblade

* [AFR] Implemented Jaded Sell-Sword

* [AFR] Implemented Forsword Paladin

* added test

* fixed test failure

* another test fix

* completely reworked tracking mana sources
2021-07-06 19:43:32 -04:00

38 lines
975 B
Java

package mage.abilities.dynamicvalue.common;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.constants.AbilityType;
import mage.game.Game;
import mage.watchers.common.ManaPaidSourceWatcher;
/**
* @author TheElk801
*/
public enum SnowManaSpentValue implements DynamicValue {
instance;
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
if (sourceAbility.getAbilityType() == AbilityType.SPELL) {
return ManaPaidSourceWatcher.getSnowPaid(sourceAbility.getId(), game);
}
return ManaPaidSourceWatcher.getSnowPaid(sourceAbility.getSourceId(), game);
}
@Override
public SnowManaSpentValue copy() {
return instance;
}
@Override
public String toString() {
return "1";
}
@Override
public String getMessage() {
return "{S} spent to cast this spell";
}
}