-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
katia_auxilien
committed
Jan 18, 2025
1 parent
8646e97
commit ef902eb
Showing
49 changed files
with
2,357 additions
and
384 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,99 @@ | ||
import java.util.Random; | ||
|
||
/** | ||
* <b> Sae partie 1 </b> : Arme() hérite de CaseBonus. | ||
* <b> Sae partie 2 </b> : Arme(). | ||
* | ||
* @version 1 | ||
* @version 2 | ||
* @author Nassim EL HADDAD & Katia AUXILIEN | ||
**/ | ||
public class Arme extends CaseBonus { | ||
protected int valmax; | ||
|
||
/** | ||
* Constructeur de l'arme. | ||
* Constructeur de l'arme. | ||
* @param diff, variable issue du choix de l'utilisateur dans le menu des options | ||
* | ||
**/ | ||
public Arme() { | ||
public Arme(float diff) { | ||
super(); | ||
if (diff == 1) { | ||
Random random = new Random(); | ||
this.valeur = random.nextInt(25) + 10; | ||
this.valmax = this.valeur; | ||
} | ||
if (diff == 2) { | ||
Random random = new Random(); | ||
this.valeur = random.nextInt(16) + 5; | ||
this.valmax = this.valeur; | ||
} | ||
if (diff == 3) { | ||
Random random = new Random(); | ||
this.valeur = random.nextInt(12) + 2; | ||
this.valmax = this.valeur; | ||
} | ||
} | ||
|
||
/** | ||
* Getter de la classe Arme pour récupérer sa valeur initiale. | ||
* | ||
* | ||
* @return retourne en entier la valeur intiale de l'arme (donc sa puissance de début). | ||
**/ | ||
public int getValInitiaux() | ||
{ | ||
return this.valmax; | ||
} | ||
|
||
/** | ||
* Setter de la classe Arme pour renouveller sa valeur. | ||
* | ||
* @param nouvVal int nouvelle valeur de l'arme. | ||
* @return void. | ||
**/ | ||
public void setValeur(int nouvVal) { | ||
this.valeur = nouvVal; | ||
} | ||
|
||
/** | ||
* Setter de la classe Arme pour renouveller sa valeur max. | ||
* | ||
* @param nouvValmax int nouvelle valeur max de l'arme. | ||
* @return void. | ||
**/ | ||
public void setValeurMax(int nouvValmax) { | ||
this.valmax = nouvValmax; | ||
} | ||
|
||
/** | ||
* Getter de la classe Arme dans le cadre d'une utilisation de JLabel. | ||
* | ||
* | ||
* @return la chaine de caractères "Arme". | ||
**/ | ||
@Override | ||
public String getLabel() { | ||
return "Arme"; | ||
} | ||
|
||
/** | ||
* Getter de la classe Arme pour récupérer sa valeur. | ||
* | ||
* | ||
* @return retourne en entier la valeur de l'arme (donc sa puissance). | ||
**/ | ||
@Override | ||
public int getValeur() { | ||
return this.valeur; | ||
} | ||
|
||
/** Remarques : | ||
* Arme() hérite aussi de public String getLabelPV() mais une Arme n'a pas de PV. | ||
**/ | ||
/** | ||
* Getter de la classe Arme pour récupérer sa description. | ||
* | ||
* | ||
* @return retourne une chaine de caractere, une description de l'arme. | ||
**/ | ||
@Override | ||
public String getDescription() { | ||
return "<html>Une arme basique, <br>je vais pouvoir me <br>défendre des ennemis <br>qui me barreront la route.</html>"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.