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;
|
package forge;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
enum Counters {
|
enum Counters {
|
||||||
AGE, BLAZE, CHARGE, DIVINITY, FADE, HOOFPRINT, ICE, LOYALTY, M1M1, MANA, P0M1, P1P1, QUEST, SPORE, TIME
|
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() {
|
public void unEquip() {
|
||||||
for (Command var : unEquipCommandList)
|
for (Command var : unEquipCommandList)
|
||||||
var.execute();
|
var.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addEnchantCommand(Command c) {enchantCommandList.add(c); }
|
public void addEnchantCommand(Command c) {enchantCommandList.add(c); }
|
||||||
public void removeEnchantCommand(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)
|
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();
|
Iterator<Card> iter = sourcesMap.keySet().iterator();
|
||||||
while(iter.hasNext()) {
|
while(iter.hasNext()) {
|
||||||
Card source = iter.next();
|
Card source = iter.next();
|
||||||
@@ -609,6 +618,7 @@ public class Card extends MyObservable
|
|||||||
|
|
||||||
this.addDamage(damage, source);
|
this.addDamage(damage, source);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
//for(Card source : sources)
|
//for(Card source : sources)
|
||||||
// this.addDamage(n, source);
|
// 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.");
|
sbD.append(Math.abs(NumDefense[0]) + " and gains " + Keyword[0] + " until end of turn.");
|
||||||
}
|
}
|
||||||
//if (!sbD.toString().isEmpty())
|
//if (!sbD.toString().isEmpty())
|
||||||
if (!sbD.toString().trim().equals(""))
|
if (sbD.toString().trim().length()!=0)
|
||||||
d = sbD.toString();
|
d = sbD.toString();
|
||||||
|
|
||||||
if (k.length > 2)
|
if (k.length > 2)
|
||||||
@@ -15999,7 +15999,7 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
card.clearSpellAbility();
|
card.clearSpellAbility();
|
||||||
spell.setChooseTargetAI(CardFactoryUtil.AI_targetHuman());
|
spell.setChooseTargetAI(CardFactoryUtil.AI_targetComputer());
|
||||||
spell.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spell));
|
spell.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spell));
|
||||||
card.addSpellAbility(spell);
|
card.addSpellAbility(spell);
|
||||||
}//*************** END ************ END **************************
|
}//*************** END ************ END **************************
|
||||||
|
|||||||
Reference in New Issue
Block a user