Merge pull request #3787 from tool4ever/fixashiok

Fix Ashiok
This commit is contained in:
kevlahnota
2023-09-20 15:01:47 +08:00
committed by GitHub
7 changed files with 196 additions and 186 deletions

View File

@@ -118,6 +118,7 @@ public enum AbilityKey {
ScryBottom("ScryBottom"),
ScryNum("ScryNum"),
Sides("Sides"),
SimultaneousETB("SimultaneousETB"),
Source("Source"),
Sources("Sources"),
SourceSA("SourceSA"),

View File

@@ -107,8 +107,6 @@ public class ChangeZoneAllEffect extends SpellAbilityEffect {
}
}
cards = (CardCollection)AbilityUtils.filterListByType(cards, sa.getParam("ChangeType"), sa);
if (sa.hasParam("Optional")) {
final String targets = Lang.joinHomogenous(cards);
final String message;
@@ -123,6 +121,12 @@ public class ChangeZoneAllEffect extends SpellAbilityEffect {
}
}
cards = (CardCollection)AbilityUtils.filterListByType(cards, sa.getParam("ChangeType"), sa);
if (sa.hasParam("TypeLimit")) {
cards = new CardCollection(Iterables.limit(cards, AbilityUtils.calculateAmount(source, sa.getParam("TypeLimit"), sa)));
}
if (sa.hasParam("ForgetOtherRemembered")) {
source.clearRemembered();
}
@@ -171,6 +175,7 @@ public class ChangeZoneAllEffect extends SpellAbilityEffect {
moveParams.put(AbilityKey.LastStateGraveyard, lastStateGraveyard);
if (destination == ZoneType.Battlefield) {
moveParams.put(AbilityKey.SimultaneousETB, cards);
if (sa.hasAdditionalAbility("AnimateSubAbility")) {
// need LKI before Animate does apply
moveParams.put(AbilityKey.CardLKI, CardUtil.getLKICopy(c));

View File

@@ -573,11 +573,11 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
}
movedCard = game.getAction().moveToLibrary(gameCard, libraryPosition, sa);
} else {
if (destination.equals(ZoneType.Battlefield)) {
} else if (destination.equals(ZoneType.Battlefield)) {
Map<AbilityKey, Object> moveParams = AbilityKey.newMap();
moveParams.put(AbilityKey.LastStateBattlefield, lastStateBattlefield);
moveParams.put(AbilityKey.LastStateGraveyard, lastStateGraveyard);
moveParams.put(AbilityKey.SimultaneousETB, tgtCards);
if (sa.isReplacementAbility()) {
ReplacementEffect re = sa.getReplacementEffect();
moveParams.put(AbilityKey.ReplacementEffect, re);
@@ -763,7 +763,6 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
movedCard.setDiscarded(true);
}
}
}
if (!movedCard.getZone().equals(originZone)) {
Card meld = null;
triggerList.put(originZone.getZoneType(), movedCard.getZone().getZoneType(), movedCard);
@@ -1305,6 +1304,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
movedCard = game.getAction().moveToLibrary(c, libraryPos, sa, moveParams);
}
else if (destination.equals(ZoneType.Battlefield)) {
moveParams.put(AbilityKey.SimultaneousETB, chosenCards);
if (sa.hasParam("Tapped")) {
c.setTapped(true);
}

View File

@@ -398,11 +398,14 @@ public class DigEffect extends SpellAbilityEffect {
if (sa.hasParam("Tapped")) {
c.setTapped(true);
}
if (destZone1.equals(ZoneType.Battlefield) && sa.hasParam("WithCounter")) {
if (destZone1.equals(ZoneType.Battlefield)) {
moveParams.put(AbilityKey.SimultaneousETB, movedCards);
if (sa.hasParam("WithCounter")) {
final int numCtr = AbilityUtils.calculateAmount(host,
sa.getParamOrDefault("WithCounterNum", "1"), sa);
c.addEtbCounter(CounterType.getType(sa.getParam("WithCounter")), numCtr, player);
}
}
if (sa.hasAdditionalAbility("AnimateSubAbility")) {
// need LKI before Animate does apply
moveParams.put(AbilityKey.CardLKI, CardUtil.getLKICopy(c));
@@ -477,8 +480,7 @@ public class DigEffect extends SpellAbilityEffect {
}
} else {
// just move them randomly
for (int i = 0; i < rest.size(); i++) {
Card c = rest.get(i);
for (Card c : rest) {
final ZoneType origin = c.getZone().getZoneType();
final PlayerZone toZone = c.getOwner().getZone(destZone2);
c = game.getAction().moveTo(toZone, c, sa);

View File

@@ -99,11 +99,6 @@ public class DigUntilEffect extends SpellAbilityEffect {
final Card host = sa.getHostCard();
final Game game = host.getGame();
String[] type = new String[]{"Card"};
if (sa.hasParam("Valid")) {
type = sa.getParam("Valid").split(",");
}
int untilAmount = 1;
if (sa.hasParam("Amount")) {
untilAmount = AbilityUtils.calculateAmount(host, sa.getParam("Amount"), sa);
@@ -115,6 +110,11 @@ public class DigUntilEffect extends SpellAbilityEffect {
maxRevealed = AbilityUtils.calculateAmount(host, sa.getParam("MaxRevealed"), sa);
}
String[] type = new String[]{"Card"};
if (sa.hasParam("Valid")) {
type = sa.getParam("Valid").split(",");
}
final boolean remember = sa.hasParam("RememberFound");
final boolean imprint = sa.hasParam("ImprintFound");
@@ -210,6 +210,7 @@ public class DigUntilEffect extends SpellAbilityEffect {
moveParams.put(AbilityKey.LastStateGraveyard, lastStateGraveyard);
Card m = null;
if (foundDest.equals(ZoneType.Battlefield)) {
moveParams.put(AbilityKey.SimultaneousETB, new CardCollection(c));
if (sa.hasParam("GainControl")) {
c.setController(sa.getActivatingPlayer(), game.getNextTimestamp());
}

View File

@@ -312,6 +312,7 @@ public class ReplacementHandler {
replacementEffect.setReplacingObjects(runParams, tailend);
//set original Params to update them later
tailend.setReplacingObject(AbilityKey.OriginalParams, runParams);
tailend.setReplacingObjectsFrom(runParams, AbilityKey.SimultaneousETB);
tailend = tailend.getSubAbility();
} while(tailend != null);

View File

@@ -3,12 +3,12 @@ ManaCost:3 B B
Types:Legendary Planeswalker Ashiok
Loyalty:5
R:Event$ PayLife | ActiveZones$ Battlefield | ValidPlayer$ You | ReplaceWith$ ExileTop | Amount$ LEY | Description$ If you would pay life while your library has at least that many cards in it, exile that many cards from the top of your library instead.
SVar:ExileTop:DB$ Dig | DigNum$ X | ChangeNum$ All | DestinationZone$ Exile
SVar:ExileTop:DB$ ChangeZoneAll | TypeLimit$ X | ChangeType$ Card.NotDefinedReplacedSimultaneousETB | Defined$ You | Origin$ Library | Destination$ Exile
SVar:X:ReplaceCount$Amount
SVar:Y:Count$ValidLibrary Card
SVar:Y:Count$ValidLibrary Card.YouOwn
A:AB$ Dig | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | DigNum$ 2 | ChangeNum$ 1 | DestinationZone2$ Exile | NoReveal$ True | SpellDescription$ Look at the top two cards of your library. Exile one of them and put the other into your hand.
A:AB$ Token | Cost$ SubCounter<2/LOYALTY> | Planeswalker$ True | TokenAmount$ 2 | TokenScript$ b_1_1_nightmare_exile_counter | TokenOwner$ You | SpellDescription$ Create two 1/1 black Nightmare creature tokens with "At the beginning of combat on your turn, if a card was put into exile this turn, put a +1/+1 counter on this creature."
A:AB$ Discard | Cost$ SubCounter<7/LOYALTY> | Planeswalker$ True | Ultimate$ True | ValidTgts$ Player | NumCards$ Z | Mode$ TgtChoose | SpellDescription$ Target player exiles the top X cards of their library, where X is the total mana value of cards you own in exile.
A:AB$ Dig | Cost$ SubCounter<7/LOYALTY> | Planeswalker$ True | Ultimate$ True | ValidTgts$ Player | DigNum$ Z | ChangeNum$ All | DestinationZone$ Exile | SpellDescription$ Target player exiles the top X cards of their library, where X is the total mana value of cards you own in exile.
SVar:Z:Count$ValidExile Card.YouOwn$SumCMC
AI:RemoveDeck:Random
Oracle:If you would pay life while your library has at least that many cards in it, exile that many cards from the top of your library instead.\n+1: Look at the top two cards of your library. Exile one of them and put the other into your hand.\n2: Create two 1/1 black Nightmare creature tokens with "At the beginning of combat on your turn, if a card was put into exile this turn, put a +1/+1 counter on this creature."\n7: Target player exiles the top X cards of their library, where X is the total mana value of cards you own in exile.