[AFR] Implemented Guild Thief

This commit is contained in:
Evan Kranzler 2021-06-29 20:28:34 -04:00
parent 01a30ca8b5
commit 48c2633eda
4 changed files with 77 additions and 8 deletions

View file

@ -0,0 +1,50 @@
package mage.cards.g;
import mage.MageInt;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.counters.CounterType;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class GuildThief extends CardImpl {
public GuildThief(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.subtype.add(SubType.ORC);
this.subtype.add(SubType.ROGUE);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Whenever Guild Thief deals combat damage to a player, put a +1/+1 counter on it.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(
new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), false
));
// Cunning Action {3}{U}: Guild Thief can't be blocked this turn.
this.addAbility(new SimpleActivatedAbility(
new CantBeBlockedSourceEffect(Duration.EndOfTurn), new ManaCostsImpl<>("{3}{U}")
).setFlavorWord("Cunning Action"));
}
private GuildThief(final GuildThief card) {
super(card);
}
@Override
public GuildThief copy() {
return new GuildThief(this);
}
}

View file

@ -36,6 +36,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet {
cards.add(new SetCardInfo("Flumph", 15, Rarity.RARE, mage.cards.f.Flumph.class)); cards.add(new SetCardInfo("Flumph", 15, Rarity.RARE, mage.cards.f.Flumph.class));
cards.add(new SetCardInfo("Forest", 278, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Forest", 278, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Gloom Stalker", 16, Rarity.COMMON, mage.cards.g.GloomStalker.class)); cards.add(new SetCardInfo("Gloom Stalker", 16, Rarity.COMMON, mage.cards.g.GloomStalker.class));
cards.add(new SetCardInfo("Guild Thief", 61, Rarity.UNCOMMON, mage.cards.g.GuildThief.class));
cards.add(new SetCardInfo("Hive of the Eye Tyrant", 258, Rarity.RARE, mage.cards.h.HiveOfTheEyeTyrant.class)); cards.add(new SetCardInfo("Hive of the Eye Tyrant", 258, Rarity.RARE, mage.cards.h.HiveOfTheEyeTyrant.class));
cards.add(new SetCardInfo("Island", 266, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Island", 266, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Lolth, Spider Queen", 112, Rarity.MYTHIC, mage.cards.l.LolthSpiderQueen.class)); cards.add(new SetCardInfo("Lolth, Spider Queen", 112, Rarity.MYTHIC, mage.cards.l.LolthSpiderQueen.class));

View file

@ -1,9 +1,11 @@
package mage.abilities; package mage.abilities;
import mage.MageIdentifier;
import mage.MageObject; import mage.MageObject;
import mage.abilities.costs.Cost; import mage.abilities.costs.Cost;
import mage.abilities.costs.CostAdjuster; import mage.abilities.costs.CostAdjuster;
import mage.abilities.costs.Costs; import mage.abilities.costs.Costs;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCosts; import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
@ -25,8 +27,6 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import mage.MageIdentifier;
import mage.abilities.costs.common.TapSourceCost;
/** /**
* Practically everything in the game is started from an Ability. This interface * Practically everything in the game is started from an Ability. This interface
@ -87,7 +87,7 @@ public interface Ability extends Controllable, Serializable {
/** /**
* Gets the id of the object which put this ability in motion. * Gets the id of the object which put this ability in motion.
* * <p>
* WARNING, MageSingleton abilities contains dirty data here, so you can't use sourceId with it * WARNING, MageSingleton abilities contains dirty data here, so you can't use sourceId with it
* *
* @return The {@link java.util.UUID} of the object this ability is * @return The {@link java.util.UUID} of the object this ability is
@ -363,10 +363,11 @@ public interface Ability extends Controllable, Serializable {
* @return * @return
*/ */
boolean hasSourceObjectAbility(Game game, MageObject source, GameEvent event); boolean hasSourceObjectAbility(Game game, MageObject source, GameEvent event);
/** /**
* Returns true if the ability has a tap itself in their costs * Returns true if the ability has a tap itself in their costs
* @return *
* @return
*/ */
default boolean hasTapCost() { default boolean hasTapCost() {
for (Cost cost : this.getCosts()) { for (Cost cost : this.getCosts()) {
@ -465,6 +466,8 @@ public interface Ability extends Controllable, Serializable {
*/ */
Ability setAbilityWord(AbilityWord abilityWord); Ability setAbilityWord(AbilityWord abilityWord);
Ability setFlavorWord(String flavorWord);
/** /**
* Creates the message about the ability casting/triggering/activating to * Creates the message about the ability casting/triggering/activating to
* post in the game log before the ability resolves. * post in the game log before the ability resolves.
@ -550,8 +553,8 @@ public interface Ability extends Controllable, Serializable {
* @return * @return
*/ */
boolean isSameInstance(Ability ability); boolean isSameInstance(Ability ability);
MageIdentifier getIdentifier(); MageIdentifier getIdentifier();
AbilityImpl setIdentifier(MageIdentifier mageIdentifier); AbilityImpl setIdentifier(MageIdentifier mageIdentifier);
} }

View file

@ -60,6 +60,7 @@ public abstract class AbilityImpl implements Ability {
protected Zone zone; protected Zone zone;
protected String name; protected String name;
protected AbilityWord abilityWord; protected AbilityWord abilityWord;
protected String flavorWord;
protected boolean usesStack = true; protected boolean usesStack = true;
protected boolean ruleAtTheTop = false; protected boolean ruleAtTheTop = false;
protected boolean ruleVisible = true; protected boolean ruleVisible = true;
@ -117,6 +118,7 @@ public abstract class AbilityImpl implements Ability {
this.ruleAdditionalCostsVisible = ability.ruleAdditionalCostsVisible; this.ruleAdditionalCostsVisible = ability.ruleAdditionalCostsVisible;
this.worksFaceDown = ability.worksFaceDown; this.worksFaceDown = ability.worksFaceDown;
this.abilityWord = ability.abilityWord; this.abilityWord = ability.abilityWord;
this.flavorWord = ability.flavorWord;
this.sourceObjectZoneChangeCounter = ability.sourceObjectZoneChangeCounter; this.sourceObjectZoneChangeCounter = ability.sourceObjectZoneChangeCounter;
this.canFizzle = ability.canFizzle; this.canFizzle = ability.canFizzle;
this.targetAdjuster = ability.targetAdjuster; this.targetAdjuster = ability.targetAdjuster;
@ -800,8 +802,16 @@ public abstract class AbilityImpl implements Ability {
} else { } else {
rule = ruleStart; rule = ruleStart;
} }
String prefix;
if (abilityWord != null) { if (abilityWord != null) {
rule = "<i>" + abilityWord + "</i> &mdash; " + Character.toUpperCase(rule.charAt(0)) + rule.substring(1); prefix = abilityWord.formatWord();
} else if (flavorWord != null) {
prefix = "<i>" + flavorWord + "</i> &mdash; ";
} else {
prefix = null;
}
if (prefix != null) {
rule = prefix + CardUtil.getTextWithFirstCharUpperCase(rule);
} }
if (appendToRule != null) { if (appendToRule != null) {
rule = rule.concat(appendToRule); rule = rule.concat(appendToRule);
@ -1062,6 +1072,11 @@ public abstract class AbilityImpl implements Ability {
return this; return this;
} }
public Ability setFlavorWord(String flavorWord) {
this.flavorWord = flavorWord;
return this;
}
@Override @Override
public String getGameLogMessage(Game game) { public String getGameLogMessage(Game game) {
if (game.isSimulation()) { if (game.isSimulation()) {