Breaking Point updates per PR comments

This commit is contained in:
Marshall 2015-06-23 20:29:19 -04:00
parent 80f9e0ff33
commit 57aee714fc

View file

@ -69,7 +69,7 @@ class BreakingPointDestroyEffect extends OneShotEffect {
public BreakingPointDestroyEffect() {
super(Outcome.Benefit);
this.staticText = "Any player may have Breaking Point deal 6 damage to him or her. If no one does, destroy all creatures. Creatures destroyed this way can't be regenerated.";
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) {
@ -83,6 +83,11 @@ class BreakingPointDestroyEffect extends OneShotEffect {
@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())){
@ -91,9 +96,9 @@ class BreakingPointDestroyEffect extends OneShotEffect {
}
if(spell != null){
boolean destroyCreatures = true;
for(UUID uuid : game.getPlayerList()){
for(UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)){
Player player = game.getPlayer(uuid);
if(player != null && player.chooseUse(Outcome.Detriment, "Have " + spell.getName() + " deal 6 damage to you?", game)){
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");