- C13: Added Sudden Demise, Tempt with Vengeance, Terra Ravager, Toxic Deluge, Widespread Panic and Witch Hunt

This commit is contained in:
swordshine
2013-10-19 00:49:33 +00:00
parent 17e96250f7
commit ca2584f598
17 changed files with 56 additions and 22 deletions

View File

@@ -1,7 +1,7 @@
Name:Psychogenic Probe Name:Psychogenic Probe
ManaCost:2 ManaCost:2
Types:Artifact Types:Artifact
T:Mode$ Shuffled | ValidPlayer$ Player | TriggerZones$ Battlefield | Execute$ TrigDamage | TriggerDescription$ Whenever a spell or ability causes a player to shuffle his or her library, CARDNAME deals 2 damage to him or her. T:Mode$ Shuffled | ValidPlayer$ Player | ShuffleFromEffect$ True | TriggerZones$ Battlefield | Execute$ TrigDamage | TriggerDescription$ Whenever a spell or ability causes a player to shuffle his or her library, CARDNAME deals 2 damage to him or her.
SVar:TrigDamage:AB$ DealDamage | Cost$ 0 | Defined$ TriggeredPlayer | NumDmg$ 2 SVar:TrigDamage:AB$ DealDamage | Cost$ 0 | Defined$ TriggeredPlayer | NumDmg$ 2
SVar:RemRandomDeck:True SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/psychogenic_probe.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/psychogenic_probe.jpg

View File

@@ -1306,7 +1306,7 @@ public class ChangeZoneAi extends SpellAbilityAi {
} }
if (origin.contains(ZoneType.Library) && !defined && !"False".equals(sa.getParam("Shuffle")) && shuffleMandatory) { if (origin.contains(ZoneType.Library) && !defined && !"False".equals(sa.getParam("Shuffle")) && shuffleMandatory) {
player.shuffle(); player.shuffle(sa);
} }
for (final Card c : fetched) { for (final Card c : fetched) {
@@ -1407,7 +1407,7 @@ public class ChangeZoneAi extends SpellAbilityAi {
} }
if ("True".equals(sa.getParam("Shuffle"))) { if ("True".equals(sa.getParam("Shuffle"))) {
player.shuffle(); player.shuffle(sa);
} }
if (((!ZoneType.Battlefield.equals(destination) && !"Card".equals(type) && !defined) if (((!ZoneType.Battlefield.equals(destination) && !"Card".equals(type) && !defined)

View File

@@ -35,6 +35,7 @@ import forge.game.combat.CombatUtil;
import forge.game.phase.PhaseType; import forge.game.phase.PhaseType;
import forge.game.player.Player; import forge.game.player.Player;
import forge.game.zone.ZoneType; import forge.game.zone.ZoneType;
import forge.util.Aggregates;
//AB:GainControl|ValidTgts$Creature|TgtPrompt$Select target legendary creature|LoseControl$Untap,LoseControl|SpellDescription$Gain control of target xxxxxxx //AB:GainControl|ValidTgts$Creature|TgtPrompt$Select target legendary creature|LoseControl$Untap,LoseControl|SpellDescription$Gain control of target xxxxxxx
@@ -89,9 +90,13 @@ public class ControlGainAi extends SpellAbilityAi {
if (!opp.canBeTargetedBy(sa)) { if (!opp.canBeTargetedBy(sa)) {
return false; return false;
} }
if (tgt.isRandomTarget()) {
sa.getTargets().add(Aggregates.random(tgt.getAllCandidates(sa, false)));
} else {
sa.getTargets().add(opp); sa.getTargets().add(opp);
} }
} }
}
// Don't steal something if I can't Attack without, or prevent it from // Don't steal something if I can't Attack without, or prevent it from
// blocking at least // blocking at least

View File

@@ -15,6 +15,7 @@ import forge.game.ai.ComputerUtilMana;
import forge.game.phase.PhaseHandler; import forge.game.phase.PhaseHandler;
import forge.game.phase.PhaseType; import forge.game.phase.PhaseType;
import forge.game.player.Player; import forge.game.player.Player;
import forge.game.player.PlayerActionConfirmMode;
import forge.game.zone.ZoneType; import forge.game.zone.ZoneType;
import forge.util.MyRandom; import forge.util.MyRandom;
@@ -223,5 +224,13 @@ public class TokenAi extends SpellAbilityAi {
return true; return true;
} }
/* (non-Javadoc)
* @see forge.card.ability.SpellAbilityAi#confirmAction(forge.game.player.Player, forge.card.spellability.SpellAbility, forge.game.player.PlayerActionConfirmMode, java.lang.String)
*/
@Override
public boolean confirmAction(Player player, SpellAbility sa, PlayerActionConfirmMode mode, String message) {
// TODO: AILogic
return true;
}
} }

View File

@@ -136,7 +136,7 @@ public class ChangeZoneAllEffect extends SpellAbilityEffect {
if (sa.hasParam("Shuffle")) { if (sa.hasParam("Shuffle")) {
for (Player p : game.getPlayers()) { for (Player p : game.getPlayers()) {
if (Iterables.any(cards, CardPredicates.isOwner(p))) { if (Iterables.any(cards, CardPredicates.isOwner(p))) {
p.shuffle(); p.shuffle(sa);
} }
} }
} }

View File

@@ -438,7 +438,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
// for things like Gaea's Blessing // for things like Gaea's Blessing
if (sa.hasParam("Shuffle") && "True".equals(sa.getParam("Shuffle"))) { if (sa.hasParam("Shuffle") && "True".equals(sa.getParam("Shuffle"))) {
tgtC.getOwner().shuffle(); tgtC.getOwner().shuffle(sa);
} }
} else { } else {
if (destination.equals(ZoneType.Battlefield)) { if (destination.equals(ZoneType.Battlefield)) {
@@ -779,7 +779,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
// do not shuffle the library once we have placed a fetched // do not shuffle the library once we have placed a fetched
// card on top. // card on top.
if (origin.contains(ZoneType.Library) && (i < 1) && !"False".equals(sa.getParam("Shuffle"))) { if (origin.contains(ZoneType.Library) && (i < 1) && !"False".equals(sa.getParam("Shuffle"))) {
player.shuffle(); player.shuffle(sa);
} }
movedCard = game.getAction().moveToLibrary(c, libraryPos); movedCard = game.getAction().moveToLibrary(c, libraryPos);
} else if (destination.equals(ZoneType.Battlefield)) { } else if (destination.equals(ZoneType.Battlefield)) {
@@ -929,7 +929,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
if ((origin.contains(ZoneType.Library) && !destination.equals(ZoneType.Library) && !defined && shuffleMandatory) if ((origin.contains(ZoneType.Library) && !destination.equals(ZoneType.Library) && !defined && shuffleMandatory)
|| (sa.hasParam("Shuffle") && "True".equals(sa.getParam("Shuffle")))) { || (sa.hasParam("Shuffle") && "True".equals(sa.getParam("Shuffle")))) {
player.shuffle(); player.shuffle(sa);
} }
} }
@@ -969,7 +969,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
} else if (srcSA.getParam("Destination").equals("Library")) { } else if (srcSA.getParam("Destination").equals("Library")) {
game.getAction().moveToBottomOfLibrary(tgtSA.getSourceCard()); game.getAction().moveToBottomOfLibrary(tgtSA.getSourceCard());
if (srcSA.hasParam("Shuffle")) { if (srcSA.hasParam("Shuffle")) {
tgtSA.getSourceCard().getOwner().shuffle(); tgtSA.getSourceCard().getOwner().shuffle(srcSA);
} }
} else { } else {
throw new IllegalArgumentException("AbilityFactory_ChangeZone: Invalid Destination argument for card " throw new IllegalArgumentException("AbilityFactory_ChangeZone: Invalid Destination argument for card "

View File

@@ -189,7 +189,7 @@ public class CounterEffect extends SpellAbilityEffect {
game.getAction().moveToBottomOfLibrary(tgtSA.getSourceCard()); game.getAction().moveToBottomOfLibrary(tgtSA.getSourceCard());
} else if (destination.equals("ShuffleIntoLibrary")) { } else if (destination.equals("ShuffleIntoLibrary")) {
game.getAction().moveToBottomOfLibrary(tgtSA.getSourceCard()); game.getAction().moveToBottomOfLibrary(tgtSA.getSourceCard());
tgtSA.getSourceCard().getController().shuffle(); tgtSA.getSourceCard().getController().shuffle(srcSA);
} else { } else {
throw new IllegalArgumentException("AbilityFactory_CounterMagic: Invalid Destination argument for card " throw new IllegalArgumentException("AbilityFactory_CounterMagic: Invalid Destination argument for card "
+ srcSA.getSourceCard().getName()); + srcSA.getSourceCard().getName());

View File

@@ -216,7 +216,7 @@ public class DigUntilEffect extends SpellAbilityEffect {
} }
if (shuffle) { if (shuffle) {
p.shuffle(); p.shuffle(sa);
} }
} // end foreach player } // end foreach player
} }

View File

@@ -82,7 +82,7 @@ public class RearrangeTopOfLibraryEffect extends SpellAbilityEffect {
for (final Player p : getTargetPlayers(sa)) { for (final Player p : getTargetPlayers(sa)) {
if ((tgt == null) || p.canBeTargetedBy(sa)) { if ((tgt == null) || p.canBeTargetedBy(sa)) {
rearrangeTopOfLibrary(host, p, numCards, shuffle); rearrangeTopOfLibrary(host, p, numCards, shuffle, sa);
} }
} }
} }
@@ -101,7 +101,8 @@ public class RearrangeTopOfLibraryEffect extends SpellAbilityEffect {
* @param mayshuffle * @param mayshuffle
* a boolean. * a boolean.
*/ */
private void rearrangeTopOfLibrary(final Card src, final Player player, final int numCards, final boolean mayshuffle) { private void rearrangeTopOfLibrary(final Card src, final Player player, final int numCards,
final boolean mayshuffle, final SpellAbility sa) {
final PlayerZone lib = player.getZone(ZoneType.Library); final PlayerZone lib = player.getZone(ZoneType.Library);
int maxCards = lib.size(); int maxCards = lib.size();
// If library is smaller than N, only show that many cards // If library is smaller than N, only show that many cards
@@ -122,7 +123,7 @@ public class RearrangeTopOfLibraryEffect extends SpellAbilityEffect {
} }
if (mayshuffle) { if (mayshuffle) {
if (GuiDialog.confirm(src, "Do you want to shuffle the library?")) { if (GuiDialog.confirm(src, "Do you want to shuffle the library?")) {
player.shuffle(); player.shuffle(sa);
} }
} }
} }

View File

@@ -83,7 +83,7 @@ public class RestartGameEffect extends SpellAbilityEffect {
action.moveToLibrary(c, 0); action.moveToLibrary(c, 0);
} }
player.shuffle(); player.shuffle(null);
} }
trigHandler.clearSuppression(TriggerType.ChangesZone); trigHandler.clearSuppression(TriggerType.ChangesZone);

View File

@@ -22,7 +22,7 @@ public class ShuffleEffect extends SpellAbilityEffect {
if ((tgt == null) || p.canBeTargetedBy(sa)) { if ((tgt == null) || p.canBeTargetedBy(sa)) {
boolean mustShuffle = !optional || sa.getActivatingPlayer().getController().confirmAction(sa, null, "Have " + p + " shuffle?"); boolean mustShuffle = !optional || sa.getActivatingPlayer().getController().confirmAction(sa, null, "Have " + p + " shuffle?");
if (mustShuffle) if (mustShuffle)
p.shuffle(); p.shuffle(sa);
} }
} }
} }

View File

@@ -55,6 +55,7 @@ public class TokenEffect extends SpellAbilityEffect {
private String tokenName; private String tokenName;
private String[] tokenKeywords; private String[] tokenKeywords;
private String[] tokenHiddenKeywords; private String[] tokenHiddenKeywords;
private boolean optional;
private void readParameters(final SpellAbility mapParams) { private void readParameters(final SpellAbility mapParams) {
String image; String image;
@@ -114,6 +115,7 @@ public class TokenEffect extends SpellAbilityEffect {
} else { } else {
this.tokenOwner = "You"; this.tokenOwner = "You";
} }
this.optional = mapParams.hasParam("Optional");
} }
@Override @Override
@@ -205,6 +207,9 @@ public class TokenEffect extends SpellAbilityEffect {
final boolean remember = sa.hasParam("RememberTokens"); final boolean remember = sa.hasParam("RememberTokens");
final boolean imprint = sa.hasParam("ImprintTokens"); final boolean imprint = sa.hasParam("ImprintTokens");
for (final Player controller : AbilityUtils.getDefinedPlayers(host, this.tokenOwner, sa)) { for (final Player controller : AbilityUtils.getDefinedPlayers(host, this.tokenOwner, sa)) {
if (optional && !controller.getController().confirmAction(sa, null, "Do you want to make tokens?")) {
continue;
}
for (int i = 0; i < finalAmount; i++) { for (int i = 0; i < finalAmount; i++) {
final List<Card> tokens = CardFactory.makeToken(substitutedName, imageName, controller, cost, final List<Card> tokens = CardFactory.makeToken(substitutedName, imageName, controller, cost,
substitutedTypes, finalPower, finalToughness, this.tokenKeywords); substitutedTypes, finalPower, finalToughness, this.tokenKeywords);
@@ -314,6 +319,9 @@ public class TokenEffect extends SpellAbilityEffect {
} }
} }
} }
if (sa.hasParam("RememberController")) {
host.addRemembered(controller);
}
} }
} }
} }

View File

@@ -365,7 +365,7 @@ public class CardFactoryUtil {
sourceCard.getGame().getAction().moveToHand(c1); sourceCard.getGame().getAction().moveToHand(c1);
} }
sourceCard.getController().shuffle(); sourceCard.getController().shuffle(this);
} }
} }
final SpellAbility transmute = new AbilityTransmute(sourceCard, abCost, null); final SpellAbility transmute = new AbilityTransmute(sourceCard, abCost, null);

View File

@@ -55,7 +55,17 @@ public class TriggerShuffled extends Trigger {
return false; return false;
} }
} }
if (this.mapParams.containsKey("ShuffleFromEffect")) {
if (null == runParams2.get("Source")) {
return false;
}
}
if (this.mapParams.containsKey("ShuffleBySelfControlled")) {
SpellAbility source = (SpellAbility) runParams2.get("Source");
if (!source.getActivatingPlayer().equals(runParams2.get("Player"))) {
return false;
}
}
return true; return true;
} }

View File

@@ -1552,7 +1552,7 @@ public class GameAction {
for (final Card c : toMulligan) { for (final Card c : toMulligan) {
moveToLibrary(c); moveToLibrary(c);
} }
p.shuffle(); p.shuffle(null);
p.drawCards(handSize[i] - mulliganDelta); p.drawCards(handSize[i] - mulliganDelta);
} else { } else {
List<Card> toExile = Lists.newArrayList(toMulligan); List<Card> toExile = Lists.newArrayList(toMulligan);
@@ -1580,7 +1580,7 @@ public class GameAction {
for(Card c : cc) { for(Card c : cc) {
moveToLibrary(c); moveToLibrary(c);
} }
p.shuffle(); p.shuffle(null);
} }
} }

View File

@@ -292,7 +292,7 @@ public class GameNew {
final Iterable<Card> c1 = GameNew.smoothComputerManaCurve(player.getCardsIn(ZoneType.Library)); final Iterable<Card> c1 = GameNew.smoothComputerManaCurve(player.getCardsIn(ZoneType.Library));
player.getZone(ZoneType.Library).setCards(c1); player.getZone(ZoneType.Library).setCards(c1);
} else { } else {
player.shuffle(); player.shuffle(null);
} }
if(isFirstGame && player.getLobbyPlayer().getType() == PlayerType.COMPUTER) { if(isFirstGame && player.getLobbyPlayer().getType() == PlayerType.COMPUTER) {

View File

@@ -1763,7 +1763,7 @@ public class Player extends GameEntity implements Comparable<Player> {
* shuffle. * shuffle.
* </p> * </p>
*/ */
public final void shuffle() { public final void shuffle(final SpellAbility sa) {
final List<Card> list = Lists.newArrayList(this.getCardsIn(ZoneType.Library)); final List<Card> list = Lists.newArrayList(this.getCardsIn(ZoneType.Library));
if (list.size() <= 1) { if (list.size() <= 1) {
@@ -1796,6 +1796,7 @@ public class Player extends GameEntity implements Comparable<Player> {
// Run triggers // Run triggers
final HashMap<String, Object> runParams = new HashMap<String, Object>(); final HashMap<String, Object> runParams = new HashMap<String, Object>();
runParams.put("Player", this); runParams.put("Player", this);
runParams.put("Source", sa);
game.getTriggerHandler().runTrigger(TriggerType.Shuffled, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.Shuffled, runParams, false);
// Play the shuffle sound // Play the shuffle sound