Search in sources :

Example 1 with HazezonTamarSandWarriorToken

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

the class HazezonTamarEntersEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        Effect effect = new CreateTokenEffect(new HazezonTamarSandWarriorToken(), new PermanentsOnBattlefieldCount(new FilterControlledLandPermanent()));
        effect.setText("create X 1/1 Sand Warrior creature tokens that are red, green, and white, where X is the number of lands you control at that time");
        DelayedTriggeredAbility delayedAbility = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(effect);
        game.addDelayedTriggeredAbility(delayedAbility, source);
        return true;
    }
    return false;
}
Also used : Player(mage.players.Player) AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(mage.abilities.common.delayed.AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility) DelayedTriggeredAbility(mage.abilities.DelayedTriggeredAbility) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect) PermanentsOnBattlefieldCount(mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount) ExileAllEffect(mage.abilities.effects.common.ExileAllEffect) OneShotEffect(mage.abilities.effects.OneShotEffect) Effect(mage.abilities.effects.Effect) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect) AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(mage.abilities.common.delayed.AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility) HazezonTamarSandWarriorToken(mage.game.permanent.token.HazezonTamarSandWarriorToken) FilterControlledLandPermanent(mage.filter.common.FilterControlledLandPermanent)

Aggregations

DelayedTriggeredAbility (mage.abilities.DelayedTriggeredAbility)1 AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility (mage.abilities.common.delayed.AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility)1 PermanentsOnBattlefieldCount (mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount)1 Effect (mage.abilities.effects.Effect)1 OneShotEffect (mage.abilities.effects.OneShotEffect)1 CreateTokenEffect (mage.abilities.effects.common.CreateTokenEffect)1 ExileAllEffect (mage.abilities.effects.common.ExileAllEffect)1 FilterControlledLandPermanent (mage.filter.common.FilterControlledLandPermanent)1 HazezonTamarSandWarriorToken (mage.game.permanent.token.HazezonTamarSandWarriorToken)1 Player (mage.players.Player)1