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;
}
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;
}
Aggregations