Fix casting of Disturb cards with Auras on the back (#8600)

This commit is contained in:
Alex W. Jackson 2022-07-08 23:37:52 -04:00 committed by GitHub
parent b473300680
commit a94c837ad0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 6 deletions

View file

@ -30,14 +30,10 @@ public class DisturbAbility extends SpellAbility {
private SpellAbility spellAbilityToResolve;
public DisturbAbility(Card card, String manaCost) {
super(card.getSpellAbility());
super(card.getSecondFaceSpellAbility());
this.newId();
// verify check
if (card.getSecondCardFace() == null || card.getSecondCardFace().getClass().equals(card.getClass())) {
throw new IllegalArgumentException("Wrong code usage. Disturb ability can be added to double faces card only (main side).");
}
// getSecondFaceSpellAbility() already verified that second face exists
this.setCardName(card.getSecondCardFace().getName() + " with Disturb");
this.zone = Zone.GRAVEYARD;
this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE;