mirror of
https://github.com/correl/mage.git
synced 2024-11-27 03:00:11 +00:00
Terraformer, Elsewhere Flask: use ChoiceBasicLandType
avoiding repetition of the basic land types everywhere
This commit is contained in:
parent
45c61417ec
commit
492637544a
2 changed files with 10 additions and 22 deletions
|
@ -27,7 +27,6 @@
|
||||||
*/
|
*/
|
||||||
package mage.sets.ravnica;
|
package mage.sets.ravnica;
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
@ -41,7 +40,8 @@ import mage.abilities.mana.GreenManaAbility;
|
||||||
import mage.abilities.mana.RedManaAbility;
|
import mage.abilities.mana.RedManaAbility;
|
||||||
import mage.abilities.mana.WhiteManaAbility;
|
import mage.abilities.mana.WhiteManaAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.choices.ChoiceImpl;
|
import mage.choices.Choice;
|
||||||
|
import mage.choices.ChoiceBasicLandType;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Layer;
|
import mage.constants.Layer;
|
||||||
|
@ -103,15 +103,9 @@ class TerraformerEffect 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) {
|
||||||
ChoiceImpl choices = new ChoiceImpl(true);
|
Choice choice = new ChoiceBasicLandType();
|
||||||
Set<String> choicesSet = choices.getChoices();
|
if (player.choose(Outcome.Neutral, choice, game)) {
|
||||||
choicesSet.add("Forest");
|
game.getState().setValue(source.getSourceId().toString() + "_Terraformer", choice.getChoice());
|
||||||
choicesSet.add("Plains");
|
|
||||||
choicesSet.add("Mountain");
|
|
||||||
choicesSet.add("Island");
|
|
||||||
choicesSet.add("Swamp");
|
|
||||||
if (player.choose(Outcome.Neutral, choices, game)) {
|
|
||||||
game.getState().setValue(source.getSourceId().toString() + "_Terraformer", choices.getChoice());
|
|
||||||
}
|
}
|
||||||
game.addEffect(new TerraformerContinuousEffect(), source);
|
game.addEffect(new TerraformerContinuousEffect(), source);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
*/
|
*/
|
||||||
package mage.sets.shadowmoor;
|
package mage.sets.shadowmoor;
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
|
@ -42,7 +41,8 @@ import mage.abilities.mana.GreenManaAbility;
|
||||||
import mage.abilities.mana.RedManaAbility;
|
import mage.abilities.mana.RedManaAbility;
|
||||||
import mage.abilities.mana.WhiteManaAbility;
|
import mage.abilities.mana.WhiteManaAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.choices.ChoiceImpl;
|
import mage.choices.Choice;
|
||||||
|
import mage.choices.ChoiceBasicLandType;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Layer;
|
import mage.constants.Layer;
|
||||||
|
@ -103,15 +103,9 @@ class ElsewhereFlaskEffect 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) {
|
||||||
ChoiceImpl choices = new ChoiceImpl(true);
|
Choice choice = new ChoiceBasicLandType();
|
||||||
Set<String> choicesSet = choices.getChoices();
|
if (player.choose(Outcome.Neutral, choice, game)) {
|
||||||
choicesSet.add("Forest");
|
game.getState().setValue(source.getSourceId().toString() + "_ElsewhereFlask", choice.getChoice());
|
||||||
choicesSet.add("Plains");
|
|
||||||
choicesSet.add("Mountain");
|
|
||||||
choicesSet.add("Island");
|
|
||||||
choicesSet.add("Swamp");
|
|
||||||
if (player.choose(Outcome.Neutral, choices, game)) {
|
|
||||||
game.getState().setValue(source.getSourceId().toString() + "_ElsewhereFlask", choices.getChoice());
|
|
||||||
}
|
}
|
||||||
game.addEffect(new ElsewhereFlaskContinuousEffect(), source);
|
game.addEffect(new ElsewhereFlaskContinuousEffect(), source);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue