Fixed bug in Breaking Point.

This commit is contained in:
LevelX2 2015-06-28 00:11:46 +02:00
parent 87f3978589
commit fa8646559c

View file

@ -66,39 +66,39 @@ public class BreakingPoint extends CardImpl {
}
class BreakingPointDestroyEffect extends OneShotEffect {
public BreakingPointDestroyEffect() {
super(Outcome.Benefit);
this.staticText = "Any player may have {this} deal 6 damage to him or her. If no one does, destroy all creatures. Creatures destroyed this way can't be regenerated.";
}
public BreakingPointDestroyEffect(final BreakingPointDestroyEffect effect) {
super(effect);
}
@Override
public BreakingPointDestroyEffect copy() {
return new BreakingPointDestroyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
StackObject spell = null;
for(StackObject object : game.getStack()){
if(object instanceof Spell && object.getSourceId().equals(source.getSourceId())){
for (StackObject object : game.getStack()) {
if (object instanceof Spell && object.getSourceId().equals(source.getSourceId())) {
spell = object;
}
}
if(spell != null){
if (spell != null) {
boolean destroyCreatures = true;
for(UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)){
Player player = game.getPlayer(uuid);
if(player != null && player.chooseUse(Outcome.Detriment, "Have " + spell.getLogName() + " deal 6 damage to you?", game)){
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player != null && player.chooseUse(Outcome.Detriment, "Have " + spell.getLogName() + " deal 6 damage to you?", game)) {
destroyCreatures = false;
player.damage(6, source.getSourceId(), game, false, true);
game.informPlayers(player.getLogName() + " has " + spell.getName() + " deal 6 to him or her");