* Fixed some problems with blocking requirements (fixes #355).

This commit is contained in:
LevelX2 2013-10-08 17:12:04 +02:00
parent 2dd26a9075
commit db1521d30c
8 changed files with 24 additions and 12 deletions

View file

@ -91,7 +91,7 @@ class RevengeOfTheHuntedEffect extends RequirementEffect<RevengeOfTheHuntedEffec
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
return true;
return permanent.canBlock(source.getFirstTarget(), game);
}
@Override

View file

@ -92,10 +92,9 @@ class FeralContestEffect extends RequirementEffect<FeralContestEffect> {
}
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (creature != null) {
return true;
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getTargets().get(1).getFirstTarget())) {
return permanent.canBlock(source.getFirstTarget(), game);
}
return false;
}

View file

@ -96,7 +96,10 @@ class GrapplingHookEffect extends RequirementEffect<GrapplingHookEffect> {
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getFirstTarget())) {
return true;
Permanent equipment = game.getPermanent(source.getSourceId());
if (equipment != null && equipment.getAttachedTo() != null) {
return permanent.canBlock(equipment.getAttachedTo(), game);
}
}
return false;
}