forked from External/mage
[WOE] Implement Imodane, the Pyrohammer (#10922)
* [WOE] Implement Imodane, the Pyrohammer * unit test Imodane * apply review --------- Co-authored-by: xenohedron <xenohedron@users.noreply.github.com>
This commit is contained in:
parent
c0f03e98eb
commit
27bba74c9f
10 changed files with 401 additions and 105 deletions
|
|
@ -0,0 +1,35 @@
|
|||
package mage.abilities.hint;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* @author Susucr
|
||||
*/
|
||||
public class ValuePositiveHint implements Hint {
|
||||
|
||||
private final String name;
|
||||
private final DynamicValue value;
|
||||
|
||||
public ValuePositiveHint(String name, DynamicValue value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
private ValuePositiveHint(final ValuePositiveHint hint) {
|
||||
this.name = hint.name;
|
||||
this.value = hint.value.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Game game, Ability ability) {
|
||||
int amount = value.calculate(game, ability, null);
|
||||
return amount <= 0 ? "" : name + ": " + amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValuePositiveHint copy() {
|
||||
return new ValuePositiveHint(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue