MCPcopy Create free account
hub / github.com/Card-Forge/forge / canBeTargetedBy

Method canBeTargetedBy

forge-game/src/main/java/forge/game/card/Card.java:6865–6884  ·  view source on GitHub ↗
(final SpellAbility sa)

Source from the content-addressed store, hash-verified

6863 }
6864
6865 @Override
6866 public final boolean canBeTargetedBy(final SpellAbility sa) {
6867 if (!getOwner().isInGame()) {
6868 return false;
6869 }
6870
6871 if (sa == null) {
6872 return true;
6873 }
6874
6875 if (isPhasedOut()) {
6876 return false;
6877 }
6878
6879 if (StaticAbilityCantTarget.cantTarget(this, sa) != null) {
6880 return false;
6881 }
6882
6883 return true;
6884 }
6885
6886 public final boolean canBeControlledBy(final Player newController) {
6887 return newController.isInGame() && !(hasKeyword("Other players can't gain control of CARDNAME.") && !getController().equals(newController));

Callers

nothing calls this directly

Calls 4

getOwnerMethod · 0.95
isPhasedOutMethod · 0.95
cantTargetMethod · 0.95
isInGameMethod · 0.45

Tested by

no test coverage detected