mirror of
https://github.com/correl/mage.git
synced 2025-01-12 11:08:01 +00:00
Fixing check for objects that should not untap during a specific player's next untap step ('your next untap step' vs. 'its controllers next untap step' lanugage)
This commit is contained in:
parent
9ca68a0603
commit
d82687bdc4
2 changed files with 6 additions and 4 deletions
|
@ -120,7 +120,7 @@ public class DontUntapInControllersNextUntapStepTargetEffect extends ContinuousR
|
|||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null) {
|
||||
if (game.getActivePlayerId().equals(permanent.getControllerId())
|
||||
|| (game.getActivePlayerId().equals(onlyIfControlledByPlayer))) { // if effect works only for specific player, all permanents have to be set to handled in that players untap step
|
||||
&& ((onlyIfControlledByPlayer == null) || (game.getActivePlayerId().equals(onlyIfControlledByPlayer)))) { // if effect works only for specific player, all permanents have to be set to handled in that players untap step
|
||||
if (!handledTargetsDuringTurn.containsKey(targetId)) {
|
||||
// it's the untep step of the current controller and the effect was not handled for this target yet, so do it now
|
||||
handledTargetsDuringTurn.put(targetId, false);
|
||||
|
@ -145,8 +145,10 @@ public class DontUntapInControllersNextUntapStepTargetEffect extends ContinuousR
|
|||
&& getTargetPointer().getTargets(game, source).contains(event.getTargetId())) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && game.getActivePlayerId().equals(permanent.getControllerId())) {
|
||||
handledTargetsDuringTurn.put(event.getTargetId(), true);
|
||||
return true;
|
||||
if ((onlyIfControlledByPlayer == null) || game.getActivePlayerId().equals(onlyIfControlledByPlayer)) { // If onlyIfControlledByPlayer is set, then don't apply unless we're currently controlled by the specified player.
|
||||
handledTargetsDuringTurn.put(event.getTargetId(), true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ class ExertReplacementEffect extends ReplacementEffectImpl {
|
|||
game.informPlayers(controller.getLogName() + " exerted " + creature.getName());
|
||||
}
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.BECOMES_EXERTED, creature.getId(), creature.getId(), creature.getControllerId()));
|
||||
ContinuousEffect effect = new DontUntapInControllersNextUntapStepTargetEffect();
|
||||
ContinuousEffect effect = new DontUntapInControllersNextUntapStepTargetEffect("", creature.getControllerId());
|
||||
effect.setTargetPointer(new FixedTarget(creature, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue