Search in sources :

Example 1 with ElephantResurgenceToken

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

the class ElephantResurgenceEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
            Effect effect = new CreateTokenTargetEffect(new ElephantResurgenceToken(), 1);
            effect.setTargetPointer(new FixedTarget(playerId));
            effect.apply(game, source);
        }
        return true;
    }
    return false;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Player(mage.players.Player) CreateTokenTargetEffect(mage.abilities.effects.common.CreateTokenTargetEffect) ElephantResurgenceToken(mage.game.permanent.token.ElephantResurgenceToken) OneShotEffect(mage.abilities.effects.OneShotEffect) CreateTokenTargetEffect(mage.abilities.effects.common.CreateTokenTargetEffect) Effect(mage.abilities.effects.Effect) UUID(java.util.UUID)

Aggregations

UUID (java.util.UUID)1 Effect (mage.abilities.effects.Effect)1 OneShotEffect (mage.abilities.effects.OneShotEffect)1 CreateTokenTargetEffect (mage.abilities.effects.common.CreateTokenTargetEffect)1 ElephantResurgenceToken (mage.game.permanent.token.ElephantResurgenceToken)1 Player (mage.players.Player)1 FixedTarget (mage.target.targetpointer.FixedTarget)1