mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
- 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:
@@ -1,4 +1,4 @@
|
|||||||
#Sat Oct 24 03:14:19 CEST 2009
|
#Thu Dec 03 11:37:04 CST 2009
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||||
|
|||||||
@@ -70,6 +70,12 @@
|
|||||||
} else
|
} else
|
||||||
targetHeight = panelHeight;
|
targetHeight = panelHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (targetWidth > 201 && srcWidth <= 201)
|
||||||
|
targetWidth = 201;
|
||||||
|
if (targetHeight > 285 && srcHeight <= 286)
|
||||||
|
targetHeight = 285;
|
||||||
|
|
||||||
ScalingInfo info = new ScalingInfo();
|
ScalingInfo info = new ScalingInfo();
|
||||||
info.targetWidth = targetWidth;
|
info.targetWidth = targetWidth;
|
||||||
info.targetHeight = targetHeight;
|
info.targetHeight = targetHeight;
|
||||||
|
|||||||
@@ -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.setStackDescription(card.getName() + " - Tap all creatures.");
|
||||||
bounce.setManaCost("0");
|
bounce.setManaCost("0");
|
||||||
|
|
||||||
@@ -14992,6 +14992,7 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
|
|||||||
{
|
{
|
||||||
private static final long serialVersionUID = 8394047173115959008L;
|
private static final long serialVersionUID = 8394047173115959008L;
|
||||||
|
|
||||||
|
|
||||||
public boolean canPlayAI(){return false;}
|
public boolean canPlayAI(){return false;}
|
||||||
|
|
||||||
public void resolve()
|
public void resolve()
|
||||||
@@ -16413,58 +16414,6 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
|
|||||||
}//*************** END ************ END **************************
|
}//*************** 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 **************************
|
//*************** START *********** START **************************
|
||||||
else if (cardName.equals("Millstone"))
|
else if (cardName.equals("Millstone"))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3267,6 +3267,22 @@ public class CardFactoryUtil
|
|||||||
return list;
|
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)
|
public static ArrayList<Ability> getBushidoEffects(Card c)
|
||||||
{
|
{
|
||||||
ArrayList<String> keywords = c.getKeyword();
|
ArrayList<String> keywords = c.getKeyword();
|
||||||
|
|||||||
@@ -153,7 +153,6 @@ public class CombatUtil
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (attacker.getName().equals("Amrou Seekers"))
|
if (attacker.getName().equals("Amrou Seekers"))
|
||||||
{
|
{
|
||||||
if (!blocker.getType().contains("Artifact") &&
|
if (!blocker.getType().contains("Artifact") &&
|
||||||
@@ -173,25 +172,7 @@ public class CombatUtil
|
|||||||
if (!CardUtil.getColors(blocker).contains(Constant.Color.Blue))
|
if (!CardUtil.getColors(blocker).contains(Constant.Color.Blue))
|
||||||
return false;
|
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"))
|
if(attacker.getName().equals("Goldmeadow Dodger"))
|
||||||
return blocker.getNetAttack() < 4;
|
return blocker.getNetAttack() < 4;
|
||||||
|
|
||||||
@@ -284,16 +265,18 @@ public class CombatUtil
|
|||||||
if (attacker.getKeyword().contains("Protection from Goblins") && (defender.getType().contains("Goblin") || defender.getKeyword().contains("Changeling") ))
|
if (attacker.getKeyword().contains("Protection from Goblins") && (defender.getType().contains("Goblin") || defender.getKeyword().contains("Changeling") ))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
int defBushidoMagnitude = CardFactoryUtil.getTotalBushidoMagnitude(defender);
|
||||||
|
int attBushidoMagnitude = CardFactoryUtil.getTotalBushidoMagnitude(attacker);
|
||||||
|
|
||||||
int defenderDamage = defender.getNetAttack() - flankingMagnitude;
|
int defenderDamage = defender.getNetAttack() - flankingMagnitude + defBushidoMagnitude;
|
||||||
int attackerDamage = attacker.getNetAttack();
|
int attackerDamage = attacker.getNetAttack() + attBushidoMagnitude;
|
||||||
|
|
||||||
if (isDoranInPlay()) {
|
if (isDoranInPlay()) {
|
||||||
defenderDamage = defender.getNetDefense() - flankingMagnitude;
|
defenderDamage = defender.getNetDefense() - flankingMagnitude + defBushidoMagnitude;
|
||||||
attackerDamage = attacker.getNetDefense();
|
attackerDamage = attacker.getNetDefense() + attBushidoMagnitude;
|
||||||
}
|
}
|
||||||
int defenderLife = defender.getNetDefense() - flankingMagnitude;
|
int defenderLife = defender.getNetDefense() - flankingMagnitude + defBushidoMagnitude;
|
||||||
int attackerLife = attacker.getNetDefense();
|
int attackerLife = attacker.getNetDefense() + attBushidoMagnitude;
|
||||||
|
|
||||||
if (defender.getKeyword().contains("Double Strike"))
|
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") ))
|
if (defender.getKeyword().contains("Protection from Goblins") && (attacker.getType().contains("Goblin") || attacker.getKeyword().contains("Changeling") ))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int defenderDamage = defender.getNetAttack() - flankingMagnitude;
|
int defBushidoMagnitude = CardFactoryUtil.getTotalBushidoMagnitude(defender);
|
||||||
int attackerDamage = attacker.getNetAttack();
|
int attBushidoMagnitude = CardFactoryUtil.getTotalBushidoMagnitude(attacker);
|
||||||
|
|
||||||
|
int defenderDamage = defender.getNetAttack() - flankingMagnitude + defBushidoMagnitude;
|
||||||
|
int attackerDamage = attacker.getNetAttack() + attBushidoMagnitude;
|
||||||
|
|
||||||
if (isDoranInPlay()) {
|
if (isDoranInPlay()) {
|
||||||
defenderDamage = defender.getNetDefense() - flankingMagnitude;
|
defenderDamage = defender.getNetDefense() - flankingMagnitude + defBushidoMagnitude;
|
||||||
attackerDamage = attacker.getNetDefense();
|
attackerDamage = attacker.getNetDefense() + attBushidoMagnitude;
|
||||||
}
|
}
|
||||||
int defenderLife = defender.getNetDefense() - flankingMagnitude;
|
int defenderLife = defender.getNetDefense() - flankingMagnitude + defBushidoMagnitude;
|
||||||
int attackerLife = attacker.getNetDefense();
|
int attackerLife = attacker.getNetDefense() + attBushidoMagnitude;
|
||||||
|
|
||||||
if (attacker.getKeyword().contains("Double Strike"))
|
if (attacker.getKeyword().contains("Double Strike"))
|
||||||
{
|
{
|
||||||
@@ -587,7 +573,6 @@ public class CombatUtil
|
|||||||
display.append("/");
|
display.append("/");
|
||||||
display.append(attack[i].getNetDefense());
|
display.append(attack[i].getNetDefense());
|
||||||
display.append(" is attacking \n");
|
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();
|
defend = AllZone.pwCombat.getBlockers(attack[i]).toArray();
|
||||||
|
|
||||||
@@ -608,8 +593,6 @@ public class CombatUtil
|
|||||||
display.append("/");
|
display.append("/");
|
||||||
display.append(defend[inner].getNetDefense());
|
display.append(defend[inner].getNetDefense());
|
||||||
display.append(" is blocking \n");
|
display.append(" is blocking \n");
|
||||||
|
|
||||||
//display += " " +blockerName +" (" +defend[inner].getUniqueNumber() +") " +defend[inner].getNetAttack() +"/" +defend[inner].getNetDefense() +" is blocking \n";
|
|
||||||
}
|
}
|
||||||
}//while - loop through attackers
|
}//while - loop through attackers
|
||||||
|
|
||||||
@@ -1784,8 +1767,10 @@ public class CombatUtil
|
|||||||
{
|
{
|
||||||
//System.out.println(a.getName() + " got blocked by " + b.getName());
|
//System.out.println(a.getName() + " got blocked by " + b.getName());
|
||||||
|
|
||||||
|
if (!a.getCreatureGotBlockedThisTurn() ) {
|
||||||
for (Ability ab: CardFactoryUtil.getBushidoEffects(a))
|
for (Ability ab: CardFactoryUtil.getBushidoEffects(a))
|
||||||
AllZone.Stack.add(ab);
|
AllZone.Stack.add(ab);
|
||||||
|
}
|
||||||
|
|
||||||
for (Ability ab: CardFactoryUtil.getBushidoEffects(b))
|
for (Ability ab: CardFactoryUtil.getBushidoEffects(b))
|
||||||
AllZone.Stack.add(ab);
|
AllZone.Stack.add(ab);
|
||||||
|
|||||||
@@ -190,10 +190,12 @@ public class StaticEffects
|
|||||||
|
|
||||||
public void removeStateBasedEffect(String s)
|
public void removeStateBasedEffect(String s)
|
||||||
{
|
{
|
||||||
|
if (stateBasedMap.containsKey(s)) {
|
||||||
stateBasedMap.put(s, stateBasedMap.get(s)-1);
|
stateBasedMap.put(s, stateBasedMap.get(s)-1);
|
||||||
if(stateBasedMap.get(s) == 0)
|
if(stateBasedMap.get(s) == 0)
|
||||||
stateBasedMap.remove(s);
|
stateBasedMap.remove(s);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public HashMap<String, Integer> getStateBasedMap()
|
public HashMap<String, Integer> getStateBasedMap()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user