Tabnine Logo
SwitchPowerToughnessSourceEffect
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: magefree/mage

@Override
public SwitchPowerToughnessSourceEffect copy() {
  return new SwitchPowerToughnessSourceEffect(this);
}
origin: magefree/mage

@Override
public void init(Ability source, Game game) {
  super.init(source, game); //To change body of generated methods, choose Tools | Templates.
  if (duration.isOnlyValidIfNoZoneChange()) {
    // If source permanent is no longer onto battlefield discard the effect
    if (source.getSourcePermanentIfItStillExists(game) == null) {
      discard();
    }
  }
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game);
  if (sourcePermanent != null) {
    int power = sourcePermanent.getPower().getValue();
    sourcePermanent.getPower().setValue(sourcePermanent.getToughness().getValue());
    sourcePermanent.getToughness().setValue(power);
    return true;
  } else {
    if (duration.isOnlyValidIfNoZoneChange()) {
      discard();
    }
  }
  return false;
}
origin: magefree/mage

public ValakutFireboar(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}");
  this.subtype.add(SubType.ELEMENTAL);
  this.subtype.add(SubType.BOAR);
  this.power = new MageInt(1);
  this.toughness = new MageInt(7);
  this.addAbility(new AttacksTriggeredAbility(new SwitchPowerToughnessSourceEffect(Duration.EndOfTurn), false));
}
origin: magefree/mage

public Fluxcharger(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{R}");
  this.subtype.add(SubType.WEIRD);
  this.power = new MageInt(1);
  this.toughness = new MageInt(5);
  // Flying
  this.addAbility(FlyingAbility.getInstance());
  // Whenever you cast an instant or sorcery spell, you may switch Fluxcharger's power and toughness until end of turn.
  this.addAbility(new SpellCastControllerTriggeredAbility(new SwitchPowerToughnessSourceEffect(Duration.EndOfTurn), StaticFilters.FILTER_SPELL_AN_INSTANT_OR_SORCERY, true));
}
origin: magefree/mage

public CalciteSnapper(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}{U}");
  this.subtype.add(SubType.TURTLE);
  this.power = new MageInt(1);
  this.toughness = new MageInt(4);
  this.addAbility(ShroudAbility.getInstance());
  this.addAbility(new LandfallAbility(new SwitchPowerToughnessSourceEffect(Duration.EndOfTurn), true));
}
origin: magefree/mage

public CragPuca(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{U/R}{U/R}{U/R}");
  this.subtype.add(SubType.SHAPESHIFTER);
  this.power = new MageInt(2);
  this.toughness = new MageInt(4);
  // {UR}: Switch Crag Puca's power and toughness until end of turn.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SwitchPowerToughnessSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{U/R}")));
  
}
origin: magefree/mage

public MyrQuadropod(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{4}");
  this.subtype.add(SubType.MYR);
  this.power = new MageInt(1);
  this.toughness = new MageInt(4);
  // {3}: Switch Myr Quadropod's power and toughness until end of turn.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SwitchPowerToughnessSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{3}")));
}
origin: magefree/mage

public WanderingFumaroleToken() {
  super("", "1/4 blue and red Elemental creature with \"0: Switch this creature's power and toughness until end of turn.\"");
  cardType.add(CardType.CREATURE);
  subtype.add(SubType.ELEMENTAL);
  color.setRed(true);
  color.setBlue(true);
  power = new MageInt(1);
  toughness = new MageInt(4);
  addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SwitchPowerToughnessSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{0}")));
}
public WanderingFumaroleToken(final WanderingFumaroleToken token) {
origin: magefree/mage

public Aquamoeba(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}");
  this.subtype.add(SubType.ELEMENTAL);
  this.subtype.add(SubType.BEAST);
  this.power = new MageInt(1);
  this.toughness = new MageInt(3);
  // Discard a card: Switch Aquamoeba's power and toughness until end of turn.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SwitchPowerToughnessSourceEffect(Duration.EndOfTurn), new DiscardCardCost()));
}
origin: magefree/mage

public TurtleshellChangeling(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}");
  this.subtype.add(SubType.SHAPESHIFTER);
  this.power = new MageInt(1);
  this.toughness = new MageInt(4);
  //Changeling
  this.addAbility(ChangelingAbility.getInstance());
  //{1}{U}: Switch {this}'s power and toughness until end of turn.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SwitchPowerToughnessSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{1}{U}")));
}
origin: magefree/mage

public PhantasmalFiend(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
  this.subtype.add(SubType.ILLUSION);
  this.power = new MageInt(1);
  this.toughness = new MageInt(5);
  // {B}: Phantasmal Fiend gets +1/-1 until end of turn.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, -1, Duration.EndOfTurn), new ManaCostsImpl("{B}")));
  // {1}{U}: Switch Phantasmal Fiend's power and toughness until end of turn.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SwitchPowerToughnessSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{1}{U}")));
}
origin: magefree/mage

public Windreaver(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}{U}");
  this.subtype.add(SubType.ELEMENTAL);
  this.power = new MageInt(1);
  this.toughness = new MageInt(3);
  // Flying
  this.addAbility(FlyingAbility.getInstance());
  // {W}: Windreaver gains vigilance until end of turn.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{W}"))); 
  // {W}: Windreaver gets +0/+1 until end of turn.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(0, 1, Duration.EndOfTurn), new ManaCostsImpl("{W}"))); 
  // {U}: Switch Windreaver's power and toughness until end of turn.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SwitchPowerToughnessSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{U}"))); 
  // {U}: Return Windreaver to its owner's hand.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new ManaCostsImpl("{U}"))); 
}
mage.abilities.effects.common.continuousSwitchPowerToughnessSourceEffect

Most used methods

  • <init>
  • discard

Popular in Java

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • addToBackStack (FragmentTransaction)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Reference (javax.naming)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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