Fixed bug of Chandra the Firebrand making only damag to first target with her third ability.

This commit is contained in:
LevelX2 2013-06-05 17:24:45 +02:00
parent ac52fea9d8
commit 8cb4c17567
2 changed files with 14 additions and 11 deletions

View file

@ -64,7 +64,9 @@ public class ChandraTheFirebrand extends CardImpl<ChandraTheFirebrand> {
ability1.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability1);
this.addAbility(new LoyaltyAbility(new CreateDelayedTriggeredAbilityEffect(new ChandraTheFirebrandAbility()), -2));
Effect effect = new CreateDelayedTriggeredAbilityEffect(new ChandraTheFirebrandAbility());
effect .setText("When you cast your next instant or sorcery spell this turn, copy that spell. You may choose new targets for the copy");
this.addAbility(new LoyaltyAbility(effect, -2));
LoyaltyAbility ability2 = new LoyaltyAbility(new DamageTargetEffect(6), -6);
ability2.addTarget(new TargetCreatureOrPlayer(0, 6));

View file

@ -118,17 +118,18 @@ public class DamageTargetEffect extends OneShotEffect<DamageTargetEffect> {
}
return true;
}
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
if (permanent != null) {
permanent.damage(amount.calculate(game, source), source.getSourceId(), game, preventable, false);
return true;
for (UUID targetId :this.getTargetPointer().getTargets(game, source)) {
Permanent permanent = game.getPermanent(targetId);
if (permanent != null) {
permanent.damage(amount.calculate(game, source), source.getSourceId(), game, preventable, false);
} else {
Player player = game.getPlayer(targetPointer.getFirst(game, source));
if (player != null) {
player.damage(amount.calculate(game, source), source.getSourceId(), game, false, preventable);
}
}
}
Player player = game.getPlayer(targetPointer.getFirst(game, source));
if (player != null) {
player.damage(amount.calculate(game, source), source.getSourceId(), game, false, preventable);
return true;
}
return false;
return true;
}
@Override