forked from External/mage
describe targets: look at hand; can't be blocked
This commit is contained in:
parent
4f44d29d32
commit
72be1856f7
2 changed files with 13 additions and 31 deletions
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
|
|
@ -15,7 +15,6 @@ public class LookAtTargetPlayerHandEffect extends OneShotEffect {
|
|||
|
||||
public LookAtTargetPlayerHandEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "look at target player's hand";
|
||||
}
|
||||
|
||||
protected LookAtTargetPlayerHandEffect(final LookAtTargetPlayerHandEffect effect) {
|
||||
|
|
@ -30,7 +29,7 @@ public class LookAtTargetPlayerHandEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
MageObject sourceObject = game.getObject(source);
|
||||
if (you != null && targetPlayer != null) {
|
||||
you.lookAtCards(sourceObject != null ? sourceObject.getIdName() : null, targetPlayer.getHand(), game);
|
||||
|
|
@ -39,4 +38,12 @@ public class LookAtTargetPlayerHandEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
return "look at " + getTargetPointer().describeTargets(mode.getTargets(), "that player") + "'s hand";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue