@Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Card sourceCard = game.getCard(source.getSourceId()); if (sourceCard instanceof SplitCardHalf) { sourceCard = ((SplitCardHalf) sourceCard).getParentCard(); } if (sourceCard != null) { Player player = game.getPlayer(sourceCard.getOwnerId()); if (player != null) { return player.moveCards(sourceCard, Zone.EXILED, source, game); } } return false; }
UUID idToCheck; if (affectedAbility != null && affectedAbility.getSourceObject(game) instanceof SplitCardHalf) { idToCheck = ((SplitCardHalf) affectedAbility.getSourceObject(game)).getParentCard().getId(); } else { if (game.getObject(objectId) instanceof SplitCardHalf) { idToCheck = ((SplitCardHalf) game.getObject(objectId)).getParentCard().getId(); } else { idToCheck = objectId;
@Override public boolean applies(GameEvent evt, Ability source, Game game) { ZoneChangeEvent event = (ZoneChangeEvent) evt; if (event.getFromZone() == Zone.STACK && event.getToZone() != Zone.EXILED) { // Moving something from stack to somewhere else // Get the source id, getting the whole split card's ID, because // that's the card that is changing zones in the event, but // source.getSourceId is only the split card half. // If branch so that we also support putting Aftermath on // non-split cards for... whatever reason, in case somebody // wants to do that in the future. UUID sourceId = source.getSourceId(); Card sourceCard = game.getCard(source.getSourceId()); if (sourceCard instanceof SplitCardHalf) { sourceCard = ((SplitCardHalf) sourceCard).getParentCard(); sourceId = sourceCard.getId(); } if (event.getTargetId().equals(sourceId)) { // Moving this spell from stack to yard Spell spell = game.getStack().getSpell(source.getSourceId()); if (spell != null && spell.getFromZone() == Zone.GRAVEYARD) { // And this spell was cast from the graveyard, so we need to exile it return true; } } } return false; }
artRect = ArtRect.SPLIT_FUSED; } else if (spell.getCard() != null) { SplitCard wholeCard = ((SplitCardHalf) spell.getCard()).getParentCard(); Abilities<Ability> aftermathHalfAbilities = wholeCard.getRightHalfCard().getAbilities(); if (aftermathHalfAbilities.stream().anyMatch(ability -> ability instanceof AftermathAbility)) {