mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
- Added a new "shop" (the Library) to the Bazaar.
- Added a new item to the Treasury. - Should be able to Mulligan to 0 now.
This commit is contained in:
3
.gitattributes
vendored
3
.gitattributes
vendored
@@ -38,6 +38,7 @@ res/pics/icons/BookIcon.png -text svneol=unset#image/png
|
||||
res/pics/icons/BottlesIconSmall.png -text svneol=unset#image/png
|
||||
res/pics/icons/BoxIcon.png -text svneol=unset#image/png
|
||||
res/pics/icons/BoxIconSmall.png -text svneol=unset#image/png
|
||||
res/pics/icons/CoinIcon.png -text svneol=unset#image/png
|
||||
res/pics/icons/CoinIconSmall.jpg -text svneol=unset#image/jpeg
|
||||
res/pics/icons/ElixirIcon.png -text svneol=unset#image/png
|
||||
res/pics/icons/FoxIconSmall.png -text svneol=unset#image/png
|
||||
@@ -47,6 +48,7 @@ res/pics/icons/GoldIconSmall.png -text svneol=unset#image/png
|
||||
res/pics/icons/HeartIcon.png -text svneol=unset#image/png
|
||||
res/pics/icons/LeafIconSmall.png -text svneol=unset#image/png
|
||||
res/pics/icons/MapIcon.png -text svneol=unset#image/png
|
||||
res/pics/icons/bookIconSmall.png -text svneol=unset#image/png
|
||||
res/pics/icons/notesIcon.png -text svneol=unset#image/png
|
||||
res/pics_link/card-pictures_a.txt -text svneol=native#text/plain
|
||||
res/pics_link/card-pictures_b.txt -text svneol=native#text/plain
|
||||
@@ -308,6 +310,7 @@ src/forge/Gui_DeckEditor_Menu.java svneol=native#text/plain
|
||||
src/forge/Gui_DownloadPictures.java svneol=native#text/plain
|
||||
src/forge/Gui_DownloadPictures_LQ.java -text svneol=native#text/plain
|
||||
src/forge/Gui_ElixirShop.java -text svneol=native#text/plain
|
||||
src/forge/Gui_Library.java -text svneol=native#text/plain
|
||||
src/forge/Gui_MultipleBlockers.java svneol=native#text/plain
|
||||
src/forge/Gui_NewGame.java svneol=native#text/plain
|
||||
src/forge/Gui_PetShop.java -text svneol=native#text/plain
|
||||
|
||||
BIN
res/pics/icons/CoinIcon.png
Normal file
BIN
res/pics/icons/CoinIcon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
BIN
res/pics/icons/bookIconSmall.png
Normal file
BIN
res/pics/icons/bookIconSmall.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -23,7 +23,7 @@ public class QuestData_State implements Serializable {
|
||||
private static final long serialVersionUID = 7007940230351051937L;
|
||||
|
||||
int rankIndex, win, lost;
|
||||
int plantLevel, wolfPetLevel, crocPetLevel, life, estatesLevel, questsPlayed;
|
||||
int plantLevel, wolfPetLevel, crocPetLevel, life, estatesLevel, luckyCoinLevel, sleightOfHandLevel, questsPlayed;
|
||||
long credits;
|
||||
String difficulty, mode, selectedPet;
|
||||
|
||||
@@ -43,6 +43,6 @@ public class QuestData_State implements Serializable {
|
||||
for(Entry<String, Deck> deck:this.aiDecks.entrySet()) {
|
||||
aiDecks.put(deck.getKey(), deck.getValue().migrate());
|
||||
}
|
||||
return new forge.QuestData_State(rankIndex, win, lost, plantLevel, wolfPetLevel, crocPetLevel, selectedPet, life, estatesLevel, questsPlayed, availableQuests, completedQuests,credits, difficulty, mode, cardPool, shopList, myDecks, aiDecks);
|
||||
return new forge.QuestData_State(rankIndex, win, lost, plantLevel, wolfPetLevel, crocPetLevel, selectedPet, life, estatesLevel, luckyCoinLevel, sleightOfHandLevel, questsPlayed, availableQuests, completedQuests,credits, difficulty, mode, cardPool, shopList, myDecks, aiDecks);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1058,6 +1058,7 @@ public class GameAction {
|
||||
AllZone.GameInfo.setHumanCanPlayNumberOfLands(1);
|
||||
|
||||
AllZone.GameInfo.setPreventCombatDamageThisTurn(false);
|
||||
AllZone.GameInfo.setHumanNumberOfTimesMulliganed(0);
|
||||
|
||||
AllZone.Human_PoisonCounter.setPoisonCounters(0);
|
||||
AllZone.Computer_PoisonCounter.setPoisonCounters(0);
|
||||
|
||||
@@ -7,6 +7,8 @@ public class GameInfo {
|
||||
private boolean computerPlayedFirstLandThisTurn;
|
||||
private boolean humanPlayedFirstLandThisTurn;
|
||||
|
||||
private int humanNumberOfTimesMulliganed;
|
||||
|
||||
private boolean preventCombatDamageThisTurn;
|
||||
|
||||
public void setComputerCanPlayNumberOfLands(int n) {
|
||||
@@ -52,7 +54,20 @@ public class GameInfo {
|
||||
return humanPlayedFirstLandThisTurn;
|
||||
}
|
||||
|
||||
public int getHumanNumberOfTimesMulliganed()
|
||||
{
|
||||
return humanNumberOfTimesMulliganed;
|
||||
}
|
||||
|
||||
public void addHumanNumberOfTimesMulliganed(int n)
|
||||
{
|
||||
humanNumberOfTimesMulliganed+=n;
|
||||
}
|
||||
|
||||
public void setHumanNumberOfTimesMulliganed(int n)
|
||||
{
|
||||
humanNumberOfTimesMulliganed = n;
|
||||
}
|
||||
|
||||
public void setPreventCombatDamageThisTurn(boolean b) {
|
||||
preventCombatDamageThisTurn = b;
|
||||
|
||||
210
src/forge/Gui_Library.java
Normal file
210
src/forge/Gui_Library.java
Normal file
@@ -0,0 +1,210 @@
|
||||
package forge;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.io.File;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.SwingConstants;
|
||||
|
||||
import forge.error.ErrorViewer;
|
||||
import forge.properties.ForgeProps;
|
||||
import forge.properties.NewConstants;
|
||||
|
||||
public class Gui_Library extends JFrame implements NewConstants{
|
||||
|
||||
private static final long serialVersionUID = 2409591658245091210L;
|
||||
|
||||
private JFrame shopsGUI;
|
||||
private JLabel titleLabel = new JLabel();
|
||||
|
||||
private JLabel sleightOfHandDescLabel = new JLabel();
|
||||
|
||||
private JLabel sleightOfHandPriceLabel = new JLabel();
|
||||
private JLabel sleightOfHandIconLabel = new JLabel();
|
||||
|
||||
private JLabel creditsLabel = new JLabel();
|
||||
|
||||
private ImageIcon sleightOfHandIcon = new ImageIcon();
|
||||
|
||||
private JButton sleightOfHandButton= new JButton();
|
||||
private JButton quitButton = new JButton();
|
||||
|
||||
private QuestData questData = AllZone.QuestData;
|
||||
|
||||
public Gui_Library(JFrame parent) {
|
||||
try {
|
||||
jbInit();
|
||||
} catch(Exception ex) {
|
||||
ErrorViewer.showError(ex);
|
||||
}
|
||||
|
||||
shopsGUI = parent;
|
||||
|
||||
setup();
|
||||
|
||||
//for some reason, the Bazaar window does not return when closing with X
|
||||
//for now, just disable X closing:
|
||||
this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
||||
|
||||
Dimension screen = this.getToolkit().getScreenSize();
|
||||
setBounds(screen.width / 3, 100, //position
|
||||
530, 430); //size
|
||||
setVisible(true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
//only do this ONCE:
|
||||
private void setup() {
|
||||
sleightOfHandButton.setBounds(new Rectangle(10, 297, 120, 50));
|
||||
sleightOfHandButton.setText(getButtonText());
|
||||
//buyPlantButton.setIcon(icon);
|
||||
sleightOfHandButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
learnEstatesButton_actionPerformed(e);
|
||||
} catch (Exception e1) {
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}//setup();
|
||||
|
||||
private String getDesc()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("<html>");
|
||||
|
||||
if (questData.getSleightOfHandLevel() == 0)
|
||||
{
|
||||
sb.append("<u><b>Sleight of Hand Vol. I</b></u><br>");
|
||||
sb.append("These volumes explain how to perform the most difficult of sleights.<br>");
|
||||
sb.append("<u>Your first mulligan is <b>free</b></u>.");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.append("Currently nothing to study at the Library. <br>Please check back later.");
|
||||
}
|
||||
|
||||
sb.append("</html>");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private long getPrice()
|
||||
{
|
||||
long l = 0;
|
||||
if (questData.getSleightOfHandLevel() == 0)
|
||||
l = 2000;
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
private String getButtonText()
|
||||
{
|
||||
return "Learn Sleight";
|
||||
}
|
||||
|
||||
private String getImageString()
|
||||
{
|
||||
return "BookIcon.png";
|
||||
}
|
||||
|
||||
private void jbInit() throws Exception {
|
||||
titleLabel.setFont(new java.awt.Font("sserif", Font.BOLD, 22));
|
||||
titleLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
titleLabel.setText("Library");
|
||||
titleLabel.setBounds(new Rectangle(130, 5, 198, 60));
|
||||
this.getContentPane().setLayout(null);
|
||||
|
||||
/*
|
||||
potionStatsLabel.setFont(new Font("sserif", Font.BOLD, 12));
|
||||
potionStatsLabel.setText(getStats());
|
||||
potionStatsLabel.setBounds(new Rectangle(10, 65, 100, 15));
|
||||
*/
|
||||
|
||||
sleightOfHandDescLabel.setFont(new Font("sserif", 0, 12));
|
||||
sleightOfHandDescLabel.setText(getDesc());
|
||||
sleightOfHandDescLabel.setBounds(new Rectangle(10, 80, 300, 150));
|
||||
|
||||
sleightOfHandPriceLabel.setFont(new Font("sserif", 0, 12));
|
||||
sleightOfHandPriceLabel.setText("<html><b><u>Price</u></b>: " + getPrice() + " credits</html>");
|
||||
sleightOfHandPriceLabel.setBounds(new Rectangle(10, 230, 150, 15));
|
||||
|
||||
creditsLabel.setFont(new Font("sserif", 0, 12));
|
||||
creditsLabel.setText("Credits: " + questData.getCredits());
|
||||
creditsLabel.setBounds(new Rectangle(10, 265, 150, 15));
|
||||
|
||||
sleightOfHandIcon = getIcon(getImageString());
|
||||
sleightOfHandIconLabel.setText("");
|
||||
sleightOfHandIconLabel.setIcon(sleightOfHandIcon);
|
||||
sleightOfHandIconLabel.setBounds(new Rectangle(300, 135, 128, 128));
|
||||
sleightOfHandIconLabel.setIconTextGap(0);
|
||||
|
||||
//String fileName = "LeafIconSmall.png";
|
||||
//ImageIcon icon = getIcon(fileName);
|
||||
|
||||
sleightOfHandButton.setEnabled(true);
|
||||
if (questData.getCredits() < getPrice() || questData.getSleightOfHandLevel() >= 1)
|
||||
sleightOfHandButton.setEnabled(false);
|
||||
|
||||
quitButton.setBounds(new Rectangle(140, 297, 120, 50));
|
||||
quitButton.setText("Quit");
|
||||
quitButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
quitButton_actionPerformed(e);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//jPanel2.add(quitButton, null);
|
||||
this.getContentPane().add(sleightOfHandButton, null);
|
||||
this.getContentPane().add(titleLabel, null);
|
||||
this.getContentPane().add(sleightOfHandDescLabel, null);
|
||||
this.getContentPane().add(sleightOfHandIconLabel, null);
|
||||
this.getContentPane().add(sleightOfHandPriceLabel, null);
|
||||
this.getContentPane().add(creditsLabel, null);
|
||||
this.getContentPane().add(quitButton,null);
|
||||
}
|
||||
|
||||
void learnEstatesButton_actionPerformed(ActionEvent e) throws Exception {
|
||||
questData.subtractCredits(getPrice());
|
||||
|
||||
if (questData.getSleightOfHandLevel() < 1)
|
||||
{
|
||||
questData.addSleightOfHandLevel(1);
|
||||
}
|
||||
QuestData.saveData(questData);
|
||||
jbInit();
|
||||
}
|
||||
|
||||
private ImageIcon getIcon(String fileName)
|
||||
{
|
||||
File base = ForgeProps.getFile(IMAGE_ICON);
|
||||
File file = new File(base, fileName);
|
||||
ImageIcon icon = new ImageIcon(file.toString());
|
||||
return icon;
|
||||
}
|
||||
|
||||
void quitButton_actionPerformed(ActionEvent e) {
|
||||
QuestData.saveData(questData);
|
||||
//new Gui_Shops();
|
||||
shopsGUI.setVisible(true);
|
||||
|
||||
dispose();
|
||||
|
||||
}
|
||||
|
||||
void this_windowClosing(WindowEvent e) {
|
||||
quitButton_actionPerformed(null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -35,6 +35,7 @@ public class Gui_Shops extends JFrame implements NewConstants {
|
||||
private JButton plantShopButton = new JButton();
|
||||
private JButton healthShopButton = new JButton();
|
||||
private JButton bankButton = new JButton();
|
||||
private JButton libraryButton = new JButton();
|
||||
private JButton quitButton = new JButton();
|
||||
|
||||
private JPanel jPanel2 = new JPanel();
|
||||
@@ -63,7 +64,7 @@ public class Gui_Shops extends JFrame implements NewConstants {
|
||||
|
||||
Dimension screen = this.getToolkit().getScreenSize();
|
||||
setBounds(screen.width / 3, 100, //position
|
||||
286, 630); //size
|
||||
286, 700); //size
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
@@ -124,7 +125,18 @@ public class Gui_Shops extends JFrame implements NewConstants {
|
||||
}
|
||||
});
|
||||
|
||||
quitButton.setBounds(new Rectangle(45, 445, 180, 77));
|
||||
fileName = "BookIconSmall.png";
|
||||
icon = getIcon(fileName);
|
||||
libraryButton.setBounds(new Rectangle(25, 360, 180, 77));
|
||||
libraryButton.setText("Library");
|
||||
libraryButton.setIcon(icon);
|
||||
libraryButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
libraryButton_actionPerformed(e);
|
||||
}
|
||||
});
|
||||
|
||||
quitButton.setBounds(new Rectangle(45, 530, 180, 77));
|
||||
quitButton.setText("Quit");
|
||||
quitButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@@ -133,7 +145,7 @@ public class Gui_Shops extends JFrame implements NewConstants {
|
||||
});
|
||||
|
||||
jPanel2.setBorder(BorderFactory.createLineBorder(Color.black));
|
||||
jPanel2.setBounds(new Rectangle(20, 50, 230, 375));
|
||||
jPanel2.setBounds(new Rectangle(20, 50, 234, 452));
|
||||
jPanel2.setLayout(null);
|
||||
this.addWindowListener(new java.awt.event.WindowAdapter() {
|
||||
@Override
|
||||
@@ -146,6 +158,7 @@ public class Gui_Shops extends JFrame implements NewConstants {
|
||||
jPanel2.add(plantShopButton, null);
|
||||
jPanel2.add(bankButton, null);
|
||||
jPanel2.add(healthShopButton, null);
|
||||
jPanel2.add(libraryButton, null);
|
||||
//jPanel2.add(quitButton, null);
|
||||
jPanel2.add(petShopButton, null);
|
||||
this.getContentPane().add(titleLabel, null);
|
||||
@@ -205,6 +218,13 @@ public class Gui_Shops extends JFrame implements NewConstants {
|
||||
dispose();
|
||||
}
|
||||
|
||||
void libraryButton_actionPerformed(ActionEvent e){
|
||||
Gui_Library g = new Gui_Library(this);
|
||||
g.setVisible(true);
|
||||
|
||||
dispose();
|
||||
}
|
||||
|
||||
private ImageIcon getIcon(String fileName)
|
||||
{
|
||||
File base = ForgeProps.getFile(IMAGE_ICON);
|
||||
|
||||
@@ -102,12 +102,19 @@ public class Gui_Treasury extends JFrame implements NewConstants{
|
||||
sb.append("Gives a bonus of <b>20%</b> to match winnings.<br>");
|
||||
sb.append("Improves sell percentage by <b>2.5%</b>.");
|
||||
}
|
||||
else if (questData.getEstatesLevel() >= 3 && questData.getLuckyCoinLevel() == 0)
|
||||
{
|
||||
sb.append("Estates Level Maxed out.<br>");
|
||||
sb.append("<u><b>Lucky Coin</b></u><br>");
|
||||
sb.append("This coin is believed to give good luck to its owner.<br>");
|
||||
sb.append("Improves the chance of getting a random <br>rare after each match by <b>15%</b>.");
|
||||
/*sb.append("Current Level: 3/3<br>");
|
||||
sb.append("Gives a bonus of <b>20%</b> to match winnings.<br>");
|
||||
sb.append("Improves sell percentage by <b>2.5%</b>.");*/
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.append("<u>Estates Level Maxed out</u>.<br>");
|
||||
sb.append("Current Level: 3/3<br>");
|
||||
sb.append("Gives a bonus of <b>20%</b> to match winnings.<br>");
|
||||
sb.append("Improves sell percentage by <b>2.5%</b>.");
|
||||
sb.append("Currently nothing for sale at the Treasury. <br>Please check back later.");
|
||||
}
|
||||
|
||||
sb.append("</html>");
|
||||
@@ -123,18 +130,27 @@ public class Gui_Treasury extends JFrame implements NewConstants{
|
||||
l = 750;
|
||||
else if (questData.getEstatesLevel() == 2)
|
||||
l = 1000;
|
||||
else if (questData.getEstatesLevel() >= 3 && questData.getLuckyCoinLevel() == 0)
|
||||
l = 500;
|
||||
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
private String getButtonText()
|
||||
{
|
||||
if (questData.getEstatesLevel() < 3)
|
||||
return "Learn Estates";
|
||||
else
|
||||
return "Buy Coin";
|
||||
}
|
||||
|
||||
private String getImageString()
|
||||
{
|
||||
if (questData.getEstatesLevel() < 3)
|
||||
return "GoldIconLarge.png";
|
||||
else
|
||||
return "CoinIcon.png";
|
||||
}
|
||||
|
||||
private void jbInit() throws Exception {
|
||||
@@ -172,7 +188,7 @@ public class Gui_Treasury extends JFrame implements NewConstants{
|
||||
//ImageIcon icon = getIcon(fileName);
|
||||
|
||||
learnEstatesButton.setEnabled(true);
|
||||
if (questData.getCredits() < getPrice() || questData.getEstatesLevel() >= 3)
|
||||
if (questData.getCredits() < getPrice() || (questData.getEstatesLevel() >= 3 && questData.getLuckyCoinLevel() >= 1))
|
||||
learnEstatesButton.setEnabled(false);
|
||||
|
||||
quitButton.setBounds(new Rectangle(140, 297, 120, 50));
|
||||
@@ -196,7 +212,15 @@ public class Gui_Treasury extends JFrame implements NewConstants{
|
||||
|
||||
void learnEstatesButton_actionPerformed(ActionEvent e) throws Exception {
|
||||
questData.subtractCredits(getPrice());
|
||||
|
||||
if (questData.getEstatesLevel() < 3)
|
||||
{
|
||||
questData.addEstatesLevel(1);
|
||||
}
|
||||
else if (questData.getLuckyCoinLevel() < 1)
|
||||
{
|
||||
questData.addLuckyCoinLevel(1);
|
||||
}
|
||||
QuestData.saveData(questData);
|
||||
jbInit();
|
||||
}
|
||||
|
||||
@@ -32,11 +32,21 @@ public class Input_Mulligan extends Input {
|
||||
for(int i = 0; i < 100; i++)
|
||||
AllZone.GameAction.shuffle(Constant.Player.Human);
|
||||
|
||||
|
||||
int newHand = hand.length - 1;
|
||||
AllZone.GameInfo.addHumanNumberOfTimesMulliganed(1);
|
||||
|
||||
//System.out.println("Mulliganed this turn:" + AllZone.GameInfo.getHumanNumberOfTimesMulliganed());
|
||||
|
||||
if(AllZone.QuestData != null)
|
||||
{
|
||||
if (AllZone.QuestData.getSleightOfHandLevel() >= 1 && AllZone.GameInfo.getHumanNumberOfTimesMulliganed() == 1)
|
||||
newHand = hand.length;
|
||||
}
|
||||
for(int i = 0; i < newHand; i++)
|
||||
AllZone.GameAction.drawCard(Constant.Player.Human);
|
||||
|
||||
if(newHand == 1) end();
|
||||
if(newHand == 0) end();
|
||||
}//selectButtonOK()
|
||||
|
||||
void end() {
|
||||
|
||||
@@ -58,6 +58,8 @@ public class QuestData implements NewConstants {
|
||||
|
||||
private int life;
|
||||
private int estatesLevel;
|
||||
private int luckyCoinLevel;
|
||||
private int sleightOfHandLevel;
|
||||
|
||||
private int questsPlayed;
|
||||
|
||||
@@ -259,6 +261,8 @@ public class QuestData implements NewConstants {
|
||||
data.selectedPet = state.selectedPet;
|
||||
data.life = state.life;
|
||||
data.estatesLevel = state.estatesLevel;
|
||||
data.luckyCoinLevel = state.luckyCoinLevel;
|
||||
data.sleightOfHandLevel = state.sleightOfHandLevel;
|
||||
data.questsPlayed = state.questsPlayed;
|
||||
data.availableQuests = state.availableQuests;
|
||||
data.completedQuests = state.completedQuests;
|
||||
@@ -687,6 +691,26 @@ public class QuestData implements NewConstants {
|
||||
estatesLevel+=n;
|
||||
}
|
||||
|
||||
public int getLuckyCoinLevel()
|
||||
{
|
||||
return luckyCoinLevel;
|
||||
}
|
||||
|
||||
public void addLuckyCoinLevel(int n)
|
||||
{
|
||||
luckyCoinLevel+=n;
|
||||
}
|
||||
|
||||
public int getSleightOfHandLevel()
|
||||
{
|
||||
return sleightOfHandLevel;
|
||||
}
|
||||
|
||||
public void addSleightOfHandLevel(int n)
|
||||
{
|
||||
sleightOfHandLevel+=n;
|
||||
}
|
||||
|
||||
public int getQuestsPlayed()
|
||||
{
|
||||
return questsPlayed;
|
||||
@@ -749,7 +773,12 @@ public class QuestData implements NewConstants {
|
||||
}
|
||||
|
||||
public boolean shouldAddAdditionalCards(boolean didWin) {
|
||||
if(didWin) return random.nextBoolean();
|
||||
float chance = 0.5f;
|
||||
if (getLuckyCoinLevel() >= 1)
|
||||
chance = 0.65f;
|
||||
|
||||
if(didWin) return random.nextFloat() <= chance;
|
||||
|
||||
else return false;
|
||||
}
|
||||
|
||||
@@ -807,6 +836,8 @@ public class QuestData implements NewConstants {
|
||||
state.selectedPet = q.selectedPet;
|
||||
state.life = q.life;
|
||||
state.estatesLevel = q.estatesLevel;
|
||||
state.luckyCoinLevel = q.luckyCoinLevel;
|
||||
state.sleightOfHandLevel = q.sleightOfHandLevel;
|
||||
state.questsPlayed = q.questsPlayed;
|
||||
state.availableQuests = q.availableQuests;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public class QuestData_State implements Serializable {
|
||||
private static final long serialVersionUID = 7007940230351051937L;
|
||||
|
||||
int rankIndex, win, lost;
|
||||
int plantLevel, wolfPetLevel, crocPetLevel, life, estatesLevel, questsPlayed;
|
||||
int plantLevel, wolfPetLevel, crocPetLevel, life, estatesLevel, luckyCoinLevel, sleightOfHandLevel, questsPlayed;
|
||||
long credits;
|
||||
String difficulty, mode, selectedPet;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class QuestData_State implements Serializable {
|
||||
* This constructor is used by QestData_State in the default package to create a replacement object for the
|
||||
* obsolete class.
|
||||
*/
|
||||
public QuestData_State(int rankIndex, int win, int lost, int plantLevel, int wolfPetLevel, int crocPetLevel, String selectedPet, int life, int estatesLevel, int questsPlayed,
|
||||
public QuestData_State(int rankIndex, int win, int lost, int plantLevel, int wolfPetLevel, int crocPetLevel, String selectedPet, int life, int estatesLevel, int luckyCoinLevel, int sleightOfHandLevel, int questsPlayed,
|
||||
ArrayList<Integer> availableQuests, ArrayList<Integer> completedQuests, long credits, String difficulty, String mode,
|
||||
ArrayList<String> cardPool, ArrayList<String> shopList, Map<String, Deck> myDecks, Map<String, Deck> aiDecks) {
|
||||
this.rankIndex = rankIndex;
|
||||
@@ -49,6 +49,7 @@ public class QuestData_State implements Serializable {
|
||||
this.crocPetLevel = crocPetLevel;
|
||||
this.life = life;
|
||||
this.estatesLevel = estatesLevel;
|
||||
this.luckyCoinLevel = luckyCoinLevel;
|
||||
this.questsPlayed = questsPlayed;
|
||||
this.availableQuests = availableQuests;
|
||||
this.completedQuests = completedQuests;
|
||||
|
||||
Reference in New Issue
Block a user