mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
[WOE] Implement Curse of the Werefox (#11009)
* [WOE] Implement Curse of the Werefox * apply review * Fix aura (and equipment?) tokens not checking for protection on target * fix targetting of reflexive trigger, by creating a custom fight effect. * fix reflexive ability target.
This commit is contained in:
parent
2d9599fbbd
commit
fab00d2f27
5 changed files with 217 additions and 2 deletions
|
|
@ -7,6 +7,7 @@ import mage.constants.Outcome;
|
|||
import mage.constants.RoleType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
|
|
@ -36,8 +37,9 @@ public class CreateRoleAttachedTargetEffect extends OneShotEffect {
|
|||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
roleType.createToken(permanent, game, source);
|
||||
return true;
|
||||
Token token = roleType.createToken(permanent, game, source);
|
||||
// The token may not be created, for instance if the creature has protection from enchantments.
|
||||
return token.getLastAddedTokenIds().size() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import mage.filter.predicate.Predicates;
|
|||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.PermanentToken;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
|
@ -89,6 +91,10 @@ public class ProtectionAbility extends StaticAbility {
|
|||
return !((FilterCard) filter).match((Card) source, ((Permanent) source).getControllerId(), this, game);
|
||||
} else if (source instanceof Card) {
|
||||
return !((FilterCard) filter).match((Card) source, ((Card) source).getOwnerId(), this, game);
|
||||
} else if (source instanceof Token) {
|
||||
// Fake a permanent with the Token info.
|
||||
PermanentToken token = new PermanentToken((Token) source, null, game);
|
||||
return !((FilterCard) filter).match((Card) token, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue