Search in sources :

Example 1 with SamuraiToken

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

the class EiganjoUprisingEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    int amount = source.getManaCostsToPay().getX();
    if (amount < 1) {
        return false;
    }
    Token token = new SamuraiToken();
    token.putOntoBattlefield(amount, game, source);
    game.addEffect(new GainAbilityTargetEffect(new MenaceAbility(false)).setTargetPointer(new FixedTargets(token, game)), source);
    game.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance()).setTargetPointer(new FixedTargets(token, game)), source);
    if (amount < 2) {
        return true;
    }
    for (UUID opponentId : game.getOpponents(source.getControllerId())) {
        token.putOntoBattlefield(amount - 1, game, source, opponentId);
    }
    return true;
}
Also used : MenaceAbility(mage.abilities.keyword.MenaceAbility) FixedTargets(mage.target.targetpointer.FixedTargets) GainAbilityTargetEffect(mage.abilities.effects.common.continuous.GainAbilityTargetEffect) SamuraiToken(mage.game.permanent.token.SamuraiToken) Token(mage.game.permanent.token.Token) SamuraiToken(mage.game.permanent.token.SamuraiToken) UUID(java.util.UUID)

Aggregations

UUID (java.util.UUID)1 GainAbilityTargetEffect (mage.abilities.effects.common.continuous.GainAbilityTargetEffect)1 MenaceAbility (mage.abilities.keyword.MenaceAbility)1 SamuraiToken (mage.game.permanent.token.SamuraiToken)1 Token (mage.game.permanent.token.Token)1 FixedTargets (mage.target.targetpointer.FixedTargets)1