mirror of
https://github.com/correl/mage.git
synced 2024-12-26 19:16:54 +00:00
parent
505f01ccb0
commit
86df6917cc
16 changed files with 34 additions and 40 deletions
|
@ -52,7 +52,7 @@ public class BehindTheScenes extends CardImpl {
|
||||||
|
|
||||||
// Creatures you control have skulk.
|
// Creatures you control have skulk.
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
|
||||||
new GainAbilityControlledEffect(SkulkAbility.getInstance(), Duration.WhileOnBattlefield, FILTER_PERMANENT_CREATURES)));
|
new GainAbilityControlledEffect(new SkulkAbility(), Duration.WhileOnBattlefield, FILTER_PERMANENT_CREATURES)));
|
||||||
|
|
||||||
// {4}{W}: Creatures you control get +1/+1 until end of turn.
|
// {4}{W}: Creatures you control get +1/+1 until end of turn.
|
||||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class FarbogRevenant extends CardImpl {
|
||||||
this.toughness = new MageInt(3);
|
this.toughness = new MageInt(3);
|
||||||
|
|
||||||
// Skulk
|
// Skulk
|
||||||
this.addAbility(SkulkAbility.getInstance());
|
this.addAbility(new SkulkAbility());
|
||||||
|
|
||||||
// Lifelink
|
// Lifelink
|
||||||
this.addAbility(LifelinkAbility.getInstance());
|
this.addAbility(LifelinkAbility.getInstance());
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class Fogwalker extends CardImpl {
|
||||||
this.toughness = new MageInt(3);
|
this.toughness = new MageInt(3);
|
||||||
|
|
||||||
// Skulk
|
// Skulk
|
||||||
this.addAbility(SkulkAbility.getInstance());
|
this.addAbility(new SkulkAbility());
|
||||||
// When Fogwalker enters the battlefield, target creature an opponent controls doesn't untap during it controler's next untap step.
|
// When Fogwalker enters the battlefield, target creature an opponent controls doesn't untap during it controler's next untap step.
|
||||||
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DontUntapInControllersNextUntapStepTargetEffect());
|
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DontUntapInControllersNextUntapStepTargetEffect());
|
||||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class ForgottenCreation extends CardImpl {
|
||||||
this.toughness = new MageInt(3);
|
this.toughness = new MageInt(3);
|
||||||
|
|
||||||
// Skulk
|
// Skulk
|
||||||
this.addAbility(SkulkAbility.getInstance());
|
this.addAbility(new SkulkAbility());
|
||||||
// At the beginning of your upkeep, you may discard all the cards in your hand. If you do, draw that many cards.
|
// At the beginning of your upkeep, you may discard all the cards in your hand. If you do, draw that many cards.
|
||||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new ForgottenCreationEffect(), TargetController.YOU, true));
|
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new ForgottenCreationEffect(), TargetController.YOU, true));
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class FurtiveHomunculus extends CardImpl {
|
||||||
this.toughness = new MageInt(1);
|
this.toughness = new MageInt(1);
|
||||||
|
|
||||||
// Skulk (This creature can't be blocked by creatures with greater power.)
|
// Skulk (This creature can't be blocked by creatures with greater power.)
|
||||||
this.addAbility(SkulkAbility.getInstance());
|
this.addAbility(new SkulkAbility());
|
||||||
}
|
}
|
||||||
|
|
||||||
public FurtiveHomunculus(final FurtiveHomunculus card) {
|
public FurtiveHomunculus(final FurtiveHomunculus card) {
|
||||||
|
|
|
@ -171,7 +171,7 @@ class OdricLunarchMarshalEffect extends OneShotEffect {
|
||||||
|
|
||||||
// Skulk
|
// Skulk
|
||||||
if (game.getBattlefield().contains(filterSkulk, source.getControllerId(), 1, game)) {
|
if (game.getBattlefield().contains(filterSkulk, source.getControllerId(), 1, game)) {
|
||||||
game.addEffect(new GainAbilityControlledEffect(SkulkAbility.getInstance(), Duration.EndOfTurn, filterCreatures), source);
|
game.addEffect(new GainAbilityControlledEffect(new SkulkAbility(), Duration.EndOfTurn, filterCreatures), source);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trample
|
// Trample
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class PaleRiderOfTrostad extends CardImpl {
|
||||||
this.toughness = new MageInt(3);
|
this.toughness = new MageInt(3);
|
||||||
|
|
||||||
// Skulk
|
// Skulk
|
||||||
this.addAbility(SkulkAbility.getInstance());
|
this.addAbility(new SkulkAbility());
|
||||||
|
|
||||||
// When Pale Rider of Trostad enters the battlefield, discard a card.
|
// When Pale Rider of Trostad enters the battlefield, discard a card.
|
||||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new DiscardControllerEffect(1), false));
|
this.addAbility(new EntersBattlefieldTriggeredAbility(new DiscardControllerEffect(1), false));
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class PersistentNightmare extends CardImpl {
|
||||||
this.nightCard = true;
|
this.nightCard = true;
|
||||||
|
|
||||||
// Skulk
|
// Skulk
|
||||||
this.addAbility(SkulkAbility.getInstance());
|
this.addAbility(new SkulkAbility());
|
||||||
|
|
||||||
// When Persistent Nightmare deals combat damage to a player, return it to its owner's hand.
|
// When Persistent Nightmare deals combat damage to a player, return it to its owner's hand.
|
||||||
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new ReturnToHandSourceEffect(), false));
|
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new ReturnToHandSourceEffect(), false));
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class RancidRats extends CardImpl {
|
||||||
this.toughness = new MageInt(1);
|
this.toughness = new MageInt(1);
|
||||||
|
|
||||||
// Skulk
|
// Skulk
|
||||||
this.addAbility(SkulkAbility.getInstance());
|
this.addAbility(new SkulkAbility());
|
||||||
// Deathtouch
|
// Deathtouch
|
||||||
this.addAbility(DeathtouchAbility.getInstance());
|
this.addAbility(DeathtouchAbility.getInstance());
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class SkeletonKey extends CardImpl {
|
||||||
this.subtype.add(SubType.EQUIPMENT);
|
this.subtype.add(SubType.EQUIPMENT);
|
||||||
|
|
||||||
// Equipped creature has skulk.
|
// Equipped creature has skulk.
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(SkulkAbility.getInstance(), AttachmentType.EQUIPMENT)));
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new SkulkAbility(), AttachmentType.EQUIPMENT)));
|
||||||
|
|
||||||
// Whenever equipped creature deals combat damage to a player, you may draw a card. if you do, discard a card.
|
// Whenever equipped creature deals combat damage to a player, you may draw a card. if you do, discard a card.
|
||||||
Ability ability = new DealsDamageToAPlayerAttachedTriggeredAbility(new DrawCardSourceControllerEffect(1), "equipped creature", true);
|
Ability ability = new DealsDamageToAPlayerAttachedTriggeredAbility(new DrawCardSourceControllerEffect(1), "equipped creature", true);
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class UninvitedGeist extends CardImpl {
|
||||||
this.secondSideCardClazz = UnimpededTrespasser.class;
|
this.secondSideCardClazz = UnimpededTrespasser.class;
|
||||||
|
|
||||||
// Skulk (This creature can't be blocked by creatures with greater power.)
|
// Skulk (This creature can't be blocked by creatures with greater power.)
|
||||||
this.addAbility(SkulkAbility.getInstance());
|
this.addAbility(new SkulkAbility());
|
||||||
|
|
||||||
// When Uninvited Geist deals combat damage to a player, transform it.
|
// When Uninvited Geist deals combat damage to a player, transform it.
|
||||||
this.addAbility(new TransformAbility());
|
this.addAbility(new TransformAbility());
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class VampireCutthroat extends CardImpl {
|
||||||
this.toughness = new MageInt(1);
|
this.toughness = new MageInt(1);
|
||||||
|
|
||||||
// Skulk
|
// Skulk
|
||||||
this.addAbility(SkulkAbility.getInstance());
|
this.addAbility(new SkulkAbility());
|
||||||
// Lifelink
|
// Lifelink
|
||||||
this.addAbility(LifelinkAbility.getInstance());
|
this.addAbility(LifelinkAbility.getInstance());
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class WharfInfiltrator extends CardImpl {
|
||||||
this.toughness = new MageInt(1);
|
this.toughness = new MageInt(1);
|
||||||
|
|
||||||
// Skulk
|
// Skulk
|
||||||
this.addAbility(SkulkAbility.getInstance());
|
this.addAbility(new SkulkAbility());
|
||||||
|
|
||||||
// Whenever Wharf Infiltrator deals combat damage to a player, you may draw a card. If you do, discard a card.
|
// Whenever Wharf Infiltrator deals combat damage to a player, you may draw a card. If you do, discard a card.
|
||||||
Effect effect = new DrawDiscardControllerEffect();
|
Effect effect = new DrawDiscardControllerEffect();
|
||||||
|
|
|
@ -14,34 +14,34 @@ public class GainAbilitiesTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Reported bug: Behind the Scenes grants skulk to all creatures instead of just ones under owner's control
|
Reported bug: Behind the Scenes grants skulk to all creatures instead of just ones under owner's control
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void behindTheScenesShouldOnlyGrantSkulkToCreaturesYouControl() {
|
public void behindTheScenesShouldOnlyGrantSkulkToCreaturesYouControl() {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Behind the Scenes {2}{B}
|
Behind the Scenes {2}{B}
|
||||||
Enchantment
|
Enchantment
|
||||||
Creatures you control have skulk. (They can't be blocked by creatures with greater power.)
|
Creatures you control have skulk. (They can't be blocked by creatures with greater power.)
|
||||||
{4}{W}: Creatures you control get +1/+1 until end of turn
|
{4}{W}: Creatures you control get +1/+1 until end of turn
|
||||||
*/
|
*/
|
||||||
String bScenes = "Behind the Scenes";
|
String bScenes = "Behind the Scenes";
|
||||||
String hGiant = "Hill Giant"; // {3}{R} 3/3
|
String hGiant = "Hill Giant"; // {3}{R} 3/3
|
||||||
String bSable = "Bronze Sable"; // {2} 2/1
|
String bSable = "Bronze Sable"; // {2} 2/1
|
||||||
String memnite = "Memnite"; // {0} 1/1
|
String memnite = "Memnite"; // {0} 1/1
|
||||||
String gBears = "Grizzly Bears"; // {1}{G} 2/2
|
String gBears = "Grizzly Bears"; // {1}{G} 2/2
|
||||||
|
|
||||||
addCard(Zone.BATTLEFIELD, playerA, bScenes);
|
addCard(Zone.BATTLEFIELD, playerA, bScenes);
|
||||||
addCard(Zone.BATTLEFIELD, playerA, hGiant);
|
addCard(Zone.BATTLEFIELD, playerA, hGiant);
|
||||||
addCard(Zone.BATTLEFIELD, playerA, bSable);
|
addCard(Zone.BATTLEFIELD, playerA, bSable);
|
||||||
addCard(Zone.BATTLEFIELD, playerB, memnite);
|
addCard(Zone.BATTLEFIELD, playerB, memnite);
|
||||||
addCard(Zone.BATTLEFIELD, playerB, gBears);
|
addCard(Zone.BATTLEFIELD, playerB, gBears);
|
||||||
|
|
||||||
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
|
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
|
||||||
execute();
|
execute();
|
||||||
|
|
||||||
assertAbility(playerA, hGiant, SkulkAbility.getInstance(), true);
|
assertAbility(playerA, hGiant, new SkulkAbility(), true);
|
||||||
assertAbility(playerA, bSable, SkulkAbility.getInstance(), true);
|
assertAbility(playerA, bSable, new SkulkAbility(), true);
|
||||||
assertAbility(playerB, memnite, SkulkAbility.getInstance(), false);
|
assertAbility(playerB, memnite, new SkulkAbility(), false);
|
||||||
assertAbility(playerB, gBears, SkulkAbility.getInstance(), false);
|
assertAbility(playerB, gBears, new SkulkAbility(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,12 +5,11 @@
|
||||||
*/
|
*/
|
||||||
package mage.abilities.keyword;
|
package mage.abilities.keyword;
|
||||||
|
|
||||||
import java.io.ObjectStreamException;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.EvasionAbility;
|
import mage.abilities.StaticAbility;
|
||||||
import mage.abilities.MageSingleton;
|
|
||||||
import mage.abilities.effects.RestrictionEffect;
|
import mage.abilities.effects.RestrictionEffect;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
|
@ -18,31 +17,26 @@ import mage.game.permanent.Permanent;
|
||||||
*
|
*
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public class SkulkAbility extends EvasionAbility implements MageSingleton {
|
public class SkulkAbility extends StaticAbility {
|
||||||
|
|
||||||
private static final SkulkAbility instance = new SkulkAbility();
|
public SkulkAbility() {
|
||||||
|
super(Zone.BATTLEFIELD, new SkulkEffect(Duration.WhileOnBattlefield));
|
||||||
private Object readResolve() throws ObjectStreamException {
|
|
||||||
return instance;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SkulkAbility getInstance() {
|
public SkulkAbility(final SkulkAbility ability) {
|
||||||
return instance;
|
super(ability);
|
||||||
}
|
|
||||||
|
|
||||||
private SkulkAbility() {
|
|
||||||
this.addEffect(new SkulkEffect(Duration.WhileOnBattlefield));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Ability copy() {
|
public Ability copy() {
|
||||||
return instance;
|
return new SkulkAbility(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
return "Skulk <i>(This creature can't be blocked by creatures with greater power.)</i>";
|
return "Skulk <i>(This creature can't be blocked by creatures with greater power.)</i>";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class SkulkEffect extends RestrictionEffect {
|
class SkulkEffect extends RestrictionEffect {
|
||||||
|
|
|
@ -76,7 +76,7 @@ Shadow|instance|
|
||||||
Shroud|instance|
|
Shroud|instance|
|
||||||
Soulbond|instance|
|
Soulbond|instance|
|
||||||
Soulshift|number|
|
Soulshift|number|
|
||||||
Skulk|instance|
|
Skulk|new|
|
||||||
Storm|new|
|
Storm|new|
|
||||||
Sunburst|new|
|
Sunburst|new|
|
||||||
Swampcycling|cost|
|
Swampcycling|cost|
|
||||||
|
|
Loading…
Reference in a new issue