mage.abilities.Ability.addCost()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(10.6k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中mage.abilities.Ability.addCost()方法的一些代码示例,展示了Ability.addCost()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ability.addCost()方法的具体详情如下:
包路径:mage.abilities.Ability
类名称:Ability
方法名:addCost

Ability.addCost介绍

[英]Adds a Cost to this ability that must be paid before this ability is activated.
[中]为该异能添加一个必须在激活该异能之前支付的费用。

代码示例

代码示例来源:origin: magefree/mage

public BlightsoilDruid(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}");
  this.subtype.add(SubType.ELF, SubType.DRUID);
  this.power = new MageInt(1);
  this.toughness = new MageInt(2);
  Ability ability = new GreenManaAbility();
  ability.addCost(new PayLifeCost(1));
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public AladdinsLamp(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{10}");
  // {X}, {T}: The next time you would draw a card this turn, instead look at the top X cards of your library, put all but one of them on the bottom of your library in a random order, then draw a card. X can't be 0.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AladdinsLampEffect(), new ManaCostsImpl("{X}"));
  ability.addCost(new TapSourceCost());
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public BorosSignet (UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
  Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(1, 0, 0, 1, 0, 0, 0, 0), new GenericManaCost(1));
  ability.addCost(new TapSourceCost());
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public BlackLotus(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{0}");
  // {tap}, Sacrifice Black Lotus: Add three mana of any one color.
  Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(3), new TapSourceCost());
  ability.addCost(new SacrificeSourceCost());
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public AlchemistsVial(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
  // When Alchemist's Vial enters the battlefield, draw a card.
  this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1)));
  // {1}, {T}: Sacrifice Alchemist's Vial: Target creature can't attack or block this turn.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantAttackBlockTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{1}"));
  ability.addCost(new TapSourceCost());
  ability.addCost(new SacrificeSourceCost());
  ability.addTarget(new TargetCreaturePermanent());
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public CabalCoffers(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
  // {2}, {T}: Add {B} for each Swamp you control.
  Ability ability = new DynamicManaAbility(Mana.BlackMana(1), new PermanentsOnBattlefieldCount(filter), new GenericManaCost(2));
  ability.addCost(new TapSourceCost());
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public BloodCelebrant(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}");
  this.subtype.add(SubType.HUMAN, SubType.CLERIC);
  this.power = new MageInt(1);
  this.toughness = new MageInt(1);
  // {B}, Pay 1 life: Add one mana of any color.
  Ability ability = new AnyColorManaAbility(new ColoredManaCost(ColoredManaSymbol.B));
  ability.addCost(new PayLifeCost(1));
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public AlchorsTomb(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}");
  // {2}, {tap}: Target permanent you control becomes the color of your choice.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorTargetEffect(Duration.WhileOnBattlefield), new GenericManaCost(2));
  ability.addCost(new TapSourceCost());
  ability.addTarget(new TargetControlledPermanent());
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public AmuletOfKroog(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
  // {2}, {tap}: Prevent the next 1 damage that would be dealt to any target this turn.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 1), new GenericManaCost(2));
  ability.addCost(new TapSourceCost());
  ability.addTarget(new TargetAnyTarget());
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public CandelabraOfTawnos(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
  // {X}, {T}: Untap X target lands.
  Effect effect = new UntapTargetEffect();
  effect.setText("untap X target lands");
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}"));
  ability.addCost(new TapSourceCost());
  ability.addTarget(new TargetPermanent(StaticFilters.FILTER_LANDS));
  ability.setTargetAdjuster(XTargetsAdjuster.instance);
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public BidentOfThassa(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT,CardType.ARTIFACT},"{2}{U}{U}");
  addSuperType(SuperType.LEGENDARY);
  // Whenever a creature you control deals combat damage to a player, you may draw a card.
  this.addAbility(new BidentOfThassaTriggeredAbility());
  // {1}{U}, {T}: Creatures your opponents control attack this turn if able.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BidentOfThassaMustAttackEffect(), new ManaCostsImpl("{1}{U}"));
  ability.addCost(new TapSourceCost());
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public AncientSpring(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.LAND},"");
  // Ancient Spring enters the battlefield tapped.
  this.addAbility(new EntersBattlefieldTappedAbility());
  // {tap}: Add {U}.
  this.addAbility(new BlueManaAbility());
  // {tap}, Sacrifice Ancient Spring: Add {W}{B}.
  Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 0, 0, 1, 1, 0, 0, 0), new TapSourceCost());
  ability.addCost(new SacrificeSourceCost());
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public CausticCaterpillar(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{G}");
  this.subtype.add(SubType.INSECT);
  this.power = new MageInt(1);
  this.toughness = new MageInt(1);
  // {1}{G}, Sacrifice Caustic Caterpillar: Destroy target artifact or enchantment.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{1}{G}"));
  ability.addCost(new SacrificeSourceCost());
  ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT));
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public AkroanMastiff(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}");
  this.subtype.add(SubType.HOUND);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  // {W},{T}: Tap target creature.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{W}"));
  ability.addCost(new TapSourceCost());
  ability.addTarget(new TargetCreaturePermanent());
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public BloodfireKavu(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}");
  this.subtype.add(SubType.KAVU);
  this.power = new MageInt(2);
  this.toughness = new MageInt(2);
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageAllEffect(2, new FilterCreaturePermanent()), new ColoredManaCost(ColoredManaSymbol.R));
  ability.addCost(new SacrificeSourceCost());
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public AmberPrison(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}");
  // You may choose not to untap Amber Prison during your untap step.
  this.addAbility(new SkipUntapOptionalAbility());
  // {4}, {tap}: Tap target artifact, creature, or land. That permanent doesn't untap during its controller's untap step for as long as Amber Prison remains tapped.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new GenericManaCost(4));
  ability.addCost(new TapSourceCost());
  ability.addTarget(new TargetPermanent(filter));
  ability.addEffect(new DontUntapAsLongAsSourceTappedEffect());
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public CentaursHerald(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{G}");
  this.subtype.add(SubType.ELF);
  this.subtype.add(SubType.SCOUT);
  this.power = new MageInt(0);
  this.toughness = new MageInt(1);
  // {2}{G}, Sacrifice Centaur's Herald: Create a 3/3 green Centaur creature token.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new CentaurToken()), new ManaCostsImpl("{2}{G}"));
  ability.addCost(new SacrificeSourceCost());
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public Amugaba(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{U}{U}");
  this.subtype.add(SubType.ILLUSION);
  this.power = new MageInt(6);
  this.toughness = new MageInt(6);
  // Flying
  this.addAbility(FlyingAbility.getInstance());
  // {2}{U}, Discard a card: Return Amugaba to its owner's hand.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new ManaCostsImpl("{2}{U}"));
  ability.addCost(new DiscardTargetCost(new TargetCardInHand()));
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public BolracClanCrusher(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}{G}");
  this.subtype.add(SubType.OGRE);
  this.subtype.add(SubType.WARRIOR);
  this.power = new MageInt(4);
  this.toughness = new MageInt(4);
  // {T}, Remove a +1/+1 counter from a creature you control: Bolrac-Clan Crusher deals 2 damage to any target.
  Ability ability = new SimpleActivatedAbility(new DamageTargetEffect(2), new TapSourceCost());
  ability.addCost(new RemoveCounterCost(new TargetControlledCreaturePermanent(), CounterType.P1P1));
  ability.addTarget(new TargetAnyTarget());
  this.addAbility(ability);
}

代码示例来源:origin: magefree/mage

public AltarOfShadows(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{7}");
  // At the beginning of your precombat main phase, add {B} for each charge counter on Altar of Shadows.
  this.addAbility(new BeginningOfPreCombatMainTriggeredAbility(new AltarOfShadowsEffect(), TargetController.YOU, false));
  
  // {7}, {tap}: Destroy target creature. Then put a charge counter on Altar of Shadows.
  Ability destroyAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new GenericManaCost(7));
  destroyAbility.addCost(new TapSourceCost());
  destroyAbility.addEffect(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(), true));
  destroyAbility.addTarget(new TargetCreaturePermanent());
  this.addAbility(destroyAbility);
}

相关文章