From d467b3392ac62227c7bd4cbadc90886ecb96c7a5 Mon Sep 17 00:00:00 2001 From: swordshine Date: Fri, 8 Mar 2013 07:35:31 +0000 Subject: [PATCH] - Added Rise//Fall --- .gitattributes | 1 + res/cardsfolder/r/rise_fall.txt | 21 +++++++++++++++++++ .../card/ability/effects/RevealEffect.java | 17 ++++++++++++--- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 res/cardsfolder/r/rise_fall.txt diff --git a/.gitattributes b/.gitattributes index 5a6a764b249..6c379d02116 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8638,6 +8638,7 @@ res/cardsfolder/r/riptide_pilferer.txt svneol=native#text/plain res/cardsfolder/r/riptide_replicator.txt -text res/cardsfolder/r/riptide_shapeshifter.txt -text svneol=unset#text/plain res/cardsfolder/r/riptide_survivor.txt svneol=native#text/plain +res/cardsfolder/r/rise_fall.txt -text res/cardsfolder/r/rise_from_the_grave.txt svneol=native#text/plain res/cardsfolder/r/rise_of_the_hobgoblins.txt svneol=native#text/plain res/cardsfolder/r/risen_sanctuary.txt -text diff --git a/res/cardsfolder/r/rise_fall.txt b/res/cardsfolder/r/rise_fall.txt new file mode 100644 index 00000000000..668dc064cc9 --- /dev/null +++ b/res/cardsfolder/r/rise_fall.txt @@ -0,0 +1,21 @@ +Name:Rise +ManaCost:U B +AlternateMode: Split +Types:Sorcery +A:SP$ ChangeZone | Cost$ U B | ValidTgts$ Creature | TgtPrompt$ Select target creature in a graveyard | Origin$ Graveyard | Destination$ Hand | SubAbility$ DBChangeZone | SpellDescription$ Return target creature card from a graveyard and target creature on the battlefield to their owners' hands. +SVar:DBChangeZone:DB$ ChangeZone | ValidTgts$ Creature | TgtPrompt$ Select target creature on the battlefield | Origin$ Battlefield | Destination$ Hand | IsCurse$ True +SVar:Picture:http://www.wizards.com/global/images/magic/general/risefall.jpg +Oracle:Return target creature card from a graveyard and target creature on the battlefield to their owners' hands. + +ALTERNATE + +Name:Fall +ManaCost:B R +Types:Sorcery +A:SP$ Reveal | Cost$ B R | ValidTgts$ Player | IsCurse$ True | Random$ True | NumCards$ 2 | RememberRevealed$ True | SubAbility$ DBDiscard | SpellDescription$ Target player reveals two cards at random from his or her hand, then discards each nonland card revealed this way. +SVar:DBDiscard:DB$ Discard | Mode$ Defined | Defined$ Targeted | DefinedCards$ ValidHand Card.nonLand+IsRemembered | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +Oracle:Target player reveals two cards at random from his or her hand, then discards each nonland card revealed this way. + +SetInfo:DDH Uncommon +SetInfo:DIS Uncommon \ No newline at end of file diff --git a/src/main/java/forge/card/ability/effects/RevealEffect.java b/src/main/java/forge/card/ability/effects/RevealEffect.java index a84f438095b..cbe11ab43cc 100644 --- a/src/main/java/forge/card/ability/effects/RevealEffect.java +++ b/src/main/java/forge/card/ability/effects/RevealEffect.java @@ -28,19 +28,30 @@ public class RevealEffect extends RevealEffectBase { if (handChoices.size() > 0) { final List revealed = new ArrayList(); if (sa.hasParam("Random")) { - revealed.add(Aggregates.random(handChoices)); + if (sa.hasParam("NumCards")) { + final int num = AbilityUtils.calculateAmount(host, sa.getParam("NumCards"), sa); + final int revealnum = Math.min(handChoices.size(), num); + final List hand = new ArrayList(handChoices); + for (int i = 0; i < revealnum; i++) { + final Card random = Aggregates.random(hand); + revealed.add(random); + hand.remove(random); + } + } else { + revealed.add(Aggregates.random(handChoices)); + } GuiChoose.oneOrNone("Revealed card(s)", revealed); } else { List valid = new ArrayList(handChoices); int max = 1; - if (sa.hasParam("RevealValid")) { + if (anyNumber) { valid = CardLists.getValidCards(valid, sa.getParam("RevealValid"), p, host); } if (sa.hasParam("AnyNumber")) { max = valid.size(); } else if (sa.hasParam("NumCards")) { - max = Math.min(valid.size(), AbilityUtils.calculateAmount(sa.getSourceCard(), sa.getParam("NumCards"), sa)); + max = Math.min(valid.size(), AbilityUtils.calculateAmount(host, sa.getParam("NumCards"), sa)); } //revealed.addAll(getRevealedList(sa.getActivatingPlayer(), valid, max, anyNumber)); revealed.addAll(getRevealedList(p, valid, max, anyNumber));