public ChoiceLandType() { super(true); this.setChoices(SubType.getLandTypes(false).stream().map(SubType::toString).collect(Collectors.toSet())); this.message = "Choose a land type"; }
public String getTypeText() { StringBuilder type = new StringBuilder(); if (!getSuperTypes().isEmpty()) { type.append(String.join(" ", getSuperTypes().stream().map(SuperType::toString).collect(Collectors.toList()))); type.append(" "); } if (!getCardTypes().isEmpty()) { type.append(String.join(" ", getCardTypes().stream().map(CardType::toString).collect(Collectors.toList()))); type.append(" "); } if (!getSubTypes().isEmpty()) { type.append(" - "); type.append(String.join(" ", getSubTypes().stream().map(SubType::toString).collect(Collectors.toList()))); } return type.toString(); }
this.setSubtypes(card.getSubtype(null).stream().map(SubType::toString).collect(Collectors.toList())); this.setSuperTypes(card.getSuperType()); this.setManaCosts(card.getManaCost().getSymbols());
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject mageObject = game.getPermanentEntering(source.getSourceId()); if (mageObject == null) { mageObject = game.getObject(source.getSourceId()); } if (controller != null && mageObject != null) { Choice typeChoice = new ChoiceImpl(true); typeChoice.setMessage("Choose land type"); typeChoice.setChoices(SubType.getLandTypes(false).stream().map(SubType::toString).collect(Collectors.toSet())); if (controller.choose(outcome, typeChoice, game)) { if (!game.isSimulation()) { game.informPlayers(mageObject.getName() + ": " + controller.getLogName() + " has chosen " + typeChoice.getChoice()); } game.getState().setValue(mageObject.getId() + "_type", SubType.byDescription(typeChoice.getChoice())); if (mageObject instanceof Permanent) { ((Permanent) mageObject).addInfo("chosen type", CardUtil.addToolTipMarkTags("Chosen type: " + typeChoice.getChoice()), game); } return true; } } return false; }