manaPool.unlockManaType(ManaType.BLACK); manaPool.unlockManaType(ManaType.BLUE); manaPool.unlockManaType(ManaType.GREEN); manaPool.unlockManaType(ManaType.WHITE); manaPool.unlockManaType(ManaType.RED); manaPool.unlockManaType(ManaType.COLORLESS); manaPool.unlockManaType(ManaType.COLORLESS); manaName = "colorless";
protected boolean playManaHandling(Ability abilityToCast, ManaCost unpaid, String promptText, Game game) { updateGameStatePriority("playMana", game); Map<String, Serializable> options = new HashMap<>(); prepareForResponse(game); if (!isExecutingMacro()) { game.firePlayManaEvent(playerId, "Pay " + promptText, options); } waitForResponse(game); if (!this.canRespond()) { return false; } if (response.getBoolean() != null) { return false; } else if (response.getUUID() != null) { playManaAbilities(abilityToCast, unpaid, game); } else if (response.getString() != null && response.getString().equals("special")) { if (unpaid instanceof ManaCostsImpl) { specialManaAction(unpaid, game); } } else if (response.getManaType() != null) { // this mana type can be paid once from pool if (response.getResponseManaTypePlayerId().equals(this.getId())) { this.getManaPool().unlockManaType(response.getManaType()); } // TODO: Handle if mana pool } return true; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { ExileFromGraveCost exileFromGraveCost = (ExileFromGraveCost) source.getCosts().get(0); List<Card> exiledCards = exileFromGraveCost.getExiledCards(); if (!exiledCards.isEmpty()) { Cards toDelve = new CardsImpl(); for (Card card : exiledCards) { toDelve.add(card); } ManaPool manaPool = controller.getManaPool(); manaPool.addMana(new Mana(0, 0, 0, 0, 0, 0, 0, toDelve.size()), game, source); manaPool.unlockManaType(ManaType.COLORLESS); String keyString = CardUtil.getCardZoneString("delvedCards", source.getSourceId(), game); @SuppressWarnings("unchecked") Cards delvedCards = (Cards) game.getState().getValue(keyString); if (delvedCards == null) { game.getState().setValue(keyString, toDelve); } else { delvedCards.addAll(toDelve); } } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (controller != null && targetPlayer != null) { int amountToPay = targetPlayer.announceXMana(0, unpaid.getMana().getGeneric(), "How much mana to pay?", game, source); if (amountToPay > 0) { Cost cost = new GenericManaCost(amountToPay); if (cost.pay(source, game, source.getSourceId(), targetPlayer.getId(), false)) { ManaPool manaPool = controller.getManaPool(); manaPool.addMana(Mana.ColorlessMana(amountToPay), game, source); manaPool.unlockManaType(ManaType.COLORLESS); game.informPlayers(targetPlayer.getLogName() + " paid " + amountToPay + " mana."); game.getState().setValue(source.getSourceId().toString() + game.getState().getZoneChangeCounter(source.getSourceId()), true); } } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Spell spell = game.getStack().getSpell(source.getSourceId()); if (controller != null && spell != null) { for (UUID artifactId : this.getTargetPointer().getTargets(game, source)) { Permanent perm = game.getPermanent(artifactId); if (perm == null) { continue; } if (!perm.isTapped() && perm.tap(game)) { ManaPool manaPool = controller.getManaPool(); manaPool.addMana(Mana.ColorlessMana(1), game, source); manaPool.unlockManaType(ManaType.COLORLESS); if (!game.isSimulation()) { game.informPlayers("Improvise: " + controller.getLogName() + " taps " + perm.getLogName() + " to pay {1}"); } spell.setDoneActivatingManaAbilities(true); } } return true; } return false; }