mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Changed Helix Pinnacle AI calculation to more efficient one; lowercased setSVar.
This commit is contained in:
@@ -313,7 +313,7 @@ public class Card extends MyObservable {
|
|||||||
else return "";
|
else return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetSVar(String Var, String str) {
|
public void setSVar(String Var, String str) {
|
||||||
if(SVars.containsKey(Var)) SVars.remove(Var);
|
if(SVars.containsKey(Var)) SVars.remove(Var);
|
||||||
|
|
||||||
SVars.put(Var, str);
|
SVars.put(Var, str);
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ public class CardFactory implements NewConstants {
|
|||||||
|
|
||||||
String k[] = parse.split(":");
|
String k[] = parse.split(":");
|
||||||
|
|
||||||
if(k.length > 2) card.SetSVar(k[1], k[2]);
|
if(k.length > 2) card.setSVar(k[1], k[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16951,21 +16951,15 @@ public class CardFactory implements NewConstants {
|
|||||||
{
|
{
|
||||||
public void resolve()
|
public void resolve()
|
||||||
{
|
{
|
||||||
getSourceCard().addCounter(Counters.TOWER, getSourceCard().getX());
|
getSourceCard().addCounter(Counters.TOWER, Integer.parseInt(getManaCost()));
|
||||||
}
|
}
|
||||||
public boolean canPlayAI()
|
public boolean canPlayAI()
|
||||||
{
|
{
|
||||||
getSourceCard().setX(ComputerUtil.getAvailableMana().size());
|
int m = (int)Math.pow(2, CardFactoryUtil.getCards("Doubling Season", Constant.Player.Computer).size());
|
||||||
setManaCost(getSourceCard().getX() + "");
|
int n = Math.max(1, Math.min((int)Math.ceil((100-getSourceCard().getCounters(Counters.TOWER))/m),
|
||||||
int n = getSourceCard().getX();
|
ComputerUtil.getAvailableMana().size())) ;
|
||||||
for (Card c : AllZone.Computer_Play.getCards())
|
setManaCost(n + "");
|
||||||
{
|
return m*n <=20;
|
||||||
if (c.getName().equals("Doubling Season"))
|
|
||||||
n*=2;
|
|
||||||
if (n > 20)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
ability.setBeforePayMana(new Input()
|
ability.setBeforePayMana(new Input()
|
||||||
@@ -16976,13 +16970,13 @@ public class CardFactory implements NewConstants {
|
|||||||
{
|
{
|
||||||
String s = JOptionPane.showInputDialog("What would you like X to be?");
|
String s = JOptionPane.showInputDialog("What would you like X to be?");
|
||||||
try {
|
try {
|
||||||
ability.getSourceCard().setX(Integer.parseInt(s));
|
Integer.parseInt(s);
|
||||||
ability.setManaCost(s);
|
ability.setManaCost(s);
|
||||||
stopSetNext(new Input_PayManaCost(ability));
|
stopSetNext(new Input_PayManaCost(ability));
|
||||||
}
|
}
|
||||||
catch(NumberFormatException e){
|
catch(NumberFormatException e){
|
||||||
AllZone.Display.showMessage("\"" + s + "\" is not a number.");
|
AllZone.Display.showMessage("\"" + s + "\" is not a number.");
|
||||||
stop();
|
showMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user