Merge pull request #3585 from tool4ever/fixDump

Fix Cellar Door
This commit is contained in:
kevlahnota
2023-08-02 01:28:16 +08:00
committed by GitHub
6 changed files with 12 additions and 29 deletions

View File

@@ -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

View File

@@ -94,7 +94,7 @@ public class CostMill extends CostPart {
Map<AbilityKey, Object> 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;
}

View File

@@ -1594,11 +1594,7 @@ public class Player extends GameEntity implements Comparable<Player> {
return notedNum.get(notedFor);
}
public final CardCollectionView mill(int n, final ZoneType destination,
final boolean bottom, SpellAbility sa, CardZoneTable table, Map<AbilityKey, Object> 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<AbilityKey, Object> params) {
// Replacement effects
final Map<AbilityKey, Object> repRunParams = AbilityKey.mapFromAffected(this);
repRunParams.put(AbilityKey.Number, n);
@@ -1606,7 +1602,7 @@ public class Player extends GameEntity implements Comparable<Player> {
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<Player> {
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) {

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.)