mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- 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:
@@ -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
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 **************************
|
||||
|
||||
Reference in New Issue
Block a user