[AI] enhanced targeting. card fixes

This commit is contained in:
magenoxx 2012-07-29 10:31:46 +04:00
parent 2200fb8572
commit eefedc03b9
10 changed files with 91 additions and 5 deletions

View file

@ -88,7 +88,7 @@ class BowerPassageEffect extends RestrictionEffect<BowerPassageEffect> {
@Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) {
if (attacker.getControllerId().equals(source.getControllerId()) && blocker.getAbilities().contains(FlyingAbility.getInstance())) {
if (attacker != null && attacker.getControllerId().equals(source.getControllerId()) && blocker.getAbilities().contains(FlyingAbility.getInstance())) {
return false;
}
return true;

View file

@ -114,7 +114,7 @@ class HuntedGhoulEffect extends RestrictionEffect<HuntedGhoulEffect> {
@Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) {
if (attacker.getSubtype().contains("Human")) {
if (attacker != null && attacker.getSubtype().contains("Human")) {
return false;
}
return true;

View file

@ -27,7 +27,6 @@
*/
package mage.sets.innistrad;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
@ -44,6 +43,8 @@ import mage.players.Player;
import mage.target.TargetPlayer;
import mage.target.common.TargetCardInYourGraveyard;
import java.util.UUID;
/**
*
* @author North
@ -93,6 +94,7 @@ class GraveyardShovelEffect extends OneShotEffect<GraveyardShovelEffect> {
Player controller = game.getPlayer(source.getControllerId());
if (targetPlayer != null && controller != null) {
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard();
target.setRequired(true);
if (targetPlayer.chooseTarget(Outcome.Exile, target, source, game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {