[DMU] Implement Silver Scrutiny and fix #7326 (#9508)

This commit is contained in:
Alex W. Jackson 2022-09-13 20:15:04 -04:00 committed by GitHub
parent dafd7f8e7c
commit c3ce7898de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 179 additions and 25 deletions

View file

@ -38,14 +38,18 @@ public class SacrificeIfCastAtInstantTimeTriggeredAbility extends TriggeredAbili
@Override
public boolean checkTrigger(GameEvent event, Game game) {
// The sacrifice occurs only if you cast it using its own ability. If you cast it using some other
// effect (for instance, if it gained flash from Vedalken Orrery), then it won't be sacrificed.
// CHECK
// TODO: The sacrifice should occur only if you cast it using its own ability. If you cast it using some
// other effect (for instance, if it gained flash from Vedalken Orrery), then it shouldn't be sacrificed.
// see https://github.com/magefree/mage/issues/9512
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && spell.getSourceId().equals(getSourceId())) {
return !(game.isMainPhase() && game.isActivePlayer(event.getPlayerId()) && game.getStack().size() == 1);
if (spell == null || !spell.getSourceId().equals(getSourceId())) {
return false;
}
return false;
// TODO: this is a hack and doesn't handle all other ways a spell could be cast as though it had flash
if (Boolean.TRUE.equals(game.getState().getValue("PlayFromNotOwnHandZone" + getSourceId()))) {
return false;
}
return !(game.isMainPhase() && game.isActivePlayer(event.getPlayerId()) && game.getStack().size() == 1);
}
@Override