@Override public PhantomPreventionEffect copy() { return new PhantomPreventionEffect(this); }
@Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { preventDamageAction(event, source, game); Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { boolean removeCounter = true; // check if in the same combat damage step already a counter was removed if (game.getTurn().getPhase().getStep().getType() == PhaseStep.COMBAT_DAMAGE) { if (game.getTurnNum() == turn && game.getTurn().getStep().equals(combatPhaseStep)) { removeCounter = false; } else { turn = game.getTurnNum(); combatPhaseStep = game.getTurn().getStep(); } } if(removeCounter && permanent.getCounters(game).containsKey(CounterType.P1P1)) { StringBuilder sb = new StringBuilder(permanent.getName()).append(": "); permanent.removeCounters(CounterType.P1P1.createInstance(), game); sb.append("Removed a +1/+1 counter "); game.informPlayers(sb.toString()); } } return false; }
public PhantomNomad(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}"); this.subtype.add(SubType.SPIRIT); this.subtype.add(SubType.NOMAD); this.power = new MageInt(0); this.toughness = new MageInt(0); // Phantom Nomad enters the battlefield with two +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), "two +1/+1 counters on it")); // If damage would be dealt to Phantom Nomad, prevent that damage. Remove a +1/+1 counter from Phantom Nomad. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhantomPreventionEffect())); }
public PhantomTiger(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.subtype.add(SubType.CAT); this.subtype.add(SubType.SPIRIT); this.power = new MageInt(1); this.toughness = new MageInt(0); // Phantom Tiger enters the battlefield with two +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), "with two +1/+1 counters on it")); // If damage would be dealt to Phantom Tiger, prevent that damage. Remove a +1/+1 counter from Phantom Tiger. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhantomPreventionEffect())); }
public PhantomWurm(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{G}{G}"); this.subtype.add(SubType.WURM); this.subtype.add(SubType.SPIRIT); this.power = new MageInt(2); this.toughness = new MageInt(0); // Phantom Wurm enters the battlefield with four +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(4)), "with four +1/+1 counters on it")); // If damage would be dealt to Phantom Wurm, prevent that damage. Remove a +1/+1 counter from Phantom Wurm. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhantomPreventionEffect())); }
public PhantomCentaur(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); this.subtype.add(SubType.CENTAUR); this.subtype.add(SubType.SPIRIT); this.power = new MageInt(2); this.toughness = new MageInt(0); // Protection from black this.addAbility(ProtectionAbility.from(ObjectColor.BLACK)); // Phantom Centaur enters the battlefield with three +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), "with three +1/+1 counters on it")); // If damage would be dealt to Phantom Centaur, prevent that damage. Remove a +1/+1 counter from Phantom Centaur. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhantomPreventionEffect())); }
public PhantomFlock(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); this.subtype.add(SubType.BIRD); this.subtype.add(SubType.SOLDIER); this.subtype.add(SubType.SPIRIT); this.power = new MageInt(0); this.toughness = new MageInt(0); // Flying this.addAbility(FlyingAbility.getInstance()); // Phantom Flock enters the battlefield with three +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), "with three +1/+1 counters on it")); // If damage would be dealt to Phantom Flock, prevent that damage. Remove a +1/+1 counter from Phantom Flock. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhantomPreventionEffect())); }
public PhantomNishoba(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}{W}"); this.subtype.add(SubType.CAT); this.subtype.add(SubType.BEAST); this.subtype.add(SubType.SPIRIT); this.power = new MageInt(0); this.toughness = new MageInt(0); // Trample this.addAbility(TrampleAbility.getInstance()); // Phantom Nishoba enters the battlefield with seven +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(7), true), "with seven +1/+1 counters on it")); // Whenever Phantom Nishoba deals damage, you gain that much life. this.addAbility(new DealsDamageGainLifeSourceTriggeredAbility()); // If damage would be dealt to Phantom Nishoba, prevent that damage. Remove a +1/+1 counter from Phantom Nishoba. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhantomPreventionEffect())); }
public PhantomNantuko(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}"); this.subtype.add(SubType.INSECT); this.subtype.add(SubType.SPIRIT); this.power = new MageInt(0); this.toughness = new MageInt(0); // Trample this.addAbility(TrampleAbility.getInstance()); // Phantom Nantuko enters the battlefield with two +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2), true), "with two +1/+1 counters on it")); // If damage would be dealt to Phantom Nantuko, prevent that damage. Remove a +1/+1 counter from Phantom Nantuko. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhantomPreventionEffect())); // {tap}: Put a +1/+1 counter on Phantom Nantuko. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new TapSourceCost())); }