mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
- CheckStyle.
This commit is contained in:
@@ -440,7 +440,7 @@ public class ChangeZoneEffect extends SpellEffect {
|
|||||||
tgtC.clearUnEnchantCommand();
|
tgtC.clearUnEnchantCommand();
|
||||||
}
|
}
|
||||||
tgtC.enchantEntity(attachedTo);
|
tgtC.enchantEntity(attachedTo);
|
||||||
} else {// When it should enter the battlefield attached to an illegal permanent it fails
|
} else { // When it should enter the battlefield attached to an illegal permanent it fails
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,16 +13,16 @@ import forge.card.spellability.Target;
|
|||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.zone.ZoneType;
|
import forge.game.zone.ZoneType;
|
||||||
|
|
||||||
public class CountersPutAllEffect extends SpellEffect {
|
public class CountersPutAllEffect extends SpellEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getStackDescription(SpellAbility sa) {
|
protected String getStackDescription(SpellAbility sa) {
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
final Counters cType = Counters.valueOf(sa.getParam("CounterType"));
|
final Counters cType = Counters.valueOf(sa.getParam("CounterType"));
|
||||||
final int amount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("CounterNum"), sa);
|
final int amount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("CounterNum"), sa);
|
||||||
final String zone = sa.hasParam("ValidZone") ? sa.getParam("ValidZone") : "Battlefield";
|
final String zone = sa.hasParam("ValidZone") ? sa.getParam("ValidZone") : "Battlefield";
|
||||||
|
|
||||||
sb.append("Put ").append(amount).append(" ").append(cType.getName()).append(" counter");
|
sb.append("Put ").append(amount).append(" ").append(cType.getName()).append(" counter");
|
||||||
if (amount != 1) {
|
if (amount != 1) {
|
||||||
sb.append("s");
|
sb.append("s");
|
||||||
@@ -33,7 +33,7 @@ public class CountersPutAllEffect extends SpellEffect {
|
|||||||
} else {
|
} else {
|
||||||
sb.append("card in ").append(zone).append(".");
|
sb.append("card in ").append(zone).append(".");
|
||||||
}
|
}
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,4 +63,4 @@ public class CountersPutAllEffect extends SpellEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class CountersPutEffect extends SpellEffect {
|
|||||||
protected String getStackDescription(SpellAbility sa) {
|
protected String getStackDescription(SpellAbility sa) {
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
final Card card = sa.getSourceCard();
|
final Card card = sa.getSourceCard();
|
||||||
|
|
||||||
|
|
||||||
final Counters cType = Counters.valueOf(sa.getParam("CounterType"));
|
final Counters cType = Counters.valueOf(sa.getParam("CounterType"));
|
||||||
final int amount = AbilityFactory.calculateAmount(card, sa.getParam("CounterNum"), sa);
|
final int amount = AbilityFactory.calculateAmount(card, sa.getParam("CounterNum"), sa);
|
||||||
@@ -50,7 +50,7 @@ public class CountersPutEffect extends SpellEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
sb.append(".");
|
sb.append(".");
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,4 +101,4 @@ public class CountersPutEffect extends SpellEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import forge.card.spellability.Target;
|
|||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.zone.ZoneType;
|
import forge.game.zone.ZoneType;
|
||||||
|
|
||||||
public class CountersRemoveAllEffect extends SpellEffect {
|
public class CountersRemoveAllEffect extends SpellEffect {
|
||||||
@Override
|
@Override
|
||||||
protected String getStackDescription(SpellAbility sa) {
|
protected String getStackDescription(SpellAbility sa) {
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
@@ -22,11 +22,11 @@ public class CountersRemoveAllEffect extends SpellEffect {
|
|||||||
final int amount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("CounterNum"), sa);
|
final int amount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("CounterNum"), sa);
|
||||||
final String zone = sa.hasParam("ValidZone") ? sa.getParam("ValidZone") : "Battlefield";
|
final String zone = sa.hasParam("ValidZone") ? sa.getParam("ValidZone") : "Battlefield";
|
||||||
String amountString = Integer.toString(amount);
|
String amountString = Integer.toString(amount);
|
||||||
|
|
||||||
if (sa.hasParam("AllCounters")) {
|
if (sa.hasParam("AllCounters")) {
|
||||||
amountString = "all";
|
amountString = "all";
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.append("Remove ").append(amount).append(" ").append(cType.getName()).append(" counter");
|
sb.append("Remove ").append(amount).append(" ").append(cType.getName()).append(" counter");
|
||||||
if (!amountString.equals("1")) {
|
if (!amountString.equals("1")) {
|
||||||
sb.append("s");
|
sb.append("s");
|
||||||
@@ -65,4 +65,4 @@ public class CountersRemoveAllEffect extends SpellEffect {
|
|||||||
tgtCard.subtractCounter(Counters.valueOf(type), counterAmount);
|
tgtCard.subtractCounter(Counters.valueOf(type), counterAmount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,12 +22,11 @@ public class DamageAllEffect extends SpellEffect {
|
|||||||
if (sa.hasParam("ValidDescription")) {
|
if (sa.hasParam("ValidDescription")) {
|
||||||
desc = sa.getParam("ValidDescription");
|
desc = sa.getParam("ValidDescription");
|
||||||
}
|
}
|
||||||
|
|
||||||
final String damage = sa.getParam("NumDmg");
|
|
||||||
final int dmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa);
|
|
||||||
|
|
||||||
|
|
||||||
|
final String damage = sa.getParam("NumDmg");
|
||||||
|
final int dmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa);
|
||||||
|
|
||||||
|
|
||||||
final ArrayList<Card> definedSources = AbilityFactory.getDefinedCards(sa.getSourceCard(), sa.getParam("DamageSource"), sa);
|
final ArrayList<Card> definedSources = AbilityFactory.getDefinedCards(sa.getSourceCard(), sa.getParam("DamageSource"), sa);
|
||||||
final Card source = definedSources.get(0);
|
final Card source = definedSources.get(0);
|
||||||
|
|
||||||
@@ -50,7 +49,7 @@ public class DamageAllEffect extends SpellEffect {
|
|||||||
final Card source = sa.getSourceCard();
|
final Card source = sa.getSourceCard();
|
||||||
|
|
||||||
final String damage = sa.getParam("NumDmg");
|
final String damage = sa.getParam("NumDmg");
|
||||||
final int dmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa);
|
final int dmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa);
|
||||||
|
|
||||||
final Target tgt = sa.getTarget();
|
final Target tgt = sa.getTarget();
|
||||||
Player targetPlayer = null;
|
Player targetPlayer = null;
|
||||||
@@ -90,4 +89,4 @@ public class DamageAllEffect extends SpellEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class DamageDealEffect extends SpellEffect {
|
|||||||
// when damageStackDescription is called, just build exactly what is happening
|
// when damageStackDescription is called, just build exactly what is happening
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
final String damage = sa.getParam("NumDmg");
|
final String damage = sa.getParam("NumDmg");
|
||||||
final int dmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa);
|
final int dmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa);
|
||||||
|
|
||||||
|
|
||||||
List<Object> tgts = getTargetObjects(sa);
|
List<Object> tgts = getTargetObjects(sa);
|
||||||
@@ -42,11 +42,11 @@ public class DamageDealEffect extends SpellEffect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append(" ").append(dmg).append(" damage ");
|
sb.append(" ").append(dmg).append(" damage ");
|
||||||
|
|
||||||
if (sa.hasParam("DivideEvenly")) {
|
if (sa.hasParam("DivideEvenly")) {
|
||||||
sb.append("divided evenly (rounded down) ");
|
sb.append("divided evenly (rounded down) ");
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.append("to");
|
sb.append("to");
|
||||||
|
|
||||||
for (int i = 0; i < tgts.size(); i++) {
|
for (int i = 0; i < tgts.size(); i++) {
|
||||||
@@ -78,7 +78,7 @@ public class DamageDealEffect extends SpellEffect {
|
|||||||
@Override
|
@Override
|
||||||
public void resolve(SpellAbility sa) {
|
public void resolve(SpellAbility sa) {
|
||||||
final String damage = sa.getParam("NumDmg");
|
final String damage = sa.getParam("NumDmg");
|
||||||
int dmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa);
|
int dmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa);
|
||||||
|
|
||||||
final boolean noPrevention = sa.hasParam("NoPrevention");
|
final boolean noPrevention = sa.hasParam("NoPrevention");
|
||||||
final boolean combatDmg = sa.hasParam("CombatDamage");
|
final boolean combatDmg = sa.hasParam("CombatDamage");
|
||||||
@@ -154,4 +154,4 @@ public class DamageDealEffect extends SpellEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import forge.game.player.Player;
|
|||||||
import forge.game.zone.ZoneType;
|
import forge.game.zone.ZoneType;
|
||||||
|
|
||||||
public class DamageEachEffect extends SpellEffect {
|
public class DamageEachEffect extends SpellEffect {
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility)
|
* @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility)
|
||||||
*/
|
*/
|
||||||
@@ -22,20 +22,20 @@ public class DamageEachEffect extends SpellEffect {
|
|||||||
protected String getStackDescription(SpellAbility sa) {
|
protected String getStackDescription(SpellAbility sa) {
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
final String damage = sa.getParam("NumDmg");
|
final String damage = sa.getParam("NumDmg");
|
||||||
final int iDmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa);
|
final int iDmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa);
|
||||||
|
|
||||||
String desc = sa.getParam("ValidCards");
|
String desc = sa.getParam("ValidCards");
|
||||||
if (sa.hasParam("ValidDescription")) {
|
if (sa.hasParam("ValidDescription")) {
|
||||||
desc = sa.getParam("ValidDescription");
|
desc = sa.getParam("ValidDescription");
|
||||||
}
|
}
|
||||||
|
|
||||||
String dmg = "";
|
String dmg = "";
|
||||||
if (sa.hasParam("DamageDesc")) {
|
if (sa.hasParam("DamageDesc")) {
|
||||||
dmg = sa.getParam("DamageDesc");
|
dmg = sa.getParam("DamageDesc");
|
||||||
} else {
|
} else {
|
||||||
dmg += iDmg + " damage";
|
dmg += iDmg + " damage";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sa.hasParam("StackDescription")) {
|
if (sa.hasParam("StackDescription")) {
|
||||||
sb.append(sa.getParam("StackDescription"));
|
sb.append(sa.getParam("StackDescription"));
|
||||||
} else {
|
} else {
|
||||||
@@ -53,7 +53,7 @@ public class DamageEachEffect extends SpellEffect {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see forge.card.abilityfactory.SpellEffect#resolve(java.util.Map, forge.card.spellability.SpellAbility)
|
* @see forge.card.abilityfactory.SpellEffect#resolve(java.util.Map, forge.card.spellability.SpellAbility)
|
||||||
*/
|
*/
|
||||||
@@ -117,4 +117,4 @@ public class DamageEachEffect extends SpellEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import forge.game.player.Player;
|
|||||||
import forge.game.zone.ZoneType;
|
import forge.game.zone.ZoneType;
|
||||||
|
|
||||||
public class DamagePreventAllEffect extends SpellEffect {
|
public class DamagePreventAllEffect extends SpellEffect {
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see forge.card.abilityfactory.SpellEffect#resolve(java.util.Map, forge.card.spellability.SpellAbility)
|
* @see forge.card.abilityfactory.SpellEffect#resolve(java.util.Map, forge.card.spellability.SpellAbility)
|
||||||
*/
|
*/
|
||||||
@@ -52,13 +52,13 @@ public class DamagePreventAllEffect extends SpellEffect {
|
|||||||
protected String getStackDescription(SpellAbility sa) {
|
protected String getStackDescription(SpellAbility sa) {
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
String desc = sa.getDescription();
|
String desc = sa.getDescription();
|
||||||
|
|
||||||
if (desc.contains(":")) {
|
if (desc.contains(":")) {
|
||||||
desc = desc.split(":")[1];
|
desc = desc.split(":")[1];
|
||||||
}
|
}
|
||||||
sb.append(desc);
|
sb.append(desc);
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ import forge.card.abilityfactory.SpellEffect;
|
|||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
|
|
||||||
public class DamagePreventEffect extends SpellEffect
|
public class DamagePreventEffect extends SpellEffect {
|
||||||
{
|
|
||||||
@Override
|
@Override
|
||||||
protected String getStackDescription(SpellAbility sa) {
|
protected String getStackDescription(SpellAbility sa) {
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
final List<Object> tgts = getTargetObjects(sa);
|
final List<Object> tgts = getTargetObjects(sa);
|
||||||
|
|
||||||
sb.append("Prevent the next ");
|
sb.append("Prevent the next ");
|
||||||
@@ -25,7 +25,7 @@ public class DamagePreventEffect extends SpellEffect
|
|||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
sb.append(" ");
|
sb.append(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
final Object o = tgts.get(i);
|
final Object o = tgts.get(i);
|
||||||
if (o instanceof Card) {
|
if (o instanceof Card) {
|
||||||
final Card tgtC = (Card) o;
|
final Card tgtC = (Card) o;
|
||||||
@@ -38,7 +38,7 @@ public class DamagePreventEffect extends SpellEffect
|
|||||||
sb.append(o.toString());
|
sb.append(o.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sa.hasParam("Radiance") && (sa.getTarget() != null)) {
|
if (sa.hasParam("Radiance") && (sa.getTarget() != null)) {
|
||||||
sb.append(" and each other ").append(sa.getParam("ValidTgts"))
|
sb.append(" and each other ").append(sa.getParam("ValidTgts"))
|
||||||
.append(" that shares a color with ");
|
.append(" that shares a color with ");
|
||||||
@@ -107,4 +107,4 @@ public class DamagePreventEffect extends SpellEffect
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // preventDamageResolve
|
} // preventDamageResolve
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import forge.card.spellability.SpellAbility;
|
|||||||
import forge.game.zone.ZoneType;
|
import forge.game.zone.ZoneType;
|
||||||
|
|
||||||
public class DebuffAllEffect extends SpellEffect {
|
public class DebuffAllEffect extends SpellEffect {
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility)
|
* @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility)
|
||||||
*/
|
*/
|
||||||
@@ -35,21 +35,21 @@ public class DebuffAllEffect extends SpellEffect {
|
|||||||
* @param af
|
* @param af
|
||||||
* a {@link forge.card.abilityfactory.AbilityFactory} object.
|
* a {@link forge.card.abilityfactory.AbilityFactory} object.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve(SpellAbility sa) {
|
public void resolve(SpellAbility sa) {
|
||||||
final Card hostCard = sa.getSourceCard();
|
final Card hostCard = sa.getSourceCard();
|
||||||
final List<String> kws = sa.hasParam("Keywords") ? Arrays.asList(sa.getParam("Keywords").split(" & ")) : new ArrayList<String>();
|
final List<String> kws = sa.hasParam("Keywords") ? Arrays.asList(sa.getParam("Keywords").split(" & ")) : new ArrayList<String>();
|
||||||
|
|
||||||
String valid = "";
|
String valid = "";
|
||||||
|
|
||||||
if (sa.hasParam("ValidCards")) {
|
if (sa.hasParam("ValidCards")) {
|
||||||
valid = sa.getParam("ValidCards");
|
valid = sa.getParam("ValidCards");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Card> list = Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield);
|
List<Card> list = Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield);
|
||||||
list = CardLists.getValidCards(list, valid.split(","), hostCard.getController(), hostCard);
|
list = CardLists.getValidCards(list, valid.split(","), hostCard.getController(), hostCard);
|
||||||
|
|
||||||
for (final Card tgtC : list) {
|
for (final Card tgtC : list) {
|
||||||
final ArrayList<String> hadIntrinsic = new ArrayList<String>();
|
final ArrayList<String> hadIntrinsic = new ArrayList<String>();
|
||||||
if (tgtC.isInPlay() && tgtC.canBeTargetedBy(sa)) {
|
if (tgtC.isInPlay() && tgtC.canBeTargetedBy(sa)) {
|
||||||
@@ -64,7 +64,7 @@ public class DebuffAllEffect extends SpellEffect {
|
|||||||
if (!sa.hasParam("Permanent")) {
|
if (!sa.hasParam("Permanent")) {
|
||||||
Singletons.getModel().getGame().getEndOfTurn().addUntil(new Command() {
|
Singletons.getModel().getGame().getEndOfTurn().addUntil(new Command() {
|
||||||
private static final long serialVersionUID = 7486231071095628674L;
|
private static final long serialVersionUID = 7486231071095628674L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if (tgtC.isInPlay()) {
|
if (tgtC.isInPlay()) {
|
||||||
@@ -78,4 +78,4 @@ public class DebuffAllEffect extends SpellEffect {
|
|||||||
}
|
}
|
||||||
} // debuffAllResolve()
|
} // debuffAllResolve()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,18 +12,18 @@ import forge.card.abilityfactory.SpellEffect;
|
|||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
|
|
||||||
public class DebuffEffect extends SpellEffect {
|
public class DebuffEffect extends SpellEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getStackDescription(SpellAbility sa) {
|
protected String getStackDescription(SpellAbility sa) {
|
||||||
final List<String> kws = sa.hasParam("Keywords") ? Arrays.asList(sa.getParam("Keywords").split(" & ")) : new ArrayList<String>();
|
final List<String> kws = sa.hasParam("Keywords") ? Arrays.asList(sa.getParam("Keywords").split(" & ")) : new ArrayList<String>();
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
final List<Card> tgtCards = getTargetCards(sa);
|
final List<Card> tgtCards = getTargetCards(sa);
|
||||||
|
|
||||||
|
|
||||||
if (tgtCards.size() > 0) {
|
if (tgtCards.size() > 0) {
|
||||||
|
|
||||||
|
|
||||||
final Iterator<Card> it = tgtCards.iterator();
|
final Iterator<Card> it = tgtCards.iterator();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
final Card tgtC = it.next();
|
final Card tgtC = it.next();
|
||||||
@@ -32,7 +32,7 @@ public class DebuffEffect extends SpellEffect {
|
|||||||
} else {
|
} else {
|
||||||
sb.append(tgtC);
|
sb.append(tgtC);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (it.hasNext()) {
|
if (it.hasNext()) {
|
||||||
sb.append(" ");
|
sb.append(" ");
|
||||||
}
|
}
|
||||||
@@ -86,4 +86,4 @@ public class DebuffEffect extends SpellEffect {
|
|||||||
|
|
||||||
} // debuffResolve
|
} // debuffResolve
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import forge.card.trigger.Trigger;
|
|||||||
import forge.card.trigger.TriggerHandler;
|
import forge.card.trigger.TriggerHandler;
|
||||||
|
|
||||||
public class DelayedTriggerEffect extends SpellEffect {
|
public class DelayedTriggerEffect extends SpellEffect {
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see forge.card.abilityfactory.SpellEffect#resolve(java.util.Map, forge.card.spellability.SpellAbility)
|
* @see forge.card.abilityfactory.SpellEffect#resolve(java.util.Map, forge.card.spellability.SpellAbility)
|
||||||
*/
|
*/
|
||||||
@@ -27,7 +27,7 @@ public class DelayedTriggerEffect extends SpellEffect {
|
|||||||
@Override
|
@Override
|
||||||
public void resolve(SpellAbility sa) {
|
public void resolve(SpellAbility sa) {
|
||||||
|
|
||||||
Map<String, String> mapParams = new HashMap<String, String>();
|
Map<String, String> mapParams = new HashMap<String, String>();
|
||||||
sa.copyParamsToMap(mapParams);
|
sa.copyParamsToMap(mapParams);
|
||||||
if (mapParams.containsKey("Cost")) {
|
if (mapParams.containsKey("Cost")) {
|
||||||
mapParams.remove("Cost");
|
mapParams.remove("Cost");
|
||||||
@@ -42,4 +42,4 @@ public class DelayedTriggerEffect extends SpellEffect {
|
|||||||
|
|
||||||
Singletons.getModel().getGame().getTriggerHandler().registerDelayedTrigger(delTrig);
|
Singletons.getModel().getGame().getTriggerHandler().registerDelayedTrigger(delTrig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,13 +14,13 @@ import forge.game.player.Player;
|
|||||||
import forge.game.zone.ZoneType;
|
import forge.game.zone.ZoneType;
|
||||||
|
|
||||||
public class DestroyAllEffect extends SpellEffect {
|
public class DestroyAllEffect extends SpellEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getStackDescription(SpellAbility sa) {
|
protected String getStackDescription(SpellAbility sa) {
|
||||||
|
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
final boolean noRegen = sa.hasParam("NoRegen");
|
final boolean noRegen = sa.hasParam("NoRegen");
|
||||||
|
|
||||||
|
|
||||||
final String conditionDesc = sa.getParam("ConditionDescription");
|
final String conditionDesc = sa.getParam("ConditionDescription");
|
||||||
if (conditionDesc != null) {
|
if (conditionDesc != null) {
|
||||||
@@ -51,7 +51,7 @@ public class DestroyAllEffect extends SpellEffect {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void resolve(SpellAbility sa) {
|
public void resolve(SpellAbility sa) {
|
||||||
|
|
||||||
final boolean noRegen = sa.hasParam("NoRegen");
|
final boolean noRegen = sa.hasParam("NoRegen");
|
||||||
final Card card = sa.getSourceCard();
|
final Card card = sa.getSourceCard();
|
||||||
|
|
||||||
@@ -106,4 +106,4 @@ public class DestroyAllEffect extends SpellEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,4 +132,4 @@ public class DestroyEffect extends SpellEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,15 +21,14 @@ import forge.game.zone.ZoneType;
|
|||||||
import forge.gui.GuiChoose;
|
import forge.gui.GuiChoose;
|
||||||
|
|
||||||
public class DigEffect extends SpellEffect {
|
public class DigEffect extends SpellEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getStackDescription(SpellAbility sa) {
|
protected String getStackDescription(SpellAbility sa) {
|
||||||
final Card host = sa.getSourceCard();
|
final Card host = sa.getSourceCard();
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
final int numToDig = AbilityFactory.calculateAmount(host, sa.getParam("DigNum"), sa);
|
final int numToDig = AbilityFactory.calculateAmount(host, sa.getParam("DigNum"), sa);
|
||||||
final List<Player> tgtPlayers = getTargetPlayers(sa);
|
final List<Player> tgtPlayers = getTargetPlayers(sa);
|
||||||
|
|
||||||
|
|
||||||
sb.append(host.getController()).append(" looks at the top ").append(numToDig);
|
sb.append(host.getController()).append(" looks at the top ").append(numToDig);
|
||||||
sb.append(" card");
|
sb.append(" card");
|
||||||
if (numToDig != 1) {
|
if (numToDig != 1) {
|
||||||
@@ -355,4 +354,4 @@ public class DigEffect extends SpellEffect {
|
|||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import forge.game.zone.ZoneType;
|
|||||||
import forge.gui.GuiChoose;
|
import forge.gui.GuiChoose;
|
||||||
|
|
||||||
public class DigUntilEffect extends SpellEffect {
|
public class DigUntilEffect extends SpellEffect {
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility)
|
* @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility)
|
||||||
@@ -24,12 +23,12 @@ public class DigUntilEffect extends SpellEffect {
|
|||||||
@Override
|
@Override
|
||||||
protected String getStackDescription(SpellAbility sa) {
|
protected String getStackDescription(SpellAbility sa) {
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
String desc = "Card";
|
String desc = "Card";
|
||||||
if (sa.hasParam("ValidDescription")) {
|
if (sa.hasParam("ValidDescription")) {
|
||||||
desc = sa.getParam("ValidDescription");
|
desc = sa.getParam("ValidDescription");
|
||||||
}
|
}
|
||||||
|
|
||||||
int untilAmount = 1;
|
int untilAmount = 1;
|
||||||
if (sa.hasParam("Amount")) {
|
if (sa.hasParam("Amount")) {
|
||||||
untilAmount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("Amount"), sa);
|
untilAmount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("Amount"), sa);
|
||||||
@@ -38,25 +37,25 @@ public class DigUntilEffect extends SpellEffect {
|
|||||||
for (final Player pl : getTargetPlayers(sa)) {
|
for (final Player pl : getTargetPlayers(sa)) {
|
||||||
sb.append(pl).append(" ");
|
sb.append(pl).append(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.append("reveals cards from his or her library until revealing ");
|
sb.append("reveals cards from his or her library until revealing ");
|
||||||
sb.append(untilAmount).append(" ").append(desc).append(" card");
|
sb.append(untilAmount).append(" ").append(desc).append(" card");
|
||||||
if (untilAmount != 1) {
|
if (untilAmount != 1) {
|
||||||
sb.append("s");
|
sb.append("s");
|
||||||
}
|
}
|
||||||
sb.append(". Put ");
|
sb.append(". Put ");
|
||||||
|
|
||||||
final ZoneType found = ZoneType.smartValueOf(sa.getParam("FoundDestination"));
|
final ZoneType found = ZoneType.smartValueOf(sa.getParam("FoundDestination"));
|
||||||
final ZoneType revealed = ZoneType.smartValueOf(sa.getParam("RevealedDestination"));
|
final ZoneType revealed = ZoneType.smartValueOf(sa.getParam("RevealedDestination"));
|
||||||
if (found != null) {
|
if (found != null) {
|
||||||
|
|
||||||
sb.append(untilAmount > 1 ? "those cards" : "that card");
|
sb.append(untilAmount > 1 ? "those cards" : "that card");
|
||||||
sb.append(" ");
|
sb.append(" ");
|
||||||
|
|
||||||
if (found.equals(ZoneType.Hand)) {
|
if (found.equals(ZoneType.Hand)) {
|
||||||
sb.append("into his or her hand ");
|
sb.append("into his or her hand ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (revealed.equals(ZoneType.Graveyard)) {
|
if (revealed.equals(ZoneType.Graveyard)) {
|
||||||
sb.append("and all other cards into his or her graveyard.");
|
sb.append("and all other cards into his or her graveyard.");
|
||||||
}
|
}
|
||||||
@@ -160,4 +159,4 @@ public class DigUntilEffect extends SpellEffect {
|
|||||||
}
|
}
|
||||||
} // end resolve
|
} // end resolve
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,21 +24,20 @@ public class DiscardEffect extends RevealEffectBase {
|
|||||||
protected String getStackDescription(SpellAbility sa) {
|
protected String getStackDescription(SpellAbility sa) {
|
||||||
final String mode = sa.getParam("Mode");
|
final String mode = sa.getParam("Mode");
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
final List<Player> tgtPlayers = getTargetPlayers(sa);
|
final List<Player> tgtPlayers = getTargetPlayers(sa);
|
||||||
|
|
||||||
|
|
||||||
final String conditionDesc = sa.getParam("ConditionDescription");
|
final String conditionDesc = sa.getParam("ConditionDescription");
|
||||||
if (conditionDesc != null) {
|
if (conditionDesc != null) {
|
||||||
sb.append(conditionDesc).append(" ");
|
sb.append(conditionDesc).append(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tgtPlayers.size() > 0) {
|
if (tgtPlayers.size() > 0) {
|
||||||
|
|
||||||
for (final Player p : tgtPlayers) {
|
for (final Player p : tgtPlayers) {
|
||||||
sb.append(p.toString()).append(" ");
|
sb.append(p.toString()).append(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode.equals("RevealYouChoose")) {
|
if (mode.equals("RevealYouChoose")) {
|
||||||
sb.append("reveals his or her hand.").append(" You choose (");
|
sb.append("reveals his or her hand.").append(" You choose (");
|
||||||
} else if (mode.equals("RevealDiscardAll")) {
|
} else if (mode.equals("RevealDiscardAll")) {
|
||||||
@@ -46,12 +45,12 @@ public class DiscardEffect extends RevealEffectBase {
|
|||||||
} else {
|
} else {
|
||||||
sb.append("discards (");
|
sb.append("discards (");
|
||||||
}
|
}
|
||||||
|
|
||||||
int numCards = 1;
|
int numCards = 1;
|
||||||
if (sa.hasParam("NumCards")) {
|
if (sa.hasParam("NumCards")) {
|
||||||
numCards = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumCards"), sa);
|
numCards = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumCards"), sa);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode.equals("Hand")) {
|
if (mode.equals("Hand")) {
|
||||||
sb.append("his or her hand");
|
sb.append("his or her hand");
|
||||||
} else if (mode.equals("RevealDiscardAll")) {
|
} else if (mode.equals("RevealDiscardAll")) {
|
||||||
@@ -59,9 +58,9 @@ public class DiscardEffect extends RevealEffectBase {
|
|||||||
} else {
|
} else {
|
||||||
sb.append(numCards);
|
sb.append(numCards);
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.append(")");
|
sb.append(")");
|
||||||
|
|
||||||
if (mode.equals("RevealYouChoose")) {
|
if (mode.equals("RevealYouChoose")) {
|
||||||
sb.append(" to discard");
|
sb.append(" to discard");
|
||||||
} else if (mode.equals("RevealDiscardAll")) {
|
} else if (mode.equals("RevealDiscardAll")) {
|
||||||
@@ -71,11 +70,11 @@ public class DiscardEffect extends RevealEffectBase {
|
|||||||
}
|
}
|
||||||
sb.append(" of type: ").append(valid);
|
sb.append(" of type: ").append(valid);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode.equals("Defined")) {
|
if (mode.equals("Defined")) {
|
||||||
sb.append(" defined cards");
|
sb.append(" defined cards");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode.equals("Random")) {
|
if (mode.equals("Random")) {
|
||||||
sb.append(" at random.");
|
sb.append(" at random.");
|
||||||
} else {
|
} else {
|
||||||
@@ -89,11 +88,11 @@ public class DiscardEffect extends RevealEffectBase {
|
|||||||
public void resolve(SpellAbility sa) {
|
public void resolve(SpellAbility sa) {
|
||||||
final Card source = sa.getSourceCard();
|
final Card source = sa.getSourceCard();
|
||||||
final String mode = sa.getParam("Mode");
|
final String mode = sa.getParam("Mode");
|
||||||
|
|
||||||
final Target tgt = sa.getTarget();
|
final Target tgt = sa.getTarget();
|
||||||
|
|
||||||
final List<Card> discarded = new ArrayList<Card>();
|
final List<Card> discarded = new ArrayList<Card>();
|
||||||
|
|
||||||
for (final Player p : getTargetPlayers(sa)) {
|
for (final Player p : getTargetPlayers(sa)) {
|
||||||
if ((tgt == null) || p.canBeTargetedBy(sa)) {
|
if ((tgt == null) || p.canBeTargetedBy(sa)) {
|
||||||
if (mode.equals("Defined")) {
|
if (mode.equals("Defined")) {
|
||||||
@@ -109,7 +108,7 @@ public class DiscardEffect extends RevealEffectBase {
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode.equals("Hand")) {
|
if (mode.equals("Hand")) {
|
||||||
final List<Card> list = p.discardHand(sa);
|
final List<Card> list = p.discardHand(sa);
|
||||||
if (sa.hasParam("RememberDiscarded")) {
|
if (sa.hasParam("RememberDiscarded")) {
|
||||||
@@ -119,16 +118,16 @@ public class DiscardEffect extends RevealEffectBase {
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode.equals("NotRemembered")) {
|
if (mode.equals("NotRemembered")) {
|
||||||
final List<Card> dPHand =
|
final List<Card> dPHand =
|
||||||
CardLists.getValidCards(p.getCardsIn(ZoneType.Hand), "Card.IsNotRemembered", source.getController(), source);
|
CardLists.getValidCards(p.getCardsIn(ZoneType.Hand), "Card.IsNotRemembered", source.getController(), source);
|
||||||
for (final Card c : dPHand) {
|
for (final Card c : dPHand) {
|
||||||
p.discard(c, sa);
|
p.discard(c, sa);
|
||||||
discarded.add(c);
|
discarded.add(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int numCards = 1;
|
int numCards = 1;
|
||||||
if (sa.hasParam("NumCards")) {
|
if (sa.hasParam("NumCards")) {
|
||||||
numCards = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumCards"), sa);
|
numCards = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumCards"), sa);
|
||||||
@@ -138,7 +137,7 @@ public class DiscardEffect extends RevealEffectBase {
|
|||||||
numCards = p.getCardsIn(ZoneType.Hand).size();
|
numCards = p.getCardsIn(ZoneType.Hand).size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode.equals("Random")) {
|
if (mode.equals("Random")) {
|
||||||
boolean runDiscard = true;
|
boolean runDiscard = true;
|
||||||
if (sa.hasParam("Optional")) {
|
if (sa.hasParam("Optional")) {
|
||||||
@@ -153,7 +152,7 @@ public class DiscardEffect extends RevealEffectBase {
|
|||||||
// Balduvian Horde and similar cards
|
// Balduvian Horde and similar cards
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (runDiscard) {
|
if (runDiscard) {
|
||||||
final String valid = sa.hasParam("DiscardValid") ? sa.getParam("DiscardValid") : "Card";
|
final String valid = sa.hasParam("DiscardValid") ? sa.getParam("DiscardValid") : "Card";
|
||||||
discarded.addAll(p.discardRandom(numCards, sa, valid));
|
discarded.addAll(p.discardRandom(numCards, sa, valid));
|
||||||
@@ -163,22 +162,22 @@ public class DiscardEffect extends RevealEffectBase {
|
|||||||
} else if (mode.equals("RevealDiscardAll")) {
|
} else if (mode.equals("RevealDiscardAll")) {
|
||||||
// Reveal
|
// Reveal
|
||||||
final List<Card> dPHand = p.getCardsIn(ZoneType.Hand);
|
final List<Card> dPHand = p.getCardsIn(ZoneType.Hand);
|
||||||
|
|
||||||
if (p.isHuman()) {
|
if (p.isHuman()) {
|
||||||
// "reveal to computer" for information gathering
|
// "reveal to computer" for information gathering
|
||||||
} else {
|
} else {
|
||||||
GuiChoose.oneOrNone("Revealed computer hand", dPHand);
|
GuiChoose.oneOrNone("Revealed computer hand", dPHand);
|
||||||
}
|
}
|
||||||
|
|
||||||
String valid = sa.getParam("DiscardValid");
|
String valid = sa.getParam("DiscardValid");
|
||||||
if (valid == null) {
|
if (valid == null) {
|
||||||
valid = "Card";
|
valid = "Card";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (valid.contains("X")) {
|
if (valid.contains("X")) {
|
||||||
valid = valid.replace("X", Integer.toString(AbilityFactory.calculateAmount(source, "X", sa)));
|
valid = valid.replace("X", Integer.toString(AbilityFactory.calculateAmount(source, "X", sa)));
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<Card> dPChHand = CardLists.getValidCards(dPHand, valid.split(","), source.getController(), source);
|
final List<Card> dPChHand = CardLists.getValidCards(dPHand, valid.split(","), source.getController(), source);
|
||||||
// Reveal cards that will be discarded?
|
// Reveal cards that will be discarded?
|
||||||
for (final Card c : dPChHand) {
|
for (final Card c : dPChHand) {
|
||||||
@@ -208,7 +207,7 @@ public class DiscardEffect extends RevealEffectBase {
|
|||||||
} else if (mode.equals("RevealOppChoose")) {
|
} else if (mode.equals("RevealOppChoose")) {
|
||||||
chooser = source.getController().getOpponent();
|
chooser = source.getController().getOpponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chooser.isComputer()) {
|
if (chooser.isComputer()) {
|
||||||
// AI
|
// AI
|
||||||
if (p.isComputer()) { // discard AI cards
|
if (p.isComputer()) { // discard AI cards
|
||||||
@@ -230,8 +229,8 @@ public class DiscardEffect extends RevealEffectBase {
|
|||||||
List<Card> goodChoices = CardLists.filter(dPChHand, new Predicate<Card>() {
|
List<Card> goodChoices = CardLists.filter(dPChHand, new Predicate<Card>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(final Card c) {
|
public boolean apply(final Card c) {
|
||||||
if (c.hasKeyword("If a spell or ability an opponent controls causes you to discard CARDNAME," +
|
if (c.hasKeyword("If a spell or ability an opponent controls causes you to discard CARDNAME,"
|
||||||
" put it onto the battlefield instead of putting it into your graveyard.")
|
+ " put it onto the battlefield instead of putting it into your graveyard.")
|
||||||
|| !c.getSVar("DiscardMe").equals("")) {
|
|| !c.getSVar("DiscardMe").equals("")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -251,15 +250,15 @@ public class DiscardEffect extends RevealEffectBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Collections.sort(goodChoices, CardLists.TextLenReverseComparator);
|
Collections.sort(goodChoices, CardLists.TextLenReverseComparator);
|
||||||
|
|
||||||
CardLists.sortCMC(goodChoices);
|
CardLists.sortCMC(goodChoices);
|
||||||
dChoices.add(goodChoices.get(0));
|
dChoices.add(goodChoices.get(0));
|
||||||
|
|
||||||
final Card dC = goodChoices.get(CardUtil.getRandomIndex(goodChoices));
|
final Card dC = goodChoices.get(CardUtil.getRandomIndex(goodChoices));
|
||||||
dPChHand.remove(dC);
|
dPChHand.remove(dC);
|
||||||
|
|
||||||
if (mode.startsWith("Reveal")) {
|
if (mode.startsWith("Reveal")) {
|
||||||
final List<Card> dCs = new ArrayList<Card>();
|
final List<Card> dCs = new ArrayList<Card>();
|
||||||
dCs.add(dC);
|
dCs.add(dC);
|
||||||
@@ -274,7 +273,7 @@ public class DiscardEffect extends RevealEffectBase {
|
|||||||
if (mode.startsWith("Reveal")) {
|
if (mode.startsWith("Reveal")) {
|
||||||
GuiChoose.oneOrNone("Revealed " + p + " hand", dPHand);
|
GuiChoose.oneOrNone("Revealed " + p + " hand", dPHand);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < numCards; i++) {
|
for (int i = 0; i < numCards; i++) {
|
||||||
if (dPChHand.size() > 0) {
|
if (dPChHand.size() > 0) {
|
||||||
Card dC = null;
|
Card dC = null;
|
||||||
@@ -294,13 +293,13 @@ public class DiscardEffect extends RevealEffectBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sa.hasParam("RememberDiscarded")) {
|
if (sa.hasParam("RememberDiscarded")) {
|
||||||
for (final Card c : discarded) {
|
for (final Card c : discarded) {
|
||||||
source.addRemembered(c);
|
source.addRemembered(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // discardResolve()
|
} // discardResolve()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,19 +13,19 @@ public class DrainManaEffect extends SpellEffect {
|
|||||||
@Override
|
@Override
|
||||||
protected String getStackDescription(SpellAbility sa) {
|
protected String getStackDescription(SpellAbility sa) {
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
final List<Player> tgtPlayers = getTargetPlayers(sa);
|
final List<Player> tgtPlayers = getTargetPlayers(sa);
|
||||||
|
|
||||||
sb.append(StringUtils.join(tgtPlayers, ", "));
|
sb.append(StringUtils.join(tgtPlayers, ", "));
|
||||||
sb.append(" empties his or her mana pool.");
|
sb.append(" empties his or her mana pool.");
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve(SpellAbility sa) {
|
public void resolve(SpellAbility sa) {
|
||||||
final Target tgt = sa.getTarget();
|
final Target tgt = sa.getTarget();
|
||||||
|
|
||||||
for (final Player p : getTargetPlayers(sa)) {
|
for (final Player p : getTargetPlayers(sa)) {
|
||||||
if ((tgt == null) || p.canBeTargetedBy(sa)) {
|
if ((tgt == null) || p.canBeTargetedBy(sa)) {
|
||||||
p.getManaPool().clearPool(false);
|
p.getManaPool().clearPool(false);
|
||||||
@@ -33,4 +33,4 @@ public class DrainManaEffect extends SpellEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,24 +18,23 @@ public class DrawEffect extends SpellEffect {
|
|||||||
@Override
|
@Override
|
||||||
protected String getStackDescription(SpellAbility sa) {
|
protected String getStackDescription(SpellAbility sa) {
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
final String conditionDesc = sa.getParam("ConditionDescription");
|
final String conditionDesc = sa.getParam("ConditionDescription");
|
||||||
if (conditionDesc != null) {
|
if (conditionDesc != null) {
|
||||||
sb.append(conditionDesc).append(" ");
|
sb.append(conditionDesc).append(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<Player> tgtPlayers = getDefinedPlayersBeforeTargetOnes(sa);
|
final List<Player> tgtPlayers = getDefinedPlayersBeforeTargetOnes(sa);
|
||||||
|
|
||||||
|
|
||||||
if (!tgtPlayers.isEmpty()) {
|
if (!tgtPlayers.isEmpty()) {
|
||||||
|
|
||||||
sb.append(StringUtils.join(tgtPlayers, " and "));
|
sb.append(StringUtils.join(tgtPlayers, " and "));
|
||||||
|
|
||||||
int numCards = 1;
|
int numCards = 1;
|
||||||
if (sa.hasParam("NumCards")) {
|
if (sa.hasParam("NumCards")) {
|
||||||
numCards = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumCards"), sa);
|
numCards = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumCards"), sa);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tgtPlayers.size() > 1) {
|
if (tgtPlayers.size() > 1) {
|
||||||
sb.append(" each");
|
sb.append(" each");
|
||||||
}
|
}
|
||||||
@@ -44,14 +43,14 @@ public class DrawEffect extends SpellEffect {
|
|||||||
sb.append("s");
|
sb.append("s");
|
||||||
}
|
}
|
||||||
sb.append(" (").append(numCards).append(")");
|
sb.append(" (").append(numCards).append(")");
|
||||||
|
|
||||||
if (sa.hasParam("NextUpkeep")) {
|
if (sa.hasParam("NextUpkeep")) {
|
||||||
sb.append(" at the beginning of the next upkeep");
|
sb.append(" at the beginning of the next upkeep");
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.append(".");
|
sb.append(".");
|
||||||
}
|
}
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,4 +111,4 @@ public class DrawEffect extends SpellEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // drawResolve()
|
} // drawResolve()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user