- Fixed Fractured Loyalty. Related to Bug #6236

This commit is contained in:
jeffwadsworth 2020-08-07 16:22:35 -05:00
parent f320b5507b
commit e9930504f6

View file

@ -1,4 +1,3 @@
package mage.cards.f; package mage.cards.f;
import java.util.UUID; import java.util.UUID;
@ -65,14 +64,14 @@ public final class FracturedLoyalty extends CardImpl {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId()); Permanent enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
if (enchantment != null) { if (enchantment != null) {
Permanent enchantedCreature = game.getPermanent(enchantment.getAttachedTo()); Permanent enchantedCreature = game.getPermanent(enchantment.getAttachedTo());
if (enchantedCreature != null) { if (enchantedCreature != null) {
Player controller = game.getPlayer(enchantedCreature.getControllerId()); Player controller = game.getPlayer(enchantedCreature.getControllerId());
if (enchantment.getAttachedTo() != null) { if (enchantment.getAttachedTo() != null) {
if (controller != null && !enchantedCreature.isControlledBy(this.getTargetPointer().getFirst(game, source))) { if (controller != null && !enchantedCreature.isControlledBy(this.getTargetPointer().getFirst(game, source))) {
ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, this.getTargetPointer().getFirst(game, source)); ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfGame, this.getTargetPointer().getFirst(game, source));
effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo())); effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo()));
game.addEffect(effect, source); game.addEffect(effect, source);
return true; return true;