Search in sources :

Example 1 with LoseLifeTargetEffect

use of mage.abilities.effects.common.LoseLifeTargetEffect in project mage by magefree.

the class DefiantBloodlordTriggeredAbility method checkTrigger.

@Override
public boolean checkTrigger(GameEvent event, Game game) {
    if (event.getPlayerId().equals(this.controllerId)) {
        this.getEffects().clear();
        this.addEffect(new LoseLifeTargetEffect(event.getAmount()));
        return true;
    }
    return false;
}
Also used : LoseLifeTargetEffect(mage.abilities.effects.common.LoseLifeTargetEffect)

Example 2 with LoseLifeTargetEffect

use of mage.abilities.effects.common.LoseLifeTargetEffect in project mage by magefree.

the class CurseOfFoolsWisdomTriggeredAbility method checkTrigger.

@Override
public boolean checkTrigger(GameEvent event, Game game) {
    Permanent enchantment = game.getPermanentOrLKIBattlefield(getSourceId());
    if (enchantment == null || !event.getPlayerId().equals(enchantment.getAttachedTo())) {
        return false;
    }
    this.getEffects().clear();
    Effect effect = new LoseLifeTargetEffect(2);
    effect.setTargetPointer(new FixedTarget(event.getPlayerId(), game));
    this.addEffect(effect);
    this.addEffect(new GainLifeEffect(2));
    return true;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Permanent(mage.game.permanent.Permanent) LoseLifeTargetEffect(mage.abilities.effects.common.LoseLifeTargetEffect) GainLifeEffect(mage.abilities.effects.common.GainLifeEffect) Effect(mage.abilities.effects.Effect) AttachEffect(mage.abilities.effects.common.AttachEffect) LoseLifeTargetEffect(mage.abilities.effects.common.LoseLifeTargetEffect) GainLifeEffect(mage.abilities.effects.common.GainLifeEffect)

Example 3 with LoseLifeTargetEffect

use of mage.abilities.effects.common.LoseLifeTargetEffect in project mage by magefree.

the class VitoThornOfTheDuskRoseTriggeredAbility method checkTrigger.

@Override
public boolean checkTrigger(GameEvent event, Game game) {
    if (event.getPlayerId().equals(getControllerId())) {
        MageObject mageObject = game.getObject(event.getSourceId());
        this.getEffects().clear();
        this.getHints().clear();
        this.addHint(new StaticHint("Lose life amount: " + event.getAmount()));
        if (mageObject != null) {
            this.addHint(new StaticHint("Caused by: " + mageObject.getLogName()));
        }
        this.addEffect(new LoseLifeTargetEffect(event.getAmount()));
        return true;
    }
    return false;
}
Also used : MageObject(mage.MageObject) LoseLifeTargetEffect(mage.abilities.effects.common.LoseLifeTargetEffect) StaticHint(mage.abilities.hint.StaticHint)

Example 4 with LoseLifeTargetEffect

use of mage.abilities.effects.common.LoseLifeTargetEffect in project mage by magefree.

the class CalculatingLichTriggeredAbility method checkTrigger.

@Override
public boolean checkTrigger(GameEvent event, Game game) {
    Player player = game.getPlayer(getControllerId());
    UUID defenderId = game.getCombat().getDefenderId(event.getSourceId());
    if (player == null || !player.hasOpponent(defenderId, game)) {
        return false;
    }
    getEffects().clear();
    addEffect(new LoseLifeTargetEffect(1).setTargetPointer(new FixedTarget(defenderId, game)));
    return true;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Player(mage.players.Player) LoseLifeTargetEffect(mage.abilities.effects.common.LoseLifeTargetEffect) UUID(java.util.UUID)

Example 5 with LoseLifeTargetEffect

use of mage.abilities.effects.common.LoseLifeTargetEffect in project mage by magefree.

the class FalseCureTriggeredAbility method checkTrigger.

@Override
public boolean checkTrigger(GameEvent event, Game game) {
    this.getEffects().clear();
    Effect effect = new LoseLifeTargetEffect(2 * event.getAmount());
    effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
    this.addEffect(effect);
    return true;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) LoseLifeTargetEffect(mage.abilities.effects.common.LoseLifeTargetEffect) Effect(mage.abilities.effects.Effect) CreateDelayedTriggeredAbilityEffect(mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect) LoseLifeTargetEffect(mage.abilities.effects.common.LoseLifeTargetEffect)

Aggregations

LoseLifeTargetEffect (mage.abilities.effects.common.LoseLifeTargetEffect)7 FixedTarget (mage.target.targetpointer.FixedTarget)4 Effect (mage.abilities.effects.Effect)3 Player (mage.players.Player)2 UUID (java.util.UUID)1 MageObject (mage.MageObject)1 OneShotEffect (mage.abilities.effects.OneShotEffect)1 AttachEffect (mage.abilities.effects.common.AttachEffect)1 CreateDelayedTriggeredAbilityEffect (mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect)1 GainLifeEffect (mage.abilities.effects.common.GainLifeEffect)1 StaticHint (mage.abilities.hint.StaticHint)1 Permanent (mage.game.permanent.Permanent)1 TargetPlayer (mage.target.TargetPlayer)1