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

How to use
DashAbility
in
mage.abilities.keyword

Best Java code snippets using mage.abilities.keyword.DashAbility (Showing top 20 results out of 315)

origin: magefree/mage

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

public DashAbility(Card card, String manaString) {
  super(Zone.ALL, null);
  name = KEYWORD;
  this.addDashCost(manaString);
  Ability ability = new EntersBattlefieldAbility(
      new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.Custom, false),
      DashedCondition.instance, "", "");
  ability.addEffect(new DashAddDelayedTriggeredAbilityEffect());
  ability.setRuleVisible(false);
  addSubAbility(ability);
}
origin: magefree/mage

private void activateDash(AlternativeCost2 cost, Game game) {
  cost.activate();
  // remember zone change counter
  if (zoneChangeCounter == 0) {
    Card card = game.getCard(getSourceId());
    if (card != null) {
      zoneChangeCounter = card.getZoneChangeCounter(game);
    } else {
      throw new IllegalArgumentException("Dash source card not found");
    }
  }
}
origin: magefree/mage

@Override
public boolean askToActivateAlternativeCosts(Ability ability, Game game) {
  if (ability instanceof SpellAbility) {
    Player player = game.getPlayer(controllerId);
    if (player != null) {
      this.resetDash();
      for (AlternativeCost2 dashCost : alternativeSourceCosts) {
        if (dashCost.canPay(ability, sourceId, controllerId, game)
            && player.chooseUse(Outcome.Benefit, KEYWORD + " the creature for " + dashCost.getText(true) + " ?", ability, game)) {
          activateDash(dashCost, game);
          ability.getManaCostsToPay().clear();
          ability.getCosts().clear();
          for (Iterator it = ((Costs) dashCost).iterator(); it.hasNext();) {
            Cost cost = (Cost) it.next();
            if (cost instanceof ManaCostsImpl) {
              ability.getManaCostsToPay().add((ManaCostsImpl) cost.copy());
            } else {
              ability.getCosts().add(cost.copy());
            }
          }
        }
      }
    }
  }
  return isActivated(ability, game);
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Card card = game.getCard(source.getSourceId());
    if (card != null) {
      return card.getAbilities().stream()
          .filter(a -> a instanceof DashAbility)
          .anyMatch(d -> ((DashAbility)d).isActivated(source, game));

    }
    return false;
  }
}
origin: magefree/mage

public AleshasVanguard(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}");
  this.subtype.add(SubType.ORC);
  this.subtype.add(SubType.WARRIOR);
  this.power = new MageInt(3);
  this.toughness = new MageInt(3);
  // Dash {2}{B}
  this.addAbility(new DashAbility(this, "{2}{B}"));
}
origin: magefree/mage

public ScreamreachBrawler(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}");
  this.subtype.add(SubType.ORC);
  this.subtype.add(SubType.BERSERKER);
  this.power = new MageInt(2);
  this.toughness = new MageInt(3);
  // Dash {1}{R}
  this.addAbility(new DashAbility(this, "{1}{R}"));
}
origin: magefree/mage

public MarduScout(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}{R}");
  this.subtype.add(SubType.GOBLIN);
  this.subtype.add(SubType.SCOUT);
  this.power = new MageInt(3);
  this.toughness = new MageInt(1);
  // Dash {1}{R}
  this.addAbility(new DashAbility(this, "{1}{R}"));        
}
origin: magefree/mage

public KolaghanSkirmisher(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}");
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.WARRIOR);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  // Dash {2}{B}
  this.addAbility(new DashAbility(this, "{2}{B}"));
}
origin: magefree/mage

public SprintingWarbrute(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}");
  this.subtype.add(SubType.OGRE);
  this.subtype.add(SubType.BERSERKER);
  this.power = new MageInt(5);
  this.toughness = new MageInt(4);
  // Sprinting Warbrute attacks each turn if able.
  this.addAbility(new AttacksEachCombatStaticAbility());
  // Dash {3}{R}
  this.addAbility(new DashAbility(this, "{3}{R}"));
}
origin: magefree/mage

public RecklessImp(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}");
  this.subtype.add(SubType.IMP);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  // Flying
  this.addAbility(FlyingAbility.getInstance());
  
  // Reckless Imp can't block.
  this.addAbility(new CantBlockAbility());
      
  // Dash {1}{B}
  this.addAbility(new DashAbility(this, "{1}{B}"));
}
origin: magefree/mage

public MarduShadowspear(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}");
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.WARRIOR);
  this.power = new MageInt(1);
  this.toughness = new MageInt(1);
  // Whenever Mardu Shadowspear attacks, each opponent loses 1 life.
  this.addAbility(new AttacksTriggeredAbility(new LoseLifeOpponentsEffect(1),false));
  // Dash {1}{B}
  this.addAbility(new DashAbility(this, "{1}{B}"));
}
origin: magefree/mage

public Warbringer(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}");
  this.subtype.add(SubType.ORC);
  this.subtype.add(SubType.BERSERKER);
  this.power = new MageInt(3);
  this.toughness = new MageInt(3);
  // Dash costs you pay cost {2} less (as long as this creature is on the battlefield).
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new WarbringerSpellsCostReductionEffect()));
  // Dash {2}{R}
  this.addAbility(new DashAbility(this, "{2}{R}"));
}
origin: magefree/mage

public PitilessHorde(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}");
  this.subtype.add(SubType.ORC);
  this.subtype.add(SubType.BERSERKER);
  this.power = new MageInt(5);
  this.toughness = new MageInt(3);
  // At the beginning of your upkeep, lose 2 life.
  this.addAbility(new BeginningOfUpkeepTriggeredAbility(new LoseLifeSourceControllerEffect(2), TargetController.YOU, false));
  
  // Dash {2}{B}{B}
  this.addAbility(new DashAbility(this, "{2}{B}{B}"));
}
origin: magefree/mage

public ZurgoBellstriker(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}");
  addSuperType(SuperType.LEGENDARY);
  this.subtype.add(SubType.ORC, SubType.WARRIOR);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  // Zurgo Bellstriker can't block creatures with power 2 or greater.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBlockCreaturesSourceEffect(filter)));
  // Dash {1}{R}
  this.addAbility(new DashAbility(this, "{1}{R}"));
}
origin: magefree/mage

public AmbuscadeShaman(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
  this.subtype.add(SubType.ORC);
  this.subtype.add(SubType.SHAMAN);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  // Whenever Ambuscade Shaman or another creature enters the battlefield under your control, that creature gets +2/+2 until end of turn.
  Effect effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn);
  effect.setText("that creature gets +2/+2 until end of turn");
  this.addAbility(new AmbuscadeShamanTriggeredAbility(effect));
  // Dash {3}{B} <i>(You may cast this spell for its dash cost. If you do, it gains haste, and it's returned from the battlefield to its owner's hand at the beginning of the next end step.)</i>);
  this.addAbility(new DashAbility(this, "{3}{B}"));
}
origin: magefree/mage

public LightningBerserker(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}");
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.BERSERKER);
  this.power = new MageInt(1);
  this.toughness = new MageInt(1);
  // {R}: Lightning Berserker gets +1/+0 until end of turn.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
      new BoostSourceEffect(1, 0, Duration.EndOfTurn),
      new ManaCostsImpl("{R}")));
  
  // Dash {R}
  this.addAbility(new DashAbility(this, "{R}"));
}
origin: magefree/mage

public FlamerushRider(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}");
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.WARRIOR);
  this.power = new MageInt(3);
  this.toughness = new MageInt(3);
  // Whenever Flamerush Rider attacks, create a token tapped and attacking that's a copy of another target attacking creature. Exile the token at end of combat.
  Ability ability = new AttacksTriggeredAbility(new FlamerushRiderEffect(), false);
  ability.addTarget(new TargetPermanent(filter));
  this.addAbility(ability);
  // Dash {2}{R}{R}
  this.addAbility(new DashAbility(this, "{2}{R}{R}"));
}
origin: magefree/mage

public GoblinHeelcutter(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}");
  this.subtype.add(SubType.GOBLIN);
  this.subtype.add(SubType.BERSERKER);
  this.power = new MageInt(3);
  this.toughness = new MageInt(2);
  // Whenever Goblin Heelcutter attacks, target creature can't block this turn.
  Ability ability = new AttacksTriggeredAbility(new CantBlockTargetEffect(Duration.EndOfTurn), false);
  ability.addTarget(new TargetCreaturePermanent());
  this.addAbility(ability);
  
  // Dash {2}{R} (You may cast this spell for its dash cost. If you do, it gains haste, and it's returned from the battlefield to its owner's hand at the beginning of the next end step.)
  this.addAbility(new DashAbility(this, "{2}{R}"));
}
origin: magefree/mage

public MarduStrikeLeader(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.WARRIOR);
  this.power = new MageInt(3);
  this.toughness = new MageInt(2);
  // Whenever Mardu Strike Leader attacks, create a 2/1 black Warrior creature token.
  this.addAbility(new AttacksTriggeredAbility(new CreateTokenEffect(new MarduStrikeLeaderWarriorToken()), false));
  // Dash {3}{B}
  this.addAbility(new DashAbility(this, "{3}{B}"));
}
mage.abilities.keywordDashAbility

Most used methods

  • <init>
  • activateDash
  • addDashCost
  • addSubAbility
  • getSourceId
  • isActivated
  • resetDash

Popular in Java

  • Reactive rest calls using spring rest template
  • getApplicationContext (Context)
  • scheduleAtFixedRate (Timer)
  • getResourceAsStream (ClassLoader)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • BoxLayout (javax.swing)
  • JFrame (javax.swing)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top plugins for WebStorm
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