Fix #9560 and replace various custom effects with GainControlAllEffect

This commit is contained in:
Alex W. Jackson 2022-09-24 00:39:48 -04:00
parent 55b75a5839
commit 0b200748e5
12 changed files with 124 additions and 460 deletions

View file

@ -30,7 +30,7 @@ public class GainControlAllEffect extends OneShotEffect {
this.filter = filter;
this.duration = duration;
this.controllingPlayerId = controllingPlayerId;
this.staticText = "gain control of " + filter.getMessage();
this.staticText = "gain control of all " + filter.getMessage() + (duration.toString().isEmpty() ? "" : ' ' + duration.toString());
}
public GainControlAllEffect(final GainControlAllEffect effect) {
@ -50,7 +50,7 @@ public class GainControlAllEffect extends OneShotEffect {
for (Permanent permanent : game.getBattlefield()
.getActivePermanents(filter,
source.getControllerId(), source, game)) {
ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, controllingPlayerId);
ContinuousEffect effect = new GainControlTargetEffect(duration, controllingPlayerId);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
}