Tabnine Logo
GainLifeEffect.<init>
Code IndexAdd Tabnine to your IDE (free)

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

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

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 CelestialForce(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{W}{W}{W}");
  this.subtype.add(SubType.ELEMENTAL);
  this.power = new MageInt(7);
  this.toughness = new MageInt(7);
  // At the beginning of each upkeep, you gain 3 life.
  this.addAbility(new BeginningOfUpkeepTriggeredAbility(new GainLifeEffect(3), TargetController.ANY, false));
}
origin: magefree/mage

public CentaurHealer(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{W}");
  this.subtype.add(SubType.CENTAUR);
  this.subtype.add(SubType.CLERIC);
  this.power = new MageInt(3);
  this.toughness = new MageInt(3);
  // When Centaur Healer enters the battlefield, you gain 3 life.
  this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(3)));
}
origin: magefree/mage

public ImpassionedOrator(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}");
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.CLERIC);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  // Whenever another creature enters the battlefield under your control, you gain 1 life.
  this.addAbility(new EntersBattlefieldAllTriggeredAbility(new GainLifeEffect(1), filter));
}
origin: magefree/mage

public PristineTalisman(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}");
  ColorlessManaAbility ability = new ColorlessManaAbility();
  ability.addEffect(new GainLifeEffect(1));
  this.addAbility(ability);
}
origin: magefree/mage

public LuxaRiverShrine(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
  // {1}, {T}: You gain 1 life. Put a brick counter on Luxa River Shrine.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), new ManaCostsImpl("{1}"));
  ability.addCost(new TapSourceCost());
  ability.addEffect(new AddCountersSourceEffect(CounterType.BRICK.createInstance()));
  this.addAbility(ability);
  // {T}: You gain 2 life. Activate this ability only if there are three or more brick counters on Luxa River Shrine.
  Condition condition = new SourceHasCounterCondition(CounterType.BRICK, 3, Integer.MAX_VALUE);
  this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(2), new TapSourceCost(), condition, rule));
}
origin: magefree/mage

public ClawsOfGix(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{0}");
  //{1}, Sacrifice a permanent: You gain 1 life.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), new GenericManaCost(1));
  ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent()));
  this.addAbility(ability);
}
origin: magefree/mage

public BogStriderAsh(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}");
  this.subtype.add(SubType.TREEFOLK, SubType.SHAMAN);
  this.power = new MageInt(2);
  this.toughness = new MageInt(4);
  // Swampwalk
  this.addAbility(new SwampwalkAbility());
  
  // Whenever a player casts a Goblin spell, you may pay {G}. If you do, you gain 2 life.
  this.addAbility(new SpellCastAllTriggeredAbility(new DoIfCostPaid(new GainLifeEffect(2), new ManaCostsImpl("{G}")), filter, true));
}
origin: magefree/mage

public DwarvenPriest(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
  this.subtype.add(SubType.DWARF);
  this.subtype.add(SubType.CLERIC);
  this.power = new MageInt(2);
  this.toughness = new MageInt(4);
  // When Dwarven Priest enters the battlefield, you gain 1 life for each creature you control.
  this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(
      new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE)
  )));
}
origin: magefree/mage

public HighwayRobber(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}{B}");
  this.subtype.add(SubType.HUMAN);
  this.subtype.add(SubType.MERCENARY);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  Ability ability = new EntersBattlefieldTriggeredAbility(new GainLifeEffect(2));
  ability.addTarget(new TargetOpponent());
  ability.addEffect(new LoseLifeTargetEffect(2));
  this.addAbility(ability);
}
origin: magefree/mage

public IllusionsOfGrandeur(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{U}");
  // Cumulative upkeep {2}
  this.addAbility(new CumulativeUpkeepAbility(new GenericManaCost(2)));
  
  // When Illusions of Grandeur enters the battlefield, you gain 20 life.
  this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(20)));
  
  // When Illusions of Grandeur leaves the battlefield, you lose 20 life.
  this.addAbility(new LeavesBattlefieldTriggeredAbility(new LoseLifeSourceControllerEffect(20), false));
}
origin: magefree/mage

public JujuBubble(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
  // Cumulative upkeep {1}
  this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{1}")));
  // When you play a card, sacrifice Juju Bubble.
  this.addAbility(new JujuBubbleTriggeredAbility());
  // {2}: You gain 1 life.
  this.addAbility(new SimpleActivatedAbility(new GainLifeEffect(1), new GenericManaCost(1)));
}
origin: magefree/mage

public ElvishEulogist(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{G}");
  this.subtype.add(SubType.ELF);
  this.subtype.add(SubType.SHAMAN);
  this.power = new MageInt(1);
  this.toughness = new MageInt(1);
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(new CardsInControllerGraveyardCount(filter, 1)), new SacrificeSourceCost()));
}
origin: magefree/mage

public PollutedBonds(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}");
  // Whenever a land enters the battlefield under an opponent's control, that player loses 2 life and you gain 2 life.
  Effect effect = new LoseLifeTargetEffect(2);
  effect.setText("that player loses 2 life");
  Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, effect, filter, false, SetTargetPointer.PLAYER, "");
  effect = new GainLifeEffect(2);
  effect.setText("and you gain 2 life");
  ability.addEffect(effect);
  this.addAbility(ability);
}
origin: magefree/mage

public BluntTheAssault (UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{G}");
  this.getSpellAbility().addEffect(new GainLifeEffect(new PermanentsOnBattlefieldCount(filter)));
  this.getSpellAbility().addEffect(new PreventAllDamageByAllPermanentsEffect(Duration.EndOfTurn, true));
}
origin: magefree/mage

public DramaticRescue(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{W}{U}");
  
  // Target player draws two cards.
  this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
  this.getSpellAbility().addEffect(new GainLifeEffect(2));
  this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}
origin: magefree/mage

public PoisonArrow(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{B}{B}");
  // Destroy target nonblack creature. You gain 3 life.
  this.getSpellAbility().addEffect(new DestroyTargetEffect());
  this.getSpellAbility().addEffect(new GainLifeEffect(3));
  this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
}
origin: magefree/mage

public DivineOffering(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{W}");
  // Destroy target artifact. You gain life equal to its converted mana cost.
  this.getSpellAbility().addEffect(new DestroyTargetEffect());
  Effect effect = new GainLifeEffect(TargetConvertedManaCost.instance);
  effect.setText("You gain life equal to its converted mana cost");
  this.getSpellAbility().addEffect(effect);
  this.getSpellAbility().addTarget(new TargetArtifactPermanent());
}
origin: magefree/mage

public HarshSustenance(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{W}{B}");
  // Harsh Sustenance deals X damage to any target and you gain X life, where X is the number of creatures you control.
  DynamicValue xValue = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent());
  Effect effect = new DamageTargetEffect(xValue);
  effect.setText("{this} deals X damage to any target");
  getSpellAbility().addEffect(effect);
  getSpellAbility().addTarget(new TargetAnyTarget());
  effect = new GainLifeEffect(xValue);
  effect.setText("and you gain X life, where X is the number of creatures you control");
  getSpellAbility().addEffect(effect);
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    Choice typeChoice = new ChoiceCreatureType(game.getObject(source.getSourceId()));
    if (player != null && player.choose(Outcome.BoostCreature, typeChoice, game)) {
      FilterControlledPermanent filter = new FilterControlledPermanent();
      filter.add(new SubtypePredicate(SubType.byDescription(typeChoice.getChoice())));
      return new GainLifeEffect(new PermanentsOnBattlefieldCount(filter, 2)).apply(game, source);
    }
    return false;
  }
}
mage.abilities.effects.commonGainLifeEffect<init>

Popular methods of GainLifeEffect

  • setText
  • apply
  • concatBy

Popular in Java

  • Parsing JSON documents to java classes using gson
  • runOnUiThread (Activity)
  • addToBackStack (FragmentTransaction)
  • startActivity (Activity)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • JPanel (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Join (org.hibernate.mapping)
  • Github Copilot alternatives
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