public Crosswinds(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}"); // Creatures with flying get -2/-0. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(-2, 0, Duration.WhileOnBattlefield, filter1, false))); }
public PendelhavenElder(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); this.subtype.add(SubType.ELF); this.subtype.add(SubType.SHAMAN); this.power = new MageInt(1); this.toughness = new MageInt(1); // {tap}: Each 1/1 creature you control gets +1/+2 until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 2, Duration.EndOfTurn, filter, false) .setText("Each 1/1 creature you control gets +1/+2 until end of turn."), new TapSourceCost() )); }
@Override public boolean apply(Game game, Ability source) { Permanent ThranWeaponry = game.getPermanent(source.getSourceId()); if (ThranWeaponry != null) { if (ThranWeaponry.isTapped()) { super.apply(game, source); return true; } else { used = true; } } return false; } }
public BoostAllEffect(DynamicValue power, DynamicValue toughness, Duration duration, FilterCreaturePermanent filter, boolean excludeSource, String rule, boolean lockedInPT) { super(duration, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, isCanKill(toughness) ? Outcome.UnboostCreature : Outcome.BoostCreature); this.power = power; this.toughness = toughness; this.filter = filter; this.excludeSource = excludeSource; this.lockedInPT = lockedInPT; if (rule == null || rule.isEmpty()) { setText(); } else { this.staticText = rule; } }
@Override public void init(Ability source, Game game) { super.init(source, game); setRuntimeData(source, game); if (this.affectedObjectsSet) { for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { if (!(excludeSource && perm.getId().equals(source.getSourceId())) && selectedByRuntimeData(perm, source, game)) { affectedObjectList.add(new MageObjectReference(perm, game)); } } } if (lockedInPT) { power = new StaticValue(power.calculate(game, source, this)); toughness = new StaticValue(toughness.calculate(game, source, this)); } }
@Override public void init(Ability source, Game game) { super.init(source, game); affectedObjectList.clear(); if (this.affectedObjectsSet) { Permanent target = game.getPermanent(getTargetPointer().getFirst(game, source)); if (target != null) { if (CardUtil.haveEmptyName(target)) { // face down creature affectedObjectList.add(new MageObjectReference(target, game)); } else { String name = target.getName(); for (Permanent perm : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { if (CardUtil.haveSameNames(perm.getName(), name)) { affectedObjectList.add(new MageObjectReference(perm, game)); } } } } } }
@Override public boolean apply(Game game, Ability source) { if (this.affectedObjectsSet) { for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) { // filter may not be used again, because object can have changed filter relevant attributes but still geets boost Permanent permanent = it.next().getPermanent(game); if (permanent != null) { permanent.addPower(power.calculate(game, source, this)); permanent.addToughness(toughness.calculate(game, source, this)); } else { it.remove(); // no longer on the battlefield, remove reference to object } } } else { setRuntimeData(source, game); for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { if (!(excludeSource && perm.getId().equals(source.getSourceId())) && selectedByRuntimeData(perm, source, game)) { perm.addPower(power.calculate(game, source, this)); perm.addToughness(toughness.calculate(game, source, this)); } } } return true; }
public BadMoon(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{B}"); // Black creatures get +1/+1. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false))); }
public WindShear(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{G}"); // Attacking creatures with flying get -2/-2 and lose flying until end of turn. this.getSpellAbility().addEffect(new BoostAllEffect(-2, -2, Duration.EndOfTurn, filter, false).setText("Attacking creatures with flying get -2/-2")); this.getSpellAbility().addEffect(new LoseAbilityAllEffect(FlyingAbility.getInstance(), Duration.EndOfTurn, filter).setText("and lose flying until end of turn")); }
public MuragandaPetroglyphs(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}"); this.expansionSetCode = "FUT"; // Creatures with no abilities get +2/+2. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect( 2, 2, Duration.WhileOnBattlefield, filterNoAbilities, false))); }
public GempalmAvenger(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{W}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.SOLDIER); this.power = new MageInt(3); this.toughness = new MageInt(5); // Cycling {2}{W} this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}{W}"))); // When you cycle Gempalm Avenger, Soldier creatures get +1/+1 and gain first strike until end of turn. Ability ability = new CycleTriggeredAbility( new BoostAllEffect(1, 1, Duration.EndOfTurn, filter, false).setText("Soldier creatures get +1/+1") ); Effect effect = new GainAbilityAllEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, filter); effect.setText("and gain first strike until end of turn"); ability.addEffect(effect); this.addAbility(ability); }
public Piety(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{W}"); // Blocking creatures get +0/+3 until end of turn. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(0, 3, Duration.EndOfTurn, filter, false))); //this.addAbility(new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_POST, "end Piety", true, new BoostAllEffect(0, 3, Duration.EndOfTurn, filter, false))); }
public DampeningPulse(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{U}"); // Creatures your opponents control get -1/-0. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, -0, Duration.WhileOnBattlefield, filter, false))); }
public CommonCause(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); // Nonartifact creatures get +2/+2 as long as they all share a color. this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect( new BoostAllEffect(2, 2, Duration.WhileOnBattlefield, filter, false), AllColorCondition.instance, "nonartifact creatures get +2/+2 as long as they all share a color.") )); }
public NightOfSoulsBetrayal (UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B}{B}"); addSuperType(SuperType.LEGENDARY); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, -1, Duration.WhileOnBattlefield, filter, false))); }
public ArmyOfAllah(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{W}{W}"); // Attacking creatures get +2/+0 until end of turn. this.getSpellAbility().addEffect(new BoostAllEffect(2, 0, Duration.EndOfTurn, filter, false)); }
public Nausea(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{B}"); // All creatures get -1/-1 until end of turn. this.getSpellAbility().addEffect(new BoostAllEffect(-1, -1, Duration.EndOfTurn)); }
public HystericalBlindness(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{U}"); // Creatures your opponents control get -4/-0 until end of turn. this.getSpellAbility().addEffect(new BoostAllEffect(-4, 0, Duration.EndOfTurn, filter, false)); }
public MarshGas(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}"); // All creatures get -2/-0 until end of turn. this.getSpellAbility().addEffect(new BoostAllEffect(-2, 0, Duration.EndOfTurn)); }
public Magnify(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}"); // All creatures get +1/+1 until end of turn. this.getSpellAbility().addEffect(new BoostAllEffect(1, 1, Duration.EndOfTurn)); }