[NEO] fixed bugs with Kotose, the Silent Spider and March of Reckless Joy (fixes #8737, fixes #8736)

This commit is contained in:
Evan Kranzler 2022-03-02 18:10:26 -05:00
parent 93cc71f40c
commit 32bf246e77
3 changed files with 12 additions and 13 deletions

View file

@ -122,6 +122,7 @@ class KotoseTheSilentSpiderEffect extends OneShotEffect {
Set<Card> cardSet = cards.getCards(game); Set<Card> cardSet = cards.getCards(game);
controller.moveCardsToExile(cardSet, source, game, true, exileId, exileName); controller.moveCardsToExile(cardSet, source, game, true, exileId, exileName);
opponent.shuffleLibrary(source, game); opponent.shuffleLibrary(source, game);
cardSet.add(card);
if (cardSet.isEmpty() || source.getSourcePermanentIfItStillExists(game) == null) { if (cardSet.isEmpty() || source.getSourcePermanentIfItStillExists(game) == null) {
return true; return true;
} }

View file

@ -88,28 +88,22 @@ class MarchOfRecklessJoyEffect extends OneShotEffect {
CardUtil.getExileZoneId(game, source), CardUtil.getExileZoneId(game, source),
CardUtil.getSourceName(game, source) CardUtil.getSourceName(game, source)
); );
Condition condition = new MarchOfRecklessJoyCondition(source);
for (Card card : cards) { for (Card card : cards) {
CardUtil.makeCardPlayable( CardUtil.makeCardPlayable(
game, source, card, Duration.UntilEndOfYourNextTurn, game, source, card, Duration.UntilEndOfYourNextTurn,
false, null, condition false, null, MarchOfRecklessJoyCondition.instance
); );
} }
return true; return true;
} }
} }
class MarchOfRecklessJoyCondition implements Condition { enum MarchOfRecklessJoyCondition implements Condition {
instance;
private final MageObjectReference mor;
MarchOfRecklessJoyCondition(Ability source) {
this.mor = new MageObjectReference(source);
}
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
return MarchOfRecklessJoyWatcher.check(mor, game); return MarchOfRecklessJoyWatcher.check(source, game);
} }
} }
@ -133,7 +127,11 @@ class MarchOfRecklessJoyWatcher extends Watcher {
); );
} }
static boolean check(MageObjectReference mor, Game game) { static boolean check(Ability source, Game game) {
return game.getState().getWatcher(MarchOfRecklessJoyWatcher.class).morMap.getOrDefault(mor, 0) < 2; return game
.getState()
.getWatcher(MarchOfRecklessJoyWatcher.class)
.morMap
.getOrDefault(new MageObjectReference(source, 1), 0) < 2;
} }
} }

View file

@ -48,7 +48,7 @@ public class ExileCardsFromHandAdjuster implements CostAdjuster {
Zone.ALL, Zone.ALL,
new InfoEffect("as an additional cost to cast this spell, you may exile any number of " new InfoEffect("as an additional cost to cast this spell, you may exile any number of "
+ filter.getMessage() + ". This spell costs {2} less to cast for each card exiled this way") + filter.getMessage() + ". This spell costs {2} less to cast for each card exiled this way")
)); ).setRuleAtTheTop(true));
card.getSpellAbility().setCostAdjuster(new ExileCardsFromHandAdjuster(filter)); card.getSpellAbility().setCostAdjuster(new ExileCardsFromHandAdjuster(filter));
} }
} }