diff --git a/.gitattributes b/.gitattributes index c5b911bc663..c43d009dfd5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5733,6 +5733,7 @@ res/cardsfolder/j/juggernaut.txt svneol=native#text/plain res/cardsfolder/j/juju_bubble.txt svneol=native#text/plain res/cardsfolder/j/jukai_messenger.txt svneol=native#text/plain res/cardsfolder/j/jump.txt svneol=native#text/plain +res/cardsfolder/j/jund.txt -text res/cardsfolder/j/jund_battlemage.txt svneol=native#text/plain res/cardsfolder/j/jund_charm.txt svneol=native#text/plain res/cardsfolder/j/jund_hackblade.txt svneol=native#text/plain diff --git a/res/cardsfolder/j/jund.txt b/res/cardsfolder/j/jund.txt new file mode 100644 index 00000000000..53743d26326 --- /dev/null +++ b/res/cardsfolder/j/jund.txt @@ -0,0 +1,16 @@ +Name:Jund +ManaCost:no cost +Types:Plane Alara +T:Mode$ SpellCast | ValidCard$ Creature.Black,Creature.Red,Creature.Green | ValidActivatingPlayer$ Player | TriggerZones$ Command | Execute$ DevourPump | TriggerDescription$ Whenever a player casts a black, red, or green creature spell, it gains devour 5. (As the creature enters the battlefield, its controller may sacrifice any number of creatures. The creature enters the battlefield with five times that many +1/+1 counters on it.) +SVar:DevourPump:AB$ Animate | Cost$ 0 | Defined$ TriggeredCard | Replacements$ etbDevour | sVars$ JundETB,JundSac,JundSacX,JundRememberedX,JundCounters,JundCleanup | Permanent$ True +SVar:etbDevour:Event$ Moved | ValidCard$ Card.Self | Destination$ Battlefield | ReplaceWith$ JundETB | Description$ Devour 5 (As the creature enters the battlefield, its controller may sacrifice any number of creatures. The creature enters the battlefield with five times that many +1/+1 counters on it.) +SVar:JundSac:DB$ Sacrifice | Defined$ You | Amount$ JundSacX | References$ JundSacX | SacValid$ Creature.Other | RememberSacrificed$ True | SacMessage$ another creature (Devour 5) | Optional$ True | Devour$ True | SubAbility$ JundCounters +SVar:JundETB:AB$ ChangeZone | Cost$ 0 | Hidden$ True | Origin$ All | Destination$ Battlefield | Defined$ ReplacedCard | SubAbility$ JundSac +SVar:JundSacX:Count$Valid Creature.YouCtrl+Other +SVar:JundCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:JundRememberedX:Count$RememberedSize/Times.5 +SVar:JundCounters:DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ JundRememberedX | References$ JundRememberedX | SubAbility$ JundCleanup +T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ RolledChaos | TriggerDescription$ Whenever you roll Chaos, put two 1/1 red Goblin creature tokens onto the battlefield. +SVar:RolledChaos:AB$ Token | Cost$ 0 | TokenAmount$ 2 | TokenPower$ 1 | TokenName$ Goblin | TokenToughness$ 1 | TokenColors$ Red | TokenTypes$ Creature,Goblin | TokenOwner$ You +SVar:Picture:http://www.wizards.com/global/images/magic/general/jund.jpg +Oracle:Whenever a player casts a black, red, or green creature spell, it gains devour 5. (As the creature enters the battlefield, its controller may sacrifice any number of creatures. The creature enters the battlefield with five times that many +1/+1 counters on it.)\nWhenever you roll {C}, put two 1/1 red Goblin creature tokens onto the battlefield. \ No newline at end of file diff --git a/res/cardsfolder/m/maelstrom_nexus.txt b/res/cardsfolder/m/maelstrom_nexus.txt index fab09c77318..d02249c3ed9 100644 --- a/res/cardsfolder/m/maelstrom_nexus.txt +++ b/res/cardsfolder/m/maelstrom_nexus.txt @@ -1,6 +1,12 @@ Name:Maelstrom Nexus ManaCost:W U B R G Types:Enchantment -Text:The first spell you cast each turn has cascade. +T:Mode$ SpellCast | ValidCard$ Card.YouCtrl | CheckSVar$ Y | SVarCompare$ EQ1 | TriggerZones$ Battlefield | Execute$ MaelstromCascade | Secondary$ True | TriggerDescription$ The first spell you cast each turn has cascade. (When you cast your first spell, exile cards from the top of your library until you exile a nonland card that costs less. You may cast it without paying its mana cost. Put the exiled cards on the bottom in a random order.) +SVar:MaelstromCascade:AB$ DigUntil | Cost$ 0 | Defined$ You | Amount$ 1 | Valid$ Card.nonLand+cmcLTX | FoundDestination$ Exile | RevealedDestination$ Exile | References$ X | ImprintRevealed$ True | RememberFound$ True | SubAbility$ DBCast +SVar:DBCast:DB$ Play | Defined$ Remembered | WithoutManaCost$ True | Optional$ True | SubAbility$ DBMoveToLib +SVar:DBMoveToLib:DB$ ChangeZoneAll | ChangeType$ Card.IsRemembered,Card.IsImprinted | Origin$ Exile | Destination$ Library | RandomOrder$ True | LibraryPosition$ -1 | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True | ClearImprinted$ True +SVar:X:Count$TriggeredCardManaCost +SVar:Y:Count$ThisTurnCast_Card.YouCtrl SVar:Picture:http://www.wizards.com/global/images/magic/general/maelstrom_nexus.jpg Oracle:The first spell you cast each turn has cascade. (When you cast your first spell, exile cards from the top of your library until you exile a nonland card that costs less. You may cast it without paying its mana cost. Put the exiled cards on the bottom in a random order.) \ No newline at end of file diff --git a/res/cardsfolder/t/thromok_the_insatiable.txt b/res/cardsfolder/t/thromok_the_insatiable.txt index 606aad9a9d9..b0fe4b8310f 100644 --- a/res/cardsfolder/t/thromok_the_insatiable.txt +++ b/res/cardsfolder/t/thromok_the_insatiable.txt @@ -3,6 +3,7 @@ ManaCost:3 R G Types:Legendary Creature Hellion PT:0/0 K:Devour:X:, where X is the number of creatures devoured this way -SVar:X:Count$Devoured Creature +SVar:X:Count$RememberedSize +# Change the script in order to be compatible with Jund, each Devour ability will remember the sacrificed card separately. Remembered$Amount doesn't work SVar:Picture:http://www.wizards.com/global/images/magic/general/thromok_the_insatiable.jpg Oracle:Devour X, where X is the number of creatures devoured this way (As this enters the battlefield, you may sacrifice any number of creatures. This creature enters the battlefield with X +1/+1 counters on it for each of those creatures.) \ No newline at end of file diff --git a/src/main/java/forge/card/ability/effects/SacrificeEffect.java b/src/main/java/forge/card/ability/effects/SacrificeEffect.java index 76020010b75..b1421da18e6 100644 --- a/src/main/java/forge/card/ability/effects/SacrificeEffect.java +++ b/src/main/java/forge/card/ability/effects/SacrificeEffect.java @@ -1,5 +1,6 @@ package forge.card.ability.effects; +import java.util.HashMap; import java.util.List; import forge.Card; @@ -9,6 +10,7 @@ import forge.CardUtil; import forge.card.ability.AbilityUtils; import forge.card.ability.SpellAbilityEffect; import forge.card.spellability.SpellAbility; +import forge.card.trigger.TriggerType; import forge.game.Game; import forge.game.player.Player; import forge.game.zone.ZoneType; @@ -26,6 +28,7 @@ public class SacrificeEffect extends SpellAbilityEffect { final String num = sa.hasParam("Amount") ? sa.getParam("Amount") : "1"; final int amount = AbilityUtils.calculateAmount(card, num, sa); final List tgts = getTargetPlayers(sa); + final boolean devour = sa.hasParam("Devour"); String valid = sa.getParam("SacValid"); if (valid == null) { @@ -37,8 +40,6 @@ public class SacrificeEffect extends SpellAbilityEffect { msg = valid; } - msg = "Sacrifice a " + msg; - final boolean destroy = sa.hasParam("Destroy"); final boolean remSacrificed = sa.hasParam("RememberSacrificed"); @@ -63,15 +64,21 @@ public class SacrificeEffect extends SpellAbilityEffect { } else { boolean isOptional = sa.hasParam("Optional"); choosenToSacrifice = destroy ? - p.getController().choosePermanentsToDestroy(sa, isOptional ? 0 : amount, amount, validTargets, valid) : - p.getController().choosePermanentsToSacrifice(sa, isOptional ? 0 : amount, amount, validTargets, valid); + p.getController().choosePermanentsToDestroy(sa, isOptional ? 0 : amount, amount, validTargets, msg) : + p.getController().choosePermanentsToSacrifice(sa, isOptional ? 0 : amount, amount, validTargets, msg); } for(Card sac : choosenToSacrifice) { final Card lKICopy = CardUtil.getLKICopy(sac); boolean wasSacrificed = !destroy && game.getAction().sacrifice(sac, sa); boolean wasDestroyed = destroy && game.getAction().destroy(sac, sa); - + // Run Devour Trigger + if (devour) { + card.addDevoured(lKICopy); + final HashMap runParams = new HashMap(); + runParams.put("Devoured", sac); + game.getTriggerHandler().runTrigger(TriggerType.Devoured, runParams, false); + } if ( remSacrificed && (wasDestroyed || wasSacrificed) ) { card.addRemembered(lKICopy); } diff --git a/src/main/java/forge/game/ai/ComputerUtil.java b/src/main/java/forge/game/ai/ComputerUtil.java index 5e250b8b2ac..ef48956400b 100644 --- a/src/main/java/forge/game/ai/ComputerUtil.java +++ b/src/main/java/forge/game/ai/ComputerUtil.java @@ -674,13 +674,24 @@ public class ComputerUtil { */ public static List choosePermanentsToSacrifice(final Player ai, final List cardlist, final int amount, SpellAbility source, final boolean destroy, final boolean isOptional) { - final List remaining = new ArrayList(cardlist); + List remaining = new ArrayList(cardlist); final List sacrificed = new ArrayList(); if (isOptional && source.getActivatingPlayer().isOpponentOf(ai)) { return sacrificed; // sacrifice none } - + if (isOptional && source.hasParam("Devour")) { + remaining = CardLists.filter(remaining, new Predicate() { + @Override + public boolean apply(final Card c) { + if ((c.getCMC() <= 1 && c.getNetAttack() < 3) + || c.getNetAttack() + c.getNetDefense() <= 3) { + return true; + } + return false; + } + }); + } CardLists.sortByCmcDesc(remaining); Collections.reverse(remaining);