@Override public EntersBattlefieldWithXCountersEffect copy() { return new EntersBattlefieldWithXCountersEffect(this); }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanentEntering(source.getSourceId()); if (permanent != null) { // except only takes place if something was copied if (permanent.isCopy()) { return super.apply(game, source); } } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent == null) { if (source.getAbilityType() == AbilityType.STATIC) { permanent = game.getPermanentEntering(source.getSourceId()); } } if (permanent != null) { SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); if (spellAbility != null && spellAbility.getSourceId().equals(source.getSourceId()) && permanent.getZoneChangeCounter(game) == spellAbility.getSourceObjectZoneChangeCounter()) { if (spellAbility.getSourceId().equals(source.getSourceId())) { // put into play by normal cast int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { Counter counterToAdd = counter.copy(); counterToAdd.add(amount - counter.getCount()); List<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects"); permanent.addCounters(counterToAdd, source, game, appliedEffects); } } } } return true; }
public ChaliceOfTheVoid(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{X}{X}"); // Chalice of the Void enters the battlefield with X charge counters on it. this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.CHARGE.createInstance()))); // Whenever a player casts a spell with converted mana cost equal to the number of charge counters on Chalice of the Void, counter that spell. this.addAbility(new ChaliceOfTheVoidTriggeredAbility()); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanentEntering(source.getSourceId()); if (controller != null && permanent != null) { int amount = controller.rollDice(game, 6); ArrayList<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects"); // the basic event is the EntersBattlefieldEvent, so use already applied replacement effects from that event permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game, appliedEffects); return super.apply(game, source); } return false; }
public EndlessOne(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{X}"); this.subtype.add(SubType.ELDRAZI); this.power = new MageInt(0); this.toughness = new MageInt(0); // Endless One enters the battlefield with X +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanentEntering(source.getSourceId()); if (controller != null && permanent != null) { int amount = controller.rollDice(game, 6); ArrayList<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects"); // the basic event is the EntersBattlefieldEvent, so use already applied replacement effects from that event permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game, appliedEffects); return super.apply(game, source); } return false; }
public IvyElemental(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{X}{G}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(0); this.toughness = new MageInt(0); // Ivy Elemental enters the battlefield with X +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); }
public NimbusSwimmer(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{X}{G}{U}"); this.subtype.add(SubType.LEVIATHAN); this.power = new MageInt(0); this.toughness = new MageInt(0); // Flying this.addAbility(FlyingAbility.getInstance()); // Nimbus Swimmer enters the battlefield with X +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); }
public ShiftingWall(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{X}"); this.subtype.add(SubType.WALL); this.power = new MageInt(0); this.toughness = new MageInt(0); // Defender this.addAbility(DefenderAbility.getInstance()); // Shifting Wall enters the battlefield with X +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); }
public WorldsoulColossus(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{X}{G}{W}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(0); this.toughness = new MageInt(0); // Convoke this.addAbility(new ConvokeAbility()); // Worldsoul Colossus enters the battlefield with X +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility( new EntersBattlefieldWithXCountersEffect( CounterType.P1P1.createInstance() ) )); }
public AstralCornucopia(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{X}{X}{X}"); // Astral Cornucopia enters the battlefield with X charge counters on it. this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.CHARGE.createInstance()))); // {T}: Choose a color. Add one mana of that color for each charge counter on Astral Cornucopia. this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new AstralCornucopiaManaEffect(), new TapSourceCost())); }
public GenesisHydra(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{X}{G}{G}"); this.subtype.add(SubType.PLANT); this.subtype.add(SubType.HYDRA); this.power = new MageInt(0); this.toughness = new MageInt(0); // When you cast Genesis Hydra, reveal the top X cards of your library. You may put a nonland permanent card with converted mana cost X or less from among them onto the battlefield. Then shuffle the rest into your library. this.addAbility(new CastSourceTriggeredAbility(new GenesisHydraPutOntoBattlefieldEffect(), false)); // Genesis Hydra enters the battlefield with X +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); }
public LifebloodHydra(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{X}{G}{G}{G}"); this.subtype.add(SubType.HYDRA); this.power = new MageInt(0); this.toughness = new MageInt(0); // Trample this.addAbility(TrampleAbility.getInstance()); // Lifeblood Hydra enters the battlefield with X +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); // When Lifeblood Hydra dies, you gain life and draw cards equal to its power. this.addAbility(new DiesTriggeredAbility(new LifebloodHydraEffect(), false)); }
public QuarantineField(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{X}{X}{W}{W}"); // Quarantine Field enters the battlefield with X isolation counters on it. this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.ISOLATION.createInstance()))); // When Quarantine Field enters the battlefield, for each isolation counter on it, exile up to one target nonland permanent an opponent controls until Quarantine Field leaves the battlefield. Ability ability = new EntersBattlefieldTriggeredAbility(new QuarantineFieldEffect(), false); ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility())); ability.setTargetAdjuster(QuarantineFieldAdjuster.instance); this.addAbility(ability); }
public PhyrexianMarauder(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{X}"); this.subtype.add(SubType.CONSTRUCT); this.power = new MageInt(0); this.toughness = new MageInt(0); // Phyrexian Marauder enters the battlefield with X +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); // Phyrexian Marauder can't block. this.addAbility(new CantBlockAbility()); // Phyrexian Marauder can't attack unless you pay {1} for each +1/+1 counter on it. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhyrexianMarauderCantAttackUnlessYouPayEffect())); }
public ProteanHydra(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{X}{G}"); this.subtype.add(SubType.HYDRA); this.power = new MageInt(0); this.toughness = new MageInt(0); // Protean Hydra enters the battlefield with X +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); // If damage would be dealt to Protean Hydra, prevent that damage and remove that many +1/+1 counters from it. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ProteanHydraEffect2())); // Whenever a +1/+1 counter is removed from Protean Hydra, put two +1/+1 counters on it at the beginning of the next end step. this.addAbility(new ProteanHydraAbility()); }
public Krakilin(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{X}{G}{G}"); this.subtype.add(SubType.BEAST); this.power = new MageInt(0); this.toughness = new MageInt(0); // Krakilin enters the battlefield with X +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); // {1}{G}: Regenerate Krakilin. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{1}{G}"))); }
public MistcutterHydra(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{X}{G}"); this.subtype.add(SubType.HYDRA); this.power = new MageInt(0); this.toughness = new MageInt(0); // Mistcutter Hydra can't be countered. this.addAbility(new CantBeCounteredAbility()); // Haste this.addAbility(HasteAbility.getInstance()); // protection from blue this.addAbility(ProtectionAbility.from(ObjectColor.BLUE)); // Mistcutter Hydra enters the battlefield with X +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); }
public VastwoodHydra(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{X}{G}{G}"); this.subtype.add(SubType.HYDRA); this.power = new MageInt(0); this.toughness = new MageInt(0); // Vastwood Hydra enters the battlefield with X +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); // When Vastwood Hydra dies, you may distribute a number of +1/+1 counters equal to the number of +1/+1 counters on Vastwood Hydra among any number of creatures you control. Ability ability = new DiesTriggeredAbility(new VastwoodHydraDistributeEffect(), true); ability.addTarget(new TargetCreaturePermanentAmount(new CountersSourceCount(CounterType.P1P1), filter)); this.addAbility(ability); }