* cleanups

This commit is contained in:
jendave
2011-08-07 01:07:39 +00:00
parent d2ec6b767f
commit c79df0627d
7 changed files with 17 additions and 18 deletions

View File

@@ -127,8 +127,8 @@ public class BoosterDraftAI
}
}
else {
CardList typeList = new CardList();
CardList colorList = new CardList();
CardList typeList;
CardList colorList;
colorList = AIPlayables.getOnly2Colors(playerColors.get(player).Color1, playerColors.get(player).Color2);

View File

@@ -104,7 +104,7 @@ public class ComputerUtil_Block2
CardList blockers = getPossibleBlockers(attacker, blockersLeft, combat);
CardList safeBlockers = getSafeBlockers(attacker, blockers, combat);
CardList killingBlockers = new CardList();
CardList killingBlockers;
if(safeBlockers.size() > 0) {
// 1.Blockers that can destroy the attacker but won't get destroyed
@@ -143,7 +143,7 @@ public class ComputerUtil_Block2
CardList currentAttackers = new CardList(attackersLeft.toArray());
currentAttackers = currentAttackers.getKeywordsDontContain("Rampage");
CardList blockers = new CardList();
CardList blockers;
//Try to block an attacker without first strike with a gang of first strikers
for (Card attacker : attackersLeft) {
@@ -181,7 +181,7 @@ public class ComputerUtil_Block2
//Try to block an attacker with two blockers of which only one will die
for(final Card attacker : attackersLeft) {
blockers = getPossibleBlockers(attacker, blockersLeft, combat);
CardList usableBlockers = new CardList();
CardList usableBlockers;
CardList blockGang = new CardList();
int absorbedDamage = 0; //The amount of damage needed to kill the first blocker
int currentValue = 0; //The value of the creatures in the blockgang
@@ -234,7 +234,7 @@ public class ComputerUtil_Block2
private static Combat makeTradeBlocks(Combat combat){
CardList currentAttackers = new CardList(attackersLeft.toArray());
CardList killingBlockers = new CardList();
CardList killingBlockers;
for(Card attacker : attackersLeft) {
killingBlockers =
@@ -254,7 +254,7 @@ public class ComputerUtil_Block2
private static Combat makeChumpBlocks(Combat combat){
CardList currentAttackers = new CardList(attackersLeft.toArray());
CardList chumpBlockers = new CardList();
CardList chumpBlockers;
for(Card attacker : attackersLeft) {
chumpBlockers = getPossibleBlockers(attacker, blockersLeft, combat);
@@ -273,7 +273,7 @@ public class ComputerUtil_Block2
//Reinforce blockers blocking attackers with trample (should only be made if life is in danger)
private static Combat reinforceBlockersAgainstTrample(Combat combat){
CardList chumpBlockers = new CardList();
CardList chumpBlockers;
CardList tramplingAttackers = attackers.getKeyword("Trample");
tramplingAttackers = tramplingAttackers.getKeywordsDontContain("Rampage"); //Don't make it worse
@@ -299,8 +299,8 @@ public class ComputerUtil_Block2
//Support blockers not destroying the attacker with more blockers to try to kill the attacker
private static Combat reinforceBlockersToKill(Combat combat){
CardList safeBlockers = new CardList();
CardList blockers = new CardList();
CardList safeBlockers;
CardList blockers;
CardList targetAttackers = blockedButUnkilled.getKeywordsDontContain("Rampage"); //Don't make it worse
//TODO - should check here for a "rampage-like" trigger that replaced the keyword:
// "Whenever CARDNAME becomes blocked, it gets +1/+1 until end of turn for each creature blocking it."
@@ -372,8 +372,8 @@ public class ComputerUtil_Block2
attackersLeft = new CardList(attackers.toArray()); //keeps track of all currently unblocked attackers
blockersLeft = new CardList(possibleBlockers.toArray()); //keeps track of all unassigned blockers
blockedButUnkilled = new CardList(); //keeps track of all blocked attackers that currently wouldn't be destroyed
CardList blockers = new CardList();
CardList chumpBlockers = new CardList();
CardList blockers;
CardList chumpBlockers;
diff = AllZone.ComputerPlayer.getLife() * 2 - 5; //This is the minimal gain for an unnecessary trade

View File

@@ -525,7 +525,7 @@ public class AbilityFactory_ChangeZone {
if (fetchList.size() == 0 || destination == null)
break;
Object o = new Object();
Object o;
if (params.containsKey("Mandatory"))
o = GuiUtils.getChoice("Select a card", fetchList.toArray());
else

View File

@@ -509,7 +509,7 @@ public class AbilityFactory_Destroy {
if (tgt != null)
tgtCards = tgt.getTargetCards();
else{
tgtCards = new ArrayList<Card>();
tgtCards = new ArrayList<Card>();
tgtCards.add(sa.getSourceCard());
}

View File

@@ -519,7 +519,6 @@ public class AbilityFactory_PermanentState {
if (tgt != null)
tgtCards = tgt.getTargetCards();
else{
tgtCards = new ArrayList<Card>();
tgtCards = AbilityFactory.getDefinedCards(hostCard, params.get("Defined"), sa);
}

View File

@@ -905,7 +905,7 @@ public class AbilityFactory_Reveal {
private static String rearrangeTopOfLibraryStackDescription(final AbilityFactory AF, final SpellAbility sa)
{
int numCards = 0;
ArrayList<Player> tgtPlayers = new ArrayList<Player>();
ArrayList<Player> tgtPlayers;
boolean shuffle = false;
Target tgt = AF.getAbTgt();

View File

@@ -89,7 +89,7 @@ public class ManaPool extends Card {
else
return ("|||||||||||");
return sbNormal.toString() + sbSnow.toString();
return sbNormal.append(sbSnow).toString();
}
@@ -132,7 +132,7 @@ public class ManaPool extends Card {
sbNormal.insert(0, "Mana Available:\n");
sbSnow.insert(0, "Snow Mana Available:\n");
return sbNormal.toString() + "\n" + sbSnow.toString();
return sbNormal.append("\n").append(sbSnow).toString();
}
public int getAmountOfColor(String color){