Source:
<code>public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Player opponent = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (controller != null && opponent != null) { Choice choice = new ChoiceImpl(); choice.setChoices(CardRepository.instance.getNames()); while (!controller.choose(Outcome.Benefit, choice, game)) { if (!controller.canRespond()) { return false; } } String cardName = choice.getChoice(); game.informPlayers("Card named: " + cardName); boolean opponentGuess = false; if (opponent.chooseUse(Outcome.Neutral, "Is the chosen card (" + cardName + ") in " + controller.getLogName() + "'s hand?", source, game)) { opponentGuess = true; } boolean rightGuess = !opponentGuess; for (Card card : controller.getHand().getCards(game)) { if (card.isSplitCard()){ SplitCard splitCard = (SplitCard) card; if (splitCard.getLeftHalfCard().getName().equals(cardName)){ rightGuess = opponentGuess; } else if (splitCard.getRightHalfCard().getName().equals(cardName)){ rightGuess = opponentGuess; } } if (card.getName().equals(cardName)) { rightGuess = opponentGuess; } } game.informPlayers(opponent.getLogName() + " guesses that " + cardName + " is " + (opponentGuess ? "" : "not") + " in " + controller.getLogName() + "'s hand"); if (controller.chooseUse(outcome, "Reveal your hand?", source, game)) { controller.revealCards("hand of " + controller.getName(), controller.getHand(), game); if (!rightGuess) { controller.drawCards(1, game); return true; } } <START> } <END> return false; }</code><technical_language>apply method return false if a expected situation happens. if player guesses card name wrong, return true false, this is a normal situation. special depending return code. if false is returned, is a info message log able recognize logical problems of effects apply method</technical_language>

Target:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Player opponent = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (controller != null && opponent != null) { Choice choice = new ChoiceImpl(); choice.setChoices(CardRepository.instance.getNames()); choice.setMessage("Choose a card name"); while (!controller.choose(Outcome.Benefit, choice, game)) { if (!controller.canRespond()) { return false; } } String cardName = choice.getChoice(); game.informPlayers("Card named: " + cardName); boolean opponentGuess = false; if (opponent.chooseUse(Outcome.Neutral, "Is the chosen card (" + cardName + ") in " + controller.getLogName() + "'s hand?", source, game)) { opponentGuess = true; } boolean rightGuess = !opponentGuess; for (Card card : controller.getHand().getCards(game)) { if (card.isSplitCard()){ SplitCard splitCard = (SplitCard) card; if (splitCard.getLeftHalfCard().getName().equals(cardName)){ rightGuess = opponentGuess; } else if (splitCard.getRightHalfCard().getName().equals(cardName)){ rightGuess = opponentGuess; } } if (card.getName().equals(cardName)) { rightGuess = opponentGuess; } } game.informPlayers(opponent.getLogName() + " guesses that " + cardName + " is " + (opponentGuess ? "" : "not") + " in " + controller.getLogName() + "'s hand"); if (controller.chooseUse(outcome, "Reveal your hand?", source, game)) { controller.revealCards("hand of " + controller.getName(), controller.getHand(), game); if (!rightGuess) { controller.drawCards(1, game); } } return true; } return false; }