mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
[ODY] fixed Aven Windreader effect #7733
This commit is contained in:
parent
d31b7bb815
commit
ed7a91cd60
2 changed files with 37 additions and 78 deletions
|
|
@ -1,28 +1,30 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.RevealTargetPlayerLibraryEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author cbt33
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class AvenWindreader extends CardImpl {
|
||||
|
||||
public AvenWindreader(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{U}");
|
||||
this.subtype.add(SubType.BIRD);
|
||||
this.subtype.add(SubType.SOLDIER);
|
||||
this.subtype.add(SubType.WIZARD);
|
||||
|
|
@ -34,7 +36,7 @@ public final class AvenWindreader extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// {1}{U}: Target player reveals the top card of their library.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RevealTargetPlayerLibraryEffect(1), new ManaCostsImpl("{1}{U}"));
|
||||
Ability ability = new SimpleActivatedAbility(new AvenWindreaderEffect(), new ManaCostsImpl("{1}{U}"));
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
@ -48,3 +50,30 @@ public final class AvenWindreader extends CardImpl {
|
|||
return new AvenWindreader(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AvenWindreaderEffect extends OneShotEffect {
|
||||
|
||||
AvenWindreaderEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "target player reveals the top card of their library";
|
||||
}
|
||||
|
||||
private AvenWindreaderEffect(final AvenWindreaderEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AvenWindreaderEffect copy() {
|
||||
return new AvenWindreaderEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
player.revealCards(source, new CardsImpl(player.getLibrary().getFromTop(game)), game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue