Search in sources :

Example 1 with SurvivorToken

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

the class VarchildBetrayerOfKjeldorEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    int damage = (int) this.getValue("damage");
    if (damage > 0) {
        Effect effect = new CreateTokenTargetEffect(new SurvivorToken(), damage);
        effect.setTargetPointer(getTargetPointer());
        return effect.apply(game, source);
    }
    return false;
}
Also used : CreateTokenTargetEffect(mage.abilities.effects.common.CreateTokenTargetEffect) CantAttackYouOrPlaneswalkerAllEffect(mage.abilities.effects.common.combat.CantAttackYouOrPlaneswalkerAllEffect) OneShotEffect(mage.abilities.effects.OneShotEffect) CreateTokenTargetEffect(mage.abilities.effects.common.CreateTokenTargetEffect) Effect(mage.abilities.effects.Effect) GainControlAllEffect(mage.abilities.effects.common.continuous.GainControlAllEffect) CantBlockAllEffect(mage.abilities.effects.common.combat.CantBlockAllEffect) SurvivorToken(mage.game.permanent.token.SurvivorToken)

Example 2 with SurvivorToken

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

the class OpponentCreateSurvivorTokenCost method pay.

@Override
public boolean pay(Ability ability, Game game, Ability source, UUID controllerId, boolean noMana, Cost costToPay) {
    Player controller = game.getPlayer(controllerId);
    if (controller != null) {
        TargetOpponent target = new TargetOpponent();
        if (controller.chooseTarget(Outcome.Neutral, target, ability, game)) {
            Player opponent = game.getPlayer(target.getFirstTarget());
            if (opponent != null) {
                Effect effect = new CreateTokenTargetEffect(new SurvivorToken());
                effect.setTargetPointer(new FixedTarget(opponent.getId(), game));
                paid = effect.apply(game, ability);
            }
        }
    }
    return paid;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Player(mage.players.Player) TargetOpponent(mage.target.common.TargetOpponent) CreateTokenTargetEffect(mage.abilities.effects.common.CreateTokenTargetEffect) CreateTokenTargetEffect(mage.abilities.effects.common.CreateTokenTargetEffect) Effect(mage.abilities.effects.Effect) SurvivorToken(mage.game.permanent.token.SurvivorToken)

Aggregations

Effect (mage.abilities.effects.Effect)2 CreateTokenTargetEffect (mage.abilities.effects.common.CreateTokenTargetEffect)2 SurvivorToken (mage.game.permanent.token.SurvivorToken)2 OneShotEffect (mage.abilities.effects.OneShotEffect)1 CantAttackYouOrPlaneswalkerAllEffect (mage.abilities.effects.common.combat.CantAttackYouOrPlaneswalkerAllEffect)1 CantBlockAllEffect (mage.abilities.effects.common.combat.CantBlockAllEffect)1 GainControlAllEffect (mage.abilities.effects.common.continuous.GainControlAllEffect)1 Player (mage.players.Player)1 TargetOpponent (mage.target.common.TargetOpponent)1 FixedTarget (mage.target.targetpointer.FixedTarget)1