congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
BeginningOfCombatTriggeredAbility
Code IndexAdd Tabnine to your IDE (free)

How to use
BeginningOfCombatTriggeredAbility
in
mage.abilities.common

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

origin: magefree/mage

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

public LandoCalrissian(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}");
  addSuperType(SuperType.LEGENDARY);
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.ROGUE);
  this.power = new MageInt(4);
  this.toughness = new MageInt(3);
  // First Strike
  this.addAbility(FirstStrikeAbility.getInstance());
  // At the beggining of each combat, target Starship you control gets +2/+2 and gains vigilance until end of turn.
  Effect effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn);
  effect.setText("target Starship you control gets +2/+2");
  BeginningOfCombatTriggeredAbility ability = new BeginningOfCombatTriggeredAbility(effect, TargetController.ANY, false);
  effect = new GainAbilityTargetEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn);
  effect.setText("and gains vigilance until end of turn");
  ability.addEffect(effect);
  ability.addTarget(new TargetCreaturePermanent(filter));
  this.addAbility(ability);
}
origin: magefree/mage

@Override
public String getRule() {
  switch (targetController) {
    case YOU:
      return "At the beginning of combat on your turn, " + generateZoneString() + super.getRule();
    case OPPONENT:
      return "At the beginning of each opponent's combat step, " + generateZoneString() + super.getRule();
    case ANY:
      return "At the beginning of each combat, " + generateZoneString() + super.getRule();
  }
  return "";
}
origin: magefree/mage

  boolean yours = event.getPlayerId().equals(this.controllerId);
  if (yours && setTargetPointer) {
    if (getTargets().isEmpty()) {
      this.getEffects().forEach(effect -> {
        effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
      });
  if (game.getPlayer(this.controllerId).hasOpponent(event.getPlayerId(), game)) {
    if (setTargetPointer) {
      this.getEffects().forEach(effect -> {
        effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
      });
case ANY:
  if (setTargetPointer) {
    this.getEffects().forEach(effect -> {
      effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
    });
origin: magefree/mage

  private String generateZoneString() {
    switch (getZone()) {
      case GRAVEYARD:
        return "if {this} is in your graveyard, ";
    }
    return "";
  }
}
origin: magefree/mage

public StandOrFall(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{R}");
  // At the beginning of combat on your turn, separate all creatures defending player controls into two piles. Only creatures in the pile of that player’s choice can block this turn.
  this.addAbility(new BeginningOfCombatTriggeredAbility(new StandOrFallEffect(), TargetController.YOU, false));
}
origin: magefree/mage

public HanSolo(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}");
  addSuperType(SuperType.LEGENDARY);
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.ROGUE);
  this.power = new MageInt(4);
  this.toughness = new MageInt(3);
  // First strike
  this.addAbility(FirstStrikeAbility.getInstance());
  // At the beginning of each combat, target starship you control gets +2/+2 and gains haste until end of turn.
  Effect effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn);
  effect.setText("target Starship you control gets +2/+2");
  BeginningOfCombatTriggeredAbility ability = new BeginningOfCombatTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.ANY, false, false);
  effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
  effect.setText("and gains haste until end of turn");
  ability.addEffect(effect);
  ability.addTarget(new TargetCreaturePermanent(filter));
  this.addAbility(ability);
}
origin: magefree/mage

public GodPharaohsGift(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{7}");
  // At the beginning of combat on your turn, you may exile a creature card from your graveyard. If you do, create a token that's a copy of that card, except it's a 4/4 black Zombie. It gains haste until end of turn.
  this.addAbility(new BeginningOfCombatTriggeredAbility(Zone.BATTLEFIELD, new GodPharaohsGiftEffect(), TargetController.YOU, true, false));
}
origin: magefree/mage

public WebOfInertia(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
  // At the beginning of combat on each opponent's turn, that player may exile a card from their graveyard. If the player doesn't, creatures he or she controls can't attack you this turn.
  this.addAbility(new BeginningOfCombatTriggeredAbility(Zone.BATTLEFIELD, new WebOfInertiaEffect(), TargetController.OPPONENT, false, true));
}
origin: magefree/mage

public FightOrFlight(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{W}");
  // At the beginning of combat on each opponent’s turn, separate all creatures that player controls into two piles. Only creatures in the pile of their choice can attack this turn.
  this.addAbility(new BeginningOfCombatTriggeredAbility(new FightOrFlightEffect(), TargetController.OPPONENT, false));
}
origin: magefree/mage

public BloodMist(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{R}");
  // At the beginning of combat on your turn, target creature you control gains double strike until end of turn.
  Ability ability = new BeginningOfCombatTriggeredAbility(new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn), TargetController.YOU, false);
  ability.addTarget(new TargetControlledCreaturePermanent());
  this.addAbility(ability);
}
origin: magefree/mage

public LoyalDrake(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
  this.subtype.add(SubType.DRAKE);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  // Flying
  this.addAbility(FlyingAbility.getInstance());
  // Lieutenant — At the beginning of combat on your turn, if you control your commander, draw a card.
  this.addAbility(new ConditionalTriggeredAbility(
      new BeginningOfCombatTriggeredAbility(
          new DrawCardSourceControllerEffect(1),
          TargetController.YOU, false
      ), CommanderInPlayCondition.instance,
      "<i>Lieutenant</i> &mdash; At the beginning of combat "
      + "on your turn, if you control your commander, draw a card."
  ));
}
origin: magefree/mage

public DeceiverOfForm(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{6}{C}");
  this.subtype.add(SubType.ELDRAZI);
  this.power = new MageInt(8);
  this.toughness = new MageInt(8);
  // At the beginning of combat on your turn, reveal the top card of your library.
  // If a creature card is revealed this way, you may have creatures you control other than Deceiver of Form becomes copies of that card until end of turn.
  // You may put that card on the bottom of your library.
  this.addAbility(new BeginningOfCombatTriggeredAbility(new DeceiverOfFormEffect(), TargetController.YOU, false));
}
origin: magefree/mage

public LoyalSubordinate(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
  this.subtype.add(SubType.ZOMBIE);
  this.power = new MageInt(3);
  this.toughness = new MageInt(1);
  // Menace
  this.addAbility(new MenaceAbility());
  // Lieutenant — At the beginning of combat on your turn, if you control your commander, each opponent loses 3 life.
  this.addAbility(new ConditionalTriggeredAbility(
      new BeginningOfCombatTriggeredAbility(
          new LoseLifeOpponentsEffect(3),
          TargetController.YOU, false
      ), CommanderInPlayCondition.instance,
      "<i>Lieutenant</i> &mdash; At the beginning of combat "
      + "on your turn, if you control your commander, "
      + "each opponent loses 3 life."
  ));
}
origin: magefree/mage

public LoyalApprentice(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.ARTIFICER);
  this.power = new MageInt(2);
  this.toughness = new MageInt(1);
  // Haste
  this.addAbility(HasteAbility.getInstance());
  // Lieutenant — At the beginning of combat on your turn, if you control your commander, create a 1/1 colorless Thopter artifact creature token with flying. That token gains haste until end of turn.
  this.addAbility(new ConditionalTriggeredAbility(
      new BeginningOfCombatTriggeredAbility(
          new LoyalApprenticeEffect(),
          TargetController.YOU, false
      ), CommanderInPlayCondition.instance,
      "<i>Lieutenant</i> &mdash; At the beginning of combat "
      + "on your turn, create a 1/1 colorless Thopter "
      + "artifact creature token with flying. "
      + "That token gains haste until end of turn"
  ));
}
origin: magefree/mage

public SightOfTheScalelords(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{G}");
  // At the beginning of combat on your turn, creature you control with toughness 4 or greater get +2/+2 and gain vigilance until end of turn.
  Effect effect = new BoostControlledEffect(2, 2, Duration.EndOfTurn, filter, false);
  effect.setText("creatures you control with toughness 4 or greater get +2/+2");
  Ability ability = new BeginningOfCombatTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, false, false);
  effect = new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn, filter);
  effect.setText("and gain vigilance until end of turn");
  ability.addEffect(effect);
  this.addAbility(ability);
}
origin: magefree/mage

public LoyalGuardian(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}");
  this.subtype.add(SubType.RHINO);
  this.power = new MageInt(4);
  this.toughness = new MageInt(4);
  // Trample
  this.addAbility(TrampleAbility.getInstance());
  // Lieutenant — At the beginning of combat on your turn, if you control your commander, put a +1/+1 counter on each creature you control.
  this.addAbility(new ConditionalTriggeredAbility(
      new BeginningOfCombatTriggeredAbility(
          new AddCountersAllEffect(
              CounterType.P1P1.createInstance(),
              StaticFilters.FILTER_CONTROLLED_CREATURE
          ), TargetController.YOU, false
      ), CommanderInPlayCondition.instance,
      "<i>Lieutenant</i> &mdash; At the beginning of combat "
      + "on your turn, if you control your commander, "
      + "put a +1/+1 counter on each creature you control."
  ));
}
origin: magefree/mage

public SurrakTheHuntCaller(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{G}");
  addSuperType(SuperType.LEGENDARY);
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.WARRIOR);
  this.power = new MageInt(5);
  this.toughness = new MageInt(4);
  // <i>Formidable</i> &mdash; At the beginning of combat on your turn, if creatures you control have total power 8 or greater, target creature you control gains haste until end of turn.
  Ability ability = new ConditionalInterveningIfTriggeredAbility(
      new BeginningOfCombatTriggeredAbility(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn), TargetController.YOU, false),
      FormidableCondition.instance,
      "<i>Formidable</i> &mdash; At the beginning of combat on your turn, if creatures you control have total power 8 or greater, target creature you control gains haste until end of turn.");
  ability.addTarget(new TargetControlledCreaturePermanent());
  this.addAbility(ability);
}
origin: magefree/mage

public CitadelSiege(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}");
  // As Citadel Siege enters the battlefield, choose Khans or Dragons.
  this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null,
      "As {this} enters the battlefield, choose Khans or Dragons.", ""));
  // * Khans - At the beginning of combat on your turn, put two +1/+1 counters on target creature you control.
  Ability ability = new ConditionalTriggeredAbility(
      new BeginningOfCombatTriggeredAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance(2)), TargetController.YOU, false),
      new ModeChoiceSourceCondition("Khans"),
      ruleTrigger1);
  ability.addTarget(new TargetControlledCreaturePermanent());
  this.addAbility(ability);
  // * Dragons - At the beginning of combat on each opponent's turn, tap target creature that player controls.
  ability = new ConditionalTriggeredAbility(
      new BeginningOfCombatTriggeredAbility(new TapTargetEffect(), TargetController.OPPONENT, false),
      new ModeChoiceSourceCondition("Dragons"),
      ruleTrigger2);
  ability.addTarget(new TargetCreaturePermanent(filter));
  this.addAbility(ability);
}
origin: magefree/mage

public AjanisComrade(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
  this.subtype.add(SubType.ELF);
  this.subtype.add(SubType.SOLDIER);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  // Trample
  this.addAbility(TrampleAbility.getInstance());
  // At the beginning of combat on your turn, if you control an Ajani planeswalker, put a +1/+1 counter on Ajani's Comrade.
  this.addAbility(new ConditionalInterveningIfTriggeredAbility(
      new BeginningOfCombatTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), TargetController.YOU, false),
      new PermanentsOnTheBattlefieldCondition(filter),
      "At the beginning of combat on your turn, if you control an Ajani planeswalker, put a +1/+1 counter on {this}."));
}
mage.abilities.commonBeginningOfCombatTriggeredAbility

Most used methods

  • <init>
  • addEffect
  • addTarget
  • generateZoneString
  • getEffects
  • getTargets
  • getZone

Popular in Java

  • Start an intent from android
  • addToBackStack (FragmentTransaction)
  • onCreateOptionsMenu (Activity)
  • getSystemService (Context)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Notification (javax.management)
  • JLabel (javax.swing)
  • JTable (javax.swing)
  • Top plugins for WebStorm
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