forked from External/mage
Improved freeze checks and canRespond/isInGame usage
This commit is contained in:
parent
3b19e3db35
commit
adbe84c540
17 changed files with 54 additions and 77 deletions
|
|
@ -122,8 +122,7 @@ public class DamageTargetEffect extends OneShotEffect {
|
|||
permanent.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, preventable);
|
||||
}
|
||||
Player player = game.getPlayer(targetId);
|
||||
if (player != null
|
||||
&& player.isInGame()) {
|
||||
if (player != null) {
|
||||
player.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, preventable);
|
||||
}
|
||||
}
|
||||
|
|
@ -136,8 +135,7 @@ public class DamageTargetEffect extends OneShotEffect {
|
|||
permanent.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, preventable);
|
||||
} else {
|
||||
Player player = game.getPlayer(targetId);
|
||||
if (player != null
|
||||
&& player.isInGame()) {
|
||||
if (player != null) {
|
||||
player.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, preventable);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package mage.abilities.effects.common.continuous;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.ActivatedAbility;
|
||||
import mage.abilities.Mode;
|
||||
|
|
@ -16,8 +15,9 @@ import mage.players.Player;
|
|||
import mage.target.Target;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class GainControlTargetEffect extends ContinuousEffectImpl {
|
||||
|
|
@ -31,17 +31,15 @@ public class GainControlTargetEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param duration
|
||||
* @param fixedControl Controlling player is fixed even if the controller of
|
||||
* the ability changes later
|
||||
* the ability changes later
|
||||
*/
|
||||
public GainControlTargetEffect(Duration duration, boolean fixedControl) {
|
||||
this(duration, fixedControl, null);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param duration
|
||||
* @param controllingPlayerId Player that controls the target creature
|
||||
*/
|
||||
|
|
@ -112,8 +110,7 @@ public class GainControlTargetEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
}
|
||||
// no valid target exists and the controller is no longer in the game, effect can be discarded
|
||||
if (!oneTargetStillExists
|
||||
|| !controller.isInGame()) {
|
||||
if (!oneTargetStillExists || !controller.isInGame()) {
|
||||
discard();
|
||||
}
|
||||
firstControlChange = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue