public static String destroyAllStackDescription( final AbilityFactory af, SpellAbility sa, boolean noRegen) { // when getStackDesc is called, just build exactly what is happening StringBuilder sb = new StringBuilder(); String name = af.getHostCard().getName(); String conditionDesc = af.getMapParams().get("ConditionDescription"); if (conditionDesc != null) sb.append(conditionDesc).append(" "); ArrayList<Card> tgtCards; Target tgt = af.getAbTgt(); if (tgt != null) tgtCards = tgt.getTargetCards(); else { tgtCards = new ArrayList<Card>(); tgtCards.add(sa.getSourceCard()); } sb.append(name).append(" - Destroy permanents"); if (noRegen) sb.append(". They can't be regenerated"); Ability_Sub abSub = sa.getSubAbility(); if (abSub != null) { sb.append(abSub.getStackDescription()); } return sb.toString(); }
private static String destroyStackDescription(final AbilityFactory af, SpellAbility sa) { final boolean noRegen = af.getMapParams().containsKey("NoRegen"); StringBuilder sb = new StringBuilder(); Card host = af.getHostCard(); String conditionDesc = af.getMapParams().get("ConditionDescription"); if (conditionDesc != null) sb.append(conditionDesc).append(" "); ArrayList<Card> tgtCards; Target tgt = af.getAbTgt(); if (tgt != null) tgtCards = tgt.getTargetCards(); else { tgtCards = AbilityFactory.getDefinedCards(sa.getSourceCard(), af.getMapParams().get("Defined"), sa); } if (sa instanceof Ability_Sub) sb.append(" "); else sb.append(host).append(" - "); sb.append("Destroy "); Iterator<Card> it = tgtCards.iterator(); while (it.hasNext()) { Card tgtC = it.next(); if (tgtC.isFaceDown()) sb.append("Morph ").append("(").append(tgtC.getUniqueNumber()).append(")"); else sb.append(tgtC); if (it.hasNext()) sb.append(", "); } if (noRegen) { sb.append(". "); if (tgtCards.size() == 1) sb.append("It"); else sb.append("They"); sb.append(" can't be regenerated"); } sb.append("."); Ability_Sub abSub = sa.getSubAbility(); if (abSub != null) { sb.append(abSub.getStackDescription()); } return sb.toString(); }