mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Converted Fading to script (now can be stifled and copied by Strionic Resonator)
This commit is contained in:
@@ -2206,6 +2206,19 @@ public class CardFactoryUtil {
|
||||
final String[] k = card.getKeyword().get(n).split(":");
|
||||
|
||||
card.addIntrinsicKeyword("etbCounter:FADE:" + k[1] + ":no Condition:no desc");
|
||||
|
||||
String upkeepTrig = "Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield " +
|
||||
" | Execute$ TrigUpkeepFading | Secondary$ True | TriggerDescription$ At the beginning of " +
|
||||
"your upkeep, remove a fade counter from CARDNAME. If you can't, sacrifice CARDNAME.";
|
||||
|
||||
card.setSVar("TrigUpkeepFading", "AB$ RemoveCounter | Cost$ 0 | Defined$ Self | CounterType$ FADE" +
|
||||
" | CounterNum$ 1 | RememberRemoved$ True | SubAbility$ DBUpkeepFadingSac");
|
||||
card.setSVar("DBUpkeepFadingSac","DB$ Sacrifice | SacValid$ Self | ConditionCheckSVar$ FadingCheckSVar" +
|
||||
" | ConditionSVarCompare$ EQ0 | References$ FadingCheckSVar | SubAbility$ FadingCleanup");
|
||||
card.setSVar("FadingCleanup","DB$ Cleanup | ClearRemembered$ True");
|
||||
card.setSVar("FadingCheckSVar","Count$RememberedSize");
|
||||
final Trigger parsedUpkeepTrig = TriggerHandler.parseTrigger(upkeepTrig, card, true);
|
||||
card.addTrigger(parsedUpkeepTrig);
|
||||
}
|
||||
} // Fading
|
||||
|
||||
|
||||
@@ -95,7 +95,6 @@ public class Upkeep extends Phase {
|
||||
Upkeep.upkeepOathOfDruids(game);
|
||||
Upkeep.upkeepOathOfGhouls(game);
|
||||
Upkeep.upkeepVanishing(game);
|
||||
Upkeep.upkeepFading(game);
|
||||
Upkeep.upkeepBlazeCounters(game);
|
||||
Upkeep.upkeepPowerSurge(game);
|
||||
|
||||
@@ -424,49 +423,6 @@ public class Upkeep extends Phase {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* upkeepFading.
|
||||
* </p>
|
||||
*/
|
||||
private static void upkeepFading(final Game game) {
|
||||
|
||||
final Player player = game.getPhaseHandler().getPlayerTurn();
|
||||
List<Card> list = player.getCardsIn(ZoneType.Battlefield);
|
||||
list = CardLists.filter(list, new Predicate<Card>() {
|
||||
@Override
|
||||
public boolean apply(final Card c) {
|
||||
return CardFactoryUtil.hasKeyword(c, "Fading") != -1;
|
||||
}
|
||||
});
|
||||
if (list.size() > 0) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
final Card card = list.get(i);
|
||||
final Ability ability = new Ability(card, ManaCost.ZERO) {
|
||||
@Override
|
||||
public void resolve() {
|
||||
final int fadeCounters = card.getCounters(CounterType.FADE);
|
||||
if (fadeCounters <= 0) {
|
||||
game.getAction().sacrifice(card, null);
|
||||
} else {
|
||||
card.subtractCounter(CounterType.FADE, 1);
|
||||
}
|
||||
}
|
||||
}; // ability
|
||||
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append(card.getName()).append(" - Fading - remove a fade counter from it. ");
|
||||
sb.append("If you can't, sacrifice it.)");
|
||||
ability.setStackDescription(sb.toString());
|
||||
ability.setDescription(sb.toString());
|
||||
ability.setActivatingPlayer(card.getController());
|
||||
|
||||
game.getStack().addSimultaneousStackEntry(ability);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* upkeepOathOfDruids.
|
||||
|
||||
Reference in New Issue
Block a user