Updated cards for new choice type dialog

This commit is contained in:
Oleg Agafonov 2017-12-25 08:13:22 +04:00
parent 749ca59ad6
commit 00d7a1f336
25 changed files with 28 additions and 30 deletions

View file

@ -65,7 +65,7 @@ public class AphettoDredging extends CardImpl {
if (ability instanceof SpellAbility) { if (ability instanceof SpellAbility) {
Player controller = game.getPlayer(ability.getControllerId()); Player controller = game.getPlayer(ability.getControllerId());
if (controller != null) { if (controller != null) {
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(game.getObject(ability.getSourceId()));
while (!controller.choose(Outcome.PutCreatureInPlay, typeChoice, game)) { while (!controller.choose(Outcome.PutCreatureInPlay, typeChoice, game)) {
if (!controller.canRespond()) { if (!controller.canRespond()) {
return; return;

View file

@ -98,7 +98,7 @@ class BloodlineShamanEffect extends OneShotEffect {
MageObject sourceObject = game.getObject(source.getSourceId()); MageObject sourceObject = game.getObject(source.getSourceId());
if (controller != null) { if (controller != null) {
// Choose a creature type. // Choose a creature type.
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(sourceObject);
while (!controller.choose(outcome, typeChoice, game)) { while (!controller.choose(outcome, typeChoice, game)) {
if (!controller.canRespond()) { if (!controller.canRespond()) {
return false; return false;

View file

@ -129,7 +129,7 @@ class ChooseCreatureTypeEffect extends OneShotEffect { // code by LevelX2, but t
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
MageObject mageObject = game.getObject(source.getSourceId()); MageObject mageObject = game.getObject(source.getSourceId());
if (controller != null && mageObject != null) { if (controller != null && mageObject != null) {
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(mageObject);
while (!controller.choose(outcome, typeChoice, game)) { while (!controller.choose(outcome, typeChoice, game)) {
if (!controller.canRespond()) { if (!controller.canRespond()) {
return false; return false;

View file

@ -44,7 +44,7 @@ import mage.abilities.effects.common.continuous.GainControlTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.choices.Choice; import mage.choices.Choice;
import mage.choices.ChoiceImpl; import mage.choices.ChoiceCreatureType;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
@ -154,9 +154,8 @@ class CallousOppressorChooseCreatureTypeEffect extends OneShotEffect {
} }
Player opponent = game.getPlayer(target.getFirstTarget()); Player opponent = game.getPlayer(target.getFirstTarget());
if (opponent != null && mageObject != null) { if (opponent != null && mageObject != null) {
Choice typeChoice = new ChoiceImpl(true); Choice typeChoice = new ChoiceCreatureType(mageObject);
typeChoice.setMessage("Choose creature type"); typeChoice.setMessage("Choose creature type");
typeChoice.setChoices(SubType.getCreatureTypes(false).stream().map(SubType::toString).collect(Collectors.toCollection(LinkedHashSet::new)));
while (!opponent.choose(outcome, typeChoice, game)) { while (!opponent.choose(outcome, typeChoice, game)) {
if (!opponent.canRespond()) { if (!opponent.canRespond()) {
return false; return false;

View file

@ -89,7 +89,7 @@ class CoordinatedBarrageEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
Choice choice = new ChoiceCreatureType(); Choice choice = new ChoiceCreatureType(game.getObject(source.getSourceId()));
if (controller.choose(Outcome.Damage, choice, game)) { if (controller.choose(Outcome.Damage, choice, game)) {
String chosenType = choice.getChoice(); String chosenType = choice.getChoice();
FilterControlledPermanent filter = new FilterControlledPermanent(); FilterControlledPermanent filter = new FilterControlledPermanent();

View file

@ -89,7 +89,7 @@ class DistantMelodyEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if (player != null) { if (player != null) {
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(game.getObject(source.getSourceId()));
while (!player.choose(Outcome.BoostCreature, typeChoice, game)) { while (!player.choose(Outcome.BoostCreature, typeChoice, game)) {
if (!player.canRespond()) { if (!player.canRespond()) {
return false; return false;

View file

@ -96,7 +96,7 @@ class ElvishSoultillerEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
MageObject mageObject = game.getObject(source.getSourceId()); MageObject mageObject = game.getObject(source.getSourceId());
if (controller != null && mageObject != null) { if (controller != null && mageObject != null) {
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(mageObject);
while (!controller.choose(outcome, typeChoice, game)) { while (!controller.choose(outcome, typeChoice, game)) {
if (!controller.canRespond()) { if (!controller.canRespond()) {
return false; return false;

View file

@ -83,7 +83,7 @@ class ExtinctionEffect extends OneShotEffect {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId()); MageObject sourceObject = game.getObject(source.getSourceId());
if (player != null) { if (player != null) {
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(sourceObject);
while (!player.choose(outcome, typeChoice, game)) { while (!player.choose(outcome, typeChoice, game)) {
if (!player.canRespond()) { if (!player.canRespond()) {
return false; return false;

View file

@ -95,7 +95,7 @@ class GraveSifterEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(game.getObject(source.getSourceId()));
typeChoice.setMessage("Choose creature type to return cards from your graveyard"); typeChoice.setMessage("Choose creature type to return cards from your graveyard");
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {

View file

@ -96,7 +96,7 @@ class HarshMercyEffect extends OneShotEffect {
PlayerIteration: PlayerIteration:
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId); Player player = game.getPlayer(playerId);
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(sourceObject);
while (!player.choose(Outcome.DestroyPermanent, typeChoice, game)) { while (!player.choose(Outcome.DestroyPermanent, typeChoice, game)) {
if (!player.canRespond()) { if (!player.canRespond()) {
continue PlayerIteration; continue PlayerIteration;

View file

@ -152,7 +152,7 @@ class KaronaFalseGodEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId()); MageObject sourceObject = game.getObject(source.getSourceId());
if (sourceObject != null && controller != null) { if (sourceObject != null && controller != null) {
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(sourceObject);
while (!controller.choose(Outcome.BoostCreature, typeChoice, game)) { while (!controller.choose(Outcome.BoostCreature, typeChoice, game)) {
if (!controller.canRespond()) { if (!controller.canRespond()) {
return false; return false;

View file

@ -86,9 +86,9 @@ class LuminescentRainEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if (player != null) { if (player != null) {
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(game.getObject(source.getSourceId()));
while (!player.choose(Outcome.BoostCreature, typeChoice, game)) { while (!player.choose(Outcome.BoostCreature, typeChoice, game)) {
if (!player.canRespond()) { if (!player.canRespond()) {
return false; return false;

View file

@ -92,7 +92,7 @@ class MistformSliverEffect extends OneShotEffect {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId()); Permanent permanent = game.getPermanent(source.getSourceId());
if (player != null && permanent != null) { if (player != null && permanent != null) {
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(permanent);
while (!player.choose(Outcome.Detriment, typeChoice, game)) { while (!player.choose(Outcome.Detriment, typeChoice, game)) {
if (!player.canRespond()) { if (!player.canRespond()) {
return false; return false;

View file

@ -39,7 +39,7 @@ import mage.abilities.text.TextPartSubType;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.choices.Choice; import mage.choices.Choice;
import mage.choices.ChoiceImpl; import mage.choices.ChoiceCreatureType;
import mage.constants.*; import mage.constants.*;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
@ -145,9 +145,8 @@ class ChangeCreatureTypeTargetEffect extends ContinuousEffectImpl {
return; return;
} }
if (fromSubType == null) { if (fromSubType == null) {
Choice typeChoice = new ChoiceImpl(true); Choice typeChoice = new ChoiceCreatureType(game.getObject(source.getSourceId()));
typeChoice.setMessage("Choose creature type to change to Vampire"); typeChoice.setMessage("Choose creature type to change to Vampire");
typeChoice.setChoices(SubType.getCreatureTypes(false).stream().map(SubType::toString).collect(Collectors.toCollection(LinkedHashSet::new)));
while (!controller.choose(outcome, typeChoice, game)) { while (!controller.choose(outcome, typeChoice, game)) {
if (!controller.canRespond()) { if (!controller.canRespond()) {
return; return;

View file

@ -96,7 +96,7 @@ class OutbreakEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if (player != null) { if (player != null) {
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(game.getObject(source.getSourceId()));
while (!player.choose(outcome, typeChoice, game)) { while (!player.choose(outcome, typeChoice, game)) {
if (!player.canRespond()) { if (!player.canRespond()) {
return false; return false;

View file

@ -93,7 +93,7 @@ class PacksDisdainEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if (player != null) { if (player != null) {
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(game.getObject(source.getSourceId()));
while (!player.choose(Outcome.UnboostCreature, typeChoice, game)) { while (!player.choose(Outcome.UnboostCreature, typeChoice, game)) {
if (!player.canRespond()) { if (!player.canRespond()) {
return false; return false;

View file

@ -93,7 +93,7 @@ class PatriarchsBiddingEffect extends OneShotEffect {
Set<String> chosenTypes = new HashSet<>(); Set<String> chosenTypes = new HashSet<>();
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId); Player player = game.getPlayer(playerId);
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(sourceObject);
while (!player.choose(Outcome.PutCreatureInPlay, typeChoice, game)) { while (!player.choose(Outcome.PutCreatureInPlay, typeChoice, game)) {
if (!player.canRespond()) { if (!player.canRespond()) {
break; break;

View file

@ -93,7 +93,7 @@ class PeerPressureEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
Choice choice = new ChoiceCreatureType(); Choice choice = new ChoiceCreatureType(game.getObject(source.getSourceId()));
while (!controller.choose(Outcome.GainControl, choice, game)) { while (!controller.choose(Outcome.GainControl, choice, game)) {
if (!controller.canRespond()) { if (!controller.canRespond()) {
return false; return false;

View file

@ -94,7 +94,7 @@ class RiptideChronologistEffect extends OneShotEffect {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId()); MageObject sourceObject = game.getObject(source.getSourceId());
if (player != null) { if (player != null) {
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(sourceObject);
while (!player.choose(outcome, typeChoice, game)) { while (!player.choose(outcome, typeChoice, game)) {
if (!player.canRespond()) { if (!player.canRespond()) {
return false; return false;

View file

@ -96,7 +96,7 @@ class RiptideShapeshifterEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game); MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) { if (controller != null && sourceObject != null) {
Choice choice = new ChoiceCreatureType(); Choice choice = new ChoiceCreatureType(sourceObject);
while (!controller.choose(Outcome.BoostCreature, choice, game)) { while (!controller.choose(Outcome.BoostCreature, choice, game)) {
if (!controller.canRespond()) { if (!controller.canRespond()) {
return false; return false;

View file

@ -89,7 +89,7 @@ class RoarOfTheCrowdEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if (player != null) { if (player != null) {
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(game.getObject(source.getSourceId()));
while (!player.choose(Outcome.LoseLife, typeChoice, game)) { while (!player.choose(Outcome.LoseLife, typeChoice, game)) {
if (!player.canRespond()) { if (!player.canRespond()) {
return false; return false;

View file

@ -85,7 +85,7 @@ class StandardizeEffect extends OneShotEffect {
MageObject sourceObject = game.getObject(source.getSourceId()); MageObject sourceObject = game.getObject(source.getSourceId());
String chosenType = ""; String chosenType = "";
if (player != null && sourceObject != null) { if (player != null && sourceObject != null) {
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(sourceObject);
typeChoice.setMessage("Choose a creature type other than Wall"); typeChoice.setMessage("Choose a creature type other than Wall");
typeChoice.getChoices().remove("Wall"); typeChoice.getChoices().remove("Wall");
while (!player.choose(Outcome.BoostCreature, typeChoice, game)) { while (!player.choose(Outcome.BoostCreature, typeChoice, game)) {

View file

@ -91,7 +91,7 @@ class TribalUnityEffect extends OneShotEffect {
MageObject sourceObject = game.getObject(source.getSourceId()); MageObject sourceObject = game.getObject(source.getSourceId());
int boost = amount.calculate(game, source, this); int boost = amount.calculate(game, source, this);
if (player != null) { if (player != null) {
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(sourceObject);
while (!player.choose(outcome, typeChoice, game)) { while (!player.choose(outcome, typeChoice, game)) {
if (!player.canRespond()) { if (!player.canRespond()) {
return false; return false;

View file

@ -90,7 +90,7 @@ class TsabosDecreeEffect extends OneShotEffect {
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
MageObject sourceObject = game.getObject(source.getSourceId()); MageObject sourceObject = game.getObject(source.getSourceId());
if (player != null) { if (player != null) {
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(sourceObject);
while (!player.choose(outcome, typeChoice, game)) { while (!player.choose(outcome, typeChoice, game)) {
if (!player.canRespond()) { if (!player.canRespond()) {
return false; return false;

View file

@ -91,7 +91,7 @@ class WalkingDesecrationEffect extends OneShotEffect {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId()); MageObject sourceObject = game.getObject(source.getSourceId());
if (player != null) { if (player != null) {
Choice typeChoice = new ChoiceCreatureType(); Choice typeChoice = new ChoiceCreatureType(sourceObject);
while (!player.choose(outcome, typeChoice, game)) { while (!player.choose(outcome, typeChoice, game)) {
if (!player.canRespond()) { if (!player.canRespond()) {
return false; return false;