Search in sources :

Example 1 with AngelVigilanceToken

use of mage.game.permanent.token.AngelVigilanceToken in project mage by magefree.

the class FinaleOfGloryEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    int xValue = source.getManaCostsToPay().getX();
    if (xValue == 0) {
        return false;
    }
    new CreateTokenEffect(new SoldierVigilanceToken(), xValue).apply(game, source);
    if (xValue >= 10) {
        new CreateTokenEffect(new AngelVigilanceToken(), xValue).apply(game, source);
    }
    return true;
}
Also used : SoldierVigilanceToken(mage.game.permanent.token.SoldierVigilanceToken) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect) AngelVigilanceToken(mage.game.permanent.token.AngelVigilanceToken)

Example 2 with AngelVigilanceToken

use of mage.game.permanent.token.AngelVigilanceToken in project mage by magefree.

the class DivineVisitationEffect method replaceEvent.

@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
    if (event instanceof CreateTokenEvent) {
        int amount = 0;
        CreateTokenEvent tokenEvent = (CreateTokenEvent) event;
        Iterator<Map.Entry<Token, Integer>> it = tokenEvent.getTokens().entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry<Token, Integer> entry = it.next();
            if (entry.getKey().isCreature(game)) {
                amount += entry.getValue();
                it.remove();
            }
        }
        if (amount > 0) {
            tokenEvent.getTokens().put(new AngelVigilanceToken(), amount);
        }
    }
    return false;
}
Also used : Token(mage.game.permanent.token.Token) AngelVigilanceToken(mage.game.permanent.token.AngelVigilanceToken) AngelVigilanceToken(mage.game.permanent.token.AngelVigilanceToken) Map(java.util.Map) CreateTokenEvent(mage.game.events.CreateTokenEvent)

Aggregations

AngelVigilanceToken (mage.game.permanent.token.AngelVigilanceToken)2 Map (java.util.Map)1 CreateTokenEffect (mage.abilities.effects.common.CreateTokenEffect)1 CreateTokenEvent (mage.game.events.CreateTokenEvent)1 SoldierVigilanceToken (mage.game.permanent.token.SoldierVigilanceToken)1 Token (mage.game.permanent.token.Token)1