- LQ images shouldn't scale higher than a ratio of 1 anymore.

- AI should consider Bushido now when declaring attackers / blockers.
- Fixed a bug which would sometimes bring up an error report when a static effect left play.
- Fixed Ensnare text.
This commit is contained in:
jendave
2011-08-06 03:23:48 +00:00
parent 2306d4c831
commit ada770f7ac
6 changed files with 70 additions and 112 deletions

View File

@@ -1,12 +1,12 @@
#Sat Oct 24 03:14:19 CEST 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5
#Thu Dec 03 11:37:04 CST 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5

View File

@@ -70,6 +70,12 @@
} else
targetHeight = panelHeight;
}
if (targetWidth > 201 && srcWidth <= 201)
targetWidth = 201;
if (targetHeight > 285 && srcHeight <= 286)
targetHeight = 285;
ScalingInfo info = new ScalingInfo();
info.targetWidth = targetWidth;
info.targetHeight = targetHeight;

View File

@@ -7009,7 +7009,7 @@ public class CardFactory implements NewConstants {
}
};
bounce.setDescription("You may return three Islands you control to their owner's hand rather than pay Ensnare's mana cost.");
bounce.setDescription("You may return two Islands you control to their owner's hand rather than pay Ensnare's mana cost.");
bounce.setStackDescription(card.getName() + " - Tap all creatures.");
bounce.setManaCost("0");
@@ -14992,6 +14992,7 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
{
private static final long serialVersionUID = 8394047173115959008L;
public boolean canPlayAI(){return false;}
public void resolve()
@@ -16411,59 +16412,7 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
card.clearSpellAbility();
card.addSpellAbility(spell);
}//*************** END ************ END **************************
/*
//*************** START *********** START **************************
else if(cardName.equals("Riding the Dilu Horse"))
{
SpellAbility spell = new Spell(card)
{
private static final long serialVersionUID = -620930445462994580L;
public boolean canPlayAI()
{
PlayerZone play = AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer);
CardList list = new CardList(play.getCards());
list = list.filter(new CardListFilter()
{
public boolean addCard(Card c)
{
return c.isCreature() && !c.getKeyword().contains("Horsemanship") && !c.getKeyword().contains("Defender");
}
});
if (list.size() > 0) {
Card c = CardFactoryUtil.AI_getBestCreature(list, card);
setTargetCard(c);
return true;
}
return false;
}
public void resolve()
{
final Card[] target = new Card[1];
target[0] = getTargetCard();
if(AllZone.GameAction.isCardInPlay(target[0]) && CardFactoryUtil.canTarget(card, target[0]))
{
target[0].addTempAttackBoost(2);
target[0].addTempDefenseBoost(2);
target[0].addExtrinsicKeyword("Horsemanship");
//String s = target[0].getText();
target[0].setText("(+2/+2 and Horsemanship from " +card+")");
}
}//resolve()
};
spell.setBeforePayMana(CardFactoryUtil.input_targetCreature(spell));
card.clearSpellAbility();
card.addSpellAbility(spell);
}//*************** END ************ END **************************
*/
//*************** START *********** START **************************
else if (cardName.equals("Millstone"))
@@ -16675,7 +16624,7 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
}//*************** END ************ END **************************
//*************** START *********** START **************************
//*************** START *********** START **************************
if (cardName.equals("Mind Funeral"))
{
final SpellAbility spell = new Spell(card)
@@ -16730,7 +16679,7 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
}//*************** END ************ END **************************
//*************** START *********** START **************************
//*************** START *********** START **************************
if (cardName.equals("Haunting Echoes"))
{
final SpellAbility spell = new Spell(card)
@@ -16917,7 +16866,7 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
card.addSpellAbility(spell);
}//*************** END ************ END **************************
//*************** START *********** START **************************
//*************** START *********** START **************************
if (cardName.equals("Flame Rift"))
{
final SpellAbility spell = new Spell(card)
@@ -17204,7 +17153,7 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
}//*************** END ************ END **************************
//*************** START *********** START **************************
//*************** START *********** START **************************
else if(cardName.equals("Thwart"))
{
final SpellAbility spell = new Spell(card)

View File

@@ -3267,6 +3267,22 @@ public class CardFactoryUtil
return list;
}
public static int getTotalBushidoMagnitude(Card c)
{
int count = 0;
ArrayList<String> keywords = c.getKeyword();
for (String kw : keywords)
{
if (kw.contains("Bushido"))
{
String[] parse = kw.split(" ");
String s = parse[1];
count += Integer.parseInt(s);
}
}
return count;
}
public static ArrayList<Ability> getBushidoEffects(Card c)
{
ArrayList<String> keywords = c.getKeyword();

View File

@@ -152,8 +152,7 @@ public class CombatUtil
if (CardUtil.getColors(blocker).contains(Constant.Color.Green))
return false;
}
if (attacker.getName().equals("Amrou Seekers"))
{
if (!blocker.getType().contains("Artifact") &&
@@ -173,25 +172,7 @@ public class CombatUtil
if (!CardUtil.getColors(blocker).contains(Constant.Color.Blue))
return false;
}
/*
if(attacker.getKeyword().contains("Flying"))
return blocker.getKeyword().contains("Flying") ||
blocker.getKeyword().contains("This creature can block as though it had flying.") ||
blocker.getKeyword().contains("Reach");
if(attacker.getKeyword().contains("Fear"))
return blocker.getType().contains("Artifact") ||
CardUtil.getColors(blocker).contains(Constant.Color.Black) ||
CardUtil.getColors(blocker).contains(Constant.Color.Colorless);
if (attacker.getName().equals("Amrou Seekers"))
return blocker.getType().contains("Artifact") ||
CardUtil.getColors(blocker).contains(Constant.Color.White);
if(attacker.getName().equals("Skirk Shaman"))
return blocker.getType().contains("Artifact") ||
CardUtil.getColors(blocker).contains(Constant.Color.Red);
*/
if(attacker.getName().equals("Goldmeadow Dodger"))
return blocker.getNetAttack() < 4;
@@ -255,7 +236,7 @@ public class CombatUtil
return false;
}//flanking
if (attacker.getName().equals("Cho-Manno, Revolutionary"))
return false;
@@ -284,16 +265,18 @@ public class CombatUtil
if (attacker.getKeyword().contains("Protection from Goblins") && (defender.getType().contains("Goblin") || defender.getKeyword().contains("Changeling") ))
return false;
int defBushidoMagnitude = CardFactoryUtil.getTotalBushidoMagnitude(defender);
int attBushidoMagnitude = CardFactoryUtil.getTotalBushidoMagnitude(attacker);
int defenderDamage = defender.getNetAttack() - flankingMagnitude;
int attackerDamage = attacker.getNetAttack();
int defenderDamage = defender.getNetAttack() - flankingMagnitude + defBushidoMagnitude;
int attackerDamage = attacker.getNetAttack() + attBushidoMagnitude;
if (isDoranInPlay()) {
defenderDamage = defender.getNetDefense() - flankingMagnitude;
attackerDamage = attacker.getNetDefense();
defenderDamage = defender.getNetDefense() - flankingMagnitude + defBushidoMagnitude;
attackerDamage = attacker.getNetDefense() + attBushidoMagnitude;
}
int defenderLife = defender.getNetDefense() - flankingMagnitude;
int attackerLife = attacker.getNetDefense();
int defenderLife = defender.getNetDefense() - flankingMagnitude + defBushidoMagnitude;
int attackerLife = attacker.getNetDefense() + attBushidoMagnitude;
if (defender.getKeyword().contains("Double Strike"))
{
@@ -419,15 +402,18 @@ public class CombatUtil
if (defender.getKeyword().contains("Protection from Goblins") && (attacker.getType().contains("Goblin") || attacker.getKeyword().contains("Changeling") ))
return false;
int defenderDamage = defender.getNetAttack() - flankingMagnitude;
int attackerDamage = attacker.getNetAttack();
int defBushidoMagnitude = CardFactoryUtil.getTotalBushidoMagnitude(defender);
int attBushidoMagnitude = CardFactoryUtil.getTotalBushidoMagnitude(attacker);
int defenderDamage = defender.getNetAttack() - flankingMagnitude + defBushidoMagnitude;
int attackerDamage = attacker.getNetAttack() + attBushidoMagnitude;
if (isDoranInPlay()) {
defenderDamage = defender.getNetDefense() - flankingMagnitude;
attackerDamage = attacker.getNetDefense();
defenderDamage = defender.getNetDefense() - flankingMagnitude + defBushidoMagnitude;
attackerDamage = attacker.getNetDefense() + attBushidoMagnitude;
}
int defenderLife = defender.getNetDefense() - flankingMagnitude;
int attackerLife = attacker.getNetDefense();
int defenderLife = defender.getNetDefense() - flankingMagnitude + defBushidoMagnitude;
int attackerLife = attacker.getNetDefense() + attBushidoMagnitude;
if (attacker.getKeyword().contains("Double Strike"))
{
@@ -587,7 +573,6 @@ public class CombatUtil
display.append("/");
display.append(attack[i].getNetDefense());
display.append(" is attacking \n");
//display += attackerName +" (" +attack[i].getUniqueNumber() +") " +attack[i].getNetAttack() +"/" +attack[i].getNetDefense() +" is attacking \n";
defend = AllZone.pwCombat.getBlockers(attack[i]).toArray();
@@ -608,8 +593,6 @@ public class CombatUtil
display.append("/");
display.append(defend[inner].getNetDefense());
display.append(" is blocking \n");
//display += " " +blockerName +" (" +defend[inner].getUniqueNumber() +") " +defend[inner].getNetAttack() +"/" +defend[inner].getNetDefense() +" is blocking \n";
}
}//while - loop through attackers
@@ -1784,8 +1767,10 @@ public class CombatUtil
{
//System.out.println(a.getName() + " got blocked by " + b.getName());
for (Ability ab: CardFactoryUtil.getBushidoEffects(a))
AllZone.Stack.add(ab);
if (!a.getCreatureGotBlockedThisTurn() ) {
for (Ability ab: CardFactoryUtil.getBushidoEffects(a))
AllZone.Stack.add(ab);
}
for (Ability ab: CardFactoryUtil.getBushidoEffects(b))
AllZone.Stack.add(ab);

View File

@@ -190,9 +190,11 @@ public class StaticEffects
public void removeStateBasedEffect(String s)
{
stateBasedMap.put(s, stateBasedMap.get(s)-1);
if(stateBasedMap.get(s) == 0)
stateBasedMap.remove(s);
if (stateBasedMap.containsKey(s)) {
stateBasedMap.put(s, stateBasedMap.get(s)-1);
if(stateBasedMap.get(s) == 0)
stateBasedMap.remove(s);
}
}
public HashMap<String, Integer> getStateBasedMap()