Added CompoundCondition, AttachedToTappedCondition and EquipmentAttachedCondition.

This commit is contained in:
LevelX2 2013-11-21 10:59:50 +01:00
parent 176c2a76b4
commit b7c45a7090
9 changed files with 202 additions and 12 deletions

View file

@ -39,7 +39,7 @@ import mage.game.permanent.Permanent;
*/
public class AttachedToCounterCondition implements Condition {
private CounterType counterType;
private final CounterType counterType;
private int amount = 1;
private int from = -1;
private int to;
@ -61,11 +61,11 @@ public class AttachedToCounterCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent == null || permanent.getAttachedTo() == null) {
Permanent attachment = game.getPermanent(source.getSourceId());
if (attachment == null || attachment.getAttachedTo() == null) {
return false;
}
Permanent attachedTo = game.getPermanent(permanent.getAttachedTo());
Permanent attachedTo = game.getPermanent(attachment.getAttachedTo());
if (attachedTo == null) {
return false;
}