package Globales;
import Personajes.*;
import villa1.*;
/*
 * Cargar.java
 *
 * Created on 28-ago-2009, 0:18:44
 */

/**
 *
 * @author Xabier
 */
public class ModPers extends Inicio {
    int cont = 35;
    public static Modificado mod = new Modificado(0,0,0,0,0,0,"mote",1);
    /** Creates new form Cargar */
    public ModPers() {
        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() {

        jPanel1 = new javax.swing.JPanel();
        labelModificado = new javax.swing.JLabel();
        btnSubirHP = new javax.swing.JButton();
        btnSubirPP = new javax.swing.JButton();
        btnSubirAtaque = new javax.swing.JButton();
        btnSubirDefensa = new javax.swing.JButton();
        btnSubirSuerte = new javax.swing.JButton();
        btnSubirAgilidad = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        lblPuntosActuales = new javax.swing.JLabel();
        lblHP = new javax.swing.JLabel();
        lblPP = new javax.swing.JLabel();
        lblAtaque = new javax.swing.JLabel();
        lblDefensa = new javax.swing.JLabel();
        lblSuerte = new javax.swing.JLabel();
        lblAgilidad = new javax.swing.JLabel();
        jCheckBox1 = new javax.swing.JCheckBox();
        btnFinalizar = new javax.swing.JButton();
        labelMote = new javax.swing.JLabel();
        txtMotePersonaje = new javax.swing.JTextField();
        btnBajarHP = new javax.swing.JButton();
        btnBajarPP = new javax.swing.JButton();
        btnBajarAtaque = new javax.swing.JButton();
        btnBajarDefensa = new javax.swing.JButton();
        btnBajarSuerte = new javax.swing.JButton();
        btnBajarAgilidad = new javax.swing.JButton();
        labelTipo = new javax.swing.JLabel();
        boxTipo = new javax.swing.JComboBox();
        btnAtras = new javax.swing.JButton();

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

        labelModificado.setFont(new java.awt.Font("Tahoma", 2, 24)); // NOI18N
        labelModificado.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        labelModificado.setText(". Personaje Modificado .");

        btnSubirHP.setText("Subir HP (+5)");
        btnSubirHP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSubirHPActionPerformed(evt);
            }
        });

        btnSubirPP.setText("Subir PP (+5)");
        btnSubirPP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSubirPPActionPerformed(evt);
            }
        });

        btnSubirAtaque.setText("Subir Ataque (+1)");
        btnSubirAtaque.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSubirAtaqueActionPerformed(evt);
            }
        });

        btnSubirDefensa.setText("Subir Defensa (+1)");
        btnSubirDefensa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSubirDefensaActionPerformed(evt);
            }
        });

        btnSubirSuerte.setText("Subir Suerte (+1)");
        btnSubirSuerte.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSubirSuerteActionPerformed(evt);
            }
        });

        btnSubirAgilidad.setText("Subir Agilidad (+1)");
        btnSubirAgilidad.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSubirAgilidadActionPerformed(evt);
            }
        });

        jLabel2.setText("Aquí puedes crear un personaje a tu medida. Tienes 35 puntos para distribuir:");

        lblPuntosActuales.setText("Puntos restantes: "+cont);

        lblHP.setText("HP: "+mod.hp);

        lblPP.setText("PP: "+mod.pp);

        lblAtaque.setText("Ataque: "+mod.atc);

        lblDefensa.setText("Defensa: "+mod.def);

        lblSuerte.setText("Suerte: "+mod.suerte);

        lblAgilidad.setText("Agilidad: "+mod.agilidad);

        jCheckBox1.setEnabled(false);

        btnFinalizar.setText("Finalizar creación");
        btnFinalizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFinalizarActionPerformed(evt);
            }
        });

        labelMote.setText("Escribe un mote para tu personaje:");

        txtMotePersonaje.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtMotePersonaje.setText("Personaje");
        txtMotePersonaje.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                txtMotePersonajeMouseClicked(evt);
            }
        });

        btnBajarHP.setLabel("Bajar HP (-5)");
        btnBajarHP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBajarHPActionPerformed(evt);
            }
        });

        btnBajarPP.setText("Bajar PP (-5)");
        btnBajarPP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBajarPPActionPerformed(evt);
            }
        });

        btnBajarAtaque.setText("Bajar Ataque (-1)");
        btnBajarAtaque.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBajarAtaqueActionPerformed(evt);
            }
        });

        btnBajarDefensa.setText("Bajar Defensa (-1)");
        btnBajarDefensa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBajarDefensaActionPerformed(evt);
            }
        });

        btnBajarSuerte.setText("Bajar Suerte (-1)");
        btnBajarSuerte.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBajarSuerteActionPerformed(evt);
            }
        });

        btnBajarAgilidad.setText("Bajar Agilidad (-1)");
        btnBajarAgilidad.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBajarAgilidadActionPerformed(evt);
            }
        });

        labelTipo.setText("Elije un personaje base para los ataques especiales:");

        boxTipo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Elfo", "Mago", "Ladrón", "Orco", "Soldado" }));
        boxTipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boxTipoActionPerformed(evt);
            }
        });

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

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(44, 44, 44)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(btnSubirAgilidad, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(btnSubirSuerte, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(btnSubirAtaque, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(btnSubirDefensa, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(btnSubirPP, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(btnSubirHP, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addGap(36, 36, 36)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(lblAgilidad)
                                            .addComponent(lblDefensa)
                                            .addComponent(lblSuerte)
                                            .addComponent(lblAtaque)
                                            .addComponent(lblHP)
                                            .addComponent(lblPP))
                                        .addGap(31, 31, 31)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                            .addComponent(btnBajarAgilidad, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(btnBajarSuerte, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(btnBajarAtaque, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(btnBajarDefensa, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(btnBajarPP, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(btnBajarHP, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                                    .addComponent(lblPuntosActuales)))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(labelMote)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txtMotePersonaje, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(labelTipo)
                                .addGap(26, 26, 26)
                                .addComponent(boxTipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(77, 77, 77)
                        .addComponent(jLabel2))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(labelModificado, javax.swing.GroupLayout.PREFERRED_SIZE, 493, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(btnAtras)
                        .addGap(154, 154, 154)
                        .addComponent(jCheckBox1)
                        .addGap(18, 18, 18)
                        .addComponent(btnFinalizar)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(labelModificado)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(11, 11, 11)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(lblPuntosActuales)
                        .addGap(11, 11, 11)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(btnSubirHP)
                            .addComponent(lblHP))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(btnSubirPP)
                            .addComponent(lblPP))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(btnSubirAtaque)
                                .addGap(18, 18, 18)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(btnSubirDefensa)
                                    .addComponent(lblDefensa))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(btnSubirSuerte)
                                    .addComponent(lblSuerte))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(btnSubirAgilidad)
                                    .addComponent(lblAgilidad)))
                            .addComponent(lblAtaque)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(25, 25, 25)
                        .addComponent(btnBajarHP)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnBajarPP)
                        .addGap(18, 18, 18)
                        .addComponent(btnBajarAtaque)
                        .addGap(18, 18, 18)
                        .addComponent(btnBajarDefensa)
                        .addGap(18, 18, 18)
                        .addComponent(btnBajarSuerte)
                        .addGap(18, 18, 18)
                        .addComponent(btnBajarAgilidad)))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelMote)
                    .addComponent(txtMotePersonaje, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(labelTipo)
                    .addComponent(boxTipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jCheckBox1)
                            .addComponent(btnFinalizar))
                        .addGap(34, 34, 34))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(btnAtras)
                        .addContainerGap())))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 472, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 445, Short.MAX_VALUE)
        );

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

    private void btnSubirHPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSubirHPActionPerformed
if (cont > 0){
        if (cont == 1){
            jCheckBox1.setSelected(rootPaneCheckingEnabled);
        }
        cont = cont - 1;
        mod.hp = mod.hp + 5;
}
lblHP.setText("HP: "+mod.hp);
lblPuntosActuales.setText("Puntos restantes: "+cont);// TODO add your handling code here:
    }//GEN-LAST:event_btnSubirHPActionPerformed

    private void btnSubirPPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSubirPPActionPerformed
if (cont > 0){
    if (cont == 1){
            jCheckBox1.setSelected(rootPaneCheckingEnabled);
        }
        cont = cont - 1;
        mod.pp = mod.pp + 5;
}
lblPP.setText("PP: "+mod.pp);
lblPuntosActuales.setText("Puntos restantes: "+cont);        // TODO add your handling code here:
    }//GEN-LAST:event_btnSubirPPActionPerformed

    private void btnSubirAtaqueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSubirAtaqueActionPerformed
if (cont > 0){
    if (cont == 1){
            jCheckBox1.setSelected(rootPaneCheckingEnabled);
        }
        cont = cont - 1;
        mod.atc = mod.atc + 1;
}
lblAtaque.setText("Ataque: "+mod.atc);
lblPuntosActuales.setText("Puntos restantes: "+cont);        // TODO add your handling code here:
    }//GEN-LAST:event_btnSubirAtaqueActionPerformed

    private void btnSubirDefensaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSubirDefensaActionPerformed
if (cont > 0){
    if (cont == 1){
            jCheckBox1.setSelected(rootPaneCheckingEnabled);
        }
        cont = cont - 1;
        mod.def = mod.def + 1;
}
lblDefensa.setText("Defensa: "+mod.def);
lblPuntosActuales.setText("Puntos restantes: "+cont);        // TODO add your handling code here:
    }//GEN-LAST:event_btnSubirDefensaActionPerformed

    private void btnSubirSuerteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSubirSuerteActionPerformed
 if (cont > 0){
        if (cont == 1){
            jCheckBox1.setSelected(rootPaneCheckingEnabled);
        }
        cont = cont - 1;
        mod.suerte = mod.suerte + 1;
}
lblSuerte.setText("Suerte: "+mod.suerte);
lblPuntosActuales.setText("Puntos restantes: "+cont);    // TODO add your handling code here:
    }//GEN-LAST:event_btnSubirSuerteActionPerformed

    private void btnSubirAgilidadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSubirAgilidadActionPerformed
if (cont > 0){
        cont = cont - 1;
        mod.agilidad = mod.agilidad + 1;
}
else if (cont == 0){
    jCheckBox1.setSelected(rootPaneCheckingEnabled);
}
lblAgilidad.setText("Agilidad: "+mod.agilidad);
lblPuntosActuales.setText("Puntos restantes: "+cont);        // TODO add your handling code here:
    }//GEN-LAST:event_btnSubirAgilidadActionPerformed

    private void btnFinalizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFinalizarActionPerformed
        if (((jCheckBox1.isSelected() == true) && (cont == 0))){
           mod.mote = txtMotePersonaje.getText();
           pers = mod;
           this.hide();
           new villa1.NMenu().setVisible(true);
        }        // TODO add your handling code here:
    }//GEN-LAST:event_btnFinalizarActionPerformed

    private void btnBajarHPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBajarHPActionPerformed
       if (mod.hp>0){
        if (cont == 1){
           jCheckBox1.setSelected(rootPaneCheckingEnabled);
        }
        cont = cont + 1;
        mod.hp = mod.hp - 5;
}
lblHP.setText("HP: "+mod.hp);
lblPuntosActuales.setText("Puntos restantes: "+cont);
    }//GEN-LAST:event_btnBajarHPActionPerformed

    private void btnBajarPPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBajarPPActionPerformed
       if (mod.pp>0){
    if (cont == 1){
            jCheckBox1.setSelected(rootPaneCheckingEnabled);
        }
        cont = cont + 1;
        mod.pp = mod.pp - 5;
}
lblPP.setText("PP: "+mod.pp);
lblPuntosActuales.setText("Puntos restantes: "+cont);
    }//GEN-LAST:event_btnBajarPPActionPerformed

    private void btnBajarAtaqueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBajarAtaqueActionPerformed
        if (mod.atc>0){
    if (cont == 1){
            jCheckBox1.setSelected(rootPaneCheckingEnabled);
        }
        cont = cont + 1;
        mod.atc = mod.atc - 1;
}
lblAtaque.setText("Ataque: "+mod.atc);
lblPuntosActuales.setText("Puntos restantes: "+cont);
    }//GEN-LAST:event_btnBajarAtaqueActionPerformed

    private void btnBajarDefensaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBajarDefensaActionPerformed
        if (mod.def>0){
    if (cont == 1){
            jCheckBox1.setSelected(rootPaneCheckingEnabled);
        }
        cont = cont + 1;
        mod.def = mod.def - 1;
}
lblDefensa.setText("Defensa: "+mod.def);
lblPuntosActuales.setText("Puntos restantes: "+cont);
    }//GEN-LAST:event_btnBajarDefensaActionPerformed

    private void btnBajarSuerteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBajarSuerteActionPerformed
      if ( mod.suerte> 0){
        if (cont == 1){
            jCheckBox1.setSelected(rootPaneCheckingEnabled);
        }
        cont = cont + 1;
        mod.suerte = mod.suerte - 1;
}
lblSuerte.setText("Suerte: "+mod.suerte);
lblPuntosActuales.setText("Puntos restantes: "+cont);
    }//GEN-LAST:event_btnBajarSuerteActionPerformed

    private void btnBajarAgilidadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBajarAgilidadActionPerformed
       if (mod.agilidad > 0){
        cont = cont + 1;
        mod.agilidad = mod.agilidad -1;
}
else if (cont == 0){
    jCheckBox1.setSelected(rootPaneCheckingEnabled);
}
lblAgilidad.setText("Agilidad: "+mod.agilidad);
lblPuntosActuales.setText("Puntos restantes: "+cont);
    }//GEN-LAST:event_btnBajarAgilidadActionPerformed

    private void boxTipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boxTipoActionPerformed
switch (boxTipo.getSelectedIndex()){
            case 1: mod.tipo = 1;
            case 2: mod.tipo = 2;
            case 3: mod.tipo = 3;
            case 4: mod.tipo = 4;
            case 5: mod.tipo = 5;
}        // TODO add your handling code here:
    }//GEN-LAST:event_boxTipoActionPerformed

    private void txtMotePersonajeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_txtMotePersonajeMouseClicked
txtMotePersonaje.setText(null);        // TODO add your handling code here:
    }//GEN-LAST:event_txtMotePersonajeMouseClicked

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

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

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox boxTipo;
    private javax.swing.JButton btnAtras;
    private javax.swing.JButton btnBajarAgilidad;
    private javax.swing.JButton btnBajarAtaque;
    private javax.swing.JButton btnBajarDefensa;
    private javax.swing.JButton btnBajarHP;
    private javax.swing.JButton btnBajarPP;
    private javax.swing.JButton btnBajarSuerte;
    private javax.swing.JButton btnFinalizar;
    private javax.swing.JButton btnSubirAgilidad;
    private javax.swing.JButton btnSubirAtaque;
    private javax.swing.JButton btnSubirDefensa;
    private javax.swing.JButton btnSubirHP;
    private javax.swing.JButton btnSubirPP;
    private javax.swing.JButton btnSubirSuerte;
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JLabel labelModificado;
    private javax.swing.JLabel labelMote;
    private javax.swing.JLabel labelTipo;
    private javax.swing.JLabel lblAgilidad;
    private javax.swing.JLabel lblAtaque;
    private javax.swing.JLabel lblDefensa;
    private javax.swing.JLabel lblHP;
    private javax.swing.JLabel lblPP;
    private javax.swing.JLabel lblPuntosActuales;
    private javax.swing.JLabel lblSuerte;
    private javax.swing.JTextField txtMotePersonaje;
    // End of variables declaration//GEN-END:variables

}
