@Override public boolean checkTrigger(GameEvent event, Game game) { Permanent target = game.getPermanent(this.getFirstTarget()); if (target != null && event.getSourceId().equals(target.getId())) { for (Effect effect : this.getEffects()) { effect.setValue("damage", event.getAmount()); } return true; } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getSourceId().equals(this.sourceId)) { if (setTargetPointer) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); effect.setValue("damage", event.getAmount()); } } return true; } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { Permanent enchantment = game.getPermanent(sourceId); UUID targetId = event.getTargetId(); if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) { for (Effect effect : this.getEffects()) { effect.setValue("damage", event.getAmount()); switch (setTargetPointer) { case PERMANENT: effect.setTargetPointer(new FixedTarget(targetId)); break; case PLAYER: effect.setTargetPointer( new FixedTarget(game.getPermanentOrLKIBattlefield(targetId).getControllerId())); break; } } return true; } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { if (!onlyCombat || ((DamagedPlayerEvent) event).isCombatDamage()) { Permanent permanent = game.getPermanent(event.getSourceId()); if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) { if (!setTargetPointer.equals(SetTargetPointer.NONE)) { for (Effect effect : this.getEffects()) { effect.setValue("damage", event.getAmount()); switch (setTargetPointer) { case PLAYER: effect.setTargetPointer(new FixedTarget(permanent.getControllerId())); break; case PERMANENT: effect.setTargetPointer( new FixedTarget(permanent.getId(), permanent.getZoneChangeCounter(game))); break; } } } return true; } } return false; }