[WOE] Implement Decadent Dragon (#10852)

Grouped together a few Gonti-like look effect.

Co-authored-by: Evan Kranzler <theelk801@gmail.com>
This commit is contained in:
Susucre 2023-08-18 21:13:13 +02:00 committed by GitHub
parent 4cfc6ebc37
commit 8ad37e19b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 182 additions and 148 deletions

View file

@ -0,0 +1,51 @@
package mage.abilities.effects.common.asthought;
import mage.abilities.Ability;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.constants.AsThoughEffectType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.game.Game;
import java.util.UUID;
/**
* @author Susucr
* <p>
* An authorized player may look at the target card for as long it remains exiled.
*/
public class MayLookAtTargetCardEffect extends AsThoughEffectImpl {
private final UUID authorizedPlayerId;
public MayLookAtTargetCardEffect(UUID authorizedPlayerId) {
super(AsThoughEffectType.LOOK_AT_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit);
this.authorizedPlayerId = authorizedPlayerId;
staticText = "You may look at the cards exiled with {this}";
}
private MayLookAtTargetCardEffect(final MayLookAtTargetCardEffect effect) {
super(effect);
this.authorizedPlayerId = effect.authorizedPlayerId;
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public MayLookAtTargetCardEffect copy() {
return new MayLookAtTargetCardEffect(this);
}
@Override
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
UUID cardId = getTargetPointer().getFirst(game, source);
if (cardId == null) {
this.discard(); // card is no longer in the origin zone, effect can be discarded
}
return affectedControllerId.equals(authorizedPlayerId)
&& objectId.equals(cardId);
}
}