Search in sources :

Example 1 with HourOfNeedSphinxToken

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

the class HourOfNeedExileEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        for (UUID creatureId : getTargetPointer().getTargets(game, source)) {
            Permanent creature = game.getPermanent(creatureId);
            if (creature != null) {
                controller.moveCardToExileWithInfo(creature, null, null, source, game, Zone.BATTLEFIELD, true);
                Token token = new HourOfNeedSphinxToken();
                token.putOntoBattlefield(1, game, source, creature.getControllerId());
            }
        }
        return true;
    }
    return false;
}
Also used : Player(mage.players.Player) Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) HourOfNeedSphinxToken(mage.game.permanent.token.HourOfNeedSphinxToken) HourOfNeedSphinxToken(mage.game.permanent.token.HourOfNeedSphinxToken) Token(mage.game.permanent.token.Token) UUID(java.util.UUID)

Aggregations

UUID (java.util.UUID)1 Permanent (mage.game.permanent.Permanent)1 HourOfNeedSphinxToken (mage.game.permanent.token.HourOfNeedSphinxToken)1 Token (mage.game.permanent.token.Token)1 Player (mage.players.Player)1 TargetCreaturePermanent (mage.target.common.TargetCreaturePermanent)1