mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- bugfixes
This commit is contained in:
@@ -249,8 +249,7 @@ public class BoosterDraftAI
|
||||
private int[] getDeckColors()
|
||||
{
|
||||
int[] out = new int[nDecks];
|
||||
int start = MyRandom.random.nextInt();
|
||||
start = Math.abs(start);//make number positive, stupid number generator
|
||||
int start = MyRandom.random.nextInt(10);
|
||||
|
||||
for(int i = 0; i < out.length; i++)
|
||||
{
|
||||
|
||||
@@ -250,7 +250,7 @@ public class Card extends MyObservable
|
||||
if (SVars.containsKey(Var))
|
||||
return SVars.get(Var);
|
||||
else
|
||||
return new String("");
|
||||
return "";
|
||||
}
|
||||
public void SetSVar(String Var, String str)
|
||||
{
|
||||
|
||||
@@ -888,7 +888,7 @@ public class CardFactory implements NewConstants {
|
||||
|
||||
if (ptk[0].contains("-")) // handle "-X" or "-Y"
|
||||
if (AttackX[0].contains("/")) // already contains math element
|
||||
AttackX[0].replace("/", "/Negative"); // insert into existing math element
|
||||
AttackX[0] = AttackX[0].replace("/", "/Negative"); // insert into existing math element
|
||||
else
|
||||
AttackX[0] += "/Negative"; // add math element
|
||||
}
|
||||
@@ -906,7 +906,7 @@ public class CardFactory implements NewConstants {
|
||||
|
||||
if (ptk[1].contains("-")) //handle "-X" or "-Y"
|
||||
if (DefenseX[0].contains("/")) // already contains math element
|
||||
DefenseX[0].replace("/", "/Negative"); // insert into existing math element
|
||||
DefenseX[0] = DefenseX[0].replace("/", "/Negative"); // insert into existing math element
|
||||
else
|
||||
DefenseX[0] += "/Negative"; // add math element
|
||||
}
|
||||
@@ -2891,7 +2891,7 @@ public class CardFactory implements NewConstants {
|
||||
|
||||
if (ptk[0].contains("-"))
|
||||
if (AttackX[0].contains("/"))
|
||||
AttackX[0].replace("/", "/Negative");
|
||||
AttackX[0] = AttackX[0].replace("/", "/Negative");
|
||||
else
|
||||
AttackX[0] += "/Negative";
|
||||
}
|
||||
@@ -2909,7 +2909,7 @@ public class CardFactory implements NewConstants {
|
||||
|
||||
if (ptk[1].contains("-"))
|
||||
if (DefenseX[0].contains("/"))
|
||||
DefenseX[0].replace("/", "/Negative");
|
||||
DefenseX[0] = DefenseX[0].replace("/", "/Negative");
|
||||
else
|
||||
DefenseX[0] += "/Negative";
|
||||
}
|
||||
@@ -14889,10 +14889,7 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
|
||||
else if((c == null) || (! check.equals(c)))
|
||||
throw new RuntimeException(card +" error in chooseTargetAI() - Card c is " +c +", Card check is " +check);
|
||||
|
||||
if (c != null)
|
||||
setTargetCard(c);
|
||||
else
|
||||
setTargetPlayer(Constant.Player.Human);
|
||||
setTargetCard(c);
|
||||
}//chooseTargetAI()
|
||||
|
||||
//uses "damage" variable
|
||||
|
||||
@@ -2602,7 +2602,7 @@ public class CardFactoryUtil
|
||||
{
|
||||
if (MY == false)
|
||||
someCards.addAll(myYard.getCards());
|
||||
if (OY = false)
|
||||
if (OY == false)
|
||||
someCards.addAll(opYard.getCards());
|
||||
}
|
||||
|
||||
@@ -2766,9 +2766,9 @@ public class CardFactoryUtil
|
||||
else if (s[0].contains("Twice"))
|
||||
return num * 2;
|
||||
else if (s[0].contains("HalfUp"))
|
||||
return (int) (Math.ceil(num / 2));
|
||||
return (int) (Math.ceil(num / 2.0));
|
||||
else if (s[0].contains("HalfDown"))
|
||||
return (int) (Math.floor(num / 2));
|
||||
return (int) (Math.floor(num / 2.0));
|
||||
else if (s[0].contains("Negative")) // 2/10
|
||||
return (int) num * -1;
|
||||
|
||||
|
||||
@@ -7171,12 +7171,11 @@ public class GameActionUtil
|
||||
|
||||
if (q == null || q.equals("No"))
|
||||
return;
|
||||
if (q.equals("Yes"))
|
||||
{
|
||||
CardFactoryUtil.makeToken("Beast", "G 3 3 Beast", crd, "G", new String[] {"Creature", "Beast"}, 3, 3, new String[] {""} );
|
||||
}
|
||||
}
|
||||
if (q.equals("Yes") || player.equals(Constant.Player.Computer))
|
||||
{
|
||||
CardFactoryUtil.makeToken("Beast", "G 3 3 Beast", crd, "G", new String[] {"Creature", "Beast"}, 3, 3, new String[] {""} );
|
||||
}
|
||||
//???
|
||||
else if (player.equals(Constant.Player.Computer))
|
||||
{
|
||||
CardFactoryUtil.makeToken("Beast", "G 3 3 Beast", crd, "G", new String[] {"Creature", "Beast"}, 3, 3, new String[] {""} );
|
||||
@@ -7249,25 +7248,25 @@ public class GameActionUtil
|
||||
q = AllZone.Display.getChoiceOptional("Use Bringer of the White Dawn?", choices);
|
||||
if (q == null || q.equals("No"))
|
||||
return;
|
||||
}
|
||||
if (q.equals("Yes"))
|
||||
{
|
||||
PlayerZone graveyard = AllZone.getZone(
|
||||
Constant.Zone.Graveyard, player);
|
||||
PlayerZone playZone = AllZone.getZone(Constant.Zone.Play,
|
||||
player);
|
||||
|
||||
CardList arts = new CardList(graveyard.getCards());
|
||||
arts = arts.getType("Artifact");
|
||||
|
||||
Object o = AllZone.Display.getChoiceOptional("Pick an artifact to put into play", arts.toArray());
|
||||
if (o != null)
|
||||
if (q.equals("Yes"))
|
||||
{
|
||||
Card card = (Card) o;
|
||||
graveyard.remove(card);
|
||||
playZone.add(card);
|
||||
PlayerZone graveyard = AllZone.getZone(
|
||||
Constant.Zone.Graveyard, player);
|
||||
PlayerZone playZone = AllZone.getZone(Constant.Zone.Play,
|
||||
player);
|
||||
|
||||
CardList arts = new CardList(graveyard.getCards());
|
||||
arts = arts.getType("Artifact");
|
||||
|
||||
Object o = AllZone.Display.getChoiceOptional("Pick an artifact to put into play", arts.toArray());
|
||||
if (o != null)
|
||||
{
|
||||
Card card = (Card) o;
|
||||
graveyard.remove(card);
|
||||
playZone.add(card);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if (player.equals(Constant.Player.Computer))
|
||||
@@ -10094,9 +10093,7 @@ public class GameActionUtil
|
||||
{
|
||||
public void resolve()
|
||||
{
|
||||
Card c = null;
|
||||
if (!test.isEmpty())
|
||||
c = test.get(0);
|
||||
Card c = test.get(0);
|
||||
|
||||
CardList all = new CardList(AllZone.getZone(
|
||||
Constant.Zone.Play, c.getController())
|
||||
|
||||
@@ -127,7 +127,7 @@ public class ImageEditor {
|
||||
ImageWrite(image,resultpath);
|
||||
}else{
|
||||
BufferedImage thumbImage = getScaledInstance(image,thumbWidth,thumbHeight,RenderingHints.VALUE_INTERPOLATION_BICUBIC,true);
|
||||
thumbImage = getCropInstance(thumbImage,max_x,max_y,Math.round(Math.abs(thumbWidth-max_x)/2),Math.round(Math.abs(thumbHeight-max_y)/2),RenderingHints.VALUE_INTERPOLATION_BICUBIC);
|
||||
thumbImage = getCropInstance(thumbImage,max_x,max_y,Math.round(Math.abs(thumbWidth-max_x)/2.0f),Math.round(Math.abs(thumbHeight-max_y)/2.0f),RenderingHints.VALUE_INTERPOLATION_BICUBIC);
|
||||
ImageWrite(thumbImage,resultpath);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ final class SynthesisFilter
|
||||
samples = new float[32];
|
||||
channel = channelnumber;
|
||||
scalefactor = factor;
|
||||
setEQ(eq);
|
||||
setEQ(eq0);
|
||||
//setQuality(HIGH_QUALITY);
|
||||
|
||||
reset();
|
||||
|
||||
Reference in New Issue
Block a user