Search in sources :

Example 1 with InsectToken

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

the class OldRutsteinEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player == null) {
        return false;
    }
    Cards cards = player.millCards(1, source, game);
    if (cards.getCards(game).stream().anyMatch(card -> card.isLand(game))) {
        new TreasureToken().putOntoBattlefield(1, game, source, source.getControllerId());
    }
    if (cards.getCards(game).stream().anyMatch(card -> card.isCreature(game))) {
        new InsectToken().putOntoBattlefield(1, game, source, source.getControllerId());
    }
    if (cards.getCards(game).stream().anyMatch(card -> !card.isCreature(game) && !card.isLand(game))) {
        new BloodToken().putOntoBattlefield(1, game, source, source.getControllerId());
    }
    return true;
}
Also used : Player(mage.players.Player) BloodToken(mage.game.permanent.token.BloodToken) InsectToken(mage.game.permanent.token.InsectToken) TreasureToken(mage.game.permanent.token.TreasureToken) Cards(mage.cards.Cards)

Example 2 with InsectToken

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

the class HiveheartShamanEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Token token = new InsectToken();
    token.putOntoBattlefield(1, game, source);
    int domainCount = xValue.calculate(game, source, this);
    if (domainCount < 1) {
        return true;
    }
    for (UUID tokenId : token.getLastAddedTokenIds()) {
        Permanent permanent = game.getPermanent(tokenId);
        if (permanent == null) {
            continue;
        }
        permanent.addCounters(CounterType.P1P1.createInstance(domainCount), source, game);
    }
    return true;
}
Also used : Permanent(mage.game.permanent.Permanent) InsectToken(mage.game.permanent.token.InsectToken) Token(mage.game.permanent.token.Token) InsectToken(mage.game.permanent.token.InsectToken) UUID(java.util.UUID) DomainHint(mage.abilities.hint.common.DomainHint)

Aggregations

InsectToken (mage.game.permanent.token.InsectToken)2 UUID (java.util.UUID)1 DomainHint (mage.abilities.hint.common.DomainHint)1 Cards (mage.cards.Cards)1 Permanent (mage.game.permanent.Permanent)1 BloodToken (mage.game.permanent.token.BloodToken)1 Token (mage.game.permanent.token.Token)1 TreasureToken (mage.game.permanent.token.TreasureToken)1 Player (mage.players.Player)1