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