use of mage.game.events.DamagedPlayerEvent in project mage by magefree.
the class DhalsimPliablePacifistTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.COMBAT_DAMAGE_STEP_PRIORITY || (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(getSourceId()))) {
damagedPlayerIds.clear();
return false;
}
if (event.getType() != GameEvent.EventType.DAMAGED_PLAYER) {
return false;
}
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
Permanent permanent = game.getPermanent(event.getSourceId());
if (!damageEvent.isCombatDamage() || permanent == null || !permanent.isControlledBy(this.getControllerId()) || !permanent.isCreature(game) || damagedPlayerIds.contains(event.getPlayerId())) {
return false;
}
damagedPlayerIds.add(event.getPlayerId());
return true;
}
use of mage.game.events.DamagedPlayerEvent in project mage by magefree.
the class AuntiesSnitchTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
Permanent p = game.getPermanent(event.getSourceId());
return damageEvent.isCombatDamage() && filter.match(p, getSourceId(), getControllerId(), game);
}
Aggregations