package Globales;
import villa1.*;

public class Datos extends Inicio {

    /** Creates new form Cargar */
    public Datos() {
        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() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        panelPers = new javax.swing.JPanel();
        labelDatos = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        btnAtras = new javax.swing.JButton();
        jLabel10 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jProgressBar1 = new javax.swing.JProgressBar();
        panelEquip = new javax.swing.JPanel();
        labelEquipamiento = new javax.swing.JLabel();
        labelCabeza = new javax.swing.JLabel();
        labelBisera = new javax.swing.JLabel();
        labelGorra = new javax.swing.JLabel();
        labelCasco = new javax.swing.JLabel();
        labelArmas = new javax.swing.JLabel();
        labelEspadaGrande = new javax.swing.JLabel();
        labelEspadasDobles = new javax.swing.JLabel();
        labelHacha = new javax.swing.JLabel();
        boxEC1 = new javax.swing.JCheckBox();
        boxEC2 = new javax.swing.JCheckBox();
        boxEC3 = new javax.swing.JCheckBox();
        boxEA1 = new javax.swing.JCheckBox();
        boxEA2 = new javax.swing.JCheckBox();
        boxEA3 = new javax.swing.JCheckBox();
        btnAtras2 = new javax.swing.JButton();
        panelBolsa = new javax.swing.JPanel();
        labelBolsa = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        btnUsarObj1 = new javax.swing.JButton();
        btnUsarObk2 = new javax.swing.JButton();
        jTextField1 = new javax.swing.JTextField();
        btnAtras3 = new javax.swing.JButton();
        panelAtcEsp = new javax.swing.JPanel();
        labelAtcEsp = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        btnAtras4 = new javax.swing.JButton();

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

        labelDatos.setFont(new java.awt.Font("Tahoma", 2, 18));
        labelDatos.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        labelDatos.setText(". Datos Personaje .");

        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel1.setText("Datos Personaje ("+pers.mote+"):");

        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel2.setText(". HP: "+pers.hp+"/"+pers.hp_max);

        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel3.setText(". PP: "+pers.pp+"/"+pers.pp_max);

        jLabel4.setText(". Ataque: "+pers.atc);

        jLabel5.setText(". Defensa: "+pers.def);

        jLabel6.setText(". Suerte: "+pers.suerte);

        jLabel7.setText(". Agilidad: "+pers.agilidad);

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

        jLabel10.setText(". Nivel: "+pers.nivel);

        jLabel22.setFont(new java.awt.Font("Tahoma", 0, 10));
        jLabel22.setText("Nota: Si te equipas algo, ve al menu y ");

        jLabel23.setFont(new java.awt.Font("Tahoma", 0, 10));
        jLabel23.setText("vuelve aquí para recargar los datos.");

        jLabel24.setText(". Dinero: "+pers.dinero);

        jProgressBar1.setMaximum(50*pers.nivel);
        jProgressBar1.setValue(pers.exp);

        javax.swing.GroupLayout panelPersLayout = new javax.swing.GroupLayout(panelPers);
        panelPers.setLayout(panelPersLayout);
        panelPersLayout.setHorizontalGroup(
            panelPersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelPersLayout.createSequentialGroup()
                .addGroup(panelPersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3)
                    .addComponent(jLabel2)
                    .addComponent(jLabel1)
                    .addComponent(jLabel4)
                    .addComponent(jLabel5)
                    .addComponent(jLabel6)
                    .addComponent(jLabel7)
                    .addComponent(jLabel24)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelPersLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel23)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 36, Short.MAX_VALUE)
                        .addComponent(btnAtras))
                    .addGroup(panelPersLayout.createSequentialGroup()
                        .addComponent(jLabel10)
                        .addGap(18, 18, 18)
                        .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panelPersLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel22))
                    .addGroup(panelPersLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(labelDatos, javax.swing.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE)))
                .addGap(153, 153, 153))
        );
        panelPersLayout.setVerticalGroup(
            panelPersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelPersLayout.createSequentialGroup()
                .addComponent(labelDatos, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(33, 33, 33)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelPersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelPersLayout.createSequentialGroup()
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel24))
                    .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
                .addComponent(jLabel22)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelPersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnAtras)
                    .addComponent(jLabel23))
                .addContainerGap())
        );

        btnAtras.getAccessibleContext().setAccessibleName("btnAtras");

        jTabbedPane1.addTab("tab1", panelPers);
        jTabbedPane1.addTab("Personaje",panelPers);

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

        labelCabeza.setText("Cabeza:");

        if (pers.cC1 == 1){
            labelBisera.setText(". Bisera (+1 Def)");
        }

        if (pers.cC2 == 1){
            labelGorra.setText(". Gorra (+2 Def)");
        }

        if (pers.cC3 == 1){
            labelCasco.setText(". Casco (+4 Def)");
        }

        labelArmas.setText("Armas:");

        if (pers.cE1 == 1){
            labelEspadaGrande.setText(". Espada Grande (+5 Atc)");
        }

        if (pers.cE2 == 1){
            labelEspadasDobles.setText(". Espadas Dobles (+7 Atc, -2 Def)");
        }

        if (pers.cE3 == 1){
            labelHacha.setText(". Hacha (+10 Atc, -1 Def)");
        }

        if (pers.cC1 == 1){
            boxEC1.setEnabled(true);
            if (pers.bisera == 1){
                boxEC1.setSelected(true);
            }
            boxEC1.setText("Equipado");
        }
        else{
            boxEC1.setEnabled(false);
        }
        boxEC1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boxEC1ActionPerformed(evt);
            }
        });

        if (pers.cC2 == 1){
            boxEC2.setEnabled(true);
            if (pers.gorra == 1){
                boxEC2.setSelected(true);
            }
            boxEC2.setText("Equipado");
        }
        else{
            boxEC2.setEnabled(false);
        }
        boxEC2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boxEC2ActionPerformed(evt);
            }
        });

        if (pers.cC3 == 1){
            boxEC3.setEnabled(true);
            if (pers.casco == 1){
                boxEC3.setSelected(true);
            }
            boxEC3.setText("Equipado");
        }
        else{
            boxEC3.setEnabled(false);
        }
        boxEC3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boxEC3ActionPerformed(evt);
            }
        });

        if (pers.cE1 == 1){
            boxEA1.setEnabled(true);
            if (pers.espada == 1){
                boxEA1.setSelected(true);
            }
            boxEA1.setText("Equipado");
        }
        else{
            boxEA1.setEnabled(false);
        }
        boxEA1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boxEA1ActionPerformed(evt);
            }
        });

        if (pers.cE2 == 1){
            boxEA2.setEnabled(true);
            if (pers.dobles == 1){
                boxEA2.setSelected(true);
            }
            boxEA2.setText("Equipado");
        }
        else{
            boxEA2.setEnabled(false);
        }
        boxEA2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boxEA2ActionPerformed(evt);
            }
        });

        if (pers.cE3 == 1){
            boxEA3.setEnabled(true);
            if (pers.hacha == 1){
                boxEA3.setSelected(true);
            }
            boxEA3.setText("Equipado");
        }
        else{
            boxEA3.setEnabled(false);
        }
        boxEA3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boxEA3ActionPerformed(evt);
            }
        });

        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()
                        .addGap(21, 21, 21)
                        .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(labelCabeza)
                            .addGroup(panelEquipLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(panelEquipLayout.createSequentialGroup()
                                        .addComponent(labelCasco)
                                        .addGap(18, 18, 18)
                                        .addComponent(boxEC3))
                                    .addGroup(panelEquipLayout.createSequentialGroup()
                                        .addComponent(labelBisera)
                                        .addGap(18, 18, 18)
                                        .addComponent(boxEC1))
                                    .addGroup(panelEquipLayout.createSequentialGroup()
                                        .addComponent(labelGorra)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(boxEC2))))
                            .addComponent(labelArmas)))
                    .addGroup(panelEquipLayout.createSequentialGroup()
                        .addGap(35, 35, 35)
                        .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(panelEquipLayout.createSequentialGroup()
                                .addComponent(labelEspadasDobles)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 142, Short.MAX_VALUE)
                                .addComponent(boxEA2))
                            .addGroup(panelEquipLayout.createSequentialGroup()
                                .addGap(5, 5, 5)
                                .addComponent(labelEspadaGrande)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 176, Short.MAX_VALUE)
                                .addComponent(boxEA1))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelEquipLayout.createSequentialGroup()
                                .addComponent(labelHacha)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 181, Short.MAX_VALUE)
                                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(btnAtras2)
                                    .addComponent(boxEA3)))))
                    .addGroup(panelEquipLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(labelEquipamiento, javax.swing.GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE)))
                .addContainerGap())
        );
        panelEquipLayout.setVerticalGroup(
            panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelEquipLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(labelEquipamiento)
                .addGap(27, 27, 27)
                .addComponent(labelCabeza)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelBisera)
                    .addComponent(boxEC1))
                .addGap(11, 11, 11)
                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelGorra)
                    .addComponent(boxEC2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelCasco)
                    .addComponent(boxEC3))
                .addGap(31, 31, 31)
                .addComponent(labelArmas)
                .addGap(18, 18, 18)
                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelEspadaGrande)
                    .addComponent(boxEA1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelEspadasDobles)
                    .addComponent(boxEA2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelEquipLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelHacha)
                    .addComponent(boxEA3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 6, Short.MAX_VALUE)
                .addComponent(btnAtras2)
                .addContainerGap())
        );

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

        labelBolsa.setFont(new java.awt.Font("Tahoma", 2, 18));
        labelBolsa.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        labelBolsa.setText(". Bolsa Objetos .");

        jLabel20.setText("Pociones: "+pers.contObj1);

        jLabel21.setText("Superpociones: "+pers.contObj2);

        btnUsarObj1.setText("Usar");
        btnUsarObj1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnUsarObj1ActionPerformed(evt);
            }
        });

        btnUsarObk2.setText("Usar");
        btnUsarObk2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnUsarObk2ActionPerformed(evt);
            }
        });

        jTextField1.setEditable(false);
        jTextField1.setFont(new java.awt.Font("Tahoma", 0, 10));
        jTextField1.setHorizontalAlignment(javax.swing.JTextField.CENTER);

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

        javax.swing.GroupLayout panelBolsaLayout = new javax.swing.GroupLayout(panelBolsa);
        panelBolsa.setLayout(panelBolsaLayout);
        panelBolsaLayout.setHorizontalGroup(
            panelBolsaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelBolsaLayout.createSequentialGroup()
                .addGroup(panelBolsaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelBolsaLayout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addGroup(panelBolsaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(panelBolsaLayout.createSequentialGroup()
                                .addComponent(jLabel21)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 225, Short.MAX_VALUE)
                                .addComponent(btnUsarObk2))
                            .addGroup(panelBolsaLayout.createSequentialGroup()
                                .addComponent(jLabel20)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 225, Short.MAX_VALUE)
                                .addComponent(btnUsarObj1))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelBolsaLayout.createSequentialGroup()
                        .addContainerGap(350, Short.MAX_VALUE)
                        .addComponent(btnAtras3))
                    .addGroup(panelBolsaLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE))
                    .addGroup(panelBolsaLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(labelBolsa, javax.swing.GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE)))
                .addContainerGap())
        );
        panelBolsaLayout.setVerticalGroup(
            panelBolsaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelBolsaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(labelBolsa)
                .addGap(26, 26, 26)
                .addGroup(panelBolsaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelBolsaLayout.createSequentialGroup()
                        .addComponent(jLabel20)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(panelBolsaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel21)
                            .addComponent(btnUsarObk2)))
                    .addComponent(btnUsarObj1))
                .addGap(171, 171, 171)
                .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 7, Short.MAX_VALUE)
                .addComponent(btnAtras3)
                .addContainerGap())
        );

        jTabbedPane1.addTab("tab3", panelBolsa);
        jTabbedPane1.addTab("Bolsa", panelBolsa);

        labelAtcEsp.setFont(new java.awt.Font("Tahoma", 2, 18));
        labelAtcEsp.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        labelAtcEsp.setText(". Ataques especiales .");

        jLabel26.setText("                      ");
        if (pers.atc1 == 1){
            jLabel26.setText("1. "+pers.atc1_nom+": "+pers.atc1_def);
        }

        jLabel27.setText("                         ");
        if (pers.atc2 == 1){
            jLabel27.setText("2. "+pers.atc2_nom+": "+pers.atc2_def);
        }

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

        javax.swing.GroupLayout panelAtcEspLayout = new javax.swing.GroupLayout(panelAtcEsp);
        panelAtcEsp.setLayout(panelAtcEspLayout);
        panelAtcEspLayout.setHorizontalGroup(
            panelAtcEspLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelAtcEspLayout.createSequentialGroup()
                .addGroup(panelAtcEspLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelAtcEspLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(labelAtcEsp, javax.swing.GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE))
                    .addGroup(panelAtcEspLayout.createSequentialGroup()
                        .addGap(35, 35, 35)
                        .addGroup(panelAtcEspLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel27)
                            .addComponent(jLabel26)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelAtcEspLayout.createSequentialGroup()
                        .addContainerGap(350, Short.MAX_VALUE)
                        .addComponent(btnAtras4)))
                .addContainerGap())
        );
        panelAtcEspLayout.setVerticalGroup(
            panelAtcEspLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelAtcEspLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(labelAtcEsp)
                .addGap(34, 34, 34)
                .addComponent(jLabel26)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel27)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 198, Short.MAX_VALUE)
                .addComponent(btnAtras4)
                .addContainerGap())
        );

        jTabbedPane1.addTab("tab4", panelAtcEsp);

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

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

    private void btnAtrasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAtrasActionPerformed
        this.hide();
        switch (pers.posicion){
               case 1: new villa1.NMenu().setVisible(true); break;
               case 2: new villa2.NMenu().setVisible(true); break;
           }
    }//GEN-LAST:event_btnAtrasActionPerformed

    private void boxEC1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boxEC1ActionPerformed
if ((boxEC2.isSelected() == true)){
    boxEC2.setSelected(false);
    pers.def = pers.def - 2;
    pers.gorra = 0;
}
else if ((boxEC3.isSelected() == true)){
    boxEC3.setSelected(false);
    pers.def = pers.def - 4;
    pers.casco = 0;
}
else if (pers.bisera == 0){
pers.def = pers.def+1;
pers.bisera = 1;
}
// TODO add your handling code here:
    }//GEN-LAST:event_boxEC1ActionPerformed

    private void boxEC2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boxEC2ActionPerformed
if ((boxEC1.isSelected() == true)){
    boxEC1.setSelected(false);
    pers.def = pers.def - 1;
    pers.bisera = 0;
}
else if ((boxEC3.isSelected() == true)){
    boxEC3.setSelected(false);
     pers.def = pers.def - 4;
     pers.casco = 0;
}
else if (pers.gorra == 0){
pers.def = pers.def+2;
pers.gorra = 1;
}// TODO add your handling code here:
    }//GEN-LAST:event_boxEC2ActionPerformed

    private void boxEC3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boxEC3ActionPerformed
if ((boxEC1.isSelected() == true)){
    boxEC1.setSelected(false);
    pers.def = pers.def - 1;
    pers.bisera = 0;
}
else if ((boxEC2.isSelected() == true)){
    boxEC2.setSelected(false);
    pers.def = pers.def - 2;
    pers.gorra = 0;
}
else if (pers.casco == 0){
pers.def = pers.def+4;
pers.casco = 1;
}// TODO add your handling code here:
    }//GEN-LAST:event_boxEC3ActionPerformed

    private void boxEA1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boxEA1ActionPerformed
if ((boxEA2.isSelected() == true)){
    boxEA2.setSelected(false);
    pers.atc = pers.atc - 7;
    pers.def = pers.def + 2;
    pers.dobles = 0;
}
else if ((boxEA3.isSelected() == true)){
    boxEA3.setSelected(false);
    pers.atc = pers.atc - 10;
    pers.def = pers.def + 1;
    pers.hacha = 0;
}
else if (pers.espada == 0){
pers.atc = pers.atc+5;
pers.espada = 1;
}// TODO add your handling code here:
    }//GEN-LAST:event_boxEA1ActionPerformed

    private void boxEA2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boxEA2ActionPerformed
if ((boxEA1.isSelected() == true)){
    boxEA1.setSelected(false);
    pers.atc = pers.atc - 5;
    pers.espada = 0;
}
else if ((boxEA3.isSelected() == true)){
    boxEA3.setSelected(false);
    pers.atc = pers.atc - 10;
    pers.def = pers.def + 1;
    pers.hacha = 0;
}
else if(pers.dobles == 0){
pers.atc = pers.atc+7;
pers.def = pers.def - 2;
pers.dobles = 1;
}// TODO add your handling code here:
    }//GEN-LAST:event_boxEA2ActionPerformed

    private void boxEA3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boxEA3ActionPerformed
if ((boxEA1.isSelected() == true)){
    boxEA1.setSelected(false);
    pers.atc = pers.atc - 5;
    pers.espada = 0;
}
else if ((boxEA2.isSelected() == true)){
    boxEA2.setSelected(false);
    pers.atc = pers.atc - 7;
    pers.def = pers.def + 2;
    pers.dobles = 0;
}
else if (pers.hacha == 0){
pers.atc = pers.atc+10;
pers.def = pers.def - 1;
pers.hacha = 1;
}// TODO add your handling code here:
    }//GEN-LAST:event_boxEA3ActionPerformed

    private void btnUsarObj1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUsarObj1ActionPerformed
if (pers.hp == pers.hp_max){
    jTextField1.setText("Tu HP está al máximo");
}
if (pers.contObj1 >= 1){
    pers.hp = pers.hp + 20;
    if (pers.hp > pers.hp_max){
        pers.hp = pers.hp_max;
        }
    pers.contObj1 = pers.contObj1 - 1;
    jLabel20.setText("Pociones: "+pers.contObj1);
    jTextField1.setText("Poción usada correctamente. HP: "+pers.hp+"/"+pers.hp_max);
    }
else {
    jTextField1.setText("No tienes pociones para poder usar");
}
// TODO add your handling code here:
    }//GEN-LAST:event_btnUsarObj1ActionPerformed

    private void btnUsarObk2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUsarObk2ActionPerformed
if (pers.hp == pers.hp_max){
    jTextField1.setText("Tu HP está al máximo");
}
        if (pers.contObj2 >= 1){
    pers.hp = pers.hp + 50;
    if (pers.hp > pers.hp_max){
        pers.hp = pers.hp_max;
        }
    pers.contObj2 = pers.contObj2 - 1;
    jLabel21.setText("Pociones: "+pers.contObj1);
    jTextField1.setText("Superpoción usada correctamente. HP: "+pers.hp+"/"+pers.hp_max);
    }
else {
    jTextField1.setText("No tienes superpociones para poder usar");
}        // TODO add your handling code here:
    }//GEN-LAST:event_btnUsarObk2ActionPerformed

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

    private void btnAtras3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAtras3ActionPerformed
this.hide();
switch (pers.posicion){
               case 1: new villa1.NMenu().setVisible(true); break;
               case 2: new villa2.NMenu().setVisible(true); break;
           }// TODO add your handling code here:
    }//GEN-LAST:event_btnAtras3ActionPerformed

    private void btnAtras4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAtras4ActionPerformed
this.hide();
switch (pers.posicion){
               case 1: new villa1.NMenu().setVisible(true); break;
               case 2: new villa2.NMenu().setVisible(true); break;
           }    // TODO add your handling code here:
    }//GEN-LAST:event_btnAtras4ActionPerformed

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

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox boxEA1;
    private javax.swing.JCheckBox boxEA2;
    private javax.swing.JCheckBox boxEA3;
    private javax.swing.JCheckBox boxEC1;
    private javax.swing.JCheckBox boxEC2;
    private javax.swing.JCheckBox boxEC3;
    private javax.swing.JButton btnAtras;
    private javax.swing.JButton btnAtras2;
    private javax.swing.JButton btnAtras3;
    private javax.swing.JButton btnAtras4;
    private javax.swing.JButton btnUsarObj1;
    private javax.swing.JButton btnUsarObk2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JProgressBar jProgressBar1;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JLabel labelArmas;
    private javax.swing.JLabel labelAtcEsp;
    private javax.swing.JLabel labelBisera;
    private javax.swing.JLabel labelBolsa;
    private javax.swing.JLabel labelCabeza;
    private javax.swing.JLabel labelCasco;
    private javax.swing.JLabel labelDatos;
    private javax.swing.JLabel labelEquipamiento;
    private javax.swing.JLabel labelEspadaGrande;
    private javax.swing.JLabel labelEspadasDobles;
    private javax.swing.JLabel labelGorra;
    private javax.swing.JLabel labelHacha;
    private javax.swing.JPanel panelAtcEsp;
    private javax.swing.JPanel panelBolsa;
    private javax.swing.JPanel panelEquip;
    private javax.swing.JPanel panelPers;
    // End of variables declaration//GEN-END:variables

}
