本文整理了Java中mage.abilities.Ability.setRuleVisible()
方法的一些代码示例,展示了Ability.setRuleVisible()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ability.setRuleVisible()
方法的具体详情如下:
包路径:mage.abilities.Ability
类名称:Ability
方法名:setRuleVisible
[英]Sets the value for the ruleVisible attribute
true = rule will be shown for the card / permanent false = rule won't be shown
[中]设置ruleVisible属性的值
true=将显示该卡的规则/永久false=将不显示规则
代码示例来源:origin: magefree/mage
@Override
public void setRuleVisible(boolean ruleVisible) {
this.ability.setRuleVisible(ruleVisible);
}
代码示例来源:origin: magefree/mage
public HideawayAbility() {
super(Zone.ALL, new EntersBattlefieldEffect(new TapSourceEffect(true)));
Ability ability = new EntersBattlefieldTriggeredAbility(new HideawayExileEffect(), false);
ability.setRuleVisible(false);
addSubAbility(ability);
// Allow controller to look at face down card
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new HideawayLookAtFaceDownCardEffect());
ability.setRuleVisible(false);
addSubAbility(ability);
}
代码示例来源:origin: magefree/mage
public FadingAbility(int fadeCounter, Card card, boolean shortRuleText) {
super(new AddCountersSourceEffect(CounterType.FADE.createInstance(fadeCounter)), "with");
Ability ability = new BeginningOfUpkeepTriggeredAbility(new FadingEffect(), TargetController.YOU, false);
ability.setRuleVisible(false);
addSubAbility(ability);
ruleText = "Fading " + fadeCounter
+ (shortRuleText ? ""
: " <i>(This permanent enters the battlefield with " + fadeCounter + " fade counters on it."
+ " At the beginning of your upkeep, remove a fade counter from this permanent. If you can't, sacrifice the permanent.</i>");
}
代码示例来源:origin: magefree/mage
public ModularAbility(Card card, int amount, boolean sunburst) {
super(new ModularDistributeCounterEffect(), true);
Target target = new TargetArtifactPermanent(filter);
this.addTarget(target);
this.amount = amount;
this.sunburst = sunburst;
if (sunburst) {
Ability ability = new SunburstAbility(card);
ability.setRuleVisible(false);
addSubAbility(ability);
} else {
addSubAbility(new ModularStaticAbility(amount));
}
}
代码示例来源:origin: magefree/mage
public EvokeAbility(Card card, String manaString) {
super(Zone.ALL, null);
name = EVOKE_KEYWORD;
this.addEvokeCost(manaString);
Ability ability = new ConditionalInterveningIfTriggeredAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceEffect()), EvokedCondition.instance, "Sacrifice {this} when it enters the battlefield and was evoked.");
ability.setRuleVisible(false);
addSubAbility(ability);
}
代码示例来源: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
public SagaAbility(Card card, SagaChapter maxChapter) {
super(Zone.ALL, new AddCountersSourceEffect(CounterType.LORE.createInstance()));
this.maxChapter = maxChapter;
this.setRuleVisible(false);
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LORE.createInstance()));
ability.setRuleVisible(false);
card.addAbility(ability);
}
代码示例来源:origin: magefree/mage
public OpalPalace(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.LAND},"");
// {T}: Add {C}.
this.addAbility(new ColorlessManaAbility());
// {1}, {tap}: Add one mana of any color in your commander's color identity. If you spend this mana to cast your commander, it enters the battlefield with a number of +1/+1 counters on it equal to the number of times it's been cast from the command zone this game.
Ability ability = new CommanderColorIdentityManaAbility(new GenericManaCost(1));
ability.addCost(new TapSourceCost());
this.addAbility(ability, new OpalPalaceWatcher(ability.getOriginalId().toString()));
ability = new SimpleStaticAbility(Zone.ALL, new OpalPalaceEntersBattlefieldEffect());
ability.setRuleVisible(false);
this.addAbility(ability);
}
代码示例来源:origin: magefree/mage
@Override
public boolean turnFaceUp(Game game, UUID playerId) {
GameEvent event = GameEvent.getEvent(GameEvent.EventType.TURNFACEUP, getId(), playerId);
if (!game.replaceEvent(event)) {
setFaceDown(false, game);
for (Ability ability : abilities) { // abilities that were set to not visible face down must be set to visible again
if (ability.getWorksFaceDown() && !ability.getRuleVisible()) {
ability.setRuleVisible(true);
}
}
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.TURNEDFACEUP, getId(), playerId));
return true;
}
return false;
}
代码示例来源:origin: magefree/mage
public BestowAbility(Card card, String manaString) {
super(new ManaCostsImpl(manaString), card.getName() + " using bestow");
this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE;
this.timing = TimingRule.SORCERY;
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.addTarget(auraTarget);
this.addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BestowEntersBattlefieldEffect());
ability.setRuleVisible(false);
addSubAbility(ability);
}
代码示例来源:origin: magefree/mage
public WaningWurm(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}");
this.subtype.add(SubType.ZOMBIE);
this.subtype.add(SubType.WURM);
this.power = new MageInt(7);
this.toughness = new MageInt(6);
// Vanishing 2
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(2)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(2));
this.addAbility(new VanishingSacrificeAbility());
}
代码示例来源:origin: magefree/mage
public Calciderm(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{W}");
this.subtype.add(SubType.BEAST);
this.power = new MageInt(5);
this.toughness = new MageInt(5);
// Shroud
this.addAbility(ShroudAbility.getInstance());
// Vanishing 4
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(4)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(4));
this.addAbility(new VanishingSacrificeAbility());
}
代码示例来源:origin: magefree/mage
public RekindledFlame(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}{R}");
// Rekindled Flame deals 4 damage to any target.
this.getSpellAbility().addEffect(new DamageTargetEffect(4));
this.getSpellAbility().addTarget(new TargetAnyTarget());
// At the beginning of your upkeep, if an opponent has no cards in hand, you may return Rekindled Flame from your graveyard to your hand.
Ability ability = new ConditionalInterveningIfTriggeredAbility(
new BeginningOfUpkeepTriggeredAbility(
Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), TargetController.YOU, true
),
new OpponentHasNoCardsInHandCondition(), rule);
ability.setRuleVisible(true);
this.addAbility(ability);
}
代码示例来源:origin: magefree/mage
public LostAuramancers(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.WIZARD);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Vanishing 3
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(3));
this.addAbility(new VanishingSacrificeAbility());
// When Lost Auramancers dies, if it had no time counters on it, you may search your library
// for an enchantment card and put it onto the battlefield. If you do, shuffle your library.
this.addAbility(new LostAuramancersAbility());
}
代码示例来源:origin: magefree/mage
public DeadwoodTreefolk(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{G}");
this.subtype.add(SubType.TREEFOLK);
this.power = new MageInt(3);
this.toughness = new MageInt(6);
// Vanishing 3
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(3));
this.addAbility(new VanishingSacrificeAbility());
// When Deadwood Treefolk enters the battlefield or leaves the battlefield, return another target creature card from your graveyard to your hand.
ability = new EntersBattlefieldOrLeavesSourceTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect(), false);
Target target = new TargetCardInYourGraveyard(filter);
ability.addTarget(target);
this.addAbility(ability);
}
代码示例来源:origin: magefree/mage
public RavagingRiftwurm(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{G}");
this.subtype.add(SubType.WURM);
this.power = new MageInt(6);
this.toughness = new MageInt(6);
// Kicker {4}
this.addAbility(new KickerAbility("{4}"));
// Vanishing 2
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(2)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(2));
this.addAbility(new VanishingSacrificeAbility());
// If Ravaging Riftwurm was kicked, it enters the battlefield with three additional time counters on it.
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)),
KickedCondition.instance, "If {this} was kicked, it enters the battlefield with three additional time counters on it.", ""));
}
代码示例来源:origin: magefree/mage
public KeldonMarauders(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.WARRIOR);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Vanishing 2
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(2)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(2));
this.addAbility(new VanishingSacrificeAbility());
// When Keldon Marauders enters the battlefield or leaves the battlefield, it deals 1 damage to target player.
ability = new EntersBattlefieldOrLeavesSourceTriggeredAbility(new DamageTargetEffect(1, "it"), false);
ability.addTarget(new TargetPlayerOrPlaneswalker());
this.addAbility(ability);
}
代码示例来源:origin: magefree/mage
public LavacoreElemental(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}");
this.subtype.add(SubType.ELEMENTAL);
this.power = new MageInt(5);
this.toughness = new MageInt(3);
// Vanishing 1
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(1)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(1));
this.addAbility(new VanishingSacrificeAbility());
// Whenever a creature you control deals combat damage to a player, put a time counter on Lavacore Elemental.
Effect effect = new AddCountersSourceEffect(CounterType.TIME.createInstance(1));
effect.setText("put a time counter on {this}");
this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(
effect,
new FilterControlledCreaturePermanent("a creature you control"), false, SetTargetPointer.PERMANENT, true
));
}
代码示例来源:origin: magefree/mage
public AvenRiftwatcher(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}");
this.subtype.add(SubType.BIRD);
this.subtype.add(SubType.REBEL);
this.subtype.add(SubType.SOLDIER);
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Vanishing 3
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(3));
this.addAbility(new VanishingSacrificeAbility());
// When Aven Riftwatcher enters the battlefield or leaves the battlefield, you gain 2 life.
this.addAbility(new EntersBattlefieldOrLeavesSourceTriggeredAbility(new GainLifeEffect(2), false));
}
代码示例来源:origin: magefree/mage
public DeadlyGrub(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
this.subtype.add(SubType.INSECT);
this.power = new MageInt(3);
this.toughness = new MageInt(1);
// Vanishing 3
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(3));
this.addAbility(new VanishingSacrificeAbility());
// When Deadly Grub dies, if it had no time counters on it, create a 6/1 green Insect creature token with shroud.
this.addAbility(new ConditionalInterveningIfTriggeredAbility(new DiesTriggeredAbility(new CreateTokenEffect(new DeadlyGrubToken(), 1)),
LastTimeCounterRemovedCondition.instance, "When {this} dies, if it had no time counters on it, create a 6/1 green Insect creature token with shroud."));
}
内容来源于网络,如有侵权,请联系作者删除!