-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.java
More file actions
91 lines (80 loc) · 1.55 KB
/
Player.java
File metadata and controls
91 lines (80 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import java.util.Scanner;
public class Player {
private String nom;
private int PA;
private int Force;
private int Adresse;
private int Resistance;
private int niv;
private int px;
private int life;
static int lim = 12;
public Player (String nom) {
this.nom = nom;
this.PA = 5;
this.Force = 5;
this.Adresse = 5;
this.Resistance = 5;
this.niv = 1;
this.px = 50;
this.life = 100;
}
public int Deplacer() {
Scanner sc = new Scanner(System.in);
System.out.println("1.Haut 2.Droite 3.Bas 4.Gauche ");
int x = sc.nextInt();
return x;
}
public int CombatP(int degat) {
this.PA = PA-3;
this.life = this.life-degat;
return this.life;
}
public int getlife() {
return this.life;
}
public void setlife(int pls) {
this.life = this.life + pls;
}
public int getPA() {
return this.PA;
}
public int getAdresse() {
return this.Adresse;
}
public int getResistance() {
return this.Resistance;
}
public void setPA(int a) {
if ( this.PA < lim) {
this.PA = this.PA + a;
}
else
System.out.println("Limite de PA atteinte");
}
public void setAdresse(int p) {
this.Adresse = this.Adresse + p;
}
public void setResistance(int p) {
this.Resistance = this.Resistance + p;
}
public void setForce(int p) {
this.Force = this.Force + p;
}
public void RemoveAdresse(int p) {
this.Adresse = this.Adresse - p;
}
public void RemoveResistance(int p) {
this.Resistance = this.Resistance - p;
}
public void RemoveForce(int p) {
this.Force = this.Force - p;
}
public boolean Check(int p) {
boolean g = false;
if (p == 0) {
g = true;
}
return g;
}
}