This commit is contained in:
magenoxx 2011-03-07 22:03:35 +03:00
parent 1c5f20989c
commit 333562f721
3 changed files with 14 additions and 8 deletions

View file

@ -58,6 +58,7 @@ public class DealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)) {
this.targets.clear();
this.addTarget(new TargetPlayer());
this.targets.get(0).add(event.getPlayerId(), game);
return true;

View file

@ -47,7 +47,11 @@ public class ConditionalTriggeredAbility extends TriggeredAbilityImpl<Conditiona
public boolean checkTrigger(GameEvent event, Game game) {
ability.setSourceId(this.getSourceId());
if (ability.checkTrigger(event, game)) {
return condition.apply(game, this);
if (condition.apply(game, this)) {
this.targets.clear();
this.targets.addAll(ability.getTargets());
return true;
}
}
return false;
}

View file

@ -61,13 +61,14 @@ public class PutLibraryIntoGraveTargetEffect extends OneShotEffect<PutLibraryInt
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getFirstTarget());
Card card;
for (int i = 0; i < amount; i++) {
card = player.getLibrary().removeFromTop(game);
if (card != null)
player.getGraveyard().add(card);
else
break;
if (player != null) {
for (int i = 0; i < amount; i++) {
Card card = player.getLibrary().removeFromTop(game);
if (card != null)
player.getGraveyard().add(card);
else
break;
}
}
return true;
}