use of mage.abilities.effects.common.GainLifeEffect in project mage by magefree.
the class ProperBurialTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zoneChangeEvent = (ZoneChangeEvent) event;
if (zoneChangeEvent.isDiesEvent()) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent != null && permanent.isControlledBy(this.getControllerId()) && permanent.isCreature(game)) {
this.getEffects().clear();
this.addEffect(new GainLifeEffect(permanent.getToughness().getValue()));
return true;
}
}
return false;
}
use of mage.abilities.effects.common.GainLifeEffect in project mage by magefree.
the class SengirTheDarkBaronWatcher method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
SengirTheDarkBaronWatcher watcher = game.getState().getWatcher(SengirTheDarkBaronWatcher.class);
if (watcher == null) {
return false;
}
this.getEffects().clear();
this.addEffect(new GainLifeEffect(watcher.getLife(event.getPlayerId())));
return true;
}
use of mage.abilities.effects.common.GainLifeEffect in project mage by magefree.
the class ExquisiteBloodTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
this.getEffects().clear();
this.addEffect(new GainLifeEffect(event.getAmount()));
return true;
}
return false;
}
use of mage.abilities.effects.common.GainLifeEffect in project mage by magefree.
the class IkraShidiqiTheUsurperTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
DamagedEvent damageEvent = (DamagedEvent) event;
if (damageEvent.isCombatDamage()) {
Permanent permanent = game.getPermanent(event.getSourceId());
if (permanent != null && permanent.isCreature(game) && permanent.isControlledBy(this.getControllerId())) {
this.getEffects().clear();
this.getEffects().add(new GainLifeEffect(permanent.getToughness().getValue()));
return true;
}
}
return false;
}
use of mage.abilities.effects.common.GainLifeEffect in project mage by magefree.
the class VarinaLichQueenTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
int attackingZombies = 0;
for (UUID attacker : game.getCombat().getAttackers()) {
Permanent creature = game.getPermanent(attacker);
if (creature != null && creature.getControllerId() != null && creature.isControlledBy(this.getControllerId()) && creature.hasSubtype(SubType.ZOMBIE, game)) {
attackingZombies++;
}
}
if (attackingZombies > 0) {
this.getEffects().clear();
addEffect(new DrawCardSourceControllerEffect(attackingZombies));
addEffect(new DiscardControllerEffect(attackingZombies, false));
addEffect(new GainLifeEffect(attackingZombies));
return true;
}
return false;
}
Aggregations