use of mage.game.permanent.token.SoldierToken in project mage by magefree.
the class LieutenantsOfTheGuardEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
// Outcome.Benefit - AI will boost all the time (Strength choice)
// TODO: add AI hint logic in the choice method, see Tyrant's Choice as example
TwoChoiceVote vote = new TwoChoiceVote("Strength (+1/+1 counter)", "Numbers (1/1 token)", Outcome.Benefit);
vote.doVotes(source, game);
int strengthCount = vote.getVoteCount(true);
int numbersCount = vote.getVoteCount(false);
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
if (strengthCount > 0 && permanent != null) {
permanent.addCounters(CounterType.P1P1.createInstance(strengthCount), source.getControllerId(), source, game);
}
if (numbersCount > 0) {
new SoldierToken().putOntoBattlefield(numbersCount, game, source, source.getControllerId());
}
return strengthCount + numbersCount > 0;
}
use of mage.game.permanent.token.SoldierToken in project mage by magefree.
the class BasriKetTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
int attackingNonTokens = 0;
for (UUID attacker : game.getCombat().getAttackers()) {
Permanent permanent = game.getPermanent(attacker);
if (filter.match(permanent, game)) {
attackingNonTokens++;
}
}
if (attackingNonTokens > 0) {
this.getEffects().clear();
addEffect(new CreateTokenEffect(new SoldierToken(), attackingNonTokens, true, true));
return true;
}
return false;
}
Aggregations