Merge branch 'adaptReduceCost' into 'master'

Adapt: add ReduceCost for Pteramander

See merge request core-developers/forge!1267
This commit is contained in:
swordshine
2019-01-12 07:49:50 +00:00
3 changed files with 22 additions and 1 deletions

View File

@@ -3703,12 +3703,24 @@ public class CardFactoryUtil {
final String[] k = keyword.split(":"); final String[] k = keyword.split(":");
final String magnitude = k[1]; final String magnitude = k[1];
final String manacost = k[2]; final String manacost = k[2];
final String reduceCost = k.length > 3 ? k[3] : null;
Set<String> references = Sets.newHashSet();
String desc = "Adapt " + magnitude; String desc = "Adapt " + magnitude;
String effect = "AB$ PutCounter | Cost$ " + manacost + " | Adapt$ True | CounterNum$ " + magnitude String effect = "AB$ PutCounter | Cost$ " + manacost + " | Adapt$ True | CounterNum$ " + magnitude
+ " | CounterType$ P1P1 | StackDescription$ SpellDescription"; + " | CounterType$ P1P1 | StackDescription$ SpellDescription";
if (reduceCost != null) {
effect += "| ReduceCost$ " + reduceCost;
references.add(reduceCost);
desc += ". This ability costs {1} less to activate for each instant and sorcery card in your graveyard.";
}
if (!references.isEmpty()) {
effect += "| References$ " + TextUtil.join(references, ",");
}
effect += "| SpellDescription$ " + desc + " (" + inst.getReminderText() + ")"; effect += "| SpellDescription$ " + desc + " (" + inst.getReminderText() + ")";
final SpellAbility sa = AbilityFactory.getAbility(effect, card); final SpellAbility sa = AbilityFactory.getAbility(effect, card);

View File

@@ -0,0 +1,9 @@
Name:Pteramander
ManaCost:U
Types:Creature Salamander Drake
PT:1/1
K:Flying
K:Adapt:4:7 U:X
SVar:X:Count$ValidGraveyard Instant.YouOwn,Sorcery.YouOwn
DeckHas:Ability$Counters
Oracle:Flying\n{7}{U}: Adapt 4. This ability costs {1} less to activate for each instant and sorcery card in your graveyard. (If this creature has no +1/+1 counters on it, put four +1/+1 counters on it.)

View File

@@ -33,7 +33,7 @@ public class InputSelectEntitiesFromList<T extends GameEntity> extends InputSele
if (min > validChoices.size()) { if (min > validChoices.size()) {
System.out.println(String.format("Trying to choose at least %d things from a list with only %d things!", min, validChoices.size())); System.out.println(String.format("Trying to choose at least %d things from a list with only %d things!", min, validChoices.size()));
} }
PlayerZoneUpdates zonesToUpdate = new PlayerZoneUpdates(); final PlayerZoneUpdates zonesToUpdate = new PlayerZoneUpdates();
for (final GameEntity c : validChoices) { for (final GameEntity c : validChoices) {
final Zone cz = (c instanceof Card) ? ((Card) c).getZone() : null ; final Zone cz = (c instanceof Card) ? ((Card) c).getZone() : null ;
zonesToUpdate.add(new PlayerZoneUpdate(cz.getPlayer().getView(),cz.getZoneType())); zonesToUpdate.add(new PlayerZoneUpdate(cz.getPlayer().getView(),cz.getZoneType()));