-
Notifications
You must be signed in to change notification settings - Fork 799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DFT] Implement Custom Effect Cards #13407
base: master
Are you sure you want to change the base?
Conversation
add option to hide reminder text for exhaust ability
|
||
// Exhaust -- {G}, {T}: Add three mana of any one color. | ||
this.addAbility(new ExhaustAbility(new AddManaOfAnyColorEffect(3), | ||
new CompositeCost(new ManaCostsImpl<>("{G}"), new TapSourceCost(), "{G}, {T}"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
composite
this.addAbility(new ExhaustAbility(new DrawCardSourceControllerEffect(3), | ||
new CompositeCost(new ManaCostsImpl<>("{U}"), new TapSourceCost(), "{U}, {T}"),false)); | ||
// Exhaust -- {R}, {T}: Loot deals 3 damage to any target. | ||
this.addAbility(new ExhaustAbility(new DamageTargetEffect(3), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Miss target definition
// Exhaust -- {U}, {T}: Draw three cards. | ||
this.addAbility(new ExhaustAbility(new DrawCardSourceControllerEffect(3), | ||
new CompositeCost(new ManaCostsImpl<>("{U}"), new TapSourceCost(), "{U}, {T}"),false)); | ||
// Exhaust -- {R}, {T}: Loot deals 3 damage to any target. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For info: use empty line between abilities for better code style
// {2}, Sacrifice this enchantment: You gain life equal to your speed. | ||
Effect gainLifeEffect = new GainLifeEffect(ControllerSpeedCount.instance).setText("You gain life equal to your speed"); | ||
Ability ability = (new SimpleActivatedAbility(gainLifeEffect, | ||
new CompositeCost(new ManaCostsImpl<>("{2}"), new SacrificeSourceCost(), "{2}, Sacrifice this enchantment") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
composite
)); | ||
filter.add(new ControllerIdPredicate(opponent)); | ||
if (game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game).isEmpty()) { | ||
player.discard(1, false, false, source, game); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s wrong logic. There are effects that can “protect” from sacrificing like Sigarda, Host of Herons or Assault Suit. So player can have permanents but can’t sacrifice it.
There is no way to filter such permanents.
I recommend to use another code order:
- choose target for sacrifice (1 target require, not 0-1);
- try to sacrifice it;
- on fail make a discard.
There are possible some cheating for a players to choose “protected” permanent instead non-protected, but it’s ok (e.g. limitation of game engine).
|
||
controller.lookAtCards(targetPlayer.getName() + " Hand", targetPlayer.getHand(), game); | ||
TargetCard chosenCard = new TargetCardInHand(0, 1, new FilterCard("card to discard")); | ||
if (controller.choose(outcome, targetPlayer.getHand(), chosenCard, source, game)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outcome.Discard is better here, may help AI to choose most powerful card from opponent’s hand.
class RadiantLotusEffect extends OneShotEffect { | ||
|
||
public RadiantLotusEffect() { | ||
super(Outcome.Benefit); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend to add Outcome.AIDontUseIt - it will save AI from it. Card must be used for complex combos, but AI can’t work good with color and mana predicted abilities.
All other cards are fine here |
For #13033
This implements cards that have custom effects. This also adds a change to the Exhaust ability to remove reminder text on the rule. [[Loot, the Pathfinder]] has multiple exhaust abilities and the reminder text is unnecessary for all of them.