From 2dea86f1959e5933bf17dcdb300c09e6f335efe3 Mon Sep 17 00:00:00 2001 From: "emile.malcuit" Date: Wed, 12 Feb 2025 15:20:58 +0100 Subject: [PATCH] =?UTF-8?q?Fin=20du=20Tp1,=20et=20d=C3=A9but=20du=20tp2=20?= =?UTF-8?q?avec=20l'ajout=20de=20la=20bare=20de=20menu=20=09mais=20non=20f?= =?UTF-8?q?onctionnel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JDR/nbproject/project.properties | 6 +- JDR/src/Presentation/Plateau_de_jeu.form | 180 ++++++++++++------ JDR/src/Presentation/Plateau_de_jeu.java | 225 ++++++++++++++++------- JDR/src/img/folie.jpg | Bin 0 -> 5788 bytes 4 files changed, 281 insertions(+), 130 deletions(-) create mode 100644 JDR/src/img/folie.jpg diff --git a/JDR/nbproject/project.properties b/JDR/nbproject/project.properties index 3ee6bff..d303e1e 100644 --- a/JDR/nbproject/project.properties +++ b/JDR/nbproject/project.properties @@ -1,9 +1,10 @@ annotation.processing.enabled=true annotation.processing.enabled.in.editor=false -annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=JDR +application.vendor=emile.lalorcey build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: @@ -32,6 +33,7 @@ dist.jar=${dist.dir}/JDR.jar dist.javadoc.dir=${dist.dir}/javadoc dist.jlink.dir=${dist.dir}/jlink dist.jlink.output=${dist.jlink.dir}/JDR +endorsed.classpath= excludes= includes=** jar.compress=false @@ -72,7 +74,7 @@ jlink.additionalmodules= jlink.additionalparam= jlink.launcher=true jlink.launcher.name=JDR -main.class=jdr.JDR +main.class=Presentation.Plateau_de_jeu manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false diff --git a/JDR/src/Presentation/Plateau_de_jeu.form b/JDR/src/Presentation/Plateau_de_jeu.form index 5d483b8..aa78683 100644 --- a/JDR/src/Presentation/Plateau_de_jeu.form +++ b/JDR/src/Presentation/Plateau_de_jeu.form @@ -2,36 +2,77 @@
- - - - - - + - + - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + @@ -53,7 +94,7 @@ - + @@ -62,7 +103,7 @@ - + @@ -77,7 +118,7 @@ - + @@ -111,9 +152,14 @@ + + + + + - + @@ -126,7 +172,7 @@ - + @@ -155,23 +201,27 @@ - - - - - - - - + + + + + + + + + + + + - - - + + + - + @@ -179,8 +229,8 @@ - - + + @@ -191,6 +241,11 @@ + + + + + @@ -205,7 +260,7 @@ - + @@ -240,18 +295,18 @@ - + - + - + - + @@ -321,24 +376,24 @@ - - - - - + + + + + - - + + @@ -361,12 +416,14 @@ + + + - @@ -383,24 +440,24 @@ - - - - - + + + + + - - + + @@ -423,6 +480,9 @@ + + + diff --git a/JDR/src/Presentation/Plateau_de_jeu.java b/JDR/src/Presentation/Plateau_de_jeu.java index 3e0e40c..6d9e74a 100644 --- a/JDR/src/Presentation/Plateau_de_jeu.java +++ b/JDR/src/Presentation/Plateau_de_jeu.java @@ -5,6 +5,8 @@ package Presentation; import javax.swing.DefaultComboBoxModel; +import javax.swing.Icon; +import javax.swing.JOptionPane; import metier.Jeu; import metier.Personnage; @@ -34,8 +36,6 @@ public class Plateau_de_jeu extends javax.swing.JFrame { // //GEN-BEGIN:initComponents private void initComponents() { - jScrollPane1 = new javax.swing.JScrollPane(); - jList1 = new javax.swing.JList<>(); jPanel1 = new javax.swing.JPanel(); JPFondListePerso = new javax.swing.JPanel(); jLImageListePerso = new javax.swing.JLabel(); @@ -57,19 +57,22 @@ public class Plateau_de_jeu extends javax.swing.JFrame { jScrollPane4 = new javax.swing.JScrollPane(); jTADefenseurCaracteristiques = new javax.swing.JTextArea(); jBGo = new javax.swing.JButton(); - - jList1.setModel(new javax.swing.AbstractListModel() { - String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" }; - public int getSize() { return strings.length; } - public String getElementAt(int i) { return strings[i]; } - }); - jScrollPane1.setViewportView(jList1); + jMenuBar1 = new javax.swing.JMenuBar(); + jMenuJeu = new javax.swing.JMenu(); + jMInewGame = new javax.swing.JMenuItem(); + jMInewPlayer = new javax.swing.JMenuItem(); + jMIopenGame = new javax.swing.JMenuItem(); + jMIsave = new javax.swing.JMenuItem(); + jMIquit = new javax.swing.JMenuItem(); + jMenu2 = new javax.swing.JMenu(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); JPFondListePerso.setBackground(new java.awt.Color(102, 0, 0)); JPFondListePerso.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); - JPFondListePerso.add(jLImageListePerso, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 10, 130, 80)); + + jLImageListePerso.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/adj_1.jpg"))); // NOI18N + JPFondListePerso.add(jLImageListePerso, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 0, 190, 100)); jScrollPane2.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); @@ -78,10 +81,12 @@ public class Plateau_de_jeu extends javax.swing.JFrame { jTextArea1.setRows(5); jScrollPane2.setViewportView(jTextArea1); - JPFondListePerso.add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 100, 148, 360)); + JPFondListePerso.add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 110, 210, 350)); jPJeu.setBackground(new java.awt.Color(255, 255, 255)); + jLChoixPerso.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/famille_1.jpg"))); // NOI18N + jLChoixPersoText.setText("Choix Des personnages"); jPCHoixPersoFond.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); @@ -112,31 +117,31 @@ public class Plateau_de_jeu extends javax.swing.JFrame { jScrollPane3.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPane3.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); + jTAAttaquantCaracteristiques.setBackground(new java.awt.Color(102, 0, 0)); jTAAttaquantCaracteristiques.setColumns(20); jTAAttaquantCaracteristiques.setRows(5); jTAAttaquantCaracteristiques.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR)); - jTAAttaquantCaracteristiques.setOpaque(false); jScrollPane3.setViewportView(jTAAttaquantCaracteristiques); javax.swing.GroupLayout jPAttaquantLayout = new javax.swing.GroupLayout(jPAttaquant); jPAttaquant.setLayout(jPAttaquantLayout); jPAttaquantLayout.setHorizontalGroup( jPAttaquantLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPAttaquantLayout.createSequentialGroup() - .addGap(25, 25, 25) - .addComponent(jLImageAttaquant, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(51, Short.MAX_VALUE)) .addGroup(jPAttaquantLayout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addContainerGap()) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPAttaquantLayout.createSequentialGroup() + .addContainerGap(68, Short.MAX_VALUE) + .addComponent(jLImageAttaquant, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(59, 59, 59)) ); jPAttaquantLayout.setVerticalGroup( jPAttaquantLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPAttaquantLayout.createSequentialGroup() .addContainerGap() - .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLImageAttaquant, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(15, Short.MAX_VALUE)) ); @@ -146,6 +151,7 @@ public class Plateau_de_jeu extends javax.swing.JFrame { jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPane4.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); + jTADefenseurCaracteristiques.setBackground(new java.awt.Color(102, 0, 0)); jTADefenseurCaracteristiques.setColumns(20); jTADefenseurCaracteristiques.setRows(5); jScrollPane4.setViewportView(jTADefenseurCaracteristiques); @@ -154,21 +160,21 @@ public class Plateau_de_jeu extends javax.swing.JFrame { jPDefenseur.setLayout(jPDefenseurLayout); jPDefenseurLayout.setHorizontalGroup( jPDefenseurLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPDefenseurLayout.createSequentialGroup() - .addGap(31, 31, 31) - .addComponent(jLImageDefenseur, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(38, Short.MAX_VALUE)) .addGroup(jPDefenseurLayout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addContainerGap()) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPDefenseurLayout.createSequentialGroup() + .addContainerGap(64, Short.MAX_VALUE) + .addComponent(jLImageDefenseur, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(64, 64, 64)) ); jPDefenseurLayout.setVerticalGroup( jPDefenseurLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPDefenseurLayout.createSequentialGroup() .addContainerGap() - .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) + .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLImageDefenseur, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); @@ -178,17 +184,17 @@ public class Plateau_de_jeu extends javax.swing.JFrame { jPCHoixPersoFondLayout.setHorizontalGroup( jPCHoixPersoFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPCHoixPersoFondLayout.createSequentialGroup() - .addGap(81, 81, 81) + .addGap(101, 101, 101) .addComponent(jCBoxAttaquant, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jCBoxDefenseur, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(75, 75, 75)) + .addGap(107, 107, 107)) .addGroup(jPCHoixPersoFondLayout.createSequentialGroup() .addGap(27, 27, 27) .addComponent(jPAttaquant, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 80, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 57, Short.MAX_VALUE) .addComponent(jPDefenseur, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(38, 38, 38)) + .addGap(26, 26, 26)) ); jPCHoixPersoFondLayout.setVerticalGroup( jPCHoixPersoFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -215,7 +221,7 @@ public class Plateau_de_jeu extends javax.swing.JFrame { .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPChoixPersoLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPCHoixPersoFond, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(70, 70, 70)) + .addContainerGap()) ); jPChoixPersoLayout.setVerticalGroup( jPChoixPersoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -238,26 +244,28 @@ public class Plateau_de_jeu extends javax.swing.JFrame { jPJeu.setLayout(jPJeuLayout); jPJeuLayout.setHorizontalGroup( jPJeuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPJeuLayout.createSequentialGroup() - .addContainerGap(15, Short.MAX_VALUE) - .addComponent(jPChoixPerso, javax.swing.GroupLayout.PREFERRED_SIZE, 528, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(54, 54, 54)) .addGroup(jPJeuLayout.createSequentialGroup() .addGroup(jPJeuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPJeuLayout.createSequentialGroup() - .addGap(215, 215, 215) - .addComponent(jLChoixPerso, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPJeuLayout.createSequentialGroup() - .addGap(236, 236, 236) - .addComponent(jBGo))) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPJeuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPJeuLayout.createSequentialGroup() + .addGap(236, 236, 236) + .addComponent(jBGo)) + .addGroup(jPJeuLayout.createSequentialGroup() + .addGap(172, 172, 172) + .addComponent(jLChoixPerso, javax.swing.GroupLayout.PREFERRED_SIZE, 239, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(0, 0, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPJeuLayout.createSequentialGroup() + .addGap(0, 15, Short.MAX_VALUE) + .addComponent(jPChoixPerso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap()) ); jPJeuLayout.setVerticalGroup( jPJeuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPJeuLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jLChoixPerso, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(32, 32, 32) + .addComponent(jLChoixPerso) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPChoixPerso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jBGo) @@ -272,7 +280,7 @@ public class Plateau_de_jeu extends javax.swing.JFrame { .addContainerGap() .addComponent(jPJeu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(JPFondListePerso, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(JPFondListePerso, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( @@ -287,6 +295,50 @@ public class Plateau_de_jeu extends javax.swing.JFrame { .addContainerGap()) ); + jMenuJeu.setText("Jeu"); + + jMInewGame.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_DOWN_MASK)); + jMInewGame.setText("New Game"); + jMInewGame.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMInewGameActionPerformed(evt); + } + }); + jMenuJeu.add(jMInewGame); + + jMInewPlayer.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ADD, 0)); + jMInewPlayer.setText("New Player"); + jMInewPlayer.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMInewPlayerActionPerformed(evt); + } + }); + jMenuJeu.add(jMInewPlayer); + + jMIopenGame.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_DOWN_MASK)); + jMIopenGame.setText("Open Game"); + jMenuJeu.add(jMIopenGame); + + jMIsave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_DOWN_MASK)); + jMIsave.setText("Save"); + jMenuJeu.add(jMIsave); + + jMIquit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.CTRL_DOWN_MASK)); + jMIquit.setText("Exit"); + jMIquit.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMIquitActionPerformed(evt); + } + }); + jMenuJeu.add(jMIquit); + + jMenuBar1.add(jMenuJeu); + + jMenu2.setText("Edit"); + jMenuBar1.add(jMenu2); + + setJMenuBar(jMenuBar1); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( @@ -301,49 +353,70 @@ public class Plateau_de_jeu extends javax.swing.JFrame { .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(14, Short.MAX_VALUE)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// //GEN-END:initComponents + + private void jBGoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBGoActionPerformed + //Attaquant + String attaque = (String) jCBoxAttaquant.getSelectedItem(); + String nomAttaque = attaque.split(":")[1]; + Personnage attaquant = leJeu.rechercherPerso(nomAttaque); + + //Defenseur + String defense = (String) jCBoxDefenseur.getSelectedItem(); + String nomDefense = defense.split(":")[1]; + Personnage defenseur = leJeu.rechercherPerso(nomDefense); + + //Combat + if(defenseur.equals(attaquant)){ + combatImpossible(defenseur); + }else{ + attaquant.rencontrer(defenseur); + //mise à jour ath + + } + majStatistiquesPersos(); + + }//GEN-LAST:event_jBGoActionPerformed + + private void jCBoxDefenseurActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBoxDefenseurActionPerformed + // TODO add your handling code here: + String perso = (String) jCBoxDefenseur.getSelectedItem(); + String nomPerso = perso.split(":")[1]; + Personnage Perso = leJeu.rechercherPerso(nomPerso); + jTADefenseurCaracteristiques.setText(Perso.toString()); + }//GEN-LAST:event_jCBoxDefenseurActionPerformed + private void jCBoxAttaquantActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBoxAttaquantActionPerformed // TODO add your handling code here: String perso = (String) jCBoxAttaquant.getSelectedItem(); String nomPerso = perso.split(":")[1]; Personnage Perso = leJeu.rechercherPerso(nomPerso); - jTAAttaquantCaracteristiques.setText(Perso.toString()); + jTAAttaquantCaracteristiques.setText(Perso.toString()); }//GEN-LAST:event_jCBoxAttaquantActionPerformed private void jCBoxAttaquantInputMethodTextChanged(java.awt.event.InputMethodEvent evt) {//GEN-FIRST:event_jCBoxAttaquantInputMethodTextChanged }//GEN-LAST:event_jCBoxAttaquantInputMethodTextChanged - - private void jCBoxDefenseurActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBoxDefenseurActionPerformed + private void jMInewPlayerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMInewPlayerActionPerformed // TODO add your handling code here: - String perso = (String) jCBoxDefenseur.getSelectedItem(); - String nomPerso = perso.split(":")[1]; - Personnage Perso = leJeu.rechercherPerso(nomPerso); - jTADefenseurCaracteristiques.setText(Perso.toString()); - }//GEN-LAST:event_jCBoxDefenseurActionPerformed + }//GEN-LAST:event_jMInewPlayerActionPerformed + + private void jMInewGameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMInewGameActionPerformed + + }//GEN-LAST:event_jMInewGameActionPerformed + + private void jMIquitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIquitActionPerformed + + }//GEN-LAST:event_jMIquitActionPerformed - private void jBGoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBGoActionPerformed - //Attaquant - String attaque = (String) jCBoxAttaquant.getSelectedItem(); - String nomAttaque = attaque.split(":")[1]; - Personnage attaquant = leJeu.rechercherPerso(nomAttaque); - //Defenseur - String defense = (String) jCBoxAttaquant.getSelectedItem(); - String nomDefense = defense.split(":")[1]; - Personnage defenseur = leJeu.rechercherPerso(nomDefense); - //Combat - attaquant.rencontrer(defenseur); - //mise à jour ath - majStatistiquesPersos(); - }//GEN-LAST:event_jBGoActionPerformed - + private void majStatistiquesPersos(){ String persos = "Jeu : "+leJeu.getnomJeu(); for(Personnage Perso:leJeu.getmesPersonnages()){ @@ -353,6 +426,16 @@ public class Plateau_de_jeu extends javax.swing.JFrame { persos += "----------------"; } jTextArea1.setText(persos); + jTAAttaquantCaracteristiques.setText(""); + jTADefenseurCaracteristiques.setText(""); + } + + private void combatImpossible(Personnage perso){ + String message = "Mais vous êtes devenu fou"; + String titre = "Folie Incontestable !!"; + Icon img = new javax.swing.ImageIcon("/img/folie.png"); + JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE, img); + perso.varierEnergie(-1); } /** * @param args the command line arguments @@ -400,14 +483,20 @@ public class Plateau_de_jeu extends javax.swing.JFrame { private javax.swing.JLabel jLImageAttaquant; private javax.swing.JLabel jLImageDefenseur; private javax.swing.JLabel jLImageListePerso; - private javax.swing.JList jList1; + private javax.swing.JMenuItem jMInewGame; + private javax.swing.JMenuItem jMInewPlayer; + private javax.swing.JMenuItem jMIopenGame; + private javax.swing.JMenuItem jMIquit; + private javax.swing.JMenuItem jMIsave; + private javax.swing.JMenu jMenu2; + private javax.swing.JMenuBar jMenuBar1; + private javax.swing.JMenu jMenuJeu; private javax.swing.JPanel jPAttaquant; private javax.swing.JPanel jPCHoixPersoFond; private javax.swing.JPanel jPChoixPerso; private javax.swing.JPanel jPDefenseur; private javax.swing.JPanel jPJeu; private javax.swing.JPanel jPanel1; - private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JScrollPane jScrollPane3; private javax.swing.JScrollPane jScrollPane4; diff --git a/JDR/src/img/folie.jpg b/JDR/src/img/folie.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0b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