mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- CheckStyle.
This commit is contained in:
@@ -52,8 +52,8 @@ public class CharmEffect extends SpellEffect {
|
||||
List<AbilitySub> chosen = null;
|
||||
|
||||
Player activator = sa.getActivatingPlayer();
|
||||
if ( activator.isHuman() )
|
||||
{
|
||||
if (activator.isHuman()) {
|
||||
|
||||
chosen = new ArrayList<AbilitySub>();
|
||||
for (int i = 0; i < num; i++) {
|
||||
AbilitySub a;
|
||||
@@ -69,17 +69,18 @@ public class CharmEffect extends SpellEffect {
|
||||
choices.remove(a);
|
||||
chosen.add(a);
|
||||
}
|
||||
}
|
||||
else
|
||||
} else {
|
||||
chosen = CharmAi.chooseOptionsAi(activator, true, choices, num, min);
|
||||
}
|
||||
|
||||
chainAbilities(sa, chosen);
|
||||
}
|
||||
|
||||
private static void chainAbilities(SpellAbility sa, List<AbilitySub> chosen) {
|
||||
SpellAbility saDeepest = sa;
|
||||
while( saDeepest.getSubAbility() != null)
|
||||
while (saDeepest.getSubAbility() != null) {
|
||||
saDeepest = saDeepest.getSubAbility();
|
||||
}
|
||||
|
||||
for (AbilitySub sub : chosen) {
|
||||
saDeepest.setSubAbility(sub);
|
||||
@@ -92,5 +93,4 @@ public class CharmEffect extends SpellEffect {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -13,8 +13,7 @@ import forge.card.spellability.Target;
|
||||
import forge.game.player.Player;
|
||||
import forge.gui.GuiChoose;
|
||||
|
||||
public class ChooseNumberEffect extends SpellEffect
|
||||
{
|
||||
public class ChooseNumberEffect extends SpellEffect {
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility)
|
||||
|
||||
@@ -19,7 +19,6 @@ import forge.gui.GuiChoose;
|
||||
|
||||
public class ChooseTypeEffect extends SpellEffect {
|
||||
|
||||
|
||||
@Override
|
||||
protected String getStackDescription(SpellAbility sa) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
|
||||
@@ -80,7 +80,6 @@ public class ControlGainEffect extends SpellEffect {
|
||||
List<Card> tgtCards = new ArrayList<Card>();
|
||||
Card source = sa.getSourceCard();
|
||||
|
||||
|
||||
final boolean bUntap = sa.hasParam("Untap");
|
||||
final boolean bTapOnLose = sa.hasParam("TapOnLose");
|
||||
final boolean bNoRegen = sa.hasParam("NoRegen");
|
||||
@@ -92,8 +91,9 @@ public class ControlGainEffect extends SpellEffect {
|
||||
if (sa.hasParam("AllValid")) {
|
||||
tgtCards = Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield);
|
||||
tgtCards = AbilityFactory.filterListByType(tgtCards, sa.getParam("AllValid"), sa);
|
||||
} else
|
||||
} else {
|
||||
tgtCards = getTargetCards(sa);
|
||||
}
|
||||
|
||||
ArrayList<Player> controllers = new ArrayList<Player>();
|
||||
|
||||
|
||||
@@ -31,8 +31,9 @@ public class CounterEffect extends SpellEffect {
|
||||
}
|
||||
sas.add(spell);
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
sas = getTargetSpellAbilities(sa);
|
||||
}
|
||||
|
||||
sb.append("countering");
|
||||
|
||||
@@ -74,8 +75,9 @@ public class CounterEffect extends SpellEffect {
|
||||
}
|
||||
sas.add(spell);
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
sas = getTargetSpellAbilities(sa);
|
||||
}
|
||||
|
||||
if (sa.hasParam("ForgetOtherTargets")) {
|
||||
if (sa.getParam("ForgetOtherTargets").equals("True")) {
|
||||
|
||||
@@ -35,11 +35,12 @@ public class CountersProliferateEffect extends SpellEffect {
|
||||
@Override
|
||||
public void resolve(SpellAbility sa) {
|
||||
Player controller = sa.getSourceCard().getController();
|
||||
if (controller.isHuman())
|
||||
if (controller.isHuman()) {
|
||||
resolveHuman(sa);
|
||||
else
|
||||
} else {
|
||||
resolveAI(controller, sa);
|
||||
}
|
||||
}
|
||||
|
||||
private static void resolveHuman(final SpellAbility sa) {
|
||||
final List<Card> unchosen = Lists.newArrayList(Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield));
|
||||
@@ -84,8 +85,8 @@ public class CountersProliferateEffect extends SpellEffect {
|
||||
|
||||
@Override
|
||||
public void selectPlayer(final Player player) {
|
||||
if (players.indexOf(player) >= 0)
|
||||
{
|
||||
if (players.indexOf(player) >= 0) {
|
||||
|
||||
players.remove(player); // no second selection
|
||||
if (player.getPoisonCounters() > 0) {
|
||||
player.addPoisonCounters(1, sa.getSourceCard());
|
||||
@@ -96,7 +97,6 @@ public class CountersProliferateEffect extends SpellEffect {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static void resolveAI(final Player ai, final SpellAbility sa) {
|
||||
final List<Player> allies = ai.getAllies();
|
||||
allies.add(ai);
|
||||
@@ -105,11 +105,13 @@ public class CountersProliferateEffect extends SpellEffect {
|
||||
@Override
|
||||
public boolean apply(Card crd) {
|
||||
for (final Entry<Counters, Integer> c1 : crd.getCounters().entrySet()) {
|
||||
if ( CardFactoryUtil.isNegativeCounter(c1.getKey()) && enemies.contains(crd.getController()))
|
||||
if (CardFactoryUtil.isNegativeCounter(c1.getKey()) && enemies.contains(crd.getController())) {
|
||||
return true;
|
||||
if ( !CardFactoryUtil.isNegativeCounter(c1.getKey()) && allies.contains(crd.getController()))
|
||||
}
|
||||
if (!CardFactoryUtil.isNegativeCounter(c1.getKey()) && allies.contains(crd.getController())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@@ -117,9 +119,10 @@ public class CountersProliferateEffect extends SpellEffect {
|
||||
List<Card> cardsToProliferate = CardLists.filter(Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield), predProliferate);
|
||||
List<Player> playersToPoison = new ArrayList<Player>();
|
||||
for (Player e : enemies) {
|
||||
if ( e.getPoisonCounters() > 0 )
|
||||
if (e.getPoisonCounters() > 0) {
|
||||
playersToPoison.add(e);
|
||||
}
|
||||
}
|
||||
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("<html>Proliferate. Computer selects:<br>");
|
||||
|
||||
Reference in New Issue
Block a user