mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 05:09:16 -08:00
Added dynamic value hints for cards
This commit is contained in:
parent
6a7253d22f
commit
4ffc40ff69
2 changed files with 37 additions and 1 deletions
|
|
@ -10,7 +10,8 @@ import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
|||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.LoseLifeTargetEffect;
|
||||
import mage.abilities.hint.DeliriumHint;
|
||||
import mage.abilities.hint.ValueHint;
|
||||
import mage.abilities.hint.common.DeliriumHint;
|
||||
import mage.abilities.keyword.ReachAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
@ -59,6 +60,7 @@ public final class IshkanahGrafwidow extends CardImpl {
|
|||
PermanentsOnBattlefieldCount count = new PermanentsOnBattlefieldCount(filter);
|
||||
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(count), new ManaCostsImpl("{6}{B}"));
|
||||
ability.addTarget(new TargetOpponent());
|
||||
ability.addHint(new ValueHint("Spider you control", count));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
34
Mage/src/main/java/mage/abilities/hint/ValueHint.java
Normal file
34
Mage/src/main/java/mage/abilities/hint/ValueHint.java
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
package mage.abilities.hint;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public class ValueHint implements Hint {
|
||||
|
||||
private String name;
|
||||
private DynamicValue value;
|
||||
|
||||
public ValueHint(String name, DynamicValue value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
private ValueHint(final ValueHint hint) {
|
||||
this.name = hint.name;
|
||||
this.value = hint.value.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Game game, Ability ability) {
|
||||
return name + ": " + value.calculate(game, ability, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Hint copy() {
|
||||
return new ValueHint(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue