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

How to use
GainLifeEffect
in
mage.abilities.effects.common

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

origin: magefree/mage

public CreepingChill(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}");
  // Creeping Chill deals 3 damage to each opponent and you gain 3 life.
  this.getSpellAbility().addEffect(
      new DamagePlayersEffect(3, TargetController.OPPONENT)
  );
  this.getSpellAbility().addEffect(
      new GainLifeEffect(3).setText("and you gain 3 life")
  );
  // When Creeping Chill is put into your graveyard from your library, you may exile it. If you do, Creeping Chill deals 3 damage to each opponent and you gain 3 life.
  this.addAbility(new CreepingChillAbility());
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent creature = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
    if (creature == null) {
      return false;
    }
    return new GainLifeEffect(creature.getToughness().getValue()).apply(game, source);
  }
}
origin: magefree/mage

public VindictiveVampire(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
  this.subtype.add(SubType.VAMPIRE);
  this.power = new MageInt(2);
  this.toughness = new MageInt(3);
  // Whenever another creature you control dies, Vindictive Vampire deals 1 damage to each opponent and you gain 1 life.
  Ability ability = new DiesCreatureTriggeredAbility(
      new DamagePlayersEffect(1, TargetController.OPPONENT), false,
      filter, true
  );
  ability.addEffect(new GainLifeEffect(1).concatBy("and"));
  this.addAbility(ability);
}
origin: magefree/mage

public DegaSanctuary(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
  // At the beginning of your upkeep, if you control a black or red permanent, you gain 2 life. If you control a black permanent and a red permanent, you gain 4 life instead.
  Ability ability = new SanctuaryInterveningIfTriggeredAbility(
      new GainLifeEffect(2), new GainLifeEffect(4), ObjectColor.BLACK, ObjectColor.RED,
      "At the beginning of your upkeep, if you control a black or red permanent, you gain 2 life. "
      + "If you control a black permanent and a red permanent, you gain 4 life instead."
  );
  this.addAbility(ability);
}
origin: magefree/mage

public GainLifeEffect(DynamicValue life) {
  super(Outcome.GainLife);
  this.life = life;
  setText();
}

origin: magefree/mage

public FeedTheClan(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{G}");
  // You gain 5 life.
  // Ferocious - You gain 10 life instead if you control a creature with power 4 or greater
  this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
      new GainLifeEffect(10),
      new GainLifeEffect(5),
      FerociousCondition.instance,
      "You gain 5 life. <br><i>Ferocious</i> &mdash; You gain 10 life instead if you control a creature with power 4 or greater"));
}
origin: magefree/mage

public BasilicaBellHaunt(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{W}{B}{B}");
  this.subtype.add(SubType.SPIRIT);
  this.power = new MageInt(3);
  this.toughness = new MageInt(4);
  // When Basilica Bell-Haunt enters the battlefield, each opponent discards a card and you gain 3 life.
  Ability ability = new EntersBattlefieldTriggeredAbility(new DiscardEachPlayerEffect(TargetController.OPPONENT));
  ability.addEffect(new GainLifeEffect(3).setText("and you gain 3 life"));
  this.addAbility(ability);
}
origin: magefree/mage

public AjanisWelcome(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}");
  // Whenever a creature enters the battlefield under your control, you gain 1 life.
  this.addAbility(new EntersBattlefieldControlledTriggeredAbility(
      new GainLifeEffect(1),
      StaticFilters.FILTER_PERMANENT_CREATURE
  ));
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent perm = game.getPermanent(source.getSourceId());
    GainLifeEffect lifeEffect = new GainLifeEffect(perm.getPower().getValue());
    return lifeEffect.apply(game, source);        
  }
}
origin: magefree/mage

public IllGottenInheritance(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}");
  // At the beginning of your upkeep, Ill-Gotten Inheritance deals 1 damage to each opponent and you gain 1 life.
  Ability ability = new BeginningOfUpkeepTriggeredAbility(
      new DamagePlayersEffect(1, TargetController.OPPONENT),
      TargetController.YOU, false
  );
  ability.addEffect(new GainLifeEffect(1).concatBy("and"));
  this.addAbility(ability);
  // {5}{B}, Sacrifice Ill-Gotten Inheritance: It deals 4 damage to target opponent and you gain 4 life.
  ability = new SimpleActivatedAbility(
      new DamageTargetEffect(4, "it"),
      new ManaCostsImpl("{5}{B}")
  );
  ability.addEffect(new GainLifeEffect(4).concatBy("and"));
  ability.addCost(new SacrificeSourceCost());
  ability.addTarget(new TargetOpponent());
  this.addAbility(ability);
}
origin: magefree/mage

public SovereignsBite(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}");
  // Target player loses 3 life and you gain 3 life.
  this.getSpellAbility().addEffect(new LoseLifeTargetEffect(3));
  this.getSpellAbility().addEffect(new GainLifeEffect(3).setText("and you gain 3 life"));
  this.getSpellAbility().addTarget(new TargetPlayer());
}
origin: magefree/mage

public Thoughtleech(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}{G}");
  // Whenever an Island an opponent controls becomes tapped, you may gain 1 life.
  this.addAbility(new BecomesTappedTriggeredAbility(new GainLifeEffect(1), true, filter));
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    RevealTargetFromHandCost cost = new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter));
    if (!cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) {
      return false;
    }
    int xValue = cost.getNumberRevealedCards();
    return new GainLifeEffect(2 * xValue).apply(game, source);
  }
}
origin: magefree/mage

public CarrionImp(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
  this.subtype.add(SubType.IMP);
  this.power = new MageInt(2);
  this.toughness = new MageInt(3);
  // Flying
  this.addAbility(FlyingAbility.getInstance());
  // When Carrion Imp enters the battlefield, you may exile target creature card from a graveyard. If you do, you gain 2 life.
  Ability ability = new EntersBattlefieldTriggeredAbility(new ExileTargetEffect(), true);
  ability.addEffect(new GainLifeEffect(2).concatBy("If you do,"));
  ability.addTarget(new TargetCardInGraveyard(filter));
  this.addAbility(ability);
}
origin: magefree/mage

public WarleadersHelix(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}{W}");
  // Warleader's Helix deals 4 damage to any target and you gain 4 life.
  this.getSpellAbility().addEffect(new DamageTargetEffect(4));
  this.getSpellAbility().addEffect(new GainLifeEffect(4).setText("and you gain 4 life"));
  this.getSpellAbility().addTarget(new TargetAnyTarget());
}
origin: magefree/mage

public LifeGoesOn(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}");
  
  // You gain 4 life. If a creature died this turn, you gain 8 life instead.
  getSpellAbility().addWatcher(new MorbidWatcher());
  getSpellAbility().addEffect(new ConditionalOneShotEffect(new GainLifeEffect(8), new GainLifeEffect(4), MorbidCondition.instance, "You gain 4 life. If a creature died this turn, you gain 8 life instead"));
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    RevealTargetFromHandCost cost = new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter));
    if (!cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) {
      return false;
    }
    int xValue = cost.getNumberRevealedCards();
    return new GainLifeEffect(2 * xValue).apply(game, source);
  }
}
origin: magefree/mage

public ConsumeSpirit(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{1}{B}");
  // Spend only black mana on X.
  this.addAbility(new SimpleStaticAbility(
      Zone.ALL, new InfoEffect("Spend only black mana on X")).setRuleAtTheTop(true)
  );
  // Consume Spirit deals X damage to any target and you gain X life.
  this.getSpellAbility().addTarget(new TargetAnyTarget());
  this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance));
  this.getSpellAbility().addEffect(new GainLifeEffect(ManacostVariableValue.instance).concatBy("and"));
  VariableCost variableCost = this.getSpellAbility().getManaCostsToPay().getVariableCosts().get(0);
  if (variableCost instanceof VariableManaCost) {
    ((VariableManaCost) variableCost).setFilter(filterBlack);
  }
}
origin: magefree/mage

public Finn(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
  
  this.addSuperType(SuperType.LEGENDARY);
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.TROOPER);
  this.subtype.add(SubType.SOLDIER);
  this.power = new MageInt(3);
  this.toughness = new MageInt(3);
  // Whenever Finn or another nontoken creature you control enters the battlefield under your control, you gain 1 life for each nontoken creature you control.
  this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD,
      new GainLifeEffect(new PermanentsOnBattlefieldCount(filter))
        .setText("you gain 1 life for each nontoken creature you control"),
      filter, false));
}
origin: magefree/mage

public BatheInBacta(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{G}");
  // You gain 6 life. If you lost life from a source other than combat damage this turn, you gain 9 life instead.
  this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
      new GainLifeEffect(6), new GainLifeEffect(9),
      new InvertCondition(HateCondition.instance),
      "You gain 6 life. If you lost life from a source other than combat damage this turn, you gain 9 life instead"));
  this.getSpellAbility().addWatcher(new LifeLossOtherFromCombatWatcher());
}
mage.abilities.effects.commonGainLifeEffect

Most used methods

  • <init>
  • setText
  • apply
  • concatBy

Popular in Java

  • Reading from database using SQL prepared statement
  • getSharedPreferences (Context)
  • getContentResolver (Context)
  • putExtra (Intent)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Top Sublime Text 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