mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
Breaking Point updates per PR comments
This commit is contained in:
parent
80f9e0ff33
commit
57aee714fc
1 changed files with 8 additions and 3 deletions
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue