use of mage.abilities.effects.common.LoseLifeTargetEffect in project mage by magefree.
the class SanguineBondTriggeredAbility 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;
}
use of mage.abilities.effects.common.LoseLifeTargetEffect in project mage by magefree.
the class SowerOfDiscordTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
int damage = event.getAmount();
Player player1 = (Player) game.getState().getValue(this.getSourceId() + "_player1");
Player player2 = (Player) game.getState().getValue(this.getSourceId() + "_player2");
if (player1 == null || player2 == null || damage == 0) {
return false;
}
Effect effect = new LoseLifeTargetEffect(damage);
if (event.getTargetId().equals(player1.getId())) {
this.getEffects().clear();
effect.setTargetPointer(new FixedTarget(player2.getId()));
this.addEffect(effect);
return true;
} else if (event.getTargetId().equals(player2.getId())) {
this.getEffects().clear();
effect.setTargetPointer(new FixedTarget(player1.getId()));
this.addEffect(effect);
return true;
}
return false;
}
Aggregations