Merge branch 'epicRework' into 'master'

Epic rework

See merge request core-developers/forge!1018
This commit is contained in:
Michael Kamensky
2018-10-16 04:12:53 +00:00
2 changed files with 16 additions and 3 deletions

View File

@@ -167,7 +167,20 @@ public class CopySpellAbilityEffect extends SpellAbilityEffect {
"Select a spell to copy", ImmutableMap.of());
chosenSA.setActivatingPlayer(controller);
for (int i = 0; i < amount; i++) {
copies.add(CardFactory.copySpellAbilityAndPossiblyHost(card, chosenSA.getHostCard(), chosenSA, true));
SpellAbility copy = CardFactory.copySpellAbilityAndPossiblyHost(
card, chosenSA.getHostCard(), chosenSA, true);
// extra case for Epic to remove the keyword and the last part of the SpellAbility
if (sa.hasParam("Epic")) {
copy.getHostCard().removeIntrinsicKeyword("Epic");
SpellAbility sub = copy;
while (sub.getSubAbility() != null) {
sub = sub.getSubAbility();
}
sub.getParent().setSubAbility(null);
}
copies.add(copy);
}
}

View File

@@ -3746,14 +3746,14 @@ public class CardFactoryUtil {
// Epic does modify existing SA, and does not add new one
// Add the Epic effect as a subAbility
String dbStr = "DB$ Effect | Triggers$ EpicTrigger | SVars$ EpicCopy | StaticAbilities$ EpicCantBeCast | Duration$ Permanent | Unique$ True";
String dbStr = "DB$ Effect | Triggers$ EpicTrigger | SVars$ EpicCopy | StaticAbilities$ EpicCantBeCast | Duration$ Permanent";
final AbilitySub newSA = (AbilitySub) AbilityFactory.getAbility(dbStr.toString(), card);
card.setSVar("EpicCantBeCast", "Mode$ CantBeCast | ValidCard$ Card | Caster$ You | EffectZone$ Command | Description$ For the rest of the game, you can't cast spells.");
card.setSVar("EpicTrigger", "Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ EpicCopy | TriggerDescription$ "
+ "At the beginning of each of your upkeeps, copy " + card.toString() + " except for its epic ability.");
card.setSVar("EpicCopy", "DB$ CopySpellAbility | Defined$ EffectSource");
card.setSVar("EpicCopy", "DB$ CopySpellAbility | Defined$ EffectSource | Epic$ True");
final SpellAbility origSA = card.getFirstSpellAbility();