From a1597252292284aabcf5242ad9103e6bd17367a8 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 16 Apr 2019 15:27:42 +0200 Subject: [PATCH] Modification 1 classes EtreVivant, Monstre, Personnage 3 --- .../src/modeles/EtreVivant.java | 1 + .../src/modeles/Personnage.java | 30 +++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/JAVA/PROJET-PMT_STRI1A/src/modeles/EtreVivant.java b/JAVA/PROJET-PMT_STRI1A/src/modeles/EtreVivant.java index 5b79d15..3117754 100644 --- a/JAVA/PROJET-PMT_STRI1A/src/modeles/EtreVivant.java +++ b/JAVA/PROJET-PMT_STRI1A/src/modeles/EtreVivant.java @@ -117,4 +117,5 @@ public class EtreVivant { + } diff --git a/JAVA/PROJET-PMT_STRI1A/src/modeles/Personnage.java b/JAVA/PROJET-PMT_STRI1A/src/modeles/Personnage.java index 84762fb..7673f46 100644 --- a/JAVA/PROJET-PMT_STRI1A/src/modeles/Personnage.java +++ b/JAVA/PROJET-PMT_STRI1A/src/modeles/Personnage.java @@ -30,11 +30,37 @@ public void equiper(Armure armure) { public void seDeplacer(Salle salle) { this.salle=salle; } - public void allerMarche(Salle salle){ - this.salle=salle; + public void allerMarche(Salle marche){ + this.salle=marche; } public void soin() { this.pVie=this.pVieMax; } + public void attaquer(Monstre monstre) { + if(arme!=null) { + monstre.pVie=monstre.pVie-(arme.getpArme()+getpAttaque()); + } + else { + monstre.pVie=monstre.pVie=getpAttaque(); + } +} + public void getBourse() { + System.out.println(this.getBourse();); + + } + + /** + * @return the arme + */ + public Arme getArme() { + return arme; + } + + /** + * @return the armure + */ + public Armure getArmure() { + return armure; + } }