- Fixed Dark Catacombs.

- Added some beginning code of quest rewards for winning within a certain amount of turns.
This commit is contained in:
jendave
2011-08-06 04:32:57 +00:00
parent f21d047165
commit 0c48899181
3 changed files with 44 additions and 4 deletions

View File

@@ -231,7 +231,7 @@ public class CardFactory implements NewConstants {
{
Card c = clICtrl.get(i);
for (int j = 0; j < types.length; j++)
if (c.getType().contains(types[j]))
if (c.getType().contains(types[j].trim()))
fnd = true;
}

View File

@@ -136,9 +136,24 @@ public class Gui_WinLose extends JFrame implements NewConstants {
statsLabel.setText("Won: " + winLose.getWin() + ", Lost: " + winLose.getLose());
//show "You Won" or "You Lost"
if(winLose.didWinRecently()) titleLabel.setText("You Won");
else titleLabel.setText("You Lost");
if(winLose.didWinRecently())
{
titleLabel.setText("You Won");
int game = 0;
if (winLose.getWinTurns()[0] != 0)
game = 1;
winLose.setWinTurn(game, AllZone.Phase.getTurn());
//winLose.setWinTurn(winLose.countWinLose()-1, AllZone.Phase.getTurn());
//System.out.println("CountwinLose:" + winLose.countWinLose());
//System.out.println("You won by turn: " + AllZone.Phase.getTurn());
}
else
{
titleLabel.setText("You Lost");
//System.out.println("You lost by turn: " + AllZone.Phase.getTurn());
}
}//setup();
private void jbInit() throws Exception {
@@ -280,6 +295,20 @@ public class Gui_WinLose extends JFrame implements NewConstants {
}
}
}
int[] winTurns = winLose.getWinTurns();
for (int i : winTurns)
{
System.out.println("Quest, won by turn:" + i);
if (i != 0)
{
if (i == 1)
sb.append("Won in one turn! Bonus: <b>+1500 credits</b>.<br>");
else if (i <= 5)
sb.append("Won by turn 5! Bonus: <b>+250 credits</b>.<br>");
}
}
if (winLose.getLose()==0)
sb.append("You have not lost once! Bonus: <b>+10 credits</b>.<br>");

View File

@@ -10,6 +10,8 @@ public class WinLose
//...
//
private String[] winMethods = new String[2];
private int[] winTurns = new int[2];
private int win;
private int lose;
@@ -33,6 +35,15 @@ public class WinLose
return winMethods;
}
public void setWinTurn(int gameNumber, int turns)
{
winTurns[gameNumber] = turns;
}
public int[] getWinTurns()
{
return winTurns;
}
public boolean didWinRecently() {return winRecently;}
}