forked from External/mage
Added delirium hint as enum
This commit is contained in:
parent
330f8cf5d0
commit
6a7253d22f
4 changed files with 80 additions and 22 deletions
|
|
@ -0,0 +1,47 @@
|
|||
package mage.abilities.dynamicvalue.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.CardType;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public enum CardTypesInGraveyardCount implements DynamicValue {
|
||||
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Player controller = game.getPlayer(sourceAbility.getControllerId());
|
||||
if (controller != null) {
|
||||
EnumSet<CardType> foundCardTypes = EnumSet.noneOf(CardType.class);
|
||||
for (Card card : controller.getGraveyard().getCards(game)) {
|
||||
foundCardTypes.addAll(card.getCardType());
|
||||
}
|
||||
return foundCardTypes.size();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CardTypesInGraveyardCount copy() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "1";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "the number of opponents you attacked this turn";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue