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

Method optionalUntap

forge-game/src/main/java/forge/game/phase/Untap.java:174–196  ·  view source on GitHub ↗
(final Card c, Player phase)

Source from the content-addressed store, hash-verified

172 }
173
174 private static boolean optionalUntap(final Card c, Player phase) {
175 boolean untap = true;
176
177 if (c.hasKeyword("You may choose not to untap CARDNAME during your untap step.")) {
178 StringBuilder prompt = new StringBuilder("Untap " + c.toString() + "?");
179 boolean defaultChoice = true;
180 if (c.hasGainControlTarget()) {
181 final Iterable<Card> targets = c.getGainControlTargets();
182 prompt.append("\r\n").append(c).append(" is controlling: ");
183 for (final Card target : targets) {
184 prompt.append(target);
185 if (target.isInPlay()) {
186 defaultChoice = false;
187 }
188 }
189 }
190 untap = c.getController().getController().chooseBinary(new SpellAbility.EmptySa(c, c.getController()), prompt.toString(), BinaryChoiceType.UntapOrLeaveTapped, defaultChoice);
191 }
192 if (untap && !c.untap(phase)) {
193 untap = false;
194 }
195 return untap;
196 }
197
198 public static void doPhasing(final Player turn) {
199 Game game = turn.getGame();

Callers 1

doUntapMethod · 0.95

Calls 9

hasGainControlTargetMethod · 0.80
isInPlayMethod · 0.80
hasKeywordMethod · 0.45
toStringMethod · 0.45
getGainControlTargetsMethod · 0.45
appendMethod · 0.45
chooseBinaryMethod · 0.45
getControllerMethod · 0.45
untapMethod · 0.45

Tested by

no test coverage detected