[EMN] Added Thirsting Axe.

This commit is contained in:
Quercitron 2016-07-10 18:41:36 +03:00
parent de0b66240f
commit 712316d8ff
3 changed files with 201 additions and 0 deletions

View file

@ -0,0 +1,29 @@
package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author Quercitron
*/
public class AttachedCondition implements Condition {
private static final AttachedCondition fInstance = new AttachedCondition();
public static AttachedCondition getInstance() {
return fInstance;
}
@Override
public boolean apply(Game game, Ability source) {
Permanent attachment = game.getPermanent(source.getSourceId());
if (attachment == null || attachment.getAttachedTo() == null) {
return false;
}
Permanent attachedTo = game.getPermanent(attachment.getAttachedTo());
return (attachedTo != null);
}
}