* Fixed that cards without cost (e.g. Ancestral Vision) could be cast from graveyard (e.g. by using Yawgmoth Will). Fixed that cards could be suspended from graveyard (e.g. with Yawgmoth Will).

This commit is contained in:
LevelX2 2015-12-31 11:01:52 +01:00
parent 8bab182f8a
commit 9f22eb0688
6 changed files with 134 additions and 17 deletions

View file

@ -234,6 +234,10 @@ public class SuspendAbility extends ActivatedAbilityImpl {
@Override
public boolean canActivate(UUID playerId, Game game) {
if (!game.getState().getZone(getSourceId()).equals(Zone.HAND)) {
// Supend can only be activated from hand
return false;
}
MageObject object = game.getObject(sourceId);
return (object.getCardType().contains(CardType.INSTANT)
|| object.hasAbility(FlashAbility.getInstance().getId(), game)

View file

@ -1291,6 +1291,9 @@ public abstract class PlayerImpl implements Player, Serializable {
if (Zone.GRAVEYARD.equals(zone) && canPlayCardsFromGraveyard()) {
for (ActivatedAbility ability : object.getAbilities().getPlayableAbilities(Zone.HAND)) {
if (canUse || ability.getAbilityType().equals(AbilityType.SPECIAL_ACTION)) {
if (ability.getManaCosts().isEmpty() && ability.getCosts().isEmpty() && ability instanceof SpellAbility) {
continue; // You can't play spells from graveyard that have no costs
}
if (ability.canActivate(playerId, game)) {
useable.put(ability.getId(), ability);
}