congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
BoostAllEffect
Code IndexAdd Tabnine to your IDE (free)

How to use
BoostAllEffect
in
mage.abilities.effects.common.continuous

Best Java code snippets using mage.abilities.effects.common.continuous.BoostAllEffect (Showing top 20 results out of 315)

origin: magefree/mage

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)));
}
origin: magefree/mage

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()
  ));
}
origin: magefree/mage

  @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;
  }
}
origin: magefree/mage

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;
  }
}
origin: magefree/mage

@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));
  }
}
origin: magefree/mage

@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));
          }
        }
      }
    }
  }
}
origin: magefree/mage

@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;
}
origin: magefree/mage

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)));
  
}
origin: magefree/mage

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"));
}
origin: magefree/mage

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)));
}
origin: magefree/mage

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);
}
origin: magefree/mage

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)));
}
origin: magefree/mage

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)));
}
origin: magefree/mage

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.")
  ));
}
origin: magefree/mage

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)));
}
origin: magefree/mage

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));
}
origin: magefree/mage

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));
}
origin: magefree/mage

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));
}
origin: magefree/mage

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));
}
origin: magefree/mage

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));
}
mage.abilities.effects.common.continuousBoostAllEffect

Most used methods

  • <init>
  • setText
  • apply
  • init
  • isCanKill
  • selectedByRuntimeData
    Overwrite this in effect that inherits from this
  • setRuntimeData
    Overwrite this in effect that inherits from this

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • requestLocationUpdates (LocationManager)
  • getContentResolver (Context)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Path (java.nio.file)
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now