mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
[CLB] Implemented Street Urchin
This commit is contained in:
parent
b6bf6aaf49
commit
185d645ba7
6 changed files with 85 additions and 55 deletions
|
@ -1,7 +1,6 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
|
@ -12,11 +11,7 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.common.TargetCreatureOrPlaneswalker;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -26,13 +21,6 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class EliteHeadhunter extends CardImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter
|
||||
= new FilterControlledPermanent("another creature or an artifact");
|
||||
|
||||
static {
|
||||
filter.add(EliteHeadhunterPredicate.instance);
|
||||
}
|
||||
|
||||
public EliteHeadhunter(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B/R}{B/R}{B/R}{B/R}");
|
||||
|
||||
|
@ -46,9 +34,9 @@ public final class EliteHeadhunter extends CardImpl {
|
|||
|
||||
// {B/R}{B/R}{B/R}, Sacrifice another creature or an artifact: Elite Headhunter deals 2 damage to target creature or planeswalker.
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
new DamageTargetEffect(2), new ManaCostsImpl("{B/R}{B/R}{B/R}")
|
||||
new DamageTargetEffect(2), new ManaCostsImpl<>("{B/R}{B/R}{B/R}")
|
||||
);
|
||||
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
|
||||
ability.addCost(new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_ARTIFACT_OR_OTHER_CREATURE));
|
||||
ability.addTarget(new TargetCreatureOrPlaneswalker());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
@ -62,16 +50,3 @@ public final class EliteHeadhunter extends CardImpl {
|
|||
return new EliteHeadhunter(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum EliteHeadhunterPredicate implements ObjectSourcePlayerPredicate<MageObject> {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(ObjectSourcePlayer<MageObject> input, Game game) {
|
||||
MageObject obj = input.getObject();
|
||||
if (obj.getId().equals(input.getSourceId())) {
|
||||
return obj.isArtifact(game);
|
||||
}
|
||||
return obj.isCreature(game) || obj.isArtifact(game);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package mage.cards.g;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.common.AttacksWithCreaturesTriggeredAbility;
|
||||
import mage.abilities.common.ChooseABackgroundAbility;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
|
@ -12,10 +11,7 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.permanent.token.Skeleton41Token;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -25,13 +21,6 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class GutTrueSoulZealot extends CardImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter
|
||||
= new FilterControlledPermanent("another creature or an artifact");
|
||||
|
||||
static {
|
||||
filter.add(GutTrueSoulZealotPredicate.instance);
|
||||
}
|
||||
|
||||
public GutTrueSoulZealot(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
|
||||
|
||||
|
@ -45,7 +34,7 @@ public final class GutTrueSoulZealot extends CardImpl {
|
|||
this.addAbility(new AttacksWithCreaturesTriggeredAbility(new DoIfCostPaid(
|
||||
new CreateTokenEffect(
|
||||
new Skeleton41Token(), 1, true, true
|
||||
), new SacrificeTargetCost(filter)
|
||||
), new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_ARTIFACT_OR_OTHER_CREATURE)
|
||||
), 1));
|
||||
|
||||
// Choose a Background
|
||||
|
@ -61,17 +50,3 @@ public final class GutTrueSoulZealot extends CardImpl {
|
|||
return new GutTrueSoulZealot(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum GutTrueSoulZealotPredicate implements ObjectSourcePlayerPredicate<MageObject> {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(ObjectSourcePlayer<MageObject> input, Game game) {
|
||||
MageObject obj = input.getObject();
|
||||
if (obj.getId().equals(input.getSourceId())) {
|
||||
return obj.isArtifact(game);
|
||||
}
|
||||
return obj.isArtifact(game)
|
||||
|| obj.isCreature(game);
|
||||
}
|
||||
}
|
||||
|
|
50
Mage.Sets/src/mage/cards/s/StreetUrchin.java
Normal file
50
Mage.Sets/src/mage/cards/s/StreetUrchin.java
Normal file
|
@ -0,0 +1,50 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class StreetUrchin extends CardImpl {
|
||||
|
||||
public StreetUrchin(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.BACKGROUND);
|
||||
|
||||
// Commander creatures you own have "{1}, Sacrifice another creature or an artifact: This creature deals 1 damage to any target."
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
new DamageTargetEffect(1, "this creature"), new GenericManaCost(1)
|
||||
);
|
||||
ability.addCost(new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_ARTIFACT_OR_OTHER_CREATURE));
|
||||
this.addAbility(new SimpleStaticAbility(new GainAbilityAllEffect(
|
||||
ability, Duration.WhileOnBattlefield,
|
||||
StaticFilters.FILTER_CREATURES_OWNED_COMMANDER
|
||||
)));
|
||||
}
|
||||
|
||||
private StreetUrchin(final StreetUrchin card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StreetUrchin copy() {
|
||||
return new StreetUrchin(this);
|
||||
}
|
||||
}
|
|
@ -141,6 +141,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Sky Diamond", 337, Rarity.COMMON, mage.cards.s.SkyDiamond.class));
|
||||
cards.add(new SetCardInfo("Spire Garden", 361, Rarity.RARE, mage.cards.s.SpireGarden.class));
|
||||
cards.add(new SetCardInfo("Stirge", 150, Rarity.COMMON, mage.cards.s.Stirge.class));
|
||||
cards.add(new SetCardInfo("Street Urchin", 197, Rarity.UNCOMMON, mage.cards.s.StreetUrchin.class));
|
||||
cards.add(new SetCardInfo("Summon Undead", 151, Rarity.COMMON, mage.cards.s.SummonUndead.class));
|
||||
cards.add(new SetCardInfo("Swamp", 459, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Swiftfoot Boots", 339, Rarity.UNCOMMON, mage.cards.s.SwiftfootBoots.class));
|
||||
|
|
|
@ -393,6 +393,13 @@ public final class StaticFilters {
|
|||
FILTER_CONTROLLED_PERMANENT_ARTIFACT_OR_CREATURE.setLockedFilter(true);
|
||||
}
|
||||
|
||||
public static final FilterControlledPermanent FILTER_CONTROLLED_ARTIFACT_OR_OTHER_CREATURE = new FilterControlledPermanent("another creature or an artifact");
|
||||
|
||||
static {
|
||||
FILTER_CONTROLLED_ARTIFACT_OR_OTHER_CREATURE.add(AnotherCreatureOrAnArtifactPredicate.instance);
|
||||
FILTER_CONTROLLED_ARTIFACT_OR_OTHER_CREATURE.setLockedFilter(true);
|
||||
}
|
||||
|
||||
public static final FilterControlledPermanent FILTER_CONTROLLED_PERMANENT_ENCHANTMENT = new FilterControlledEnchantmentPermanent();
|
||||
|
||||
static {
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package mage.filter.predicate.mageobject;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public enum AnotherCreatureOrAnArtifactPredicate implements ObjectSourcePlayerPredicate<MageObject> {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(ObjectSourcePlayer<MageObject> input, Game game) {
|
||||
MageObject obj = input.getObject();
|
||||
if (obj.getId().equals(input.getSourceId())) {
|
||||
return obj.isArtifact(game);
|
||||
}
|
||||
return obj.isCreature(game) || obj.isArtifact(game);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue