- Fixed AI targeting for Time Stretch and Time Warp.

- Added some performance enhancement in the addDamage iteration code (probably won't matter much).
This commit is contained in:
jendave
2011-08-06 03:22:08 +00:00
parent f674a983d3
commit 8950394361
2 changed files with 13 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
package forge;
import java.util.*;
import java.util.Map.Entry;
enum Counters {
AGE, BLAZE, CHARGE, DIVINITY, FADE, HOOFPRINT, ICE, LOYALTY, M1M1, MANA, P0M1, P1P1, QUEST, SPORE, TIME
@@ -557,7 +558,7 @@ public class Card extends MyObservable
public void unEquip() {
for (Command var : unEquipCommandList)
var.execute();
}
}
public void addEnchantCommand(Command c) {enchantCommandList.add(c); }
public void removeEnchantCommand(Command c) {enchantCommandList.add(c); }
@@ -602,6 +603,14 @@ public class Card extends MyObservable
public void addDamage(HashMap<Card, Integer> sourcesMap)
{
Iterator<Entry<Card, Integer>> iter1 = sourcesMap.entrySet().iterator();
while(iter1.hasNext())
{
Entry<Card, Integer> entry = iter1.next();
this.addDamage(entry.getValue(), entry.getKey());
}
/*
Iterator<Card> iter = sourcesMap.keySet().iterator();
while(iter.hasNext()) {
Card source = iter.next();
@@ -609,6 +618,7 @@ public class Card extends MyObservable
this.addDamage(damage, source);
}
*/
//for(Card source : sources)
// this.addDamage(n, source);

View File

@@ -979,7 +979,7 @@ public class CardFactory implements NewConstants {
sbD.append(Math.abs(NumDefense[0]) + " and gains " + Keyword[0] + " until end of turn.");
}
//if (!sbD.toString().isEmpty())
if (!sbD.toString().trim().equals(""))
if (sbD.toString().trim().length()!=0)
d = sbD.toString();
if (k.length > 2)
@@ -15999,7 +15999,7 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
}
};
card.clearSpellAbility();
spell.setChooseTargetAI(CardFactoryUtil.AI_targetHuman());
spell.setChooseTargetAI(CardFactoryUtil.AI_targetComputer());
spell.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spell));
card.addSpellAbility(spell);
}//*************** END ************ END **************************