updated Heart of Kiran text generation

This commit is contained in:
Evan Kranzler 2022-02-19 17:42:19 -05:00
parent 4868afe0e0
commit 3f37b5aa76
2 changed files with 10 additions and 11 deletions

View file

@ -1,9 +1,7 @@
package mage.cards.h; package mage.cards.h;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.RemoveCounterCost; import mage.abilities.costs.common.RemoveCounterCost;
import mage.abilities.effects.common.InfoEffect;
import mage.abilities.keyword.CrewAbility; import mage.abilities.keyword.CrewAbility;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.VigilanceAbility; import mage.abilities.keyword.VigilanceAbility;
@ -12,7 +10,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.SuperType; import mage.constants.SuperType;
import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetControlledPermanent;
@ -39,18 +36,13 @@ public final class HeartOfKiran extends CardImpl {
this.addAbility(VigilanceAbility.getInstance()); this.addAbility(VigilanceAbility.getInstance());
// Crew 3 // Crew 3
// You may remove a loyalty counter from a planeswalker you control rather than pay Heart of Kiran's crew cost.
this.addAbility(new CrewAbility( this.addAbility(new CrewAbility(
3, 3,
new RemoveCounterCost(new TargetControlledPermanent( new RemoveCounterCost(new TargetControlledPermanent(
StaticFilters.FILTER_CONTROLLED_PERMANENT_PLANESWALKER StaticFilters.FILTER_CONTROLLED_PERMANENT_PLANESWALKER
), CounterType.LOYALTY) ), CounterType.LOYALTY)
)); ));
// You may remove a loyalty counter from a planeswalker you control rather than pay Heart of Kiran's crew cost.
this.addAbility(new SimpleStaticAbility(
Zone.ALL, new InfoEffect("you may remove a loyalty counter " +
"from a planeswalker you control rather than pay {this}'s crew cost")
));
} }
private HeartOfKiran(final HeartOfKiran card) { private HeartOfKiran(final HeartOfKiran card) {

View file

@ -4,9 +4,11 @@ import mage.abilities.Ability;
import mage.abilities.common.CrewIncreasedPowerAbility; import mage.abilities.common.CrewIncreasedPowerAbility;
import mage.abilities.common.CrewWithToughnessAbility; import mage.abilities.common.CrewWithToughnessAbility;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.Cost; import mage.abilities.costs.Cost;
import mage.abilities.costs.CostImpl; import mage.abilities.costs.CostImpl;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.InfoEffect;
import mage.abilities.effects.common.continuous.AddCardTypeSourceEffect; import mage.abilities.effects.common.continuous.AddCardTypeSourceEffect;
import mage.abilities.hint.HintUtils; import mage.abilities.hint.HintUtils;
import mage.abilities.icon.abilities.CrewAbilityIcon; import mage.abilities.icon.abilities.CrewAbilityIcon;
@ -47,6 +49,12 @@ public class CrewAbility extends SimpleActivatedAbility {
this.addEffect(new CrewEventEffect()); this.addEffect(new CrewEventEffect());
this.addIcon(CrewAbilityIcon.instance); this.addIcon(CrewAbilityIcon.instance);
this.value = value; this.value = value;
if (altCost != null) {
this.addSubAbility(new SimpleStaticAbility(Zone.ALL, new InfoEffect(
"you may " + CardUtil.addCostVerb(altCost.getText())
+ " rather than pay {this}'s crew cost"
)));
}
} }
public CrewAbility(final CrewAbility ability) { public CrewAbility(final CrewAbility ability) {
@ -123,9 +131,8 @@ class CrewCost extends CostImpl {
return false; return false;
} }
Player player = game.getPlayer(controllerId); Player player = game.getPlayer(controllerId);
String costName = altCost.getText();
String message = CardUtil.getTextWithFirstCharUpperCase( String message = CardUtil.getTextWithFirstCharUpperCase(
(CardUtil.checkCostWords(costName) ? "" : "Pay ") + costName CardUtil.addCostVerb(altCost.getText())
) + " rather than the crew cost?"; ) + " rather than the crew cost?";
return player != null return player != null
&& player.chooseUse(Outcome.Benefit, message, source, game) && player.chooseUse(Outcome.Benefit, message, source, game)