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

Method cloak

forge-game/src/main/java/forge/game/card/Card.java:794–818  ·  view source on GitHub ↗
(Player p, SpellAbility sa, Map<AbilityKey, Object> params)

Source from the content-addressed store, hash-verified

792 }
793
794 public Card cloak(Player p, SpellAbility sa, Map<AbilityKey, Object> params) {
795 // Turn Face Down (even if it's DFC).
796 // Sometimes cards are manifested while already being face down
797 if (!turnFaceDown(true) && !isFaceDown()) {
798 return null;
799 }
800
801 // Just in case you aren't the controller, now you are!
802 setController(p, game.getNextTimestamp());
803
804 // Mark this card as "cloaked"
805 setCloaked(sa);
806 // give it Ward:2
807 getFaceDownState().addIntrinsicKeyword("Ward:2", true);
808
809 // Move to p's battlefield
810 Card c = game.getAction().moveToPlay(this, p, sa, params);
811 if (c.isInPlay()) {
812 c.setCloaked(sa);
813 c.turnFaceDown(true);
814 c.updateStateForView();
815 }
816
817 return c;
818 }
819
820 public boolean turnFaceDown() {
821 return turnFaceDown(false);

Callers 1

internalEffectMethod · 0.80

Calls 11

turnFaceDownMethod · 0.95
isFaceDownMethod · 0.95
setControllerMethod · 0.95
setCloakedMethod · 0.95
getFaceDownStateMethod · 0.95
isInPlayMethod · 0.95
updateStateForViewMethod · 0.95
getNextTimestampMethod · 0.80
moveToPlayMethod · 0.80
addIntrinsicKeywordMethod · 0.45
getActionMethod · 0.45

Tested by

no test coverage detected