diff --git a/forge-game/src/main/java/forge/game/ability/effects/MillEffect.java b/forge-game/src/main/java/forge/game/ability/effects/MillEffect.java index 96947f7e21c..33d902674e4 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/MillEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/MillEffect.java @@ -24,7 +24,6 @@ public class MillEffect extends SpellAbilityEffect { final Card source = sa.getHostCard(); final Game game = source.getGame(); final int numCards = sa.hasParam("NumCards") ? AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParam("NumCards"), sa) : 1; - final boolean bottom = sa.hasParam("FromBottom"); final boolean facedown = sa.hasParam("ExileFaceDown"); final boolean reveal = !sa.hasParam("NoReveal"); final boolean showRevealDialog = sa.hasParam("ShowMilledCards"); @@ -55,7 +54,7 @@ public class MillEffect extends SpellAbilityEffect { continue; } } - final CardCollectionView milled = p.mill(numCards, destination, bottom, sa, table, moveParams); + final CardCollectionView milled = p.mill(numCards, destination, sa, table, moveParams); // Reveal the milled cards, so players don't have to manually inspect the // graveyard to figure out which ones were milled. if (!facedown && reveal) { // do not reveal when exiling face down diff --git a/forge-game/src/main/java/forge/game/cost/CostMill.java b/forge-game/src/main/java/forge/game/cost/CostMill.java index 328319c02ae..37bd5073cd7 100644 --- a/forge-game/src/main/java/forge/game/cost/CostMill.java +++ b/forge-game/src/main/java/forge/game/cost/CostMill.java @@ -94,7 +94,7 @@ public class CostMill extends CostPart { Map moveParams = AbilityKey.newMap(); moveParams.put(AbilityKey.LastStateBattlefield, ai.getGame().getLastStateBattlefield()); moveParams.put(AbilityKey.LastStateGraveyard, ai.getGame().getLastStateGraveyard()); - ability.getPaidHash().put("Milled", true, (CardCollection) ai.mill(decision.c, ZoneType.Graveyard, false, ability, table, moveParams)); + ability.getPaidHash().put("Milled", true, (CardCollection) ai.mill(decision.c, ZoneType.Graveyard, ability, table, moveParams)); table.triggerChangesZoneAll(ai.getGame(), ability); return true; } diff --git a/forge-game/src/main/java/forge/game/player/Player.java b/forge-game/src/main/java/forge/game/player/Player.java index ec7edd9d099..2c2629e6725 100644 --- a/forge-game/src/main/java/forge/game/player/Player.java +++ b/forge-game/src/main/java/forge/game/player/Player.java @@ -1594,11 +1594,7 @@ public class Player extends GameEntity implements Comparable { return notedNum.get(notedFor); } - public final CardCollectionView mill(int n, final ZoneType destination, - final boolean bottom, SpellAbility sa, CardZoneTable table, Map params) { - final CardCollectionView lib = getCardsIn(ZoneType.Library); - final CardCollection milled = new CardCollection(); - + public final CardCollectionView mill(int n, final ZoneType destination, SpellAbility sa, CardZoneTable table, Map params) { // Replacement effects final Map repRunParams = AbilityKey.mapFromAffected(this); repRunParams.put(AbilityKey.Number, n); @@ -1606,7 +1602,7 @@ public class Player extends GameEntity implements Comparable { repRunParams.putAll(params); } - if (destination == ZoneType.Graveyard && !bottom) { + if (destination == ZoneType.Graveyard) { switch (getGame().getReplacementHandler().run(ReplacementType.Mill, repRunParams)) { case NotReplaced: break; @@ -1615,24 +1611,15 @@ public class Player extends GameEntity implements Comparable { if (this.equals(repRunParams.get(AbilityKey.Affected))) { n = (int) repRunParams.get(AbilityKey.Number); } else { - return milled; + return CardCollection.EMPTY; } break; default: - return milled; - } - } - - final int max = Math.min(n, lib.size()); - - for (int i = 0; i < max; i++) { - if (bottom) { - milled.add(lib.get(lib.size() - i - 1)); - } else { - milled.add(lib.get(i)); + return CardCollection.EMPTY; } } + CardCollection milled = getTopXCardsFromLibrary(n); CardCollectionView milledView = milled; if (destination == ZoneType.Graveyard) { diff --git a/forge-gui/res/cardsfolder/c/call_the_coppercoats.txt b/forge-gui/res/cardsfolder/c/call_the_coppercoats.txt index 8a44c8876c2..873b1ae79ca 100644 --- a/forge-gui/res/cardsfolder/c/call_the_coppercoats.txt +++ b/forge-gui/res/cardsfolder/c/call_the_coppercoats.txt @@ -2,10 +2,9 @@ Name:Call the Coppercoats ManaCost:2 W Types:Instant K:Strive:1 W -A:SP$ RepeatEach | Cost$ 2 W | ValidTgts$ Opponent | TargetMin$ 0 | TargetMax$ MaxTargets | TgtPrompt$ Choose any number of target opponents | RepeatPlayers$ Targeted | RepeatSubAbility$ DBToken | SpellDescription$ Choose any number of target opponents. Create X 1/1 white Human Soldier creature tokens, where X is the number of creatures those opponents control. +A:SP$ Token | TokenAmount$ X | TokenScript$ w_1_1_human_soldier | TokenOwner$ You | ValidTgts$ Opponent | TargetMin$ 0 | TargetMax$ MaxTargets | TgtPrompt$ Choose any number of target opponents | SpellDescription$ Choose any number of target opponents. Create X 1/1 white Human Soldier creature tokens, where X is the number of creatures those opponents control. SVar:MaxTargets:PlayerCountOpponents$Amount -SVar:DBToken:DB$ Token | TokenAmount$ X | TokenScript$ w_1_1_human_soldier | TokenOwner$ You -SVar:X:Count$Valid Creature.RememberedPlayerCtrl +SVar:X:Count$Valid Creature.TargetedPlayerCtrl DeckHas:Ability$Token AI:RemoveDeck:All Oracle:Strive — This spell costs {1}{W} more to cast for each target beyond the first.\nChoose any number of target opponents. Create X 1/1 white Human Soldier creature tokens, where X is the number of creatures those opponents control. diff --git a/forge-gui/res/cardsfolder/c/cellar_door.txt b/forge-gui/res/cardsfolder/c/cellar_door.txt index 4615bb23895..991053bb342 100644 --- a/forge-gui/res/cardsfolder/c/cellar_door.txt +++ b/forge-gui/res/cardsfolder/c/cellar_door.txt @@ -1,7 +1,7 @@ Name:Cellar Door ManaCost:2 Types:Artifact -A:AB$ Mill | Cost$ 3 T | NumCards$ 1 | ValidTgts$ Player | TgtPrompt$ Choose a player | FromBottom$ True | RememberMilled$ True | SubAbility$ DBToken | StackDescription$ {p:Targeted} puts the bottom card of their library into their graveyard. | SpellDescription$ Target player puts the bottom card of their library into their graveyard. If it's a creature card, you create a 2/2 black Zombie creature token. +A:AB$ Dig | Cost$ 3 T | DigNum$ 1 | ChangeNum$ All | ValidTgts$ Player | FromBottom$ True | DestinationZone$ Graveyard | RememberChanged$ True | SubAbility$ DBToken | StackDescription$ {p:Targeted} puts the bottom card of their library into their graveyard. | SpellDescription$ Target player puts the bottom card of their library into their graveyard. If it's a creature card, you create a 2/2 black Zombie creature token. SVar:DBToken:DB$ Token | TokenScript$ b_2_2_zombie | TokenOwner$ You | TokenAmount$ 1 | ConditionDefined$ Remembered | ConditionPresent$ Creature | ConditionCompare$ EQ1 | SubAbility$ DBCleanup | StackDescription$ If it's a creature card, {p:You} creates a 2/2 black Zombie creature token. | SpellDescription$ If it's a creature card, you create a 2/2 black Zombie creature token. SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True Oracle:{3}, {T}: Target player puts the bottom card of their library into their graveyard. If it's a creature card, you create a 2/2 black Zombie creature token. diff --git a/forge-gui/res/cardsfolder/o/ogre_head_helm.txt b/forge-gui/res/cardsfolder/o/ogre_head_helm.txt index 6229ea553fa..390ff0b9b18 100644 --- a/forge-gui/res/cardsfolder/o/ogre_head_helm.txt +++ b/forge-gui/res/cardsfolder/o/ogre_head_helm.txt @@ -4,10 +4,8 @@ Types:Artifact Creature Equipment Ogre PT:2/2 K:Reconfigure:3 S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddPower$ 2 | AddToughness$ 2 | Description$ Equipped creature gets +2/+2. -T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigDiscard1 | TriggerDescription$ Whenever CARDNAME or equipped creature deals combat damage to a player, you may sacrifice it. If you do, discard your hand, then draw three cards. -T:Mode$ DamageDone | ValidSource$ Creature.EquippedBy | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigDiscard2 | Secondary$ True | TriggerDescription$ Whenever CARDNAME or equipped creature deals combat damage to a player, you may sacrifice it. If you do, discard your hand, then draw three cards. -SVar:TrigDiscard1:AB$ Discard | Cost$ Sac<1/CARDNAME> | Mode$ Hand | SubAbility$ DBDraw -SVar:TrigDiscard2:AB$ Discard | Cost$ Sac<1/Creature.EquippedBy/equipped creature> | Mode$ Hand | SubAbility$ DBDraw +T:Mode$ DamageDone | ValidSource$ Card.Self,Creature.EquippedBy | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigDiscard | TriggerDescription$ Whenever CARDNAME or equipped creature deals combat damage to a player, you may sacrifice it. If you do, discard your hand, then draw three cards. +SVar:TrigDiscard:AB$ Discard | Cost$ Sac<1/Card.TriggeredSource> | Mode$ Hand | SubAbility$ DBDraw SVar:DBDraw:DB$ Draw | NumCards$ 3 DeckHas:Ability$Sacrifice|Discard Oracle:Equipped creature gets +2/+2.\nWhenever Ogre-Head Helm or equipped creature deals combat damage to a player, you may sacrifice it. If you do, discard your hand, then draw three cards.\nReconfigure {3} ({3}: Attach to target creature you control; or unattach from a creature. Reconfigure only as a sorcery. While attached, this isn't a creature.)