mirror of
https://github.com/correl/mage.git
synced 2024-12-25 19:25:41 +00:00
[AKH] Added Vizier of Many Faces.
This commit is contained in:
parent
06fdd17e7d
commit
c033868795
22 changed files with 213 additions and 56 deletions
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -42,8 +43,6 @@ import mage.game.permanent.Permanent;
|
|||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.util.functions.ApplyToPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -51,7 +50,7 @@ import java.util.UUID;
|
|||
public class ArtisanOfForms extends CardImpl {
|
||||
|
||||
public ArtisanOfForms(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Wizard");
|
||||
|
||||
|
@ -79,7 +78,7 @@ public class ArtisanOfForms extends CardImpl {
|
|||
class ArtisanOfFormsApplyToPermanent extends ApplyToPermanent {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, MageObject mageObject) {
|
||||
public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) {
|
||||
Effect effect = new CopyPermanentEffect(new ArtisanOfFormsApplyToPermanent());
|
||||
effect.setText("have {this} become a copy of target creature and gain this ability");
|
||||
mageObject.getAbilities().add(new HeroicAbility(effect, true));
|
||||
|
@ -87,7 +86,7 @@ class ArtisanOfFormsApplyToPermanent extends ApplyToPermanent {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Permanent permanent) {
|
||||
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
|
||||
Effect effect = new CopyPermanentEffect(new ArtisanOfFormsApplyToPermanent());
|
||||
effect.setText("have {this} become a copy of target creature and gain this ability");
|
||||
permanent.addAbility(new HeroicAbility(effect, true), game);
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -44,8 +45,6 @@ import mage.game.permanent.Permanent;
|
|||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.util.functions.ApplyToPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Loki
|
||||
*/
|
||||
|
@ -58,7 +57,7 @@ public class Cryptoplasm extends CardImpl {
|
|||
}
|
||||
|
||||
public Cryptoplasm(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{U}");
|
||||
this.subtype.add("Shapeshifter");
|
||||
|
||||
this.power = new MageInt(2);
|
||||
|
@ -103,7 +102,7 @@ class CryptoplasmEffect extends OneShotEffect {
|
|||
if (creatureToCopy != null) {
|
||||
ApplyToPermanent applier = new ApplyToPermanent() {
|
||||
@Override
|
||||
public boolean apply(Game game, Permanent permanent) {
|
||||
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
|
||||
Ability upkeepAbility = new BeginningOfUpkeepTriggeredAbility(new CryptoplasmEffect(), TargetController.YOU, true);
|
||||
upkeepAbility.addTarget(new TargetCreaturePermanent());
|
||||
permanent.addAbility(upkeepAbility, source.getSourceId(), game);
|
||||
|
@ -111,7 +110,7 @@ class CryptoplasmEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, MageObject mageObject) {
|
||||
public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) {
|
||||
Ability upkeepAbility = new BeginningOfUpkeepTriggeredAbility(new CryptoplasmEffect(), TargetController.YOU, true);
|
||||
upkeepAbility.addTarget(new TargetCreaturePermanent());
|
||||
mageObject.getAbilities().add(upkeepAbility);
|
||||
|
|
|
@ -27,8 +27,10 @@
|
|||
*/
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CopyPermanentEffect;
|
||||
|
@ -42,8 +44,6 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.util.functions.ApplyToPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
@ -51,7 +51,7 @@ import java.util.UUID;
|
|||
public class DacksDuplicate extends CardImpl {
|
||||
|
||||
public DacksDuplicate(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{R}");
|
||||
this.subtype.add("Shapeshifter");
|
||||
|
||||
this.power = new MageInt(0);
|
||||
|
@ -76,7 +76,7 @@ public class DacksDuplicate extends CardImpl {
|
|||
class DacksDuplicateApplyToPermanent extends ApplyToPermanent {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Permanent permanent) {
|
||||
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
|
||||
/**
|
||||
* 29/05/2014 The ability of Dack’s Duplicate doesn’t target the
|
||||
* creature.
|
||||
|
@ -87,7 +87,7 @@ class DacksDuplicateApplyToPermanent extends ApplyToPermanent {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, MageObject mageObject) {
|
||||
public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) {
|
||||
mageObject.getAbilities().add(new DethroneAbility());
|
||||
mageObject.getAbilities().add(HasteAbility.getInstance());
|
||||
return true;
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -47,8 +48,6 @@ import mage.players.Player;
|
|||
import mage.target.common.TargetCardInGraveyard;
|
||||
import mage.util.functions.ApplyToPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
@ -110,7 +109,7 @@ class DimirDoppelgangerEffect extends OneShotEffect {
|
|||
newBluePrint = new PermanentCard((Card) copyFromCard, source.getControllerId(), game);
|
||||
newBluePrint.assignNewId();
|
||||
ApplyToPermanent applier = new DimirDoppelgangerApplier();
|
||||
applier.apply(game, newBluePrint);
|
||||
applier.apply(game, newBluePrint, source);
|
||||
CopyEffect copyEffect = new CopyEffect(Duration.Custom, newBluePrint, dimirDoppelganger.getId());
|
||||
copyEffect.newId();
|
||||
copyEffect.setApplier(applier);
|
||||
|
@ -127,7 +126,7 @@ class DimirDoppelgangerEffect extends OneShotEffect {
|
|||
class DimirDoppelgangerApplier extends ApplyToPermanent {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Permanent permanent) {
|
||||
public boolean apply(Game game, Permanent permanent, Ability source) {
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DimirDoppelgangerEffect(), new ManaCostsImpl("{1}{U}{B}"));
|
||||
ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard")));
|
||||
permanent.getAbilities().add(ability);
|
||||
|
@ -135,7 +134,7 @@ class DimirDoppelgangerApplier extends ApplyToPermanent {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, MageObject mageObject) {
|
||||
public boolean apply(Game game, MageObject mageObject, Ability source) {
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DimirDoppelgangerEffect(), new ManaCostsImpl("{1}{U}{B}"));
|
||||
ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard")));
|
||||
mageObject.getAbilities().add(ability);
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -49,8 +50,6 @@ import mage.game.permanent.Permanent;
|
|||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.util.functions.ApplyToPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward
|
||||
|
@ -58,7 +57,7 @@ import java.util.UUID;
|
|||
public class EvilTwin extends CardImpl {
|
||||
|
||||
public EvilTwin(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{B}");
|
||||
this.subtype.add("Shapeshifter");
|
||||
|
||||
this.power = new MageInt(0);
|
||||
|
@ -90,7 +89,7 @@ class EvilTwinApplyToPermanent extends ApplyToPermanent {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Permanent permanent) {
|
||||
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{U}{B}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
|
@ -99,7 +98,7 @@ class EvilTwinApplyToPermanent extends ApplyToPermanent {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, MageObject mageObject) {
|
||||
public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) {
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{U}{B}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -49,8 +50,6 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.util.functions.ApplyToPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
|
@ -58,7 +57,7 @@ import java.util.UUID;
|
|||
public class Gigantoplasm extends CardImpl {
|
||||
|
||||
public Gigantoplasm(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}");
|
||||
this.subtype.add("Shapeshifter");
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(0);
|
||||
|
@ -82,7 +81,7 @@ public class Gigantoplasm extends CardImpl {
|
|||
class GigantoplasmApplyToPermanent extends ApplyToPermanent {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Permanent permanent) {
|
||||
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
|
||||
DynamicValue variableMana = new ManacostVariableValue();
|
||||
Effect effect = new SetPowerToughnessSourceEffect(variableMana, Duration.WhileOnBattlefield, SubLayer.SetPT_7b);
|
||||
effect.setText("This creature has base power and toughness X/X");
|
||||
|
@ -92,7 +91,7 @@ class GigantoplasmApplyToPermanent extends ApplyToPermanent {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, MageObject mageObject) {
|
||||
public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) {
|
||||
DynamicValue variableMana = new ManacostVariableValue();
|
||||
Effect effect = new SetPowerToughnessSourceEffect(variableMana, Duration.WhileOnBattlefield, SubLayer.SetPT_7b);
|
||||
effect.setText("This creature has base power and toughness X/X");
|
||||
|
|
|
@ -109,7 +109,7 @@ class LazavDimirMastermindEffect extends OneShotEffect {
|
|||
newBluePrint = new PermanentCard((Card) copyFromCard, source.getControllerId(), game);
|
||||
newBluePrint.assignNewId();
|
||||
ApplyToPermanent applier = new LazavDimirMastermindApplier();
|
||||
applier.apply(game, newBluePrint);
|
||||
applier.apply(game, newBluePrint, source);
|
||||
CopyEffect copyEffect = new CopyEffect(Duration.Custom, newBluePrint, lazavDimirMastermind.getId());
|
||||
copyEffect.newId();
|
||||
copyEffect.setApplier(applier);
|
||||
|
@ -126,7 +126,7 @@ class LazavDimirMastermindEffect extends OneShotEffect {
|
|||
class LazavDimirMastermindApplier extends ApplyToPermanent {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Permanent permanent) {
|
||||
public boolean apply(Game game, Permanent permanent, Ability source) {
|
||||
Ability ability = new PutCardIntoGraveFromAnywhereAllTriggeredAbility(
|
||||
new LazavDimirMastermindEffect(), true,
|
||||
new FilterCreatureCard("a creature card"),
|
||||
|
@ -139,7 +139,7 @@ class LazavDimirMastermindApplier extends ApplyToPermanent {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, MageObject mageObject) {
|
||||
public boolean apply(Game game, MageObject mageObject, Ability source) {
|
||||
Ability ability = new PutCardIntoGraveFromAnywhereAllTriggeredAbility(
|
||||
new LazavDimirMastermindEffect(), true,
|
||||
new FilterCreatureCard("a creature card"),
|
||||
|
|
|
@ -30,6 +30,7 @@ package mage.cards.p;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BecomesTargetTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
|
@ -53,7 +54,7 @@ public class PhantasmalImage extends CardImpl {
|
|||
|
||||
ApplyToPermanent phantasmalImageApplier = new ApplyToPermanent() {
|
||||
@Override
|
||||
public boolean apply(Game game, Permanent permanent) {
|
||||
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
|
||||
if (!permanent.getSubtype(game).contains("Illusion")) {
|
||||
permanent.getSubtype(game).add("Illusion");
|
||||
}
|
||||
|
@ -64,7 +65,7 @@ public class PhantasmalImage extends CardImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, MageObject mageObject) {
|
||||
public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) {
|
||||
if (!mageObject.getSubtype(game).contains("Illusion")) {
|
||||
mageObject.getSubtype(game).add("Illusion");
|
||||
}
|
||||
|
@ -76,7 +77,7 @@ public class PhantasmalImage extends CardImpl {
|
|||
};
|
||||
|
||||
public PhantasmalImage(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
|
||||
this.subtype.add("Illusion");
|
||||
|
||||
this.color.setBlue(true);
|
||||
|
|
|
@ -69,12 +69,12 @@ public class PhyrexianMetamorph extends CardImpl {
|
|||
|
||||
ApplyToPermanent phyrexianMetamorphApplier = new ApplyToPermanent() {
|
||||
@Override
|
||||
public boolean apply(Game game, Permanent permanent) {
|
||||
return apply(game, (MageObject) permanent);
|
||||
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
|
||||
return apply(game, (MageObject) permanent, source, copyToObjectId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, MageObject mageObject) {
|
||||
public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) {
|
||||
if (!mageObject.isArtifact()) {
|
||||
mageObject.addCardType(CardType.ARTIFACT);
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ import mage.util.functions.ApplyToPermanent;
|
|||
public class QuicksilverGargantuan extends CardImpl {
|
||||
|
||||
public QuicksilverGargantuan(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{U}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{U}");
|
||||
this.subtype.add("Shapeshifter");
|
||||
|
||||
this.power = new MageInt(7);
|
||||
|
@ -70,14 +70,14 @@ public class QuicksilverGargantuan extends CardImpl {
|
|||
class QuicksilverGargantuanApplyToPermanent extends ApplyToPermanent {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Permanent permanent) {
|
||||
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
|
||||
permanent.getPower().modifyBaseValue(7);
|
||||
permanent.getToughness().modifyBaseValue(7);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, MageObject mageObject) {
|
||||
public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) {
|
||||
mageObject.getPower().modifyBaseValue(7);
|
||||
mageObject.getToughness().modifyBaseValue(7);
|
||||
return true;
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
|
@ -81,7 +81,7 @@ public class SakashimaTheImpostor extends CardImpl {
|
|||
class SakashimaTheImpostorApplier extends ApplyToPermanent {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Permanent permanent) {
|
||||
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
|
||||
permanent.addSuperType(SuperType.LEGENDARY);
|
||||
|
||||
permanent.setName("Sakashima the Impostor");
|
||||
|
@ -94,8 +94,8 @@ class SakashimaTheImpostorApplier extends ApplyToPermanent {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, MageObject mageObject) {
|
||||
mageObject.addSuperType(SuperType.LEGENDARY);
|
||||
public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) {
|
||||
mageObject.addSuperType(SuperType.LEGENDARY);
|
||||
mageObject.setName("Sakashima the Impostor");
|
||||
// {2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step
|
||||
mageObject.getAbilities().add(new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
|
|
|
@ -113,7 +113,7 @@ class VesuvanDoppelgangerCopyEffect extends OneShotEffect {
|
|||
if (copyFromPermanent != null) {
|
||||
game.copyPermanent(copyFromPermanent, sourcePermanent.getId(), source, new ApplyToPermanent() {
|
||||
@Override
|
||||
public boolean apply(Game game, Permanent permanent) {
|
||||
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
|
||||
permanent.getColor(game).setColor(sourcePermanent.getColor(game));
|
||||
permanent.getAbilities().add(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD,
|
||||
new VesuvanDoppelgangerCopyEffect(), TargetController.YOU, true, false, rule2));
|
||||
|
@ -121,7 +121,7 @@ class VesuvanDoppelgangerCopyEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, MageObject mageObject) {
|
||||
public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) {
|
||||
mageObject.getColor(game).setColor(sourcePermanent.getColor(game));
|
||||
mageObject.getAbilities().add(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD,
|
||||
new VesuvanDoppelgangerCopyEffect(), TargetController.YOU, true, false, rule2));
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
package mage.cards.v;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -105,7 +104,7 @@ public class VesuvanShapeshifter extends CardImpl {
|
|||
class VesuvanShapeShifterFaceUpApplier extends ApplyToPermanent {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Permanent permanent) {
|
||||
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
|
||||
Effect effect = new VesuvanShapeshifterFaceDownEffect();
|
||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, true);
|
||||
permanent.getAbilities().add(ability);
|
||||
|
@ -114,7 +113,7 @@ class VesuvanShapeShifterFaceUpApplier extends ApplyToPermanent {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, MageObject mageObject) {
|
||||
public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) {
|
||||
Effect effect = new VesuvanShapeshifterFaceDownEffect();
|
||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, true);
|
||||
mageObject.getAbilities().add(ability);
|
||||
|
|
156
Mage.Sets/src/mage/cards/v/VizierOfManyFaces.java
Normal file
156
Mage.Sets/src/mage/cards/v/VizierOfManyFaces.java
Normal file
|
@ -0,0 +1,156 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.cards.v;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.MageObjectReference;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CopyPermanentEffect;
|
||||
import mage.abilities.keyword.EmbalmAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.PermanentToken;
|
||||
import mage.util.functions.ApplyToPermanent;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class VizierOfManyFaces extends CardImpl {
|
||||
|
||||
public VizierOfManyFaces(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
|
||||
|
||||
this.subtype.add("Shapeshifter");
|
||||
this.subtype.add("Cleric");
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(0);
|
||||
|
||||
// You may have Vizier of Many Faces enter the battlefield as a copy of any creature on the battlefield, except if Vizier of Many Faces was embalmed, the token has no mana cost, it's white, and it's a Zombie in addition to its other types.
|
||||
Effect effect = new CopyPermanentEffect(new VizierOfManyFacesApplyToPermanent());
|
||||
effect.setText("as a copy of any creature on the battlefield, except if {this} was embalmed, the token has no mana cost, it's white, and it's a Zombie in addition to its other types.");
|
||||
this.addAbility(new EntersBattlefieldAbility(effect, true), new EmbalmedThisTurnWatcher());
|
||||
|
||||
// Embalm {3}{U}{U}
|
||||
this.addAbility(new EmbalmAbility(new ManaCostsImpl("{3}{U}{U}"), this));
|
||||
|
||||
}
|
||||
|
||||
public VizierOfManyFaces(final VizierOfManyFaces card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VizierOfManyFaces copy() {
|
||||
return new VizierOfManyFaces(this);
|
||||
}
|
||||
}
|
||||
|
||||
class VizierOfManyFacesApplyToPermanent extends ApplyToPermanent {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
|
||||
for (Permanent entering : game.getPermanentsEntering().values()) {
|
||||
if (entering.getId().equals(copyToObjectId) && entering instanceof PermanentToken) {
|
||||
UUID originalCardId = ((PermanentToken) entering).getToken().getCopySourceCard().getId();
|
||||
EmbalmedThisTurnWatcher watcher = (EmbalmedThisTurnWatcher) game.getState().getWatchers().get(EmbalmedThisTurnWatcher.class.getName());
|
||||
if (watcher != null) {
|
||||
for (MageObjectReference mor : watcher.getEmbalmedThisTurnCards()) {
|
||||
if (mor.getSourceId().equals(originalCardId) && game.getState().getZoneChangeCounter(originalCardId) == mor.getZoneChangeCounter()) {
|
||||
permanent.getManaCost().clear();
|
||||
if (!permanent.getSubtype(game).contains("Zombie")) {
|
||||
permanent.getSubtype(game).add("Zombie");
|
||||
}
|
||||
permanent.getColor(game).setColor(ObjectColor.WHITE);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class EmbalmedThisTurnWatcher extends Watcher {
|
||||
|
||||
private final Set<MageObjectReference> embalmedThisTurnTokens;
|
||||
|
||||
public EmbalmedThisTurnWatcher() {
|
||||
super(EmbalmedThisTurnWatcher.class.getName(), WatcherScope.GAME);
|
||||
embalmedThisTurnTokens = new HashSet<>();
|
||||
}
|
||||
|
||||
public EmbalmedThisTurnWatcher(final EmbalmedThisTurnWatcher watcher) {
|
||||
super(watcher);
|
||||
embalmedThisTurnTokens = new HashSet<>(watcher.embalmedThisTurnTokens);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Watcher copy() {
|
||||
return new EmbalmedThisTurnWatcher(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.EMBALMED_CREATURE) {
|
||||
this.embalmedThisTurnTokens.add(new MageObjectReference(event.getSourceId(), game));
|
||||
}
|
||||
}
|
||||
|
||||
public Set<MageObjectReference> getEmbalmedThisTurnCards() {
|
||||
return this.embalmedThisTurnTokens;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
super.reset();
|
||||
embalmedThisTurnTokens.clear();
|
||||
}
|
||||
|
||||
}
|
|
@ -327,6 +327,7 @@ public class Amonkhet extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Unwavering Initiate", 36, Rarity.COMMON, mage.cards.u.UnwaveringInitiate.class));
|
||||
cards.add(new SetCardInfo("Violent Impact", 154, Rarity.COMMON, mage.cards.v.ViolentImpact.class));
|
||||
cards.add(new SetCardInfo("Vizier of Deferment", 37, Rarity.UNCOMMON, mage.cards.v.VizierOfDeferment.class));
|
||||
cards.add(new SetCardInfo("Vizier of Many Faces", 74, Rarity.RARE, mage.cards.v.VizierOfManyFaces.class));
|
||||
cards.add(new SetCardInfo("Vizier of Remedies", 38, Rarity.UNCOMMON, mage.cards.v.VizierOfRemedies.class));
|
||||
cards.add(new SetCardInfo("Vizier of Tumbling Sands", 75, Rarity.UNCOMMON, mage.cards.v.VizierOfTumblingSands.class));
|
||||
cards.add(new SetCardInfo("Vizier of the Menagerie", 192, Rarity.MYTHIC, mage.cards.v.VizierOfTheMenagerie.class));
|
||||
|
|
|
@ -38,6 +38,7 @@ import mage.constants.Outcome;
|
|||
import mage.constants.TimingRule;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.token.EmptyToken;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
@ -112,6 +113,7 @@ class EmbalmEffect extends OneShotEffect {
|
|||
token.getSubtype(game).add(0, "Zombie");
|
||||
}
|
||||
token.getManaCost().clear();
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.EMBALMED_CREATURE, token.getId(), source.getSourceId(), controller.getId()));
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId(), false, false, null);
|
||||
// Probably it makes sense to remove also the Embalm ability (it's not shown on the token cards).
|
||||
// Also it can never get active or? But it's not mentioned in the reminder text.
|
||||
|
|
|
@ -1454,7 +1454,7 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
}
|
||||
}
|
||||
if (applier != null) {
|
||||
applier.apply(this, newBluePrint);
|
||||
applier.apply(this, newBluePrint, source, copyToPermanentId);
|
||||
}
|
||||
|
||||
CopyEffect newEffect = new CopyEffect(duration, newBluePrint, copyToPermanentId);
|
||||
|
|
|
@ -282,6 +282,7 @@ public class GameEvent implements Serializable {
|
|||
FIGHTED_PERMANENT,
|
||||
EXPLOITED_CREATURE,
|
||||
EVOLVED_CREATURE,
|
||||
EMBALMED_CREATURE,
|
||||
ATTACH, ATTACHED,
|
||||
STAY_ATTACHED,
|
||||
UNATTACH, UNATTACHED,
|
||||
|
|
|
@ -27,7 +27,9 @@
|
|||
*/
|
||||
package mage.util.functions;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
|
@ -36,5 +38,5 @@ import mage.game.Game;
|
|||
*/
|
||||
public abstract class ApplyToMageObject {
|
||||
|
||||
public abstract boolean apply(Game game, MageObject mageObject);
|
||||
public abstract boolean apply(Game game, MageObject mageObject, Ability source, UUID targetObjectId);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package mage.util.functions;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
|
@ -9,5 +11,5 @@ import mage.game.permanent.Permanent;
|
|||
*/
|
||||
public abstract class ApplyToPermanent extends ApplyToMageObject implements Serializable {
|
||||
|
||||
public abstract boolean apply(Game game, Permanent permanent);
|
||||
public abstract boolean apply(Game game, Permanent permanent, Ability source, UUID targetObjectId);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@ package mage.watchers.common;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
|
|
@ -9,7 +9,6 @@ import java.util.ArrayList;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
|
Loading…
Reference in a new issue