mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Fixed a bug in EntersTheBattlefield event of PermanentImpl using ownerId instead controller id. Fixes issue #133. Some minor formating.
This commit is contained in:
parent
58a05970e8
commit
1121c7c562
3 changed files with 14 additions and 8 deletions
|
@ -29,9 +29,8 @@
|
|||
package mage.sets.newphyrexia;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
@ -51,9 +50,13 @@ public class GitaxianProbe extends CardImpl<GitaxianProbe> {
|
|||
super(ownerId, 35, "Gitaxian Probe", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{UP}");
|
||||
this.expansionSetCode = "NPH";
|
||||
this.color.setBlue(true);
|
||||
|
||||
// Look at target player's hand.
|
||||
this.getSpellAbility().addEffect(new GitaxianProbeEffect());
|
||||
this.getSpellAbility().addEffect(new DrawCardControllerEffect(1));
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
// Draw a card.
|
||||
this.getSpellAbility().addEffect(new DrawCardControllerEffect(1));
|
||||
|
||||
}
|
||||
|
||||
public GitaxianProbe (final GitaxianProbe card) {
|
||||
|
@ -69,7 +72,7 @@ public class GitaxianProbe extends CardImpl<GitaxianProbe> {
|
|||
|
||||
class GitaxianProbeEffect extends OneShotEffect<GitaxianProbeEffect> {
|
||||
GitaxianProbeEffect() {
|
||||
super(Constants.Outcome.Detriment);
|
||||
super(Outcome.DrawCard);
|
||||
staticText = "Look at target player's hand";
|
||||
}
|
||||
|
||||
|
@ -92,4 +95,4 @@ class GitaxianProbeEffect extends OneShotEffect<GitaxianProbeEffect> {
|
|||
return new GitaxianProbeEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -353,8 +353,11 @@ class JaceArchitectOfThoughtEffect3 extends OneShotEffect<JaceArchitectOfThought
|
|||
Cards playerLibrary = new CardsImpl();
|
||||
Player player = game.getPlayer(playerId);
|
||||
playerLibrary.addAll(player.getLibrary().getCardList());
|
||||
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(new FilterNonlandCard());
|
||||
String playerName = new StringBuilder(player.getName()).append("'s").toString();
|
||||
if (source.getControllerId().equals(player.getId())) {
|
||||
playerName = "your";
|
||||
}
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(new FilterNonlandCard(new StringBuilder("nonland card from ").append(playerName).append(" library").toString()));
|
||||
if (controller.choose(Constants.Outcome.Benefit, playerLibrary, target, game)) {
|
||||
UUID targetId = target.getFirstTarget();
|
||||
Card card = player.getLibrary().remove(targetId, game);
|
||||
|
|
|
@ -727,7 +727,7 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
|
|||
@Override
|
||||
public void entersBattlefield(UUID sourceId, Game game) {
|
||||
controlledFromStartOfControllerTurn = false;
|
||||
game.replaceEvent(GameEvent.getEvent(EventType.ENTERS_THE_BATTLEFIELD, objectId, sourceId, ownerId));
|
||||
game.replaceEvent(GameEvent.getEvent(EventType.ENTERS_THE_BATTLEFIELD, objectId, sourceId, controllerId));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue