mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Fixes
This commit is contained in:
parent
1c5f20989c
commit
333562f721
3 changed files with 14 additions and 8 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue