forked from External/mage
[TLE] Implement Dutiful Knowledge Seeker
This commit is contained in:
parent
3f0b37ea99
commit
6fbdc86ed8
2 changed files with 94 additions and 0 deletions
93
Mage.Sets/src/mage/cards/d/DutifulKnowledgeSeeker.java
Normal file
93
Mage.Sets/src/mage/cards/d/DutifulKnowledgeSeeker.java
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.BatchTriggeredAbility;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.PutOnLibraryTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeBatchEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.target.common.TargetCardInGraveyard;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class DutifulKnowledgeSeeker extends CardImpl {
|
||||
|
||||
public DutifulKnowledgeSeeker(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
|
||||
|
||||
this.subtype.add(SubType.FOX);
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Whenever one or more cards are put into a library from anywhere, put a +1/+1 counter on this creature.
|
||||
this.addAbility(new DutifulKnowledgeSeekerTriggeredAbility());
|
||||
|
||||
// {3}: Put target card from a graveyard on the bottom of its owner's library.
|
||||
Ability ability = new SimpleActivatedAbility(new PutOnLibraryTargetEffect(false), new GenericManaCost(3));
|
||||
ability.addTarget(new TargetCardInGraveyard());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private DutifulKnowledgeSeeker(final DutifulKnowledgeSeeker card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DutifulKnowledgeSeeker copy() {
|
||||
return new DutifulKnowledgeSeeker(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DutifulKnowledgeSeekerTriggeredAbility extends TriggeredAbilityImpl implements BatchTriggeredAbility<ZoneChangeEvent> {
|
||||
|
||||
DutifulKnowledgeSeekerTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()));
|
||||
this.setTriggerPhrase("Whenever one or more cards are put into a library from anywhere, ");
|
||||
}
|
||||
|
||||
private DutifulKnowledgeSeekerTriggeredAbility(final DutifulKnowledgeSeekerTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DutifulKnowledgeSeekerTriggeredAbility copy() {
|
||||
return new DutifulKnowledgeSeekerTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ZONE_CHANGE_BATCH;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEvent(ZoneChangeEvent event, Game game) {
|
||||
return Zone.LIBRARY.match(event.getToZone());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return this
|
||||
.getFilteredEvents((ZoneChangeBatchEvent) event, game)
|
||||
.stream()
|
||||
.map(GameEvent::getTargetId)
|
||||
.map(game::getCard)
|
||||
.anyMatch(Objects::nonNull);
|
||||
}
|
||||
}
|
||||
|
|
@ -101,6 +101,7 @@ public final class AvatarTheLastAirbenderEternal extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Dramatic Reversal", 158, Rarity.COMMON, mage.cards.d.DramaticReversal.class));
|
||||
cards.add(new SetCardInfo("Drannith Magistrate", 2, Rarity.MYTHIC, mage.cards.d.DrannithMagistrate.class));
|
||||
cards.add(new SetCardInfo("Duelist's Heritage", 153, Rarity.RARE, mage.cards.d.DuelistsHeritage.class));
|
||||
cards.add(new SetCardInfo("Dutiful Knowledge Seeker", 92, Rarity.UNCOMMON, mage.cards.d.DutifulKnowledgeSeeker.class));
|
||||
cards.add(new SetCardInfo("Earthbending Student", 249, Rarity.UNCOMMON, mage.cards.e.EarthbendingStudent.class));
|
||||
cards.add(new SetCardInfo("Earthshape", 67, Rarity.RARE, mage.cards.e.Earthshape.class));
|
||||
cards.add(new SetCardInfo("Eel-Hounds", 250, Rarity.UNCOMMON, mage.cards.e.EelHounds.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue