From 8fcb03fb3ec0484d3fd4ea8e41813d6bfdaee951 Mon Sep 17 00:00:00 2001 From: moomarc Date: Wed, 27 Feb 2013 17:12:21 +0000 Subject: [PATCH] - Added Master of the Wild Hunt Avatar - added AtRandom param to GenericChoice AF --- .gitattributes | 1 + .../m/master_of_the_wild_hunt_avatar.txt | 12 ++++++++++++ .../card/ability/effects/ChooseGenericEffect.java | 15 ++++++++++----- 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 res/cardsfolder/m/master_of_the_wild_hunt_avatar.txt diff --git a/.gitattributes b/.gitattributes index 6adbdde6832..9c7fa918696 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6415,6 +6415,7 @@ res/cardsfolder/m/master_of_etherium.txt svneol=native#text/plain res/cardsfolder/m/master_of_the_pearl_trident.txt -text res/cardsfolder/m/master_of_the_veil.txt -text res/cardsfolder/m/master_of_the_wild_hunt.txt svneol=native#text/plain +res/cardsfolder/m/master_of_the_wild_hunt_avatar.txt -text res/cardsfolder/m/master_splicer.txt svneol=native#text/plain res/cardsfolder/m/master_thief.txt svneol=native#text/plain res/cardsfolder/m/master_transmuter.txt svneol=native#text/plain diff --git a/res/cardsfolder/m/master_of_the_wild_hunt_avatar.txt b/res/cardsfolder/m/master_of_the_wild_hunt_avatar.txt new file mode 100644 index 00000000000..94c3af6cbaa --- /dev/null +++ b/res/cardsfolder/m/master_of_the_wild_hunt_avatar.txt @@ -0,0 +1,12 @@ +Name:Master of the Wild Hunt Avatar +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+1/+3 +A:AB$ GenericChoice | Cost$ 2 G | Choices$ Wolf,Antelope,Cat,Rhino | ActivationZone$ Command | AtRandom$ True | StackDescription$ SpellDescription | SpellDescription$ Put a green creature token onto the battlefield that's a 2/2 Wolf, a 2/3 Antelope with forestwalk, a 3/2 Cat with shroud, or a 4/4 Rhino with trample, chosen at random. +SVar:Wolf:DB$ Token | TokenAmount$ 1 | TokenName$ Wolf | TokenTypes$ Creature,Wolf | TokenOwner$ You | TokenColors$ Green | TokenPower$ 2 | TokenToughness$ 2 | ChoiceDescription$ Wolf +SVar:Antelope:DB$ Token | TokenAmount$ 1 | TokenName$ Antelope | TokenTypes$ Creature,Antelope | TokenOwner$ You | TokenColors$ Green | TokenPower$ 2 | TokenToughness$ 3 | TokenKeywords$ Forestwalk | ChoiceDescription$ Antelope +SVar:Cat:DB$ Token | TokenAmount$ 1 | TokenName$ Cat | TokenTypes$ Creature,Cat | TokenOwner$ You | TokenColors$ Green | TokenPower$ 3 | TokenToughness$ 2 | TokenKeywords$ Shroud | ChoiceDescription$ Cat +SVar:Rhino:DB$ Token | TokenAmount$ 1 | TokenName$ Rhino | TokenTypes$ Creature,Rhino | TokenOwner$ You | TokenColors$ Green | TokenPower$ 4 | TokenToughness$ 4 | TokenKeywords$ Trample | ChoiceDescription$ Rhino +SVar:Picture:http://www.cardforge.org/fpics/vgd-lq/master_of_the_wild_hunt_avatar.jpg +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo-2/master-of-the-wild-hunt.jpg \ No newline at end of file diff --git a/src/main/java/forge/card/ability/effects/ChooseGenericEffect.java b/src/main/java/forge/card/ability/effects/ChooseGenericEffect.java index 29fbe8156be..171da6c69ae 100644 --- a/src/main/java/forge/card/ability/effects/ChooseGenericEffect.java +++ b/src/main/java/forge/card/ability/effects/ChooseGenericEffect.java @@ -15,6 +15,7 @@ import forge.card.spellability.SpellAbility; import forge.card.spellability.Target; import forge.game.player.Player; import forge.gui.GuiChoose; +import forge.util.Aggregates; public class ChooseGenericEffect extends SpellAbilityEffect { @@ -48,11 +49,15 @@ public class ChooseGenericEffect extends SpellAbilityEffect { continue; } SpellAbility chosenSA = null; - if (p.isHuman()) { - String choice = GuiChoose.one("Choose one", choices.values()); - chosenSA = AbilityFactory.getAbility(host.getSVar(choices.inverse().get(choice)), host); - } else { //Computer AI - chosenSA = AbilityFactory.getAbility(host.getSVar(sa.getParam("Choices").split(",")[0]), host); + if (sa.hasParam("AtRandom")) { + chosenSA = AbilityFactory.getAbility(host.getSVar(Aggregates.random(choices.keySet())), host); + } else { + if (p.isHuman()) { + String choice = GuiChoose.one("Choose one", choices.values()); + chosenSA = AbilityFactory.getAbility(host.getSVar(choices.inverse().get(choice)), host); + } else { //Computer AI + chosenSA = AbilityFactory.getAbility(host.getSVar(sa.getParam("Choices").split(",")[0]), host); + } } chosenSA.setActivatingPlayer(sa.getSourceCard().getController()); ((AbilitySub) chosenSA).setParent(sa);