package villa1;
import Globales.*;

public class Tiendas extends Inicio {

    /** Creates new form Cargar */
    public Tiendas() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton4 = new javax.swing.JButton();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        panelObj = new javax.swing.JPanel();
        labelObj = new javax.swing.JLabel();
        btnAtras = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        labelDinero = new javax.swing.JLabel();
        textDinero = new javax.swing.JTextField();
        btnPocion = new javax.swing.JButton();
        btnSuperpocion = new javax.swing.JButton();
        labelObj1 = new javax.swing.JLabel();
        labelObj2 = new javax.swing.JLabel();
        textCompra = new javax.swing.JTextField();
        panelEquip = new javax.swing.JPanel();
        labelEquip = new javax.swing.JLabel();
        labelCab = new javax.swing.JLabel();
        labeldinero2 = new javax.swing.JLabel();
        textDinero2 = new javax.swing.JTextField();
        labelArm = new javax.swing.JLabel();
        btnBisera = new javax.swing.JButton();
        btnGorra = new javax.swing.JButton();
        btnCasco = new javax.swing.JButton();
        labelBisera = new javax.swing.JLabel();
        labelGorra = new javax.swing.JLabel();
        labelCasco = new javax.swing.JLabel();
        textCompra2 = new javax.swing.JTextField();
        btnEspadaGrande = new javax.swing.JButton();
        btnEspadasDobles = new javax.swing.JButton();
        btnHacha = new javax.swing.JButton();
        labelEspadaGrande = new javax.swing.JLabel();
        labelEspadasDobles = new javax.swing.JLabel();
        labelHacha = new javax.swing.JLabel();
        btnAtras2 = new javax.swing.JButton();

        jButton4.setText("jButton4");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("RpG Java - Tiendas");

        labelObj.setFont(new java.awt.Font("Tahoma", 2, 18)); // NOI18N
        labelObj.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        labelObj.setText(". Tienda Objetos .");

        btnAtras.setText("Atras");
        btnAtras.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAtrasActionPerformed(evt);
            }
        });

        jLabel1.setText("Bienvenido a la Tienda de Objetos. Pulsa el botón del objeto que quieras comprar.");

        labelDinero.setText("Dinero Actual:");

        textDinero.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        textDinero.setText(pers.dinero+" leutas");

        btnPocion.setText("Poción");
        btnPocion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPocionActionPerformed(evt);
            }
        });

        btnSuperpocion.setText("Superpoción");
        btnSuperpocion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSuperpocionActionPerformed(evt);
            }
        });

        labelObj1.setText("Precio: 100 leutas. Efecto: +20 Hp");

        labelObj2.setText("Precio: 200 leutas. efecto: +50 Hp");

        textCompra.setEditable(false);
        textCompra.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        javax.swing.GroupLayout panelObjLayout = new javax.swing.GroupLayout(panelObj);
        panelObj.setLayout(panelObjLayout);
        panelObjLayout.setHorizontalGroup(
            panelObjLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelObjLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelObjLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(textCompra, javax.swing.GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE)
                    .addComponent(labelObj, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE)
                    .addComponent(btnAtras)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, panelObjLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(panelObjLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addGroup(panelObjLayout.createSequentialGroup()
                                .addGroup(panelObjLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(btnPocion, javax.swing.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)
                                    .addComponent(btnSuperpocion, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(panelObjLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(panelObjLayout.createSequentialGroup()
                                        .addComponent(labelDinero)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(textDinero, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(panelObjLayout.createSequentialGroup()
                                        .addGap(38, 38, 38)
                                        .addGroup(panelObjLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(labelObj2)
                                            .addComponent(labelObj1))))))))
                .addContainerGap())
        );
        panelObjLayout.setVerticalGroup(
            panelObjLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelObjLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(labelObj, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addGroup(panelObjLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textDinero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(labelDinero))
                .addGap(26, 26, 26)
                .addGroup(panelObjLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnPocion)
                    .addComponent(labelObj1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelObjLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelObj2)
                    .addComponent(btnSuperpocion))
                .addGap(77, 77, 77)
                .addComponent(textCompra, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE)
                .addComponent(btnAtras)
                .addContainerGap())
        );

        btnAtras.getAccessibleContext().setAccessibleName("btnAtras");
        btnPocion.getAccessibleContext().setAccessibleName("btnPoción");
        btnSuperpocion.getAccessibleContext().setAccessibleName("btnSuperpoción");

        jTabbedPane1.addTab("tab1", panelObj);
        jTabbedPane1.addTab("Objetos",panelObj);

        labelEquip.setFont(new java.awt.Font("Tahoma", 2, 18)); // NOI18N
        labelEquip.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        labelEquip.setText(". Tienda Equipamiento .");

        labelCab.setText("Equipamiento de cabeza:");

        labeldinero2.setText("Dinero actual:");

        textDinero2.setEditable(false);
        textDinero2.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        textDinero2.setText(pers.dinero+" leutas");

        labelArm.setText("Equipamiento de armas:");

        btnBisera.setText("Bisera");
        btnBisera.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBiseraActionPerformed(evt);
            }
        });

        btnGorra.setText("Gorra");
        btnGorra.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGorraActionPerformed(evt);
            }
        });

        btnCasco.setText("Casco");
        btnCasco.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCascoActionPerformed(evt);
            }
        });

        labelBisera.setText("Precio: 50 leutas. (+1 Def)");

        labelGorra.setText("Precio: 100 leutas. (+2 Def)");

        labelCasco.setText("Precio: 150 leutas. (+4 Def)");

        textCompra2.setEditable(false);
        textCompra2.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        btnEspadaGrande.setText("Espada Grande");
        btnEspadaGrande.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEspadaGrandeActionPerformed(evt);
            }
        });

        btnEspadasDobles.setText("Espadas Dobles");
        btnEspadasDobles.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEspadasDoblesActionPerformed(evt);
            }
        });

        btnHacha.setText("Hacha");
        btnHacha.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnHachaActionPerformed(evt);
            }
        });

        labelEspadaGrande.setText("Precio: 500 leutas. (+5 Atc)");

        labelEspadasDobles.setText("Precio: 700 leutas. (+7 Atc, -2 Def)");

        labelHacha.setText("Precio 1000 leutas. (+10 Atc, -1 Def)");

        btnAtras2.setText("Atras");
        btnAtras2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAtras2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panelEquipLayout = new javax.swing.GroupLayout(panelEquip);
        panelEquip.setLayout(panelEquipLayout);
        panelEquipLayout.setHorizontalGroup(
            panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelEquipLayout.createSequentialGroup()
                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelEquipLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(labelEquip, javax.swing.GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE))
                    .addGroup(panelEquipLayout.createSequentialGroup()
                        .addGap(19, 19, 19)
                        .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(textCompra2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE)
                            .addGroup(panelEquipLayout.createSequentialGroup()
                                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(labelCab, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(labelGorra, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(labelBisera, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(btnBisera, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(btnGorra, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(labelCasco)
                                        .addComponent(btnCasco, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE)
                                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(labelEspadasDobles)
                                    .addComponent(labelEspadaGrande)
                                    .addComponent(labelArm)
                                    .addGroup(panelEquipLayout.createSequentialGroup()
                                        .addComponent(labeldinero2)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(textDinero2, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(btnEspadaGrande, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(btnEspadasDobles, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(btnHacha, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)
                                        .addComponent(labelHacha, javax.swing.GroupLayout.Alignment.LEADING))))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelEquipLayout.createSequentialGroup()
                        .addContainerGap(354, Short.MAX_VALUE)
                        .addComponent(btnAtras2)))
                .addContainerGap())
        );
        panelEquipLayout.setVerticalGroup(
            panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelEquipLayout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addComponent(labelEquip)
                .addGap(18, 18, 18)
                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labeldinero2)
                    .addComponent(textDinero2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(13, 13, 13)
                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelCab)
                    .addComponent(labelArm))
                .addGap(18, 18, 18)
                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnBisera)
                    .addComponent(btnEspadaGrande))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 13, Short.MAX_VALUE)
                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelBisera)
                    .addComponent(labelEspadaGrande))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnGorra)
                    .addComponent(btnEspadasDobles))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelGorra)
                    .addComponent(labelEspadasDobles))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnCasco)
                    .addComponent(btnHacha))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelCasco)
                    .addComponent(labelHacha))
                .addGap(16, 16, 16)
                .addComponent(textCompra2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnAtras2)
                .addGap(5, 5, 5))
        );

        jTabbedPane1.addTab("tab2", panelEquip);
        jTabbedPane1.addTab("Equipamiento", panelEquip);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 428, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 378, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnAtrasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAtrasActionPerformed
        this.hide();
        new villa1.NMenu().setVisible(true);
}//GEN-LAST:event_btnAtrasActionPerformed

    private void btnPocionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPocionActionPerformed
if (pers.dinero >= 100){
        pers.contObj1 = pers.contObj1 + 1;
        pers.dinero = pers.dinero - 100;
        textDinero.setText(pers.dinero+" leutas");
        textCompra.setText("Poción comprada con éxito.");
}
else{
    textCompra.setText("No tienes dinero suficiente para realizar la compra");
}// TODO add your handling code here:
    }//GEN-LAST:event_btnPocionActionPerformed

    private void btnSuperpocionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSuperpocionActionPerformed
if (pers.dinero >= 100){
        pers.contObj1 = pers.contObj1 + 1;
        pers.dinero = pers.dinero - 100;
        textDinero.setText(pers.dinero+" leutas");
        textCompra.setText("Poción comprada con éxito.");
}
else{
    textCompra.setText("No tienes dinero suficiente para realizar la compra");
}// TODO add your handling code here:
    }//GEN-LAST:event_btnSuperpocionActionPerformed

    private void btnBiseraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBiseraActionPerformed
if ((pers.dinero >= 50) && (pers.cC1 == 0)){
    pers.dinero =  pers.dinero - 50;
    pers.cC1 = 1;
    textDinero2.setText(pers.dinero+" leutas");
    textCompra2.setText("Bisera comprada correctamente.");
}
else if (pers.dinero < 50){
    textCompra2.setText ("No tienes dinero suficiente para realizar la compra.");
}
else if (pers.cC1 == 1){
    textCompra2.setText("Ya tienes este objeto, no puedes comprar mas.");
}// TODO add your handling code here:
    }//GEN-LAST:event_btnBiseraActionPerformed

    private void btnGorraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGorraActionPerformed
if ((pers.dinero >= 100) && (pers.cC2 == 0)){
    pers.dinero =  pers.dinero - 100;
    pers.cC2 = 1;
    textDinero2.setText(pers.dinero+" leutas");
    textCompra2.setText("Gorra comprada correctamente.");
}
else if (pers.dinero < 100){
    textCompra2.setText ("No tienes dinero suficiente para realizar la compra.");
}
else if (pers.cC2 == 1){
    textCompra2.setText("Ya tienes este objeto, no puedes comprar mas.");
}        // TODO add your handling code here:
    }//GEN-LAST:event_btnGorraActionPerformed

    private void btnCascoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCascoActionPerformed
if ((pers.dinero >= 150) && (pers.cC3 == 0)){
    pers.dinero =  pers.dinero - 150;
    pers.cC3 = 1;
    textDinero2.setText(pers.dinero+" leutas");
    textCompra2.setText("Casco comprado correctamente.");
}
else if (pers.dinero < 150){
    textCompra2.setText ("No tienes dinero suficiente para realizar la compra.");
}
else if (pers.cC3 == 1){
    textCompra2.setText("Ya tienes este objeto, no puedes comprar mas.");
}        // TODO add your handling code here:
    }//GEN-LAST:event_btnCascoActionPerformed

    private void btnEspadaGrandeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEspadaGrandeActionPerformed
if ((pers.dinero >= 500) && (pers.cE1 == 0)){
    pers.dinero =  pers.dinero - 500;
    pers.cE1 = 1;
    textDinero2.setText(pers.dinero+" leutas");
    textCompra2.setText("Espada Grande comprada correctamente.");
}
else if (pers.dinero < 500){
    textCompra2.setText ("No tienes dinero suficiente para realizar la compra.");
}
else if (pers.cE1 == 1){
    textCompra2.setText("Ya tienes este objeto, no puedes comprar mas.");
}        // TODO add your handling code here:
    }//GEN-LAST:event_btnEspadaGrandeActionPerformed

    private void btnEspadasDoblesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEspadasDoblesActionPerformed
if ((pers.dinero >= 700) && (pers.cE2 == 0)){
    pers.dinero =  pers.dinero - 700;
    pers.cE2 = 1;
    textDinero2.setText(pers.dinero+" leutas");
    textCompra2.setText("Espadas dobles compradas correctamente.");
}
else if (pers.dinero < 700){
    textCompra2.setText ("No tienes dinero suficiente para realizar la compra.");
}
else if (pers.cE2 == 1){
    textCompra2.setText("Ya tienes este objeto, no puedes comprar mas.");
}           // TODO add your handling code here:
    }//GEN-LAST:event_btnEspadasDoblesActionPerformed

    private void btnHachaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnHachaActionPerformed
if ((pers.dinero >= 1000) && (pers.cE3 == 0)){
    pers.dinero =  pers.dinero - 1000;
    pers.cE3 = 1;
    textDinero2.setText(pers.dinero+" leutas");
    textCompra2.setText("Hacha comprada correctamente.");
}
else if (pers.dinero < 1000){
    textCompra2.setText ("No tienes dinero suficiente para realizar la compra.");
}
else if (pers.cE3 == 1){
    textCompra2.setText("Ya tienes este objeto, no puedes comprar mas.");
}           // TODO add your handling code here:
    }//GEN-LAST:event_btnHachaActionPerformed

    private void btnAtras2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAtras2ActionPerformed
         this.hide();
        new villa1.NMenu().setVisible(true);        // TODO add your handling code here:
    }//GEN-LAST:event_btnAtras2ActionPerformed

    /**
    * @param args the command line arguments
    */
   

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAtras;
    private javax.swing.JButton btnAtras2;
    private javax.swing.JButton btnBisera;
    private javax.swing.JButton btnCasco;
    private javax.swing.JButton btnEspadaGrande;
    private javax.swing.JButton btnEspadasDobles;
    private javax.swing.JButton btnGorra;
    private javax.swing.JButton btnHacha;
    private javax.swing.JButton btnPocion;
    private javax.swing.JButton btnSuperpocion;
    private javax.swing.JButton jButton4;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JLabel labelArm;
    private javax.swing.JLabel labelBisera;
    private javax.swing.JLabel labelCab;
    private javax.swing.JLabel labelCasco;
    private javax.swing.JLabel labelDinero;
    private javax.swing.JLabel labelEquip;
    private javax.swing.JLabel labelEspadaGrande;
    private javax.swing.JLabel labelEspadasDobles;
    private javax.swing.JLabel labelGorra;
    private javax.swing.JLabel labelHacha;
    private javax.swing.JLabel labelObj;
    private javax.swing.JLabel labelObj1;
    private javax.swing.JLabel labelObj2;
    private javax.swing.JLabel labeldinero2;
    private javax.swing.JPanel panelEquip;
    private javax.swing.JPanel panelObj;
    private javax.swing.JTextField textCompra;
    private javax.swing.JTextField textCompra2;
    private javax.swing.JTextField textDinero;
    private javax.swing.JTextField textDinero2;
    // End of variables declaration//GEN-END:variables

}
