mirror of
https://github.com/correl/mage.git
synced 2024-11-16 03:00:12 +00:00
[SWS] Sabacc Game - Fixed a null pointer exception while SabaccGame effect resolved.
This commit is contained in:
parent
5009c2c149
commit
cbffe624aa
1 changed files with 4 additions and 4 deletions
|
@ -39,7 +39,7 @@ import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.TargetController;
|
import mage.constants.TargetController;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.predicate.other.PlayerIdPredicate;
|
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
@ -86,7 +86,7 @@ public class SabaccGame extends CardImpl {
|
||||||
class SabaccGameEffect extends OneShotEffect {
|
class SabaccGameEffect extends OneShotEffect {
|
||||||
|
|
||||||
public SabaccGameEffect() {
|
public SabaccGameEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Detriment);
|
||||||
this.staticText = "Choose target permanent an opponent controls. That opponent chooses a permanent you control. "
|
this.staticText = "Choose target permanent an opponent controls. That opponent chooses a permanent you control. "
|
||||||
+ "Flip a coin. If you win the flip, gain control of the permanent you chose. "
|
+ "Flip a coin. If you win the flip, gain control of the permanent you chose. "
|
||||||
+ "If you lose the flip, your opponent gains control of the permanent they chose";
|
+ "If you lose the flip, your opponent gains control of the permanent they chose";
|
||||||
|
@ -110,7 +110,7 @@ class SabaccGameEffect extends OneShotEffect {
|
||||||
Player opponent = game.getPlayer(targetPermanent.getControllerId());
|
Player opponent = game.getPlayer(targetPermanent.getControllerId());
|
||||||
if (opponent != null) {
|
if (opponent != null) {
|
||||||
FilterPermanent filter = new FilterPermanent("permanent controlled by " + controller.getName());
|
FilterPermanent filter = new FilterPermanent("permanent controlled by " + controller.getName());
|
||||||
filter.add(new PlayerIdPredicate(controller.getId()));
|
filter.add(new ControllerIdPredicate(controller.getId()));
|
||||||
TargetPermanent target = new TargetPermanent(1, 1, filter, true);
|
TargetPermanent target = new TargetPermanent(1, 1, filter, true);
|
||||||
Permanent chosenPermanent = null;
|
Permanent chosenPermanent = null;
|
||||||
if (target.chooseTarget(outcome, opponent.getId(), source, game)) {
|
if (target.chooseTarget(outcome, opponent.getId(), source, game)) {
|
||||||
|
|
Loading…
Reference in a new issue