forked from External/mage
[FIC] Implement Lord Jyscal Guado
This commit is contained in:
parent
3d7c610431
commit
36ecbd8cf6
3 changed files with 110 additions and 1 deletions
108
Mage.Sets/src/mage/cards/l/LordJyscalGuado.java
Normal file
108
Mage.Sets/src/mage/cards/l/LordJyscalGuado.java
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
package mage.cards.l;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.effects.keyword.InvestigateEffect;
|
||||
import mage.abilities.hint.ConditionHint;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class LordJyscalGuado extends CardImpl {
|
||||
|
||||
public LordJyscalGuado(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}");
|
||||
|
||||
this.supertype.add(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
this.subtype.add(SubType.CLERIC);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// At the beginning of each end step, if you put a counter on a creature this turn, investigate.
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(new InvestigateEffect())
|
||||
.withInterveningIf(LordJyscalGuadoCondition.instance)
|
||||
.addHint(LordJyscalGuadoCondition.getHint()),
|
||||
new LordJyscalGuadoWatcher()
|
||||
);
|
||||
}
|
||||
|
||||
private LordJyscalGuado(final LordJyscalGuado card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LordJyscalGuado copy() {
|
||||
return new LordJyscalGuado(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum LordJyscalGuadoCondition implements Condition {
|
||||
instance;
|
||||
private static final Hint hint = new ConditionHint(instance);
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return LordJyscalGuadoWatcher.checkPlayer(source.getControllerId(), game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "you put a counter on a creature this turn";
|
||||
}
|
||||
|
||||
public static Hint getHint() {
|
||||
return hint;
|
||||
}
|
||||
}
|
||||
|
||||
class LordJyscalGuadoWatcher extends Watcher {
|
||||
|
||||
Set<UUID> set = new HashSet<>();
|
||||
|
||||
LordJyscalGuadoWatcher() {
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() != GameEvent.EventType.COUNTER_ADDED) {
|
||||
return;
|
||||
}
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && permanent.isCreature(game)) {
|
||||
set.add(event.getPlayerId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
super.reset();
|
||||
set.clear();
|
||||
}
|
||||
|
||||
static boolean checkPlayer(UUID playerId, Game game) {
|
||||
return game.getState().getWatcher(LordJyscalGuadoWatcher.class).set.contains(playerId);
|
||||
}
|
||||
}
|
||||
|
|
@ -156,6 +156,7 @@ public final class FinalFantasyCommander extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Lethal Scheme", 277, Rarity.RARE, mage.cards.l.LethalScheme.class));
|
||||
cards.add(new SetCardInfo("Lightning Greaves", 349, Rarity.UNCOMMON, mage.cards.l.LightningGreaves.class));
|
||||
cards.add(new SetCardInfo("Lingering Souls", 245, Rarity.UNCOMMON, mage.cards.l.LingeringSouls.class));
|
||||
cards.add(new SetCardInfo("Lord Jyscal Guado", 23, Rarity.RARE, mage.cards.l.LordJyscalGuado.class));
|
||||
cards.add(new SetCardInfo("Luminous Broodmoth", 246, Rarity.MYTHIC, mage.cards.l.LuminousBroodmoth.class));
|
||||
cards.add(new SetCardInfo("Mask of Memory", 350, Rarity.UNCOMMON, mage.cards.m.MaskOfMemory.class));
|
||||
cards.add(new SetCardInfo("Meteor Golem", 351, Rarity.UNCOMMON, mage.cards.m.MeteorGolem.class));
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public class ConditionHint implements Hint {
|
|||
private final boolean useIcons;
|
||||
|
||||
public ConditionHint(Condition condition) {
|
||||
this(condition, condition.toString());
|
||||
this(condition, CardUtil.getTextWithFirstCharUpperCase(condition.toString()));
|
||||
}
|
||||
|
||||
public ConditionHint(Condition condition, String textWithIcons) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue