mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 12:52:06 -08:00
[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:
parent
4cfc6ebc37
commit
8ad37e19b8
7 changed files with 182 additions and 148 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue