mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 12:49:39 -08:00
Fixed handling of Chisei, Heart of Oceans. Some more minor fixes/changes.
This commit is contained in:
parent
8684cf2962
commit
f763985ce9
5 changed files with 151 additions and 52 deletions
|
|
@ -28,17 +28,15 @@
|
|||
package mage.sets.avacynrestored;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.abilities.common.ZoneChangeTriggeredAbility;
|
||||
import mage.Constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.CreatureEntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
|
||||
/**
|
||||
|
|
@ -47,6 +45,12 @@ import mage.target.common.TargetCreatureOrPlayer;
|
|||
*/
|
||||
public class VigilanteJustice extends CardImpl<VigilanteJustice> {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Human");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Human"));
|
||||
}
|
||||
|
||||
public VigilanteJustice(UUID ownerId) {
|
||||
super(ownerId, 165, "Vigilante Justice", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}");
|
||||
this.expansionSetCode = "AVR";
|
||||
|
|
@ -54,7 +58,9 @@ public class VigilanteJustice extends CardImpl<VigilanteJustice> {
|
|||
this.color.setRed(true);
|
||||
|
||||
// Whenever a Human enters the battlefield under your control, Vigilante Justice deals 1 damage to target creature or player.
|
||||
this.addAbility(new VigilanteJusticeTriggeredAbility());
|
||||
Ability ability = new CreatureEntersBattlefieldTriggeredAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), filter, false, false);
|
||||
ability.addTarget(new TargetCreatureOrPlayer());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public VigilanteJustice(final VigilanteJustice card) {
|
||||
|
|
@ -66,36 +72,3 @@ public class VigilanteJustice extends CardImpl<VigilanteJustice> {
|
|||
return new VigilanteJustice(this);
|
||||
}
|
||||
}
|
||||
|
||||
class VigilanteJusticeTriggeredAbility extends ZoneChangeTriggeredAbility<VigilanteJusticeTriggeredAbility> {
|
||||
|
||||
public VigilanteJusticeTriggeredAbility() {
|
||||
super(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(1), "Whenever a Human enters the battlefield under your control, ", false);
|
||||
this.addTarget(new TargetCreatureOrPlayer());
|
||||
}
|
||||
|
||||
public VigilanteJusticeTriggeredAbility(VigilanteJusticeTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (zEvent.getToZone() == Constants.Zone.BATTLEFIELD) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && permanent.getSubtype().contains("Human") && permanent.getControllerId().equals(this.getControllerId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VigilanteJusticeTriggeredAbility copy() {
|
||||
return new VigilanteJusticeTriggeredAbility(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,17 +32,17 @@ import mage.Constants;
|
|||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.TargetController;
|
||||
import mage.Constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.costs.common.RemoveCounterTargetCost;
|
||||
import mage.abilities.costs.common.RemoveCounterCost;
|
||||
import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.SoulshiftAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.common.FilterPermanentOrPlayerWithCounter;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.target.common.TargetPermanentOrPlayerWithCounter;
|
||||
import mage.filter.predicate.permanent.CounterAnyPredicate;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -50,10 +50,11 @@ import mage.target.common.TargetPermanentOrPlayerWithCounter;
|
|||
*/
|
||||
public class ChiseiHeartOfOceans extends CardImpl<ChiseiHeartOfOceans> {
|
||||
|
||||
private final static FilterPermanentOrPlayerWithCounter filter = new FilterPermanentOrPlayerWithCounter("remove a counter from a permanent you control");
|
||||
private final static FilterPermanent filter = new FilterControlledPermanent("remove a counter from a permanent you control");
|
||||
|
||||
static {
|
||||
filter.add(new ControllerPredicate(Constants.TargetController.YOU));
|
||||
filter.add(new CounterAnyPredicate());
|
||||
}
|
||||
|
||||
public ChiseiHeartOfOceans(UUID ownerId) {
|
||||
|
|
@ -70,10 +71,9 @@ public class ChiseiHeartOfOceans extends CardImpl<ChiseiHeartOfOceans> {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// At the beginning of your upkeep, sacrifice Chisei, Heart of Oceans unless you remove a counter from a permanent you control.
|
||||
TargetPermanentOrPlayerWithCounter target = new TargetPermanentOrPlayerWithCounter(1);
|
||||
target.setFilter(filter);
|
||||
TargetPermanent target = new TargetPermanent(1,1,filter,true);
|
||||
target.setTargetName("a permanent you control");
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new RemoveCounterTargetCost(target)),TargetController.YOU, false));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new RemoveCounterCost(target)),TargetController.YOU, false));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import mage.abilities.effects.common.GainLifeEffect;
|
|||
import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
|
||||
/**
|
||||
|
|
@ -49,7 +50,7 @@ import mage.filter.predicate.mageobject.ColorPredicate;
|
|||
*/
|
||||
public class ResplendentMentor extends CardImpl<ResplendentMentor> {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("White creatures");
|
||||
private static final FilterPermanent filter = new FilterCreaturePermanent("White creatures");
|
||||
|
||||
static {
|
||||
filter.add(new ColorPredicate(ObjectColor.WHITE));
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
package mage.sets.tenth;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
|
|
@ -53,11 +52,15 @@ public class RobeOfMirrors extends CardImpl<RobeOfMirrors> {
|
|||
this.expansionSetCode = "10E";
|
||||
this.subtype.add("Aura");
|
||||
this.color.setBlue(true);
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.AddAbility));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
|
||||
// Enchanted creature has shroud.
|
||||
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ShroudAbility.getInstance(), Constants.AttachmentType.AURA)));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue