|
|
|
@ -7,8 +7,8 @@ import java.util.Random;
|
|
|
|
|
|
|
|
|
|
public class Personnage extends EtreVivant {
|
|
|
|
|
|
|
|
|
|
private Arme arme;
|
|
|
|
|
private Armure armure;
|
|
|
|
|
private int arme =-1;
|
|
|
|
|
private int armure=-1;
|
|
|
|
|
private Bourse bourse;
|
|
|
|
|
private List<Potion> listepotion= new ArrayList<Potion>();
|
|
|
|
|
|
|
|
|
@ -17,13 +17,11 @@ public class Personnage extends EtreVivant {
|
|
|
|
|
this.bourse=new Bourse(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void equiper(Arme arme) {
|
|
|
|
|
arme.setProprietaire(this);
|
|
|
|
|
this.arme=arme;
|
|
|
|
|
public void equiper(Arme arme,Labyrinthe lab) {
|
|
|
|
|
this.arme=lab.listeArme.indexOf(arme);
|
|
|
|
|
}
|
|
|
|
|
public void equiper(Armure armure) {
|
|
|
|
|
armure.setProprietaire(this);
|
|
|
|
|
this.armure=armure;
|
|
|
|
|
public void equiper(Armure armure,Labyrinthe lab) {
|
|
|
|
|
this.armure=lab.listeArmure.indexOf(armure);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void utiliser(Potion potion) {
|
|
|
|
@ -51,11 +49,11 @@ public void equiper(Armure armure) {
|
|
|
|
|
this.pVie=this.pVieMax;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int attaquer(Monstre monstre) {
|
|
|
|
|
if(arme!=null) {
|
|
|
|
|
monstre.pVie=monstre.pVie-(arme.getpArme()+getpAttaque());
|
|
|
|
|
public int attaquer(Monstre monstre,Labyrinthe lab) {
|
|
|
|
|
if(arme>=0) {
|
|
|
|
|
monstre.pVie=monstre.pVie-(lab.listeArme.get(arme).getpArme()+getpAttaque());
|
|
|
|
|
if (monstre.pVie<=0)monstre.setVivant(false);
|
|
|
|
|
return arme.getpArme()+getpAttaque();
|
|
|
|
|
return lab.listeArme.get(arme).getpArme()+getpAttaque();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
monstre.pVie=monstre.pVie-getpAttaque();
|
|
|
|
@ -74,7 +72,7 @@ public void equiper(Armure armure) {
|
|
|
|
|
/**
|
|
|
|
|
* @return the arme
|
|
|
|
|
*/
|
|
|
|
|
public Arme getArme() {
|
|
|
|
|
public int getArme() {
|
|
|
|
|
return arme;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -92,7 +90,7 @@ public void equiper(Armure armure) {
|
|
|
|
|
/**
|
|
|
|
|
* @return the armure
|
|
|
|
|
*/
|
|
|
|
|
public Armure getArmure() {
|
|
|
|
|
public int getArmure() {
|
|
|
|
|
return armure;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|