fix multitargeting, todo: fix tooltip

This commit is contained in:
Loki 2011-08-22 00:01:32 +03:00
parent 4eaf896cff
commit 54a2e7c497

View file

@ -40,8 +40,9 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class BecomesCreatureTargetEffect extends ContinuousEffectImpl<BecomesCreatureTargetEffect> {
@ -68,7 +69,9 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl<BecomesCre
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
boolean result = false;
for (UUID permanentId : targetPointer.getTargets(source)) {
Permanent permanent = game.getPermanent(permanentId);
if (permanent != null) {
switch (layer) {
case TypeChangingEffects_4:
@ -97,7 +100,7 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl<BecomesCre
case AbilityAddingRemovingEffects_6:
if (sublayer == SubLayer.NA) {
if (token.getAbilities().size() > 0) {
for (Ability ability: token.getAbilities()) {
for (Ability ability : token.getAbilities()) {
permanent.addAbility(ability);
}
}
@ -112,7 +115,9 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl<BecomesCre
}
}
}
return true;
result |= true;
}
return result;
}
@Override